cradova 3.5.0 → 3.5.2

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.
@@ -3,32 +3,30 @@ import { type browserPageType, type CradovaPageType } from "./types.js";
3
3
  * Cradova event
4
4
  */
5
5
  declare class cradovaEvent {
6
- static refid: number;
7
- /**
8
- * the events runs only once and removed.
9
- * these event are call and removed once when when a comp is rendered to the dom
10
- * @param callback
11
- */
12
- afterMount: Function[];
13
- /**
14
- * the events runs many times.
15
- * these event are called before a comp is rendered to the dom
16
- * @param callback
17
- */
18
- beforeMountActive: Function[];
19
- /**
20
- * the events runs once after comps unmounts.
21
- * these event are called before a comp is rendered to the dom
22
- * @param callback
23
- */
24
- afterDeactivate: Function[];
25
- /**
26
- * Dispatch any event
27
- * @param eventName
28
- */
29
- dispatchEvent(
30
- eventName: "beforeMountActive" | "afterMount" | "afterDeactivate",
31
- ): void;
6
+ static compId: number;
7
+ /**
8
+ * the events runs only once and removed.
9
+ * these event are call and removed once when when a comp is rendered to the dom
10
+ * @param callback
11
+ */
12
+ afterMount: Function[];
13
+ /**
14
+ * the events runs many times.
15
+ * these event are called before a comp is rendered to the dom
16
+ * @param callback
17
+ */
18
+ beforeMountActive: Function[];
19
+ /**
20
+ * the events runs once after comps unmounts.
21
+ * these event are called before a comp is rendered to the dom
22
+ * @param callback
23
+ */
24
+ afterDeactivate: Function[];
25
+ /**
26
+ * Dispatch any event
27
+ * @param eventName
28
+ */
29
+ dispatchEvent(eventName: "beforeMountActive" | "afterMount" | "afterDeactivate"): void;
32
30
  }
33
31
  export declare const CradovaEvent: cradovaEvent;
34
32
  /**
@@ -37,39 +35,38 @@ export declare const CradovaEvent: cradovaEvent;
37
35
  * create dynamic components
38
36
  */
39
37
  export declare class Comp<Prop extends Record<string, any> = any> {
40
- id: number;
41
- private component;
42
- private effects;
43
- private effectuate;
44
- private rendered;
45
- private published;
46
- private preRendered;
47
- private reference;
48
- subData: Prop | null;
49
- _state: Prop[];
50
- _state_index: number;
51
- test?: string;
52
- constructor(component: (this: Comp<Prop>) => HTMLElement);
53
- preRender(): void;
54
- /**
55
- * Cradova Comp
56
- * ---
57
- * returns html with cradova reference
58
- * @param data
59
- * @returns () => HTMLElement
60
- */
61
- render(): HTMLElement;
62
- _effect(fn: () => Promise<void> | void): void;
63
- private effector;
64
- /**
65
- * Cradova Comp
66
- * ---
67
- * update comp component with new data and update the dom.
68
- * @param data
69
- * @returns
70
- */
71
- recall(): void;
72
- private activate;
38
+ id: number;
39
+ private component;
40
+ private effects;
41
+ private effectuate;
42
+ private rendered;
43
+ private published;
44
+ private preRendered;
45
+ private reference;
46
+ subData: Prop | null;
47
+ _state: Prop[];
48
+ _state_index: number;
49
+ constructor(component: (this: Comp<Prop>) => HTMLElement);
50
+ preRender(): void;
51
+ /**
52
+ * Cradova Comp
53
+ * ---
54
+ * returns html with cradova reference
55
+ * @param data
56
+ * @returns () => HTMLElement
57
+ */
58
+ render(): HTMLElement;
59
+ _effect(fn: () => Promise<void> | void): void;
60
+ private effector;
61
+ /**
62
+ * Cradova Comp
63
+ * ---
64
+ * update comp component with new data and update the dom.
65
+ * @param data
66
+ * @returns
67
+ */
68
+ recall(): void;
69
+ private activate;
73
70
  }
