fynixui 1.0.12 → 1.0.13

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/types/global.d.ts CHANGED
@@ -1,279 +1,277 @@
1
- /* MIT License
2
-
3
- * Copyright (c) 2026 Resty Gonzales
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- * SOFTWARE.
22
- */
23
- /**
24
- * Virtual DOM node type - re-exported from fnx.d.ts (single source of truth)
25
- */
26
- export type { VNode } from "./fnx";
27
-
28
- // global.d.ts - Fynix Global Type Declarations
29
-
30
- /**
31
- * Reactive state object - references actual nixState return type
32
- */
33
- export type NixState<T> = {
34
- value: T;
35
- subscribe: (fn: (value: T) => void) => () => void;
36
- cleanup: () => void;
37
- getSubscriberCount: () => number;
38
- isDestroyed: () => boolean;
39
- asReadOnly: () => {
40
- value: T;
41
- subscribe: (fn: (value: T) => void) => () => void;
42
- _isNixState: true;
43
- _isReadOnly: true;
44
- };
45
- _isNixState: true;
46
- };
47
-
48
- /**
49
- * Reactive store object
50
- */
51
- interface NixStore<T extends Record<string, any>> {
52
- _isNixStore: true;
53
- subscribe(callback: () => void): () => void;
54
- getState(): T;
55
- setState(updates: Partial<T> | ((state: T) => Partial<T>)): void;
56
- [key: string]: any;
57
- }
58
-
59
- /**
60
- * Async state result
61
- */
62
- interface NixAsyncResult<T> {
63
- data: T | null;
64
- loading: boolean;
65
- error: Error | null;
66
- refetch: () => Promise<void>;
67
- }
68
-
69
- /**
70
- * Form field
71
- */
72
- interface NixFormField<T = any> {
73
- value: T;
74
- error: string | null;
75
- touched: boolean;
76
- }
77
-
78
- /**
79
- * Form state
80
- */
81
- interface NixFormState<T extends Record<string, any>> {
82
- values: { [K in keyof T]: NixFormField<T[K]> };
83
- isValid: boolean;
84
- isSubmitting: boolean;
85
- errors: { [K in keyof T]?: string };
86
- handleSubmit: (
87
- onSubmit: (values: T) => void | Promise<void>
88
- ) => (e?: Event) => Promise<void>;
89
- reset: () => void;
90
- setFieldValue: <K extends keyof T>(field: K, value: T[K]) => void;
91
- setFieldError: <K extends keyof T>(field: K, error: string) => void;
92
- }
93
-
94
- /**
95
- * Lazy component result
96
- */
97
- interface NixLazyComponent {
98
- Component: any;
99
- loading: boolean;
100
- error: Error | null;
101
- }
102
-
103
- /**
104
- * Fynix Router instance
105
- */
106
- interface FynixRouter {
107
- mountRouter(selector?: string): void;
108
- navigate(path: string, props?: Record<string, any>): void;
109
- replace(path: string, props?: Record<string, any>): void;
110
- back(): void;
111
- cleanup(): void;
112
- routes: Record<string, any>;
113
- dynamicRoutes: Array<{
114
- pattern: string;
115
- regex: RegExp;
116
- component: any;
117
- params: string[];
118
- }>;
119
- }
120
-
121
- /**
122
- * Window object extensions for Fynix framework
123
- */
124
- interface Window {
125
- /** Cache for router props to prevent memory leaks */
126
- __fynixPropsCache?: Map<string, any>;
127
-
128
- /** Link props namespace for router navigation */
129
- __fynixLinkProps__?: Record<string, any>;
130
-
131
- /** Last route props passed to components */
132
- __lastRouteProps?: any;
133
-
134
- /** Fynix global state and utilities */
135
- __fynix__?: {
136
- /** Current route props */
137
- lastRouteProps?: any;
138
- /** Force re-render function */
139
- rerender?: () => void;
140
- /** Hot Module Replacement handler */
141
- hmr?: (ctx: { mod: any }) => void;
142
- };
143
- }
144
-
145
- /**
146
- * HTMLElement extensions for event delegation and Fynix internals
147
- */
148
- interface HTMLElement {
149
- /** Event delegation ID for r-* event handlers */
150
- _rest_eid?: number;
151
-
152
- /** Fynix internal data storage */
153
- _fynix_?: any;
154
- }
155
-
156
- /**
157
- * Node extensions for Fynix virtual DOM
158
- */
159
- interface Node {
160
- /** Event delegation ID */
161
- _rest_eid?: number;
162
- /** Fynix cleanup functions */
163
- _fynixCleanups?: Array<() => void>;
164
- }
165
-
166
- /**
167
- * Text node type with nodeValue
168
- */
169
- interface Text {
170
- nodeValue: string | null;
171
- }
172
-
173
- /**
174
- * Vite-specific import.meta extensions
175
- */
176
- interface ImportMeta {
177
- /** Vite Hot Module Replacement API */
178
- readonly hot?: {
179
- /** Accept HMR updates */
180
- accept: (cb?: (mod: any) => void) => void;
181
- /** Cleanup before module disposal */
182
- dispose: (cb: () => void) => void;
183
- /** Decline HMR for this module */
184
- decline?: () => void;
185
- /** Invalidate and force full reload */
186
- invalidate?: () => void;
187
- /** Custom HMR event handling */
188
- on?: (event: string, cb: (...args: any[]) => void) => void;
189
- };
190
-
191
- /** Vite glob import function */
192
- readonly glob: <T = any>(
193
- pattern: string,
194
- options?: {
195
- /** Load modules eagerly (at build time) */
196
- eager?: boolean;
197
- /** Import as URL strings */
198
- as?: "url" | "raw";
199
- /** Custom import query */
200
- query?: Record<string, string | number | boolean>;
201
- }
202
- ) => Record<string, T>;
203
-
204
- /** Environment variables */
205
- readonly env: {
206
- MODE: string;
207
- BASE_URL: string;
208
- PROD: boolean;
209
- DEV: boolean;
210
- SSR: boolean;
211
- [key: string]: any;
212
- };
213
- }
214
-
215
- /**
216
- * Module declarations for non-TypeScript files
217
- */
218
- declare module "*.css" {
219
- const content: string;
220
- export default content;
221
- }
222
-
223
- declare module "*.scss" {
224
- const content: string;
225
- export default content;
226
- }
227
-
228
- declare module "*.svg" {
229
- const content: string;
230
- export default content;
231
- }
232
-
233
- declare module "*.png" {
234
- const content: string;
235
- export default content;
236
- }
237
-
238
- declare module "*.jpg" {
239
- const content: string;
240
- export default content;
241
- }
242
-
243
- declare module "*.jpeg" {
244
- const content: string;
245
- export default content;
246
- }
247
-
248
- declare module "*.gif" {
249
- const content: string;
250
- export default content;
251
- }
252
-
253
- declare module "*.webp" {
254
- const content: string;
255
- export default content;
256
- }
257
-
258
- /**
259
- * Fynix-specific module patterns
260
- */
261
-
262
-
263
- declare module "*.js" {
264
- const Component: any;
265
- export default Component;
266
- }
267
- declare module "*.fnx" {
268
- const Component: any;
269
- export default Component;
270
- }
271
- declare module "*.ts" {
272
- const Component: any;
273
- export default Component;
274
- }
275
- /**
276
- * Vite client types
277
- */
278
- /// <reference types="vite/client" />
279
-
1
+ /* MIT License
2
+
3
+ * Copyright (c) 2026 Resty Gonzales
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ /**
24
+ * Virtual DOM node type - re-exported from fnx.d.ts (single source of truth)
25
+ */
26
+ export type { VNode } from "./fnx";
27
+
28
+ // global.d.ts - Fynix Global Type Declarations
29
+
30
+ /**
31
+ * Reactive state object - references actual nixState return type
32
+ */
33
+ export type NixState<T> = {
34
+ value: T;
35
+ subscribe: (fn: (value: T) => void) => () => void;
36
+ cleanup: () => void;
37
+ getSubscriberCount: () => number;
38
+ isDestroyed: () => boolean;
39
+ asReadOnly: () => {
40
+ value: T;
41
+ subscribe: (fn: (value: T) => void) => () => void;
42
+ _isNixState: true;
43
+ _isReadOnly: true;
44
+ };
45
+ _isNixState: true;
46
+ };
47
+
48
+ /**
49
+ * Reactive store object
50
+ */
51
+ interface NixStore<T extends Record<string, any>> {
52
+ _isNixStore: true;
53
+ subscribe(callback: () => void): () => void;
54
+ getState(): T;
55
+ setState(updates: Partial<T> | ((state: T) => Partial<T>)): void;
56
+ [key: string]: any;
57
+ }
58
+
59
+ /**
60
+ * Async state result
61
+ */
62
+ interface NixAsyncResult<T> {
63
+ data: T | null;
64
+ loading: boolean;
65
+ error: Error | null;
66
+ refetch: () => Promise<void>;
67
+ }
68
+
69
+ /**
70
+ * Form field
71
+ */
72
+ interface NixFormField<T = any> {
73
+ value: T;
74
+ error: string | null;
75
+ touched: boolean;
76
+ }
77
+
78
+ /**
79
+ * Form state
80
+ */
81
+ interface NixFormState<T extends Record<string, any>> {
82
+ values: { [K in keyof T]: NixFormField<T[K]> };
83
+ isValid: boolean;
84
+ isSubmitting: boolean;
85
+ errors: { [K in keyof T]?: string };
86
+ handleSubmit: (
87
+ onSubmit: (values: T) => void | Promise<void>
88
+ ) => (e?: Event) => Promise<void>;
89
+ reset: () => void;
90
+ setFieldValue: <K extends keyof T>(field: K, value: T[K]) => void;
91
+ setFieldError: <K extends keyof T>(field: K, error: string) => void;
92
+ }
93
+
94
+ /**
95
+ * Lazy component result
96
+ */
97
+ interface NixLazyComponent {
98
+ Component: any;
99
+ loading: boolean;
100
+ error: Error | null;
101
+ }
102
+
103
+ /**
104
+ * Fynix Router instance
105
+ */
106
+ interface FynixRouter {
107
+ mountRouter(selector?: string): void;
108
+ navigate(path: string, props?: Record<string, any>): void;
109
+ replace(path: string, props?: Record<string, any>): void;
110
+ back(): void;
111
+ cleanup(): void;
112
+ routes: Record<string, any>;
113
+ dynamicRoutes: Array<{
114
+ pattern: string;
115
+ regex: RegExp;
116
+ component: any;
117
+ params: string[];
118
+ }>;
119
+ }
120
+
121
+ /**
122
+ * Window object extensions for Fynix framework
123
+ */
124
+ interface Window {
125
+ /** Cache for router props to prevent memory leaks */
126
+ __fynixPropsCache?: Map<string, any>;
127
+
128
+ /** Link props namespace for router navigation */
129
+ __fynixLinkProps__?: Record<string, any>;
130
+
131
+ /** Last route props passed to components */
132
+ __lastRouteProps?: any;
133
+
134
+ /** Fynix global state and utilities */
135
+ __fynix__?: {
136
+ /** Current route props */
137
+ lastRouteProps?: any;
138
+ /** Force re-render function */
139
+ rerender?: () => void;
140
+ /** Hot Module Replacement handler */
141
+ hmr?: (ctx: { mod: any }) => void;
142
+ };
143
+ }
144
+
145
+ /**
146
+ * HTMLElement extensions for event delegation and Fynix internals
147
+ */
148
+ interface HTMLElement {
149
+ /** Event delegation ID for r-* event handlers */
150
+ _rest_eid?: number;
151
+
152
+ /** Fynix internal data storage */
153
+ _fynix_?: any;
154
+ }
155
+
156
+ /**
157
+ * Node extensions for Fynix virtual DOM
158
+ */
159
+ interface Node {
160
+ /** Event delegation ID */
161
+ _rest_eid?: number;
162
+ /** Fynix cleanup functions */
163
+ _fynixCleanups?: Array<() => void>;
164
+ }
165
+
166
+ /**
167
+ * Text node type with nodeValue
168
+ */
169
+ interface Text {
170
+ nodeValue: string | null;
171
+ }
172
+
173
+ /**
174
+ * Vite-specific import.meta extensions
175
+ */
176
+ interface ImportMeta {
177
+ /** Vite Hot Module Replacement API */
178
+ readonly hot?: {
179
+ /** Accept HMR updates */
180
+ accept: (cb?: (mod: any) => void) => void;
181
+ /** Cleanup before module disposal */
182
+ dispose: (cb: () => void) => void;
183
+ /** Decline HMR for this module */
184
+ decline?: () => void;
185
+ /** Invalidate and force full reload */
186
+ invalidate?: () => void;
187
+ /** Custom HMR event handling */
188
+ on?: (event: string, cb: (...args: any[]) => void) => void;
189
+ };
190
+
191
+ /** Vite glob import function */
192
+ readonly glob: <T = any>(
193
+ pattern: string,
194
+ options?: {
195
+ /** Load modules eagerly (at build time) */
196
+ eager?: boolean;
197
+ /** Import as URL strings */
198
+ as?: "url" | "raw";
199
+ /** Custom import query */
200
+ query?: Record<string, string | number | boolean>;
201
+ }
202
+ ) => Record<string, T>;
203
+
204
+ /** Environment variables */
205
+ readonly env: {
206
+ MODE: string;
207
+ BASE_URL: string;
208
+ PROD: boolean;
209
+ DEV: boolean;
210
+ SSR: boolean;
211
+ [key: string]: any;
212
+ };
213
+ }
214
+
215
+ /**
216
+ * Module declarations for non-TypeScript files
217
+ */
218
+ declare module "*.css" {
219
+ const content: string;
220
+ export default content;
221
+ }
222
+
223
+ declare module "*.scss" {
224
+ const content: string;
225
+ export default content;
226
+ }
227
+
228
+ declare module "*.svg" {
229
+ const content: string;
230
+ export default content;
231
+ }
232
+
233
+ declare module "*.png" {
234
+ const content: string;
235
+ export default content;
236
+ }
237
+
238
+ declare module "*.jpg" {
239
+ const content: string;
240
+ export default content;
241
+ }
242
+
243
+ declare module "*.jpeg" {
244
+ const content: string;
245
+ export default content;
246
+ }
247
+
248
+ declare module "*.gif" {
249
+ const content: string;
250
+ export default content;
251
+ }
252
+
253
+ declare module "*.webp" {
254
+ const content: string;
255
+ export default content;
256
+ }
257
+
258
+ /**
259
+ * Fynix-specific module patterns
260
+ */
261
+
262
+ declare module "*.js" {
263
+ const Component: any;
264
+ export default Component;
265
+ }
266
+ declare module "*.fnx" {
267
+ const Component: any;
268
+ export default Component;
269
+ }
270
+ declare module "*.ts" {
271
+ const Component: any;
272
+ export default Component;
273
+ }
274
+ /**
275
+ * Vite client types
276
+ */
277
+ /// <reference types="vite/client" />