cradova 3.0.0 → 3.1.1

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/README.md CHANGED
@@ -41,11 +41,7 @@
41
41
 
42
42
  Cradova is a web development framework for building Single Page Applications and PWAs.
43
43
 
44
- It's a fast, simple and modern, with powerful state management and routing system.
45
-
46
- ```
47
- No matter how complex your UI, cradova helps you build fast, reactivity and scalable web apps.
48
- ```
44
+ It's a fast and simple framework, it provides an easy to use state management and router system.
49
45
 
50
46
  Cradova follows the [VJS specification](https://github.com/fridaycandour/cradova/blob/main/spec.md)
51
47
 
@@ -58,7 +54,7 @@ Instead, State management is done more elegantly with a simple predictive model,
58
54
 
59
55
  ## Is this a big benefit?
60
56
 
61
- Undoubtedly, this provides a significant advantage. You can experience it firsthand and decide.
57
+ Undoubtedly, this provides a significant advantage.
62
58
 
63
59
  Cradova has already been utilized in multiple production projects, and we will continuously update this page to showcase our advancements as we keep improving.
64
60
 
@@ -115,8 +111,14 @@ you can choose any that best suite what problem you want to solve
115
111
  ```js
116
112
  import _, { button, createSignal, Ref, reference, h1, br, div } from "cradova";
117
113
 
118
- // setting shouldUpdate to true
119
- // gives you this.updateState binding
114
+
115
+ const count = new Ref(function () {
116
+ const [count, setCounter] = useState(0, this);
117
+ setTimeout(() => {
118
+ setCounter(count + 1);
119
+ }, 1000);
120
+ return h1(" the current count is = " + count);
121
+ });
120
122
 
121
123
  function counter() {
122
124
  let num = 0;
@@ -185,7 +187,7 @@ function typingExample() {
185
187
  }
186
188
 
187
189
  function App() {
188
- return div(counter, dataCounter, HelloMessage, br, nameRef);
190
+ return div(count, counter, dataCounter, HelloMessage, br, nameRef);
189
191
  }
190
192
 
191
193
  // add your app to the DOM
package/dist/index.d.ts CHANGED
@@ -1,3 +1,20 @@
1
+ /*
2
+ ============================================================================="
3
+ ██████╗ ██████╗ █████═╗ ███████╗ ███████╗ ██╗ ██╗ █████╗
4
+ ██╔════╝ ██╔══██╗ ██╔═╗██║ █ ██ ██╔═════╝█ ██║ ██║ ██╔═╗██
5
+ ██║ ██████╔╝ ███████║ █ ██ ██║ ██ ██║ ██║ ██████╗
6
+ ██║ ██╔══██╗ ██║ ██║ █ ██ ██║ ██ ╚██╗ ██╔╝ ██║ ██╗
7
+ ╚██████╗ ██║ ██║ ██║ ██║ ███████╔╝ ████████ ╚███╔╝ ██║ ██║
8
+ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚════╝ ╚══╝ ╚═╝ ╚═╝
9
+ =============================================================================
10
+ Cradova FrameWork
11
+ @version 3.0.0
12
+ License: Apache V2
13
+ Copyright 2022 Friday Candour.
14
+ Repository - https://github.com/fridaycandour/cradova
15
+ =============================================================================
16
+ */
17
+
1
18
  declare module "cradova" {
2
19
  /**
3
20
  * Cradova Signal
@@ -69,7 +86,7 @@ declare module "cradova" {
69
86
  * @param key - string key of the action
70
87
  * @param data - data for the action
71
88
  */
72
- fireAction(key: string, data?: unknown): void;
89
+ fireAction(key: string, data?: Type): Type;
73
90
  /**
74
91
  * Cradova
75
92
  * ---
@@ -89,7 +106,7 @@ declare module "cradova" {
89
106
  * @param path a property in the object to send to attached ref
90
107
  */
91
108
  bindRef(
92
- ref: Partial<Ref<unknown>>, //! there's more to this friday (even elements act as ref here because of the updateState)
109
+ ref: Partial<Ref<unknown>>,
93
110
  binding?: {
94
111
  event?: string;
95
112
  signalProperty: string;
@@ -118,45 +135,48 @@ declare module "cradova" {
118
135
  * @param {expression} condition
119
136
  * @param {function} elements[]
120
137
  */
121
- export function assert(
138
+ export function assert<Type>(
122
139
  condition: boolean,
123
- ...elements: VJS_Child_TYPE<HTMLElement>[]
124
- ): VJS_Child_TYPE<HTMLElement> | undefined;
125
-
140
+ ...elements: VJS_Child_TYPE<Type | HTMLElement>[]
141
+ ): HTMLElement[];
126
142
  type LoopData<Type> = Type[];
127
-
128
143
  export function loop<Type>(
129
144
  datalist: LoopData<Type>,
130
145
  component: (
131
146
  value: Type,
132
147
  index?: number,
133
148
  array?: LoopData<Type>
134
- ) => HTMLElement | undefined
135
- ): HTMLElement | undefined;
136
- export function assertOr(
149
+ ) => HTMLElement | DocumentFragment | undefined
150
+ ): HTMLElement[] | undefined;
151
+ export function assertOr<Type>(
137
152
  condition: boolean,
138
- ifTrue: HTMLElement | HTMLElement[],
139
- ifFalse: HTMLElement | HTMLElement[]
153
+ ifTrue: VJS_Child_TYPE<Type | HTMLElement>,
154
+ ifFalse: VJS_Child_TYPE<Type | HTMLElement>
140
155
  ): HTMLElement;
141
156
  /**
142
157
  * Cradova Ref
143
158
  * -------
144
159
  * create dynamic components
145
160
  */
146
-
147
161
  export class Ref<D> {
148
162
  private component;
149
163
  private effects;
150
164
  private effectuate;
151
165
  private rendered;
152
166
  private published;
153
- private hasFirstStateUpdateRun;
154
167
  private preRendered;
155
168
  private reference;
156
169
  Signal: createSignal<any> | undefined;
170
+ _state: D[];
171
+ _state_track: {
172
+ [x: number]: boolean;
173
+ };
174
+ _state_index: number;
157
175
  stash: D | undefined;
158
- constructor(component: (this: Ref<D>, data: D) => HTMLElement);
159
- preRender(data?: D | undefined): void;
176
+ constructor(
177
+ component: (this: Ref<D>, data: D) => HTMLElement | DocumentFragment
178
+ );
179
+ preRender(data?: D): void;
160
180
  destroyPreRendered(): void;
161
181
  /**
162
182
  * Cradova Ref
@@ -165,33 +185,29 @@ declare module "cradova" {
165
185
  * @param data
166
186
  * @returns () => HTMLElement
167
187
  */
168
- render(data?: D, stash?: boolean): HTMLElement;
188
+ render(data?: D, stash?: boolean): HTMLElement | DocumentFragment;
169
189
  instance(): Record<string, any>;
170
190
  _setExtra(Extra: createSignal<any>): void;
171
- /**
172
- * Cradova Ref
173
- * ---
174
- * runs on first state update
175
- *
176
- */
177
- effect(fn: () => Promise<void> | void): void;
191
+ _roll_state(data: D, idx: number, get?: boolean): D;
192
+ _effect(fn: () => Promise<void> | void): void;
178
193
  private effector;
179
194
  /**
180
195
  * Cradova Ref
181
196
  * ---
182
197
  * update ref component with new data and update the dom.
183
198
  * @param data
184
- * @returns void
185
- *
186
- *
187
- * .
199
+ * @returns
188
200
  */
189
- updateState(data: D, stash?: boolean): void;
201
+ updateState(data?: D, stash?: boolean): void;
190
202
  private Activate;
191
- remove(): void;
192
203
  }
204
+ /**
205
+ * cradova
206
+ * ---
207
+ * lazy load a file
208
+ */
193
209
  export class lazy<Type> {
194
- public content: Type | undefined;
210
+ content: Type | undefined;
195
211
  private _cb;
196
212
  constructor(cb: () => Promise<unknown>);
197
213
  load(): Promise<void>;
@@ -204,27 +220,106 @@ declare module "cradova" {
204
220
  export class reference {
205
221
  [x: string]: Record<string, any>;
206
222
  bindAs(name: string): reference;
207
- // _appendDom(name: string, Element: HTMLElement): void;
208
223
  _appendDomForce(name: string, Element: HTMLElement): void;
209
224
  }
225
+ /**
226
+ * Cradova
227
+ * ---
228
+ * Allows functional components to manage state by providing a state value and a function to update it.
229
+ * @param initialValue
230
+ * @param ActiveRef
231
+ * @returns [state, setState]
232
+ */
233
+ export function useState<S>(
234
+ initialValue: S,
235
+ ActiveRef: Ref<S>
236
+ ): (S | ((newState: S) => void))[];
237
+ /**
238
+ * Cradova
239
+ * ---
240
+ Allows side effects to be performed in functional components (Refs), such as fetching data or subscribing to events.
241
+ * @param effect
242
+ * @returns
243
+ */
244
+ export function useEffect(effect: () => void, ActiveRef: Ref<unknown>): void;
245
+ /**
246
+ * Cradova
247
+ * ---
248
+ Returns a mutable reference object of dom elements that persists across component renders.
249
+ * @returns reference
250
+ */
251
+ export function useRef(): Record<string, HTMLElement | undefined>;
210
252
 
211
- type DataAttributes = { [key: `data-${string}`]: string };
212
- type AriaAttributes = { [key: `aria-${string}`]: string };
253
+ /**
254
+ * Cradova Screen
255
+ * ---
256
+ * create instances of manageable pages and scaffolds
257
+ * @param name
258
+ * @param template
259
+ * @param transitions
260
+ */
261
+ export class Screen {
262
+ /**
263
+ * this should be a cradova screen component
264
+ */
265
+ _html:
266
+ | ((this: Screen, data?: unknown) => HTMLElement | DocumentFragment)
267
+ | HTMLElement
268
+ | DocumentFragment;
269
+ /**
270
+ * this is a set of added html to the screen
271
+ */
272
+ _secondaryChildren: VJSType<HTMLElement>[];
273
+ /**
274
+ * error handler for the screen
275
+ */
276
+ _errorHandler: ((err: unknown) => void) | null;
277
+ /**
278
+ * used internally
279
+ */
280
+ _name: string;
281
+ private _packed;
282
+ private _template;
283
+ private _callBack;
284
+ private _deCallBack;
285
+ private _persist;
286
+ private _delegatedRoutesCount;
287
+ private _transition;
288
+ constructor(cradova_screen_initials: CradovaScreenType);
289
+ get _delegatedRoutes(): boolean;
290
+ set _delegatedRoutes(count: boolean);
291
+ setErrorHandler(errorHandler: (err: unknown) => void): void;
292
+ _package(): Promise<void>;
293
+ onActivate(cb: () => Promise<void> | void): void;
294
+ onDeactivate(cb: () => Promise<void> | void): void;
295
+ addChildren(...addOns: VJSType<HTMLElement>[]): void;
296
+ _deActivate(): Promise<void>;
297
+ _Activate(force?: boolean): Promise<void>;
298
+ }
213
299
 
300
+ type DataAttributes = {
301
+ [key: `data-${string}`]: string;
302
+ };
303
+ type AriaAttributes = {
304
+ [key: `aria-${string}`]: string;
305
+ };
214
306
  type VJSType<T> = (
215
307
  ...VJS: (
216
308
  | undefined
217
309
  | string
218
- | Partial<T>
219
310
  | HTMLElement
220
311
  | HTMLElement[]
221
- | DataAttributes
222
- | AriaAttributes
312
+ | DocumentFragment
313
+ | DocumentFragment[]
314
+ | TemplateStringsArray
315
+ | Partial<T>
223
316
  | (() => HTMLElement)
317
+ | Partial<DataAttributes>
318
+ | Partial<AriaAttributes>
319
+ | Partial<CSSStyleDeclaration>
224
320
  | {
225
321
  style?: Partial<CSSStyleDeclaration>;
226
322
  onmount?: (this: T) => void;
227
- text?: string;
228
323
  reference?: reference;
229
324
  }
230
325
  )[]
@@ -232,28 +327,39 @@ declare module "cradova" {
232
327
  type VJS_params_TYPE<T> = (
233
328
  | undefined
234
329
  | string
235
- | Partial<T>
236
330
  | HTMLElement
237
331
  | HTMLElement[]
238
- | Partial<CSSStyleDeclaration>
239
- | DataAttributes
240
- | AriaAttributes
332
+ | DocumentFragment
333
+ | DocumentFragment[]
241
334
  | TemplateStringsArray
335
+ | Partial<T>
242
336
  | (() => HTMLElement)
243
- | any
337
+ | Partial<DataAttributes>
338
+ | Partial<AriaAttributes>
339
+ | Partial<CSSStyleDeclaration>
244
340
  | {
245
341
  style?: Partial<CSSStyleDeclaration>;
342
+ src?: string;
343
+ href?: string;
344
+ placeholder?: string;
345
+ type?: string;
346
+ action?: string;
347
+ name?: string;
348
+ alt?: string;
349
+ for?: string;
350
+ method?: string;
351
+ rows?: string;
352
+ value?: string;
353
+ target?: string;
354
+ rel?: string;
355
+ required?: string;
356
+ frameBorder?: string;
246
357
  onmount?: (this: T) => void;
247
- text?: string;
248
358
  reference?: reference;
249
359
  }
250
360
  )[];
251
-
252
361
  type VJS_Child_TYPE<T> = undefined | string | T | (() => T);
253
- /**
254
- *
255
- */
256
- type CradovaScreenType = {
362
+ type CradovaScreenType<T = unknown> = {
257
363
  /**
258
364
  * Cradova screen
259
365
  * ---
@@ -277,13 +383,17 @@ declare module "cradova" {
277
383
  * @returns void
278
384
  * .
279
385
  */
280
- template: ((this: Screen, data?: unknown) => HTMLElement) | HTMLElement;
386
+ template:
387
+ | ((this: Screen, data?: T | unknown) => HTMLElement | DocumentFragment)
388
+ | HTMLElement
389
+ | DocumentFragment;
281
390
  /**
282
391
  * Cradova screen
283
392
  * ---
284
393
  * Allows this screen render in parallel for unique routes
285
394
  *
286
395
  * limit is 1000
396
+ *
287
397
  * .
288
398
  */
289
399
  renderInParallel?: boolean;
@@ -296,54 +406,34 @@ declare module "cradova" {
296
406
  * .
297
407
  */
298
408
  persist?: boolean;
299
- /**
300
- * Cradova screen
301
- * ---
302
- * Should the loading screen be show as this screen is loading?
303
- * .
304
- */
305
- suspend?: boolean;
306
409
  };
307
410
 
308
- export const makeElement: (
309
- element: HTMLElement,
310
- ...ElementChildrenAndPropertyList: VJS_params_TYPE<HTMLElement>
311
- ) => HTMLElement;
411
+ export const makeElement: <E extends HTMLElement>(
412
+ element: E & HTMLElement,
413
+ ElementChildrenAndPropertyList: VJS_params_TYPE<E>
414
+ ) => E;
312
415
  export const a: VJSType<HTMLAnchorElement>;
313
- export const abbr: VJSType<HTMLElement>;
314
- export const address: VJSType<HTMLElement>;
315
416
  export const area: VJSType<HTMLAreaElement>;
316
417
  export const article: VJSType<HTMLElement>;
317
418
  export const aside: VJSType<HTMLElement>;
318
419
  export const audio: VJSType<HTMLAudioElement>;
319
420
  export const b: VJSType<HTMLElement>;
320
421
  export const base: VJSType<HTMLBaseElement>;
321
- export const bdi: VJSType<HTMLElement>;
322
- export const bdo: VJSType<HTMLElement>;
323
422
  export const blockquote: VJSType<HTMLElement>;
324
- export const body: VJSType<HTMLBodyElement>;
325
423
  export const br: VJSType<HTMLBRElement>;
326
424
  export const button: VJSType<HTMLButtonElement>;
327
425
  export const canvas: VJSType<HTMLCanvasElement>;
328
426
  export const caption: VJSType<HTMLTableCaptionElement>;
329
- export const cite: VJSType<HTMLElement>;
330
427
  export const code: VJSType<HTMLElement>;
331
428
  export const col: VJSType<HTMLTableColElement>;
332
- export const colgroup: VJSType<HTMLElement>;
429
+ export const colgroup: VJSType<HTMLOptGroupElement>;
333
430
  export const data: VJSType<HTMLDataElement>;
334
431
  export const datalist: VJSType<HTMLDataListElement>;
335
- export const dd: VJSType<HTMLElement>;
336
- export const del: VJSType<HTMLElement>;
337
432
  export const details: VJSType<HTMLDetailsElement>;
338
- export const dfn: VJSType<HTMLElement>;
339
433
  export const dialog: VJSType<HTMLDialogElement>;
340
434
  export const div: VJSType<HTMLDivElement>;
341
- export const dl: VJSType<HTMLElement>;
342
- export const dt: VJSType<HTMLElement>;
343
435
  export const em: VJSType<HTMLElement>;
344
436
  export const embed: VJSType<HTMLEmbedElement>;
345
- export const fieldset: VJSType<HTMLFieldSetElement>;
346
- export const figcaption: VJSType<HTMLElement>;
347
437
  export const figure: VJSType<HTMLElement>;
348
438
  export const footer: VJSType<HTMLElement>;
349
439
  export const form: VJSType<HTMLFormElement>;
@@ -354,72 +444,45 @@ declare module "cradova" {
354
444
  export const h5: VJSType<HTMLHeadingElement>;
355
445
  export const h6: VJSType<HTMLHeadingElement>;
356
446
  export const head: VJSType<HTMLHeadElement>;
357
- export const header: VJSType<HTMLElement>;
447
+ export const header: VJSType<HTMLHeadElement>;
358
448
  export const hr: VJSType<HTMLHRElement>;
359
- export const html: VJSType<HTMLHtmlElement>;
360
- export const i: VJSType<HTMLElement>;
449
+ export const i: VJSType<HTMLLIElement>;
361
450
  export const iframe: VJSType<HTMLIFrameElement>;
362
451
  export const img: VJSType<HTMLImageElement>;
363
452
  export const input: VJSType<HTMLInputElement>;
364
- export const ins: VJSType<HTMLElement>;
365
- export const kbd: VJSType<HTMLElement>;
366
453
  export const label: VJSType<HTMLLabelElement>;
367
454
  export const legend: VJSType<HTMLLegendElement>;
368
455
  export const li: VJSType<HTMLLIElement>;
369
456
  export const link: VJSType<HTMLLinkElement>;
370
457
  export const main: VJSType<HTMLElement>;
371
- export const map: VJSType<HTMLMapElement>;
372
- export const mark: VJSType<HTMLElement>;
373
- export const math: VJSType<HTMLElement>;
374
458
  export const menu: VJSType<HTMLMenuElement>;
375
- export const meta: VJSType<HTMLMetaElement>;
376
- export const meter: VJSType<HTMLMeterElement>;
377
459
  export const nav: VJSType<HTMLElement>;
378
460
  export const object: VJSType<HTMLObjectElement>;
379
461
  export const ol: VJSType<HTMLOListElement>;
380
462
  export const optgroup: VJSType<HTMLOptGroupElement>;
381
463
  export const option: VJSType<HTMLOptionElement>;
382
- export const output: VJSType<HTMLOutputElement>;
383
464
  export const p: VJSType<HTMLParagraphElement>;
384
- export const picture: VJSType<HTMLPictureElement>;
385
- export const portal: VJSType<HTMLElement>;
386
465
  export const pre: VJSType<HTMLPreElement>;
387
466
  export const progress: VJSType<HTMLProgressElement>;
388
467
  export const q: VJSType<HTMLQuoteElement>;
389
- export const rp: VJSType<HTMLElement>;
390
- export const rt: VJSType<HTMLElement>;
391
- export const ruby: VJSType<HTMLElement>;
392
- export const s: VJSType<HTMLElement>;
393
- export const samp: VJSType<HTMLElement>;
394
- export const script: VJSType<HTMLScriptElement>;
395
468
  export const section: VJSType<HTMLElement>;
396
469
  export const select: VJSType<HTMLSelectElement>;
397
- export const slot: VJSType<HTMLSlotElement>;
398
- export const small: VJSType<HTMLElement>;
399
470
  export const source: VJSType<HTMLSourceElement>;
400
471
  export const span: VJSType<HTMLSpanElement>;
401
472
  export const strong: VJSType<HTMLElement>;
402
- export const style: VJSType<HTMLStyleElement>;
403
- export const sub: VJSType<HTMLElement>;
404
473
  export const summary: VJSType<HTMLElement>;
405
- export const sup: VJSType<HTMLElement>;
406
474
  export const table: VJSType<HTMLTableElement>;
407
475
  export const tbody: VJSType<HTMLTableColElement>;
408
476
  export const td: VJSType<HTMLTableCellElement>;
409
477
  export const template: VJSType<HTMLTemplateElement>;
410
478
  export const textarea: VJSType<HTMLTextAreaElement>;
411
- export const tfoot: VJSType<HTMLElement>;
412
479
  export const th: VJSType<HTMLTableSectionElement>;
413
- export const thead: VJSType<HTMLTableSectionElement>;
414
- export const time: VJSType<HTMLTimeElement>;
415
480
  export const title: VJSType<HTMLTitleElement>;
416
481
  export const tr: VJSType<HTMLTableRowElement>;
417
482
  export const track: VJSType<HTMLTrackElement>;
418
- export const u: VJSType<HTMLElement>;
483
+ export const u: VJSType<HTMLUListElement>;
419
484
  export const ul: VJSType<HTMLUListElement>;
420
- export const val: VJSType<HTMLElement>;
421
485
  export const video: VJSType<HTMLVideoElement>;
422
- export const wbr: VJSType<HTMLElement>;
423
486
 
424
487
  /** cradova router
425
488
  * ---
@@ -428,7 +491,7 @@ declare module "cradova" {
428
491
  * @param {string} path Route path.
429
492
  * @param screen the cradova document tree for the route.
430
493
  */
431
- class RouterClass {
494
+ export class RouterClass {
432
495
  /** cradova router
433
496
  * ---
434
497
  * Registers a route.
@@ -462,6 +525,16 @@ declare module "cradova" {
462
525
  data?: Record<string, unknown> | null,
463
526
  force?: boolean
464
527
  ): void;
528
+ /**
529
+ * Cradova
530
+ * ---
531
+ * Loading screen for your app
532
+ *
533
+ * lazy loaded loading use
534
+ *
535
+ * @param screen
536
+ */
537
+ setLoadingScreen(screen: Screen): void;
465
538
  /** cradova router
466
539
  * ---
467
540
  * Listen for navigation events
@@ -485,7 +558,7 @@ declare module "cradova" {
485
558
  *
486
559
  * .
487
560
  */
488
- getParams: () => any;
561
+ getParams(): any;
489
562
  /**
490
563
  * Cradova
491
564
  * ---
@@ -495,71 +568,10 @@ declare module "cradova" {
495
568
  * @param path? page path
496
569
  */
497
570
  addErrorHandler(callback: (err: unknown) => void): void;
498
- /**
499
- * Cradova
500
- * ---
501
- * Loading screen for your app
502
- *
503
- * lazy loaded loading use
504
- *
505
- * @param screen
506
- */
507
- setLoadingScreen(screen: Screen): void;
508
-
509
571
  _mount(): void;
510
572
  }
511
573
  export const Router: RouterClass;
512
574
 
513
- /**
514
- * Cradova Screen
515
- * ---
516
- * create instances of manageable pages and scaffolds
517
- * @param name
518
- * @param template
519
- * @param transitions
520
- */
521
- export class Screen {
522
- /**
523
- * this should be a cradova screen component
524
- */
525
- _html: Function | HTMLElement;
526
- /**
527
- * this is a set of added html to the screen
528
- */
529
- _secondaryChildren: VJSType<HTMLElement>[];
530
- /**
531
- * error handler for the screen
532
- */
533
- _errorHandler: ((err: unknown) => void) | null;
534
- /**
535
- * used internally
536
- */
537
- _name: string;
538
- private _packed;
539
- private _template;
540
- private _callBack;
541
- private _deCallBack;
542
- private _persist;
543
- private _data;
544
- // _params: Record<string, unknown> | null;
545
- _suspend: boolean;
546
- private _delegatedRoutesCount;
547
- private _transition;
548
- private _doc;
549
- constructor(cradova_screen_initials: CradovaScreenType);
550
- get _delegatedRoutes(): boolean;
551
- set _delegatedRoutes(count: boolean);
552
- // get _paramData(): typeof this._params;
553
- // set _paramData(params: typeof this._params);
554
- setErrorHandler(errorHandler: (err: unknown) => void): void;
555
- _package(): Promise<void>;
556
- onActivate(cb: () => Promise<void> | void): void;
557
- onDeactivate(cb: () => Promise<void> | void): void;
558
- addChildren(...addOns: VJSType<HTMLElement>[]): void;
559
- _deActivate(): Promise<void>;
560
- _Activate(force?: boolean): Promise<void>;
561
- }
562
-
563
575
  /**
564
576
  *
565
577
  * Cradova Ajax
@@ -580,11 +592,11 @@ declare module "cradova" {
580
592
  } & Record<string, string>;
581
593
  callbacks?: Record<string, (arg: Function) => void>;
582
594
  }
583
- ): Promise<unknown>;
595
+ ): Promise<string>;
584
596
 
585
- type TemplateType = (
586
- ...element_initials: VJS_params_TYPE<HTMLElement>
587
- ) => HTMLElement;
597
+ type TemplateType = <E extends HTMLElement>(
598
+ ...element_initials: VJS_params_TYPE<E | HTMLElement>
599
+ ) => E | HTMLElement | DocumentFragment;
588
600
  /**
589
601
  * Cradova
590
602
  * ---