lack 1.3.1 → 1.3.2

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.
@@ -5,11 +5,11 @@ import { ParsedUrlQuery } from 'querystring';
5
5
  import { Socket } from 'net';
6
6
 
7
7
  declare global {
8
- namespace WhistleBase {
9
- class Request extends IncomingMessage {}
10
- class Response extends ServerResponse {}
11
- class HttpServer extends Server {}
12
- class Socks extends Socket {}
13
- type UrlQuery = ParsedUrlQuery;
14
- }
8
+ namespace WhistleBase {
9
+ class Request extends IncomingMessage {}
10
+ class Response extends ServerResponse {}
11
+ class HttpServer extends Server {}
12
+ class Socks extends Socket {}
13
+ type UrlQuery = ParsedUrlQuery;
14
+ }
15
15
  }
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/triple-slash-reference, @typescript-eslint/naming-convention */
2
+
1
3
  /// <reference path="base.d.ts" />
2
4
 
3
5
  declare module 'koa-onerror';
@@ -6,42 +8,42 @@ declare namespace Whistle {
6
8
  type Body = string | false;
7
9
 
8
10
  interface LRUOptions<K = any, V = any> {
9
- max?: number;
10
- maxAge?: number;
11
- length?(value: V, key?: K): number;
12
- dispose?(key: K, value: V): void;
13
- stale?: boolean;
14
- noDisposeOnSet?: boolean;
15
- }
11
+ max?: number;
12
+ maxAge?: number;
13
+ length?(value: V, key?: K): number;
14
+ dispose?(key: K, value: V): void;
15
+ stale?: boolean;
16
+ noDisposeOnSet?: boolean;
17
+ }
16
18
 
17
- interface LRUEntry<K, V> {
18
- k: K;
19
- v: V;
20
- e: number;
21
- }
19
+ interface LRUEntry<K, V> {
20
+ k: K;
21
+ v: V;
22
+ e: number;
23
+ }
22
24
 
23
- interface LRUCache<K = any, V = any> {
24
- new (options?: LRUOptions<K, V>): this;
25
- readonly length: number;
26
- readonly itemCount: number;
27
- allowStale: boolean;
28
- lengthCalculator(value: V): number;
29
- max: number;
30
- maxAge: number;
31
- set(key: K, value: V, maxAge?: number): boolean;
32
- get(key: K): V;
33
- peek(key: K): V;
34
- has(key: K): boolean;
35
- del(key: K): void;
36
- reset(): void;
37
- prune(): void;
38
- forEach<T = this>(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void;
39
- rforEach<T = this>(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void;
40
- keys(): K[];
41
- values(): V[];
42
- dump(): Array<LRUEntry<K, V>>;
43
- load(cacheEntries: ReadonlyArray<LRUEntry<K, V>>): void;
44
- }
25
+ interface LRUCache<K = any, V = any> {
26
+ new (options?: LRUOptions<K, V>): this;
27
+ readonly length: number;
28
+ readonly itemCount: number;
29
+ allowStale: boolean;
30
+ lengthCalculator(value: V): number;
31
+ max: number;
32
+ maxAge: number;
33
+ set(key: K, value: V, maxAge?: number): boolean;
34
+ get(key: K): V;
35
+ peek(key: K): V;
36
+ has(key: K): boolean;
37
+ del(key: K): void;
38
+ reset(): void;
39
+ prune(): void;
40
+ forEach<T = this>(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void;
41
+ rforEach<T = this>(callbackFn: (this: T, value: V, key: K, cache: this) => void, thisArg?: T): void;
42
+ keys(): K[];
43
+ values(): V[];
44
+ dump(): Array<LRUEntry<K, V>>;
45
+ load(cacheEntries: ReadonlyArray<LRUEntry<K, V>>): void;
46
+ }
45
47
 
46
48
  interface Frame {
47
49
  reqId: string;
@@ -303,10 +305,10 @@ declare namespace Whistle {
303
305
  }
304
306
 
305
307
  class PluginServerSocket extends WhistleBase.Socks {
306
- setReqRules: SetRules;
307
- setResRules: SetRules;
308
- disableTrailers?: boolean;
309
- }
308
+ setReqRules: SetRules;
309
+ setResRules: SetRules;
310
+ disableTrailers?: boolean;
311
+ }
310
312
  class PluginUIRequest extends WhistleBase.Request {
311
313
  clientIp: string;
312
314
  Storage: Storage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lack",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "whistle extension tools",
5
5
  "author": "avenwu <avwu@qq.com>",
6
6
  "license": "MIT",