@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
17 lines (16 loc) • 863 B
TypeScript
/** Function that does nothing */
export declare const noop: AnyToVoidFnSignature;
/** Function that returns the first argument */
export declare const identity: <T>(arg: T) => T;
export type NoopFnSignature = () => void;
export type AnyToVoidFnSignature = (...args: any[]) => void;
export type AnyToAnyFnSignature = (...args: any[]) => any;
export type MethodTypedDecorator<T> = (target: any, property: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
export type Predicate<T> = (el: T) => boolean;
/**
* Property provider function
* @param that - (equal to `this` context) host or context
*/
export type PropertyProvider<T> = (this: unknown, that: unknown) => T;
/** Resolves {@link PropertyProvider} function to the value */
export declare const resolveProperty: <T>(val: T | PropertyProvider<T>, origin: unknown) => T;