@tinywork/glass 0.0.16 → 0.0.18
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/dist/index.d.ts +4 -5
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import fs from 'node:fs';
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import http from 'node:http';
|
|
5
5
|
import https from 'node:https';
|
|
6
|
+
import querystring from 'node:querystring';
|
|
6
7
|
import axios from 'axios';
|
|
7
8
|
import { BrowserWindow, type MenuItemConstructorOptions, type Session } from 'electron';
|
|
8
9
|
export type DocSchema = {
|
|
@@ -50,10 +51,6 @@ export interface IProgress {
|
|
|
50
51
|
export interface IGlassContext {
|
|
51
52
|
getItem: <T>(key: string) => Promise<T>;
|
|
52
53
|
setItem: <T>(key: string, value: T) => Promise<void>;
|
|
53
|
-
onItemChange?: <T>(key: string, cb: (params: {
|
|
54
|
-
key: string;
|
|
55
|
-
value: T;
|
|
56
|
-
}) => void) => void;
|
|
57
54
|
saveGroup: (group: GroupSchema) => Promise<{
|
|
58
55
|
success: boolean;
|
|
59
56
|
message?: string;
|
|
@@ -94,6 +91,8 @@ export interface IGlassExtension {
|
|
|
94
91
|
req: http.IncomingMessage;
|
|
95
92
|
res: http.ServerResponse;
|
|
96
93
|
}): Promise<void>;
|
|
94
|
+
/** 在postMessage到页面之前 */
|
|
95
|
+
onMessagePost?(context: IGlassContext, message: Partial<NetLog>): Promise<void>;
|
|
97
96
|
onResponse?(context: IGlassContext, params: {
|
|
98
97
|
url: URL;
|
|
99
98
|
req: http.IncomingMessage;
|
|
@@ -117,4 +116,4 @@ export interface IGlassExtension {
|
|
|
117
116
|
apiId: string;
|
|
118
117
|
}>): Promise<void>;
|
|
119
118
|
}
|
|
120
|
-
export { fs, path, http, https, axios, BrowserWindow, type Session };
|
|
119
|
+
export { fs, querystring, path, http, https, axios, BrowserWindow, type Session };
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import http from 'node:http';
|
|
4
4
|
import https from 'node:https';
|
|
5
|
+
import querystring from 'node:querystring';
|
|
5
6
|
import axios from 'axios';
|
|
6
7
|
import { BrowserWindow } from 'electron';
|
|
7
|
-
export { fs, path, http, https, axios, BrowserWindow };
|
|
8
|
+
export { fs, querystring, path, http, https, axios, BrowserWindow };
|