yvee 0.0.8 → 0.0.10
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/dist/index.d.ts +763 -476
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
type ModuleLike = {
|
|
2
|
+
[Symbol.toStringTag]: "Module";
|
|
3
|
+
default?: unknown;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
};
|
|
1
6
|
declare const isFN: (v: any) => v is Function;
|
|
2
7
|
declare const isAsync: (v: any) => v is Function;
|
|
3
8
|
declare const isPromise: (v: any) => v is Function;
|
|
4
9
|
declare const isNumber: (value: any) => boolean;
|
|
5
10
|
declare const isObject: (val: any) => val is Record<string, any>;
|
|
6
11
|
declare const isPlainObject: (value: any) => boolean;
|
|
12
|
+
declare const isModule: (obj: any) => obj is ModuleLike;
|
|
7
13
|
declare const isArraybuff: (val: any) => val is string | ArrayBuffer | Uint8Array<ArrayBufferLike>;
|
|
8
14
|
declare const isClassOrId: (k: string) => boolean;
|
|
9
15
|
declare const isBool: (v: any) => v is boolean;
|
|
@@ -19,6 +25,7 @@ declare const isInt: (str: string) => boolean;
|
|
|
19
25
|
declare const isWindow: boolean;
|
|
20
26
|
declare const isNotWindow: boolean;
|
|
21
27
|
|
|
28
|
+
type is_ModuleLike = ModuleLike;
|
|
22
29
|
declare const is_isArr: typeof isArr;
|
|
23
30
|
declare const is_isArraybuff: typeof isArraybuff;
|
|
24
31
|
declare const is_isAsync: typeof isAsync;
|
|
@@ -27,6 +34,7 @@ declare const is_isClassOrId: typeof isClassOrId;
|
|
|
27
34
|
declare const is_isDefined: typeof isDefined;
|
|
28
35
|
declare const is_isFN: typeof isFN;
|
|
29
36
|
declare const is_isInt: typeof isInt;
|
|
37
|
+
declare const is_isModule: typeof isModule;
|
|
30
38
|
declare const is_isNotNull: typeof isNotNull;
|
|
31
39
|
declare const is_isNotWindow: typeof isNotWindow;
|
|
32
40
|
declare const is_isNull: typeof isNull;
|
|
@@ -40,32 +48,15 @@ declare const is_isStr: typeof isStr;
|
|
|
40
48
|
declare const is_isUndefined: typeof isUndefined;
|
|
41
49
|
declare const is_isWindow: typeof isWindow;
|
|
42
50
|
declare namespace is {
|
|
43
|
-
export {
|
|
44
|
-
|
|
45
|
-
is_isArraybuff as isArraybuff,
|
|
46
|
-
is_isAsync as isAsync,
|
|
47
|
-
is_isBool as isBool,
|
|
48
|
-
is_isClassOrId as isClassOrId,
|
|
49
|
-
is_isDefined as isDefined,
|
|
50
|
-
is_isFN as isFN,
|
|
51
|
-
is_isInt as isInt,
|
|
52
|
-
is_isNotNull as isNotNull,
|
|
53
|
-
is_isNotWindow as isNotWindow,
|
|
54
|
-
is_isNull as isNull,
|
|
55
|
-
is_isNum as isNum,
|
|
56
|
-
is_isNumber as isNumber,
|
|
57
|
-
is_isObj as isObj,
|
|
58
|
-
is_isObject as isObject,
|
|
59
|
-
is_isPlainObject as isPlainObject,
|
|
60
|
-
is_isPromise as isPromise,
|
|
61
|
-
is_isStr as isStr,
|
|
62
|
-
is_isUndefined as isUndefined,
|
|
63
|
-
is_isWindow as isWindow,
|
|
64
|
-
};
|
|
51
|
+
export { is_isArr as isArr, is_isArraybuff as isArraybuff, is_isAsync as isAsync, is_isBool as isBool, is_isClassOrId as isClassOrId, is_isDefined as isDefined, is_isFN as isFN, is_isInt as isInt, is_isModule as isModule, is_isNotNull as isNotNull, is_isNotWindow as isNotWindow, is_isNull as isNull, is_isNum as isNum, is_isNumber as isNumber, is_isObj as isObj, is_isObject as isObject, is_isPlainObject as isPlainObject, is_isPromise as isPromise, is_isStr as isStr, is_isUndefined as isUndefined, is_isWindow as isWindow };
|
|
52
|
+
export type { is_ModuleLike as ModuleLike };
|
|
65
53
|
}
|
|
66
54
|
|
|
55
|
+
declare const IfClient: <T>(fn: () => T) => T | undefined;
|
|
56
|
+
|
|
67
57
|
type V = string | number | boolean;
|
|
68
58
|
type obj$1<T> = Record<string, T>;
|
|
59
|
+
type maybePromise<T> = Promise<T> | T;
|
|
69
60
|
|
|
70
61
|
/**
|
|
71
62
|
* A custom Map implementation that provides additional utility methods for working with objects and maps.
|
|
@@ -86,13 +77,6 @@ declare class log {
|
|
|
86
77
|
static set e(a: any);
|
|
87
78
|
static set w(a: any);
|
|
88
79
|
}
|
|
89
|
-
declare class idm {
|
|
90
|
-
_c: number;
|
|
91
|
-
_id: string;
|
|
92
|
-
constructor(mid?: string);
|
|
93
|
-
get id(): string;
|
|
94
|
-
get mid(): string;
|
|
95
|
-
}
|
|
96
80
|
|
|
97
81
|
interface metaViewport {
|
|
98
82
|
width?: string;
|
|
@@ -194,31 +178,37 @@ interface headAttr {
|
|
|
194
178
|
link?: link<string>[];
|
|
195
179
|
script?: script<string | boolean>[];
|
|
196
180
|
css?: string[] | string;
|
|
181
|
+
js?: string[] | string;
|
|
197
182
|
description?: string;
|
|
198
183
|
}
|
|
199
|
-
declare class head implements headAttr {
|
|
184
|
+
declare abstract class head implements headAttr {
|
|
200
185
|
title?: string;
|
|
201
186
|
description?: string;
|
|
202
|
-
|
|
187
|
+
css?: string[] | string;
|
|
188
|
+
js?: string[] | string;
|
|
203
189
|
meta?: meta<string>[] | Meta;
|
|
204
190
|
link?: link<string>[];
|
|
205
191
|
script?: script<string | boolean>[];
|
|
206
|
-
css?: string[] | string;
|
|
207
192
|
}
|
|
208
|
-
type CSSinT
|
|
193
|
+
type CSSinT = {
|
|
209
194
|
[P in keyof CSSStyleDeclaration]?: V;
|
|
210
195
|
} & {
|
|
211
196
|
[key: string]: V;
|
|
212
197
|
};
|
|
213
|
-
type headType = Mapper<keyof
|
|
198
|
+
type headType = Mapper<keyof headAttr, any>;
|
|
199
|
+
interface hHeadCFG {
|
|
200
|
+
initial?: headType;
|
|
201
|
+
mark?: boolean;
|
|
202
|
+
push?: obj$1<any>;
|
|
203
|
+
}
|
|
214
204
|
declare class htmlHead {
|
|
215
205
|
lang: string;
|
|
216
206
|
htmlHead: headType;
|
|
217
|
-
head: (heads?: headAttr) => void;
|
|
218
|
-
constructor();
|
|
207
|
+
head: (heads?: Omit<headAttr, "base">) => void;
|
|
208
|
+
constructor({ mark, push }?: hHeadCFG);
|
|
219
209
|
}
|
|
220
|
-
declare const cssLoader: (vv: link<string>) => Promise<
|
|
221
|
-
declare function addCSS(selector: string, rules?: CSSinT
|
|
210
|
+
declare const cssLoader: (vv: link<string>) => Promise<HTMLLinkElement | undefined>;
|
|
211
|
+
declare function addCSS(selector: string, rules?: CSSinT): void;
|
|
222
212
|
|
|
223
213
|
declare class MinStorage {
|
|
224
214
|
readonly path: string;
|
|
@@ -231,12 +221,13 @@ declare class MinStorage {
|
|
|
231
221
|
* string | int | float | file | uuid
|
|
232
222
|
* - /path/\<string:hell>
|
|
233
223
|
*/
|
|
234
|
-
declare class Storage
|
|
224
|
+
declare class Storage<T extends MinStorage> {
|
|
235
225
|
private _storage;
|
|
236
226
|
private CC;
|
|
237
227
|
constructor();
|
|
238
228
|
set(min: T): void;
|
|
239
229
|
get(path: string): [T | undefined, Record<string, string>];
|
|
230
|
+
keys(): MapIterator<string>;
|
|
240
231
|
}
|
|
241
232
|
|
|
242
233
|
declare class Time {
|
|
@@ -268,7 +259,7 @@ declare class __ {
|
|
|
268
259
|
static randArray<T>(arr?: T[], length?: number, unique?: boolean): T[];
|
|
269
260
|
static randomAZ: () => string;
|
|
270
261
|
static makeID: (length: number) => string;
|
|
271
|
-
static class(a: obj$1<any>, ...classes: string[]): void;
|
|
262
|
+
static class(a: obj$1<any>, ...classes: (string | undefined | boolean)[]): void;
|
|
272
263
|
static get O(): {
|
|
273
264
|
vals: {
|
|
274
265
|
<T>(o: {
|
|
@@ -297,10 +288,27 @@ declare class __ {
|
|
|
297
288
|
};
|
|
298
289
|
static get is(): typeof is;
|
|
299
290
|
static get return(): typeof returner;
|
|
291
|
+
static isHREF(pt: string, hpt: string): boolean;
|
|
300
292
|
static sleep: (ms?: number) => Promise<unknown>;
|
|
301
293
|
static get screen(): "xs" | "sm" | "smd" | "md" | "lg" | "xl" | "xxl" | undefined;
|
|
302
294
|
bytes(bytes: number): string;
|
|
303
295
|
static format(val: any): Formatteer;
|
|
296
|
+
static compareObjects: <T extends object>(oldObj: T, newObj: T | any) => {
|
|
297
|
+
added: Record<string, any>;
|
|
298
|
+
removed: Record<string, any>;
|
|
299
|
+
modified: Record<string, {
|
|
300
|
+
old: any;
|
|
301
|
+
new: any;
|
|
302
|
+
}>;
|
|
303
|
+
};
|
|
304
|
+
static isObjectUdpated: (changes: {
|
|
305
|
+
added: Record<string, any>;
|
|
306
|
+
removed: Record<string, any>;
|
|
307
|
+
modified: Record<string, {
|
|
308
|
+
old: any;
|
|
309
|
+
new: any;
|
|
310
|
+
}>;
|
|
311
|
+
}) => boolean;
|
|
304
312
|
}
|
|
305
313
|
declare class returner {
|
|
306
314
|
static arr<T = string>(val?: any): T[];
|
|
@@ -316,95 +324,566 @@ declare class Formatteer {
|
|
|
316
324
|
get pr(): string;
|
|
317
325
|
}
|
|
318
326
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
states: ((id: string) => () => void)[];
|
|
324
|
-
events: Mapper<string, (...arg: any) => any>;
|
|
325
|
-
OZ: OZ;
|
|
326
|
-
constructor(xid: string, IDM?: idm, _OZ?: OZ);
|
|
327
|
-
attr_push(key: string, val: any, pre?: string): void;
|
|
328
|
-
get attr(): string;
|
|
329
|
-
set id(id: string);
|
|
330
|
-
get id(): string | undefined;
|
|
327
|
+
type hookFN<T extends any[]> = (...args: statefulValue<T>) => maybePromise<void>;
|
|
328
|
+
interface stateCFG {
|
|
329
|
+
id?: string;
|
|
330
|
+
init?: boolean;
|
|
331
331
|
}
|
|
332
|
+
declare function StateHook<T extends any[]>(callback: hookFN<T>, statefuls: [...{
|
|
333
|
+
[K in keyof T]: Stateful<T[K]>;
|
|
334
|
+
}], { id, init }?: stateCFG): Promise<() => void>;
|
|
332
335
|
|
|
333
|
-
|
|
334
|
-
|
|
336
|
+
type statefulValue<T extends any[]> = {
|
|
337
|
+
[K in keyof T]: T[K] extends Stateful<infer U> ? U : T[K];
|
|
338
|
+
};
|
|
339
|
+
declare class Stateful<T> extends EventTarget {
|
|
340
|
+
private options;
|
|
341
|
+
private deep;
|
|
342
|
+
private verify;
|
|
343
|
+
private hooks;
|
|
335
344
|
private states;
|
|
336
|
-
private
|
|
337
|
-
private
|
|
338
|
-
private
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
get processWindowEvents(): this;
|
|
346
|
-
reset(id: string[]): this;
|
|
347
|
-
RPS(oz?: this): this;
|
|
345
|
+
private _value;
|
|
346
|
+
private listening;
|
|
347
|
+
private end?;
|
|
348
|
+
constructor(value: T, options?: AddEventListenerOptions, deep?: boolean, verify?: boolean);
|
|
349
|
+
get value(): T;
|
|
350
|
+
set value(newValue: T);
|
|
351
|
+
get listen(): () => void;
|
|
352
|
+
call<Q>(callback: (this: Elements, arg: T) => Q, entry: string): (id: string) => () => void;
|
|
353
|
+
hook<T extends any[]>(callback: hookFN<T>): (id: string) => () => void;
|
|
348
354
|
}
|
|
355
|
+
declare function State<T>(value: T, options?: AddEventListenerOptions): Stateful<T>;
|
|
356
|
+
/**
|
|
357
|
+
* Quick State checking - skip checking of Object keys:values as it will only be compared as a===b
|
|
358
|
+
*/
|
|
359
|
+
declare function QState<T>(value: T, verify?: boolean): Stateful<T>;
|
|
349
360
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}
|
|
361
|
+
type CSSStyle = {
|
|
362
|
+
[P in keyof CSSStyleDeclaration]?: DVal;
|
|
363
|
+
} & {
|
|
364
|
+
[key: string]: DVal;
|
|
365
|
+
};
|
|
356
366
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
367
|
+
interface c_events<T extends Elements = HTMLElement> {
|
|
368
|
+
state?: (this: T, e: T) => [(...args: any[]) => void, Stateful<any>[], boolean?];
|
|
369
|
+
ready?: (this: T, e: T) => void;
|
|
370
|
+
resize?: (this: T, e: UIEvent) => void;
|
|
371
|
+
beforeunload?: (this: T, e: BeforeUnloadEvent) => void;
|
|
372
|
+
popstate?: (this: T, e: PopStateEvent) => void;
|
|
373
|
+
winscroll?: (this: T, e: Event) => void;
|
|
374
|
+
winload?: (this: T, e: Event) => void;
|
|
375
|
+
winfocus?: (this: T, e: Event) => void;
|
|
376
|
+
winblur?: (this: T, e: Event) => void;
|
|
362
377
|
}
|
|
363
|
-
declare function eventStream(url: string, withCredentials?: boolean): eStream;
|
|
364
378
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
379
|
+
interface EAttr<T = DVal> {
|
|
380
|
+
[key: string]: any;
|
|
381
|
+
[key: `data-${string}`]: T | any;
|
|
382
|
+
accesskey?: T;
|
|
383
|
+
autocapitalize?: T;
|
|
384
|
+
class?: T;
|
|
385
|
+
on?: events<any>;
|
|
386
|
+
contenteditable?: T;
|
|
387
|
+
dir?: T;
|
|
388
|
+
draggable?: T;
|
|
389
|
+
hidden?: T;
|
|
390
|
+
id?: T;
|
|
391
|
+
itemprop?: T;
|
|
392
|
+
lang?: T;
|
|
393
|
+
role?: T;
|
|
394
|
+
slot?: T;
|
|
395
|
+
spellcheck?: T;
|
|
396
|
+
style?: CSSStyle | string;
|
|
397
|
+
tabindex?: T;
|
|
398
|
+
title?: T;
|
|
399
|
+
translate?: T;
|
|
400
|
+
}
|
|
401
|
+
interface ElementAttributes {
|
|
402
|
+
link: linkAttr;
|
|
403
|
+
base: baseAttr;
|
|
404
|
+
meta: metaAttr;
|
|
405
|
+
p: EAttr;
|
|
406
|
+
br: EAttr;
|
|
407
|
+
hr: EAttr;
|
|
408
|
+
h: EAttr;
|
|
409
|
+
cmnt: EAttr;
|
|
410
|
+
root: EAttr;
|
|
411
|
+
div: EAttr;
|
|
412
|
+
span: EAttr;
|
|
413
|
+
header: EAttr;
|
|
414
|
+
hgroup: EAttr;
|
|
415
|
+
footer: EAttr;
|
|
416
|
+
main: EAttr;
|
|
417
|
+
section: EAttr;
|
|
418
|
+
search: EAttr;
|
|
419
|
+
article: EAttr;
|
|
420
|
+
aside: EAttr;
|
|
421
|
+
details: detailsAttr;
|
|
422
|
+
dialog: dialogAttr;
|
|
423
|
+
summary: EAttr;
|
|
424
|
+
data: dataAttr;
|
|
425
|
+
noscript: EAttr;
|
|
426
|
+
object: objectAttr;
|
|
427
|
+
param: paramAttr;
|
|
428
|
+
script: scriptAttr;
|
|
429
|
+
a: aAttr;
|
|
430
|
+
nav: EAttr;
|
|
431
|
+
style: styleAttr;
|
|
432
|
+
audio: audioAttr;
|
|
433
|
+
video: videoAttr;
|
|
434
|
+
source: sourceAttr;
|
|
435
|
+
track: trackAttr;
|
|
436
|
+
img: imgAttr;
|
|
437
|
+
map: mapAttr;
|
|
438
|
+
area: areaAttr;
|
|
439
|
+
canvas: canvasAttr;
|
|
440
|
+
figcaption: EAttr;
|
|
441
|
+
figure: EAttr;
|
|
442
|
+
picture: EAttr;
|
|
443
|
+
iframe: iframeAttr;
|
|
444
|
+
form: formAttr;
|
|
445
|
+
input: inputAttr;
|
|
446
|
+
textarea: textareaAttr;
|
|
447
|
+
button: buttonAttr;
|
|
448
|
+
select: selectAttr;
|
|
449
|
+
optgroup: optgroupAttr;
|
|
450
|
+
option: optionAttr;
|
|
451
|
+
label: labelAttr;
|
|
452
|
+
fieldset: fieldsetAttr;
|
|
453
|
+
legend: EAttr;
|
|
454
|
+
datalist: EAttr;
|
|
455
|
+
table: EAttr;
|
|
456
|
+
caption: EAttr;
|
|
457
|
+
th: thAttr;
|
|
458
|
+
tr: EAttr;
|
|
459
|
+
td: tdAttr;
|
|
460
|
+
thead: EAttr;
|
|
461
|
+
tbody: EAttr;
|
|
462
|
+
tfoot: EAttr;
|
|
463
|
+
col: colAttr;
|
|
464
|
+
colgroup: colgroupAttr;
|
|
465
|
+
b: EAttr;
|
|
466
|
+
i: EAttr;
|
|
467
|
+
q: qAttr;
|
|
468
|
+
s: EAttr;
|
|
469
|
+
u: EAttr;
|
|
470
|
+
em: EAttr;
|
|
471
|
+
rp: EAttr;
|
|
472
|
+
del: delAttr;
|
|
473
|
+
dfn: EAttr;
|
|
474
|
+
ins: insAttr;
|
|
475
|
+
kbd: EAttr;
|
|
476
|
+
pre: EAttr;
|
|
477
|
+
sub: EAttr;
|
|
478
|
+
sup: EAttr;
|
|
479
|
+
var: EAttr;
|
|
480
|
+
wbr: EAttr;
|
|
481
|
+
cite: EAttr;
|
|
482
|
+
time: timeAttr;
|
|
483
|
+
abbr: EAttr;
|
|
484
|
+
code: EAttr;
|
|
485
|
+
mark: EAttr;
|
|
486
|
+
samp: EAttr;
|
|
487
|
+
meter: meterAttr;
|
|
488
|
+
small: EAttr;
|
|
489
|
+
strong: EAttr;
|
|
490
|
+
address: EAttr;
|
|
491
|
+
progress: progressAttr;
|
|
492
|
+
template: EAttr;
|
|
493
|
+
blockquote: blockquoteAttr;
|
|
494
|
+
menu: menuAttr;
|
|
495
|
+
ul: EAttr;
|
|
496
|
+
ol: olAttr;
|
|
497
|
+
li: liAttr;
|
|
498
|
+
dl: EAttr;
|
|
499
|
+
dt: EAttr;
|
|
500
|
+
dd: EAttr;
|
|
501
|
+
h1: EAttr;
|
|
502
|
+
h2: EAttr;
|
|
503
|
+
h3: EAttr;
|
|
504
|
+
h4: EAttr;
|
|
505
|
+
h5: EAttr;
|
|
506
|
+
h6: EAttr;
|
|
507
|
+
}
|
|
508
|
+
interface SVGAttributes {
|
|
509
|
+
svg: EAttr;
|
|
510
|
+
path: EAttr;
|
|
511
|
+
circle: EAttr;
|
|
512
|
+
animate: EAttr;
|
|
513
|
+
animateMotion: EAttr;
|
|
514
|
+
animateTransform: EAttr;
|
|
515
|
+
clipPath: EAttr;
|
|
516
|
+
defs: EAttr;
|
|
517
|
+
desc: EAttr;
|
|
518
|
+
ellipse: EAttr;
|
|
519
|
+
feBlend: EAttr;
|
|
520
|
+
feColorMatrix: EAttr;
|
|
521
|
+
feComponentTransfer: EAttr;
|
|
522
|
+
feComposite: EAttr;
|
|
523
|
+
feConvolveMatrix: EAttr;
|
|
524
|
+
feDiffuseLighting: EAttr;
|
|
525
|
+
feDisplacementMap: EAttr;
|
|
526
|
+
feDistantLight: EAttr;
|
|
527
|
+
feDropShadow: EAttr;
|
|
528
|
+
feFlood: EAttr;
|
|
529
|
+
feFuncA: EAttr;
|
|
530
|
+
feFuncB: EAttr;
|
|
531
|
+
feFuncG: EAttr;
|
|
532
|
+
feFuncR: EAttr;
|
|
533
|
+
feGaussianBlur: EAttr;
|
|
534
|
+
feImage: EAttr;
|
|
535
|
+
feMerge: EAttr;
|
|
536
|
+
feMergeNode: EAttr;
|
|
537
|
+
feMorphology: EAttr;
|
|
538
|
+
feOffset: EAttr;
|
|
539
|
+
fePointLight: EAttr;
|
|
540
|
+
feSpecularLighting: EAttr;
|
|
541
|
+
feSpotLight: EAttr;
|
|
542
|
+
feTile: EAttr;
|
|
543
|
+
feTurbulence: EAttr;
|
|
544
|
+
filter: EAttr;
|
|
545
|
+
foreignObject: EAttr;
|
|
546
|
+
g: EAttr;
|
|
547
|
+
image: EAttr;
|
|
548
|
+
line: EAttr;
|
|
549
|
+
linearGradient: EAttr;
|
|
550
|
+
marker: EAttr;
|
|
551
|
+
mask: EAttr;
|
|
552
|
+
metadata: EAttr;
|
|
553
|
+
mpath: EAttr;
|
|
554
|
+
pattern: EAttr;
|
|
555
|
+
polygon: EAttr;
|
|
556
|
+
polyline: EAttr;
|
|
557
|
+
radialGradient: EAttr;
|
|
558
|
+
rect: EAttr;
|
|
559
|
+
set: EAttr;
|
|
560
|
+
stop: EAttr;
|
|
561
|
+
symbol: EAttr;
|
|
562
|
+
text: EAttr;
|
|
563
|
+
textPath: EAttr;
|
|
564
|
+
title: EAttr;
|
|
565
|
+
tspan: EAttr;
|
|
566
|
+
use: EAttr;
|
|
567
|
+
view: EAttr;
|
|
568
|
+
}
|
|
569
|
+
interface aAttr<T = DVal> extends EAttr {
|
|
570
|
+
download?: T;
|
|
571
|
+
href?: T;
|
|
572
|
+
hreflang?: T;
|
|
573
|
+
media?: T;
|
|
574
|
+
ping?: T;
|
|
575
|
+
referrerpolicy?: T;
|
|
576
|
+
rel?: T;
|
|
577
|
+
shape?: T;
|
|
578
|
+
target?: T;
|
|
579
|
+
}
|
|
580
|
+
interface areaAttr<T = DVal> extends EAttr {
|
|
581
|
+
alt?: T;
|
|
582
|
+
coords?: T;
|
|
583
|
+
download?: T;
|
|
584
|
+
href?: T;
|
|
585
|
+
media?: T;
|
|
586
|
+
ping?: T;
|
|
587
|
+
referrerpolicy?: T;
|
|
588
|
+
rel?: T;
|
|
589
|
+
shape?: T;
|
|
590
|
+
target?: T;
|
|
591
|
+
}
|
|
592
|
+
interface audioAttr<T = DVal> extends EAttr {
|
|
593
|
+
autoplay?: T;
|
|
594
|
+
controls?: T;
|
|
595
|
+
crossorigin?: T;
|
|
596
|
+
loop?: T;
|
|
597
|
+
muted?: T;
|
|
598
|
+
preload?: T;
|
|
599
|
+
src?: T;
|
|
600
|
+
}
|
|
601
|
+
interface baseAttr<T = DVal> extends EAttr {
|
|
602
|
+
href?: T;
|
|
603
|
+
target?: T;
|
|
604
|
+
}
|
|
605
|
+
interface blockquoteAttr<T = DVal> extends EAttr {
|
|
606
|
+
cite?: T;
|
|
607
|
+
}
|
|
608
|
+
interface buttonAttr<T = DVal> extends EAttr {
|
|
609
|
+
disabled?: T;
|
|
610
|
+
form?: T;
|
|
611
|
+
formaction?: T;
|
|
612
|
+
formenctype?: T;
|
|
613
|
+
formmethod?: T;
|
|
614
|
+
formnovalidate?: T;
|
|
615
|
+
formtarget?: T;
|
|
616
|
+
name?: T;
|
|
617
|
+
type?: T;
|
|
618
|
+
value?: T;
|
|
619
|
+
}
|
|
620
|
+
interface canvasAttr<T = DVal> extends EAttr {
|
|
621
|
+
height?: T;
|
|
622
|
+
width?: T;
|
|
623
|
+
}
|
|
624
|
+
interface colAttr<T = DVal> extends EAttr {
|
|
625
|
+
span?: T;
|
|
626
|
+
}
|
|
627
|
+
interface colgroupAttr<T = DVal> extends EAttr {
|
|
628
|
+
span?: T;
|
|
629
|
+
}
|
|
630
|
+
interface dataAttr<T = DVal> extends EAttr {
|
|
631
|
+
value?: T;
|
|
632
|
+
}
|
|
633
|
+
interface delAttr<T = DVal> extends EAttr {
|
|
634
|
+
cite?: T;
|
|
635
|
+
datetime?: T;
|
|
636
|
+
}
|
|
637
|
+
interface detailsAttr<T = DVal> extends EAttr {
|
|
638
|
+
open?: T;
|
|
639
|
+
}
|
|
640
|
+
interface dialogAttr<T = DVal> extends EAttr {
|
|
641
|
+
open?: T;
|
|
642
|
+
}
|
|
643
|
+
interface fieldsetAttr<T = DVal> extends EAttr {
|
|
644
|
+
disabled?: T;
|
|
645
|
+
form?: T;
|
|
646
|
+
name?: T;
|
|
647
|
+
}
|
|
648
|
+
interface formAttr<T = DVal> extends EAttr {
|
|
649
|
+
accept?: T;
|
|
650
|
+
"accept-charset"?: T;
|
|
651
|
+
action?: T;
|
|
652
|
+
autocomplete?: T;
|
|
653
|
+
enctype?: T;
|
|
654
|
+
method?: T;
|
|
655
|
+
name?: T;
|
|
656
|
+
novalidate?: T;
|
|
657
|
+
target?: T;
|
|
658
|
+
}
|
|
659
|
+
interface iframeAttr<T = DVal> extends EAttr {
|
|
660
|
+
allow?: T;
|
|
661
|
+
csp?: T;
|
|
662
|
+
loading?: T;
|
|
663
|
+
name?: T;
|
|
664
|
+
height?: T;
|
|
665
|
+
referrerpolicy?: T;
|
|
666
|
+
sandbox?: T;
|
|
667
|
+
src?: T;
|
|
668
|
+
srcdoc?: T;
|
|
669
|
+
width?: T;
|
|
670
|
+
}
|
|
671
|
+
interface imgAttr<T = DVal> extends EAttr {
|
|
672
|
+
alt?: T;
|
|
673
|
+
crossorigin?: T;
|
|
674
|
+
decoding?: T;
|
|
675
|
+
ismap?: T;
|
|
676
|
+
loading?: T;
|
|
677
|
+
height?: T;
|
|
678
|
+
referrerpolicy?: T;
|
|
679
|
+
sizes?: T;
|
|
680
|
+
src?: T;
|
|
681
|
+
srcset?: T;
|
|
682
|
+
usemap?: T;
|
|
683
|
+
width?: T;
|
|
684
|
+
}
|
|
685
|
+
interface inputAttr<T = DVal> extends EAttr {
|
|
686
|
+
accept?: T;
|
|
687
|
+
alt?: T;
|
|
688
|
+
autocomplete?: T;
|
|
689
|
+
capture?: T;
|
|
690
|
+
checked?: T;
|
|
691
|
+
dirname?: T;
|
|
692
|
+
disabled?: T;
|
|
693
|
+
form?: T;
|
|
694
|
+
formaction?: T;
|
|
695
|
+
formenctype?: T;
|
|
696
|
+
formmethod?: T;
|
|
697
|
+
formnovalidate?: T;
|
|
698
|
+
formtarget?: T;
|
|
699
|
+
list?: T;
|
|
700
|
+
max?: T;
|
|
701
|
+
maxlength?: T;
|
|
702
|
+
minlength?: T;
|
|
703
|
+
min?: T;
|
|
704
|
+
multiple?: T;
|
|
705
|
+
name?: T;
|
|
706
|
+
pattern?: T;
|
|
707
|
+
placeholder?: T;
|
|
708
|
+
height?: T;
|
|
709
|
+
readonly?: T;
|
|
710
|
+
required?: T;
|
|
711
|
+
size?: T;
|
|
712
|
+
src?: T;
|
|
713
|
+
step?: T;
|
|
714
|
+
type?: T;
|
|
715
|
+
usemap?: T;
|
|
716
|
+
value?: T;
|
|
717
|
+
width?: T;
|
|
718
|
+
}
|
|
719
|
+
interface insAttr<T = DVal> extends EAttr {
|
|
720
|
+
cite?: T;
|
|
721
|
+
datetime?: T;
|
|
722
|
+
}
|
|
723
|
+
interface labelAttr<T = DVal> extends EAttr {
|
|
724
|
+
for?: T;
|
|
725
|
+
form?: T;
|
|
726
|
+
}
|
|
727
|
+
interface liAttr<T = DVal> extends EAttr {
|
|
728
|
+
value?: T;
|
|
729
|
+
}
|
|
730
|
+
interface linkAttr<T = DVal> extends EAttr {
|
|
731
|
+
as?: T;
|
|
732
|
+
crossorigin?: T;
|
|
733
|
+
href?: T;
|
|
734
|
+
hreflang?: T;
|
|
735
|
+
integrity?: T;
|
|
736
|
+
media?: T;
|
|
737
|
+
referrerpolicy?: T;
|
|
738
|
+
rel?: T;
|
|
739
|
+
sizes?: T;
|
|
740
|
+
type?: T;
|
|
741
|
+
}
|
|
742
|
+
interface mapAttr<T = DVal> extends EAttr {
|
|
743
|
+
name?: T;
|
|
744
|
+
}
|
|
745
|
+
interface menuAttr<T = DVal> extends EAttr {
|
|
746
|
+
type?: T;
|
|
747
|
+
}
|
|
748
|
+
interface metaAttr<T = DVal> extends EAttr {
|
|
749
|
+
charset?: T;
|
|
750
|
+
content?: T;
|
|
751
|
+
"http-equiv"?: T;
|
|
752
|
+
name?: T;
|
|
753
|
+
}
|
|
754
|
+
interface meterAttr<T = DVal> extends EAttr {
|
|
755
|
+
form?: T;
|
|
756
|
+
high?: T;
|
|
757
|
+
low?: T;
|
|
758
|
+
max?: T;
|
|
759
|
+
min?: T;
|
|
760
|
+
optimum?: T;
|
|
761
|
+
value?: T;
|
|
762
|
+
}
|
|
763
|
+
interface objectAttr<T = DVal> extends EAttr {
|
|
764
|
+
data?: T;
|
|
765
|
+
form?: T;
|
|
766
|
+
name?: T;
|
|
767
|
+
height?: T;
|
|
768
|
+
type?: T;
|
|
769
|
+
usemap?: T;
|
|
770
|
+
width?: T;
|
|
771
|
+
}
|
|
772
|
+
interface olAttr<T = DVal> extends EAttr {
|
|
773
|
+
reversed?: T;
|
|
774
|
+
start?: T;
|
|
775
|
+
type?: T;
|
|
776
|
+
}
|
|
777
|
+
interface optgroupAttr<T = DVal> extends EAttr {
|
|
778
|
+
disabled?: T;
|
|
779
|
+
label?: T;
|
|
780
|
+
}
|
|
781
|
+
interface optionAttr<T = DVal> extends EAttr {
|
|
782
|
+
disabled?: T;
|
|
783
|
+
label?: T;
|
|
784
|
+
selected?: T;
|
|
785
|
+
value?: T;
|
|
786
|
+
}
|
|
787
|
+
interface paramAttr<T = DVal> extends EAttr {
|
|
788
|
+
name?: T;
|
|
789
|
+
value?: T;
|
|
790
|
+
}
|
|
791
|
+
interface progressAttr<T = DVal> extends EAttr {
|
|
792
|
+
form?: T;
|
|
793
|
+
max?: T;
|
|
794
|
+
value?: T;
|
|
795
|
+
}
|
|
796
|
+
interface qAttr<T = DVal> extends EAttr {
|
|
797
|
+
cite?: T;
|
|
798
|
+
}
|
|
799
|
+
interface scriptAttr<T = DVal> extends EAttr {
|
|
800
|
+
async?: T;
|
|
801
|
+
crossorigin?: T;
|
|
802
|
+
defer?: T;
|
|
803
|
+
integrity?: T;
|
|
804
|
+
referrerpolicy?: T;
|
|
805
|
+
src?: T;
|
|
806
|
+
type?: T;
|
|
807
|
+
}
|
|
808
|
+
interface selectAttr<T = DVal> extends EAttr {
|
|
809
|
+
autocomplete?: T;
|
|
810
|
+
disabled?: T;
|
|
811
|
+
form?: T;
|
|
812
|
+
multiple?: T;
|
|
813
|
+
name?: T;
|
|
814
|
+
required?: T;
|
|
815
|
+
size?: T;
|
|
816
|
+
}
|
|
817
|
+
interface sourceAttr<T = DVal> extends EAttr {
|
|
818
|
+
media?: T;
|
|
819
|
+
sizes?: T;
|
|
820
|
+
src?: T;
|
|
821
|
+
srcset?: T;
|
|
822
|
+
type?: T;
|
|
823
|
+
}
|
|
824
|
+
interface styleAttr<T = DVal> extends EAttr {
|
|
825
|
+
media?: T;
|
|
826
|
+
type?: T;
|
|
827
|
+
}
|
|
828
|
+
interface tdAttr<T = DVal> extends EAttr {
|
|
829
|
+
colspan?: T;
|
|
830
|
+
headers?: T;
|
|
831
|
+
rowspan?: T;
|
|
832
|
+
}
|
|
833
|
+
interface textareaAttr<T = DVal> extends EAttr {
|
|
834
|
+
autocomplete?: T;
|
|
835
|
+
cols?: T;
|
|
836
|
+
dirname?: T;
|
|
837
|
+
disabled?: T;
|
|
838
|
+
enterkeyhint?: T;
|
|
839
|
+
form?: T;
|
|
840
|
+
inputmode?: T;
|
|
841
|
+
maxlength?: T;
|
|
842
|
+
minlength?: T;
|
|
843
|
+
name?: T;
|
|
844
|
+
placeholder?: T;
|
|
845
|
+
readonly?: T;
|
|
846
|
+
required?: T;
|
|
847
|
+
rows?: T;
|
|
848
|
+
wrap?: T;
|
|
849
|
+
}
|
|
850
|
+
interface thAttr<T = DVal> extends EAttr {
|
|
851
|
+
colspan?: T;
|
|
852
|
+
headers?: T;
|
|
853
|
+
rowspan?: T;
|
|
854
|
+
scope?: T;
|
|
855
|
+
}
|
|
856
|
+
interface timeAttr<T = DVal> extends EAttr {
|
|
857
|
+
datetime?: T;
|
|
858
|
+
}
|
|
859
|
+
interface trackAttr<T = DVal> extends EAttr {
|
|
860
|
+
default?: T;
|
|
861
|
+
kind?: T;
|
|
862
|
+
label?: T;
|
|
863
|
+
src?: T;
|
|
864
|
+
srclang?: T;
|
|
865
|
+
}
|
|
866
|
+
interface videoAttr<T = DVal> extends EAttr {
|
|
867
|
+
autoplay?: T;
|
|
868
|
+
controls?: T;
|
|
869
|
+
crossorigin?: T;
|
|
870
|
+
loop?: T;
|
|
871
|
+
muted?: T;
|
|
872
|
+
playsinline?: T;
|
|
873
|
+
height?: T;
|
|
874
|
+
poster?: T;
|
|
875
|
+
preload?: T;
|
|
876
|
+
src?: T;
|
|
877
|
+
width?: T;
|
|
384
878
|
}
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* Local Storage
|
|
388
|
-
*/
|
|
389
|
-
declare const local: {
|
|
390
|
-
get: <T>(item: obj$1<Stateful<T>> | string) => storageInterface<T>;
|
|
391
|
-
init: <T>(item: obj$1<Stateful<T>>, as: storeValTypes) => storageInterface<T>;
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* Session Storage
|
|
396
|
-
*/
|
|
397
|
-
declare const session: {
|
|
398
|
-
get: <T>(item: obj$1<Stateful<T>> | string) => storageInterface<T>;
|
|
399
|
-
};
|
|
400
879
|
|
|
401
880
|
type kf = KeyframeAnimationOptions;
|
|
402
|
-
type KFType = (
|
|
881
|
+
type KFType = (CSSStyle | obj$1<V>)[] | CSSStyle | obj$1<V>;
|
|
403
882
|
declare class anim {
|
|
404
883
|
private e;
|
|
405
884
|
opt: kf;
|
|
406
885
|
constructor(e: Elem);
|
|
407
|
-
animate(keyframes:
|
|
886
|
+
animate(keyframes: CSSStyle[] | CSSStyle, options?: kf): Elem<HTMLElement>;
|
|
408
887
|
get slide(): {
|
|
409
888
|
left: (options?: kf) => anim;
|
|
410
889
|
right: (options?: kf) => anim;
|
|
@@ -445,7 +924,7 @@ declare class Eget<T extends Elements = HTMLElement> {
|
|
|
445
924
|
get rect(): DOMRect;
|
|
446
925
|
get remove_element(): this;
|
|
447
926
|
get style(): {
|
|
448
|
-
set: (style:
|
|
927
|
+
set: (style: CSSStyle | obj$1<V | null>, delayOrFN?: number | ((e?: any) => void)) => Elem<HTMLElement>;
|
|
449
928
|
get: (prop: keyof CSSStyleDeclaration | string) => string;
|
|
450
929
|
del: (...props: (keyof CSSStyleDeclaration | string)[]) => void;
|
|
451
930
|
};
|
|
@@ -485,6 +964,7 @@ declare class Elem<T extends Elements = HTMLElement> extends Eget<T> {
|
|
|
485
964
|
animate(keyframes: KFType, onComplete?: fn<any, void>): this;
|
|
486
965
|
}
|
|
487
966
|
|
|
967
|
+
type Elements = HTMLElementTagNameMap[keyof HTMLElementTagNameMap] | SVGElementTagNameMap[keyof SVGElementTagNameMap];
|
|
488
968
|
interface CLI {
|
|
489
969
|
id?: string;
|
|
490
970
|
class?: string;
|
|
@@ -503,33 +983,91 @@ declare class Ref<T extends Elements = HTMLElement> {
|
|
|
503
983
|
}
|
|
504
984
|
declare const useRef: <T extends Elements = HTMLElement>() => Ref<T>;
|
|
505
985
|
|
|
506
|
-
declare class
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
986
|
+
declare class Dom {
|
|
987
|
+
tag: string;
|
|
988
|
+
attr: attr;
|
|
989
|
+
ctx: ctx[];
|
|
990
|
+
constructor(tag: string, attr: attr, ctx: ctx[]);
|
|
991
|
+
}
|
|
992
|
+
declare function dom$1(tag: string | ((attr: attr, ...ctx: ctx[]) => maybePromise<Dom>), attr?: attr | null, ...ctx: ctx[]): Promise<Dom>;
|
|
993
|
+
declare const frag: (attr: attr, ...ctx: Dom[]) => Promise<Dom>;
|
|
994
|
+
declare global {
|
|
995
|
+
type events<T extends Elements = HTMLElement> = {
|
|
996
|
+
[P in keyof GlobalEventHandlersEventMap]?: (this: T, e: GlobalEventHandlersEventMap[P]) => void;
|
|
997
|
+
} & c_events<T>;
|
|
998
|
+
type DVal<T = V | V[]> = T | Stateful<T> | undefined;
|
|
999
|
+
type dom = Dom;
|
|
1000
|
+
type ctx<T = DVal | dom> = T | Stateful<T> | ctx[];
|
|
1001
|
+
type obj<T> = Record<string, T>;
|
|
1002
|
+
type DomFN<T = {}> = (a: attr & T, ...D: ctx[]) => maybePromise<dom>;
|
|
1003
|
+
type attr = EAttr;
|
|
1004
|
+
namespace JSX {
|
|
1005
|
+
type Element = maybePromise<dom>;
|
|
1006
|
+
interface IntrinsicElements extends ElementAttributes, SVGAttributes {
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
interface docObj {
|
|
1012
|
+
args?: obj<any>;
|
|
1013
|
+
data?: obj<any>;
|
|
1014
|
+
}
|
|
1015
|
+
declare class doc<T extends docObj = obj<obj<any>>> extends head {
|
|
510
1016
|
path: string;
|
|
1017
|
+
data: T["data"];
|
|
511
1018
|
args: T["args"];
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
1019
|
+
importArgs: any[] | (() => any[]);
|
|
1020
|
+
fetch?(): maybePromise<obj<any>>;
|
|
1021
|
+
head?(): maybePromise<void>;
|
|
1022
|
+
body?(): maybePromise<any>;
|
|
1023
|
+
static A: (a: aAttr, ...ctx: ctx[]) => Promise<Dom>;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
type ExtraState = Record<string, unknown>;
|
|
1027
|
+
type HistoryData<S extends ExtraState = ExtraState> = (S & {
|
|
1028
|
+
path: string;
|
|
1029
|
+
}) | null;
|
|
1030
|
+
type ChangeHandler<S extends ExtraState> = (path: string, state: HistoryData<S>) => void;
|
|
1031
|
+
declare class PathHistory<S extends ExtraState = ExtraState> {
|
|
1032
|
+
private onChange?;
|
|
1033
|
+
private popListener?;
|
|
1034
|
+
constructor(path?: Stateful<string>, isDev?: boolean, onChange?: ChangeHandler<S>);
|
|
1035
|
+
/** Current path (pathname + search + hash) */
|
|
1036
|
+
path(): string;
|
|
1037
|
+
/** Current state object */
|
|
1038
|
+
state(): HistoryData<S>;
|
|
1039
|
+
/** Navigate to a new path using pushState (no-op if same as current) */
|
|
1040
|
+
navigate(path: string, state?: S, title?: string): void;
|
|
1041
|
+
/** Replace current entry using replaceState (no-op if same as current) */
|
|
1042
|
+
replace(path: string, state?: S, title?: string): void;
|
|
1043
|
+
back(): void;
|
|
1044
|
+
forward(): void;
|
|
1045
|
+
/** Remove listeners */
|
|
1046
|
+
destroy(): void;
|
|
1047
|
+
private resolve;
|
|
1048
|
+
private samePath;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
interface contentObj {
|
|
1052
|
+
args?: obj<any>;
|
|
1053
|
+
data?: obj<any>;
|
|
1054
|
+
}
|
|
1055
|
+
declare class content<T extends contentObj = obj<obj<string>>> {
|
|
1056
|
+
path: string;
|
|
1057
|
+
data: T["data"];
|
|
1058
|
+
args: T["args"];
|
|
1059
|
+
importArgs: any[] | (() => any[]);
|
|
1060
|
+
body?(): maybePromise<any>;
|
|
1061
|
+
static Button: (a: buttonAttr & {
|
|
1062
|
+
tab?: string | string[];
|
|
1063
|
+
}, ...ctx: ctx[]) => Promise<Dom>;
|
|
526
1064
|
}
|
|
527
1065
|
|
|
528
1066
|
declare class websocket<T = Record<string, any>> {
|
|
529
1067
|
path: string;
|
|
530
1068
|
protected args: T;
|
|
1069
|
+
route: string;
|
|
531
1070
|
ws: WebSocket;
|
|
532
|
-
static route: string;
|
|
533
1071
|
isConnected: Stateful<boolean>;
|
|
534
1072
|
data: T;
|
|
535
1073
|
constructor(path: string, args?: T);
|
|
@@ -551,374 +1089,123 @@ declare class websocket<T = Record<string, any>> {
|
|
|
551
1089
|
set send(message: string | ArrayBufferLike | Blob | ArrayBufferView);
|
|
552
1090
|
}
|
|
553
1091
|
declare class socket {
|
|
554
|
-
protected yvee:
|
|
555
|
-
constructor(yvee:
|
|
556
|
-
load(_path: string): Promise<websocket<
|
|
1092
|
+
protected yvee: Yvee;
|
|
1093
|
+
constructor(yvee: Yvee);
|
|
1094
|
+
load(_path: string): Promise<websocket<Record<string, any>> | undefined>;
|
|
557
1095
|
unload(_path: string): void;
|
|
558
1096
|
}
|
|
559
1097
|
|
|
560
|
-
declare class
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
protected root: Stateful<ctx[]>;
|
|
564
|
-
socket: socket;
|
|
565
|
-
id: string;
|
|
566
|
-
path: Stateful<string>;
|
|
567
|
-
lastPath: Stateful<string>;
|
|
568
|
-
loading: Stateful<boolean>;
|
|
569
|
-
mainElement?: HTMLElement;
|
|
570
|
-
A: (a: attr & {
|
|
571
|
-
href: string;
|
|
572
|
-
topRef?: Stateful<_$>;
|
|
573
|
-
top?: number | (() => number);
|
|
574
|
-
}, ...D: ctx[]) => Dom;
|
|
575
|
-
Main: (a: attr) => Dom;
|
|
576
|
-
load: (path?: string, data?: obj<string>) => Promise<this>;
|
|
577
|
-
matchPath: (str: string) => boolean;
|
|
578
|
-
protected isYvee: boolean;
|
|
579
|
-
constructor(config?: routerCfg, events?: events);
|
|
580
|
-
protected hooker(): void;
|
|
581
|
-
protected class(this: Pager, _path: string, _error: number, isError?: boolean): Promise<doc<{}>>;
|
|
582
|
-
protected fetch(CL?: doc<{}>): Promise<void>;
|
|
583
|
-
protected processHead(CL?: doc<{}>, head?: headAttr): Promise<headType>;
|
|
584
|
-
private processClassHead;
|
|
585
|
-
private processDefaultHead;
|
|
586
|
-
render(_path: string, _error?: number, data?: obj<string>, head?: headAttr, isClient?: boolean, isError?: boolean): Promise<{
|
|
587
|
-
lang: string;
|
|
588
|
-
heads: headType;
|
|
589
|
-
done: boolean;
|
|
590
|
-
}>;
|
|
1098
|
+
declare class BasePath<T> extends MinStorage {
|
|
1099
|
+
cls: T;
|
|
1100
|
+
constructor(path: string, cls: T);
|
|
591
1101
|
}
|
|
592
|
-
|
|
593
|
-
declare function pushHistory(path?: string, title?: string): void;
|
|
594
|
-
|
|
595
|
-
interface routerCfg {
|
|
596
|
-
classes?: string | string[];
|
|
597
|
-
id?: string;
|
|
598
|
-
base?: string;
|
|
1102
|
+
declare class ClientPath extends BasePath<typeof doc<{}>> {
|
|
599
1103
|
}
|
|
600
|
-
|
|
601
|
-
pushState?: boolean;
|
|
1104
|
+
declare class SocketPath extends BasePath<typeof websocket> {
|
|
602
1105
|
}
|
|
603
|
-
declare class
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
protected unload: boolean;
|
|
607
|
-
constructor(config?: yveeCfg, events?: events);
|
|
1106
|
+
declare class MainStorage<T extends InstanceType<typeof BasePath>> {
|
|
1107
|
+
storage: Storage<T>;
|
|
1108
|
+
error: Storage<T>;
|
|
608
1109
|
}
|
|
609
|
-
declare
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
1110
|
+
declare class Stormy extends MainStorage<ClientPath> {
|
|
1111
|
+
wss: Storage<SocketPath>;
|
|
1112
|
+
setRoute(path: string, _doc: typeof doc<{}>): void;
|
|
1113
|
+
getRoute(path: string, error?: number): doc<{}>;
|
|
1114
|
+
setWss(path: string, _wss: typeof websocket): void;
|
|
1115
|
+
getWss(path: string): [SocketPath | undefined, Record<string, string>];
|
|
1116
|
+
setError(code: number, _doc: typeof doc<{}>): void;
|
|
1117
|
+
getError(code?: number): [ClientPath | undefined, Record<string, string>];
|
|
617
1118
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
declare
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
1119
|
+
declare class TabPath extends BasePath<typeof content<{}>> {
|
|
1120
|
+
}
|
|
1121
|
+
declare class miniStormy extends MainStorage<TabPath> {
|
|
1122
|
+
setRoute(path: string, _doc: typeof content<{}>): void;
|
|
1123
|
+
getRoute(path: string, error?: number): content<{}>;
|
|
1124
|
+
setWss(path: string): void;
|
|
1125
|
+
getWss(path: string): void;
|
|
1126
|
+
setError(code: number, _doc: typeof content<{}>): void;
|
|
1127
|
+
getError(code?: number): [TabPath | undefined, Record<string, string>];
|
|
627
1128
|
}
|
|
628
|
-
|
|
1129
|
+
|
|
1130
|
+
declare class minElements$1 extends htmlHead {
|
|
629
1131
|
id: string;
|
|
630
|
-
|
|
631
|
-
|
|
1132
|
+
data: obj<any>;
|
|
1133
|
+
path: Stateful<string>;
|
|
1134
|
+
protected _root: Stateful<any[]>;
|
|
1135
|
+
constructor();
|
|
1136
|
+
A(a: aAttr, ...ctx: ctx[]): Promise<Dom>;
|
|
1137
|
+
protected _main?: (root: Stateful<any[]>) => maybePromise<dom>;
|
|
1138
|
+
protected getMain(_class?: string | string[]): Promise<Dom>;
|
|
632
1139
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
protected
|
|
636
|
-
|
|
1140
|
+
|
|
1141
|
+
declare class Router extends minElements$1 {
|
|
1142
|
+
protected pushHistory: boolean;
|
|
1143
|
+
storage: Stormy;
|
|
1144
|
+
protected base: string;
|
|
1145
|
+
constructor(base?: string, index?: string, pushHistory?: boolean);
|
|
637
1146
|
/** --------------------
|
|
638
1147
|
* string | int | float | file | uuid
|
|
639
1148
|
* - /url/\<string:hell>
|
|
640
1149
|
*/
|
|
641
|
-
route
|
|
642
|
-
error
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
protected loadError(code: number): Promise<[ClientPath | undefined, Record<string, string>]>;
|
|
649
|
-
protected loadWSS(path: string): Promise<[SocketPath | undefined, Record<string, string>]>;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
type Elements = HTMLElementTagNameMap[keyof HTMLElementTagNameMap] | SVGElementTagNameMap[keyof SVGElementTagNameMap];
|
|
653
|
-
|
|
654
|
-
type hookFN<T extends any[]> = (...args: statefulValue<T>) => void;
|
|
655
|
-
interface stateCFG {
|
|
656
|
-
id?: string;
|
|
657
|
-
init?: boolean;
|
|
1150
|
+
route<Q extends typeof doc<{}>>(path: string): (f: Q) => Q;
|
|
1151
|
+
error<Q extends typeof doc<{}>>(...codes: number[]): (f: Q) => Q;
|
|
1152
|
+
/** --------------------
|
|
1153
|
+
* string | int | float | file | uuid
|
|
1154
|
+
* - /url/\<string:hell>
|
|
1155
|
+
*/
|
|
1156
|
+
wss<Q extends typeof websocket>(path: string): (f: Q) => Q;
|
|
658
1157
|
}
|
|
659
|
-
declare function StateHook<T extends any[]>(callback: hookFN<T>, statefuls: [...{
|
|
660
|
-
[K in keyof T]: Stateful<T[K]>;
|
|
661
|
-
}], { id, init }?: stateCFG): () => void;
|
|
662
1158
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
};
|
|
666
|
-
declare class Stateful<T> extends EventTarget {
|
|
667
|
-
private options;
|
|
668
|
-
private deep;
|
|
669
|
-
private verify;
|
|
670
|
-
private hooks;
|
|
671
|
-
private states;
|
|
672
|
-
private _value;
|
|
673
|
-
private listening;
|
|
674
|
-
private end?;
|
|
675
|
-
constructor(value: T, options?: AddEventListenerOptions, deep?: boolean, verify?: boolean);
|
|
676
|
-
get value(): T;
|
|
677
|
-
set value(newValue: T);
|
|
678
|
-
get listen(): () => void;
|
|
679
|
-
call<Q>(callback: (this: Elements, arg: T) => Q, entry: string): (id: string) => () => void;
|
|
680
|
-
hook<T extends any[]>(callback: hookFN<T>): (id: string) => () => void;
|
|
1159
|
+
interface mtab {
|
|
1160
|
+
tab?: string | string[];
|
|
681
1161
|
}
|
|
682
|
-
declare
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
type X2 = V | V[];
|
|
689
|
-
type X3 = X2 | Stateful<X2> | null | undefined;
|
|
690
|
-
type CSSinT = {
|
|
691
|
-
[P in keyof CSSStyleDeclaration]?: X3;
|
|
692
|
-
} & {
|
|
693
|
-
[key: string]: X3;
|
|
694
|
-
};
|
|
695
|
-
interface c_events<T extends Elements = HTMLElement> {
|
|
696
|
-
state?: (this: T, e: T) => [(...args: any[]) => void, Stateful<any>[], boolean?];
|
|
697
|
-
ready?: (this: T, e: T) => void;
|
|
698
|
-
resize?: (this: T, e: UIEvent) => void;
|
|
699
|
-
beforeunload?: (this: T, e: BeforeUnloadEvent) => void;
|
|
700
|
-
popstate?: (this: T, e: PopStateEvent) => void;
|
|
701
|
-
winscroll?: (this: T, e: Event) => void;
|
|
702
|
-
winload?: (this: T, e: Event) => void;
|
|
703
|
-
winfocus?: (this: T, e: Event) => void;
|
|
704
|
-
winblur?: (this: T, e: Event) => void;
|
|
1162
|
+
declare class minElements {
|
|
1163
|
+
id: string;
|
|
1164
|
+
path: Stateful<string>;
|
|
1165
|
+
protected _root: Stateful<any[]>;
|
|
1166
|
+
Button(a: buttonAttr & mtab, ...ctx: ctx[]): Promise<Dom>;
|
|
705
1167
|
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
style?: CSSinT | string;
|
|
709
|
-
on?: events<any>;
|
|
710
|
-
id?: string;
|
|
711
|
-
class?: XU4 | Stateful<X2>;
|
|
712
|
-
ref?: Ref<any>;
|
|
1168
|
+
interface _Tabs {
|
|
1169
|
+
path?: Stateful<string>;
|
|
713
1170
|
}
|
|
714
|
-
declare class
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
1171
|
+
declare class Tabs extends minElements {
|
|
1172
|
+
storage: miniStormy;
|
|
1173
|
+
private hasLoaded;
|
|
1174
|
+
constructor({ path }?: _Tabs);
|
|
1175
|
+
tab<Q extends typeof content<{}>>(path: string): (f: Q) => Q;
|
|
1176
|
+
Main(a: attr & {
|
|
1177
|
+
tab?: string;
|
|
1178
|
+
data?: obj<any>;
|
|
1179
|
+
}): Promise<Dom>;
|
|
1180
|
+
load(tab: string, data?: obj<any>): Promise<void>;
|
|
724
1181
|
}
|
|
725
|
-
declare function dom(tag: string | ((attr: attr, ...ctx: ctx[]) => Dom), attr?: attr | null, ...ctx: ctx[]): Dom;
|
|
726
|
-
declare const frag: (attr: attr, ...dom: Dom[]) => Dom[];
|
|
727
1182
|
|
|
728
|
-
declare global {
|
|
729
|
-
type events<T extends Elements = HTMLElement> = {
|
|
730
|
-
[P in keyof GlobalEventHandlersEventMap]?: (this: T, e: GlobalEventHandlersEventMap[P]) => void;
|
|
731
|
-
} & c_events<T>;
|
|
732
|
-
type attr = baseAttr | obj<X3>;
|
|
733
|
-
type ctx = V | Dom | Stateful<V | Dom> | ctx[];
|
|
734
|
-
type obj<T> = Record<string, T>;
|
|
735
|
-
type dom = Dom;
|
|
736
|
-
type DomFN<T = {}> = (a: attr & T, ...D: ctx[]) => Dom;
|
|
737
|
-
const BASE_STRING: string;
|
|
738
|
-
namespace JSX {
|
|
739
|
-
type Element = Dom;
|
|
740
|
-
interface IntrinsicElements {
|
|
741
|
-
link: attr;
|
|
742
|
-
base: attr;
|
|
743
|
-
meta: attr;
|
|
744
|
-
p: attr;
|
|
745
|
-
br: attr;
|
|
746
|
-
hr: attr;
|
|
747
|
-
h: attr;
|
|
748
|
-
cmnt: attr;
|
|
749
|
-
root: attr;
|
|
750
|
-
html: attr;
|
|
751
|
-
body: attr;
|
|
752
|
-
div: attr;
|
|
753
|
-
span: attr;
|
|
754
|
-
header: attr;
|
|
755
|
-
hgroup: attr;
|
|
756
|
-
footer: attr;
|
|
757
|
-
main: attr;
|
|
758
|
-
section: attr;
|
|
759
|
-
search: attr;
|
|
760
|
-
article: attr;
|
|
761
|
-
aside: attr;
|
|
762
|
-
details: attr;
|
|
763
|
-
dialog: attr;
|
|
764
|
-
summary: attr;
|
|
765
|
-
data: attr;
|
|
766
|
-
noscript: attr;
|
|
767
|
-
object: attr;
|
|
768
|
-
param: attr;
|
|
769
|
-
script: attr;
|
|
770
|
-
a: attr;
|
|
771
|
-
nav: attr;
|
|
772
|
-
style: attr;
|
|
773
|
-
audio: attr;
|
|
774
|
-
video: attr;
|
|
775
|
-
source: attr;
|
|
776
|
-
track: attr;
|
|
777
|
-
img: attr;
|
|
778
|
-
map: attr;
|
|
779
|
-
area: attr;
|
|
780
|
-
canvas: attr;
|
|
781
|
-
figcaption: attr;
|
|
782
|
-
figure: attr;
|
|
783
|
-
picture: attr;
|
|
784
|
-
iframe: attr;
|
|
785
|
-
form: attr;
|
|
786
|
-
input: attr;
|
|
787
|
-
textarea: attr;
|
|
788
|
-
button: attr;
|
|
789
|
-
select: attr;
|
|
790
|
-
optgroup: attr;
|
|
791
|
-
option: attr;
|
|
792
|
-
label: attr;
|
|
793
|
-
fieldset: attr;
|
|
794
|
-
legend: attr;
|
|
795
|
-
datalist: attr;
|
|
796
|
-
table: attr;
|
|
797
|
-
caption: attr;
|
|
798
|
-
th: attr;
|
|
799
|
-
tr: attr;
|
|
800
|
-
td: attr;
|
|
801
|
-
thead: attr;
|
|
802
|
-
tbody: attr;
|
|
803
|
-
tfoot: attr;
|
|
804
|
-
col: attr;
|
|
805
|
-
colgroup: attr;
|
|
806
|
-
b: attr;
|
|
807
|
-
i: attr;
|
|
808
|
-
q: attr;
|
|
809
|
-
s: attr;
|
|
810
|
-
u: attr;
|
|
811
|
-
em: attr;
|
|
812
|
-
rp: attr;
|
|
813
|
-
del: attr;
|
|
814
|
-
dfn: attr;
|
|
815
|
-
ins: attr;
|
|
816
|
-
kbd: attr;
|
|
817
|
-
pre: attr;
|
|
818
|
-
sub: attr;
|
|
819
|
-
sup: attr;
|
|
820
|
-
var: attr;
|
|
821
|
-
wbr: attr;
|
|
822
|
-
cite: attr;
|
|
823
|
-
time: attr;
|
|
824
|
-
abbr: attr;
|
|
825
|
-
code: attr;
|
|
826
|
-
mark: attr;
|
|
827
|
-
samp: attr;
|
|
828
|
-
meter: attr;
|
|
829
|
-
small: attr;
|
|
830
|
-
strong: attr;
|
|
831
|
-
address: attr;
|
|
832
|
-
progress: attr;
|
|
833
|
-
template: attr;
|
|
834
|
-
blockquote: attr;
|
|
835
|
-
menu: attr;
|
|
836
|
-
ul: attr;
|
|
837
|
-
ol: attr;
|
|
838
|
-
li: attr;
|
|
839
|
-
dl: attr;
|
|
840
|
-
dt: attr;
|
|
841
|
-
dd: attr;
|
|
842
|
-
h1: attr;
|
|
843
|
-
h2: attr;
|
|
844
|
-
h3: attr;
|
|
845
|
-
h4: attr;
|
|
846
|
-
h5: attr;
|
|
847
|
-
h6: attr;
|
|
848
|
-
svg: attr;
|
|
849
|
-
path: attr;
|
|
850
|
-
circle: attr;
|
|
851
|
-
animate: attr;
|
|
852
|
-
animateMotion: attr;
|
|
853
|
-
animateTransform: attr;
|
|
854
|
-
clipPath: attr;
|
|
855
|
-
defs: attr;
|
|
856
|
-
desc: attr;
|
|
857
|
-
ellipse: attr;
|
|
858
|
-
feBlend: attr;
|
|
859
|
-
feColorMatrix: attr;
|
|
860
|
-
feComponentTransfer: attr;
|
|
861
|
-
feComposite: attr;
|
|
862
|
-
feConvolveMatrix: attr;
|
|
863
|
-
feDiffuseLighting: attr;
|
|
864
|
-
feDisplacementMap: attr;
|
|
865
|
-
feDistantLight: attr;
|
|
866
|
-
feDropShadow: attr;
|
|
867
|
-
feFlood: attr;
|
|
868
|
-
feFuncA: attr;
|
|
869
|
-
feFuncB: attr;
|
|
870
|
-
feFuncG: attr;
|
|
871
|
-
feFuncR: attr;
|
|
872
|
-
feGaussianBlur: attr;
|
|
873
|
-
feImage: attr;
|
|
874
|
-
feMerge: attr;
|
|
875
|
-
feMergeNode: attr;
|
|
876
|
-
feMorphology: attr;
|
|
877
|
-
feOffset: attr;
|
|
878
|
-
fePointLight: attr;
|
|
879
|
-
feSpecularLighting: attr;
|
|
880
|
-
feSpotLight: attr;
|
|
881
|
-
feTile: attr;
|
|
882
|
-
feTurbulence: attr;
|
|
883
|
-
filter: attr;
|
|
884
|
-
foreignObject: attr;
|
|
885
|
-
g: attr;
|
|
886
|
-
image: attr;
|
|
887
|
-
line: attr;
|
|
888
|
-
linearGradient: attr;
|
|
889
|
-
marker: attr;
|
|
890
|
-
mask: attr;
|
|
891
|
-
metadata: attr;
|
|
892
|
-
mpath: attr;
|
|
893
|
-
pattern: attr;
|
|
894
|
-
polygon: attr;
|
|
895
|
-
polyline: attr;
|
|
896
|
-
radialGradient: attr;
|
|
897
|
-
rect: attr;
|
|
898
|
-
set: attr;
|
|
899
|
-
stop: attr;
|
|
900
|
-
symbol: attr;
|
|
901
|
-
text: attr;
|
|
902
|
-
textPath: attr;
|
|
903
|
-
title: attr;
|
|
904
|
-
tspan: attr;
|
|
905
|
-
use: attr;
|
|
906
|
-
view: attr;
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
declare const resolvePath: (base: string, relative: string) => string;
|
|
911
1183
|
interface renderConfig {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
1184
|
+
class?: string | string[];
|
|
1185
|
+
id?: string;
|
|
1186
|
+
data?: any;
|
|
915
1187
|
}
|
|
916
1188
|
interface serverRender {
|
|
917
1189
|
path: string;
|
|
1190
|
+
error?: number;
|
|
918
1191
|
data?: Record<string, any>;
|
|
919
|
-
status?: number;
|
|
920
1192
|
}
|
|
921
|
-
|
|
1193
|
+
interface _Yvee {
|
|
1194
|
+
base?: string;
|
|
1195
|
+
index?: string;
|
|
1196
|
+
history?: boolean;
|
|
1197
|
+
isDev?: boolean;
|
|
1198
|
+
}
|
|
1199
|
+
declare class Yvee extends Router {
|
|
1200
|
+
yvee: Yvee;
|
|
1201
|
+
private isDev;
|
|
1202
|
+
history: PathHistory;
|
|
1203
|
+
constructor({ base, history, index, isDev }?: _Yvee);
|
|
1204
|
+
Main(main?: (root: Stateful<any[]>) => maybePromise<dom>): void;
|
|
1205
|
+
render(x?: renderConfig): Promise<(() => void) | (({ path, data, error }: serverRender) => Promise<string>)>;
|
|
1206
|
+
private init;
|
|
1207
|
+
}
|
|
1208
|
+
declare const Routes: <T>(fn: (route: Yvee["route"]) => T) => (route: Yvee["route"]) => T;
|
|
922
1209
|
|
|
923
|
-
export { $,
|
|
924
|
-
export type { $E, Elements, _$, headAttr,
|
|
1210
|
+
export { $, IfClient, Meta, PathHistory, QState, Ref, Routes, State, StateHook, Stateful, Tabs, Time, Yvee, __, addCSS, content, cssLoader, doc, dom$1 as dom, frag, log, socket, useRef, websocket };
|
|
1211
|
+
export type { $E, Elements, _$, aAttr, headAttr, maybePromise, serverRender };
|