ddan-js 2.9.9 → 2.9.11

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.
Files changed (117) hide show
  1. package/bin/browser.d.ts +39 -0
  2. package/bin/ddan-js.browser.js +1 -1
  3. package/bin/ddan-js.js +1 -1
  4. package/bin/ddan-js.mjs +1 -1
  5. package/bin/ddan-tiny.js +1 -0
  6. package/bin/ddan-upload.js +1 -1
  7. package/bin/index.d.ts +39 -0
  8. package/bin/lib/class/event.js +1 -0
  9. package/bin/lib/class/getset.js +1 -0
  10. package/bin/lib/class/icon.js +1 -0
  11. package/bin/lib/class/persist.js +1 -0
  12. package/bin/lib/class/pipeTask.js +1 -0
  13. package/bin/lib/class/store.js +1 -0
  14. package/bin/lib/common/_Symbol.js +1 -0
  15. package/bin/lib/common/_freeGlobal.js +1 -0
  16. package/bin/lib/common/_object.js +1 -0
  17. package/bin/lib/common/_root.js +1 -0
  18. package/bin/lib/common/internal/asciiToArray.js +1 -0
  19. package/bin/lib/common/internal/castSlice.js +1 -0
  20. package/bin/lib/common/internal/createCaseFirst.js +1 -0
  21. package/bin/lib/common/internal/hasUnicode.js +1 -0
  22. package/bin/lib/common/internal/nodeTypes.js +1 -0
  23. package/bin/lib/common/internal/slice.js +1 -0
  24. package/bin/lib/common/internal/stringToArray.js +1 -0
  25. package/bin/lib/common/internal/unicodeToArray.js +1 -0
  26. package/bin/lib/common/internal/unicodeWords.js +1 -0
  27. package/bin/lib/modules/convert/base.js +1 -0
  28. package/bin/lib/modules/convert/base64.js +1 -0
  29. package/bin/lib/modules/convert/index.js +1 -0
  30. package/bin/lib/modules/convert/md5.js +1 -0
  31. package/bin/lib/modules/convert/pkcs.js +1 -0
  32. package/bin/lib/modules/convert/utf8.js +1 -0
  33. package/bin/lib/modules/crypto/base64.js +1 -0
  34. package/bin/lib/modules/crypto/const.js +1 -0
  35. package/bin/lib/modules/crypto/index.js +1 -0
  36. package/bin/lib/modules/crypto/rsa.js +1 -0
  37. package/bin/lib/modules/crypto/tea.js +1 -0
  38. package/bin/lib/modules/crypto/uuid.js +1 -0
  39. package/bin/lib/modules/css.js +1 -0
  40. package/bin/lib/modules/fetch.js +1 -0
  41. package/bin/lib/modules/gbk.js +1 -0
  42. package/bin/lib/modules/hook/base.js +1 -0
  43. package/bin/lib/modules/hook/hooker.js +1 -0
  44. package/bin/lib/modules/hook/index.js +1 -0
  45. package/bin/lib/modules/hook/log.js +1 -0
  46. package/bin/lib/modules/hook/modules/bezier.js +1 -0
  47. package/bin/lib/modules/hook/modules/debounce.js +1 -0
  48. package/bin/lib/modules/hook/modules/mutex.js +1 -0
  49. package/bin/lib/modules/hook/modules/pipeline.js +1 -0
  50. package/bin/lib/modules/hook/modules/polling.js +1 -0
  51. package/bin/lib/modules/hook/modules/safeTask.js +1 -0
  52. package/bin/lib/modules/hook/modules/throttle.js +1 -0
  53. package/bin/lib/modules/html.js +1 -0
  54. package/bin/lib/modules/http/index.js +1 -0
  55. package/bin/lib/modules/http/interceptor.js +1 -0
  56. package/bin/lib/modules/list/base.js +1 -0
  57. package/bin/lib/modules/list/index.js +1 -0
  58. package/bin/lib/modules/math/index.js +1 -0
  59. package/bin/lib/modules/node/rsa-web.js +1 -0
  60. package/bin/lib/modules/obj/index.js +1 -0
  61. package/bin/lib/modules/qs/decode.js +1 -0
  62. package/bin/lib/modules/qs/encode.js +1 -0
  63. package/bin/lib/modules/qs/index.js +1 -0
  64. package/bin/lib/modules/regex.js +1 -0
  65. package/bin/lib/modules/rsa.js +1 -0
  66. package/bin/lib/modules/rule/async-validator/index.js +1 -0
  67. package/bin/lib/modules/rule/async-validator/messages.js +1 -0
  68. package/bin/lib/modules/rule/async-validator/rule/enum.js +1 -0
  69. package/bin/lib/modules/rule/async-validator/rule/index.js +1 -0
  70. package/bin/lib/modules/rule/async-validator/rule/pattern.js +1 -0
  71. package/bin/lib/modules/rule/async-validator/rule/range.js +1 -0
  72. package/bin/lib/modules/rule/async-validator/rule/required.js +1 -0
  73. package/bin/lib/modules/rule/async-validator/rule/type.js +1 -0
  74. package/bin/lib/modules/rule/async-validator/rule/url.js +1 -0
  75. package/bin/lib/modules/rule/async-validator/rule/whitespace.js +1 -0
  76. package/bin/lib/modules/rule/async-validator/util.js +1 -0
  77. package/bin/lib/modules/rule/async-validator/validator/any.js +1 -0
  78. package/bin/lib/modules/rule/async-validator/validator/array.js +1 -0
  79. package/bin/lib/modules/rule/async-validator/validator/boolean.js +1 -0
  80. package/bin/lib/modules/rule/async-validator/validator/date.js +1 -0
  81. package/bin/lib/modules/rule/async-validator/validator/enum.js +1 -0
  82. package/bin/lib/modules/rule/async-validator/validator/float.js +1 -0
  83. package/bin/lib/modules/rule/async-validator/validator/index.js +1 -0
  84. package/bin/lib/modules/rule/async-validator/validator/integer.js +1 -0
  85. package/bin/lib/modules/rule/async-validator/validator/method.js +1 -0
  86. package/bin/lib/modules/rule/async-validator/validator/number.js +1 -0
  87. package/bin/lib/modules/rule/async-validator/validator/object.js +1 -0
  88. package/bin/lib/modules/rule/async-validator/validator/pattern.js +1 -0
  89. package/bin/lib/modules/rule/async-validator/validator/regexp.js +1 -0
  90. package/bin/lib/modules/rule/async-validator/validator/required.js +1 -0
  91. package/bin/lib/modules/rule/async-validator/validator/string.js +1 -0
  92. package/bin/lib/modules/rule/async-validator/validator/type.js +1 -0
  93. package/bin/lib/modules/rule/index.js +1 -0
  94. package/bin/lib/modules/string/index.js +1 -0
  95. package/bin/lib/modules/string/words.js +1 -0
  96. package/bin/lib/modules/time/const.js +1 -0
  97. package/bin/lib/modules/time/dtime.js +1 -0
  98. package/bin/lib/modules/time/frame.js +1 -0
  99. package/bin/lib/modules/time/index.js +1 -0
  100. package/bin/lib/tiny/hook.js +1 -0
  101. package/bin/lib/tiny/store.js +1 -0
  102. package/bin/lib/tiny/utils.js +1 -0
  103. package/bin/lib/tiny/web.js +1 -0
  104. package/bin/lib/tiny.js +1 -0
  105. package/bin/lib/util/function.js +1 -0
  106. package/bin/lib/util/includes.js +1 -0
  107. package/bin/lib/util/index.js +1 -0
  108. package/bin/lib/util/is.js +1 -0
  109. package/bin/lib/util/to.js +1 -0
  110. package/bin/modules/html.d.ts +1 -0
  111. package/bin/modules/qs/index.d.ts +9 -0
  112. package/bin/tiny/hook.d.ts +185 -0
  113. package/bin/tiny/store.d.ts +9 -0
  114. package/bin/tiny/utils.d.ts +239 -0
  115. package/bin/tiny/web.d.ts +114 -0
  116. package/bin/tiny.d.ts +6 -0
  117. package/package.json +12 -20
