UNPKG

@alauda-fe/common

Version:

Alauda frontend team common codes.

15 lines (14 loc) 1.23 kB
/** * @packageDocumentation * @module utils */ import { DebounceSettings, DebouncedFunc } from 'lodash-es'; import { ObservableType } from '../types/public-api'; export declare function ValueHook<T = any, K extends keyof T = any>(setter?: (this: T, value?: T[K]) => boolean | void, getter?: (this: T, value?: T[K]) => T[K], afterSetter?: (this: T, value?: T[K]) => void): (target: T, propertyKey: K) => void; export type ObservableInputPropertyKey<T> = T extends `${infer R}$` ? ObservableInputPropertyKey<R> : T; export declare function ObservableInput<T = any, OK extends keyof T = any, K extends keyof T = ObservableInputPropertyKey<OK> & keyof T>(propertyKey?: K | boolean, initialValue?: ObservableType<T[OK]>): (target: T, oPropertyKey: OK) => void; /** * @see https://github.com/NoHomey/bind-decorator */ export declare function bind<T extends Function>(_target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void; export declare function debounceFn<T extends (...args: any) => any>(delay?: number, options?: DebounceSettings): (_target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<DebouncedFunc<T>> | void;