UNPKG

@d3vtool/ex-frame

Version:

This library enhances Express.js by providing a more organized structure for web API projects, along with improved control and error handling capabilities.

14 lines (13 loc) 1.23 kB
type AnyFn<T> = (...arg: any[]) => T; export declare function Memoize<T = any>(): (_targetFn: any, _propertyKey?: string, descriptor?: PropertyDescriptor) => PropertyDescriptor; type Milliseconds = number; export declare function Cache(ttl: Milliseconds): (_targetFn: any, _propertyKey?: string, descriptor?: PropertyDescriptor) => PropertyDescriptor; type ErrorFn = (error: unknown) => void; export declare function OnError(fn: ErrorFn): (_targetFn: any, _propertyKey?: string, descriptor?: PropertyDescriptor) => PropertyDescriptor; export declare function Pipe<T>(fn: AnyFn<T>): (_targetFn: any, _propertyKey?: string, descriptor?: PropertyDescriptor) => PropertyDescriptor; type MeasureTimeFn = (time: Milliseconds) => void; export declare function MeasureTime(fn?: MeasureTimeFn): (_targetFn: any, _propertyKey?: string, descriptor?: PropertyDescriptor) => PropertyDescriptor; export declare function Throttle(limit: Milliseconds): (_: any, __: string, descriptor: PropertyDescriptor) => PropertyDescriptor; type DebounceDataFn<T> = (data: T) => void; export declare function Debounce<T = any>(delay: Milliseconds, fn?: DebounceDataFn<T>): (_: any, __: string, descriptor: PropertyDescriptor) => PropertyDescriptor; export {};