ddan-js 3.9.0 → 3.9.1

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.
@@ -19,20 +19,27 @@ declare class Fetch {
19
19
  cache?: RequestCache;
20
20
  }): Promise<string>;
21
21
  formatError(response: Response | null, responseText: string | null, networkError?: any): any;
22
+ ask(url: string, args?: {
23
+ params?: Record<string, any>;
24
+ method?: 'POST' | 'GET';
25
+ baseURL?: string;
26
+ headers?: Record<string, string>;
27
+ cache?: RequestCache;
28
+ }): Promise<[null, any] | [any, undefined]>;
22
29
  }
23
30
  declare const _default: {
24
- getDataURL: (url: string, cache?: RequestCache | undefined) => Promise<[null, {
31
+ getDataURL: (url: string, init?: RequestInit | undefined) => Promise<[any, undefined] | [null, {
25
32
  contentType: string;
26
33
  dataUrl: string;
27
- }] | [any, undefined]>;
28
- getArrayBuffer: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, ArrayBuffer]>;
29
- getJson: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, any]>;
34
+ }]>;
35
+ getArrayBuffer: (url: string, init?: RequestInit | undefined) => Promise<[any, undefined] | [null, ArrayBuffer]>;
36
+ getJson: (url: string, init?: RequestInit | undefined) => Promise<[null, any] | [any, undefined]>;
30
37
  download: (url: string, opts?: {
31
38
  success?: ((buffer: Uint8Array) => void) | undefined;
32
39
  progress?: ((percentage: number, current: number, total: number) => void) | undefined;
33
40
  fail?: ((error: Error) => void) | undefined;
34
41
  }) => Promise<Uint8Array | undefined>;
35
- getText: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, string]>;
42
+ getText: (url: string, init?: RequestInit | undefined) => Promise<[any, undefined] | [null, string]>;
36
43
  cache: (url: string, cache?: RequestCache) => Promise<[any, undefined] | [null, boolean]>;
37
44
  Fetch: typeof Fetch;
38
45
  };
@@ -10,5 +10,6 @@ declare const _default: {
10
10
  getValueIf: <T_3 = any, F = any>(condition: boolean | (() => boolean), trueValue: T_3 | (() => T_3), falseValue?: F | (() => F) | undefined) => T_3 | F | undefined;
11
11
  resolveValue: <T_4 = any>(value: T_4 | (() => T_4)) => T_4;
12
12
  compareVersion: (ver1: string, ver2: string) => 0 | 1 | -1;
13
+ toOpen: (content: string, defaultOpen?: boolean) => boolean;
13
14
  };
14
15
  export default _default;
@@ -52,5 +52,6 @@ declare const _default: {
52
52
  getValueIf: <T_5 = any, F = any>(condition: boolean | (() => boolean), trueValue: T_5 | (() => T_5), falseValue?: F | (() => F) | undefined) => T_5 | F | undefined;
53
53
  resolveValue: <T_6 = any>(value: T_6 | (() => T_6)) => T_6;
54
54
  compareVersion: (ver1: string, ver2: string) => 0 | 1 | -1;
55
+ toOpen: (content: string, defaultOpen?: boolean) => boolean;
55
56
  };
56
57
  export default _default;
@@ -156,6 +156,7 @@ declare const dHook: {
156
156
  getValueIf: <T_9 = any, F = any>(condition: boolean | (() => boolean), trueValue: T_9 | (() => T_9), falseValue?: F | (() => F) | undefined) => T_9 | F | undefined;
157
157
  resolveValue: <T_10 = any>(value: T_10 | (() => T_10)) => T_10;
158
158
  compareVersion: (ver1: string, ver2: string) => 0 | 1 | -1;
159
+ toOpen: (content: string, defaultOpen?: boolean) => boolean;
159
160
  base64: {
160
161
  encode: (input: string) => string;
161
162
  decode: (base64Str: string) => string;
package/bin/tiny/web.d.ts CHANGED
@@ -2,18 +2,18 @@ import Http from '../modules/http';
2
2
  declare const dWeb: {
3
3
  Ecdh: typeof import("../modules/browser/ecdh").default;
4
4
  fetch: {
5
- getDataURL: (url: string, cache?: RequestCache | undefined) => Promise<[null, {
5
+ getDataURL: (url: string, init?: RequestInit | undefined) => Promise<[null, {
6
6
  contentType: string;
7
7
  dataUrl: string;
8
8
  }] | [any, undefined]>;
9
- getArrayBuffer: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, ArrayBuffer]>;
10
- getJson: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, any]>;
9
+ getArrayBuffer: (url: string, init?: RequestInit | undefined) => Promise<[any, undefined] | [null, ArrayBuffer]>;
10
+ getJson: (url: string, init?: RequestInit | undefined) => Promise<[any, undefined] | [null, any]>;
11
11
  download: (url: string, opts?: {
12
12
  success?: ((buffer: Uint8Array) => void) | undefined;
13
13
  progress?: ((percentage: number, current: number, total: number) => void) | undefined;
14
14
  fail?: ((error: Error) => void) | undefined;
15
15
  }) => Promise<Uint8Array | undefined>;
16
- getText: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, string]>;
16
+ getText: (url: string, init?: RequestInit | undefined) => Promise<[any, undefined] | [null, string]>;
17
17
  cache: (url: string, cache?: RequestCache) => Promise<[any, undefined] | [null, boolean]>;
18
18
  Fetch: {
19
19
  new (config?: {
@@ -36,6 +36,13 @@ declare const dWeb: {
36
36
  cache?: RequestCache | undefined;
37
37
  }): Promise<string>;
38
38
  formatError(response: Response | null, responseText: string | null, networkError?: any): any;
39
+ ask(url: string, args?: {
40
+ params?: Record<string, any> | undefined;
41
+ method?: "POST" | "GET" | undefined;
42
+ baseURL?: string | undefined;
43
+ headers?: Record<string, string> | undefined;
44
+ cache?: RequestCache | undefined;
45
+ }): Promise<[any, undefined] | [null, any]>;
39
46
  };
40
47
  };
41
48
  };
@@ -50,17 +50,6 @@ export declare namespace Ddan {
50
50
  port: string;
51
51
  query: string;
52
52
  }
53
- interface IURL {
54
- href: string;
55
- url: string;
56
- origin: string;
57
- host: string;
58
- hash: string;
59
- hostname: string;
60
- protocol: string;
61
- port: string;
62
- query: string;
63
- }
64
53
  interface IGetset<T> {
65
54
  set(value?: T): void;
66
55
  get(): T | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddan-js",
3
- "version": "3.9.0",
3
+ "version": "3.9.1",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "ddan-js",