@modern-js/types 2.54.6 → 2.56.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/cli/index.d.ts +15 -0
- package/package.json +4 -4
- package/server/index.d.ts +1 -0
- package/server/monitor.d.ts +36 -0
- package/server/utils.d.ts +1 -1
package/cli/index.d.ts
CHANGED
|
@@ -29,12 +29,27 @@ export interface Entrypoint {
|
|
|
29
29
|
nestedRoutesEntry?: string;
|
|
30
30
|
pageRoutesEntry?: string;
|
|
31
31
|
isAutoMount?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated
|
|
34
|
+
* Using customEntry instead.
|
|
35
|
+
*/
|
|
32
36
|
customBootstrap?: string | false;
|
|
37
|
+
/**
|
|
38
|
+
* use src/{entryName}/entry.tsx to custom entry
|
|
39
|
+
*/
|
|
40
|
+
customEntry?: boolean;
|
|
41
|
+
|
|
42
|
+
customServerEntry?: string | false;
|
|
43
|
+
|
|
33
44
|
fileSystemRoutes?: {
|
|
34
45
|
globalApp?: string | false;
|
|
35
46
|
routes?: any[];
|
|
36
47
|
};
|
|
37
48
|
absoluteEntryDir?: string;
|
|
49
|
+
/**
|
|
50
|
+
* use source.entries to custom entry
|
|
51
|
+
*/
|
|
52
|
+
isCustomSourceEntry?: boolean;
|
|
38
53
|
}
|
|
39
54
|
|
|
40
55
|
/**
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.56.0",
|
|
19
19
|
"types": "./index.d.ts",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@types/babel__core": "^7.20.
|
|
42
|
+
"@types/babel__core": "^7.20.5",
|
|
43
43
|
"@types/jest": "^29",
|
|
44
44
|
"@types/node": "^14",
|
|
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.56.0",
|
|
49
|
+
"@scripts/jest-config": "2.56.0"
|
|
50
50
|
},
|
|
51
51
|
"sideEffects": false,
|
|
52
52
|
"publishConfig": {
|
package/server/index.d.ts
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/method-signature-style */
|
|
2
|
+
/** Monitor Events */
|
|
3
|
+
export type LogLevel = 'warn' | 'error' | 'debug' | 'info';
|
|
4
|
+
|
|
5
|
+
export interface LogEvent {
|
|
6
|
+
type: 'log';
|
|
7
|
+
payload: {
|
|
8
|
+
level: LogLevel;
|
|
9
|
+
message: string;
|
|
10
|
+
args?: any[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TimingEvent {
|
|
15
|
+
type: 'timing';
|
|
16
|
+
payload: {
|
|
17
|
+
name: string;
|
|
18
|
+
dur: number;
|
|
19
|
+
desc?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type MonitorEvent = LogEvent | TimingEvent;
|
|
24
|
+
|
|
25
|
+
export type CoreMonitor = (event: MonitorEvent) => void;
|
|
26
|
+
|
|
27
|
+
export interface Monitors {
|
|
28
|
+
push(monitor: CoreMonitor): void;
|
|
29
|
+
|
|
30
|
+
error(message: string, ...args: any[]): void;
|
|
31
|
+
warn(message: string, ...args: any[]): void;
|
|
32
|
+
debug(message: string, ...args: any[]): void;
|
|
33
|
+
info(message: string, ...args: any[]): void;
|
|
34
|
+
|
|
35
|
+
timing(name: string, dur: number, desc?: string): void;
|
|
36
|
+
}
|
package/server/utils.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ export type CacheControl = {
|
|
|
103
103
|
|
|
104
104
|
export type CacheOptionProvider = (
|
|
105
105
|
req: IncomingMessage,
|
|
106
|
-
) => Promise<CacheControl> | CacheControl;
|
|
106
|
+
) => Promise<CacheControl | false> | CacheControl | false;
|
|
107
107
|
|
|
108
108
|
export type CacheOption =
|
|
109
109
|
| false
|