ddan-js 2.10.3 → 2.10.5
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/bin/browser.d.ts +5 -1129
- package/bin/ddan-js.browser.js +1 -1
- package/bin/ddan-js.js +1 -1
- package/bin/ddan-js.mjs +1 -1
- package/bin/index.d.ts +7 -1183
- package/bin/tiny/hook.d.ts +202 -0
- package/bin/tiny/mini.d.ts +106 -0
- package/bin/tiny/node.d.ts +37 -0
- package/bin/tiny/tools.d.ts +45 -0
- package/bin/tiny/utils.d.ts +233 -0
- package/bin/tiny/web.d.ts +127 -0
- package/package.json +1 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import Http from '../modules/http';
|
|
2
|
+
declare const dWeb: {
|
|
3
|
+
Ecdh: typeof import("../modules/browser/ecdh").default;
|
|
4
|
+
fetch: {
|
|
5
|
+
getDataURL: (url: string, cache?: RequestCache | undefined) => Promise<[null, {
|
|
6
|
+
contentType: string;
|
|
7
|
+
dataUrl: string;
|
|
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]>;
|
|
11
|
+
download: (url: string, opts?: {
|
|
12
|
+
success?: ((buffer: Uint8Array) => void) | undefined;
|
|
13
|
+
progress?: ((percentage: number, current: number, total: number) => void) | undefined;
|
|
14
|
+
fail?: ((error: Error) => void) | undefined;
|
|
15
|
+
}) => Promise<Uint8Array | undefined>;
|
|
16
|
+
getText: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, string]>;
|
|
17
|
+
cache: (url: string, cache?: RequestCache) => Promise<[any, undefined] | [null, boolean]>;
|
|
18
|
+
};
|
|
19
|
+
Http: typeof Http;
|
|
20
|
+
css: {
|
|
21
|
+
stringify: (styleObj: Record<string, string | number>) => string;
|
|
22
|
+
parse: (styleStr: string, { camel, pure }?: {
|
|
23
|
+
camel?: boolean | undefined;
|
|
24
|
+
pure?: boolean | undefined;
|
|
25
|
+
}) => {} | undefined;
|
|
26
|
+
fixValue: (value: string | number, unit?: string) => string | number;
|
|
27
|
+
style: (cssKV: Record<string, any>, unit?: string) => string;
|
|
28
|
+
commonFields: string[];
|
|
29
|
+
};
|
|
30
|
+
qs: {
|
|
31
|
+
parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
|
|
32
|
+
sep?: string | undefined;
|
|
33
|
+
eq?: string | undefined;
|
|
34
|
+
max?: number | undefined;
|
|
35
|
+
multiple?: boolean | undefined;
|
|
36
|
+
uri?: boolean | undefined;
|
|
37
|
+
parseNumber?: boolean | undefined;
|
|
38
|
+
parseBoolean?: boolean | undefined;
|
|
39
|
+
}) => {};
|
|
40
|
+
stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
|
|
41
|
+
sep?: string | undefined;
|
|
42
|
+
eq?: string | undefined;
|
|
43
|
+
name?: null | undefined;
|
|
44
|
+
uri?: boolean | undefined;
|
|
45
|
+
cleanZero?: boolean | undefined;
|
|
46
|
+
cleanNull?: boolean | undefined;
|
|
47
|
+
cleanWhitespace?: boolean | undefined;
|
|
48
|
+
}) => string;
|
|
49
|
+
https: (url: string) => string;
|
|
50
|
+
parseUrl: (url: string) => {
|
|
51
|
+
pathname: string;
|
|
52
|
+
params: {};
|
|
53
|
+
route: string;
|
|
54
|
+
page: string;
|
|
55
|
+
name: string;
|
|
56
|
+
withoutExtension: string;
|
|
57
|
+
extname: string;
|
|
58
|
+
href: string;
|
|
59
|
+
url: string;
|
|
60
|
+
origin: string;
|
|
61
|
+
host: string;
|
|
62
|
+
protocol: string;
|
|
63
|
+
port: string;
|
|
64
|
+
query: string;
|
|
65
|
+
};
|
|
66
|
+
parsePath: (url: string) => {
|
|
67
|
+
route: string;
|
|
68
|
+
page: string;
|
|
69
|
+
name: string;
|
|
70
|
+
withoutExtension: string;
|
|
71
|
+
extname: string;
|
|
72
|
+
};
|
|
73
|
+
parseHost: (url: string) => import("..").Ddan.IHttpHost;
|
|
74
|
+
join: (...args: string[]) => string;
|
|
75
|
+
shExpMatch: (text: string, pattern: string) => boolean;
|
|
76
|
+
isLocalIpAddress: (addr: string) => boolean;
|
|
77
|
+
parseFileUrl: (url: string) => {
|
|
78
|
+
href: string;
|
|
79
|
+
file: string;
|
|
80
|
+
url: string;
|
|
81
|
+
protocol: string;
|
|
82
|
+
host: string;
|
|
83
|
+
query: string;
|
|
84
|
+
params: {};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
icon: import("../class/icon").DIcon;
|
|
88
|
+
html: {
|
|
89
|
+
dataURLtoFile: (dataurl: any, filename: any) => File;
|
|
90
|
+
dataURLtoBlob: (dataurl: any) => Blob;
|
|
91
|
+
blobToFile: (blob: any, fileName: string) => any;
|
|
92
|
+
readAsDataURL: (file: any, cb: any) => void;
|
|
93
|
+
downloadUrl: (url: string, filename?: string, checkSomeOrigin?: boolean) => void;
|
|
94
|
+
download: (urlOrFile: string | Blob | MediaSource, filename?: string) => void;
|
|
95
|
+
downloadFile: (data: Blob | MediaSource, filename?: string) => void;
|
|
96
|
+
downloadImage: (url: string) => Promise<void> | undefined;
|
|
97
|
+
watermark: (text: string, { width, height, angle, fillStyle, font, textAlign, textBaseline, }?: {
|
|
98
|
+
width?: number | undefined;
|
|
99
|
+
height?: number | undefined;
|
|
100
|
+
angle?: number | undefined;
|
|
101
|
+
fillStyle?: string | undefined;
|
|
102
|
+
font?: string | undefined;
|
|
103
|
+
textAlign?: "center" | "end" | "left" | "right" | "start" | undefined;
|
|
104
|
+
textBaseline?: "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" | undefined;
|
|
105
|
+
}) => string;
|
|
106
|
+
copyText: (text: string, legacy?: boolean) => Promise<boolean>;
|
|
107
|
+
queryPermission: (name: string, def?: PermissionState) => Promise<PermissionState>;
|
|
108
|
+
isAllowed: (status: PermissionState | undefined, prompt?: boolean) => boolean;
|
|
109
|
+
legacyCopy: (text: string) => boolean;
|
|
110
|
+
takeHtmlLinks: (htmlContent: string) => never[];
|
|
111
|
+
takeHtml: (htmlContent: string, regex: RegExp) => string[];
|
|
112
|
+
toBlobUrl: (part: BlobPart, mime: "application/javascript") => string;
|
|
113
|
+
};
|
|
114
|
+
rsa: {
|
|
115
|
+
generateKeys: () => Promise<{
|
|
116
|
+
publicKey: string;
|
|
117
|
+
publicKeyPem: string;
|
|
118
|
+
privateKey: string;
|
|
119
|
+
privateKeyPem: string;
|
|
120
|
+
}>;
|
|
121
|
+
encrypt: (data: string, publicKey: string) => Promise<string>;
|
|
122
|
+
decrypt: (encryptedBase64: string, privateKey: string) => Promise<string>;
|
|
123
|
+
encode: (data: string) => Promise<string>;
|
|
124
|
+
decode: (encryptedBase64: string) => Promise<string>;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
export default dWeb;
|