74
71
  /**
75
72
  * Cradova Signal
@@ -82,34 +79,34 @@ export declare class Comp<Prop extends Record<string, any> = any> {
82
79
  * @constructor initial: Record<string, any>, props: {persist}
83
80
  */
84
81
  export declare class Signal<Type extends Record<string, any>> {
85
- private pn?;
86
- private subs?;
87
- pipe: Type;
88
- constructor(initial: Type, props?: {
89
- persistName?: string | undefined;
90
- });
91
- /**
92
- * Cradova Signal
93
- * ----
94
- * fires an action if available
95
- * @param key - string key of the action
96
- * @param data - data for the action
97
- */
98
- publish<T extends keyof Type>(eventName: T, data: Type[T]): void;
99
- /**
100
- * Cradova Signal
101
- * ----
102
- * subscribe to an event
103
- *
104
- * @param Comp component to bind to.
105
- */
106
- subscribe<T extends keyof Type>(eventName: T, comp: Comp): void;
107
- /**
108
- * Cradova Signal
109
- * ----
110
- * clear the history on local storage
111
- */
112
- clearPersist(): void;
82
+ private pn?;
83
+ private subs?;
84
+ pipe: Type;
85
+ constructor(initial: Type, props?: {
86
+ persistName?: string | undefined;
87
+ });
88
+ /**
89
+ * Cradova Signal
90
+ * ----
91
+ * fires an action if available
92
+ * @param key - string key of the action
93
+ * @param data - data for the action
94
+ */
95
+ publish<T extends keyof Type>(eventName: T, data: Type[T]): void;
96
+ /**
97
+ * Cradova Signal
98
+ * ----
99
+ * subscribe to an event
100
+ *
101
+ * @param Comp component to bind to.
102
+ */
103
+ subscribe<T extends keyof Type>(eventName: T, comp: Comp): void;
104
+ /**
105
+ * Cradova Signal
106
+ * ----
107
+ * clear the history on local storage
108
+ */
109
+ clearPersist(): void;
113
110
  }
114
111
  /**
115
112
  * Cradova Page
@@ -119,27 +116,24 @@ export declare class Signal<Type extends Record<string, any>> {
119
116
  * @param template
120
117
  */
121
118
  export declare class Page {
122
- /**
123
- * used internally
124
- */
125
- private _name;
126
- /**
127
- * this should be a cradova page component
128
- */
129
- _html: (this: Page) => HTMLElement;
130
- private _template;
131
- private _callBack;
132
- private _deCallBack;
133
- private _dropped;
134
- private _snapshot;
135
- private _snapshot_html?;
136
- constructor(pageParams: CradovaPageType);
137
- private _takeSnapShot;
138
- onActivate(cb: () => Promise<void> | void): void;
139
- onDeactivate(cb: () => Promise<void> | void): void;
140
- _deActivate(): Promise<void>;
141
- drop(state?: boolean): boolean | undefined;
142
- _activate(): Promise<void>;
119
+ /**
120
+ * used internally
121
+ */
122
+ private _name;
123
+ /**
124
+ * this should be a cradova page component
125
+ */
126
+ _html: (this: Page) => HTMLElement;
127
+ private _template;
128
+ private _dropped;
129
+ private _snapshot;
130
+ private _snapshot_html?;
131
+ _deCB?: () => Promise<void> | void;
132
+ constructor(pageParams: CradovaPageType);
133
+ private _takeSnapShot;
134
+ set onDeactivate(cb: () => Promise<void> | void);
135
+ drop(state?: boolean): boolean | undefined;
136
+ _activate(): Promise<void>;
143
137
  }
144
138
  /** cradova router
145
139
  * ---
@@ -149,83 +143,64 @@ export declare class Page {
149
143
  * @param page the cradova document tree for the route.
150
144
  */
