import { AnyFn, MaybeAccessor, ArgumentsType, Pausable } from './types.js'; import 'solid-js'; import 'solid-js/types/reactive/signal'; type FunctionArgs = (...args: Args) => Return; interface FunctionWrapperOptions { fn: FunctionArgs; args: Args; thisArg: This; } type EventFilter = (invoke: Invoke, options: FunctionWrapperOptions) => ReturnType | Promise>; interface ConfigurableEventFilter { /** * Filter for if events should to be received. * * */ eventFilter?: EventFilter; } interface DebounceFilterOptions { /** * The maximum time allowed to be delayed before it's invoked. * In milliseconds. */ maxWait?: MaybeAccessor; /** * Whether to reject the last call if it's been cancel. * * @default false */ rejectOnCancel?: boolean; } /** * @internal */ declare function createFilterWrapper(filter: EventFilter, fn: T): (this: any, ...args: ArgumentsType) => Promise>; declare const bypassFilter: EventFilter; /** * Create an EventFilter that debounce the events * * @param ms * @param options */ declare function debounceFilter(ms: MaybeAccessor, options?: DebounceFilterOptions): EventFilter; /** * Create an EventFilter that throttle the events * * @param ms * @param [trailing=true] * @param [leading=true] * @param [rejectOnCancel=false] */ declare function throttleFilter(ms: MaybeAccessor, trailing?: boolean, leading?: boolean, rejectOnCancel?: boolean): EventFilter; /** * EventFilter that gives extra controls to pause and resume the filter * * @param extendFilter Extra filter to apply when the PausableFilter is active, default to none * */ declare function pausableFilter(extendFilter?: EventFilter): Pausable & { eventFilter: EventFilter; }; export { ConfigurableEventFilter, DebounceFilterOptions, EventFilter, FunctionArgs, FunctionWrapperOptions, bypassFilter, createFilterWrapper, debounceFilter, pausableFilter, throttleFilter };