lack 1.3.11 → 1.3.13

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.
@@ -129,6 +129,13 @@ declare namespace Whistle {
129
129
  removeProperty(name: string): void;
130
130
  }
131
131
 
132
+ interface SharedStorage {
133
+ getAll: () => Promise<any>;
134
+ setItem: (key: any, value?: any) => Promise<any>;
135
+ getItem: (key: string) => any;
136
+ removeItem: (key: string) => any;
137
+ }
138
+
132
139
  interface PluginOptions {
133
140
  name: string;
134
141
  version: string;
@@ -190,6 +197,7 @@ declare namespace Whistle {
190
197
  Storage: Storage;
191
198
  localStorage: Storage;
192
199
  storage: Storage;
200
+ sharedStorage: SharedStorage;
193
201
  baseUrl: string;
194
202
  LRU: LRUCache;
195
203
  getValue(key: string, cb: (value: string) => void): void;
@@ -209,6 +217,7 @@ declare namespace Whistle {
209
217
  request(opts: any, cb?: Function): any;
210
218
  generateSaz(sessions: Session[]): Buffer;
211
219
  extractSaz(saz: Buffer, cb: (sessions: Session[]) => void): void;
220
+ getTempFilePath(ruleValue: string): string | undefined;
212
221
  [propName: string]: any;
213
222
  }
214
223
 
@@ -229,7 +238,7 @@ declare namespace Whistle {
229
238
  };
230
239
  type PluginReqHandler = (buffer: Buffer | null, next: (result?: PluginNextResult) => void, ctx?: PluginReqCtx) => void;
231
240
  type PluginResHandler = (buffer: Buffer | null, next: (result?: PluginNextResult) => void, ctx?: PluginResCtx) => void;
232
- type PassThroughReq = PluginReqHandler | { [key: string]: any } | null | undefined;
241
+ type PassThroughReq = PluginReqHandler | { [key: string]: any } | string | null | undefined;
233
242
  type PassThroughRes = PluginResHandler | { [key: string]: any } | null | undefined;
234
243
  type PassThrough = (uri?: PassThroughReq, trailers?: PassThroughRes) => void;
235
244
 
@@ -255,6 +264,7 @@ declare namespace Whistle {
255
264
  getFrames: GetFrame;
256
265
  Storage: Storage;
257
266
  localStorage: Storage;
267
+ sharedStorage: SharedStorage;
258
268
  sessionStorage: {
259
269
  set(key: string, value: any): any;
260
270
  get(key: string): any;
@@ -333,6 +343,7 @@ declare namespace Whistle {
333
343
  clientIp: string;
334
344
  Storage: Storage;
335
345
  localStorage: Storage;
346
+ sharedStorage: SharedStorage;
336
347
  }
337
348
 
338
349
  type PluginUIResponse = WhistleBase.Response;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lack",
3
- "version": "1.3.11",
3
+ "version": "1.3.13",
4
4
  "description": "whistle extension tools",
5
5
  "author": "avenwu <avwu@qq.com>",
6
6
  "license": "MIT",