@e7w/easy-model 0.1.7 → 0.1.8
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/LICENSE.md +9 -9
- package/README.md +233 -530
- package/dist/index.d.ts +5 -6
- package/dist/index.es.js +345 -274
- package/dist/index.umd.js +4 -4
- package/package.json +32 -22
package/dist/index.d.ts
CHANGED
|
@@ -13,16 +13,14 @@ export declare function finalizationRegistry(model: object): {
|
|
|
13
13
|
export declare function useModel<T extends new (...args: any[]) => InstanceType<T>>(Ctor: T, args: ConstructorParameters<T>): InstanceType<T>;
|
|
14
14
|
export declare function useModel<T extends new (...args: any[]) => InstanceType<T>>(Ctor: T, args: ConstructorParameters<T> | null): InstanceType<T> | Partial<InstanceType<T>>;
|
|
15
15
|
export declare function useInstance<T extends object>(model: T): T;
|
|
16
|
-
export
|
|
16
|
+
export declare function useWatcher(...args: Parameters<typeof watch>): void;
|
|
17
17
|
export type AsyncFn<T = unknown> = (...args: any[]) => Promise<T>;
|
|
18
18
|
declare class MLoader {
|
|
19
|
-
loading: Record<symbol,
|
|
20
|
-
Fn,
|
|
21
|
-
Promise<unknown>
|
|
22
|
-
]>;
|
|
19
|
+
loading: Record<symbol, Promise<unknown>>;
|
|
23
20
|
globalLoading: number;
|
|
24
21
|
onceTokens: WeakMap<AsyncFn, symbol>;
|
|
25
22
|
oncePool: Record<symbol, Promise<unknown>>;
|
|
23
|
+
loadingTokens: WeakMap<AsyncFn, symbol>;
|
|
26
24
|
addGlobalLoading(): void;
|
|
27
25
|
subGlobalLoading(): void;
|
|
28
26
|
load(isGlobal?: boolean): <T extends AsyncFn>(target: T, { name }: ClassMethodDecoratorContext) => T;
|
|
@@ -71,7 +69,7 @@ export declare function VInjection<T extends ZodType>({ schema, val, }: {
|
|
|
71
69
|
* @param namespace - 命名空间,默认为空字符串
|
|
72
70
|
* @returns 装饰器函数
|
|
73
71
|
*/
|
|
74
|
-
export declare function inject<T extends ZodType>(schema: T, namespace?: string): (_: unknown, { static: isStatic, kind }: ClassFieldDecoratorContext) => <P extends ReturnType<T["parse"]> | undefined>(initVal: P) => P;
|
|
72
|
+
export declare function inject<T extends ZodType>(schema: T, namespace?: string): (_: unknown, { static: isStatic, kind, name, addInitializer }: ClassFieldDecoratorContext) => <P extends ReturnType<T["parse"]> | undefined>(this: object, initVal: P) => P;
|
|
75
73
|
/**
|
|
76
74
|
* 清理指定命名空间的所有依赖
|
|
77
75
|
*
|
|
@@ -86,5 +84,6 @@ export declare function clearNamespace(namespace: string): void;
|
|
|
86
84
|
* @returns 是否已注册
|
|
87
85
|
*/
|
|
88
86
|
export declare function isRegistered<T extends ZodType>(schema: T, namespace?: string): boolean;
|
|
87
|
+
export declare function config(option: ReactNode): void;
|
|
89
88
|
|
|
90
89
|
export {};
|