dphelper 3.0.6 → 3.0.7
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/dphelper.umd.js +26 -26
- package/index.js +13 -13
- package/package.json +5 -4
- package/postinstall.mjs +23 -0
- package/tools/ai/interface.d.ts +12 -0
- package/tools/anchor/interface.d.ts +7 -0
- package/tools/array/interface.d.ts +22 -0
- package/tools/audio/interface.d.ts +11 -0
- package/tools/avoid/interface.d.ts +3 -0
- package/tools/browser/interface.d.ts +11 -0
- package/tools/check/interface.d.ts +5 -0
- package/tools/color/interface.d.ts +7 -0
- package/tools/cookie/interface.d.ts +13 -0
- package/tools/coords/interface.d.ts +9 -0
- package/tools/credits/interface.d.ts +12 -0
- package/tools/date/interface.d.ts +26 -0
- package/tools/disable/interface.d.ts +9 -0
- package/tools/dispatch/interface.d.ts +5 -0
- package/tools/elements/interface.d.ts +4 -0
- package/tools/events/interface.d.ts +7 -0
- package/tools/fetch/interface.d.ts +16 -0
- package/tools/form/interface.d.ts +14 -0
- package/tools/format/interface.d.ts +4 -0
- package/tools/json/interface.d.ts +9 -0
- package/tools/load/interface.d.ts +9 -0
- package/tools/logging/interface.d.ts +9 -0
- package/tools/math/interface.d.ts +14 -0
- package/tools/memory/interface.d.ts +4 -0
- package/tools/navigation/interface.d.ts +5 -0
- package/tools/objects/interface.d.ts +16 -0
- package/tools/path/interface.d.ts +5 -0
- package/tools/promise/interface.d.ts +4 -0
- package/tools/sanitize/interface.d.ts +3 -0
- package/tools/screen/interface.d.ts +12 -0
- package/tools/scrollbar/interface.d.ts +10 -0
- package/tools/security/interface.d.ts +12 -0
- package/tools/shortcut/interface.d.ts +3 -0
- package/tools/socket/interface.d.ts +13 -0
- package/tools/sse/interface.d.ts +9 -0
- package/tools/svg/interface.d.ts +13 -0
- package/tools/sync/interface.d.ts +14 -0
- package/tools/system/interface.d.ts +3 -0
- package/tools/text/interface.d.ts +13 -0
- package/tools/timer/interface.d.ts +4 -0
- package/tools/tools/interface.d.ts +6 -0
- package/tools/translators/interface.d.ts +3 -0
- package/tools/triggers/interface.d.ts +5 -0
- package/tools/types/interface.d.ts +6 -0
- package/tools/ui/interface.d.ts +4 -0
- package/tools/window/interface.d.ts +10 -0
- package/types/dphelper.d.ts +578 -139
- package/types/index.d.ts +1 -47
- package/types/tools/navigation/index.d.ts +1 -0
package/types/dphelper.d.ts
CHANGED
|
@@ -5,10 +5,585 @@
|
|
|
5
5
|
https://dario.passariello.ca
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
export { }
|
|
9
|
+
|
|
8
10
|
declare global {
|
|
9
11
|
|
|
12
|
+
// --- AUTO-GENERATED TOOL TYPES START ---
|
|
13
|
+
// --- ai ---
|
|
14
|
+
interface AiTool {
|
|
15
|
+
tokenCount: (data: any) => number
|
|
16
|
+
smartSanitize: (text: string) => string
|
|
17
|
+
toon: (data: any) => string
|
|
18
|
+
toonToJson: (toon: string) => any
|
|
19
|
+
chunker: (text: string, options?: { size?: number, overlap?: number }) => string[]
|
|
20
|
+
similarity: (a: number[], b: number[]) => number
|
|
21
|
+
extractReasoning: (text: string) => { reasoning: string, content: string }
|
|
22
|
+
prompt: (template: string, vars: Record<string, any>) => string
|
|
23
|
+
schema: (data: any) => string
|
|
24
|
+
snapshot: () => string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// --- anchor ---
|
|
28
|
+
interface AnchorTool {
|
|
29
|
+
/**
|
|
30
|
+
* Converts anchor tags to onClick events
|
|
31
|
+
* @param selector - CSS selector for target elements
|
|
32
|
+
*/
|
|
33
|
+
toOnClick(selector: string): void
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// --- array ---
|
|
37
|
+
interface ArrayTool {
|
|
38
|
+
find<T>(array: T[], key: any): T | any
|
|
39
|
+
unique<T>(array: T[]): T[]
|
|
40
|
+
delete<T>(array: T[], key: keyof T): void
|
|
41
|
+
merge<T>(arrayA: T[], arrayB: T[]): T[]
|
|
42
|
+
mergeByKey<T extends Record<string, any>>(arrayA: T[], arrayB: T[], key: keyof T): T[]
|
|
43
|
+
asc<T>(array: T[]): T[]
|
|
44
|
+
desc<T>(array: T[]): T[]
|
|
45
|
+
duplicates<T>(array: T[]): T[]
|
|
46
|
+
even<T>(array: T[]): T[]
|
|
47
|
+
odd<T>(array: T[]): T[]
|
|
48
|
+
toObj<T>(array: T[]): Record<string, T>
|
|
49
|
+
sumColumn(array: number[][], column: number): number
|
|
50
|
+
shuffle<T>(array: T[]): T[]
|
|
51
|
+
generate(num: number): number[]
|
|
52
|
+
testArrayInt(array: unknown[]): number[]
|
|
53
|
+
rand32(number: number): number
|
|
54
|
+
findindex<T>(array: T[], key: any): number
|
|
55
|
+
pathToJson(array: string[], separator?: string): Record<string, unknown>
|
|
56
|
+
deepClone<T>(src: T): T
|
|
57
|
+
match(arrayWords: string[], arrayToCheck: string[]): boolean
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// --- audio ---
|
|
61
|
+
interface AudioTool {
|
|
62
|
+
/**
|
|
63
|
+
* Plays an audio file if it is not already playing.
|
|
64
|
+
* If no file is specified, removes all audio elements from the document.
|
|
65
|
+
*
|
|
66
|
+
* @param file - The name of the audio file to play.
|
|
67
|
+
* @param path - The path to the audio file.
|
|
68
|
+
* @param loop - Whether the audio should loop.
|
|
69
|
+
*/
|
|
70
|
+
play: (file?: string, path?: string, loop?: boolean) => void
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// --- avoid ---
|
|
74
|
+
interface AvoidTool {
|
|
75
|
+
cache: (uri: string) => string
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// --- browser ---
|
|
79
|
+
interface BrowserTool {
|
|
80
|
+
state(state: any, title: any, url: any): void
|
|
81
|
+
forw(times: number): void
|
|
82
|
+
back(times: number): void
|
|
83
|
+
reload(): void
|
|
84
|
+
href(url: string): void
|
|
85
|
+
offLine(text?: string): void
|
|
86
|
+
zoom(): number
|
|
87
|
+
status(code: number): string
|
|
88
|
+
interlock(onUpdate: (tabs: number) => void): void
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// --- check ---
|
|
92
|
+
interface CheckTool {
|
|
93
|
+
url: (url: string) => any
|
|
94
|
+
version: (v1: string, v2: string, opts?: any) => any
|
|
95
|
+
npmVer: (npm: string) => any
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// --- color ---
|
|
99
|
+
interface ColorTool {
|
|
100
|
+
hex: (c: any) => string
|
|
101
|
+
toHex: (rgb: any) => string
|
|
102
|
+
toRGB: (c: any) => number[]
|
|
103
|
+
oleColor: (c: any) => string
|
|
104
|
+
gradient: (colorStart: any, colorEnd: any, colorCount: any) => any
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// --- cookie ---
|
|
108
|
+
interface CookieTool {
|
|
109
|
+
set: (pars: {
|
|
110
|
+
name: any,
|
|
111
|
+
value: any,
|
|
112
|
+
time?: any,
|
|
113
|
+
path?: string,
|
|
114
|
+
sameSite?: string,
|
|
115
|
+
secure?: string
|
|
116
|
+
}) => any
|
|
117
|
+
get: (name: string) => any
|
|
118
|
+
delete: (name: string) => any
|
|
119
|
+
removeAll: () => any
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// --- coords ---
|
|
123
|
+
interface CoordsTool {
|
|
124
|
+
degreesToRadians: (degrees: any) => any
|
|
125
|
+
latToMeters: (points: any) => any
|
|
126
|
+
toVector: (points: any) => any
|
|
127
|
+
convertToDecDegrees: (deg: any, minutes: any, sec: any, direction: any) => any
|
|
128
|
+
distance: (point1: any, point2: any) => any
|
|
129
|
+
polarToCartesian: (centerX: any, centerY: any, radius: any, angleInDegrees: any) => any
|
|
130
|
+
mapDegreesToPixels: (degree: number, minDegree: number, maxDegree: number, minPixel: number, maxPixel: number, padding: number) => number
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// --- credits ---
|
|
134
|
+
interface Credits {
|
|
135
|
+
name: string
|
|
136
|
+
version: string
|
|
137
|
+
description: string
|
|
138
|
+
license: string
|
|
139
|
+
author: {
|
|
140
|
+
name: string
|
|
141
|
+
email: string
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
type CreditsTool = (props: Credits) => void
|
|
146
|
+
|
|
147
|
+
// --- date ---
|
|
148
|
+
interface DateTool {
|
|
149
|
+
days: (lang?: string) => string[]
|
|
150
|
+
months: (lang?: string) => string[]
|
|
151
|
+
year: () => number
|
|
152
|
+
toIso: (value: any, int?: string) => string | null
|
|
153
|
+
toMMDDYYYY: (value: any) => string
|
|
154
|
+
toYYYYMMDD: (value: any) => string | undefined
|
|
155
|
+
toHuman: (value: any) => string
|
|
156
|
+
convert: (value: any, format: string[]) => string | null
|
|
157
|
+
iso2Epoch: (value: any) => number
|
|
158
|
+
localIsoTime: (value: any) => string
|
|
159
|
+
utc: () => string
|
|
160
|
+
parse: (value: any, separator?: string) => string | null
|
|
161
|
+
addDays: (date: any, days: number) => Date
|
|
162
|
+
dateTimeToString: (dateObject: any) => string
|
|
163
|
+
isoToHuman: (value: any, symbol?: string) => string | null
|
|
164
|
+
fullDate: () => string
|
|
165
|
+
epoch: () => number
|
|
166
|
+
diffInDays: (d1: any, d2: any) => number
|
|
167
|
+
diffInWeeks: (d1: any, d2: any) => number
|
|
168
|
+
diffInMonths: (d1: any, d2: any) => number
|
|
169
|
+
diffInYears: (d1: any, d2: any) => number
|
|
170
|
+
dateToYMD: (date: any) => string
|
|
171
|
+
collection: (params: { date?: Date; type: string; locale?: string }) => string | undefined
|
|
172
|
+
timeZones: () => string[]
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// --- disable ---
|
|
176
|
+
interface DisableTool {
|
|
177
|
+
select: (el?: string) => void
|
|
178
|
+
spellCheck: (tmr?: number) => void
|
|
179
|
+
rightClick: (el?: string) => void
|
|
180
|
+
copy: (el?: string) => void
|
|
181
|
+
paste: (el?: string) => void
|
|
182
|
+
cut: (el?: string) => void
|
|
183
|
+
drag: (el?: string) => void
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// --- dispatch ---
|
|
187
|
+
interface DispatchTool {
|
|
188
|
+
set: (name: string, value?: any) => void
|
|
189
|
+
listen: (name: string, cb?: (e: Event) => void, flag?: boolean) => void
|
|
190
|
+
remove: (name: string) => void
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// --- elements ---
|
|
194
|
+
interface ElementsTool {
|
|
195
|
+
fitScale: (el: any, scale?: number, fit?: boolean) => void
|
|
196
|
+
scaleBasedOnWindow: (elm: any, scale: number, fit: boolean) => void
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// --- events ---
|
|
200
|
+
interface EventsTool {
|
|
201
|
+
list: (el: Element) => any
|
|
202
|
+
multi: (element: Element, eventNames: string, listener: EventListener) => void
|
|
203
|
+
copy: (el: string) => void
|
|
204
|
+
onDrag: (elem: string) => void
|
|
205
|
+
keys: (e: KeyboardEvent) => { key: string; ctrl: boolean; alt: boolean; shift: boolean }
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// --- fetch ---
|
|
209
|
+
interface FetchTool {
|
|
210
|
+
/**
|
|
211
|
+
* Perform a resilient fetch with automatic retries and exponential backoff.
|
|
212
|
+
*/
|
|
213
|
+
(url: string, options?: any, retries?: number, backoff?: number): Promise<Response>
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Perform a GET request.
|
|
217
|
+
*/
|
|
218
|
+
get: (url: string, options?: any) => Promise<Response>
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Perform a POST request with optional JSON body auto-serialization.
|
|
222
|
+
*/
|
|
223
|
+
post: (url: string, body: any, options?: any) => Promise<Response>
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// --- form ---
|
|
227
|
+
interface FormTool {
|
|
228
|
+
serialize: (form: HTMLFormElement) => { [key: string]: any }
|
|
229
|
+
confirmType: (type: string, value: any) => boolean
|
|
230
|
+
required: (value: any) => string | undefined
|
|
231
|
+
minLength: (value: any, num?: number) => string | undefined
|
|
232
|
+
maxLength: (value: any, num?: number) => string | undefined
|
|
233
|
+
maxPhoneNumber: (value: any, num?: number) => string | undefined
|
|
234
|
+
isNumeric: (value: any) => boolean
|
|
235
|
+
isEmail: (value: any) => boolean
|
|
236
|
+
pattern: (e: Event) => void
|
|
237
|
+
noSpecialChars: (e: Event) => void
|
|
238
|
+
table: (size: [number, number], id: string, elem: HTMLElement) => void
|
|
239
|
+
sanitize: (str: string) => string | undefined
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// --- format ---
|
|
243
|
+
interface FormatTool {
|
|
244
|
+
currency: (value: number, locale?: string, currency?: string) => string
|
|
245
|
+
phoneNumber: (value: string, countryCode?: string) => string
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// --- json ---
|
|
249
|
+
interface JsonTool {
|
|
250
|
+
counter: (json: any, key?: string, val?: any) => number | null
|
|
251
|
+
toCsv: (jsonInput: any) => string
|
|
252
|
+
saveCsvAs: (csvData: string, fileName: string) => void
|
|
253
|
+
is: (str: string) => boolean
|
|
254
|
+
parse: (file: string) => any
|
|
255
|
+
sanitize: (str: string) => string
|
|
256
|
+
sanitizeJsonValue: (str: string) => string
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// --- load ---
|
|
260
|
+
interface LoadTool {
|
|
261
|
+
all: (context: any, cacheName?: string) => void
|
|
262
|
+
file: (filePath: string) => Promise<string>
|
|
263
|
+
fileToElement: (elementSelector: string, filePath: string) => Promise<void>
|
|
264
|
+
json: (filePath: string) => Promise<any>
|
|
265
|
+
remote: (path: string, method?: string, headers?: HeadersInit) => Promise<any>
|
|
266
|
+
script: (scripts: string[], elementSelector?: string) => void
|
|
267
|
+
toJson: (context: any, cacheName?: string) => void
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// --- logging ---
|
|
271
|
+
interface LoggingTool {
|
|
272
|
+
list: {
|
|
273
|
+
type: string
|
|
274
|
+
message: string
|
|
275
|
+
}[]
|
|
276
|
+
reg: (txt: string) => void
|
|
277
|
+
debug: (txt: string) => void
|
|
278
|
+
error: (txt: string) => void
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// --- math ---
|
|
282
|
+
interface MathTool {
|
|
283
|
+
rnd: () => number
|
|
284
|
+
tmr: () => number
|
|
285
|
+
add: (a: number, b: number) => number
|
|
286
|
+
sub: (a: number, b: number) => number
|
|
287
|
+
multi: (a: number, b: number) => number
|
|
288
|
+
div: (a: number, b: number) => number
|
|
289
|
+
rem: (a: number, b: number) => number
|
|
290
|
+
exp: (a: number, b: number) => number
|
|
291
|
+
isOdd: (a: number) => boolean
|
|
292
|
+
float2int: (a: number) => number
|
|
293
|
+
percent: (n: number, tot: number) => number
|
|
294
|
+
isPrime: (n: number) => boolean
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// --- memory ---
|
|
298
|
+
interface MemoryTool {
|
|
299
|
+
lock: (obj: string) => void
|
|
300
|
+
unlock: (obj: string) => void
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// --- navigation ---
|
|
304
|
+
interface NavigationTool {
|
|
305
|
+
load(url: string): Promise<void>
|
|
306
|
+
ajax(): void
|
|
307
|
+
ajax_running?: boolean
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// --- objects ---
|
|
311
|
+
interface ObjectsTool {
|
|
312
|
+
toArray: (object: Record<string, any>) => [string, any][]
|
|
313
|
+
replaceNullObjects: (data: Record<string, any>) => Record<string, any>
|
|
314
|
+
serialize: (value: any) => any
|
|
315
|
+
deSerialize: (valueNew: any) => any
|
|
316
|
+
sort: (o: Record<string, any>) => Record<string, any>
|
|
317
|
+
toXML: (obj: Record<string, any>) => string
|
|
318
|
+
find: (array: any[], key: string, value: any) => any
|
|
319
|
+
instance: (obj: any) => any
|
|
320
|
+
updateByKey: (obj: Record<string, any>, key: string, newValue: any) => Record<string, any>
|
|
321
|
+
findindex: (array: any[], key: string) => number
|
|
322
|
+
parse: (val: any) => any
|
|
323
|
+
isObject: (val: any) => boolean
|
|
324
|
+
diff: (obj1: Record<string, any>, obj2: Record<string, any>) => Record<string, { obj1: any, obj2: any }>
|
|
325
|
+
path: (prop: string, array: string[], separator?: string) => string
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// --- path ---
|
|
329
|
+
interface PathTool {
|
|
330
|
+
rail: () => string[]
|
|
331
|
+
hash: () => string[]
|
|
332
|
+
query: (url: string) => Record<string, string>
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// --- promise ---
|
|
336
|
+
interface PromiseTool {
|
|
337
|
+
check: (p: any) => boolean
|
|
338
|
+
resolve: (data: any) => Promise<any>
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// --- sanitize ---
|
|
342
|
+
interface SanitizeTool {
|
|
343
|
+
html: (s: string) => string
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// --- screen ---
|
|
347
|
+
interface ScreenTool {
|
|
348
|
+
fullScreen: (el: string) => void
|
|
349
|
+
toggle: (el: string) => void
|
|
350
|
+
info: () => {
|
|
351
|
+
width: number
|
|
352
|
+
height: number
|
|
353
|
+
availWidth: number
|
|
354
|
+
availHeight: number
|
|
355
|
+
colorDepth: number
|
|
356
|
+
pixelDepth: number
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// --- scrollbar ---
|
|
361
|
+
interface ScrollbarTool {
|
|
362
|
+
custom: (el: string, options: any) => void
|
|
363
|
+
indicator: (props: any) => void
|
|
364
|
+
position: {
|
|
365
|
+
get: (el: any) => void
|
|
366
|
+
set: (el: any) => void
|
|
367
|
+
}
|
|
368
|
+
smooth: (target: any, speed: any, smooth: any) => void
|
|
369
|
+
scrollTo: (container: string, element: string, gap?: number) => void
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// --- security ---
|
|
373
|
+
interface SecurityTool {
|
|
374
|
+
uuid: {
|
|
375
|
+
byVal: (string: string) => string
|
|
376
|
+
v4: string
|
|
377
|
+
v5: string
|
|
378
|
+
}
|
|
379
|
+
hashPass: (u: string, p: string, t?: string) => Promise<string>
|
|
380
|
+
crypt: (u: string, p: string, mode?: string) => string
|
|
381
|
+
deCrypt: (u: string, p: string, mode?: string) => string
|
|
382
|
+
AES_KeyGen: (passKey?: string) => string
|
|
383
|
+
SHA256_Hex: (passKey: string) => string
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// --- shortcut ---
|
|
387
|
+
interface ShortcutTool {
|
|
388
|
+
keys: (e: any, trigger: any) => void
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// --- socket ---
|
|
392
|
+
interface SocketTool {
|
|
393
|
+
info: () => string
|
|
394
|
+
start: (element: any, server: any, name: string) => void
|
|
395
|
+
conn: (id: any, server: any, name: string) => void
|
|
396
|
+
connect: (server: any, name: string) => void
|
|
397
|
+
open: (id: any, server: any, name: string) => void
|
|
398
|
+
send: (mex: any, type?: string) => void
|
|
399
|
+
ping: (name: string) => void
|
|
400
|
+
receive: (el?: any, name?: string) => void
|
|
401
|
+
keepAlive: (name: string) => void
|
|
402
|
+
check: () => void
|
|
403
|
+
list: () => WebSocket[]
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// --- sse ---
|
|
407
|
+
interface SseTool {
|
|
408
|
+
/**
|
|
409
|
+
* Opens an SSE connection with support for custom fetch options (POST, Headers, etc).
|
|
410
|
+
*/
|
|
411
|
+
open(url: string, options?: any): {
|
|
412
|
+
on(event: "message" | "error" | "open", cb: (data: any) => void): void
|
|
413
|
+
close(): void
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// --- svg ---
|
|
418
|
+
interface SvgTool {
|
|
419
|
+
init: (container: HTMLElement, source1: [HTMLElement, string], source2: [HTMLElement, string], cb?: Function) => void
|
|
420
|
+
check: () => boolean
|
|
421
|
+
update: (rect1: HTMLElement, rect2: HTMLElement, cxn: HTMLElement) => void
|
|
422
|
+
getCurve: (p1: [number, number], p2: [number, number], dx: number) => string
|
|
423
|
+
getIntersection: (dx: number, dy: number, cx: number, cy: number, w: number, h: number) => [number, number]
|
|
424
|
+
setConnector: (source: HTMLElement, side: string) => HTMLElement
|
|
425
|
+
removeConnection: (container: HTMLElement) => void
|
|
426
|
+
makeScrollable: (svgContainer: HTMLElement, scrollContainer: HTMLElement, elm1: HTMLElement, elm2: HTMLElement, rect1: HTMLElement, rect2: HTMLElement) => void
|
|
427
|
+
makeDraggable: (evt: Event) => void
|
|
428
|
+
toggle: (evt: Event, container: HTMLElement, source1: HTMLElement, source2: HTMLElement) => void
|
|
429
|
+
convert: (options: any) => string | void
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// --- sync ---
|
|
433
|
+
interface SyncTool {
|
|
434
|
+
/**
|
|
435
|
+
* Synchronize data between tabs using BroadcastChannel.
|
|
436
|
+
*/
|
|
437
|
+
tab: (channelName: string, callback: (data: any) => void) => { post: (data: any) => void, close: () => void }
|
|
438
|
+
/**
|
|
439
|
+
* Create a Proxy object linked to localStorage for auto-sync.
|
|
440
|
+
*/
|
|
441
|
+
storageProxy: <T extends object>(key: string, initialValue: T) => T
|
|
442
|
+
/**
|
|
443
|
+
* Low-latency cross-tab event bus.
|
|
444
|
+
*/
|
|
445
|
+
pulse: (channelName: string, callback: (data: any) => void) => { emit: (data: any) => void, stop: () => void }
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// --- system ---
|
|
449
|
+
interface SystemTool {
|
|
450
|
+
multiSplit: () => any
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// --- text ---
|
|
454
|
+
interface TextTool {
|
|
455
|
+
trim(s: string, c: string, b: number, e: number): string
|
|
456
|
+
capitalize(txt: string): string
|
|
457
|
+
lower(txt: string): string
|
|
458
|
+
upper(txt: string): string
|
|
459
|
+
nl2br(str: string): string
|
|
460
|
+
sanitize(str: string): string
|
|
461
|
+
camelCase: {
|
|
462
|
+
toSpace(string: string): string
|
|
463
|
+
toUnderscore(string: string): string
|
|
464
|
+
}
|
|
465
|
+
fitContainer(el: string): void
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// --- timer ---
|
|
469
|
+
interface TimerTool {
|
|
470
|
+
sleep(ms: number): Promise<void>
|
|
471
|
+
percentage(start: string, end: string): string
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// --- tools ---
|
|
475
|
+
interface ToolsTool {
|
|
476
|
+
getip(): Promise<void>
|
|
477
|
+
byteSize(bytes: number): string
|
|
478
|
+
zIndex(): number
|
|
479
|
+
zeroToFalse(value: number): boolean | number
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// --- translators ---
|
|
483
|
+
interface TranslatorsTool {
|
|
484
|
+
convertMatrixToScale(values: any): number
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// --- triggers ---
|
|
488
|
+
interface TriggersTool {
|
|
489
|
+
click(elem: string): void
|
|
490
|
+
change(elem: string): void
|
|
491
|
+
input(elem: string): void
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// --- types ---
|
|
495
|
+
interface TypesTool {
|
|
496
|
+
of(p: any): string
|
|
497
|
+
instOfObj(p: any): boolean
|
|
498
|
+
isNull(p: any): (p: any) => boolean
|
|
499
|
+
isBool(val: any): boolean
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// --- ui ---
|
|
503
|
+
interface UiTool {
|
|
504
|
+
anchorContext(): void
|
|
505
|
+
[key: string]: any
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
// --- window ---
|
|
509
|
+
interface WindowTool {
|
|
510
|
+
enhancement(): void
|
|
511
|
+
animationframe(): any
|
|
512
|
+
center(params: { url: string; title: string; name: string; w: number; h: number }): void
|
|
513
|
+
onBeforeUnLoad(e: any): void
|
|
514
|
+
purge(d?: Document, time?: number): void
|
|
515
|
+
stopZoomWheel(e: any): void
|
|
516
|
+
setZoom(element?: string, zoom?: number): string
|
|
517
|
+
getZoom(element?: string): number
|
|
518
|
+
}
|
|
519
|
+
// --- AUTO-GENERATED TOOL TYPES END ---
|
|
520
|
+
|
|
521
|
+
interface _dphelper {
|
|
522
|
+
[key: string]: any
|
|
523
|
+
// --- AUTO-GENERATED TOOL MEMBERS START ---
|
|
524
|
+
ai: AiTool
|
|
525
|
+
anchor: AnchorTool
|
|
526
|
+
array: ArrayTool
|
|
527
|
+
audio: AudioTool
|
|
528
|
+
avoid: AvoidTool
|
|
529
|
+
browser: BrowserTool
|
|
530
|
+
check: CheckTool
|
|
531
|
+
color: ColorTool
|
|
532
|
+
cookie: CookieTool
|
|
533
|
+
coords: CoordsTool
|
|
534
|
+
credits: CreditsTool
|
|
535
|
+
date: DateTool
|
|
536
|
+
disable: DisableTool
|
|
537
|
+
dispatch: DispatchTool
|
|
538
|
+
element: ElementsTool
|
|
539
|
+
events: EventsTool
|
|
540
|
+
fetch: FetchTool
|
|
541
|
+
form: FormTool
|
|
542
|
+
format: FormatTool
|
|
543
|
+
json: JsonTool
|
|
544
|
+
load: LoadTool
|
|
545
|
+
logging: LoggingTool
|
|
546
|
+
math: MathTool
|
|
547
|
+
memory: MemoryTool
|
|
548
|
+
navigation: NavigationTool
|
|
549
|
+
object: ObjectsTool
|
|
550
|
+
path: PathTool
|
|
551
|
+
promise: PromiseTool
|
|
552
|
+
sanitize: SanitizeTool
|
|
553
|
+
screen: ScreenTool
|
|
554
|
+
scrollbar: ScrollbarTool
|
|
555
|
+
security: SecurityTool
|
|
556
|
+
shortcut: ShortcutTool
|
|
557
|
+
socket: SocketTool
|
|
558
|
+
sse: SseTool
|
|
559
|
+
svg: SvgTool
|
|
560
|
+
sync: SyncTool
|
|
561
|
+
system: SystemTool
|
|
562
|
+
text: TextTool
|
|
563
|
+
timer: TimerTool
|
|
564
|
+
tools: ToolsTool
|
|
565
|
+
translators: TranslatorsTool
|
|
566
|
+
trigger: TriggersTool
|
|
567
|
+
type: TypesTool
|
|
568
|
+
ui: UiTool
|
|
569
|
+
window: WindowTool
|
|
570
|
+
// --- AUTO-GENERATED TOOL MEMBERS END ---
|
|
571
|
+
setDescription: (description: Description, newObj: any) => void
|
|
572
|
+
setProps: (root: any, desc: any, options?: any) => void
|
|
573
|
+
_list: {
|
|
574
|
+
scripts: Description[]
|
|
575
|
+
sockets: any[]
|
|
576
|
+
[key: string]: any
|
|
577
|
+
}
|
|
578
|
+
version: string
|
|
579
|
+
isServer: boolean
|
|
580
|
+
isBrowser: boolean
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
var dphelper: _dphelper
|
|
584
|
+
|
|
10
585
|
interface Window {
|
|
11
|
-
dphelper:
|
|
586
|
+
dphelper: _dphelper
|
|
12
587
|
}
|
|
13
588
|
|
|
14
589
|
interface SubCommand {
|
|
@@ -31,142 +606,6 @@ declare global {
|
|
|
31
606
|
subCommand: SubCommand[]
|
|
32
607
|
}
|
|
33
608
|
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// --- AUTO-GENERATED TOOL TYPES START ---
|
|
38
|
-
import { AiTool } from "../tools/ai/index"
|
|
39
|
-
import { AnchorTool } from "../tools/anchor/index"
|
|
40
|
-
import { ArrayTool } from "../tools/array/index"
|
|
41
|
-
import { AudioTool } from "../tools/audio/index"
|
|
42
|
-
import { AvoidTool } from "../tools/avoid/index"
|
|
43
|
-
import { BrowserTool } from "../tools/browser/index"
|
|
44
|
-
import { CheckTool } from "../tools/check/index"
|
|
45
|
-
import { ColorTool } from "../tools/color/index"
|
|
46
|
-
import { CookieTool } from "../tools/cookie/index"
|
|
47
|
-
import { CoordsTool } from "../tools/coords/index"
|
|
48
|
-
import { CreditsTool } from "../tools/credits/index"
|
|
49
|
-
import { DateTool } from "../tools/date/index"
|
|
50
|
-
import { DisableTool } from "../tools/disable/index"
|
|
51
|
-
import { DispatchTool } from "../tools/dispatch/index"
|
|
52
|
-
import { ElementsTool } from "../tools/elements/index"
|
|
53
|
-
import { EventsTool } from "../tools/events/index"
|
|
54
|
-
import { FetchTool } from "../tools/fetch/index"
|
|
55
|
-
import { FormTool } from "../tools/form/index"
|
|
56
|
-
import { FormatTool } from "../tools/format/index"
|
|
57
|
-
import { JsonTool } from "../tools/json/index"
|
|
58
|
-
import { LoadTool } from "../tools/load/index"
|
|
59
|
-
import { LoggingTool } from "../tools/logging/index"
|
|
60
|
-
import { MathTool } from "../tools/math/index"
|
|
61
|
-
import { MemoryTool } from "../tools/memory/index"
|
|
62
|
-
import { ObjectsTool } from "../tools/objects/index"
|
|
63
|
-
import { PathTool } from "../tools/path/index"
|
|
64
|
-
import { PromiseTool } from "../tools/promise/index"
|
|
65
|
-
import { SanitizeTool } from "../tools/sanitize/index"
|
|
66
|
-
import { ScreenTool } from "../tools/screen/index"
|
|
67
|
-
import { ScrollbarTool } from "../tools/scrollbar/index"
|
|
68
|
-
import { SecurityTool } from "../tools/security/index"
|
|
69
|
-
import { ShortcutTool } from "../tools/shortcut/index"
|
|
70
|
-
import { SocketTool } from "../tools/socket/index"
|
|
71
|
-
import { SseTool } from "../tools/sse/index"
|
|
72
|
-
import { SvgTool } from "../tools/svg/index"
|
|
73
|
-
import { SyncTool } from "../tools/sync/index"
|
|
74
|
-
import { SystemTool } from "../tools/system/index"
|
|
75
|
-
import { TextTool } from "../tools/text/index"
|
|
76
|
-
import { TimerTool } from "../tools/timer/index"
|
|
77
|
-
import { ToolsTool } from "../tools/tools/index"
|
|
78
|
-
import { TranslatorsTool } from "../tools/translators/index"
|
|
79
|
-
import { TriggersTool } from "../tools/triggers/index"
|
|
80
|
-
import { TypesTool } from "../tools/types/index"
|
|
81
|
-
import { UiTool } from "../tools/ui/index"
|
|
82
|
-
import { WindowTool } from "../tools/window/index"
|
|
83
|
-
// --- AUTO-GENERATED TOOL TYPES END ---
|
|
84
|
-
|
|
85
|
-
// --- GLOBALS ---
|
|
86
|
-
|
|
87
|
-
type RTC_PEER_CONNECTION_LIKE = {
|
|
88
|
-
new(configuration?: RTCConfiguration): RTCPeerConnection
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
declare const mozRTCPeerConnection: RTC_PEER_CONNECTION_LIKE
|
|
92
|
-
declare const webkitRTCPeerConnection: RTC_PEER_CONNECTION_LIKE
|
|
93
|
-
|
|
94
|
-
declare const require: {
|
|
95
|
-
(id: string): unknown
|
|
96
|
-
context: (directory: string, useSubdirectories?: boolean, regExp?: RegExp) => {
|
|
97
|
-
(id: string): unknown
|
|
98
|
-
keys(): string[]
|
|
99
|
-
resolve(id: string): string
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
type RequireType = object
|
|
104
|
-
|
|
105
|
-
declare function confirm(message: string, func1: Function, func2?: Function): boolean
|
|
106
|
-
|
|
107
|
-
// --- DPHELPER ---
|
|
108
|
-
|
|
109
|
-
export interface _dphelper {
|
|
110
|
-
[key: string]: any
|
|
111
|
-
|
|
112
|
-
// --- AUTO-GENERATED TOOL MEMBERS START ---
|
|
113
|
-
ai: AiTool
|
|
114
|
-
anchor: AnchorTool
|
|
115
|
-
array: ArrayTool
|
|
116
|
-
audio: AudioTool
|
|
117
|
-
avoid: AvoidTool
|
|
118
|
-
browser: BrowserTool
|
|
119
|
-
check: CheckTool
|
|
120
|
-
color: ColorTool
|
|
121
|
-
cookie: CookieTool
|
|
122
|
-
coords: CoordsTool
|
|
123
|
-
credits: CreditsTool
|
|
124
|
-
date: DateTool
|
|
125
|
-
disable: DisableTool
|
|
126
|
-
dispatch: DispatchTool
|
|
127
|
-
element: ElementsTool
|
|
128
|
-
events: EventsTool
|
|
129
|
-
fetch: FetchTool
|
|
130
|
-
form: FormTool
|
|
131
|
-
format: FormatTool
|
|
132
|
-
json: JsonTool
|
|
133
|
-
load: LoadTool
|
|
134
|
-
logging: LoggingTool
|
|
135
|
-
math: MathTool
|
|
136
|
-
memory: MemoryTool
|
|
137
|
-
object: ObjectsTool
|
|
138
|
-
path: PathTool
|
|
139
|
-
promise: PromiseTool
|
|
140
|
-
sanitize: SanitizeTool
|
|
141
|
-
screen: ScreenTool
|
|
142
|
-
scrollbar: ScrollbarTool
|
|
143
|
-
security: SecurityTool
|
|
144
|
-
shortcut: ShortcutTool
|
|
145
|
-
socket: SocketTool
|
|
146
|
-
sse: SseTool
|
|
147
|
-
svg: SvgTool
|
|
148
|
-
sync: SyncTool
|
|
149
|
-
system: SystemTool
|
|
150
|
-
text: TextTool
|
|
151
|
-
timer: TimerTool
|
|
152
|
-
tools: ToolsTool
|
|
153
|
-
translators: TranslatorsTool
|
|
154
|
-
trigger: TriggersTool
|
|
155
|
-
type: TypesTool
|
|
156
|
-
ui: UiTool
|
|
157
|
-
window: WindowTool
|
|
158
|
-
// --- AUTO-GENERATED TOOL MEMBERS END ---
|
|
159
|
-
|
|
160
|
-
setDescription: (description: Description, newObj: any) => void
|
|
161
|
-
setProps: (root: any, desc: any, options?: any) => void
|
|
162
|
-
_list: {
|
|
163
|
-
scripts: Description[]
|
|
164
|
-
sockets: any[]
|
|
165
|
-
[key: string]: any
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
declare var dphelper: _dphelper
|
|
170
|
-
type dphelper = _dphelper
|
|
609
|
+
function confirm(message: string, func1: Function, func2?: Function): boolean
|
|
171
610
|
|
|
172
|
-
|
|
611
|
+
} // end declare global
|