@kizmann/pico-js 2.0.7 → 2.0.9

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 (97) hide show
  1. package/dist/pico-js.browser.js +1 -1
  2. package/dist/pico-js.browser.js.map +1 -1
  3. package/dist/pico-js.esm.js +1 -1
  4. package/dist/pico-js.esm.js.map +1 -1
  5. package/package.json +4 -6
  6. package/src/dom/{DomAttribute.js → DomAttribute.ts} +40 -63
  7. package/src/dom/{DomBuilder.js → DomBuilder.ts} +27 -44
  8. package/src/dom/{DomEvent.js → DomEvent.ts} +101 -76
  9. package/src/dom/{DomFinder.js → DomFinder.ts} +103 -139
  10. package/src/dom/DomForm.ts +38 -0
  11. package/src/dom/{DomGlobal.js → DomGlobal.ts} +34 -51
  12. package/src/dom/{DomInview.js → DomInview.ts} +37 -57
  13. package/src/dom/DomMeta.ts +48 -0
  14. package/src/dom/DomObserver.ts +17 -0
  15. package/src/dom/{DomPopover.js → DomPopover.ts} +20 -39
  16. package/src/dom/{DomRectangle.js → DomRectangle.ts} +70 -87
  17. package/src/format/{FormatFile.js → FormatFile.ts} +12 -23
  18. package/src/format/{FormatOption.js → FormatOption.ts} +15 -24
  19. package/src/format/{FormatParam.js → FormatParam.ts} +14 -25
  20. package/src/format/{FormatParser.js → FormatParser.ts} +29 -39
  21. package/src/format/{FormatUrl.js → FormatUrl.ts} +9 -21
  22. package/src/index.browser.ts +32 -0
  23. package/src/index.esm.ts +64 -0
  24. package/src/now/{NowDefault.js → NowDefault.ts} +86 -121
  25. package/src/now/{NowFormat.js → NowFormat.ts} +23 -28
  26. package/src/now/{NowGrid.js → NowGrid.ts} +41 -58
  27. package/src/now/{NowHuman.js → NowHuman.ts} +18 -27
  28. package/src/now/{NowMatch.js → NowMatch.ts} +22 -28
  29. package/src/now/{NowRange.js → NowRange.ts} +13 -22
  30. package/src/now/{NowWalker.js → NowWalker.ts} +65 -71
  31. package/src/tool/{scope.js → scope.ts} +41 -11
  32. package/src/utils/{Array.js → Array.ts} +187 -152
  33. package/src/utils/{Cookie.js → Cookie.ts} +15 -12
  34. package/src/utils/{Data.js → Data.ts} +17 -17
  35. package/src/utils/Dom.ts +204 -0
  36. package/src/utils/Format.ts +48 -0
  37. package/src/utils/{Hash.js → Hash.ts} +20 -20
  38. package/src/utils/{Locale.js → Locale.ts} +21 -21
  39. package/src/utils/{Mixed.js → Mixed.ts} +104 -61
  40. package/src/utils/{Now.js → Now.ts} +68 -69
  41. package/src/utils/{Number.js → Number.ts} +34 -36
  42. package/src/utils/{Object.js → Object.ts} +68 -122
  43. package/src/utils/{Route.js → Route.ts} +11 -9
  44. package/src/utils/{Runner.js → Runner.ts} +89 -77
  45. package/src/utils/{Signal.js → Signal.ts} +35 -22
  46. package/src/utils/{String.js → String.ts} +79 -69
  47. package/src/wip/{Element.js → Element.ts} +2 -2
  48. package/src/wip/{Map.js → Map.ts} +1 -1
  49. package/types/dom/DomAttribute.d.ts +16 -27
  50. package/types/dom/DomBuilder.d.ts +6 -9
  51. package/types/dom/DomEvent.d.ts +19 -24
  52. package/types/dom/DomFinder.d.ts +38 -61
  53. package/types/dom/DomForm.d.ts +7 -10
  54. package/types/dom/DomGlobal.d.ts +8 -15
  55. package/types/dom/DomInview.d.ts +9 -19
  56. package/types/dom/DomMeta.d.ts +9 -16
  57. package/types/dom/DomObserver.d.ts +4 -8
  58. package/types/dom/DomPopover.d.ts +8 -11
  59. package/types/dom/DomRectangle.d.ts +21 -35
  60. package/types/format/FormatFile.d.ts +5 -8
  61. package/types/format/FormatOption.d.ts +6 -8
  62. package/types/format/FormatParam.d.ts +6 -9
  63. package/types/format/FormatParser.d.ts +10 -18
  64. package/types/format/FormatUrl.d.ts +5 -8
  65. package/types/index.esm.d.ts +25 -37
  66. package/types/now/NowDefault.d.ts +30 -99
  67. package/types/now/NowFormat.d.ts +8 -21
  68. package/types/now/NowGrid.d.ts +24 -46
  69. package/types/now/NowHuman.d.ts +10 -11
  70. package/types/now/NowMatch.d.ts +6 -4
  71. package/types/now/NowRange.d.ts +5 -8
  72. package/types/now/NowWalker.d.ts +6 -4
  73. package/types/tool/scope.d.ts +11 -3
  74. package/types/utils/Array.d.ts +83 -101
  75. package/types/utils/Cookie.d.ts +11 -8
  76. package/types/utils/Data.d.ts +7 -7
  77. package/types/utils/Dom.d.ts +63 -96
  78. package/types/utils/Format.d.ts +15 -28
  79. package/types/utils/Hash.d.ts +21 -21
  80. package/types/utils/Locale.d.ts +9 -9
  81. package/types/utils/Mixed.d.ts +19 -32
  82. package/types/utils/Now.d.ts +51 -56
  83. package/types/utils/Number.d.ts +9 -20
  84. package/types/utils/Object.d.ts +21 -36
  85. package/types/utils/Route.d.ts +5 -2
  86. package/types/utils/Runner.d.ts +45 -38
  87. package/types/utils/Signal.d.ts +16 -16
  88. package/types/utils/String.d.ts +40 -76
  89. package/src/dom/DomForm.js +0 -59
  90. package/src/dom/DomMeta.js +0 -68
  91. package/src/dom/DomObserver.js +0 -38
  92. package/src/index.browser.js +0 -36
  93. package/src/index.esm.js +0 -80
  94. package/src/utils/Dom.js +0 -214
  95. package/src/utils/Format.js +0 -62
  96. package/types/wip/Element.d.ts +0 -119
  97. package/types/wip/Map.d.ts +0 -254
