@teamvelix/velix 5.0.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/LICENSE +21 -0
- package/README.md +117 -0
- package/assets/logo.webp +0 -0
- package/dist/build/index.d.ts +19 -0
- package/dist/build/index.js +588 -0
- package/dist/build/index.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.js +148 -0
- package/dist/client/index.js.map +1 -0
- package/dist/config.d.ts +194 -0
- package/dist/config.js +129 -0
- package/dist/config.js.map +1 -0
- package/dist/index-C4udNtpZ.d.ts +405 -0
- package/dist/index-l0dwPa62.d.ts +106 -0
- package/dist/index.d.ts +792 -0
- package/dist/index.js +3387 -0
- package/dist/index.js.map +1 -0
- package/dist/islands/index.d.ts +97 -0
- package/dist/islands/index.js +182 -0
- package/dist/islands/index.js.map +1 -0
- package/dist/runtime/start-dev.d.ts +2 -0
- package/dist/runtime/start-dev.js +2432 -0
- package/dist/runtime/start-dev.js.map +1 -0
- package/dist/runtime/start-prod.d.ts +2 -0
- package/dist/runtime/start-prod.js +2408 -0
- package/dist/runtime/start-prod.js.map +1 -0
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.js +2442 -0
- package/dist/server/index.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import * as http from 'http';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
interface RouteContextType {
|
|
5
|
+
params: Record<string, string>;
|
|
6
|
+
query: Record<string, string>;
|
|
7
|
+
pathname: string;
|
|
8
|
+
}
|
|
9
|
+
declare const RequestContext: React.Context<any>;
|
|
10
|
+
declare const RouteContext: React.Context<RouteContextType | null>;
|
|
11
|
+
declare const LayoutContext: React.Context<any>;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a request context value
|
|
14
|
+
*/
|
|
15
|
+
declare function createRequestContext(req: http.IncomingMessage, res: http.ServerResponse, params?: Record<string, string>, query?: Record<string, string>): {
|
|
16
|
+
req: http.IncomingMessage;
|
|
17
|
+
res: http.ServerResponse<http.IncomingMessage>;
|
|
18
|
+
params: Record<string, string>;
|
|
19
|
+
query: Record<string, string>;
|
|
20
|
+
url: string | undefined;
|
|
21
|
+
method: string | undefined;
|
|
22
|
+
headers: http.IncomingHttpHeaders;
|
|
23
|
+
cookies: Record<string, string>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Hook to access request context (server-side only)
|
|
27
|
+
*/
|
|
28
|
+
declare function useRequest(): any;
|
|
29
|
+
/**
|
|
30
|
+
* Hook to access route params
|
|
31
|
+
*/
|
|
32
|
+
declare function useParams(): Record<string, string>;
|
|
33
|
+
/**
|
|
34
|
+
* Hook to access query parameters
|
|
35
|
+
*/
|
|
36
|
+
declare function useQuery(): Record<string, string>;
|
|
37
|
+
/**
|
|
38
|
+
* Hook to access current pathname
|
|
39
|
+
*/
|
|
40
|
+
declare function usePathname(): string;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Velix v5 Client Module
|
|
44
|
+
* Client-side navigation, hydration, and the Link component.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
interface RouterState {
|
|
48
|
+
pathname: string;
|
|
49
|
+
query: Record<string, string>;
|
|
50
|
+
params: Record<string, string>;
|
|
51
|
+
}
|
|
52
|
+
declare const router: {
|
|
53
|
+
push(url: string): void;
|
|
54
|
+
replace(url: string): void;
|
|
55
|
+
back(): void;
|
|
56
|
+
forward(): void;
|
|
57
|
+
refresh(): void;
|
|
58
|
+
prefetch(_url: string): void;
|
|
59
|
+
subscribe(listener: () => void): () => boolean;
|
|
60
|
+
getState(): RouterState;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Hook to access the Velix client router
|
|
64
|
+
*/
|
|
65
|
+
declare function useRouter(): {
|
|
66
|
+
push(url: string): void;
|
|
67
|
+
replace(url: string): void;
|
|
68
|
+
back(): void;
|
|
69
|
+
forward(): void;
|
|
70
|
+
refresh(): void;
|
|
71
|
+
prefetch(_url: string): void;
|
|
72
|
+
subscribe(listener: () => void): () => boolean;
|
|
73
|
+
getState(): RouterState;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
77
|
+
href: string;
|
|
78
|
+
prefetch?: boolean | 'hover' | 'visible';
|
|
79
|
+
replace?: boolean;
|
|
80
|
+
scroll?: boolean;
|
|
81
|
+
shallow?: boolean;
|
|
82
|
+
children: React.ReactNode;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Client-side navigation link component
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* import { Link } from 'velix/client';
|
|
90
|
+
*
|
|
91
|
+
* <Link href="/dashboard">Dashboard</Link>
|
|
92
|
+
* <Link href="/blog" prefetch>Blog</Link>
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
declare function Link({ href, prefetch, replace: shouldReplace, scroll, shallow, children, onClick, onMouseEnter, ...rest }: LinkProps): React.DetailedReactHTMLElement<{
|
|
96
|
+
download?: any;
|
|
97
|
+
hrefLang?: string | undefined;
|
|
98
|
+
media?: string | undefined;
|
|
99
|
+
ping?: string | undefined;
|
|
100
|
+
target?: React.HTMLAttributeAnchorTarget | undefined;
|
|
101
|
+
type?: string | undefined;
|
|
102
|
+
referrerPolicy?: React.HTMLAttributeReferrerPolicy | undefined;
|
|
103
|
+
defaultChecked?: boolean | undefined;
|
|
104
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
105
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
106
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
107
|
+
accessKey?: string | undefined;
|
|
108
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
|
|
109
|
+
autoFocus?: boolean | undefined;
|
|
110
|
+
className?: string | undefined;
|
|
111
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
112
|
+
contextMenu?: string | undefined;
|
|
113
|
+
dir?: string | undefined;
|
|
114
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
115
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
116
|
+
hidden?: boolean | undefined;
|
|
117
|
+
id?: string | undefined;
|
|
118
|
+
lang?: string | undefined;
|
|
119
|
+
nonce?: string | undefined;
|
|
120
|
+
slot?: string | undefined;
|
|
121
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
122
|
+
style?: React.CSSProperties | undefined;
|
|
123
|
+
tabIndex?: number | undefined;
|
|
124
|
+
title?: string | undefined;
|
|
125
|
+
translate?: "yes" | "no" | undefined;
|
|
126
|
+
radioGroup?: string | undefined;
|
|
127
|
+
role?: React.AriaRole | undefined;
|
|
128
|
+
about?: string | undefined;
|
|
129
|
+
content?: string | undefined;
|
|
130
|
+
datatype?: string | undefined;
|
|
131
|
+
inlist?: any;
|
|
132
|
+
prefix?: string | undefined;
|
|
133
|
+
property?: string | undefined;
|
|
134
|
+
rel?: string | undefined;
|
|
135
|
+
resource?: string | undefined;
|
|
136
|
+
rev?: string | undefined;
|
|
137
|
+
typeof?: string | undefined;
|
|
138
|
+
vocab?: string | undefined;
|
|
139
|
+
autoCorrect?: string | undefined;
|
|
140
|
+
autoSave?: string | undefined;
|
|
141
|
+
color?: string | undefined;
|
|
142
|
+
itemProp?: string | undefined;
|
|
143
|
+
itemScope?: boolean | undefined;
|
|
144
|
+
itemType?: string | undefined;
|
|
145
|
+
itemID?: string | undefined;
|
|
146
|
+
itemRef?: string | undefined;
|
|
147
|
+
results?: number | undefined;
|
|
148
|
+
security?: string | undefined;
|
|
149
|
+
unselectable?: "on" | "off" | undefined;
|
|
150
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
151
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
152
|
+
popoverTarget?: string | undefined;
|
|
153
|
+
inert?: boolean | undefined;
|
|
154
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
155
|
+
is?: string | undefined;
|
|
156
|
+
exportparts?: string | undefined;
|
|
157
|
+
part?: string | undefined;
|
|
158
|
+
"aria-activedescendant"?: string | undefined;
|
|
159
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
160
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
161
|
+
"aria-braillelabel"?: string | undefined;
|
|
162
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
163
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
164
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
165
|
+
"aria-colcount"?: number | undefined;
|
|
166
|
+
"aria-colindex"?: number | undefined;
|
|
167
|
+
"aria-colindextext"?: string | undefined;
|
|
168
|
+
"aria-colspan"?: number | undefined;
|
|
169
|
+
"aria-controls"?: string | undefined;
|
|
170
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
171
|
+
"aria-describedby"?: string | undefined;
|
|
172
|
+
"aria-description"?: string | undefined;
|
|
173
|
+
"aria-details"?: string | undefined;
|
|
174
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
175
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
|
|
176
|
+
"aria-errormessage"?: string | undefined;
|
|
177
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
178
|
+
"aria-flowto"?: string | undefined;
|
|
179
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
180
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
181
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
182
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
183
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
184
|
+
"aria-label"?: string | undefined;
|
|
185
|
+
"aria-labelledby"?: string | undefined;
|
|
186
|
+
"aria-level"?: number | undefined;
|
|
187
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
188
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
189
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
190
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
191
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
192
|
+
"aria-owns"?: string | undefined;
|
|
193
|
+
"aria-placeholder"?: string | undefined;
|
|
194
|
+
"aria-posinset"?: number | undefined;
|
|
195
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
196
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
197
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
|
|
198
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
199
|
+
"aria-roledescription"?: string | undefined;
|
|
200
|
+
"aria-rowcount"?: number | undefined;
|
|
201
|
+
"aria-rowindex"?: number | undefined;
|
|
202
|
+
"aria-rowindextext"?: string | undefined;
|
|
203
|
+
"aria-rowspan"?: number | undefined;
|
|
204
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
205
|
+
"aria-setsize"?: number | undefined;
|
|
206
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
207
|
+
"aria-valuemax"?: number | undefined;
|
|
208
|
+
"aria-valuemin"?: number | undefined;
|
|
209
|
+
"aria-valuenow"?: number | undefined;
|
|
210
|
+
"aria-valuetext"?: string | undefined;
|
|
211
|
+
dangerouslySetInnerHTML?: {
|
|
212
|
+
__html: string | TrustedHTML;
|
|
213
|
+
} | undefined;
|
|
214
|
+
onCopy?: React.ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
215
|
+
onCopyCapture?: React.ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
216
|
+
onCut?: React.ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
217
|
+
onCutCapture?: React.ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
218
|
+
onPaste?: React.ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
219
|
+
onPasteCapture?: React.ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
220
|
+
onCompositionEnd?: React.CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
221
|
+
onCompositionEndCapture?: React.CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
222
|
+
onCompositionStart?: React.CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
223
|
+
onCompositionStartCapture?: React.CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
224
|
+
onCompositionUpdate?: React.CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
225
|
+
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
226
|
+
onFocus?: React.FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
227
|
+
onFocusCapture?: React.FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
228
|
+
onBlur?: React.FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
229
|
+
onBlurCapture?: React.FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
230
|
+
onChange?: React.FormEventHandler<HTMLAnchorElement> | undefined;
|
|
231
|
+
onChangeCapture?: React.FormEventHandler<HTMLAnchorElement> | undefined;
|
|
232
|
+
onBeforeInput?: React.InputEventHandler<HTMLAnchorElement> | undefined;
|
|
233
|
+
onBeforeInputCapture?: React.FormEventHandler<HTMLAnchorElement> | undefined;
|
|
234
|
+
onInput?: React.FormEventHandler<HTMLAnchorElement> | undefined;
|
|
235
|
+
onInputCapture?: React.FormEventHandler<HTMLAnchorElement> | undefined;
|
|
236
|
+
onReset?: React.FormEventHandler<HTMLAnchorElement> | undefined;
|
|
237
|
+
onResetCapture?: React.FormEventHandler<HTMLAnchorElement> | undefined;
|
|
238
|
+
onSubmit?: React.FormEventHandler<HTMLAnchorElement> | undefined;
|
|
239
|
+
onSubmitCapture?: React.FormEventHandler<HTMLAnchorElement> | undefined;
|
|
240
|
+
onInvalid?: React.FormEventHandler<HTMLAnchorElement> | undefined;
|
|
241
|
+
onInvalidCapture?: React.FormEventHandler<HTMLAnchorElement> | undefined;
|
|
242
|
+
onLoad?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
243
|
+
onLoadCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
244
|
+
onError?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
245
|
+
onErrorCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
246
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
247
|
+
onKeyDownCapture?: React.KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
248
|
+
onKeyPress?: React.KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
249
|
+
onKeyPressCapture?: React.KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
250
|
+
onKeyUp?: React.KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
251
|
+
onKeyUpCapture?: React.KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
252
|
+
onAbort?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
253
|
+
onAbortCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
254
|
+
onCanPlay?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
255
|
+
onCanPlayCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
256
|
+
onCanPlayThrough?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
257
|
+
onCanPlayThroughCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
258
|
+
onDurationChange?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
259
|
+
onDurationChangeCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
260
|
+
onEmptied?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
261
|
+
onEmptiedCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
262
|
+
onEncrypted?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
263
|
+
onEncryptedCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
264
|
+
onEnded?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
265
|
+
onEndedCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
266
|
+
onLoadedData?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
267
|
+
onLoadedDataCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
268
|
+
onLoadedMetadata?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
269
|
+
onLoadedMetadataCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
270
|
+
onLoadStart?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
271
|
+
onLoadStartCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
272
|
+
onPause?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
273
|
+
onPauseCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
274
|
+
onPlay?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
275
|
+
onPlayCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
276
|
+
onPlaying?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
277
|
+
onPlayingCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
278
|
+
onProgress?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
279
|
+
onProgressCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
280
|
+
onRateChange?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
281
|
+
onRateChangeCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
282
|
+
onSeeked?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
283
|
+
onSeekedCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
284
|
+
onSeeking?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
285
|
+
onSeekingCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
286
|
+
onStalled?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
287
|
+
onStalledCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
288
|
+
onSuspend?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
289
|
+
onSuspendCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
290
|
+
onTimeUpdate?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
291
|
+
onTimeUpdateCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
292
|
+
onVolumeChange?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
293
|
+
onVolumeChangeCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
294
|
+
onWaiting?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
295
|
+
onWaitingCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
296
|
+
onAuxClick?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
297
|
+
onAuxClickCapture?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
298
|
+
onClickCapture?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
299
|
+
onContextMenu?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
300
|
+
onContextMenuCapture?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
301
|
+
onDoubleClick?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
302
|
+
onDoubleClickCapture?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
303
|
+
onDrag?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
304
|
+
onDragCapture?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
305
|
+
onDragEnd?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
306
|
+
onDragEndCapture?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
307
|
+
onDragEnter?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
308
|
+
onDragEnterCapture?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
309
|
+
onDragExit?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
310
|
+
onDragExitCapture?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
311
|
+
onDragLeave?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
312
|
+
onDragLeaveCapture?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
313
|
+
onDragOver?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
314
|
+
onDragOverCapture?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
315
|
+
onDragStart?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
316
|
+
onDragStartCapture?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
317
|
+
onDrop?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
318
|
+
onDropCapture?: React.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
319
|
+
onMouseDown?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
320
|
+
onMouseDownCapture?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
321
|
+
onMouseLeave?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
322
|
+
onMouseMove?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
323
|
+
onMouseMoveCapture?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
324
|
+
onMouseOut?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
325
|
+
onMouseOutCapture?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
326
|
+
onMouseOver?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
327
|
+
onMouseOverCapture?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
328
|
+
onMouseUp?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
329
|
+
onMouseUpCapture?: React.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
330
|
+
onSelect?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
331
|
+
onSelectCapture?: React.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
332
|
+
onTouchCancel?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
333
|
+
onTouchCancelCapture?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
334
|
+
onTouchEnd?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
335
|
+
onTouchEndCapture?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
336
|
+
onTouchMove?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
337
|
+
onTouchMoveCapture?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
338
|
+
onTouchStart?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
339
|
+
onTouchStartCapture?: React.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
340
|
+
onPointerDown?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
341
|
+
onPointerDownCapture?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
342
|
+
onPointerMove?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
343
|
+
onPointerMoveCapture?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
344
|
+
onPointerUp?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
345
|
+
onPointerUpCapture?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
346
|
+
onPointerCancel?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
347
|
+
onPointerCancelCapture?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
348
|
+
onPointerEnter?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
349
|
+
onPointerLeave?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
350
|
+
onPointerOver?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
351
|
+
onPointerOverCapture?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
352
|
+
onPointerOut?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
353
|
+
onPointerOutCapture?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
354
|
+
onGotPointerCapture?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
355
|
+
onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
356
|
+
onLostPointerCapture?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
357
|
+
onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
358
|
+
onScroll?: React.UIEventHandler<HTMLAnchorElement> | undefined;
|
|
359
|
+
onScrollCapture?: React.UIEventHandler<HTMLAnchorElement> | undefined;
|
|
360
|
+
onScrollEnd?: React.UIEventHandler<HTMLAnchorElement> | undefined;
|
|
361
|
+
onScrollEndCapture?: React.UIEventHandler<HTMLAnchorElement> | undefined;
|
|
362
|
+
onWheel?: React.WheelEventHandler<HTMLAnchorElement> | undefined;
|
|
363
|
+
onWheelCapture?: React.WheelEventHandler<HTMLAnchorElement> | undefined;
|
|
364
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
365
|
+
onAnimationStartCapture?: React.AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
366
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
367
|
+
onAnimationEndCapture?: React.AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
368
|
+
onAnimationIteration?: React.AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
369
|
+
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
370
|
+
onToggle?: React.ToggleEventHandler<HTMLAnchorElement> | undefined;
|
|
371
|
+
onBeforeToggle?: React.ToggleEventHandler<HTMLAnchorElement> | undefined;
|
|
372
|
+
onTransitionCancel?: React.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
373
|
+
onTransitionCancelCapture?: React.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
374
|
+
onTransitionEnd?: React.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
375
|
+
onTransitionEndCapture?: React.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
376
|
+
onTransitionRun?: React.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
377
|
+
onTransitionRunCapture?: React.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
378
|
+
onTransitionStart?: React.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
379
|
+
onTransitionStartCapture?: React.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
380
|
+
ref: React.RefObject<HTMLAnchorElement | null>;
|
|
381
|
+
href: string;
|
|
382
|
+
onClick: (e: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
383
|
+
onMouseEnter: (e: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
384
|
+
}, HTMLAnchorElement>;
|
|
385
|
+
/**
|
|
386
|
+
* Client entry point for hydrating the app
|
|
387
|
+
*/
|
|
388
|
+
declare function hydrate(): Promise<void>;
|
|
389
|
+
declare const _default: {
|
|
390
|
+
Link: typeof Link;
|
|
391
|
+
useRouter: typeof useRouter;
|
|
392
|
+
router: {
|
|
393
|
+
push(url: string): void;
|
|
394
|
+
replace(url: string): void;
|
|
395
|
+
back(): void;
|
|
396
|
+
forward(): void;
|
|
397
|
+
refresh(): void;
|
|
398
|
+
prefetch(_url: string): void;
|
|
399
|
+
subscribe(listener: () => void): () => boolean;
|
|
400
|
+
getState(): RouterState;
|
|
401
|
+
};
|
|
402
|
+
hydrate: typeof hydrate;
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
export { LayoutContext as L, RequestContext as R, _default as _, useQuery as a, usePathname as b, useRequest as c, RouteContext as d, createRequestContext as e, Link as f, useRouter as g, hydrate as h, router as r, useParams as u };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import http__default from 'http';
|
|
2
|
+
import { VelixConfig } from './config.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Velix v5 Plugin System
|
|
6
|
+
* Extensible hook-based plugin architecture
|
|
7
|
+
*/
|
|
8
|
+
declare const PluginHooks: {
|
|
9
|
+
readonly CONFIG: "config";
|
|
10
|
+
readonly SERVER_START: "server:start";
|
|
11
|
+
readonly REQUEST: "request";
|
|
12
|
+
readonly RESPONSE: "response";
|
|
13
|
+
readonly ROUTES_LOADED: "routes:loaded";
|
|
14
|
+
readonly BEFORE_RENDER: "render:before";
|
|
15
|
+
readonly AFTER_RENDER: "render:after";
|
|
16
|
+
readonly BUILD_START: "build:start";
|
|
17
|
+
readonly BUILD_END: "build:end";
|
|
18
|
+
};
|
|
19
|
+
type PluginHook = typeof PluginHooks[keyof typeof PluginHooks];
|
|
20
|
+
interface VelixPluginDefinition {
|
|
21
|
+
name: string;
|
|
22
|
+
version?: string;
|
|
23
|
+
setup?: (config: any) => void | Promise<void>;
|
|
24
|
+
hooks?: Partial<Record<PluginHook, (...args: any[]) => any>>;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}
|
|
27
|
+
declare class PluginManager {
|
|
28
|
+
private plugins;
|
|
29
|
+
private hooks;
|
|
30
|
+
/**
|
|
31
|
+
* Register a plugin
|
|
32
|
+
*/
|
|
33
|
+
register(plugin: VelixPluginDefinition): void;
|
|
34
|
+
/**
|
|
35
|
+
* Run a hook with arguments
|
|
36
|
+
*/
|
|
37
|
+
runHook(hookName: string, ...args: any[]): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Run a waterfall hook — each handler transforms the first argument
|
|
40
|
+
*/
|
|
41
|
+
runWaterfallHook(hookName: string, value: any, ...args: any[]): Promise<any>;
|
|
42
|
+
/**
|
|
43
|
+
* Get all registered plugins
|
|
44
|
+
*/
|
|
45
|
+
getPlugins(): VelixPluginDefinition[];
|
|
46
|
+
/**
|
|
47
|
+
* Check if a plugin is registered
|
|
48
|
+
*/
|
|
49
|
+
hasPlugin(name: string): boolean;
|
|
50
|
+
}
|
|
51
|
+
declare const pluginManager: PluginManager;
|
|
52
|
+
/**
|
|
53
|
+
* Load plugins from project configuration
|
|
54
|
+
*/
|
|
55
|
+
declare function loadPlugins(projectRoot: string, config: any): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Helper to define a Velix plugin with type safety.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* export default definePlugin({
|
|
62
|
+
* name: 'my-plugin',
|
|
63
|
+
* hooks: {
|
|
64
|
+
* 'server:start': (server) => {
|
|
65
|
+
* console.log('Server started!');
|
|
66
|
+
* }
|
|
67
|
+
* }
|
|
68
|
+
* });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
declare function definePlugin(definition: VelixPluginDefinition): VelixPluginDefinition;
|
|
72
|
+
|
|
73
|
+
interface TailwindPluginOptions {
|
|
74
|
+
input?: string;
|
|
75
|
+
output?: string;
|
|
76
|
+
config?: string;
|
|
77
|
+
minify?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Native Velix Tailwind CSS Plugin
|
|
81
|
+
* Automatically handles CSS compilation and injection.
|
|
82
|
+
*/
|
|
83
|
+
declare function tailwindPlugin(options?: TailwindPluginOptions): VelixPluginDefinition;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Velix v5 Server
|
|
87
|
+
*
|
|
88
|
+
* Modular HTTP server with SSR, static file serving, API routes,
|
|
89
|
+
* server actions, middleware, and plugin hooks.
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
interface VelixServer {
|
|
93
|
+
server: http__default.Server;
|
|
94
|
+
config: VelixConfig;
|
|
95
|
+
close: () => void;
|
|
96
|
+
}
|
|
97
|
+
declare function createServer(options?: {
|
|
98
|
+
projectRoot?: string;
|
|
99
|
+
mode?: 'development' | 'production';
|
|
100
|
+
}): Promise<VelixServer>;
|
|
101
|
+
declare const _default: {
|
|
102
|
+
createServer: typeof createServer;
|
|
103
|
+
tailwindPlugin: typeof tailwindPlugin;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export { PluginManager as P, type VelixServer as V, _default as _, PluginHooks as a, createServer as c, definePlugin as d, loadPlugins as l, pluginManager as p, tailwindPlugin as t };
|