weifuwu 0.16.2 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +659 -1294
- package/cli.ts +103 -5
- package/dist/cli.js +98 -5
- package/dist/client-router.d.ts +296 -0
- package/dist/csrf.d.ts +8 -0
- package/dist/hub.d.ts +12 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +405 -83
- package/dist/messager/types.d.ts +2 -0
- package/dist/messager/ws.d.ts +1 -0
- package/dist/serve.d.ts +1 -0
- package/dist/use-action.d.ts +14 -0
- package/dist/use-websocket.d.ts +17 -0
- package/package.json +1 -1
package/cli.ts
CHANGED
|
@@ -47,24 +47,122 @@ async function cmdInit(name: string) {
|
|
|
47
47
|
jsx: 'react-jsx',
|
|
48
48
|
skipLibCheck: true,
|
|
49
49
|
},
|
|
50
|
-
include: ['*.ts'],
|
|
50
|
+
include: ['*.ts', 'ui/**/*.ts', 'ui/**/*.tsx'],
|
|
51
51
|
}, null, 2) + '\n')
|
|
52
52
|
|
|
53
53
|
await writeFile(join(targetDir, '.gitignore'), 'node_modules\ndist\n.env\n.sessions\n')
|
|
54
54
|
|
|
55
55
|
await writeFile(join(targetDir, '.env'), 'PORT=3000\n')
|
|
56
56
|
|
|
57
|
+
await writeFile(join(targetDir, 'AGENTS.md'), [
|
|
58
|
+
`# ${name}`,
|
|
59
|
+
'',
|
|
60
|
+
'This is a [weifuwu](https://weifuwu.io) HTTP application — pure Node.js, no build step.',
|
|
61
|
+
'',
|
|
62
|
+
'## Commands',
|
|
63
|
+
'',
|
|
64
|
+
'- `npm run dev` — start dev server with `--watch`',
|
|
65
|
+
'- `npm start` — start production server',
|
|
66
|
+
'- `npm install` — install dependencies',
|
|
67
|
+
'- `node --test` — run tests',
|
|
68
|
+
'',
|
|
69
|
+
'## TypeScript',
|
|
70
|
+
'',
|
|
71
|
+
'- Node.js v24+ runs TypeScript natively (no build step needed)',
|
|
72
|
+
"- All imports use explicit `.ts` extensions (e.g. `import { x } from './foo.ts'`)",
|
|
73
|
+
'- For JSX/React SSR, use `.tsx` files',
|
|
74
|
+
'',
|
|
75
|
+
'## API Reference',
|
|
76
|
+
'',
|
|
77
|
+
'See `node_modules/weifuwu/README.md` for the full weifuwu API documentation including `serve()`, `Router`, middleware, PostgreSQL, auth, and more.',
|
|
78
|
+
'',
|
|
79
|
+
].join('\n'))
|
|
80
|
+
|
|
57
81
|
await writeFile(join(targetDir, 'app.ts'), [
|
|
58
|
-
"import { serve, Router, loadEnv } from 'weifuwu'",
|
|
82
|
+
"import { serve, Router, loadEnv, tsx } from 'weifuwu'",
|
|
59
83
|
'',
|
|
60
84
|
"loadEnv()",
|
|
61
85
|
"const port = Number(process.env.PORT) || 3000",
|
|
62
86
|
'',
|
|
63
87
|
"const app = new Router()",
|
|
64
|
-
"
|
|
88
|
+
"const ui = await tsx({ dir: './ui/' })",
|
|
89
|
+
"app.use('/', ui)",
|
|
90
|
+
'',
|
|
91
|
+
"app.get('/api/ping', () => Response.json({ pong: true, time: new Date().toISOString() }))",
|
|
92
|
+
'',
|
|
93
|
+
"app.ws('/ws/echo', { message(ws, _ctx, data) { ws.send(`echo: ${data}`) } })",
|
|
94
|
+
'',
|
|
95
|
+
"const server = serve(app.handler(), { port, websocket: app.websocketHandler() })",
|
|
96
|
+
"await server.ready",
|
|
97
|
+
"console.log(`Listening on http://localhost:${server.port}`)",
|
|
98
|
+
'',
|
|
99
|
+
].join('\n'))
|
|
100
|
+
|
|
101
|
+
await mkdir(join(targetDir, 'ui', 'pages'), { recursive: true })
|
|
102
|
+
|
|
103
|
+
await writeFile(join(targetDir, 'ui', 'app.css'), '@import "tailwindcss";\n')
|
|
104
|
+
|
|
105
|
+
await writeFile(join(targetDir, 'ui', 'pages', 'layout.tsx'), [
|
|
106
|
+
"import { ReactNode } from 'react'",
|
|
107
|
+
'',
|
|
108
|
+
'export default function RootLayout({ children }: { children: ReactNode }) {',
|
|
109
|
+
' return (',
|
|
110
|
+
' <html lang="en">',
|
|
111
|
+
' <head>',
|
|
112
|
+
' <meta charSet="utf-8" />',
|
|
113
|
+
' <meta name="viewport" content="width=device-width, initial-scale=1" />',
|
|
114
|
+
' </head>',
|
|
115
|
+
' <body>',
|
|
116
|
+
' <main>{children}</main>',
|
|
117
|
+
' </body>',
|
|
118
|
+
' </html>',
|
|
119
|
+
' )',
|
|
120
|
+
'}',
|
|
121
|
+
'',
|
|
122
|
+
].join('\n'))
|
|
123
|
+
|
|
124
|
+
await writeFile(join(targetDir, 'ui', 'pages', 'page.tsx'), [
|
|
125
|
+
"import { useState } from 'react'",
|
|
126
|
+
"import { useWebsocket } from 'weifuwu'",
|
|
127
|
+
'',
|
|
128
|
+
'export default function Home() {',
|
|
129
|
+
' const [input, setInput] = useState("")',
|
|
130
|
+
' const { send, lastMessage, readyState } = useWebsocket("/ws/echo")',
|
|
65
131
|
'',
|
|
66
|
-
|
|
67
|
-
"
|
|
132
|
+
' return (',
|
|
133
|
+
' <div className="p-8 max-w-xl mx-auto">',
|
|
134
|
+
' <h1 className="text-3xl font-bold mb-2">Hello, Weifuwu!</h1>',
|
|
135
|
+
' <p className="text-gray-600 mb-6">',
|
|
136
|
+
' Welcome to your weifuwu application.',
|
|
137
|
+
' </p>',
|
|
138
|
+
' <div className="border rounded-lg p-4 space-y-3">',
|
|
139
|
+
' <p className="text-sm text-gray-500">',
|
|
140
|
+
' WebSocket: {readyState === 1 ? "Connected" : readyState === 0 ? "Connecting..." : "Disconnected"}',
|
|
141
|
+
' </p>',
|
|
142
|
+
' <div className="flex gap-2">',
|
|
143
|
+
' <input',
|
|
144
|
+
' value={input}',
|
|
145
|
+
' onChange={e => setInput(e.target.value)}',
|
|
146
|
+
' onKeyDown={e => { if (e.key === "Enter") { send(input); setInput("") } }}',
|
|
147
|
+
' placeholder="Type a message..."',
|
|
148
|
+
' className="flex-1 border rounded px-3 py-2 text-sm"',
|
|
149
|
+
' />',
|
|
150
|
+
' <button',
|
|
151
|
+
' onClick={() => { send(input); setInput("") }}',
|
|
152
|
+
' className="bg-blue-600 text-white px-4 py-2 rounded text-sm"',
|
|
153
|
+
' >',
|
|
154
|
+
' Send',
|
|
155
|
+
' </button>',
|
|
156
|
+
' </div>',
|
|
157
|
+
' {lastMessage && (',
|
|
158
|
+
' <div className="text-sm bg-gray-50 rounded p-2">',
|
|
159
|
+
' <span className="font-medium">Echo:</span> {lastMessage}',
|
|
160
|
+
' </div>',
|
|
161
|
+
' )}',
|
|
162
|
+
' </div>',
|
|
163
|
+
' </div>',
|
|
164
|
+
' )',
|
|
165
|
+
'}',
|
|
68
166
|
'',
|
|
69
167
|
].join('\n'))
|
|
70
168
|
|
package/dist/cli.js
CHANGED
|
@@ -42,21 +42,114 @@ async function cmdInit(name) {
|
|
|
42
42
|
jsx: "react-jsx",
|
|
43
43
|
skipLibCheck: true
|
|
44
44
|
},
|
|
45
|
-
include: ["*.ts"]
|
|
45
|
+
include: ["*.ts", "ui/**/*.ts", "ui/**/*.tsx"]
|
|
46
46
|
}, null, 2) + "\n");
|
|
47
47
|
await writeFile(join(targetDir, ".gitignore"), "node_modules\ndist\n.env\n.sessions\n");
|
|
48
48
|
await writeFile(join(targetDir, ".env"), "PORT=3000\n");
|
|
49
|
+
await writeFile(join(targetDir, "AGENTS.md"), [
|
|
50
|
+
`# ${name}`,
|
|
51
|
+
"",
|
|
52
|
+
"This is a [weifuwu](https://weifuwu.io) HTTP application \u2014 pure Node.js, no build step.",
|
|
53
|
+
"",
|
|
54
|
+
"## Commands",
|
|
55
|
+
"",
|
|
56
|
+
"- `npm run dev` \u2014 start dev server with `--watch`",
|
|
57
|
+
"- `npm start` \u2014 start production server",
|
|
58
|
+
"- `npm install` \u2014 install dependencies",
|
|
59
|
+
"- `node --test` \u2014 run tests",
|
|
60
|
+
"",
|
|
61
|
+
"## TypeScript",
|
|
62
|
+
"",
|
|
63
|
+
"- Node.js v24+ runs TypeScript natively (no build step needed)",
|
|
64
|
+
"- All imports use explicit `.ts` extensions (e.g. `import { x } from './foo.ts'`)",
|
|
65
|
+
"- For JSX/React SSR, use `.tsx` files",
|
|
66
|
+
"",
|
|
67
|
+
"## API Reference",
|
|
68
|
+
"",
|
|
69
|
+
"See `node_modules/weifuwu/README.md` for the full weifuwu API documentation including `serve()`, `Router`, middleware, PostgreSQL, auth, and more.",
|
|
70
|
+
""
|
|
71
|
+
].join("\n"));
|
|
49
72
|
await writeFile(join(targetDir, "app.ts"), [
|
|
50
|
-
"import { serve, Router, loadEnv } from 'weifuwu'",
|
|
73
|
+
"import { serve, Router, loadEnv, tsx } from 'weifuwu'",
|
|
51
74
|
"",
|
|
52
75
|
"loadEnv()",
|
|
53
76
|
"const port = Number(process.env.PORT) || 3000",
|
|
54
77
|
"",
|
|
55
78
|
"const app = new Router()",
|
|
56
|
-
"
|
|
79
|
+
"const ui = await tsx({ dir: './ui/' })",
|
|
80
|
+
"app.use('/', ui)",
|
|
81
|
+
"",
|
|
82
|
+
"app.get('/api/ping', () => Response.json({ pong: true, time: new Date().toISOString() }))",
|
|
83
|
+
"",
|
|
84
|
+
"app.ws('/ws/echo', { message(ws, _ctx, data) { ws.send(`echo: ${data}`) } })",
|
|
85
|
+
"",
|
|
86
|
+
"const server = serve(app.handler(), { port, websocket: app.websocketHandler() })",
|
|
87
|
+
"await server.ready",
|
|
88
|
+
"console.log(`Listening on http://localhost:${server.port}`)",
|
|
89
|
+
""
|
|
90
|
+
].join("\n"));
|
|
91
|
+
await mkdir(join(targetDir, "ui", "pages"), { recursive: true });
|
|
92
|
+
await writeFile(join(targetDir, "ui", "app.css"), '@import "tailwindcss";\n');
|
|
93
|
+
await writeFile(join(targetDir, "ui", "pages", "layout.tsx"), [
|
|
94
|
+
"import { ReactNode } from 'react'",
|
|
95
|
+
"",
|
|
96
|
+
"export default function RootLayout({ children }: { children: ReactNode }) {",
|
|
97
|
+
" return (",
|
|
98
|
+
' <html lang="en">',
|
|
99
|
+
" <head>",
|
|
100
|
+
' <meta charSet="utf-8" />',
|
|
101
|
+
' <meta name="viewport" content="width=device-width, initial-scale=1" />',
|
|
102
|
+
" </head>",
|
|
103
|
+
" <body>",
|
|
104
|
+
" <main>{children}</main>",
|
|
105
|
+
" </body>",
|
|
106
|
+
" </html>",
|
|
107
|
+
" )",
|
|
108
|
+
"}",
|
|
109
|
+
""
|
|
110
|
+
].join("\n"));
|
|
111
|
+
await writeFile(join(targetDir, "ui", "pages", "page.tsx"), [
|
|
112
|
+
"import { useState } from 'react'",
|
|
113
|
+
"import { useWebsocket } from 'weifuwu'",
|
|
114
|
+
"",
|
|
115
|
+
"export default function Home() {",
|
|
116
|
+
' const [input, setInput] = useState("")',
|
|
117
|
+
' const { send, lastMessage, readyState } = useWebsocket("/ws/echo")',
|
|
57
118
|
"",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
119
|
+
" return (",
|
|
120
|
+
' <div className="p-8 max-w-xl mx-auto">',
|
|
121
|
+
' <h1 className="text-3xl font-bold mb-2">Hello, Weifuwu!</h1>',
|
|
122
|
+
' <p className="text-gray-600 mb-6">',
|
|
123
|
+
" Welcome to your weifuwu application.",
|
|
124
|
+
" </p>",
|
|
125
|
+
' <div className="border rounded-lg p-4 space-y-3">',
|
|
126
|
+
' <p className="text-sm text-gray-500">',
|
|
127
|
+
' WebSocket: {readyState === 1 ? "Connected" : readyState === 0 ? "Connecting..." : "Disconnected"}',
|
|
128
|
+
" </p>",
|
|
129
|
+
' <div className="flex gap-2">',
|
|
130
|
+
" <input",
|
|
131
|
+
" value={input}",
|
|
132
|
+
" onChange={e => setInput(e.target.value)}",
|
|
133
|
+
' onKeyDown={e => { if (e.key === "Enter") { send(input); setInput("") } }}',
|
|
134
|
+
' placeholder="Type a message..."',
|
|
135
|
+
' className="flex-1 border rounded px-3 py-2 text-sm"',
|
|
136
|
+
" />",
|
|
137
|
+
" <button",
|
|
138
|
+
' onClick={() => { send(input); setInput("") }}',
|
|
139
|
+
' className="bg-blue-600 text-white px-4 py-2 rounded text-sm"',
|
|
140
|
+
" >",
|
|
141
|
+
" Send",
|
|
142
|
+
" </button>",
|
|
143
|
+
" </div>",
|
|
144
|
+
" {lastMessage && (",
|
|
145
|
+
' <div className="text-sm bg-gray-50 rounded p-2">',
|
|
146
|
+
' <span className="font-medium">Echo:</span> {lastMessage}',
|
|
147
|
+
" </div>",
|
|
148
|
+
" )}",
|
|
149
|
+
" </div>",
|
|
150
|
+
" </div>",
|
|
151
|
+
" )",
|
|
152
|
+
"}",
|
|
60
153
|
""
|
|
61
154
|
].join("\n"));
|
|
62
155
|
console.log(`\u2705 Created ${name}/ \u2014 cd ${name} && npm install && npm run dev`);
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
export declare function navigate(href: string): Promise<void>;
|
|
2
|
+
export declare function useNavigate(): (href: string) => Promise<void>;
|
|
3
|
+
interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
|
|
4
|
+
href: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function Link({ href, children, onClick, ...props }: LinkProps): import("react").DetailedReactHTMLElement<{
|
|
8
|
+
download?: any;
|
|
9
|
+
hrefLang?: string | undefined | undefined;
|
|
10
|
+
media?: string | undefined | undefined;
|
|
11
|
+
ping?: string | undefined | undefined;
|
|
12
|
+
target?: import("react").HTMLAttributeAnchorTarget | undefined;
|
|
13
|
+
type?: string | undefined | undefined;
|
|
14
|
+
referrerPolicy?: import("react").HTMLAttributeReferrerPolicy | undefined;
|
|
15
|
+
defaultChecked?: boolean | undefined | undefined;
|
|
16
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
17
|
+
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
18
|
+
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
19
|
+
accessKey?: string | undefined | undefined;
|
|
20
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
21
|
+
autoFocus?: boolean | undefined | undefined;
|
|
22
|
+
className?: string | undefined | undefined;
|
|
23
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
24
|
+
contextMenu?: string | undefined | undefined;
|
|
25
|
+
dir?: string | undefined | undefined;
|
|
26
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
27
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
28
|
+
hidden?: boolean | undefined | undefined;
|
|
29
|
+
id?: string | undefined | undefined;
|
|
30
|
+
lang?: string | undefined | undefined;
|
|
31
|
+
nonce?: string | undefined | undefined;
|
|
32
|
+
slot?: string | undefined | undefined;
|
|
33
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
34
|
+
style?: import("react").CSSProperties | undefined;
|
|
35
|
+
tabIndex?: number | undefined | undefined;
|
|
36
|
+
title?: string | undefined | undefined;
|
|
37
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
38
|
+
radioGroup?: string | undefined | undefined;
|
|
39
|
+
role?: import("react").AriaRole | undefined;
|
|
40
|
+
about?: string | undefined | undefined;
|
|
41
|
+
content?: string | undefined | undefined;
|
|
42
|
+
datatype?: string | undefined | undefined;
|
|
43
|
+
inlist?: any;
|
|
44
|
+
prefix?: string | undefined | undefined;
|
|
45
|
+
property?: string | undefined | undefined;
|
|
46
|
+
rel?: string | undefined | undefined;
|
|
47
|
+
resource?: string | undefined | undefined;
|
|
48
|
+
rev?: string | undefined | undefined;
|
|
49
|
+
typeof?: string | undefined | undefined;
|
|
50
|
+
vocab?: string | undefined | undefined;
|
|
51
|
+
autoCorrect?: string | undefined | undefined;
|
|
52
|
+
autoSave?: string | undefined | undefined;
|
|
53
|
+
color?: string | undefined | undefined;
|
|
54
|
+
itemProp?: string | undefined | undefined;
|
|
55
|
+
itemScope?: boolean | undefined | undefined;
|
|
56
|
+
itemType?: string | undefined | undefined;
|
|
57
|
+
itemID?: string | undefined | undefined;
|
|
58
|
+
itemRef?: string | undefined | undefined;
|
|
59
|
+
results?: number | undefined | undefined;
|
|
60
|
+
security?: string | undefined | undefined;
|
|
61
|
+
unselectable?: "on" | "off" | undefined | undefined;
|
|
62
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined | undefined;
|
|
63
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
64
|
+
popoverTarget?: string | undefined | undefined;
|
|
65
|
+
inert?: boolean | undefined | undefined;
|
|
66
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
67
|
+
is?: string | undefined | undefined;
|
|
68
|
+
exportparts?: string | undefined | undefined;
|
|
69
|
+
part?: string | undefined | undefined;
|
|
70
|
+
"aria-activedescendant"?: string | undefined | undefined;
|
|
71
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
72
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
|
|
73
|
+
"aria-braillelabel"?: string | undefined | undefined;
|
|
74
|
+
"aria-brailleroledescription"?: string | undefined | undefined;
|
|
75
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
76
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
77
|
+
"aria-colcount"?: number | undefined | undefined;
|
|
78
|
+
"aria-colindex"?: number | undefined | undefined;
|
|
79
|
+
"aria-colindextext"?: string | undefined | undefined;
|
|
80
|
+
"aria-colspan"?: number | undefined | undefined;
|
|
81
|
+
"aria-controls"?: string | undefined | undefined;
|
|
82
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined | undefined;
|
|
83
|
+
"aria-describedby"?: string | undefined | undefined;
|
|
84
|
+
"aria-description"?: string | undefined | undefined;
|
|
85
|
+
"aria-details"?: string | undefined | undefined;
|
|
86
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
87
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
|
|
88
|
+
"aria-errormessage"?: string | undefined | undefined;
|
|
89
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
90
|
+
"aria-flowto"?: string | undefined | undefined;
|
|
91
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
92
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined | undefined;
|
|
93
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
94
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined | undefined;
|
|
95
|
+
"aria-keyshortcuts"?: string | undefined | undefined;
|
|
96
|
+
"aria-label"?: string | undefined | undefined;
|
|
97
|
+
"aria-labelledby"?: string | undefined | undefined;
|
|
98
|
+
"aria-level"?: number | undefined | undefined;
|
|
99
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined | undefined;
|
|
100
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
101
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
102
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
103
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined | undefined;
|
|
104
|
+
"aria-owns"?: string | undefined | undefined;
|
|
105
|
+
"aria-placeholder"?: string | undefined | undefined;
|
|
106
|
+
"aria-posinset"?: number | undefined | undefined;
|
|
107
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
108
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
109
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined | undefined;
|
|
110
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
111
|
+
"aria-roledescription"?: string | undefined | undefined;
|
|
112
|
+
"aria-rowcount"?: number | undefined | undefined;
|
|
113
|
+
"aria-rowindex"?: number | undefined | undefined;
|
|
114
|
+
"aria-rowindextext"?: string | undefined | undefined;
|
|
115
|
+
"aria-rowspan"?: number | undefined | undefined;
|
|
116
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
117
|
+
"aria-setsize"?: number | undefined | undefined;
|
|
118
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined | undefined;
|
|
119
|
+
"aria-valuemax"?: number | undefined | undefined;
|
|
120
|
+
"aria-valuemin"?: number | undefined | undefined;
|
|
121
|
+
"aria-valuenow"?: number | undefined | undefined;
|
|
122
|
+
"aria-valuetext"?: string | undefined | undefined;
|
|
123
|
+
dangerouslySetInnerHTML?: {
|
|
124
|
+
__html: string | TrustedHTML;
|
|
125
|
+
} | undefined | undefined;
|
|
126
|
+
onCopy?: import("react").ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
127
|
+
onCopyCapture?: import("react").ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
128
|
+
onCut?: import("react").ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
129
|
+
onCutCapture?: import("react").ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
130
|
+
onPaste?: import("react").ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
131
|
+
onPasteCapture?: import("react").ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
132
|
+
onCompositionEnd?: import("react").CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
133
|
+
onCompositionEndCapture?: import("react").CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
134
|
+
onCompositionStart?: import("react").CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
135
|
+
onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
136
|
+
onCompositionUpdate?: import("react").CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
137
|
+
onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
138
|
+
onFocus?: import("react").FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
139
|
+
onFocusCapture?: import("react").FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
140
|
+
onBlur?: import("react").FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
141
|
+
onBlurCapture?: import("react").FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
142
|
+
onChange?: import("react").ChangeEventHandler<HTMLAnchorElement, Element> | undefined;
|
|
143
|
+
onChangeCapture?: import("react").ChangeEventHandler<HTMLAnchorElement, Element> | undefined;
|
|
144
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLAnchorElement> | undefined;
|
|
145
|
+
onBeforeInputCapture?: import("react").InputEventHandler<HTMLAnchorElement> | undefined;
|
|
146
|
+
onInput?: import("react").InputEventHandler<HTMLAnchorElement> | undefined;
|
|
147
|
+
onInputCapture?: import("react").InputEventHandler<HTMLAnchorElement> | undefined;
|
|
148
|
+
onReset?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
149
|
+
onResetCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
150
|
+
onSubmit?: import("react").SubmitEventHandler<HTMLAnchorElement> | undefined;
|
|
151
|
+
onSubmitCapture?: import("react").SubmitEventHandler<HTMLAnchorElement> | undefined;
|
|
152
|
+
onInvalid?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
153
|
+
onInvalidCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
154
|
+
onLoad?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
155
|
+
onLoadCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
156
|
+
onError?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
157
|
+
onErrorCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
158
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
159
|
+
onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
160
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
161
|
+
onKeyPressCapture?: import("react").KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
162
|
+
onKeyUp?: import("react").KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
163
|
+
onKeyUpCapture?: import("react").KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
164
|
+
onAbort?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
165
|
+
onAbortCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
166
|
+
onCanPlay?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
167
|
+
onCanPlayCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
168
|
+
onCanPlayThrough?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
169
|
+
onCanPlayThroughCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
170
|
+
onDurationChange?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
171
|
+
onDurationChangeCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
172
|
+
onEmptied?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
173
|
+
onEmptiedCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
174
|
+
onEncrypted?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
175
|
+
onEncryptedCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
176
|
+
onEnded?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
177
|
+
onEndedCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
178
|
+
onLoadedData?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
179
|
+
onLoadedDataCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
180
|
+
onLoadedMetadata?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
181
|
+
onLoadedMetadataCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
182
|
+
onLoadStart?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
183
|
+
onLoadStartCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
184
|
+
onPause?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
185
|
+
onPauseCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
186
|
+
onPlay?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
187
|
+
onPlayCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
188
|
+
onPlaying?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
189
|
+
onPlayingCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
190
|
+
onProgress?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
191
|
+
onProgressCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
192
|
+
onRateChange?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
193
|
+
onRateChangeCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
194
|
+
onSeeked?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
195
|
+
onSeekedCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
196
|
+
onSeeking?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
197
|
+
onSeekingCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
198
|
+
onStalled?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
199
|
+
onStalledCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
200
|
+
onSuspend?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
201
|
+
onSuspendCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
202
|
+
onTimeUpdate?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
203
|
+
onTimeUpdateCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
204
|
+
onVolumeChange?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
205
|
+
onVolumeChangeCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
206
|
+
onWaiting?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
207
|
+
onWaitingCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
208
|
+
onAuxClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
209
|
+
onAuxClickCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
210
|
+
onClickCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
211
|
+
onContextMenu?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
212
|
+
onContextMenuCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
213
|
+
onDoubleClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
214
|
+
onDoubleClickCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
215
|
+
onDrag?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
216
|
+
onDragCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
217
|
+
onDragEnd?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
218
|
+
onDragEndCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
219
|
+
onDragEnter?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
220
|
+
onDragEnterCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
221
|
+
onDragExit?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
222
|
+
onDragExitCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
223
|
+
onDragLeave?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
224
|
+
onDragLeaveCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
225
|
+
onDragOver?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
226
|
+
onDragOverCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
227
|
+
onDragStart?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
228
|
+
onDragStartCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
229
|
+
onDrop?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
230
|
+
onDropCapture?: import("react").DragEventHandler<HTMLAnchorElement> | undefined;
|
|
231
|
+
onMouseDown?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
232
|
+
onMouseDownCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
233
|
+
onMouseEnter?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
234
|
+
onMouseLeave?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
235
|
+
onMouseMove?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
236
|
+
onMouseMoveCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
237
|
+
onMouseOut?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
238
|
+
onMouseOutCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
239
|
+
onMouseOver?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
240
|
+
onMouseOverCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
241
|
+
onMouseUp?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
242
|
+
onMouseUpCapture?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
243
|
+
onSelect?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
244
|
+
onSelectCapture?: import("react").ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
245
|
+
onTouchCancel?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
246
|
+
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
247
|
+
onTouchEnd?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
248
|
+
onTouchEndCapture?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
249
|
+
onTouchMove?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
250
|
+
onTouchMoveCapture?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
251
|
+
onTouchStart?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
252
|
+
onTouchStartCapture?: import("react").TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
253
|
+
onPointerDown?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
254
|
+
onPointerDownCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
255
|
+
onPointerMove?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
256
|
+
onPointerMoveCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
257
|
+
onPointerUp?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
258
|
+
onPointerUpCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
259
|
+
onPointerCancel?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
260
|
+
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
261
|
+
onPointerEnter?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
262
|
+
onPointerLeave?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
263
|
+
onPointerOver?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
264
|
+
onPointerOverCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
265
|
+
onPointerOut?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
266
|
+
onPointerOutCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
267
|
+
onGotPointerCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
268
|
+
onGotPointerCaptureCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
269
|
+
onLostPointerCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
270
|
+
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
271
|
+
onScroll?: import("react").UIEventHandler<HTMLAnchorElement> | undefined;
|
|
272
|
+
onScrollCapture?: import("react").UIEventHandler<HTMLAnchorElement> | undefined;
|
|
273
|
+
onScrollEnd?: import("react").UIEventHandler<HTMLAnchorElement> | undefined;
|
|
274
|
+
onScrollEndCapture?: import("react").UIEventHandler<HTMLAnchorElement> | undefined;
|
|
275
|
+
onWheel?: import("react").WheelEventHandler<HTMLAnchorElement> | undefined;
|
|
276
|
+
onWheelCapture?: import("react").WheelEventHandler<HTMLAnchorElement> | undefined;
|
|
277
|
+
onAnimationStart?: import("react").AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
278
|
+
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
279
|
+
onAnimationEnd?: import("react").AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
280
|
+
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
281
|
+
onAnimationIteration?: import("react").AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
282
|
+
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
283
|
+
onToggle?: import("react").ToggleEventHandler<HTMLAnchorElement> | undefined;
|
|
284
|
+
onBeforeToggle?: import("react").ToggleEventHandler<HTMLAnchorElement> | undefined;
|
|
285
|
+
onTransitionCancel?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
286
|
+
onTransitionCancelCapture?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
287
|
+
onTransitionEnd?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
288
|
+
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
289
|
+
onTransitionRun?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
290
|
+
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
291
|
+
onTransitionStart?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
292
|
+
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
293
|
+
href: string;
|
|
294
|
+
onClick: (e: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
295
|
+
}, HTMLElement>;
|
|
296
|
+
export {};
|
package/dist/csrf.d.ts
ADDED
package/dist/hub.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Redis } from './vendor.ts';
|
|
2
|
+
export interface HubOptions {
|
|
3
|
+
redis?: Redis;
|
|
4
|
+
prefix?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface Hub {
|
|
7
|
+
join(key: string, ws: WebSocket): void;
|
|
8
|
+
leave(ws: WebSocket): void;
|
|
9
|
+
broadcast(key: string, data: unknown): void;
|
|
10
|
+
close(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare function createHub(opts?: HubOptions): Hub;
|
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export { user } from './user/index.ts';
|
|
|
38
38
|
export type { UserOptions, UserData, UserModule, OAuth2Client, } from './user/types.ts';
|
|
39
39
|
export { redis } from './redis/index.ts';
|
|
40
40
|
export type { RedisOptions, RedisClient } from './redis/types.ts';
|
|
41
|
+
export { createHub } from './hub.ts';
|
|
42
|
+
export type { Hub, HubOptions } from './hub.ts';
|
|
41
43
|
export { queue } from './queue/index.ts';
|
|
42
44
|
export type { QueueOptions, QueueJob, Queue } from './queue/types.ts';
|
|
43
45
|
export { tenant } from './tenant/index.ts';
|
|
@@ -58,6 +60,13 @@ export { seo, seoMiddleware, seoTags } from './seo.ts';
|
|
|
58
60
|
export type { SeoOptions, RobotsRule, SitemapUrl, SitemapConfig, SeoHeadersConfig, SeoTagsConfig, } from './seo.ts';
|
|
59
61
|
export { mailer } from './mailer.ts';
|
|
60
62
|
export type { MailerOptions, MailOptions, Mailer } from './mailer.ts';
|
|
63
|
+
export { useWebsocket } from './use-websocket.ts';
|
|
64
|
+
export type { UseWebsocketOptions, UseWebsocketReturn } from './use-websocket.ts';
|
|
65
|
+
export { useAction } from './use-action.ts';
|
|
66
|
+
export type { UseActionOptions, UseActionReturn } from './use-action.ts';
|
|
67
|
+
export { Link, useNavigate, navigate } from './client-router.ts';
|
|
68
|
+
export { csrf } from './csrf.ts';
|
|
69
|
+
export type { CsrfOptions } from './csrf.ts';
|
|
61
70
|
export { logdb } from './logdb/index.ts';
|
|
62
71
|
export type { LogdbOptions, LogdbModule, LogEntry, LogEntryInput, } from './logdb/types.ts';
|
|
63
72
|
export { iii, createWorker, registerWorker } from './iii/index.ts';
|