utils-lib-js 2.2.0 → 2.3.1
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/dist/bundle/function.d.ts +1 -1
- package/dist/bundle/types.d.ts +5 -5
- package/dist/cjs/function.d.ts +1 -1
- package/dist/cjs/types.d.ts +5 -5
- package/dist/esm/function.d.ts +1 -1
- package/dist/esm/types.d.ts +5 -5
- package/dist/umd/function.d.ts +1 -1
- package/dist/umd/types.d.ts +5 -5
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICatchAwait,
|
|
1
|
+
import { ICatchAwait, IDebounce, IDefer, IRequestFrame, IThrottle } from "./types";
|
|
2
2
|
export declare const throttle: IThrottle;
|
|
3
3
|
export declare const debounce: IDebounce;
|
|
4
4
|
export declare const defer: IDefer;
|
package/dist/bundle/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type IKey = string | symbol | number;
|
|
2
2
|
export type IObject<V = any, K extends string | number | symbol = IKey> = Record<K, V>;
|
|
3
|
-
export interface IPromise
|
|
4
|
-
promise
|
|
5
|
-
resolve
|
|
6
|
-
reject
|
|
3
|
+
export interface IPromise<T = any> {
|
|
4
|
+
promise: Promise<T>;
|
|
5
|
+
resolve: (res?: T) => unknown;
|
|
6
|
+
reject: (err?: any) => unknown;
|
|
7
7
|
}
|
|
8
8
|
export type IInstance<T> = {
|
|
9
9
|
_instance: Function;
|
|
@@ -28,7 +28,7 @@ export type IStringToJson = (target: string) => IObject<any> | null;
|
|
|
28
28
|
export type IJsonToString = (target: IObject<any>) => string;
|
|
29
29
|
export type IThrottle = (fn: Function, time: number) => (...args: any[]) => void;
|
|
30
30
|
export type IDebounce = (fn: Function, time: number) => (...args: any[]) => void;
|
|
31
|
-
export type IDefer = (timer?: number) => IPromise
|
|
31
|
+
export type IDefer = <T>(timer?: number) => IPromise<T>;
|
|
32
32
|
export type ICatchAwait<T extends Promise<any>> = (defer: T) => T;
|
|
33
33
|
export type IRequestFrame = (callback: (start: number) => void, delay: number) => () => void;
|
|
34
34
|
export type IArrayRandom<T extends any[]> = (arr: T) => T;
|
package/dist/cjs/function.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICatchAwait,
|
|
1
|
+
import { ICatchAwait, IDebounce, IDefer, IRequestFrame, IThrottle } from "./types";
|
|
2
2
|
export declare const throttle: IThrottle;
|
|
3
3
|
export declare const debounce: IDebounce;
|
|
4
4
|
export declare const defer: IDefer;
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type IKey = string | symbol | number;
|
|
2
2
|
export type IObject<V = any, K extends string | number | symbol = IKey> = Record<K, V>;
|
|
3
|
-
export interface IPromise
|
|
4
|
-
promise
|
|
5
|
-
resolve
|
|
6
|
-
reject
|
|
3
|
+
export interface IPromise<T = any> {
|
|
4
|
+
promise: Promise<T>;
|
|
5
|
+
resolve: (res?: T) => unknown;
|
|
6
|
+
reject: (err?: any) => unknown;
|
|
7
7
|
}
|
|
8
8
|
export type IInstance<T> = {
|
|
9
9
|
_instance: Function;
|
|
@@ -28,7 +28,7 @@ export type IStringToJson = (target: string) => IObject<any> | null;
|
|
|
28
28
|
export type IJsonToString = (target: IObject<any>) => string;
|
|
29
29
|
export type IThrottle = (fn: Function, time: number) => (...args: any[]) => void;
|
|
30
30
|
export type IDebounce = (fn: Function, time: number) => (...args: any[]) => void;
|
|
31
|
-
export type IDefer = (timer?: number) => IPromise
|
|
31
|
+
export type IDefer = <T>(timer?: number) => IPromise<T>;
|
|
32
32
|
export type ICatchAwait<T extends Promise<any>> = (defer: T) => T;
|
|
33
33
|
export type IRequestFrame = (callback: (start: number) => void, delay: number) => () => void;
|
|
34
34
|
export type IArrayRandom<T extends any[]> = (arr: T) => T;
|
package/dist/esm/function.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICatchAwait,
|
|
1
|
+
import { ICatchAwait, IDebounce, IDefer, IRequestFrame, IThrottle } from "./types";
|
|
2
2
|
export declare const throttle: IThrottle;
|
|
3
3
|
export declare const debounce: IDebounce;
|
|
4
4
|
export declare const defer: IDefer;
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type IKey = string | symbol | number;
|
|
2
2
|
export type IObject<V = any, K extends string | number | symbol = IKey> = Record<K, V>;
|
|
3
|
-
export interface IPromise
|
|
4
|
-
promise
|
|
5
|
-
resolve
|
|
6
|
-
reject
|
|
3
|
+
export interface IPromise<T = any> {
|
|
4
|
+
promise: Promise<T>;
|
|
5
|
+
resolve: (res?: T) => unknown;
|
|
6
|
+
reject: (err?: any) => unknown;
|
|
7
7
|
}
|
|
8
8
|
export type IInstance<T> = {
|
|
9
9
|
_instance: Function;
|
|
@@ -28,7 +28,7 @@ export type IStringToJson = (target: string) => IObject<any> | null;
|
|
|
28
28
|
export type IJsonToString = (target: IObject<any>) => string;
|
|
29
29
|
export type IThrottle = (fn: Function, time: number) => (...args: any[]) => void;
|
|
30
30
|
export type IDebounce = (fn: Function, time: number) => (...args: any[]) => void;
|
|
31
|
-
export type IDefer = (timer?: number) => IPromise
|
|
31
|
+
export type IDefer = <T>(timer?: number) => IPromise<T>;
|
|
32
32
|
export type ICatchAwait<T extends Promise<any>> = (defer: T) => T;
|
|
33
33
|
export type IRequestFrame = (callback: (start: number) => void, delay: number) => () => void;
|
|
34
34
|
export type IArrayRandom<T extends any[]> = (arr: T) => T;
|
package/dist/umd/function.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICatchAwait,
|
|
1
|
+
import { ICatchAwait, IDebounce, IDefer, IRequestFrame, IThrottle } from "./types";
|
|
2
2
|
export declare const throttle: IThrottle;
|
|
3
3
|
export declare const debounce: IDebounce;
|
|
4
4
|
export declare const defer: IDefer;
|
package/dist/umd/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type IKey = string | symbol | number;
|
|
2
2
|
export type IObject<V = any, K extends string | number | symbol = IKey> = Record<K, V>;
|
|
3
|
-
export interface IPromise
|
|
4
|
-
promise
|
|
5
|
-
resolve
|
|
6
|
-
reject
|
|
3
|
+
export interface IPromise<T = any> {
|
|
4
|
+
promise: Promise<T>;
|
|
5
|
+
resolve: (res?: T) => unknown;
|
|
6
|
+
reject: (err?: any) => unknown;
|
|
7
7
|
}
|
|
8
8
|
export type IInstance<T> = {
|
|
9
9
|
_instance: Function;
|
|
@@ -28,7 +28,7 @@ export type IStringToJson = (target: string) => IObject<any> | null;
|
|
|
28
28
|
export type IJsonToString = (target: IObject<any>) => string;
|
|
29
29
|
export type IThrottle = (fn: Function, time: number) => (...args: any[]) => void;
|
|
30
30
|
export type IDebounce = (fn: Function, time: number) => (...args: any[]) => void;
|
|
31
|
-
export type IDefer = (timer?: number) => IPromise
|
|
31
|
+
export type IDefer = <T>(timer?: number) => IPromise<T>;
|
|
32
32
|
export type ICatchAwait<T extends Promise<any>> = (defer: T) => T;
|
|
33
33
|
export type IRequestFrame = (callback: (start: number) => void, delay: number) => () => void;
|
|
34
34
|
export type IArrayRandom<T extends any[]> = (arr: T) => T;
|