@@ -1,4 +1,4 @@
1
- import { Arr, For, Locale, Mix, Now, Str } from "../index.esm.js";
1
+ import { Arr, For, Locale, Mix, Now, Str } from "../index.esm.ts";
2
2
 
3
3
  export class PicoString
4
4
  {
@@ -8,12 +8,12 @@ export class PicoString
8
8
  * @example Str.get("abc", 1) // => "b"
9
9
  *
10
10
  * @param {any} value Input string
11
- * @param {any} index Char index
11
+ * @param {number} index Char index
12
12
  * @returns {string} Single char
13
13
  */
14
- static get(value, index)
14
+ static get(value : any, index : number) : string
15
15
  {
16
- if ( ! Mix.isStr(value) ) {
16
+ if ( !Mix.isStr(value) ) {
17
17
  value = Mix.str(value);
18
18
  }
19
19
 
@@ -34,9 +34,9 @@ export class PicoString
34
34
  * @param {string} [replace] Replace value
35
35
  * @returns {string} Updated string
36
36
  */
37
- static set(value, index, replace = '')
37
+ static set(value : any, index : any, replace : string = '') : string
38
38
  {
39
- if ( ! Mix.isStr(value) ) {
39
+ if ( !Mix.isStr(value) ) {
40
40
  value = Mix.str(value);
41
41
  }
42
42
 
@@ -58,7 +58,7 @@ export class PicoString
58
58
  * @param {any} [search] Search value
59
59
  * @returns {string} Updated string
60
60
  */
61
- static replace(value, replace, search = null)
61
+ static replace(value : any, replace : string, search : any = null) : string
62
62
  {
63
63
  if ( Mix.isNull(search) ) {
64
64
  search = value;
@@ -83,13 +83,13 @@ export class PicoString
83
83
  * @param {any} [search] Match source
84
84
  * @returns {string|null} Extracted string
85
85
  */
86
- static extract(value, replace, search = null)
86
+ static extract(value : any, replace : string, search : any = null) : string
87
87
  {
88
88
  if ( Mix.isNull(search) ) {
89
89
  search = value;
90
90
  }
91
91
 
92
- let index = this.range(search, replace);
92
+ let index : [number, number] = this.range(search, replace);
93
93
 
94
94
  if ( index === null ) {
95
95
  return null;
@@ -105,10 +105,10 @@ export class PicoString
105
105
  *
106
106
  * @param {any} value Input string
107
107
  * @param {RegExp|string} pattern Match pattern
108
- * @param {any} [cb] Callback fn
108
+ * @param {Function} [cb] Callback fn
109
109
  * @returns {any} Match result
110
110
  */
111
- static match(value, pattern, cb = null)
111
+ static match(value : any, pattern : RegExp | string, cb : Function = null) : any
112
112
  {
113
113
  let result = Mix.str(value).match(pattern);
114
114
 
@@ -124,12 +124,12 @@ export class PicoString
124
124
  *
125
125
  * @example Str.regex("a.b") // => "a\\.b"
126
126
  *
127
- * @param {any} val Input string
127
+ * @param {any} value Input string
128
128
  * @returns {string} Escaped string
129
129
  */
130
- static regex(val)
130
+ static regex(value : any) : string
131
131
  {
132
- return Mix.str(val).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
132
+ return Mix.str(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
133
133
  }
134
134
 
135
135
  /**
@@ -140,7 +140,7 @@ export class PicoString
140
140
  * @param {any} value Input string
141
141
  * @returns {string} Uppercase string
142
142
  */
143
- static uc(value)
143
+ static uc(value : any) : string
144
144
  {
145
145
  return Mix.str(value).toUpperCase();
146
146
  }
@@ -155,12 +155,12 @@ export class PicoString
155
155
  *
156
156
  * @example Str.ucfirst("abc") // => "Abc"
157
157
  *
158
- * @param {string} value Input string
158
+ * @param {any} value Input string
159
159
  * @returns {string} Updated string
160
160
  */
161
- static ucfirst(value)
161
+ static ucfirst(value : any) : string
162
162
  {
163
- return value.charAt(0).toUpperCase() + value.slice(1);
163
+ return Mix.str(value).charAt(0).toUpperCase() + value.slice(1);
164
164
  }
165
165
 
166
166
  /**
@@ -171,7 +171,7 @@ export class PicoString
171
171
  * @param {any} value Input string
172
172
  * @returns {string} Lowercase string
173
173
  */
174
- static lc(value)
174
+ static lc(value : any) : string
175
175
  {
176
176
  return Mix.str(value).toLowerCase();
177
177
  }
@@ -186,12 +186,12 @@ export class PicoString
186
186
  *
187
187
  * @example Str.lcfirst("ABC") // => "aBC"
188
188
  *
189
- * @param {string} value Input string
189
+ * @param {any} value Input string
190
190
  * @returns {string} Updated string
191
191
  */
192
- static lcfirst(value)
192
+ static lcfirst(value : any) : string
193
193
  {
194
- return value.charAt(0).toLowerCase() + value.slice(1);
194
+ return Mix.str(value).charAt(0).toLowerCase() + value.slice(1);
195
195
  }
196
196
 
197
197
  /**
@@ -199,10 +199,10 @@ export class PicoString
199
199
  *
200
200
  * @example Str.cc("hello-world") // => "helloWorld"
201
201
  *
202
- * @param {string} value Input string
202
+ * @param {any} value Input string
203
203
  * @returns {string} camelCase string
204
204
  */
205
- static cc(value)
205
+ static cc(value : any) : string
206
206
  {
207
207
  let splits = Arr.each(For.slugify(value).split('-'), (v, i) => {
208
208
  return i ? this.ucfirst(v) : v;
@@ -221,10 +221,10 @@ export class PicoString
221
221
  *
222
222
  * @example Str.kc("helloWorld") // => "hello-world"
223
223
  *
224
- * @param {string} value Input string
224
+ * @param {any} value Input string
225
225
  * @returns {string} kebab-case string
226
226
  */
227
- static kc(value)
227
+ static kc(value : any) : string
228
228
  {
229
229
  return For.slugify(value);
230
230
  }
@@ -239,10 +239,10 @@ export class PicoString
239
239
  *
240
240
  * @example Str.sc("helloWorld") // => "hello_world"
241
241
  *
242
- * @param {string} value Input string
242
+ * @param {any} value Input string
243
243
  * @returns {string} snake_case string
244
244
  */
245
- static sc(value)
245
+ static sc(value : any) : string
246
246
  {
247
247
  return For.slugify(value).replace('-', '_');
248
248
  }
@@ -257,10 +257,10 @@ export class PicoString
257
257
  *
258
258
  * @example Str.pc("hello-world") // => "HelloWorld"
259
259
  *
260
- * @param {string} value Input string
260
+ * @param {any} value Input string
261
261
  * @returns {string} PascalCase string
262
262
  */
263
- static pc(value)
263
+ static pc(value : any) : string
264
264
  {
265
265
  let splits = Arr.each(For.slugify(value).split('-'), (v) => {
266
266
  return this.ucfirst(v);
@@ -279,11 +279,11 @@ export class PicoString
279
279
  *
280
280
  * @example Str.has("abc", "b") // => true
281
281
  *
282
- * @param {string} value Input string
283
- * @param {string} search Search string
282
+ * @param {any} value Input string
283
+ * @param {any} search Search string
284
284
  * @returns {boolean} True if found
285
285
  */
286
- static has(value, search)
286
+ static has(value : any, search : any) : boolean
287
287
  {
288
288
  return this.lc(value).indexOf(this.lc(search)) !== -1;
289
289
  }
@@ -296,9 +296,9 @@ export class PicoString
296
296
  * @param {any} value Input string
297
297
  * @param {string} search Search string
298
298
  * @param {any} [fallback] Fallback value
299
- * @returns {Array<number>|any} Index range
299
+ * @returns {number[]|any} Index range
300
300
  */
301
- static range(value, search, fallback = null)
301
+ static range(value : any, search : string, fallback : any = null) : number[] | any
302
302
  {
303
303
  let index = Mix.str(value).indexOf(search);
304
304
 
@@ -319,7 +319,7 @@ export class PicoString
319
319
  * @param {number} limit End index
320
320
  * @returns {string} Sliced string
321
321
  */
322
- static slice(value, start, limit)
322
+ static slice(value : any, start : number, limit : number) : string
323
323
  {
324
324
  return Mix.str(value).slice(start, limit);
325
325
  }
@@ -330,11 +330,11 @@ export class PicoString
330
330
  * @example Str.string("<b>a</b>") // => "a"
331
331
  *
332
332
  * @param {any} value Input value
333
- * @param {any} [empty] Empty fallback
333
+ * @param {string} [empty] Empty fallback
334
334
  * @param {boolean} [html] Keep HTML
335
335
  * @returns {string} String value
336
336
  */
337
- static string(value, empty = '-', html = false)
337
+ static string(value : any, empty : string = '-', html : boolean = false) : string
338
338
  {
339
339
  if ( Mix.isEmpty(value) ) {
340
340
  return empty;
@@ -357,10 +357,10 @@ export class PicoString
357
357
  * @param {any} value Input value
358
358
  * @param {string} [yes] True string
359
359
  * @param {string} [no] False string
360
- * @param {any} [empty] Empty fallback
361
- * @returns {string|any} Boolean string
360
+ * @param {string} [empty] Empty fallback
361
+ * @returns {string} Boolean string
362
362
  */
363
- static boolean(value, yes = 'Yes', no = 'No', empty = '-')
363
+ static boolean(value : any, yes : string = 'Yes', no : string = 'No', empty : string = '-') : string
364
364
  {
365
365
  if ( Mix.isEmpty(value) ) {
366
366
  return empty;
@@ -378,12 +378,12 @@ export class PicoString
378
378
  * @param {number} [fixed] Decimal points
379
379
  * @param {string} [locale] Locale code
380
380
  * @param {any} [config] Format config
381
- * @returns {string|any} Formatted string
381
+ * @returns {string} Formatted string
382
382
  */
383
- static number(value, fixed = null, locale = null, config = {})
383
+ static number(value : any, fixed : number = null, locale : string = null, config : any = {}) : string
384
384
  {
385
- if ( ! Mix.isNum(value) ) {
386
- return value;
385
+ if ( !Mix.isNum(value) ) {
386
+ return Mix.str(value);
387
387
  }
388
388
 
389
389
  if ( locale == null ) {
@@ -412,19 +412,19 @@ export class PicoString
412
412
  * @param {string} [padding] Padding char
413
413
  * @returns {string|any} Formatted string
414
414
  */
415
- static integer(value, leading = 0, padding = '0')
415
+ static integer(value : any, leading : number = 0, padding : string = '0') : string
416
416
  {
417
- if ( ! Mix.isNum(value) ) {
418
- return value;
417
+ if ( !Mix.isNum(value) ) {
418
+ return Mix.str(value);
419
419
  }
420
420
 
421
- if ( ! Mix.isInt(value) ) {
421
+ if ( !Mix.isInt(value) ) {
422
422
  value = Mix.int(value);
423
423
  }
424
424
 
425
425
  value = Mix.int(value);
426
426
 
427
- if ( ! leading ) {
427
+ if ( !leading ) {
428
428
  return Mix.str(value);
429
429
  }
430
430
 
@@ -438,16 +438,16 @@ export class PicoString
438
438
  *
439
439
  * @param {any} value Input value
440
440
  * @param {string} [format] Output format
441
- * @param {any} [empty] Empty fallback
441
+ * @param {string} [empty] Empty fallback
442
442
  * @returns {string} Formatted string
443
443
  */
444
- static datetime(value, format = 'YYYY-MM-DD HH:mm:ss', empty = '-')
444
+ static datetime(value : any, format : string = 'YYYY-MM-DD HH:mm:ss', empty : string = '-') : string
445
445
  {
446
- if ( ! Mix.isDate(value) ) {
446
+ if ( !Mix.isDate(value) ) {
447
447
  value = Now.make(value);
448
448
  }
449
449
 
450
- if ( ! value.valid() ) {
450
+ if ( !value.valid() ) {
451
451
  return empty;
452
452
  }
453
453
 
@@ -461,10 +461,10 @@ export class PicoString
461
461
  *
462
462
  * @param {any} value Input value
463
463
  * @param {string} [format] Output format
464
- * @param {any} [empty] Empty fallback
464
+ * @param {string} [empty] Empty fallback
465
465
  * @returns {string} Formatted string
466
466
  */
467
- static date(value, format = 'YYYY-MM-DD', empty = '-')
467
+ static date(value : any, format : string = 'YYYY-MM-DD', empty : string = '-') : string
468
468
  {
469
469
  return this.datetime(value, format, empty);
470
470
  }
@@ -479,7 +479,7 @@ export class PicoString
479
479
  * @param {any} [empty] Empty fallback
480
480
  * @returns {string} Formatted string
481
481
  */
482
- static time(value, format = 'HH:mm:ss', empty = '-')
482
+ static time(value : any, format : string = 'HH:mm:ss', empty : string = '-') : string
483
483
  {
484
484
  return this.datetime(value, format, empty);
485
485
  }
@@ -494,7 +494,7 @@ export class PicoString
494
494
  * @param {boolean} [toarray] Return array
495
495
  * @returns {any} Parsed value
496
496
  */
497
- static objectify(value, mode = 'options', toarray = false)
497
+ static objectify(value : any, mode : string = 'options', toarray : boolean = false) : any
498
498
  {
499
499
  if ( Mix.isRef(value) ) {
500
500
  return value;
@@ -508,7 +508,7 @@ export class PicoString
508
508
  value = For.parseOptions(value);
509
509
  }
510
510
 
511
- if ( ! Mix.isRef(value) ) {
511
+ if ( !Mix.isRef(value) ) {
512
512
  value = JSON.parse(value)
513
513
  }
514
514
 
@@ -524,7 +524,7 @@ export class PicoString
524
524
  * @param {string} [mode] Cast mode
525
525
  * @returns {string} Casted string
526
526
  */
527
- static stringify(value, mode = 'options')
527
+ static stringify(value : any, mode : string = 'options') : string
528
528
  {
529
529
  if ( Mix.isStr(value) ) {
530
530
  return value;
@@ -546,7 +546,8 @@ export class PicoString
546
546
  /**
547
547
  * @see PicoStr.regex
548
548
  */
549
- PicoString.regexEscape = (...args) => {
549
+ // @ts-ignore
550
+ PicoString.regexEscape = (...args : Parameters<typeof Str.regex>) => {
550
551
  console.warn('Str.regexEscape() is deprecated, use Str.regex() instead.');
551
552
  return Str.regex(...args);
552
553
  };
@@ -554,15 +555,17 @@ PicoString.regexEscape = (...args) => {
554
555
  /**
555
556
  * @see PicoStr.pascalcase
556
557
  */
557
- PicoString.humancase = (...args) => {
558
+ // @ts-ignore
559
+ PicoString.humancase = (...args : Parameters<typeof Str.pc>) => {
558
560
  console.warn('Str.humancase() is deprecated, use Str.pascalcase() instead.');
559
- return Str.pascalcase(...args);
561
+ return Str.pc(...args);
560
562
  };
561
563
 
562
564
  /**
563
565
  * @see PicoFormat.slugify
564
566
  */
565
- PicoString.slugify = (...args) => {
567
+ // @ts-ignore
568
+ PicoString.slugify = (...args : Parameters<typeof For.slugify>) => {
566
569
  console.warn('Str.slugify() is deprecated, use For.slugify() instead.');
567
570
  return For.slugify(...args);
568
571
  };
@@ -570,7 +573,8 @@ PicoString.slugify = (...args) => {
570
573
  /**
571
574
  * @see PicoFormat.castOptions
572
575
  */
573
- PicoString.options = (...args) => {
576
+ // @ts-ignore
577
+ PicoString.options = (...args : Parameters<typeof For.castOptions>) => {
574
578
  console.warn('Str.options() is deprecated, use For.castOptions() instead.');
575
579
  return For.castOptions(...args);
576
580
  };
@@ -578,7 +582,8 @@ PicoString.options = (...args) => {
578
582
  /**
579
583
  * @see PicoFormat.parseOptions
580
584
  */
581
- PicoString.fromOptions = (...args) => {
585
+ // @ts-ignore
586
+ PicoString.fromOptions = (...args : Parameters<typeof For.parseOptions>) => {
582
587
  console.warn('Str.fromOptions() is deprecated, use For.parseOptions() instead.');
583
588
  return For.parseOptions(...args);
584
589
  };
@@ -586,7 +591,8 @@ PicoString.fromOptions = (...args) => {
586
591
  /**
587
592
  * @see PicoFormat.castParams
588
593
  */
589
- PicoString.params = (...args) => {
594
+ // @ts-ignore
595
+ PicoString.params = (...args : Parameters<typeof For.castParams>) => {
590
596
  console.warn('Str.params() is deprecated, use For.castParams() instead.');
591
597
  return For.castParams(...args);
592
598
  };
@@ -594,7 +600,8 @@ PicoString.params = (...args) => {
594
600
  /**
595
601
  * @see PicoFormat.parseParams
596
602
  */
597
- PicoString.fromParams = (...args) => {
603
+ // @ts-ignore
604
+ PicoString.fromParams = (...args : Parameters<typeof For.parseParams>) => {
598
605
  console.warn('Str.fromParams() is deprecated, use For.parseParams() instead.');
599
606
  return For.parseParams(...args);
600
607
  };
@@ -602,15 +609,18 @@ PicoString.fromParams = (...args) => {
602
609
  /**
603
610
  * @see PicoFormat.filesize
604
611
  */
605
- PicoString.filesize = (...args) => {
612
+ // @ts-ignore
613
+ PicoString.filesize = (...args : Parameters<typeof For.filesize>) => {
606
614
  console.warn('Str.filesize() is deprecated, use For.filesize() instead.');
607
615
  return For.filesize(...args);
608
616
  };
609
617
 
618
+ // @ts-ignore
610
619
  PicoString.real = () => {
611
620
  console.error('Str.real() is not implemented anymore.');
612
621
  };
613
622
 
623
+ // @ts-ignore
614
624
  PicoString.array = () => {
615
625
  console.error('Str.array() is not implemented anymore.');
616
626
  };
@@ -1,4 +1,4 @@
1
- import { Str, Obj, Dom, Mix, Arr } from "#src/index.esm.js";
1
+ import { Str, Obj, Dom, Mix, Arr } from "../index.esm.ts";
2
2
 
3
3
  export class PicoElement
4
4
  {
@@ -58,7 +58,7 @@ export class PicoElement
58
58
  return;
59
59
  }
60
60
 
61
- Arr.removeIndex(this.invi, index);
61
+ Arr.unset(this.invi, index);
62
62
 
63
63
  item.cb();
64
64
  });
@@ -1,4 +1,4 @@
1
- import { go, Obj, Arr, Mix, Dom, Event, Hash } from "#src/index.esm.js";
1
+ import { go, Obj, Arr, Mix, Dom, Event, Hash } from "../index.esm.ts";
2
2
 
3
3
  /**
4
4
  * @const {object} google
@@ -1,13 +1,11 @@
1
- /**
2
- * @memberof PicoDom
3
- */
4
- export class PicoDomAttributeStatic {
1
+ import { PicoDom, PicoDomInterface } from "../utils/Dom.ts";
2
+ import PicoDomFinder from "./DomFinder.js";
3
+ export interface PicoDomAttribute extends PicoDomInterface, PicoDomFinder {
5
4
  }
6
5
  /**
7
6
  * @memberof PicoDom
8
- * @extends {PicoDom}
9
7
  */
10
- export class PicoDomAttributeInstance {
8
+ export declare class PicoDomAttribute {
11
9
  /**
12
10
  * Get or set attribute
13
11
  *
@@ -16,9 +14,9 @@ export class PicoDomAttributeInstance {
16
14
  * @param {string} key Attr key
17
15
  * @param {any} [value] Attr value
18
16
  * @param {any} [fallback] Fallback value
19
- * @returns {any|PicoDom} Attr value or instance
17
+ * @returns {any} Attr value or instance
20
18
  */
21
- attr(key: string, value?: any, fallback?: any): any | PicoDom;
19
+ attr(key: string, value?: any, fallback?: any): any;
22
20
  /**
23
21
  * Get or set data attribute
24
22
  *
@@ -27,9 +25,9 @@ export class PicoDomAttributeInstance {
27
25
  * @param {string} key Data key
28
26
  * @param {any} [value] Data value
29
27
  * @param {any} [fallback] Fallback value
30
- * @returns {any|PicoDom} Data value or instance
28
+ * @returns {any} Data value or instance
31
29
  */
32
- data(key: string, value?: any, fallback?: any): any | PicoDom;
30
+ data(key: string, value?: any, fallback?: any): any;
33
31
  /**
34
32
  * Get computed style
35
33
  *
@@ -47,9 +45,9 @@ export class PicoDomAttributeInstance {
47
45
  *
48
46
  * @param {any} [value] Style value
49
47
  * @param {boolean} [combine] Combine style
50
- * @returns {any|PicoDom} Style or instance
48
+ * @returns {any} Style or instance
51
49
  */
52
- style(value?: any, combine?: boolean): any | PicoDom;
50
+ style(value?: any, combine?: boolean): any;
53
51
  /**
54
52
  * Get or set classes
55
53
  *
@@ -57,24 +55,24 @@ export class PicoDomAttributeInstance {
57
55
  *
58
56
  * @param {any} [value] Class value
59
57
  * @param {boolean} [combine] Combine classes
60
- * @returns {any|PicoDom} Classes or instance
58
+ * @returns {any} Classes or instance
61
59
  */
62
- class(value?: any, combine?: boolean): any | PicoDom;
60
+ class(value?: any, combine?: boolean): any;
63
61
  /**
64
62
  * Get or set inner HTML
65
63
  *
66
64
  * @example Dom.find("div").html("<span></span>")
67
65
  *
68
66
  * @param {any} [html] HTML content
69
- * @returns {string|PicoDom} HTML or instance
67
+ * @returns {any} HTML or instance
70
68
  */
71
- html(html?: any): string | PicoDom;
69
+ html(html?: any): any;
72
70
  /**
73
71
  * Get actual style value
74
72
  *
75
73
  * @example Dom.find("div").actual((el) => el.offsetWidth, { display: "block" })
76
74
  *
77
- * @param {function} cb Callback fn
75
+ * @param {Function} cb Callback fn
78
76
  * @param {any} [style] Temp style
79
77
  * @returns {any} Callback result
80
78
  */
@@ -125,14 +123,5 @@ export class PicoDomAttributeInstance {
125
123
  * @returns {PicoDom} Current instance
126
124
  */
127
125
  stateClass(cls: any, state?: boolean): PicoDom;
128
- /**
129
- * @see PicoDom.style
130
- */
131
- css(...args: any[]): any;
132
- /**
133
- * @see PicoDom.remClass
134
- */
135
- removeClass(...args: any[]): PicoDom;
136
126
  }
137
- export function PicoDomAttributePlugin(self: typeof PicoDom): typeof PicoDom;
138
- import { PicoDom } from "../utils/Dom.js";
127
+ export default PicoDomAttribute;
@@ -1,7 +1,11 @@
1
+ import { PicoDom, PicoDomInterface } from "../utils/Dom.ts";
2
+ import PicoDomFinder from "./DomFinder.js";
3
+ export interface PicoDomBuilder extends PicoDomInterface, PicoDomFinder {
4
+ }
1
5
  /**
2
6
  * @memberof PicoDom
3
7
  */
4
- export class PicoDomBuilderStatic {
8
+ export declare class PicoDomBuilder {
5
9
  /**
6
10
  * Create element from tag
7
11
  *
@@ -12,12 +16,6 @@ export class PicoDomBuilderStatic {
12
16
  * @returns {PicoDom} Dom instance
13
17
  */
14
18
  static make(el: any, options?: any): PicoDom;
15
- }
16
- /**
17
- * @memberof PicoDom
18
- * @extends {PicoDom}
19
- */
20
- export class PicoDomBuilderInstance {
21
19
  /**
22
20
  * Prepend value to element
23
21
  *
@@ -64,5 +62,4 @@ export class PicoDomBuilderInstance {
64
62
  */
65
63
  replace(value: any): PicoDom;
66
64
  }
67
- export function PicoDomBuilderPlugin(self: typeof PicoDom): typeof PicoDom;
68
- import { PicoDom } from "../utils/Dom.js";
65
+ export default PicoDomBuilder;