151
145
  export declare class Router {
152
- /**
153
- * cradova router
154
- * ---
155
- * Registers a route.
156
- *
157
- * accepts an object containing pat and page
158
- */
159
- static BrowserRoutes(
160
- obj: Record<string, browserPageType<Page | unknown>>,
161
- ): void;
162
- /**
163
- Go back in Navigation history
164
- */
165
- static back(): void;
166
- /**
167
- Go forward in Navigation history
168
- */
169
- static forward(): void;
170
- /**
146
+ /**
147
+ * cradova router
148
+ * ---
149
+ * Registers a route.
150
+ *
151
+ * accepts an object containing pat and page
152
+ */
153
+ static BrowserRoutes(obj: Record<string, browserPageType<Page | unknown>>): void;
154
+ /**
171
155
  Pause navigation
172
156
  */
173
- static pauseNavigation(): void;
174
- /**
157
+ static pauseNavigation(): void;
158
+ /**
175
159
  resume navigation
176
160
  */
177
- static resumeNavigation(): void;
178
- /**
179
- * Cradova Router
180
- * ------
181
- *
182
- * Navigates to a designated page in your app
183
- *
184
- * @param href string
185
- * @param data object
186
- * @param force boolean
187
- */
188
- static navigate(href: string, data?: Record<string, any>): void;
189
- /**
190
- * Cradova
191
- * ---
192
- * Loading page for your app
193
- *
194
- * lazy loaded loading use
195
- *
196
- * @param page
197
- */
198
- static setLoadingPage(page: Page): void;
199
- /** cradova router
200
- * ---
201
- * Listen for navigation events
202
- *
203
- * @param callback () => void
204
- */
205
- static onPageEvent(callback: () => void): void;
206
- /**
207
- * Cradova Router
208
- * ------
209
- *
210
- * return last set router params
211
- *
212
- * .
213
- */
214
- static get PageData(): {
215
- params: Record<string, string>;
216
- data?: Record<string, any>;
217
- };
218
- /**
219
- * Cradova
220
- * ---
221
- * Error Handler for your app
222
- *
223
- * @param callback
224
- * @param path? page path
225
- */
226
- static addErrorHandler(
227
- callback: (err?: unknown, pagePath?: string) => void,
228
- ): void;
229
- static _mount(): void;
161
+ static resumeNavigation(): void;
162
+ /**
163
+ * Cradova Router
164
+ * ------
165
+ *
166
+ * Navigates to a designated page in your app
167
+ *
168
+ * @param href string
169
+ * @param data object
170
+ * @param force boolean
171
+ */
172
+ static navigate(href: string, data?: Record<string, any>): void;
173
+ /**
174
+ * Cradova
175
+ * ---
176
+ * Loading page for your app
177
+ *
178
+ * lazy loaded loading use
179
+ *
180
+ * @param page
181
+ */
182
+ static setLoadingPage(page: Page): void;
183
+ /**
184
+ * Cradova Router
185
+ * ------
186
+ *
187
+ * return last set router params
188
+ *
189
+ * .
190
+ */
191
+ static get PageData(): {
192
+ params: Record<string, string>;
193
+ data?: Record<string, any>;
194
+ };
195
+ /**
196
+ * Cradova
197
+ * ---
198
+ * Error Handler for your app
199
+ *
200
+ * @param callback
201
+ * @param path? page path
202
+ */
203
+ static addErrorHandler(callback: (err?: unknown, pagePath?: string) => void): void;
204
+ static _mount(): void;
230
205
  }
231
206
  export {};
@@ -1,161 +1,36 @@
1
1
  import { type VJS_params_TYPE } from "./types.js";
