Detects when user changes same config setting 3+ times within 24 hours. Shows non-intrusive prompt offering help with guided calibration flow. Guided calibration features: - Test for false positives (walk around room) - Test for missed motion (sit still) - Suggest optimal value based on diurnal baseline SNR and link health - Apply suggested value button Files: - dashboard/js/proactive.js: Complete implementation with localStorage tracking Acceptance: - Help prompt fires after 3+ changes in 24h - Calibration flow tests both directions - Suggests value based on system data - Apply button works
54 lines
1.2 KiB
TypeScript
54 lines
1.2 KiB
TypeScript
declare const mimicFn: {
|
|
/**
|
|
Make a function mimic another one. It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set.
|
|
|
|
@param to - Mimicking function.
|
|
@param from - Function to mimic.
|
|
@returns The modified `to` function.
|
|
|
|
@example
|
|
```
|
|
import mimicFn = require('mimic-fn');
|
|
|
|
function foo() {}
|
|
foo.unicorn = '🦄';
|
|
|
|
function wrapper() {
|
|
return foo();
|
|
}
|
|
|
|
console.log(wrapper.name);
|
|
//=> 'wrapper'
|
|
|
|
mimicFn(wrapper, foo);
|
|
|
|
console.log(wrapper.name);
|
|
//=> 'foo'
|
|
|
|
console.log(wrapper.unicorn);
|
|
//=> '🦄'
|
|
```
|
|
*/
|
|
<
|
|
ArgumentsType extends unknown[],
|
|
ReturnType,
|
|
FunctionType extends (...arguments: ArgumentsType) => ReturnType
|
|
>(
|
|
to: (...arguments: ArgumentsType) => ReturnType,
|
|
from: FunctionType
|
|
): FunctionType;
|
|
|
|
// TODO: Remove this for the next major release, refactor the whole definition to:
|
|
// declare function mimicFn<
|
|
// ArgumentsType extends unknown[],
|
|
// ReturnType,
|
|
// FunctionType extends (...arguments: ArgumentsType) => ReturnType
|
|
// >(
|
|
// to: (...arguments: ArgumentsType) => ReturnType,
|
|
// from: FunctionType
|
|
// ): FunctionType;
|
|
// export = mimicFn;
|
|
default: typeof mimicFn;
|
|
};
|
|
|
|
export = mimicFn;
|