@luminix/support 0.1.0-beta.1 → 0.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminix/support",
3
- "version": "0.1.0-beta.1",
3
+ "version": "0.1.0-beta.3",
4
4
  "module": "dist/support.js",
5
5
  "types": "types/index.d.ts",
6
6
  "type": "module",
package/types/Func.d.ts CHANGED
@@ -1,7 +1,39 @@
1
- import { DebouncedFunc, DebounceSettings, ThrottleSettings } from 'lodash-es';
2
1
  export declare class FuncMacros {
3
2
  [x: string]: (...args: any[]) => any;
4
3
  }
4
+ interface DebouncedFunc<T extends (...args: any[]) => any> {
5
+ /**
6
+ * Call the original function, but applying the debounce rules.
7
+ *
8
+ * If the debounced function can be run immediately, this calls it and returns its return
9
+ * value.
10
+ *
11
+ * Otherwise, it returns the return value of the last invocation, or undefined if the debounced
12
+ * function was not invoked yet.
13
+ */
14
+ (...args: Parameters<T>): ReturnType<T> | undefined;
15
+ /**
16
+ * Throw away any pending invocation of the debounced function.
17
+ */
18
+ cancel(): void;
19
+ /**
20
+ * If there is a pending invocation of the debounced function, invoke it immediately and return
21
+ * its return value.
22
+ *
23
+ * Otherwise, return the value from the last invocation, or undefined if the debounced function
24
+ * was never invoked.
25
+ */
26
+ flush(): ReturnType<T> | undefined;
27
+ }
28
+ interface DebounceSettings {
29
+ leading?: boolean | undefined;
30
+ maxWait?: number | undefined;
31
+ trailing?: boolean | undefined;
32
+ }
33
+ interface ThrottleSettings {
34
+ leading?: boolean | undefined;
35
+ trailing?: boolean | undefined;
36
+ }
5
37
  declare class FuncStatic {
6
38
  throttle<T extends (...args: any) => any>(func: T, wait?: number, options?: ThrottleSettings): DebouncedFunc<T>;
7
39
  debounce<T extends (...args: any) => any>(func: T, wait?: number, options?: DebounceSettings): DebouncedFunc<T>;
package/types/index.d.ts CHANGED
@@ -24,7 +24,7 @@ export type { ArrMacros } from './Arr';
24
24
  export type { DateTimeMacros } from './DateTime';
25
25
  export type { FuncMacros } from './Func';
26
26
  export type { ObjMacros } from './Obj';
27
- export type { QueryMacros } from './Query';
27
+ export type { QueryMacros, Operator } from './Query';
28
28
  export type { StrMacros } from './Str';
29
29
  export type { ApplicationInterface, ApplicationEvents } from './App/Interfaces';
30
30
  export type { Event, EventMap, EventMapOf, EventsOf, EventCallbackOf } from './Contracts/EventSource';