@modern-js/types 2.43.0 → 2.44.0
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 +3 -3
- package/server/hook.d.ts +10 -0
- package/server/utils.d.ts +4 -4
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.44.0",
|
|
19
19
|
"types": "./index.d.ts",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"http-proxy-middleware": "^2.0.4",
|
|
46
46
|
"jest": "^29",
|
|
47
47
|
"type-fest": "2.15.0",
|
|
48
|
-
"@scripts/build": "2.
|
|
49
|
-
"@scripts/jest-config": "2.
|
|
48
|
+
"@scripts/build": "2.44.0",
|
|
49
|
+
"@scripts/jest-config": "2.44.0"
|
|
50
50
|
},
|
|
51
51
|
"sideEffects": false,
|
|
52
52
|
"publishConfig": {
|
package/server/hook.d.ts
CHANGED
|
@@ -68,6 +68,16 @@ export type AfterRenderContext = HookContext & {
|
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
+
export type AfterStreamingRenderContext = HookContext & {
|
|
72
|
+
route?: Partial<
|
|
73
|
+
Pick<
|
|
74
|
+
ServerRoute,
|
|
75
|
+
'entryName' | 'bundle' | 'isSPA' | 'isSSR' | 'urlPath' | 'entryPath'
|
|
76
|
+
>
|
|
77
|
+
>;
|
|
78
|
+
chunk: string;
|
|
79
|
+
};
|
|
80
|
+
|
|
71
81
|
export type MiddlewareContext<T extends 'worker' | 'node' = 'node'> =
|
|
72
82
|
HookContext & {
|
|
73
83
|
reporter?: Reporter;
|
package/server/utils.d.ts
CHANGED
|
@@ -108,13 +108,13 @@ export type CacheOption =
|
|
|
108
108
|
|
|
109
109
|
export interface Container<K = string, V = string> {
|
|
110
110
|
/**
|
|
111
|
-
* Returns a specified element from the
|
|
111
|
+
* Returns a specified element from the container. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Container.
|
|
112
112
|
* @returns Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
|
|
113
113
|
*/
|
|
114
114
|
get: (key: K) => Promise<V | undefined>;
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
|
-
* Adds a new element with a specified key and value to the
|
|
117
|
+
* Adds a new element with a specified key and value to the container. If an element with the same key already exists, the element will be updated.
|
|
118
118
|
*/
|
|
119
119
|
set: (key: K, value: V, options?: { ttl?: number }) => Promise<this>;
|
|
120
120
|
|
|
@@ -124,9 +124,9 @@ export interface Container<K = string, V = string> {
|
|
|
124
124
|
has: (key: K) => Promise<boolean>;
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
|
-
* @returns true if an element in the
|
|
127
|
+
* @returns true if an element in the container existed and has been removed, or false if the element does not exist.
|
|
128
128
|
*/
|
|
129
129
|
delete: (key: K) => Promise<boolean>;
|
|
130
130
|
|
|
131
|
-
forEach?: (callbackFn: (v: V, k: K,
|
|
131
|
+
forEach?: (callbackFn: (v: V, k: K, container: this) => void) => void;
|
|
132
132
|
}
|