native-document 1.0.52 → 1.0.53
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/.npmrc.example +1 -0
- package/package.json +2 -2
- package/types/service.d.ts +13 -3
package/.npmrc.example
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
package/package.json
CHANGED
package/types/service.d.ts
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
type ServiceFactory<T> = () => T;
|
|
2
2
|
type MemoizedFactory<T, Args extends any[]> = (...args: Args) => T;
|
|
3
3
|
|
|
4
|
+
type OnceProxy<T> = {
|
|
5
|
+
[K in keyof T]: T[K];
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type MemoizeProxy<T> = {
|
|
9
|
+
[key: string]: T;
|
|
10
|
+
[key: symbol]: T;
|
|
11
|
+
};
|
|
12
|
+
|
|
4
13
|
interface ServiceStatic {
|
|
14
|
+
once<T extends object>(fn: ServiceFactory<T>): OnceProxy<T>;
|
|
5
15
|
|
|
6
|
-
|
|
16
|
+
memoize<T>(fn: () => T): MemoizeProxy<T>;
|
|
7
17
|
|
|
8
18
|
memoize<T, Args extends any[]>(
|
|
9
|
-
fn:
|
|
10
|
-
):
|
|
19
|
+
fn: (...args: Args) => T
|
|
20
|
+
): MemoizeProxy<(...args: Args) => T>;
|
|
11
21
|
}
|
|
12
22
|
|
|
13
23
|
export const Service: ServiceStatic;
|