2
- export declare const a: (
3
- ...Children_and_Properties: VJS_params_TYPE<HTMLAnchorElement>
4
- ) => HTMLAnchorElement;
5
- export declare const audio: (
6
- ...Children_and_Properties: VJS_params_TYPE<HTMLAudioElement>
7
- ) => HTMLAudioElement;
8
- export declare const br: (
9
- ...Children_and_Properties: VJS_params_TYPE<HTMLBRElement>
10
- ) => HTMLBRElement;
11
- export declare const button: (
12
- ...Children_and_Properties: VJS_params_TYPE<HTMLButtonElement>
13
- ) => HTMLButtonElement;
14
- export declare const canvas: (
15
- ...Children_and_Properties: VJS_params_TYPE<HTMLCanvasElement>
16
- ) => HTMLCanvasElement;
17
- export declare const caption: (
18
- ...Children_and_Properties: VJS_params_TYPE<HTMLTableCaptionElement>
19
- ) => HTMLTableCaptionElement;
20
- export declare const datalist: (
21
- ...Children_and_Properties: VJS_params_TYPE<HTMLDataListElement>
22
- ) => HTMLDataListElement;
23
- export declare const details: (
24
- ...Children_and_Properties: VJS_params_TYPE<HTMLDetailsElement>
25
- ) => HTMLDetailsElement;
26
- export declare const dialog: (
27
- ...Children_and_Properties: VJS_params_TYPE<HTMLDialogElement>
28
- ) => HTMLDialogElement;
29
- export declare const div: (
30
- ...Children_and_Properties: VJS_params_TYPE<HTMLDivElement>
31
- ) => HTMLDivElement;
32
- export declare const footer: (
33
- ...Children_and_Properties: VJS_params_TYPE<HTMLElement>
34
- ) => HTMLElement;
35
- export declare const form: (
36
- ...Children_and_Properties: VJS_params_TYPE<HTMLFormElement>
37
- ) => HTMLFormElement;
38
- export declare const h1: (
39
- ...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>
40
- ) => HTMLHeadingElement;
41
- export declare const h2: (
42
- ...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>
43
- ) => HTMLHeadingElement;
44
- export declare const h3: (
45
- ...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>
46
- ) => HTMLHeadingElement;
47
- export declare const h4: (
48
- ...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>
49
- ) => HTMLHeadingElement;
50
- export declare const h5: (
51
- ...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>
52
- ) => HTMLHeadingElement;
53
- export declare const h6: (
54
- ...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>
55
- ) => HTMLHeadingElement;
56
- export declare const head: (
57
- ...Children_and_Properties: VJS_params_TYPE<HTMLHeadElement>
58
- ) => HTMLHeadElement;
59
- export declare const header: (
60
- ...Children_and_Properties: VJS_params_TYPE<HTMLHeadElement>
61
- ) => HTMLHeadElement;
62
- export declare const hr: (
63
- ...Children_and_Properties: VJS_params_TYPE<HTMLHRElement>
64
- ) => HTMLHRElement;
65
- export declare const i: (
66
- ...Children_and_Properties: VJS_params_TYPE<HTMLLIElement>
67
- ) => HTMLLIElement;
68
- export declare const iframe: (
69
- ...Children_and_Properties: VJS_params_TYPE<HTMLIFrameElement>
70
- ) => HTMLIFrameElement;
71
- export declare const img: (
72
- ...Children_and_Properties: VJS_params_TYPE<HTMLImageElement>
73
- ) => HTMLImageElement;
74
- export declare const input: (
75
- ...Children_and_Properties: VJS_params_TYPE<HTMLInputElement>
76
- ) => HTMLInputElement;
77
- export declare const label: (
78
- ...Children_and_Properties: VJS_params_TYPE<HTMLLabelElement>
79
- ) => HTMLLabelElement;
80
- export declare const li: (
81
- ...Children_and_Properties: VJS_params_TYPE<HTMLLIElement>
82
- ) => HTMLLIElement;
83
- export declare const main: (
84
- ...Children_and_Properties: VJS_params_TYPE<HTMLElement>
85
- ) => HTMLElement;
86
- export declare const nav: (
87
- ...Children_and_Properties: VJS_params_TYPE<HTMLElement>
88
- ) => HTMLElement;
89
- export declare const ol: (
90
- ...Children_and_Properties: VJS_params_TYPE<HTMLOListElement>
91
- ) => HTMLOListElement;
92
- export declare const optgroup: (
93
- ...Children_and_Properties: VJS_params_TYPE<HTMLOptGroupElement>
94
- ) => HTMLOptGroupElement;
95
- export declare const option: (
96
- ...Children_and_Properties: VJS_params_TYPE<HTMLOptionElement>
97
- ) => HTMLOptionElement;
98
- export declare const p: (
99
- ...Children_and_Properties: VJS_params_TYPE<HTMLParagraphElement>
100
- ) => HTMLParagraphElement;
101
- export declare const progress: (
102
- ...Children_and_Properties: VJS_params_TYPE<HTMLProgressElement>
103
- ) => HTMLProgressElement;
104
- export declare const q: (
105
- ...Children_and_Properties: VJS_params_TYPE<HTMLQuoteElement>
106
- ) => HTMLQuoteElement;
107
- export declare const section: (
108
- ...Children_and_Properties: VJS_params_TYPE<HTMLElement>
109
- ) => HTMLElement;
110
- export declare const select: (
111
- ...Children_and_Properties: VJS_params_TYPE<HTMLSelectElement>
112
- ) => HTMLSelectElement;
113
- export declare const source: (
114
- ...Children_and_Properties: VJS_params_TYPE<HTMLSourceElement>
115
- ) => HTMLSourceElement;
116
- export declare const span: (
117
- ...Children_and_Properties: VJS_params_TYPE<HTMLSpanElement>
118
- ) => HTMLSpanElement;
119
- export declare const strong: (
120
- ...Children_and_Properties: VJS_params_TYPE<HTMLElement>
121
- ) => HTMLElement;
122
- export declare const summary: (
123
- ...Children_and_Properties: VJS_params_TYPE<HTMLElement>
124
- ) => HTMLElement;
125
- export declare const table: (
126
- ...Children_and_Properties: VJS_params_TYPE<HTMLTableElement>
127
- ) => HTMLTableElement;
128
- export declare const tbody: (
129
- ...Children_and_Properties: VJS_params_TYPE<HTMLTableColElement>
130
- ) => HTMLTableColElement;
131
- export declare const td: (
132
- ...Children_and_Properties: VJS_params_TYPE<HTMLTableCellElement>
133
- ) => HTMLTableCellElement;
134
- export declare const textarea: (
135
- ...Children_and_Properties: VJS_params_TYPE<HTMLTextAreaElement>
136
- ) => HTMLTextAreaElement;
137
- export declare const th: (
138
- ...Children_and_Properties: VJS_params_TYPE<HTMLTableSectionElement>
139
- ) => HTMLTableSectionElement;
140
- export declare const title: (
141
- ...Children_and_Properties: VJS_params_TYPE<HTMLTitleElement>
142
- ) => HTMLTitleElement;
143
- export declare const tr: (
144
- ...Children_and_Properties: VJS_params_TYPE<HTMLTableRowElement>
145
- ) => HTMLTableRowElement;
146
- export declare const u: (
147
- ...Children_and_Properties: VJS_params_TYPE<HTMLUListElement>
148
- ) => HTMLUListElement;
149
- export declare const ul: (
150
- ...Children_and_Properties: VJS_params_TYPE<HTMLUListElement>
151
- ) => HTMLUListElement;
152
- export declare const video: (
153
- ...Children_and_Properties: VJS_params_TYPE<HTMLVideoElement>
154
- ) => HTMLVideoElement;
155
- export declare const svg: (
156
- svg: string,
157
- properties?: VJS_params_TYPE<HTMLSpanElement>,
158
- ) => HTMLSpanElement;
159
- export declare const raw: (
160
- html: string | TemplateStringsArray,
161
- ) => DocumentFragment;
2
+ export declare const a: (...Children_and_Properties: VJS_params_TYPE<HTMLAnchorElement>) => HTMLAnchorElement;
3
+ export declare const audio: (...Children_and_Properties: VJS_params_TYPE<HTMLAudioElement>) => HTMLAudioElement;
4
+ export declare const button: (...Children_and_Properties: VJS_params_TYPE<HTMLButtonElement>) => HTMLButtonElement;
5
+ export declare const canvas: (...Children_and_Properties: VJS_params_TYPE<HTMLCanvasElement>) => HTMLCanvasElement;
6
+ export declare const div: (...Children_and_Properties: VJS_params_TYPE<HTMLDivElement>) => HTMLDivElement;
7
+ export declare const footer: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
8
+ export declare const form: (...Children_and_Properties: VJS_params_TYPE<HTMLFormElement>) => HTMLFormElement;
9
+ export declare const h1: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
10
+ export declare const h2: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
11
+ export declare const h3: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
12
+ export declare const h4: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
13
+ export declare const h5: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
14
+ export declare const h6: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
15
+ export declare const header: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadElement>) => HTMLHeadElement;
16
+ export declare const i: (...Children_and_Properties: VJS_params_TYPE<HTMLLIElement>) => HTMLLIElement;
17
+ export declare const iframe: (...Children_and_Properties: VJS_params_TYPE<HTMLIFrameElement>) => HTMLIFrameElement;
18
+ export declare const img: (...Children_and_Properties: VJS_params_TYPE<HTMLImageElement>) => HTMLImageElement;
19
+ export declare const input: (...Children_and_Properties: VJS_params_TYPE<HTMLInputElement>) => HTMLInputElement;
20
+ export declare const label: (...Children_and_Properties: VJS_params_TYPE<HTMLLabelElement>) => HTMLLabelElement;
21
+ export declare const li: (...Children_and_Properties: VJS_params_TYPE<HTMLLIElement>) => HTMLLIElement;
22
+ export declare const main: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
23
+ export declare const nav: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
24
+ export declare const ol: (...Children_and_Properties: VJS_params_TYPE<HTMLOListElement>) => HTMLOListElement;
25
+ export declare const optgroup: (...Children_and_Properties: VJS_params_TYPE<HTMLOptGroupElement>) => HTMLOptGroupElement;
26
+ export declare const option: (...Children_and_Properties: VJS_params_TYPE<HTMLOptionElement>) => HTMLOptionElement;
27
+ export declare const p: (...Children_and_Properties: VJS_params_TYPE<HTMLParagraphElement>) => HTMLParagraphElement;
28
+ export declare const section: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
29
+ export declare const select: (...Children_and_Properties: VJS_params_TYPE<HTMLSelectElement>) => HTMLSelectElement;
30
+ export declare const source: (...Children_and_Properties: VJS_params_TYPE<HTMLSourceElement>) => HTMLSourceElement;
31
+ export declare const span: (...Children_and_Properties: VJS_params_TYPE<HTMLSpanElement>) => HTMLSpanElement;
32
+ export declare const textarea: (...Children_and_Properties: VJS_params_TYPE<HTMLTextAreaElement>) => HTMLTextAreaElement;
33
+ export declare const ul: (...Children_and_Properties: VJS_params_TYPE<HTMLUListElement>) => HTMLUListElement;
34
+ export declare const video: (...Children_and_Properties: VJS_params_TYPE<HTMLVideoElement>) => HTMLVideoElement;
35
+ export declare const svg: (svg: string, properties?: VJS_params_TYPE<HTMLSpanElement>) => HTMLSpanElement;
36
+ export declare const raw: (html: string | TemplateStringsArray) => DocumentFragment;