cradova 3.3.8 → 3.3.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/LICENSE +1 -1
- package/README.md +104 -149
- package/dist/index.d.ts +0 -9
- package/dist/index.js +192 -315
- package/dist/primitives/classes.d.ts +44 -86
- package/dist/primitives/dom-objects.d.ts +53 -59
- package/dist/primitives/functions.d.ts +13 -13
- package/dist/primitives/types.d.ts +15 -33
- package/package.json +5 -6
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CradovaPageType, type promisedPage } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Cradova event
|
|
4
4
|
*/
|
|
5
5
|
declare class cradovaEvent {
|
|
6
|
-
private
|
|
7
|
-
private
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
dispatchEvent(eventName:
|
|
11
|
-
/**
|
|
12
|
-
* Active refs is a concept for delegated screens to keep their active refs alive
|
|
13
|
-
* even in the case of naviagtion
|
|
14
|
-
* @param eventName
|
|
15
|
-
* @param eventArgs
|
|
16
|
-
*/
|
|
17
|
-
dispatchActiveEvent(eventName: string, eventArgs?: unknown): Promise<void>;
|
|
6
|
+
private afterMount;
|
|
7
|
+
private beforeMountActive;
|
|
8
|
+
addAfterMount(callback: () => void): Promise<void>;
|
|
9
|
+
addBeforeMountActive(callback: () => void): Promise<void>;
|
|
10
|
+
dispatchEvent(eventName: "beforeMountActive" | "afterMount"): void;
|
|
18
11
|
}
|
|
19
12
|
export declare const CradovaEvent: cradovaEvent;
|
|
20
13
|
/**
|
|
21
|
-
* Cradova
|
|
14
|
+
* Cradova Comp
|
|
22
15
|
* -------
|
|
23
16
|
* create dynamic components
|
|
17
|
+
*
|
|
24
18
|
*/
|
|
25
|
-
export declare class
|
|
19
|
+
export declare class Comp<Prop extends Record<string, any> = any> {
|
|
26
20
|
private component;
|
|
27
21
|
private effects;
|
|
28
22
|
private effectuate;
|
|
29
|
-
methods: Record<string, Function>;
|
|
30
23
|
private rendered;
|
|
31
24
|
private published;
|
|
32
25
|
private preRendered;
|
|
@@ -37,41 +30,30 @@ export declare class Ref<Prop extends Record<string, any> = any> {
|
|
|
37
30
|
[x: number]: boolean;
|
|
38
31
|
};
|
|
39
32
|
_state_index: number;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
preRender(data?: Prop, stash?: boolean): void;
|
|
43
|
-
destroyPreRendered(): void;
|
|
44
|
-
/**
|
|
45
|
-
* Cradova Ref
|
|
46
|
-
* ---
|
|
47
|
-
* construct to add custom methods to Refs
|
|
48
|
-
* @param methodName
|
|
49
|
-
* @param method
|
|
50
|
-
* @returns void
|
|
51
|
-
*/
|
|
52
|
-
define(methodName: string, method: (this: this, ...arg: any) => void): void;
|
|
33
|
+
constructor(component: (this: Comp<Prop>) => HTMLElement);
|
|
34
|
+
preRender(): void;
|
|
53
35
|
/**
|
|
54
|
-
* Cradova
|
|
36
|
+
* Cradova Comp
|
|
55
37
|
* ---
|
|
56
38
|
* returns html with cradova reference
|
|
57
39
|
* @param data
|
|
58
40
|
* @returns () => HTMLElement
|
|
59
41
|
*/
|
|
60
|
-
render(
|
|
42
|
+
render(): any;
|
|
61
43
|
instance(): HTMLElement;
|
|
62
44
|
_setExtra(Extra: createSignal<any>): void;
|
|
63
|
-
_roll_state(data: any, idx: number, get?: boolean):
|
|
45
|
+
_roll_state<S>(data: any, idx: number, get?: boolean): S;
|
|
64
46
|
_effect(fn: () => Promise<void> | void): void;
|
|
65
47
|
private effector;
|
|
66
48
|
/**
|
|
67
|
-
* Cradova
|
|
49
|
+
* Cradova Comp
|
|
68
50
|
* ---
|
|
69
|
-
* update
|
|
51
|
+
* update comp component with new data and update the dom.
|
|
70
52
|
* @param data
|
|
71
53
|
* @returns
|
|
72
54
|
*/
|
|
73
|
-
|
|
74
|
-
private
|
|
55
|
+
recall(): void;
|
|
56
|
+
private activate;
|
|
75
57
|
}
|
|
76
58
|
/**
|
|
77
59
|
* cradova
|
|
@@ -89,14 +71,14 @@ export declare class lazy<Type> {
|
|
|
89
71
|
* ---
|
|
90
72
|
* make reference to dom elements
|
|
91
73
|
*/
|
|
92
|
-
export declare class
|
|
74
|
+
export declare class __raw_ref {
|
|
93
75
|
tree: Record<string, any>;
|
|
94
76
|
globalTree: Record<string, HTMLElement>;
|
|
95
77
|
/**
|
|
96
78
|
* Bind a DOM element to a reference name.
|
|
97
79
|
* @param name - The name to reference the DOM element by.
|
|
98
80
|
*/
|
|
99
|
-
bindAs(name: string):
|
|
81
|
+
bindAs(name: string): __raw_ref;
|
|
100
82
|
/**
|
|
101
83
|
* Retrieve a referenced DOM element.
|
|
102
84
|
* @param name - The name of the referenced DOM element.
|
|
@@ -117,18 +99,18 @@ export declare class reference {
|
|
|
117
99
|
* Features:
|
|
118
100
|
* - create a store
|
|
119
101
|
* - create actions and fire them
|
|
120
|
-
* - bind a
|
|
102
|
+
* - bind a Comp and elements
|
|
121
103
|
* - listen to updates
|
|
122
104
|
* - set object keys instead of all values
|
|
123
105
|
* - persist changes to localStorage
|
|
124
|
-
* - update a cradova
|
|
106
|
+
* - update a cradova Comp automatically
|
|
125
107
|
* @constructor initial: unknown, props: {useHistory, persist}
|
|
126
108
|
*/
|
|
127
109
|
export declare class createSignal<Type extends Record<string, any>> {
|
|
128
110
|
private callback;
|
|
129
111
|
private persistName;
|
|
130
112
|
private actions;
|
|
131
|
-
private
|
|
113
|
+
private comp;
|
|
132
114
|
value: Type;
|
|
133
115
|
constructor(initial: Type, props?: {
|
|
134
116
|
persistName?: string | undefined;
|
|
@@ -173,25 +155,25 @@ export declare class createSignal<Type extends Record<string, any>> {
|
|
|
173
155
|
* @param key - string key of the action
|
|
174
156
|
* @param data - data for the action
|
|
175
157
|
*/
|
|
176
|
-
fireAction(key: string, data?:
|
|
158
|
+
fireAction(key: string, data?: unknown): void;
|
|
177
159
|
/**
|
|
178
160
|
* Cradova
|
|
179
161
|
* ---
|
|
180
|
-
* is used to bind signal data to elements and
|
|
162
|
+
* is used to bind signal data to elements and Comps
|
|
181
163
|
*
|
|
182
164
|
* @param prop
|
|
183
165
|
* @returns something
|
|
184
166
|
*/
|
|
185
167
|
bind(prop: string): any;
|
|
186
|
-
private
|
|
168
|
+
private updateState;
|
|
187
169
|
/**
|
|
188
170
|
* Cradova Signal
|
|
189
171
|
* ----
|
|
190
172
|
* set a auto - rendering component for this store
|
|
191
173
|
*
|
|
192
|
-
* @param
|
|
174
|
+
* @param Comp component to bind to.
|
|
193
175
|
*/
|
|
194
|
-
bindRef(
|
|
176
|
+
bindRef(comp: Comp, binding?: {
|
|
195
177
|
event?: string;
|
|
196
178
|
signalProperty: string;
|
|
197
179
|
_element_property: string;
|
|
@@ -212,59 +194,43 @@ export declare class createSignal<Type extends Record<string, any>> {
|
|
|
212
194
|
clearPersist(): void;
|
|
213
195
|
}
|
|
214
196
|
/**
|
|
215
|
-
* Cradova
|
|
197
|
+
* Cradova Page
|
|
216
198
|
* ---
|
|
217
199
|
* create instances of manageable pages
|
|
218
200
|
* @param name
|
|
219
201
|
* @param template
|
|
220
202
|
*/
|
|
221
|
-
export declare class
|
|
203
|
+
export declare class Page {
|
|
222
204
|
/**
|
|
223
205
|
* used internally
|
|
224
206
|
*/
|
|
225
207
|
private _name;
|
|
226
208
|
/**
|
|
227
|
-
* this should be a cradova
|
|
209
|
+
* this should be a cradova page component
|
|
228
210
|
*/
|
|
229
|
-
_html: ((this:
|
|
230
|
-
_packed: boolean;
|
|
211
|
+
_html: ((this: Page) => HTMLElement);
|
|
231
212
|
private _template;
|
|
232
213
|
private _callBack;
|
|
233
214
|
private _deCallBack;
|
|
234
|
-
private _persist;
|
|
235
|
-
private _delegatedRoutesCount;
|
|
236
215
|
private _dropped;
|
|
237
216
|
/**
|
|
238
|
-
* error handler for the
|
|
217
|
+
* error handler for the page
|
|
239
218
|
*/
|
|
240
219
|
_errorHandler: ((err: unknown) => void) | null;
|
|
241
|
-
constructor(
|
|
242
|
-
|
|
243
|
-
_name: string;
|
|
244
|
-
_callBack: ((cradovaScreenSet: HTMLElement) => void | Promise<void>) | undefined;
|
|
245
|
-
_deCallBack: ((cradovaScreenSet: HTMLElement) => void | Promise<void>) | undefined;
|
|
246
|
-
};
|
|
247
|
-
_apply_derivation(derivation: {
|
|
248
|
-
_name: string;
|
|
249
|
-
_callBack: ((cradovaScreenSet: HTMLElement) => void | Promise<void>) | undefined;
|
|
250
|
-
_deCallBack: ((cradovaScreenSet: HTMLElement) => void | Promise<void>) | undefined;
|
|
251
|
-
}): void;
|
|
252
|
-
get _delegatedRoutes(): number;
|
|
253
|
-
set _delegatedRoutes(count: number);
|
|
254
|
-
setErrorHandler(errorHandler: (err: unknown) => void): void;
|
|
255
|
-
_package(): Promise<void>;
|
|
220
|
+
constructor(cradova_page_initials: CradovaPageType);
|
|
221
|
+
set errorHandler(errorHandler: (err: unknown) => void);
|
|
256
222
|
onActivate(cb: () => Promise<void> | void): void;
|
|
257
223
|
onDeactivate(cb: () => Promise<void> | void): void;
|
|
258
224
|
_deActivate(): Promise<void>;
|
|
259
225
|
drop(state?: boolean): boolean | undefined;
|
|
260
|
-
|
|
226
|
+
_activate(): Promise<void>;
|
|
261
227
|
}
|
|
262
228
|
/** cradova router
|
|
263
229
|
* ---
|
|
264
230
|
* Registers a route.
|
|
265
231
|
*
|
|
266
232
|
* @param {string} path Route path.
|
|
267
|
-
* @param
|
|
233
|
+
* @param page the cradova document tree for the route.
|
|
268
234
|
*/
|
|
269
235
|
export declare class Router {
|
|
270
236
|
/**
|
|
@@ -272,9 +238,9 @@ export declare class Router {
|
|
|
272
238
|
* ---
|
|
273
239
|
* Registers a route.
|
|
274
240
|
*
|
|
275
|
-
* accepts an object containing pat and
|
|
241
|
+
* accepts an object containing pat and page
|
|
276
242
|
*/
|
|
277
|
-
static BrowserRoutes(obj: Record<string,
|
|
243
|
+
static BrowserRoutes(obj: Record<string, Page | promisedPage>): void;
|
|
278
244
|
/**
|
|
279
245
|
Go back in Navigation history
|
|
280
246
|
*/
|
|
@@ -295,23 +261,23 @@ export declare class Router {
|
|
|
295
261
|
* Cradova Router
|
|
296
262
|
* ------
|
|
297
263
|
*
|
|
298
|
-
* Navigates to a designated
|
|
264
|
+
* Navigates to a designated page in your app
|
|
299
265
|
*
|
|
300
266
|
* @param href string
|
|
301
267
|
* @param data object
|
|
302
268
|
* @param force boolean
|
|
303
269
|
*/
|
|
304
|
-
static navigate(href: string, data?: Record<string, unknown> | null
|
|
270
|
+
static navigate(href: string, data?: Record<string, unknown> | null): void;
|
|
305
271
|
/**
|
|
306
272
|
* Cradova
|
|
307
273
|
* ---
|
|
308
|
-
* Loading
|
|
274
|
+
* Loading page for your app
|
|
309
275
|
*
|
|
310
276
|
* lazy loaded loading use
|
|
311
277
|
*
|
|
312
|
-
* @param
|
|
278
|
+
* @param page
|
|
313
279
|
*/
|
|
314
|
-
static
|
|
280
|
+
static setLoadingPage(page: Page): void;
|
|
315
281
|
/** cradova router
|
|
316
282
|
* ---
|
|
317
283
|
* Listen for navigation events
|
|
@@ -319,14 +285,6 @@ export declare class Router {
|
|
|
319
285
|
* @param callback () => void
|
|
320
286
|
*/
|
|
321
287
|
static onPageEvent(callback: () => void): void;
|
|
322
|
-
/** cradova router
|
|
323
|
-
* ---
|
|
324
|
-
* get a screen ready before time.
|
|
325
|
-
*
|
|
326
|
-
* @param {string} path Route path.
|
|
327
|
-
* @param data data for the screen.
|
|
328
|
-
*/
|
|
329
|
-
static packageScreen(path: string): Promise<void>;
|
|
330
288
|
/**
|
|
331
289
|
* Cradova Router
|
|
332
290
|
* ------
|
|
@@ -1,60 +1,54 @@
|
|
|
1
1
|
import { type VJS_params_TYPE } from "./types";
|
|
2
|
-
export declare const a: (...Children_and_Properties: VJS_params_TYPE) => HTMLAnchorElement;
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const
|
|
27
|
-
export declare const
|
|
28
|
-
export declare const
|
|
29
|
-
export declare const
|
|
30
|
-
export declare const
|
|
31
|
-
export declare const
|
|
32
|
-
export declare const
|
|
33
|
-
export declare const
|
|
34
|
-
export declare const
|
|
35
|
-
export declare const
|
|
36
|
-
export declare const
|
|
37
|
-
export declare const
|
|
38
|
-
export declare const
|
|
39
|
-
export declare const
|
|
40
|
-
export declare const
|
|
41
|
-
export declare const
|
|
42
|
-
export declare const
|
|
43
|
-
export declare const
|
|
44
|
-
export declare const
|
|
45
|
-
export declare const
|
|
46
|
-
export declare const
|
|
47
|
-
export declare const
|
|
48
|
-
export declare const
|
|
49
|
-
export declare const
|
|
50
|
-
export declare const
|
|
51
|
-
export declare const
|
|
52
|
-
export declare const
|
|
53
|
-
export declare const
|
|
54
|
-
export declare const
|
|
55
|
-
export declare const track: (...Children_and_Properties: VJS_params_TYPE) => HTMLTrackElement;
|
|
56
|
-
export declare const u: (...Children_and_Properties: VJS_params_TYPE) => HTMLUListElement;
|
|
57
|
-
export declare const ul: (...Children_and_Properties: VJS_params_TYPE) => HTMLUListElement;
|
|
58
|
-
export declare const video: (...Children_and_Properties: VJS_params_TYPE) => HTMLVideoElement;
|
|
59
|
-
export declare const svg: (svg: string, properties?: VJS_params_TYPE) => HTMLSpanElement;
|
|
60
|
-
export declare const raw: (html: string) => 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 br: (...Children_and_Properties: VJS_params_TYPE<HTMLBRElement>) => HTMLBRElement;
|
|
5
|
+
export declare const button: (...Children_and_Properties: VJS_params_TYPE<HTMLButtonElement>) => HTMLButtonElement;
|
|
6
|
+
export declare const canvas: (...Children_and_Properties: VJS_params_TYPE<HTMLCanvasElement>) => HTMLCanvasElement;
|
|
7
|
+
export declare const caption: (...Children_and_Properties: VJS_params_TYPE<HTMLTableCaptionElement>) => HTMLTableCaptionElement;
|
|
8
|
+
export declare const datalist: (...Children_and_Properties: VJS_params_TYPE<HTMLDataListElement>) => HTMLDataListElement;
|
|
9
|
+
export declare const details: (...Children_and_Properties: VJS_params_TYPE<HTMLDetailsElement>) => HTMLDetailsElement;
|
|
10
|
+
export declare const dialog: (...Children_and_Properties: VJS_params_TYPE<HTMLDialogElement>) => HTMLDialogElement;
|
|
11
|
+
export declare const div: (...Children_and_Properties: VJS_params_TYPE<HTMLDivElement>) => HTMLDivElement;
|
|
12
|
+
export declare const footer: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
|
|
13
|
+
export declare const form: (...Children_and_Properties: VJS_params_TYPE<HTMLFormElement>) => HTMLFormElement;
|
|
14
|
+
export declare const h1: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
|
|
15
|
+
export declare const h2: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
|
|
16
|
+
export declare const h3: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
|
|
17
|
+
export declare const h4: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
|
|
18
|
+
export declare const h5: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
|
|
19
|
+
export declare const h6: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
|
|
20
|
+
export declare const head: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadElement>) => HTMLHeadElement;
|
|
21
|
+
export declare const header: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadElement>) => HTMLHeadElement;
|
|
22
|
+
export declare const hr: (...Children_and_Properties: VJS_params_TYPE<HTMLHRElement>) => HTMLHRElement;
|
|
23
|
+
export declare const i: (...Children_and_Properties: VJS_params_TYPE<HTMLLIElement>) => HTMLLIElement;
|
|
24
|
+
export declare const iframe: (...Children_and_Properties: VJS_params_TYPE<HTMLIFrameElement>) => HTMLIFrameElement;
|
|
25
|
+
export declare const img: (...Children_and_Properties: VJS_params_TYPE<HTMLImageElement>) => HTMLImageElement;
|
|
26
|
+
export declare const input: (...Children_and_Properties: VJS_params_TYPE<HTMLInputElement>) => HTMLInputElement;
|
|
27
|
+
export declare const label: (...Children_and_Properties: VJS_params_TYPE<HTMLLabelElement>) => HTMLLabelElement;
|
|
28
|
+
export declare const li: (...Children_and_Properties: VJS_params_TYPE<HTMLLIElement>) => HTMLLIElement;
|
|
29
|
+
export declare const main: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
|
|
30
|
+
export declare const nav: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
|
|
31
|
+
export declare const ol: (...Children_and_Properties: VJS_params_TYPE<HTMLOListElement>) => HTMLOListElement;
|
|
32
|
+
export declare const optgroup: (...Children_and_Properties: VJS_params_TYPE<HTMLOptGroupElement>) => HTMLOptGroupElement;
|
|
33
|
+
export declare const option: (...Children_and_Properties: VJS_params_TYPE<HTMLOptionElement>) => HTMLOptionElement;
|
|
34
|
+
export declare const p: (...Children_and_Properties: VJS_params_TYPE<HTMLParagraphElement>) => HTMLParagraphElement;
|
|
35
|
+
export declare const progress: (...Children_and_Properties: VJS_params_TYPE<HTMLProgressElement>) => HTMLProgressElement;
|
|
36
|
+
export declare const q: (...Children_and_Properties: VJS_params_TYPE<HTMLQuoteElement>) => HTMLQuoteElement;
|
|
37
|
+
export declare const section: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
|
|
38
|
+
export declare const select: (...Children_and_Properties: VJS_params_TYPE<HTMLSelectElement>) => HTMLSelectElement;
|
|
39
|
+
export declare const source: (...Children_and_Properties: VJS_params_TYPE<HTMLSourceElement>) => HTMLSourceElement;
|
|
40
|
+
export declare const span: (...Children_and_Properties: VJS_params_TYPE<HTMLSpanElement>) => HTMLSpanElement;
|
|
41
|
+
export declare const strong: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
|
|
42
|
+
export declare const summary: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
|
|
43
|
+
export declare const table: (...Children_and_Properties: VJS_params_TYPE<HTMLTableElement>) => HTMLTableElement;
|
|
44
|
+
export declare const tbody: (...Children_and_Properties: VJS_params_TYPE<HTMLTableColElement>) => HTMLTableColElement;
|
|
45
|
+
export declare const td: (...Children_and_Properties: VJS_params_TYPE<HTMLTableCellElement>) => HTMLTableCellElement;
|
|
46
|
+
export declare const textarea: (...Children_and_Properties: VJS_params_TYPE<HTMLTextAreaElement>) => HTMLTextAreaElement;
|
|
47
|
+
export declare const th: (...Children_and_Properties: VJS_params_TYPE<HTMLTableSectionElement>) => HTMLTableSectionElement;
|
|
48
|
+
export declare const title: (...Children_and_Properties: VJS_params_TYPE<HTMLTitleElement>) => HTMLTitleElement;
|
|
49
|
+
export declare const tr: (...Children_and_Properties: VJS_params_TYPE<HTMLTableRowElement>) => HTMLTableRowElement;
|
|
50
|
+
export declare const u: (...Children_and_Properties: VJS_params_TYPE<HTMLUListElement>) => HTMLUListElement;
|
|
51
|
+
export declare const ul: (...Children_and_Properties: VJS_params_TYPE<HTMLUListElement>) => HTMLUListElement;
|
|
52
|
+
export declare const video: (...Children_and_Properties: VJS_params_TYPE<HTMLVideoElement>) => HTMLVideoElement;
|
|
53
|
+
export declare const svg: (svg: string, properties?: VJS_params_TYPE<HTMLSpanElement>) => HTMLSpanElement;
|
|
54
|
+
export declare const raw: (html: string | TemplateStringsArray) => DocumentFragment;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { type VJS_params_TYPE } from "./types";
|
|
2
|
-
import {
|
|
3
|
-
export declare const makeElement: <E extends HTMLElement>(element: E & HTMLElement, ElementChildrenAndPropertyList: VJS_params_TYPE) => E;
|
|
4
|
-
export declare const cra: <E extends HTMLElement>(tag: string) => (...Children_and_Properties: VJS_params_TYPE) => E;
|
|
5
|
-
export declare function Rhoda(l: VJS_params_TYPE): DocumentFragment;
|
|
2
|
+
import { Comp, __raw_ref } from "./classes";
|
|
3
|
+
export declare const makeElement: <E extends HTMLElement>(element: E & HTMLElement, ElementChildrenAndPropertyList: VJS_params_TYPE<E>) => E;
|
|
4
|
+
export declare const cra: <E extends HTMLElement>(tag: string) => (...Children_and_Properties: VJS_params_TYPE<E>) => E;
|
|
5
|
+
export declare function Rhoda(l: VJS_params_TYPE<HTMLElement>): DocumentFragment;
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* @param {expression} condition
|
|
9
9
|
* @param {function} elements[]
|
|
10
10
|
*/
|
|
11
|
-
export declare function $if(condition: any, ...elements: VJS_params_TYPE): any;
|
|
11
|
+
export declare function $if<E>(condition: any, ...elements: VJS_params_TYPE<E>): any;
|
|
12
12
|
export declare function $ifelse(condition: any, ifTrue: any, ifFalse?: any): any;
|
|
13
|
-
export declare function $case(value: any, ...elements: VJS_params_TYPE): (key: any) => VJS_params_TYPE | undefined;
|
|
13
|
+
export declare function $case<E>(value: any, ...elements: VJS_params_TYPE<E>): (key: any) => VJS_params_TYPE<E> | undefined;
|
|
14
14
|
export declare function $switch(key: unknown, ...cases: ((key: any) => HTMLElement[] | undefined)[]): HTMLElement[] | undefined;
|
|
15
15
|
type LoopData<Type> = Type[];
|
|
16
16
|
export declare function loop<Type>(datalist: LoopData<Type>, component: (value: Type, index?: number, array?: LoopData<Type>) => HTMLElement | DocumentFragment | undefined): HTMLElement[] | undefined;
|
|
@@ -24,29 +24,29 @@ export declare const SNRU: {
|
|
|
24
24
|
* @param children
|
|
25
25
|
* @returns
|
|
26
26
|
*/
|
|
27
|
-
export declare const frag: (children: VJS_params_TYPE) => DocumentFragment;
|
|
27
|
+
export declare const frag: (children: VJS_params_TYPE<HTMLElement>) => DocumentFragment;
|
|
28
28
|
/**
|
|
29
29
|
* Cradova
|
|
30
30
|
* ---
|
|
31
31
|
* Allows functional components to manage state by providing a state value and a function to update it.
|
|
32
32
|
* @param initialValue
|
|
33
|
-
* @param
|
|
33
|
+
* @param Comp
|
|
34
34
|
* @returns [state, setState]
|
|
35
35
|
*/
|
|
36
|
-
export declare function useState<S = unknown>(initialValue: S,
|
|
36
|
+
export declare function useState<S = unknown>(initialValue: S, Comp: Comp): [S, (newState: S) => void];
|
|
37
37
|
/**
|
|
38
38
|
* Cradova
|
|
39
39
|
* ---
|
|
40
|
-
Allows side effects to be performed in functional components (
|
|
40
|
+
Allows side effects to be performed in functional components (Comps), such as fetching data or subscribing to events.
|
|
41
41
|
* @param effect
|
|
42
42
|
* @returns
|
|
43
43
|
*/
|
|
44
|
-
export declare function useEffect(effect: () => void,
|
|
44
|
+
export declare function useEffect(effect: () => void, Comp: Comp): void;
|
|
45
45
|
/**
|
|
46
46
|
* Cradova
|
|
47
47
|
* ---
|
|
48
|
-
Returns a mutable reference object of dom elements
|
|
48
|
+
Returns a mutable reference object of dom elements.
|
|
49
49
|
* @returns reference
|
|
50
50
|
*/
|
|
51
|
-
export declare function useRef():
|
|
51
|
+
export declare function useRef(): __raw_ref;
|
|
52
52
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as CSS from "csstype";
|
|
2
|
-
import {
|
|
2
|
+
import { Comp, Page, __raw_ref } from "./classes";
|
|
3
3
|
type DataAttributes = {
|
|
4
4
|
[key: `data-${string}`]: string;
|
|
5
5
|
};
|
|
@@ -24,15 +24,15 @@ type Attributes = {
|
|
|
24
24
|
required?: string;
|
|
25
25
|
frameBorder?: string;
|
|
26
26
|
placeholder?: string;
|
|
27
|
-
reference?:
|
|
27
|
+
reference?: __raw_ref;
|
|
28
28
|
autocomplete?: string;
|
|
29
29
|
style?: CSS.Properties;
|
|
30
|
-
|
|
30
|
+
recall?: (P: any) => void;
|
|
31
31
|
onmount?: (this: HTMLElement & Attributes) => void;
|
|
32
32
|
};
|
|
33
|
-
export type VJS_params_TYPE = (
|
|
33
|
+
export type VJS_params_TYPE<E = HTMLElement> = (Comp | Comp[] | string | undefined | HTMLElement | HTMLElement[] | DocumentFragment | DocumentFragment[] | Attributes | (() => HTMLElement) | Partial<Attributes> | Partial<E> | Record<string, (this: E) => void> | Partial<DataAttributes> | Partial<AriaAttributes> | CSS.Properties<string | number>)[];
|
|
34
34
|
export interface RouterRouteObject {
|
|
35
|
-
_html: ((this:
|
|
35
|
+
_html: ((this: Page, data?: unknown) => HTMLElement | DocumentFragment) | HTMLElement | DocumentFragment;
|
|
36
36
|
_delegatedRoutes: number | boolean;
|
|
37
37
|
_Activate: (force: boolean) => Promise<void>;
|
|
38
38
|
_deActivate: (params: object) => void;
|
|
@@ -40,50 +40,32 @@ export interface RouterRouteObject {
|
|
|
40
40
|
_errorHandler: ((err: unknown) => void) | null;
|
|
41
41
|
_derive(): {
|
|
42
42
|
_name: string;
|
|
43
|
-
_callBack: ((
|
|
44
|
-
_deCallBack: ((
|
|
43
|
+
_callBack: ((cradovaPageSet: HTMLElement) => void | Promise<void>) | undefined;
|
|
44
|
+
_deCallBack: ((cradovaPageSet: HTMLElement) => void | Promise<void>) | undefined;
|
|
45
45
|
};
|
|
46
46
|
_apply_derivation(data: {
|
|
47
47
|
_name: string;
|
|
48
|
-
_callBack: ((
|
|
49
|
-
_deCallBack: ((
|
|
48
|
+
_callBack: ((cradovaPageSet: HTMLElement) => void | Promise<void>) | undefined;
|
|
49
|
+
_deCallBack: ((cradovaPageSet: HTMLElement) => void | Promise<void>) | undefined;
|
|
50
50
|
}): unknown;
|
|
51
51
|
}
|
|
52
|
-
export type
|
|
52
|
+
export type CradovaPageType = {
|
|
53
53
|
/**
|
|
54
|
-
* Cradova
|
|
54
|
+
* Cradova page
|
|
55
55
|
* ---
|
|
56
56
|
* title of the page
|
|
57
57
|
* .
|
|
58
58
|
*/
|
|
59
59
|
name?: string;
|
|
60
60
|
/**
|
|
61
|
-
* Cradova
|
|
61
|
+
* Cradova page
|
|
62
62
|
* ---
|
|
63
|
-
* The component for the
|
|
63
|
+
* The component for the page
|
|
64
64
|
* @param data
|
|
65
65
|
* @returns void
|
|
66
66
|
* .
|
|
67
67
|
*/
|
|
68
|
-
template: (this:
|
|
69
|
-
/**
|
|
70
|
-
* Cradova screen
|
|
71
|
-
* ---
|
|
72
|
-
* Allows this screen render in parallel for unique routes
|
|
73
|
-
*
|
|
74
|
-
* limit is 1000
|
|
75
|
-
*
|
|
76
|
-
* .
|
|
77
|
-
*/
|
|
78
|
-
renderInParallel?: boolean;
|
|
79
|
-
/**
|
|
80
|
-
* Cradova screen
|
|
81
|
-
* ---
|
|
82
|
-
* Should this screen be cached after first render?
|
|
83
|
-
* you can use Route.navigate(url, null, true) to force later
|
|
84
|
-
*
|
|
85
|
-
* .
|
|
86
|
-
*/
|
|
87
|
-
persist?: boolean;
|
|
68
|
+
template: (this: Page) => HTMLElement;
|
|
88
69
|
};
|
|
70
|
+
export type promisedPage = (() => Promise<Page>);
|
|
89
71
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cradova",
|
|
3
|
-
"version": "3.3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.3.10",
|
|
4
|
+
"description": "Build Powerful ⚡ Web Apps with Ease",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"url": "git+https://github.com/FridayCandour/cradova.git"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"
|
|
18
|
-
"pub": "
|
|
17
|
+
"compile": "bun bundle.ts",
|
|
18
|
+
"pub:patch": " git add . && git commit -m 'new version' && bun bundle.ts && npm version patch && npm publish && git push && git push --tags",
|
|
19
19
|
"lint": "eslint . --fix"
|
|
20
20
|
},
|
|
21
21
|
"keywords": [
|
|
@@ -24,8 +24,7 @@
|
|
|
24
24
|
"parallel rendering",
|
|
25
25
|
"conditionals",
|
|
26
26
|
"prerendering",
|
|
27
|
-
"
|
|
28
|
-
"Refs",
|
|
27
|
+
"Comps",
|
|
29
28
|
"createSignal",
|
|
30
29
|
"VJS",
|
|
31
30
|
"vjs specification",
|