@@ -0,0 +1,239 @@
1
+ declare const dUtil: {
2
+ Event: {
3
+ new (type: string, eventInitDict?: EventInit | undefined): Event;
4
+ prototype: Event;
5
+ readonly NONE: 0;
6
+ readonly CAPTURING_PHASE: 1;
7
+ readonly AT_TARGET: 2;
8
+ readonly BUBBLING_PHASE: 3;
9
+ };
10
+ includes: typeof import("../util/includes").default;
11
+ forof: (source: any, cb: (key: any, val: any) => void) => void;
12
+ singleton: <T>() => {
13
+ new (): {};
14
+ __instance__: any;
15
+ readonly Instance: T;
16
+ readonly I: T;
17
+ };
18
+ getset: <T_1 = any>(t?: T_1 | undefined) => import("..").Ddan.IGetset<T_1>;
19
+ copy: (source: any, options?: {
20
+ fields?: string[] | undefined;
21
+ camel?: boolean | undefined;
22
+ pure?: boolean | undefined;
23
+ } & import("..").Ddan.IIgnoreParams) => any;
24
+ clone: (source: any) => any;
25
+ merge: (target: any, source: any, options?: import("..").Ddan.IIgnoreParams) => {};
26
+ isEmpty: (source: any) => boolean;
27
+ parseValue: (source: any, { number, boolean }?: {
28
+ number?: boolean | undefined;
29
+ boolean?: boolean | undefined;
30
+ }) => any;
31
+ cloneClass: <T_2>(source: T_2) => T_2;
32
+ combine: (target: any, source: any, options?: import("..").Ddan.IIgnoreParams) => any;
33
+ combines: (objs: any[], options?: import("..").Ddan.IIgnoreParams) => {};
34
+ observe: (obj: any, key: any, watchFun: any, owner: any, deep?: boolean) => void;
35
+ find: (obj: any, cb: (k: string, v: any) => boolean) => [string, unknown] | undefined;
36
+ getTag: (value: any) => string;
37
+ getType: (value: any) => string;
38
+ toString: () => string;
39
+ hasOwnProperty: (v: PropertyKey) => boolean;
40
+ propertyIsEnumerable: (v: PropertyKey) => boolean;
41
+ is: (val: any, type: string) => boolean;
42
+ isNumber: (value: any) => boolean;
43
+ isString: (value: any) => boolean;
44
+ isObject: (value: any) => boolean;
45
+ isObjectLike: (value: any) => boolean;
46
+ isPlainObject: (value: any) => boolean;
47
+ isSymbol: (value: any) => boolean;
48
+ isFunction: (value: any) => boolean;
49
+ isArray: (arg: any) => arg is any[];
50
+ isArrayLikeObject: (value: any) => boolean;
51
+ isIndex: (value: any, length: number) => boolean;
52
+ isArrayLike: (value: any) => boolean;
53
+ isPrototype: (value: any) => boolean;
54
+ isArguments: (value: any) => boolean;
55
+ isPromise: (value: any) => boolean;
56
+ isBrowser: boolean;
57
+ isNode: boolean;
58
+ isBlobOrBuffer: (data: any) => boolean;
59
+ isUint8Array: (data: any) => boolean;
60
+ isArrayBuffer: (data: any) => boolean;
61
+ base64: {
62
+ encode: (input: string) => string;
63
+ decode: (base64Str: string) => string;
64
+ encodeByOss: (input: string) => string;
65
+ };
66
+ tea: {
67
+ TEAKey: string;
68
+ encrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
69
+ decrypt: (v: Uint32Array, teaKey: Uint32Array) => Uint32Array;
70
+ toTeaKey: (str: string) => Uint32Array;
71
+ encode: (plaintext: string, key: string) => string;
72
+ decode: (ciphertext: string, key: string) => string;
73
+ encodeBytes: (plainbytes: Uint8Array, key: string) => Uint8Array;
74
+ decodeBytes: (cipherbytes: Uint8Array, key: string) => Uint8Array;
75
+ };
76
+ uuid: (len?: number, radix?: number) => string;
77
+ guid: (len: number, prefix?: boolean, sep?: string) => string;
78
+ getHexString: (len: number) => string;
79
+ keyNumber: string;
80
+ keyLower: string;
81
+ keyUpper: string;
82
+ keyChars: string;
83
+ str2ab: (content?: string, base64?: boolean) => ArrayBuffer;
84
+ ab2str: (data: ArrayBuffer, base64?: boolean) => string;
85
+ utf8ToBase64: (str: string) => string;
86
+ base64ToUtf8: (base64Str: string) => string;
87
+ getRandomBytes: (length: number) => Uint8Array;
88
+ textEncode: (text: string) => Uint8Array;
89
+ textDecode: (buf: ArrayBufferLike) => string;
90
+ toDataUrl: (textOrBuf: string | ArrayBuffer, contentType?: string) => string;
91
+ md5: (input: string | Uint8Array) => string;
92
+ md5Base64: (input: string | Uint8Array) => string;
93
+ toBase64: (input?: string) => string;
94
+ fromBase64: (input?: string) => string;
95
+ bytesToBase64: (bytes: Uint8Array) => string;
96
+ base64ToBytes: (input?: string) => Uint8Array;
97
+ toUtf8: (content: string) => string;
98
+ fromUtf8: (utftext: string) => string;
99
+ toUtf8Bytes: (content: string) => Uint8Array;
100
+ fromUtf8Bytes: (utf8Bytes: Uint8Array) => string;
101
+ pkcs7Padding: (plaintext: Uint8Array, blockSize: number) => Uint8Array;
102
+ pkcs7Unpadding: (ciphertext: Uint8Array) => Uint8Array;
103
+ bytes2str: (bytes: Uint8Array) => string;
104
+ str2bytes: (str?: string) => Uint8Array;
105
+ str2hex: (str: string) => string;
106
+ hex2str: (hexstr: string) => string;
107
+ concatBytes: (...args: Uint8Array[]) => Uint8Array;
108
+ uint32ToBytes: (uint32: Uint32Array) => Uint8Array;
109
+ bytesToUint32: (bytes: Uint8Array) => Uint32Array;
110
+ hex2bytes: (hex: string) => Uint8Array;
111
+ bytes2hex: (bytes: Uint8Array) => string;
112
+ toUint32: (str: string) => Uint32Array;
113
+ fromUint32: (uint32: Uint32Array) => string;
114
+ flatten: <T_3>(data: T_3[], recursive?: boolean, list?: T_3[]) => T_3[];
115
+ gbk: {
116
+ gbkLength: (str: string) => number;
117
+ gbkCut: (source: string, len: number) => string;
118
+ };
119
+ math: {
120
+ random: (max: number) => number;
121
+ randomRange: (min: number, max: number) => number;
122
+ lerp: (start: number, end: number, t: number) => number;
123
+ randoms: (max: number, count?: number, repeat?: boolean) => number[];
124
+ strip: (num: string | number, digits?: number) => number;
125
+ float: (num: string | number, { digits, fixed }?: {
126
+ digits?: number | undefined;
127
+ fixed?: boolean | undefined;
128
+ }) => number;
129
+ radian2degree: (radians: number) => number;
130
+ degree2radian: (degrees: number) => number;
131
+ calcDataSize: (data: number) => {
132
+ gb: number;
133
+ mb: number;
134
+ kb: number;
135
+ b: number;
136
+ total: number;
137
+ desc: string;
138
+ };
139
+ };
140
+ list: {
141
+ stepAction: <T_4>(list: T_4[], func: import("..").Ddan.Task<T_4, void>, stepCount?: number) => void;
142
+ skip: <T_5>(list: T_5[], count: number) => T_5[];
143
+ take: <T_6>(list: T_6[], count: number, skip?: number) => T_6[];
144
+ distinct: <T_7>(list: T_7[]) => T_7[];
145
+ randoms: <T_8>(list: T_8[], count?: number, repeat?: boolean) => T_8[];
146
+ toKV: (list: import("..").Ddan.KV<any>[], key: string, value: string) => import("..").Ddan.KV<any>;
147
+ groupBy: <T_9>(list: T_9[], key: string) => Record<string, T_9[]>;
148
+ first: <T_10>(list: T_10[]) => T_10 | undefined;
149
+ last: <T_11>(list: T_11[]) => T_11 | undefined;
150
+ toList: <T_12>(val: T_12 | T_12[]) => T_12[];
151
+ };
152
+ string: {
153
+ toString: (value: any) => any;
154
+ startCase: (string: any) => any;
155
+ snakeCase: (string: any) => any;
156
+ kebabCase: (string: any) => any;
157
+ camelCase: (string: any) => any;
158
+ upperCase: (string: any) => any;
159
+ upperFirst: (string: any) => any;
160
+ lowerCase: (string: any) => any;
161
+ lowerFirst: (string: any) => any;
162
+ splitOnFirst: (string: any, separator: any) => string[];
163
+ parseValue: (value?: any, { number, boolean }?: {
164
+ number?: boolean | undefined;
165
+ boolean?: boolean | undefined;
166
+ }) => any;
167
+ replace: (source: string, rules: import("..").Ddan.IRegexRule | import("..").Ddan.IRegexRule[]) => string;
168
+ jsonFormat: (jsonString: string) => string;
169
+ toLines: (content: string, separator?: string | RegExp) => string[];
170
+ };
171
+ time: {
172
+ now: () => import("../modules/time/dtime").default;
173
+ isToday: (date: any) => any;
174
+ parseTimestamp: ({ year, month, date, hour, minute, second }: {
175
+ year?: number | undefined;
176
+ month?: number | undefined;
177
+ date?: number | undefined;
178
+ hour?: number | undefined;
179
+ minute?: number | undefined;
180
+ second?: number | undefined;
181
+ }) => number;
182
+ todayZero: () => number;
183
+ format: (time: string | number | Date, reg?: string) => string;
184
+ countdown: (endTime: string | number | Date, reg?: string) => "" | import("..").Ddan.ICountdown;
185
+ dtime: (time: string | number | Date) => import("../modules/time/dtime").default;
186
+ loopFrame: (interval?: number) => import("../modules/time/frame").default;
187
+ getTimezoneOffset: () => number;
188
+ getLocalTime: typeof import("../modules/time/dtime").default.getLocalTime;
189
+ oneDay: number;
190
+ oneHour: number;
191
+ oneMinute: number;
192
+ oneSecond: number;
193
+ };
194
+ obj: {
195
+ copy: (source: any, options?: {
196
+ fields?: string[] | undefined;
197
+ camel?: boolean | undefined;
198
+ pure?: boolean | undefined;
199
+ } & import("..").Ddan.IIgnoreParams) => any;
200
+ clone: (source: any) => any;
201
+ merge: (target: any, source: any, options?: import("..").Ddan.IIgnoreParams) => {};
202
+ isEmpty: (source: any) => boolean;
203
+ parseValue: (source: any, { number, boolean }?: {
204
+ number?: boolean | undefined;
205
+ boolean?: boolean | undefined;
206
+ }) => any;
207
+ cloneClass: <T_2>(source: T_2) => T_2;
208
+ combine: (target: any, source: any, options?: import("..").Ddan.IIgnoreParams) => any;
209
+ combines: (objs: any[], options?: import("..").Ddan.IIgnoreParams) => {};
210
+ observe: (obj: any, key: any, watchFun: any, owner: any, deep?: boolean) => void;
211
+ find: (obj: any, cb: (k: string, v: any) => boolean) => [string, unknown] | undefined;
212
+ };
213
+ rule: {
214
+ validateId: (content: any) => boolean;
215
+ validatePhone: (content: any) => boolean;
216
+ validator: (rules: import("../modules/rule/async-validator").Rules) => import("../modules/rule/async-validator").default;
217
+ validate: (rules: import("../modules/rule/async-validator").Rules, source_: import("../modules/rule/async-validator").Values, o?: any, oc?: any) => Promise<import("../modules/rule/async-validator").Values>;
218
+ isChinese: (content: string) => boolean;
219
+ isNumber: (content: string) => boolean;
220
+ isFloat: (content: string) => boolean;
221
+ isPhoneNumber: (content: any) => boolean;
222
+ };
223
+ regex: {
224
+ pattern: {
225
+ num: string;
226
+ zh: string;
227
+ en: string;
228
+ };
229
+ regex: (patt: string, modifiers?: "i" | "g" | "m" | undefined) => RegExp;
230
+ entire: {
231
+ chinese: RegExp;
232
+ real: RegExp;
233
+ cssReal: RegExp;
234
+ id: RegExp;
235
+ yyyyMMdd: RegExp;
236
+ };
237
+ };
238
+ };
239
+ export default dUtil;
@@ -0,0 +1,114 @@
1
+ import Http from '../modules/http';
2
+ declare const dWeb: {
3
+ fetch: {
4
+ getDataURL: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, {
5
+ contentType: string;
6
+ dataUrl: string;
7
+ }]>;
8
+ getArrayBuffer: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, ArrayBuffer]>;
9
+ getJson: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, any]>;
10
+ download: (url: string, opts?: {
11
+ success?: ((buffer: Uint8Array) => void) | undefined;
12
+ progress?: ((percentage: number, current: number, total: number) => void) | undefined;
13
+ fail?: ((error: Error) => void) | undefined;
14
+ }) => Promise<Uint8Array | undefined>;
15
+ getText: (url: string, cache?: RequestCache | undefined) => Promise<[any, undefined] | [null, string]>;
16
+ cache: (url: string, cache?: RequestCache) => Promise<[any, undefined] | [null, boolean]>;
17
+ };
18
+ Http: typeof Http;
19
+ css: {
20
+ stringify: (styleObj: Record<string, string | number>) => string;
21
+ parse: (styleStr: string, { camel, pure }?: {
22
+ camel?: boolean | undefined;
23
+ pure?: boolean | undefined;
24
+ }) => {} | undefined;
25
+ fixValue: (value: string | number, unit?: string) => string | number;
26
+ style: (cssKV: Record<string, any>, unit?: string) => string;
27
+ commonFields: string[];
28
+ };
29
+ qs: {
30
+ parse: (qs: any, { sep, eq, max, multiple, uri, parseNumber, parseBoolean }?: {
31
+ sep?: string | undefined;
32
+ eq?: string | undefined;
33
+ max?: number | undefined;
34
+ multiple?: boolean | undefined;
35
+ uri?: boolean | undefined;
36
+ parseNumber?: boolean | undefined;
37
+ parseBoolean?: boolean | undefined;
38
+ }) => {};
39
+ stringify: (obj: any, { sep, eq, name, uri, cleanZero, cleanNull, cleanWhitespace }?: {
40
+ sep?: string | undefined;
41
+ eq?: string | undefined;
42
+ name?: null | undefined;
43
+ uri?: boolean | undefined;
44
+ cleanZero?: boolean | undefined;
45
+ cleanNull?: boolean | undefined;
46
+ cleanWhitespace?: boolean | undefined;
47
+ }) => string;
48
+ https: (url: string) => string;
49
+ parseUrl: (url: string) => {
50
+ pathname: string;
51
+ params: {};
52
+ route: string;
53
+ page: string;
54
+ name: string;
55
+ withoutExtension: string;
56
+ extname: string;
57
+ href: string;
58
+ url: string;
59
+ origin: string;
60
+ host: string;
61
+ protocol: string;
62
+ port: string;
63
+ query: string;
64
+ };
65
+ parsePath: (url: string) => {
66
+ route: string;
67
+ page: string;
68
+ name: string;
69
+ withoutExtension: string;
70
+ extname: string;
71
+ };
72
+ parseHost: (url: string) => import("..").Ddan.IHttpHost;
73
+ join: (...args: string[]) => string;
74
+ shExpMatch: (text: string, pattern: string) => boolean;
75
+ isLocalIpAddress: (addr: string) => boolean;
76
+ parseFileUrl: (url: string) => {
77
+ href: string;
78
+ file: string;
79
+ url: string;
80
+ protocol: string;
81
+ host: string;
82
+ query: string;
83
+ params: {};
84
+ };
85
+ };
86
+ icon: import("../class/icon").DIcon;
87
+ html: {
88
+ dataURLtoFile: (dataurl: any, filename: any) => File;
89
+ dataURLtoBlob: (dataurl: any) => Blob;
90
+ blobToFile: (blob: any, fileName: string) => any;
91
+ readAsDataURL: (file: any, cb: any) => void;
92
+ downloadUrl: (url: string, filename?: string, checkSomeOrigin?: boolean) => void;
93
+ download: (urlOrFile: string | Blob | MediaSource, filename?: string) => void;
94
+ downloadFile: (data: Blob | MediaSource, filename?: string) => void;
95
+ downloadImage: (url: string) => Promise<void> | undefined;
96
+ watermark: (text: string, { width, height, angle, fillStyle, font, textAlign, textBaseline, }?: {
97
+ width?: number | undefined;
98
+ height?: number | undefined;
99
+ angle?: number | undefined;
100
+ fillStyle?: string | undefined;
101
+ font?: string | undefined;
102
+ textAlign?: "center" | "end" | "left" | "right" | "start" | undefined;
103
+ textBaseline?: "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" | undefined;
104
+ }) => string;
105
+ copyText: (text: string, legacy?: boolean) => Promise<boolean>;
106
+ queryPermission: (name: string, def?: PermissionState) => Promise<PermissionState>;
107
+ isAllowed: (status: PermissionState | undefined, prompt?: boolean) => boolean;
108
+ legacyCopy: (text: string) => boolean;
109
+ takeHtmlLinks: (htmlContent: string) => never[];
110
+ takeHtml: (htmlContent: string, regex: RegExp) => string[];
111
+ toBlobUrl: (part: BlobPart, mime: "application/javascript") => string;
112
+ };
113
+ };
114
+ export default dWeb;
package/bin/tiny.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export type { Ddan } from './typings';
2
+ import dHook from './tiny/hook';
3
+ import dStore from './tiny/store';
4
+ import dUtil from './tiny/utils';
5
+ import dWeb from './tiny/web';
6
+ export { dHook, dWeb, dUtil, dStore };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddan-js",
3
- "version": "2.9.9",
3
+ "version": "2.9.11",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "ddan-js",
@@ -33,6 +33,11 @@
33
33
  "import": "./bin/ddan-upload.mjs",
