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 ADDED
@@ -0,0 +1 @@
1
+ //registry.npmjs.org/:_authToken=${NPM_TOKEN}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-document",
3
- "version": "1.0.52",
3
+ "version": "1.0.53",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -18,4 +18,4 @@
18
18
  "eslint": "^9.33.0",
19
19
  "rollup": "^4.53.3"
20
20
  }
21
- }
21
+ }
@@ -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
- once<T>(fn: ServiceFactory<T>): ServiceFactory<T>;
16
+ memoize<T>(fn: () => T): MemoizeProxy<T>;
7
17
 
8
18
  memoize<T, Args extends any[]>(
9
- fn: MemoizedFactory<T, Args>
10
- ): MemoizedFactory<T, Args>;
19
+ fn: (...args: Args) => T
20
+ ): MemoizeProxy<(...args: Args) => T>;
11
21
  }
12
22
 
13
23
  export const Service: ServiceStatic;