34
34
  "require": "./bin/ddan-upload.js"
35
35
  },
36
+ "./tiny": {
37
+ "types": "./bin/tiny.d.ts",
38
+ "import": "./bin/lib/tiny.js",
39
+ "require": "./bin/ddan-tiny.js"
40
+ },
36
41
  "./*": "./*"
37
42
  },
38
43
  "files": [
@@ -67,17 +72,15 @@
67
72
  "git add"
68
73
  ]
69
74
  },
70
- "config": {
71
- "commitizen": {
72
- "path": "node_modules/cz-conventional-changelog"
73
- }
74
- },
75
75
  "jest": {
76
76
  "preset": "ts-jest",
77
77
  "transform": {
78
- "^.+\\.(ts|tsx)$": ["ts-jest", {
79
- "isolatedModules": true
80
- }]
78
+ "^.+\\.(ts|tsx)$": [
79
+ "ts-jest",
80
+ {
81
+ "isolatedModules": true
82
+ }
83
+ ]
81
84
  },
82
85
  "testEnvironment": "node",
83
86
  "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
@@ -112,18 +115,11 @@
112
115
  "semi": false,
113
116
  "singleQuote": true
114
117
  },
115
- "commitlint": {
116
- "extends": [
117
- "@commitlint/config-conventional"
118
- ]
119
- },
120
118
  "devDependencies": {
121
119
  "@alicloud/pop-core": "^1.7.12",
122
120
  "@babel/core": "^7.26.0",
123
121
  "@babel/preset-env": "^7.26.0",
124
122
  "@babel/preset-typescript": "^7.26.0",
125
- "@commitlint/cli": "^17.6.1",
126
- "@commitlint/config-conventional": "^17.6.1",
127
123
  "@rollup/plugin-node-resolve": "^15.1.0",
128
124
  "@types/ali-oss": "^6.16.7",
129
125
  "@types/babel__core": "7.1.19",
@@ -133,9 +129,7 @@
133
129
  "ali-oss": "^6.17.1",
134
130
  "colors": "^1.4.0",
135
131
  "commitizen": "^4.3.0",
136
- "coveralls": "^3.1.1",
137
132
  "cross-env": "^7.0.3",
138
- "cz-conventional-changelog": "^3.3.0",
139
133
  "gulp": "^4.0.2",
140
134
  "gulp-uglify": "^3.0.2",
141
135
  "jest": "^29.1.0",
@@ -144,7 +138,6 @@
144
138
  "lodash": "^4.17.21",
145
139
  "prettier": "^2.8.8",
146
140
  "prompt": "^1.3.0",
147
- "replace-in-file": "^6.3.5",
148
141
  "rimraf": "^5.0.0",
149
142
  "rollup": "^2.79.1",
150
143
  "rollup-plugin-babel": "^4.4.0",
@@ -157,7 +150,6 @@
157
150
  "rollup-plugin-typescript2": "^0.34.1",
158
151
  "semantic-release": "^21.0.1",
159
152
  "shelljs": "^0.8.5",
160
- "travis-deploy-once": "^5.0.11",
161
153
  "ts-jest": "^29.1.0",
162
154
  "ts-node": "^10.9.1",
163
155
  "tslib": "^2.5.0",