alepha 0.15.1 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/audits/index.d.ts +342 -365
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/audits/index.js +10 -33
- package/dist/api/audits/index.js.map +1 -1
- package/dist/api/files/index.d.ts +180 -173
- package/dist/api/files/index.d.ts.map +1 -1
- package/dist/api/files/index.js +10 -3
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.d.ts +162 -155
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +10 -3
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/keys/index.d.ts +413 -0
- package/dist/api/keys/index.d.ts.map +1 -0
- package/dist/api/keys/index.js +476 -0
- package/dist/api/keys/index.js.map +1 -0
- package/dist/api/notifications/index.d.ts +10 -4
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/notifications/index.js +10 -4
- package/dist/api/notifications/index.js.map +1 -1
- package/dist/api/parameters/index.d.ts +294 -301
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/parameters/index.js +30 -37
- package/dist/api/parameters/index.js.map +1 -1
- package/dist/api/users/index.d.ts +1079 -769
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +2534 -218
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts +10 -4
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/api/verifications/index.js +12 -4
- package/dist/api/verifications/index.js.map +1 -1
- package/dist/batch/index.d.ts +20 -40
- package/dist/batch/index.d.ts.map +1 -1
- package/dist/batch/index.js +31 -44
- package/dist/batch/index.js.map +1 -1
- package/dist/bucket/index.d.ts +432 -8
- package/dist/bucket/index.d.ts.map +1 -1
- package/dist/bucket/index.js +1856 -12
- package/dist/bucket/index.js.map +1 -1
- package/dist/cache/core/index.d.ts +179 -7
- package/dist/cache/core/index.d.ts.map +1 -1
- package/dist/cache/core/index.js +213 -7
- package/dist/cache/core/index.js.map +1 -1
- package/dist/cache/redis/index.d.ts +1 -0
- package/dist/cache/redis/index.d.ts.map +1 -1
- package/dist/cache/redis/index.js +4 -0
- package/dist/cache/redis/index.js.map +1 -1
- package/dist/cli/index.d.ts +488 -5612
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2326 -311
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +194 -46
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +1995 -60
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +42 -19
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +34 -13
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +62 -19
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +42 -19
- package/dist/core/index.native.js.map +1 -1
- package/dist/datetime/index.d.ts +15 -0
- package/dist/datetime/index.d.ts.map +1 -1
- package/dist/datetime/index.js +15 -0
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/index.d.ts +315 -20
- package/dist/email/index.d.ts.map +1 -1
- package/dist/email/index.js +1852 -7
- package/dist/email/index.js.map +1 -1
- package/dist/fake/index.d.ts +90 -8
- package/dist/fake/index.d.ts.map +1 -1
- package/dist/fake/index.js +91 -20
- package/dist/fake/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +11 -4
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/core/index.js +11 -4
- package/dist/lock/core/index.js.map +1 -1
- package/dist/logger/index.d.ts +17 -66
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +14 -63
- package/dist/logger/index.js.map +1 -1
- package/dist/mcp/index.d.ts +15 -35
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +12 -35
- package/dist/mcp/index.js.map +1 -1
- package/dist/orm/index.browser.js +3 -3
- package/dist/orm/index.browser.js.map +1 -1
- package/dist/orm/index.bun.js +7 -4
- package/dist/orm/index.bun.js.map +1 -1
- package/dist/orm/index.d.ts +514 -540
- package/dist/orm/index.d.ts.map +1 -1
- package/dist/orm/index.js +24 -49
- package/dist/orm/index.js.map +1 -1
- package/dist/queue/core/index.d.ts +18 -10
- package/dist/queue/core/index.d.ts.map +1 -1
- package/dist/queue/core/index.js +14 -6
- package/dist/queue/core/index.js.map +1 -1
- package/dist/react/auth/index.browser.js +108 -0
- package/dist/react/auth/index.browser.js.map +1 -0
- package/dist/react/auth/index.d.ts +100 -0
- package/dist/react/auth/index.d.ts.map +1 -0
- package/dist/react/auth/index.js +145 -0
- package/dist/react/auth/index.js.map +1 -0
- package/dist/react/core/index.d.ts +469 -0
- package/dist/react/core/index.d.ts.map +1 -0
- package/dist/react/core/index.js +464 -0
- package/dist/react/core/index.js.map +1 -0
- package/dist/react/form/index.d.ts +232 -0
- package/dist/react/form/index.d.ts.map +1 -0
- package/dist/react/form/index.js +432 -0
- package/dist/react/form/index.js.map +1 -0
- package/dist/react/head/index.browser.js +423 -0
- package/dist/react/head/index.browser.js.map +1 -0
- package/dist/react/head/index.d.ts +288 -0
- package/dist/react/head/index.d.ts.map +1 -0
- package/dist/react/head/index.js +465 -0
- package/dist/react/head/index.js.map +1 -0
- package/dist/react/i18n/index.d.ts +175 -0
- package/dist/react/i18n/index.d.ts.map +1 -0
- package/dist/react/i18n/index.js +224 -0
- package/dist/react/i18n/index.js.map +1 -0
- package/dist/react/router/index.browser.js +1980 -0
- package/dist/react/router/index.browser.js.map +1 -0
- package/dist/react/router/index.d.ts +2068 -0
- package/dist/react/router/index.d.ts.map +1 -0
- package/dist/react/router/index.js +4932 -0
- package/dist/react/router/index.js.map +1 -0
- package/dist/react/websocket/index.d.ts +117 -0
- package/dist/react/websocket/index.d.ts.map +1 -0
- package/dist/react/websocket/index.js +107 -0
- package/dist/react/websocket/index.js.map +1 -0
- package/dist/redis/index.bun.js +4 -0
- package/dist/redis/index.bun.js.map +1 -1
- package/dist/redis/index.d.ts +22 -25
- package/dist/redis/index.d.ts.map +1 -1
- package/dist/redis/index.js +16 -25
- package/dist/redis/index.js.map +1 -1
- package/dist/retry/index.d.ts +11 -2
- package/dist/retry/index.d.ts.map +1 -1
- package/dist/retry/index.js +11 -2
- package/dist/retry/index.js.map +1 -1
- package/dist/scheduler/index.d.ts +11 -2
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +11 -2
- package/dist/scheduler/index.js.map +1 -1
- package/dist/security/index.d.ts +110 -19
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +157 -26
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +179 -174
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +12 -7
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cache/index.d.ts +7 -22
- package/dist/server/cache/index.d.ts.map +1 -1
- package/dist/server/cache/index.js +7 -22
- package/dist/server/cache/index.js.map +1 -1
- package/dist/server/compress/index.d.ts +10 -2
- package/dist/server/compress/index.d.ts.map +1 -1
- package/dist/server/compress/index.js +10 -2
- package/dist/server/compress/index.js.map +1 -1
- package/dist/server/cookies/index.d.ts +40 -16
- package/dist/server/cookies/index.d.ts.map +1 -1
- package/dist/server/cookies/index.js +7 -5
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.d.ts +115 -14
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +231 -14
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/cors/index.d.ts +13 -23
- package/dist/server/cors/index.d.ts.map +1 -1
- package/dist/server/cors/index.js +7 -21
- package/dist/server/cors/index.js.map +1 -1
- package/dist/server/health/index.d.ts +25 -19
- package/dist/server/health/index.d.ts.map +1 -1
- package/dist/server/health/index.js +8 -2
- package/dist/server/health/index.js.map +1 -1
- package/dist/server/helmet/index.d.ts +11 -3
- package/dist/server/helmet/index.d.ts.map +1 -1
- package/dist/server/helmet/index.js +11 -3
- package/dist/server/helmet/index.js.map +1 -1
- package/dist/server/links/index.d.ts +50 -45
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/links/index.js +11 -6
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.d.ts +10 -3
- package/dist/server/metrics/index.d.ts.map +1 -1
- package/dist/server/metrics/index.js +10 -3
- package/dist/server/metrics/index.js.map +1 -1
- package/dist/server/multipart/index.d.ts +9 -3
- package/dist/server/multipart/index.d.ts.map +1 -1
- package/dist/server/multipart/index.js +9 -3
- package/dist/server/multipart/index.js.map +1 -1
- package/dist/server/proxy/index.d.ts +8 -2
- package/dist/server/proxy/index.d.ts.map +1 -1
- package/dist/server/proxy/index.js +8 -2
- package/dist/server/proxy/index.js.map +1 -1
- package/dist/server/rate-limit/index.d.ts +30 -35
- package/dist/server/rate-limit/index.d.ts.map +1 -1
- package/dist/server/rate-limit/index.js +18 -55
- package/dist/server/rate-limit/index.js.map +1 -1
- package/dist/server/static/index.d.ts +137 -4
- package/dist/server/static/index.d.ts.map +1 -1
- package/dist/server/static/index.js +1848 -5
- package/dist/server/static/index.js.map +1 -1
- package/dist/server/swagger/index.d.ts +301 -6
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/server/swagger/index.js +1849 -6
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/sms/index.d.ts +301 -7
- package/dist/sms/index.d.ts.map +1 -1
- package/dist/sms/index.js +1851 -7
- package/dist/sms/index.js.map +1 -1
- package/dist/system/index.browser.js +496 -0
- package/dist/system/index.browser.js.map +1 -0
- package/dist/{file → system}/index.d.ts +335 -16
- package/dist/system/index.d.ts.map +1 -0
- package/dist/{file → system}/index.js +412 -20
- package/dist/system/index.js.map +1 -0
- package/dist/thread/index.d.ts +11 -2
- package/dist/thread/index.d.ts.map +1 -1
- package/dist/thread/index.js +11 -2
- package/dist/thread/index.js.map +1 -1
- package/dist/topic/core/index.d.ts +12 -5
- package/dist/topic/core/index.d.ts.map +1 -1
- package/dist/topic/core/index.js +12 -5
- package/dist/topic/core/index.js.map +1 -1
- package/dist/vite/index.d.ts +4 -6271
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +8 -3
- package/dist/vite/index.js.map +1 -1
- package/dist/websocket/index.d.ts +12 -8
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/index.js +12 -8
- package/dist/websocket/index.js.map +1 -1
- package/package.json +80 -11
- package/src/api/audits/index.ts +10 -33
- package/src/api/files/__tests__/$bucket.spec.ts +1 -1
- package/src/api/files/controllers/AdminFileStatsController.spec.ts +1 -1
- package/src/api/files/controllers/FileController.spec.ts +1 -1
- package/src/api/files/index.ts +10 -3
- package/src/api/files/jobs/FileJobs.spec.ts +1 -1
- package/src/api/files/services/FileService.spec.ts +1 -1
- package/src/api/jobs/index.ts +10 -3
- package/src/api/keys/controllers/AdminApiKeyController.ts +75 -0
- package/src/api/keys/controllers/ApiKeyController.ts +103 -0
- package/src/api/keys/entities/apiKeyEntity.ts +41 -0
- package/src/api/keys/index.ts +49 -0
- package/src/api/keys/schemas/adminApiKeyQuerySchema.ts +7 -0
- package/src/api/keys/schemas/adminApiKeyResourceSchema.ts +17 -0
- package/src/api/keys/schemas/createApiKeyBodySchema.ts +7 -0
- package/src/api/keys/schemas/createApiKeyResponseSchema.ts +11 -0
- package/src/api/keys/schemas/listApiKeyResponseSchema.ts +15 -0
- package/src/api/keys/schemas/revokeApiKeyParamsSchema.ts +5 -0
- package/src/api/keys/schemas/revokeApiKeyResponseSchema.ts +5 -0
- package/src/api/keys/services/ApiKeyService.spec.ts +553 -0
- package/src/api/keys/services/ApiKeyService.ts +306 -0
- package/src/api/logs/TODO.md +52 -0
- package/src/api/notifications/index.ts +10 -4
- package/src/api/parameters/index.ts +9 -30
- package/src/api/parameters/primitives/$config.ts +12 -4
- package/src/api/parameters/services/ConfigStore.ts +9 -3
- package/src/api/users/__tests__/ApiKeys-integration.spec.ts +1035 -0
- package/src/api/users/__tests__/ApiKeys.spec.ts +401 -0
- package/src/api/users/index.ts +14 -3
- package/src/api/users/primitives/$realm.ts +33 -5
- package/src/api/users/providers/RealmProvider.ts +1 -12
- package/src/api/users/services/SessionService.ts +1 -1
- package/src/api/verifications/controllers/VerificationController.ts +2 -0
- package/src/api/verifications/index.ts +10 -4
- package/src/batch/index.ts +9 -36
- package/src/batch/primitives/$batch.ts +0 -8
- package/src/batch/providers/BatchProvider.ts +29 -2
- package/src/bucket/__tests__/shared.ts +1 -1
- package/src/bucket/index.ts +13 -6
- package/src/bucket/primitives/$bucket.ts +1 -1
- package/src/bucket/providers/LocalFileStorageProvider.ts +1 -1
- package/src/bucket/providers/MemoryFileStorageProvider.ts +1 -1
- package/src/cache/core/__tests__/shared.ts +30 -0
- package/src/cache/core/index.ts +11 -6
- package/src/cache/core/primitives/$cache.spec.ts +5 -0
- package/src/cache/core/providers/CacheProvider.ts +17 -0
- package/src/cache/core/providers/MemoryCacheProvider.ts +300 -1
- package/src/cache/redis/__tests__/cache-redis.spec.ts +5 -0
- package/src/cache/redis/providers/RedisCacheProvider.ts +9 -0
- package/src/cli/apps/AlephaCli.ts +1 -14
- package/src/cli/apps/AlephaPackageBuilderCli.ts +1 -1
- package/src/cli/commands/build.ts +1 -5
- package/src/cli/commands/db.ts +17 -11
- package/src/cli/commands/deploy.ts +1 -1
- package/src/cli/commands/dev.ts +1 -20
- package/src/cli/commands/gen/env.ts +5 -2
- package/src/cli/commands/gen/openapi.ts +5 -2
- package/src/cli/commands/init.spec.ts +544 -0
- package/src/cli/commands/init.ts +89 -55
- package/src/cli/commands/lint.ts +7 -1
- package/src/cli/commands/typecheck.ts +11 -0
- package/src/cli/providers/AppEntryProvider.ts +1 -1
- package/src/cli/providers/ViteBuildProvider.ts +8 -50
- package/src/cli/providers/ViteDevServerProvider.ts +36 -8
- package/src/cli/services/AlephaCliUtils.ts +37 -122
- package/src/cli/services/PackageManagerUtils.ts +127 -11
- package/src/cli/services/ProjectScaffolder.ts +122 -77
- package/src/cli/services/ViteUtils.ts +82 -0
- package/src/cli/{assets/claudeMd.ts → templates/agentMd.ts} +32 -24
- package/src/cli/templates/gitignore.ts +39 -0
- package/src/cli/{assets → templates}/mainCss.ts +11 -2
- package/src/cli/templates/mainServerTs.ts +33 -0
- package/src/cli/templates/webAppRouterTs.ts +50 -0
- package/src/cli/{assets → templates}/webHelloComponentTsx.ts +2 -2
- package/src/command/helpers/Runner.spec.ts +4 -0
- package/src/command/helpers/Runner.ts +3 -21
- package/src/command/index.ts +12 -4
- package/src/command/providers/CliProvider.spec.ts +1067 -0
- package/src/command/providers/CliProvider.ts +203 -40
- package/src/core/Alepha.ts +2 -2
- package/src/core/__tests__/Alepha-start.spec.ts +4 -4
- package/src/core/helpers/jsonSchemaToTypeBox.spec.ts +771 -0
- package/src/core/helpers/jsonSchemaToTypeBox.ts +62 -10
- package/src/core/index.shared.ts +1 -0
- package/src/core/index.ts +20 -0
- package/src/core/providers/EventManager.spec.ts +0 -71
- package/src/core/providers/EventManager.ts +3 -15
- package/src/core/providers/Json.ts +2 -14
- package/src/datetime/index.ts +15 -0
- package/src/email/index.ts +10 -5
- package/src/email/providers/LocalEmailProvider.spec.ts +1 -1
- package/src/email/providers/LocalEmailProvider.ts +1 -1
- package/src/fake/__tests__/keyName.example.ts +1 -1
- package/src/fake/__tests__/keyName.spec.ts +5 -5
- package/src/fake/index.ts +9 -6
- package/src/fake/providers/FakeProvider.spec.ts +258 -40
- package/src/fake/providers/FakeProvider.ts +133 -19
- package/src/lock/core/index.ts +11 -4
- package/src/logger/index.ts +17 -66
- package/src/mcp/index.ts +10 -27
- package/src/mcp/transports/SseMcpTransport.ts +0 -11
- package/src/orm/__tests__/PostgresProvider.spec.ts +2 -2
- package/src/orm/index.browser.ts +2 -2
- package/src/orm/index.bun.ts +4 -2
- package/src/orm/index.ts +21 -47
- package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -0
- package/src/orm/services/Repository.ts +7 -3
- package/src/queue/core/index.ts +14 -6
- package/src/react/auth/__tests__/$auth.spec.ts +202 -0
- package/src/react/auth/hooks/useAuth.ts +32 -0
- package/src/react/auth/index.browser.ts +13 -0
- package/src/react/auth/index.shared.ts +2 -0
- package/src/react/auth/index.ts +48 -0
- package/src/react/auth/providers/ReactAuthProvider.ts +16 -0
- package/src/react/auth/services/ReactAuth.ts +135 -0
- package/src/react/core/__tests__/Router.spec.tsx +169 -0
- package/src/react/core/components/ClientOnly.tsx +49 -0
- package/src/react/core/components/ErrorBoundary.tsx +73 -0
- package/src/react/core/contexts/AlephaContext.ts +7 -0
- package/src/react/core/contexts/AlephaProvider.tsx +42 -0
- package/src/react/core/hooks/useAction.browser.spec.tsx +569 -0
- package/src/react/core/hooks/useAction.ts +480 -0
- package/src/react/core/hooks/useAlepha.ts +26 -0
- package/src/react/core/hooks/useClient.ts +17 -0
- package/src/react/core/hooks/useEvents.ts +51 -0
- package/src/react/core/hooks/useInject.ts +12 -0
- package/src/react/core/hooks/useStore.ts +52 -0
- package/src/react/core/index.ts +90 -0
- package/src/react/form/components/FormState.tsx +17 -0
- package/src/react/form/errors/FormValidationError.ts +18 -0
- package/src/react/form/hooks/useForm.browser.spec.tsx +366 -0
- package/src/react/form/hooks/useForm.ts +47 -0
- package/src/react/form/hooks/useFormState.ts +130 -0
- package/src/react/form/index.ts +44 -0
- package/src/react/form/services/FormModel.ts +614 -0
- package/src/react/head/helpers/SeoExpander.spec.ts +203 -0
- package/src/react/head/helpers/SeoExpander.ts +142 -0
- package/src/react/head/hooks/useHead.spec.tsx +288 -0
- package/src/react/head/hooks/useHead.ts +62 -0
- package/src/react/head/index.browser.ts +26 -0
- package/src/react/head/index.ts +44 -0
- package/src/react/head/interfaces/Head.ts +105 -0
- package/src/react/head/primitives/$head.ts +25 -0
- package/src/react/head/providers/BrowserHeadProvider.browser.spec.ts +196 -0
- package/src/react/head/providers/BrowserHeadProvider.ts +212 -0
- package/src/react/head/providers/HeadProvider.ts +168 -0
- package/src/react/head/providers/ServerHeadProvider.ts +31 -0
- package/src/react/i18n/__tests__/integration.spec.tsx +239 -0
- package/src/react/i18n/components/Localize.spec.tsx +357 -0
- package/src/react/i18n/components/Localize.tsx +35 -0
- package/src/react/i18n/hooks/useI18n.browser.spec.tsx +438 -0
- package/src/react/i18n/hooks/useI18n.ts +18 -0
- package/src/react/i18n/index.ts +41 -0
- package/src/react/i18n/primitives/$dictionary.ts +69 -0
- package/src/react/i18n/providers/I18nProvider.spec.ts +389 -0
- package/src/react/i18n/providers/I18nProvider.ts +278 -0
- package/src/react/router/__tests__/page-head-browser.browser.spec.ts +95 -0
- package/src/react/router/__tests__/page-head.spec.ts +48 -0
- package/src/react/router/__tests__/seo-head.spec.ts +125 -0
- package/src/react/router/atoms/ssrManifestAtom.ts +58 -0
- package/src/react/router/components/ErrorViewer.tsx +872 -0
- package/src/react/router/components/Link.tsx +23 -0
- package/src/react/router/components/NestedView.tsx +223 -0
- package/src/react/router/components/NotFound.tsx +30 -0
- package/src/react/router/constants/PAGE_PRELOAD_KEY.ts +6 -0
- package/src/react/router/contexts/RouterLayerContext.ts +12 -0
- package/src/react/router/errors/Redirection.ts +28 -0
- package/src/react/router/hooks/useActive.ts +52 -0
- package/src/react/router/hooks/useQueryParams.ts +63 -0
- package/src/react/router/hooks/useRouter.ts +20 -0
- package/src/react/router/hooks/useRouterState.ts +11 -0
- package/src/react/router/index.browser.ts +45 -0
- package/src/react/router/index.shared.ts +19 -0
- package/src/react/router/index.ts +142 -0
- package/src/react/router/primitives/$page.browser.spec.tsx +851 -0
- package/src/react/router/primitives/$page.spec.tsx +708 -0
- package/src/react/router/primitives/$page.ts +497 -0
- package/src/react/router/providers/ReactBrowserProvider.ts +309 -0
- package/src/react/router/providers/ReactBrowserRendererProvider.ts +25 -0
- package/src/react/router/providers/ReactBrowserRouterProvider.ts +168 -0
- package/src/react/router/providers/ReactPageProvider.ts +726 -0
- package/src/react/router/providers/ReactServerProvider.spec.tsx +316 -0
- package/src/react/router/providers/ReactServerProvider.ts +558 -0
- package/src/react/router/providers/ReactServerTemplateProvider.ts +979 -0
- package/src/react/router/providers/SSRManifestProvider.ts +334 -0
- package/src/react/router/services/ReactPageServerService.ts +48 -0
- package/src/react/router/services/ReactPageService.ts +27 -0
- package/src/react/router/services/ReactRouter.ts +262 -0
- package/src/react/websocket/hooks/useRoom.tsx +242 -0
- package/src/react/websocket/index.ts +7 -0
- package/src/redis/__tests__/redis.spec.ts +13 -0
- package/src/redis/index.ts +9 -25
- package/src/redis/providers/BunRedisProvider.ts +9 -0
- package/src/redis/providers/NodeRedisProvider.ts +8 -0
- package/src/redis/providers/RedisProvider.ts +16 -0
- package/src/retry/index.ts +11 -2
- package/src/router/index.ts +15 -0
- package/src/scheduler/index.ts +11 -2
- package/src/security/__tests__/BasicAuth.spec.ts +2 -0
- package/src/security/__tests__/ServerSecurityProvider.spec.ts +13 -5
- package/src/security/index.ts +15 -10
- package/src/security/interfaces/IssuerResolver.ts +27 -0
- package/src/security/primitives/$issuer.ts +55 -0
- package/src/security/providers/SecurityProvider.ts +179 -0
- package/src/security/providers/ServerBasicAuthProvider.ts +6 -2
- package/src/security/providers/ServerSecurityProvider.ts +36 -22
- package/src/server/auth/index.ts +12 -7
- package/src/server/cache/index.ts +7 -22
- package/src/server/compress/index.ts +10 -2
- package/src/server/cookies/index.ts +7 -5
- package/src/server/cookies/primitives/$cookie.ts +33 -11
- package/src/server/core/index.ts +16 -6
- package/src/server/core/interfaces/ServerRequest.ts +83 -1
- package/src/server/core/primitives/$action.spec.ts +1 -1
- package/src/server/core/primitives/$action.ts +8 -3
- package/src/server/core/providers/NodeHttpServerProvider.ts +9 -3
- package/src/server/core/services/ServerRequestParser.spec.ts +520 -0
- package/src/server/core/services/ServerRequestParser.ts +306 -13
- package/src/server/cors/index.ts +7 -21
- package/src/server/cors/primitives/$cors.ts +6 -2
- package/src/server/health/index.ts +8 -2
- package/src/server/helmet/index.ts +11 -3
- package/src/server/links/index.ts +11 -6
- package/src/server/metrics/index.ts +10 -3
- package/src/server/multipart/index.ts +9 -3
- package/src/server/proxy/index.ts +8 -2
- package/src/server/rate-limit/index.ts +21 -25
- package/src/server/rate-limit/primitives/$rateLimit.ts +6 -2
- package/src/server/rate-limit/providers/ServerRateLimitProvider.spec.ts +38 -14
- package/src/server/rate-limit/providers/ServerRateLimitProvider.ts +22 -56
- package/src/server/static/index.ts +8 -2
- package/src/server/static/providers/ServerStaticProvider.ts +1 -1
- package/src/server/swagger/index.ts +9 -4
- package/src/server/swagger/providers/ServerSwaggerProvider.ts +1 -1
- package/src/sms/index.ts +9 -5
- package/src/sms/providers/LocalSmsProvider.spec.ts +1 -1
- package/src/sms/providers/LocalSmsProvider.ts +1 -1
- package/src/system/index.browser.ts +11 -0
- package/src/system/index.ts +62 -0
- package/src/{file → system}/providers/FileSystemProvider.ts +16 -0
- package/src/{file → system}/providers/MemoryFileSystemProvider.ts +116 -3
- package/src/system/providers/MemoryShellProvider.ts +164 -0
- package/src/{file → system}/providers/NodeFileSystemProvider.spec.ts +2 -2
- package/src/{file → system}/providers/NodeFileSystemProvider.ts +36 -0
- package/src/system/providers/NodeShellProvider.ts +184 -0
- package/src/system/providers/ShellProvider.ts +74 -0
- package/src/{file → system}/services/FileDetector.spec.ts +2 -2
- package/src/thread/index.ts +11 -2
- package/src/topic/core/index.ts +12 -5
- package/src/vite/tasks/buildClient.ts +2 -7
- package/src/vite/tasks/buildServer.ts +17 -1
- package/src/websocket/index.ts +12 -8
- package/dist/file/index.d.ts.map +0 -1
- package/dist/file/index.js.map +0 -1
- package/src/cli/assets/mainServerTs.ts +0 -24
- package/src/cli/assets/webAppRouterTs.ts +0 -16
- package/src/cli/providers/ViteTemplateProvider.ts +0 -27
- package/src/file/index.ts +0 -43
- /package/src/cli/{assets → templates}/apiHelloControllerTs.ts +0 -0
- /package/src/cli/{assets → templates}/apiIndexTs.ts +0 -0
- /package/src/cli/{assets → templates}/biomeJson.ts +0 -0
- /package/src/cli/{assets → templates}/dummySpecTs.ts +0 -0
- /package/src/cli/{assets → templates}/editorconfig.ts +0 -0
- /package/src/cli/{assets → templates}/mainBrowserTs.ts +0 -0
- /package/src/cli/{assets → templates}/tsconfigJson.ts +0 -0
- /package/src/cli/{assets → templates}/webIndexTs.ts +0 -0
- /package/src/{file → system}/errors/FileError.ts +0 -0
- /package/src/{file → system}/services/FileDetector.ts +0 -0
|
@@ -0,0 +1,2068 @@
|
|
|
1
|
+
import * as alepha16 from "alepha";
|
|
2
|
+
import { Alepha, AlephaError, Async, FileLike, Json, KIND, Primitive, Static, StreamLike, TObject, TSchema } from "alepha";
|
|
3
|
+
import { DateTimeProvider } from "alepha/datetime";
|
|
4
|
+
import { ClientOnlyProps } from "alepha/react";
|
|
5
|
+
import { ServerHandler, ServerRequest, ServerRouterProvider } from "alepha/server";
|
|
6
|
+
import { ServerRouteCache } from "alepha/server/cache";
|
|
7
|
+
import { LinkProvider } from "alepha/server/links";
|
|
8
|
+
import * as alepha_logger2 from "alepha/logger";
|
|
9
|
+
import * as react0 from "react";
|
|
10
|
+
import { AnchorHTMLAttributes, CSSProperties, FC, ReactNode } from "react";
|
|
11
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
12
|
+
import { BrowserHeadProvider, Head, ServerHeadProvider, SimpleHead } from "alepha/react/head";
|
|
13
|
+
import { ServerStaticProvider } from "alepha/server/static";
|
|
14
|
+
import { Readable } from "node:stream";
|
|
15
|
+
import { Route, RouterProvider } from "alepha/router";
|
|
16
|
+
|
|
17
|
+
//#region ../../src/react/router/constants/PAGE_PRELOAD_KEY.d.ts
|
|
18
|
+
/**
|
|
19
|
+
* Symbol key for SSR module preloading path.
|
|
20
|
+
* Using Symbol.for() allows the Vite plugin to inject this at build time.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
declare const PAGE_PRELOAD_KEY: unique symbol;
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region ../../src/react/router/errors/Redirection.d.ts
|
|
26
|
+
/**
|
|
27
|
+
* Used for Redirection during the page loading.
|
|
28
|
+
*
|
|
29
|
+
* Depends on the context, it can be thrown or just returned.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* import { Redirection } from "alepha/react";
|
|
34
|
+
*
|
|
35
|
+
* const MyPage = $page({
|
|
36
|
+
* loader: async () => {
|
|
37
|
+
* if (needRedirect) {
|
|
38
|
+
* throw new Redirection("/new-path");
|
|
39
|
+
* }
|
|
40
|
+
* },
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
declare class Redirection extends AlephaError {
|
|
45
|
+
readonly redirect: string;
|
|
46
|
+
constructor(redirect: string);
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region ../../src/react/router/providers/ReactPageProvider.d.ts
|
|
50
|
+
declare const envSchema$1: alepha16.TObject<{
|
|
51
|
+
REACT_STRICT_MODE: alepha16.TBoolean;
|
|
52
|
+
}>;
|
|
53
|
+
declare module "alepha" {
|
|
54
|
+
interface Env extends Partial<Static<typeof envSchema$1>> {}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Handle page routes for React applications. (Browser and Server)
|
|
58
|
+
*/
|
|
59
|
+
declare class ReactPageProvider {
|
|
60
|
+
protected readonly log: alepha_logger2.Logger;
|
|
61
|
+
protected readonly env: {
|
|
62
|
+
REACT_STRICT_MODE: boolean;
|
|
63
|
+
};
|
|
64
|
+
protected readonly alepha: Alepha;
|
|
65
|
+
protected readonly pages: PageRoute[];
|
|
66
|
+
getPages(): PageRoute[];
|
|
67
|
+
getConcretePages(): ConcretePageRoute[];
|
|
68
|
+
page(name: string): PageRoute;
|
|
69
|
+
pathname(name: string, options?: {
|
|
70
|
+
params?: Record<string, string>;
|
|
71
|
+
query?: Record<string, string>;
|
|
72
|
+
}): string;
|
|
73
|
+
url(name: string, options?: {
|
|
74
|
+
params?: Record<string, string>;
|
|
75
|
+
host?: string;
|
|
76
|
+
}): URL;
|
|
77
|
+
root(state: ReactRouterState): ReactNode;
|
|
78
|
+
protected convertStringObjectToObject: (schema?: TSchema, value?: any) => any;
|
|
79
|
+
/**
|
|
80
|
+
* Create a new RouterState based on a given route and request.
|
|
81
|
+
* This method resolves the layers for the route, applying any query and params schemas defined in the route.
|
|
82
|
+
* It also handles errors and redirects.
|
|
83
|
+
*/
|
|
84
|
+
createLayers(route: PageRoute, state: ReactRouterState, previous?: PreviousLayerData[]): Promise<CreateLayersResult>;
|
|
85
|
+
protected getErrorHandler(route: PageRoute): ErrorHandler | undefined;
|
|
86
|
+
protected createElement(page: PageRoute, props: Record<string, any>): Promise<ReactNode>;
|
|
87
|
+
renderError(error: Error): ReactNode;
|
|
88
|
+
renderEmptyView(): ReactNode;
|
|
89
|
+
href(page: {
|
|
90
|
+
options: {
|
|
91
|
+
name?: string;
|
|
92
|
+
};
|
|
93
|
+
}, params?: Record<string, any>): string;
|
|
94
|
+
compile(path: string, params?: Record<string, string>): string;
|
|
95
|
+
protected renderView(index: number, path: string, view: ReactNode | undefined, page: PageRoute): ReactNode;
|
|
96
|
+
protected readonly configure: alepha16.HookPrimitive<"configure">;
|
|
97
|
+
protected map(pages: Array<PagePrimitive>, target: PagePrimitive): PageRouteEntry;
|
|
98
|
+
add(entry: PageRouteEntry): void;
|
|
99
|
+
protected createMatch(page: PageRoute): string;
|
|
100
|
+
protected _next: number;
|
|
101
|
+
protected nextId(): string;
|
|
102
|
+
}
|
|
103
|
+
declare const isPageRoute: (it: any) => it is PageRoute;
|
|
104
|
+
interface PageRouteEntry extends Omit<PagePrimitiveOptions, "children" | "parent"> {
|
|
105
|
+
children?: PageRouteEntry[];
|
|
106
|
+
}
|
|
107
|
+
interface ConcretePageRoute extends PageRoute {
|
|
108
|
+
/**
|
|
109
|
+
* When exported, static routes can be split into multiple pages with different params.
|
|
110
|
+
* We replace 'name' by the new name for each static entry, and old 'name' becomes 'staticName'.
|
|
111
|
+
*/
|
|
112
|
+
staticName?: string;
|
|
113
|
+
params?: Record<string, string>;
|
|
114
|
+
}
|
|
115
|
+
interface PageRoute extends PageRouteEntry {
|
|
116
|
+
type: "page";
|
|
117
|
+
name: string;
|
|
118
|
+
parent?: PageRoute;
|
|
119
|
+
match: string;
|
|
120
|
+
}
|
|
121
|
+
interface Layer {
|
|
122
|
+
config?: {
|
|
123
|
+
query?: Record<string, any>;
|
|
124
|
+
params?: Record<string, any>;
|
|
125
|
+
context?: Record<string, any>;
|
|
126
|
+
};
|
|
127
|
+
name: string;
|
|
128
|
+
props?: Record<string, any>;
|
|
129
|
+
error?: Error;
|
|
130
|
+
part?: string;
|
|
131
|
+
element: ReactNode;
|
|
132
|
+
index: number;
|
|
133
|
+
path: string;
|
|
134
|
+
route?: PageRoute;
|
|
135
|
+
cache?: boolean;
|
|
136
|
+
}
|
|
137
|
+
type PreviousLayerData = Omit<Layer, "element" | "index" | "path">;
|
|
138
|
+
interface AnchorProps {
|
|
139
|
+
href: string;
|
|
140
|
+
onClick: (ev?: any) => any;
|
|
141
|
+
}
|
|
142
|
+
interface ReactRouterState {
|
|
143
|
+
/**
|
|
144
|
+
* Stack of layers for the current page.
|
|
145
|
+
*/
|
|
146
|
+
layers: Array<Layer>;
|
|
147
|
+
/**
|
|
148
|
+
* URL of the current page.
|
|
149
|
+
*/
|
|
150
|
+
url: URL;
|
|
151
|
+
/**
|
|
152
|
+
* Error handler for the current page.
|
|
153
|
+
*/
|
|
154
|
+
onError: ErrorHandler;
|
|
155
|
+
/**
|
|
156
|
+
* Params extracted from the URL for the current page.
|
|
157
|
+
*/
|
|
158
|
+
params: Record<string, any>;
|
|
159
|
+
/**
|
|
160
|
+
* Query parameters extracted from the URL for the current page.
|
|
161
|
+
*/
|
|
162
|
+
query: Record<string, string>;
|
|
163
|
+
/**
|
|
164
|
+
* Optional meta information associated with the current page.
|
|
165
|
+
*/
|
|
166
|
+
meta: Record<string, any>;
|
|
167
|
+
/**
|
|
168
|
+
* Head configuration for the current page (title, meta tags, etc.).
|
|
169
|
+
* Populated by HeadProvider during SSR.
|
|
170
|
+
*/
|
|
171
|
+
head: Head;
|
|
172
|
+
name?: string;
|
|
173
|
+
}
|
|
174
|
+
interface RouterStackItem {
|
|
175
|
+
route: PageRoute;
|
|
176
|
+
config?: Record<string, any>;
|
|
177
|
+
props?: Record<string, any>;
|
|
178
|
+
error?: Error;
|
|
179
|
+
cache?: boolean;
|
|
180
|
+
}
|
|
181
|
+
interface TransitionOptions {
|
|
182
|
+
previous?: PreviousLayerData[];
|
|
183
|
+
}
|
|
184
|
+
interface CreateLayersResult {
|
|
185
|
+
redirect?: string;
|
|
186
|
+
state?: ReactRouterState;
|
|
187
|
+
}
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region ../../src/react/router/services/ReactPageService.d.ts
|
|
190
|
+
/**
|
|
191
|
+
* $page methods interface.
|
|
192
|
+
*/
|
|
193
|
+
declare abstract class ReactPageService {
|
|
194
|
+
fetch(pathname: string, options?: PagePrimitiveRenderOptions): Promise<{
|
|
195
|
+
html: string;
|
|
196
|
+
response: Response;
|
|
197
|
+
}>;
|
|
198
|
+
render(name: string, options?: PagePrimitiveRenderOptions): Promise<PagePrimitiveRenderResult>;
|
|
199
|
+
}
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region ../../src/react/router/primitives/$page.d.ts
|
|
202
|
+
/**
|
|
203
|
+
* Main primitive for defining a React route in the application.
|
|
204
|
+
*
|
|
205
|
+
* The $page primitive is the core building block for creating type-safe, SSR-enabled React routes.
|
|
206
|
+
* It provides a declarative way to define pages with powerful features:
|
|
207
|
+
*
|
|
208
|
+
* **Routing & Navigation**
|
|
209
|
+
* - URL pattern matching with parameters (e.g., `/users/:id`)
|
|
210
|
+
* - Nested routing with parent-child relationships
|
|
211
|
+
* - Type-safe URL parameter and query string validation
|
|
212
|
+
*
|
|
213
|
+
* **Data Loading**
|
|
214
|
+
* - Server-side data fetching with the `loader` function
|
|
215
|
+
* - Automatic serialization and hydration for SSR
|
|
216
|
+
* - Access to request context, URL params, and parent data
|
|
217
|
+
*
|
|
218
|
+
* **Component Loading**
|
|
219
|
+
* - Direct component rendering or lazy loading for code splitting
|
|
220
|
+
* - Client-only rendering when browser APIs are needed
|
|
221
|
+
* - Automatic fallback handling during hydration
|
|
222
|
+
*
|
|
223
|
+
* **Performance Optimization**
|
|
224
|
+
* - Static generation for pre-rendered pages at build time
|
|
225
|
+
* - Server-side caching with configurable TTL and providers
|
|
226
|
+
* - Code splitting through lazy component loading
|
|
227
|
+
*
|
|
228
|
+
* **Error Handling**
|
|
229
|
+
* - Custom error handlers with support for redirects
|
|
230
|
+
* - Hierarchical error handling (child → parent)
|
|
231
|
+
* - HTTP status code handling (404, 401, etc.)
|
|
232
|
+
*
|
|
233
|
+
* **Page Animations**
|
|
234
|
+
* - CSS-based enter/exit animations
|
|
235
|
+
* - Dynamic animations based on page state
|
|
236
|
+
* - Custom timing and easing functions
|
|
237
|
+
*
|
|
238
|
+
* **Lifecycle Management**
|
|
239
|
+
* - Server response hooks for headers and status codes
|
|
240
|
+
* - Page leave handlers for cleanup (browser only)
|
|
241
|
+
* - Permission-based access control
|
|
242
|
+
*
|
|
243
|
+
* @example Simple page with data fetching
|
|
244
|
+
* ```typescript
|
|
245
|
+
* const userProfile = $page({
|
|
246
|
+
* path: "/users/:id",
|
|
247
|
+
* schema: {
|
|
248
|
+
* params: t.object({ id: t.integer() }),
|
|
249
|
+
* query: t.object({ tab: t.optional(t.text()) })
|
|
250
|
+
* },
|
|
251
|
+
* loader: async ({ params }) => {
|
|
252
|
+
* const user = await userApi.getUser(params.id);
|
|
253
|
+
* return { user };
|
|
254
|
+
* },
|
|
255
|
+
* lazy: () => import("./UserProfile.tsx")
|
|
256
|
+
* });
|
|
257
|
+
* ```
|
|
258
|
+
*
|
|
259
|
+
* @example Nested routing with error handling
|
|
260
|
+
* ```typescript
|
|
261
|
+
* const projectSection = $page({
|
|
262
|
+
* path: "/projects/:id",
|
|
263
|
+
* children: () => [projectBoard, projectSettings],
|
|
264
|
+
* loader: async ({ params }) => {
|
|
265
|
+
* const project = await projectApi.get(params.id);
|
|
266
|
+
* return { project };
|
|
267
|
+
* },
|
|
268
|
+
* errorHandler: (error) => {
|
|
269
|
+
* if (HttpError.is(error, 404)) {
|
|
270
|
+
* return <ProjectNotFound />;
|
|
271
|
+
* }
|
|
272
|
+
* }
|
|
273
|
+
* });
|
|
274
|
+
* ```
|
|
275
|
+
*
|
|
276
|
+
* @example Static generation with caching
|
|
277
|
+
* ```typescript
|
|
278
|
+
* const blogPost = $page({
|
|
279
|
+
* path: "/blog/:slug",
|
|
280
|
+
* static: {
|
|
281
|
+
* entries: posts.map(p => ({ params: { slug: p.slug } }))
|
|
282
|
+
* },
|
|
283
|
+
* loader: async ({ params }) => {
|
|
284
|
+
* const post = await loadPost(params.slug);
|
|
285
|
+
* return { post };
|
|
286
|
+
* }
|
|
287
|
+
* });
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
declare const $page: {
|
|
291
|
+
<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = any, TPropsParent extends object = TPropsParentDefault>(options: PagePrimitiveOptions<TConfig, TProps, TPropsParent>): PagePrimitive<TConfig, TProps, TPropsParent>;
|
|
292
|
+
[KIND]: typeof PagePrimitive;
|
|
293
|
+
};
|
|
294
|
+
interface PagePrimitiveOptions<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = TPropsDefault, TPropsParent extends object = TPropsParentDefault> {
|
|
295
|
+
/**
|
|
296
|
+
* Identifier name for the page. Must be unique.
|
|
297
|
+
*
|
|
298
|
+
* @default Primitive key
|
|
299
|
+
*/
|
|
300
|
+
name?: string;
|
|
301
|
+
/**
|
|
302
|
+
* Add a pathname to the page.
|
|
303
|
+
*
|
|
304
|
+
* Pathname can contain parameters, like `/post/:slug`.
|
|
305
|
+
*
|
|
306
|
+
* @default ""
|
|
307
|
+
*/
|
|
308
|
+
path?: string;
|
|
309
|
+
/**
|
|
310
|
+
* Add an input schema to define:
|
|
311
|
+
* - `params`: parameters from the pathname.
|
|
312
|
+
* - `query`: query parameters from the URL.
|
|
313
|
+
*/
|
|
314
|
+
schema?: TConfig;
|
|
315
|
+
/**
|
|
316
|
+
* Load data before rendering the page.
|
|
317
|
+
*
|
|
318
|
+
* This function receives
|
|
319
|
+
* - the request context (params, query, etc.)
|
|
320
|
+
* - the parent props (if page has a parent)
|
|
321
|
+
*
|
|
322
|
+
* > In SSR, the returned data will be serialized and sent to the client, then reused during the client-side hydration.
|
|
323
|
+
*
|
|
324
|
+
* Loader can be stopped by throwing an error, which will be handled by the `errorHandler` function.
|
|
325
|
+
* It's common to throw a `NotFoundError` to display a 404 page.
|
|
326
|
+
*
|
|
327
|
+
* RedirectError can be thrown to redirect the user to another page.
|
|
328
|
+
*/
|
|
329
|
+
loader?: (context: PageLoader<TConfig, TPropsParent>) => Async<TProps>;
|
|
330
|
+
/**
|
|
331
|
+
* Default props to pass to the component when rendering the page.
|
|
332
|
+
*
|
|
333
|
+
* Resolved props from the `resolve` function will override these default props.
|
|
334
|
+
*/
|
|
335
|
+
props?: () => Partial<TProps>;
|
|
336
|
+
/**
|
|
337
|
+
* The component to render when the page is loaded.
|
|
338
|
+
*
|
|
339
|
+
* If `lazy` is defined, this will be ignored.
|
|
340
|
+
* Prefer using `lazy` to improve the initial loading time.
|
|
341
|
+
*/
|
|
342
|
+
component?: FC<TProps & TPropsParent>;
|
|
343
|
+
/**
|
|
344
|
+
* Lazy load the component when the page is loaded.
|
|
345
|
+
*
|
|
346
|
+
* It's recommended to use this for components to improve the initial loading time
|
|
347
|
+
* and enable code-splitting.
|
|
348
|
+
*/
|
|
349
|
+
lazy?: () => Promise<{
|
|
350
|
+
default: FC<TProps & TPropsParent>;
|
|
351
|
+
}>;
|
|
352
|
+
/**
|
|
353
|
+
* Attach child pages to create nested routes.
|
|
354
|
+
* This will make the page a parent route.
|
|
355
|
+
*/
|
|
356
|
+
children?: Array<PagePrimitive> | (() => Array<PagePrimitive>);
|
|
357
|
+
/**
|
|
358
|
+
* Define a parent page for nested routing.
|
|
359
|
+
*/
|
|
360
|
+
parent?: PagePrimitive<PageConfigSchema, TPropsParent, any>;
|
|
361
|
+
/**
|
|
362
|
+
* Function to determine if the page can be accessed.
|
|
363
|
+
*
|
|
364
|
+
* If it returns false, the page will not be accessible and a 403 Forbidden error will be returned.
|
|
365
|
+
* This function can be used to implement permission-based access control.
|
|
366
|
+
*/
|
|
367
|
+
can?: () => boolean;
|
|
368
|
+
/**
|
|
369
|
+
* Catch any error from the `loader` function or during `rendering`.
|
|
370
|
+
*
|
|
371
|
+
* Expected to return one of the following:
|
|
372
|
+
* - a ReactNode to render an error page
|
|
373
|
+
* - a Redirection to redirect the user
|
|
374
|
+
* - undefined to let the error propagate
|
|
375
|
+
*
|
|
376
|
+
* If not defined, the error will be thrown and handled by the server or client error handler.
|
|
377
|
+
* If a leaf $page does not define an error handler, the error can be caught by parent pages.
|
|
378
|
+
*
|
|
379
|
+
* @example Catch a 404 from API and render a custom not found component:
|
|
380
|
+
* ```ts
|
|
381
|
+
* loader: async ({ params, query }) => {
|
|
382
|
+
* api.fetch("/api/resource", { params, query });
|
|
383
|
+
* },
|
|
384
|
+
* errorHandler: (error, context) => {
|
|
385
|
+
* if (HttpError.is(error, 404)) {
|
|
386
|
+
* return <ResourceNotFound />;
|
|
387
|
+
* }
|
|
388
|
+
* }
|
|
389
|
+
* ```
|
|
390
|
+
*
|
|
391
|
+
* @example Catch an 401 error and redirect the user to the login page:
|
|
392
|
+
* ```ts
|
|
393
|
+
* loader: async ({ params, query }) => {
|
|
394
|
+
* // but the user is not authenticated
|
|
395
|
+
* api.fetch("/api/resource", { params, query });
|
|
396
|
+
* },
|
|
397
|
+
* errorHandler: (error, context) => {
|
|
398
|
+
* if (HttpError.is(error, 401)) {
|
|
399
|
+
* // throwing a Redirection is also valid!
|
|
400
|
+
* return new Redirection("/login");
|
|
401
|
+
* }
|
|
402
|
+
* }
|
|
403
|
+
* ```
|
|
404
|
+
*/
|
|
405
|
+
errorHandler?: ErrorHandler;
|
|
406
|
+
/**
|
|
407
|
+
* If true, the page will be considered as a static page, immutable and cacheable.
|
|
408
|
+
* Replace boolean by an object to define static entries. (e.g. list of params/query)
|
|
409
|
+
*
|
|
410
|
+
* Browser-side: it only works with `alepha/vite`, which can pre-render the page at build time.
|
|
411
|
+
*
|
|
412
|
+
* Server-side: It will act as timeless cached page. You can use `cache` to configure the cache behavior.
|
|
413
|
+
*/
|
|
414
|
+
static?: boolean | {
|
|
415
|
+
entries?: Array<Partial<PageRequestConfig<TConfig>>>;
|
|
416
|
+
};
|
|
417
|
+
cache?: ServerRouteCache;
|
|
418
|
+
/**
|
|
419
|
+
* If true, force the page to be rendered only on the client-side (browser).
|
|
420
|
+
* It uses the `<ClientOnly/>` component to render the page.
|
|
421
|
+
*/
|
|
422
|
+
client?: boolean | ClientOnlyProps;
|
|
423
|
+
/**
|
|
424
|
+
* Called before the server response is sent to the client. (server only)
|
|
425
|
+
*/
|
|
426
|
+
onServerResponse?: (request: ServerRequest) => unknown;
|
|
427
|
+
/**
|
|
428
|
+
* Called when user enters the page. (browser only)
|
|
429
|
+
*
|
|
430
|
+
* Useful for browser-only side effects like analytics, scroll management,
|
|
431
|
+
* or focus handling that don't need to return data to the component.
|
|
432
|
+
*
|
|
433
|
+
* @example
|
|
434
|
+
* ```ts
|
|
435
|
+
* onEnter: () => {
|
|
436
|
+
* analytics.trackPageView("/dashboard");
|
|
437
|
+
* window.scrollTo(0, 0);
|
|
438
|
+
* }
|
|
439
|
+
* ```
|
|
440
|
+
*/
|
|
441
|
+
onEnter?: () => void;
|
|
442
|
+
/**
|
|
443
|
+
* Called when user leaves the page. (browser only)
|
|
444
|
+
*/
|
|
445
|
+
onLeave?: () => void;
|
|
446
|
+
/**
|
|
447
|
+
* @experimental
|
|
448
|
+
*
|
|
449
|
+
* Add a css animation when the page is loaded or unloaded.
|
|
450
|
+
* It uses CSS animations, so you need to define the keyframes in your CSS.
|
|
451
|
+
*
|
|
452
|
+
* @example Simple animation name
|
|
453
|
+
* ```ts
|
|
454
|
+
* animation: "fadeIn"
|
|
455
|
+
* ```
|
|
456
|
+
*
|
|
457
|
+
* CSS example:
|
|
458
|
+
* ```css
|
|
459
|
+
* @keyframes fadeIn {
|
|
460
|
+
* from { opacity: 0; }
|
|
461
|
+
* to { opacity: 1; }
|
|
462
|
+
* }
|
|
463
|
+
* ```
|
|
464
|
+
*
|
|
465
|
+
* @example Detailed animation
|
|
466
|
+
* ```ts
|
|
467
|
+
* animation: {
|
|
468
|
+
* enter: { name: "fadeIn", duration: 300 },
|
|
469
|
+
* exit: { name: "fadeOut", duration: 200, timing: "ease-in-out" },
|
|
470
|
+
* }
|
|
471
|
+
* ```
|
|
472
|
+
*
|
|
473
|
+
* @example Only exit animation
|
|
474
|
+
* ```ts
|
|
475
|
+
* animation: {
|
|
476
|
+
* exit: "fadeOut"
|
|
477
|
+
* }
|
|
478
|
+
* ```
|
|
479
|
+
*
|
|
480
|
+
* @example With custom timing function
|
|
481
|
+
* ```ts
|
|
482
|
+
* animation: {
|
|
483
|
+
* enter: { name: "fadeIn", duration: 300, timing: "cubic-bezier(0.4, 0, 0.2, 1)" },
|
|
484
|
+
* exit: { name: "fadeOut", duration: 200, timing: "ease-in-out" },
|
|
485
|
+
* }
|
|
486
|
+
* ```
|
|
487
|
+
*/
|
|
488
|
+
animation?: PageAnimation;
|
|
489
|
+
/**
|
|
490
|
+
* Head configuration for the page (title, meta tags, etc.).
|
|
491
|
+
*
|
|
492
|
+
* Can be a static object or a function that receives resolved props.
|
|
493
|
+
*
|
|
494
|
+
* @example Static head
|
|
495
|
+
* ```ts
|
|
496
|
+
* head: {
|
|
497
|
+
* title: "My Page",
|
|
498
|
+
* description: "Page description",
|
|
499
|
+
* }
|
|
500
|
+
* ```
|
|
501
|
+
*
|
|
502
|
+
* @example Dynamic head based on props
|
|
503
|
+
* ```ts
|
|
504
|
+
* head: (props) => ({
|
|
505
|
+
* title: props.user.name,
|
|
506
|
+
* description: `Profile of ${props.user.name}`,
|
|
507
|
+
* })
|
|
508
|
+
* ```
|
|
509
|
+
*/
|
|
510
|
+
head?: Head | ((props: TProps, previous?: Head) => Head);
|
|
511
|
+
/**
|
|
512
|
+
* Source path for SSR module preloading.
|
|
513
|
+
*
|
|
514
|
+
* This is automatically injected by the viteAlephaPreload plugin.
|
|
515
|
+
* It maps to the source file path used in Vite's SSR manifest.
|
|
516
|
+
*
|
|
517
|
+
* @internal
|
|
518
|
+
*/
|
|
519
|
+
[PAGE_PRELOAD_KEY]?: string;
|
|
520
|
+
}
|
|
521
|
+
type ErrorHandler = (error: Error, state: ReactRouterState) => ReactNode | Redirection | undefined;
|
|
522
|
+
declare class PagePrimitive<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = TPropsDefault, TPropsParent extends object = TPropsParentDefault> extends Primitive<PagePrimitiveOptions<TConfig, TProps, TPropsParent>> {
|
|
523
|
+
protected readonly reactPageService: ReactPageService;
|
|
524
|
+
protected onInit(): void;
|
|
525
|
+
get name(): string;
|
|
526
|
+
/**
|
|
527
|
+
* For testing or build purposes.
|
|
528
|
+
*
|
|
529
|
+
* This will render the page (HTML layout included or not) and return the HTML + context.
|
|
530
|
+
* Only valid for server-side rendering, it will throw an error if called on the client-side.
|
|
531
|
+
*/
|
|
532
|
+
render(options?: PagePrimitiveRenderOptions): Promise<PagePrimitiveRenderResult>;
|
|
533
|
+
fetch(options?: PagePrimitiveRenderOptions): Promise<{
|
|
534
|
+
html: string;
|
|
535
|
+
response: Response;
|
|
536
|
+
}>;
|
|
537
|
+
match(url: string): boolean;
|
|
538
|
+
pathname(config: any): string;
|
|
539
|
+
}
|
|
540
|
+
interface PageConfigSchema {
|
|
541
|
+
query?: TSchema;
|
|
542
|
+
params?: TSchema;
|
|
543
|
+
}
|
|
544
|
+
type TPropsDefault = any;
|
|
545
|
+
type TPropsParentDefault = {};
|
|
546
|
+
interface PagePrimitiveRenderOptions {
|
|
547
|
+
params?: Record<string, string>;
|
|
548
|
+
query?: Record<string, string>;
|
|
549
|
+
/**
|
|
550
|
+
* If true, the HTML layout will be included in the response.
|
|
551
|
+
* If false, only the page content will be returned.
|
|
552
|
+
*
|
|
553
|
+
* @default true
|
|
554
|
+
*/
|
|
555
|
+
html?: boolean;
|
|
556
|
+
hydration?: boolean;
|
|
557
|
+
}
|
|
558
|
+
interface PagePrimitiveRenderResult {
|
|
559
|
+
html: string;
|
|
560
|
+
state: ReactRouterState;
|
|
561
|
+
redirect?: string;
|
|
562
|
+
}
|
|
563
|
+
interface PageRequestConfig<TConfig extends PageConfigSchema = PageConfigSchema> {
|
|
564
|
+
params: TConfig["params"] extends TSchema ? Static<TConfig["params"]> : Record<string, string>;
|
|
565
|
+
query: TConfig["query"] extends TSchema ? Static<TConfig["query"]> : Record<string, string>;
|
|
566
|
+
}
|
|
567
|
+
type PageLoader<TConfig extends PageConfigSchema = PageConfigSchema, TPropsParent extends object = TPropsParentDefault> = PageRequestConfig<TConfig> & TPropsParent & Omit<ReactRouterState, "layers" | "onError">;
|
|
568
|
+
type PageAnimation = PageAnimationObject | ((state: ReactRouterState) => PageAnimationObject | undefined);
|
|
569
|
+
type PageAnimationObject = CssAnimationName | {
|
|
570
|
+
enter?: CssAnimation | CssAnimationName;
|
|
571
|
+
exit?: CssAnimation | CssAnimationName;
|
|
572
|
+
};
|
|
573
|
+
type CssAnimationName = string;
|
|
574
|
+
type CssAnimation = {
|
|
575
|
+
name: string;
|
|
576
|
+
duration?: number;
|
|
577
|
+
timing?: string;
|
|
578
|
+
};
|
|
579
|
+
//#endregion
|
|
580
|
+
//#region ../../src/react/router/services/ReactRouter.d.ts
|
|
581
|
+
interface RouterGoOptions {
|
|
582
|
+
replace?: boolean;
|
|
583
|
+
params?: Record<string, string>;
|
|
584
|
+
query?: Record<string, string>;
|
|
585
|
+
meta?: Record<string, any>;
|
|
586
|
+
/**
|
|
587
|
+
* Recreate the whole page, ignoring the current state.
|
|
588
|
+
*/
|
|
589
|
+
force?: boolean;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Friendly browser router API.
|
|
593
|
+
*
|
|
594
|
+
* Can be safely used server-side, but most methods will be no-op.
|
|
595
|
+
*/
|
|
596
|
+
declare class ReactRouter<T extends object> {
|
|
597
|
+
protected readonly alepha: Alepha;
|
|
598
|
+
protected readonly pageApi: ReactPageProvider;
|
|
599
|
+
get state(): ReactRouterState;
|
|
600
|
+
get pages(): PageRoute[];
|
|
601
|
+
get concretePages(): ConcretePageRoute[];
|
|
602
|
+
get browser(): ReactBrowserProvider | undefined;
|
|
603
|
+
isActive(href: string, options?: {
|
|
604
|
+
startWith?: boolean;
|
|
605
|
+
}): boolean;
|
|
606
|
+
node(name: keyof VirtualRouter<T> | string, config?: {
|
|
607
|
+
params?: Record<string, any>;
|
|
608
|
+
query?: Record<string, any>;
|
|
609
|
+
}): any;
|
|
610
|
+
path(name: keyof VirtualRouter<T> | string, config?: {
|
|
611
|
+
params?: Record<string, any>;
|
|
612
|
+
query?: Record<string, any>;
|
|
613
|
+
}): string;
|
|
614
|
+
/**
|
|
615
|
+
* Reload the current page.
|
|
616
|
+
* This is equivalent to calling `go()` with the current pathname and search.
|
|
617
|
+
*/
|
|
618
|
+
reload(): Promise<void>;
|
|
619
|
+
getURL(): URL;
|
|
620
|
+
get location(): Location;
|
|
621
|
+
get current(): ReactRouterState;
|
|
622
|
+
get pathname(): string;
|
|
623
|
+
get query(): Record<string, string>;
|
|
624
|
+
back(): Promise<void>;
|
|
625
|
+
forward(): Promise<void>;
|
|
626
|
+
invalidate(props?: Record<string, any>): Promise<void>;
|
|
627
|
+
go(path: string, options?: RouterGoOptions): Promise<void>;
|
|
628
|
+
go(path: keyof VirtualRouter<T>, options?: RouterGoOptions): Promise<void>;
|
|
629
|
+
anchor(path: string, options?: RouterGoOptions): AnchorProps;
|
|
630
|
+
anchor(path: keyof VirtualRouter<T>, options?: RouterGoOptions): AnchorProps;
|
|
631
|
+
base(path: string): string;
|
|
632
|
+
/**
|
|
633
|
+
* Set query params.
|
|
634
|
+
*
|
|
635
|
+
* @param record
|
|
636
|
+
* @param options
|
|
637
|
+
*/
|
|
638
|
+
setQueryParams(record: Record<string, any> | ((queryParams: Record<string, any>) => Record<string, any>), options?: {
|
|
639
|
+
/**
|
|
640
|
+
* If true, this will add a new entry to the history stack.
|
|
641
|
+
*/
|
|
642
|
+
push?: boolean;
|
|
643
|
+
}): void;
|
|
644
|
+
}
|
|
645
|
+
type VirtualRouter<T> = { [K in keyof T as T[K] extends PagePrimitive ? K : never]: T[K] };
|
|
646
|
+
//#endregion
|
|
647
|
+
//#region ../../src/react/router/providers/ReactBrowserRouterProvider.d.ts
|
|
648
|
+
interface BrowserRoute extends Route {
|
|
649
|
+
page: PageRoute;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Implementation of AlephaRouter for React in browser environment.
|
|
653
|
+
*/
|
|
654
|
+
declare class ReactBrowserRouterProvider extends RouterProvider<BrowserRoute> {
|
|
655
|
+
protected readonly log: alepha_logger2.Logger;
|
|
656
|
+
protected readonly alepha: Alepha;
|
|
657
|
+
protected readonly pageApi: ReactPageProvider;
|
|
658
|
+
protected readonly browserHeadProvider: BrowserHeadProvider;
|
|
659
|
+
add(entry: PageRouteEntry): void;
|
|
660
|
+
protected readonly configure: alepha16.HookPrimitive<"configure">;
|
|
661
|
+
transition(url: URL, previous?: PreviousLayerData[], meta?: {}): Promise<string | void>;
|
|
662
|
+
root(state: ReactRouterState): ReactNode;
|
|
663
|
+
}
|
|
664
|
+
//#endregion
|
|
665
|
+
//#region ../../src/react/router/providers/ReactBrowserProvider.d.ts
|
|
666
|
+
/**
|
|
667
|
+
* React browser renderer configuration atom
|
|
668
|
+
*/
|
|
669
|
+
declare const reactBrowserOptions: alepha16.Atom<alepha16.TObject<{
|
|
670
|
+
scrollRestoration: alepha16.TUnsafe<"top" | "manual">;
|
|
671
|
+
}>, "alepha.react.browser.options">;
|
|
672
|
+
type ReactBrowserRendererOptions = Static<typeof reactBrowserOptions.schema>;
|
|
673
|
+
declare module "alepha" {
|
|
674
|
+
interface State {
|
|
675
|
+
[reactBrowserOptions.key]: ReactBrowserRendererOptions;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
declare class ReactBrowserProvider {
|
|
679
|
+
protected readonly log: alepha_logger2.Logger;
|
|
680
|
+
protected readonly client: LinkProvider;
|
|
681
|
+
protected readonly alepha: Alepha;
|
|
682
|
+
protected readonly router: ReactBrowserRouterProvider;
|
|
683
|
+
protected readonly dateTimeProvider: DateTimeProvider;
|
|
684
|
+
protected readonly browserHeadProvider: BrowserHeadProvider;
|
|
685
|
+
protected readonly options: Readonly<{
|
|
686
|
+
scrollRestoration: "top" | "manual";
|
|
687
|
+
}>;
|
|
688
|
+
get rootId(): string;
|
|
689
|
+
protected getRootElement(): HTMLElement;
|
|
690
|
+
transitioning?: {
|
|
691
|
+
to: string;
|
|
692
|
+
from?: string;
|
|
693
|
+
};
|
|
694
|
+
get state(): ReactRouterState;
|
|
695
|
+
/**
|
|
696
|
+
* Accessor for Document DOM API.
|
|
697
|
+
*/
|
|
698
|
+
get document(): Document;
|
|
699
|
+
/**
|
|
700
|
+
* Accessor for History DOM API.
|
|
701
|
+
*/
|
|
702
|
+
get history(): History;
|
|
703
|
+
/**
|
|
704
|
+
* Accessor for Location DOM API.
|
|
705
|
+
*/
|
|
706
|
+
get location(): Location;
|
|
707
|
+
get base(): string;
|
|
708
|
+
get url(): string;
|
|
709
|
+
pushState(path: string, replace?: boolean): void;
|
|
710
|
+
invalidate(props?: Record<string, any>): Promise<void>;
|
|
711
|
+
go(url: string, options?: RouterGoOptions): Promise<void>;
|
|
712
|
+
protected render(options?: RouterRenderOptions): Promise<void>;
|
|
713
|
+
/**
|
|
714
|
+
* Get embedded layers from the server.
|
|
715
|
+
*/
|
|
716
|
+
protected getHydrationState(): ReactHydrationState | undefined;
|
|
717
|
+
protected readonly onTransitionEnd: alepha16.HookPrimitive<"react:transition:end">;
|
|
718
|
+
readonly ready: alepha16.HookPrimitive<"ready">;
|
|
719
|
+
}
|
|
720
|
+
type ReactHydrationState = {
|
|
721
|
+
layers?: Array<PreviousLayerData>;
|
|
722
|
+
} & {
|
|
723
|
+
[key: string]: any;
|
|
724
|
+
};
|
|
725
|
+
interface RouterRenderOptions {
|
|
726
|
+
url?: string;
|
|
727
|
+
previous?: PreviousLayerData[];
|
|
728
|
+
meta?: Record<string, any>;
|
|
729
|
+
}
|
|
730
|
+
//#endregion
|
|
731
|
+
//#region ../../src/react/router/components/ErrorViewer.d.ts
|
|
732
|
+
interface ErrorViewerProps {
|
|
733
|
+
error: Error;
|
|
734
|
+
alepha: Alepha;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* Error viewer component - Terminal/brutalist aesthetic
|
|
738
|
+
*/
|
|
739
|
+
declare const ErrorViewer: ({
|
|
740
|
+
error,
|
|
741
|
+
alepha
|
|
742
|
+
}: ErrorViewerProps) => react_jsx_runtime0.JSX.Element;
|
|
743
|
+
//#endregion
|
|
744
|
+
//#region ../../src/react/router/components/Link.d.ts
|
|
745
|
+
interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
746
|
+
href: string;
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Link component for client-side navigation.
|
|
750
|
+
*
|
|
751
|
+
* It's a simple wrapper around an anchor (`<a>`) element using the `useRouter` hook.
|
|
752
|
+
*/
|
|
753
|
+
declare const Link: (props: LinkProps) => react0.DetailedReactHTMLElement<{
|
|
754
|
+
href: string;
|
|
755
|
+
onClick: (ev?: any) => any;
|
|
756
|
+
download?: any;
|
|
757
|
+
hrefLang?: string | undefined;
|
|
758
|
+
media?: string | undefined;
|
|
759
|
+
ping?: string | undefined;
|
|
760
|
+
target?: react0.HTMLAttributeAnchorTarget | undefined;
|
|
761
|
+
type?: string | undefined;
|
|
762
|
+
referrerPolicy?: react0.HTMLAttributeReferrerPolicy | undefined;
|
|
763
|
+
defaultChecked?: boolean | undefined;
|
|
764
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
765
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
766
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
767
|
+
accessKey?: string | undefined;
|
|
768
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
|
|
769
|
+
autoFocus?: boolean | undefined;
|
|
770
|
+
className?: string | undefined;
|
|
771
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
772
|
+
contextMenu?: string | undefined;
|
|
773
|
+
dir?: string | undefined;
|
|
774
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
775
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
776
|
+
hidden?: boolean | undefined;
|
|
777
|
+
id?: string | undefined;
|
|
778
|
+
lang?: string | undefined;
|
|
779
|
+
nonce?: string | undefined;
|
|
780
|
+
slot?: string | undefined;
|
|
781
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
782
|
+
style?: react0.CSSProperties | undefined;
|
|
783
|
+
tabIndex?: number | undefined;
|
|
784
|
+
title?: string | undefined;
|
|
785
|
+
translate?: "yes" | "no" | undefined;
|
|
786
|
+
radioGroup?: string | undefined;
|
|
787
|
+
role?: react0.AriaRole | undefined;
|
|
788
|
+
about?: string | undefined;
|
|
789
|
+
content?: string | undefined;
|
|
790
|
+
datatype?: string | undefined;
|
|
791
|
+
inlist?: any;
|
|
792
|
+
prefix?: string | undefined;
|
|
793
|
+
property?: string | undefined;
|
|
794
|
+
rel?: string | undefined;
|
|
795
|
+
resource?: string | undefined;
|
|
796
|
+
rev?: string | undefined;
|
|
797
|
+
typeof?: string | undefined;
|
|
798
|
+
vocab?: string | undefined;
|
|
799
|
+
autoCorrect?: string | undefined;
|
|
800
|
+
autoSave?: string | undefined;
|
|
801
|
+
color?: string | undefined;
|
|
802
|
+
itemProp?: string | undefined;
|
|
803
|
+
itemScope?: boolean | undefined;
|
|
804
|
+
itemType?: string | undefined;
|
|
805
|
+
itemID?: string | undefined;
|
|
806
|
+
itemRef?: string | undefined;
|
|
807
|
+
results?: number | undefined;
|
|
808
|
+
security?: string | undefined;
|
|
809
|
+
unselectable?: "on" | "off" | undefined;
|
|
810
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
811
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
812
|
+
popoverTarget?: string | undefined;
|
|
813
|
+
inert?: boolean | undefined;
|
|
814
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
815
|
+
is?: string | undefined;
|
|
816
|
+
exportparts?: string | undefined;
|
|
817
|
+
part?: string | undefined;
|
|
818
|
+
"aria-activedescendant"?: string | undefined;
|
|
819
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
820
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
821
|
+
"aria-braillelabel"?: string | undefined;
|
|
822
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
823
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
824
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
825
|
+
"aria-colcount"?: number | undefined;
|
|
826
|
+
"aria-colindex"?: number | undefined;
|
|
827
|
+
"aria-colindextext"?: string | undefined;
|
|
828
|
+
"aria-colspan"?: number | undefined;
|
|
829
|
+
"aria-controls"?: string | undefined;
|
|
830
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
831
|
+
"aria-describedby"?: string | undefined;
|
|
832
|
+
"aria-description"?: string | undefined;
|
|
833
|
+
"aria-details"?: string | undefined;
|
|
834
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
835
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
|
|
836
|
+
"aria-errormessage"?: string | undefined;
|
|
837
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
838
|
+
"aria-flowto"?: string | undefined;
|
|
839
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
840
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
841
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
842
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
843
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
844
|
+
"aria-label"?: string | undefined;
|
|
845
|
+
"aria-labelledby"?: string | undefined;
|
|
846
|
+
"aria-level"?: number | undefined;
|
|
847
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
848
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
849
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
850
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
851
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
852
|
+
"aria-owns"?: string | undefined;
|
|
853
|
+
"aria-placeholder"?: string | undefined;
|
|
854
|
+
"aria-posinset"?: number | undefined;
|
|
855
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
856
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
857
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
|
|
858
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
859
|
+
"aria-roledescription"?: string | undefined;
|
|
860
|
+
"aria-rowcount"?: number | undefined;
|
|
861
|
+
"aria-rowindex"?: number | undefined;
|
|
862
|
+
"aria-rowindextext"?: string | undefined;
|
|
863
|
+
"aria-rowspan"?: number | undefined;
|
|
864
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
865
|
+
"aria-setsize"?: number | undefined;
|
|
866
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
867
|
+
"aria-valuemax"?: number | undefined;
|
|
868
|
+
"aria-valuemin"?: number | undefined;
|
|
869
|
+
"aria-valuenow"?: number | undefined;
|
|
870
|
+
"aria-valuetext"?: string | undefined;
|
|
871
|
+
children?: react0.ReactNode | undefined;
|
|
872
|
+
dangerouslySetInnerHTML?: {
|
|
873
|
+
__html: string | TrustedHTML;
|
|
874
|
+
} | undefined;
|
|
875
|
+
onCopy?: react0.ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
876
|
+
onCopyCapture?: react0.ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
877
|
+
onCut?: react0.ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
878
|
+
onCutCapture?: react0.ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
879
|
+
onPaste?: react0.ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
880
|
+
onPasteCapture?: react0.ClipboardEventHandler<HTMLAnchorElement> | undefined;
|
|
881
|
+
onCompositionEnd?: react0.CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
882
|
+
onCompositionEndCapture?: react0.CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
883
|
+
onCompositionStart?: react0.CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
884
|
+
onCompositionStartCapture?: react0.CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
885
|
+
onCompositionUpdate?: react0.CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
886
|
+
onCompositionUpdateCapture?: react0.CompositionEventHandler<HTMLAnchorElement> | undefined;
|
|
887
|
+
onFocus?: react0.FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
888
|
+
onFocusCapture?: react0.FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
889
|
+
onBlur?: react0.FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
890
|
+
onBlurCapture?: react0.FocusEventHandler<HTMLAnchorElement> | undefined;
|
|
891
|
+
onChange?: react0.ChangeEventHandler<HTMLAnchorElement, Element> | undefined;
|
|
892
|
+
onChangeCapture?: react0.ChangeEventHandler<HTMLAnchorElement, Element> | undefined;
|
|
893
|
+
onBeforeInput?: react0.InputEventHandler<HTMLAnchorElement> | undefined;
|
|
894
|
+
onBeforeInputCapture?: react0.InputEventHandler<HTMLAnchorElement> | undefined;
|
|
895
|
+
onInput?: react0.InputEventHandler<HTMLAnchorElement> | undefined;
|
|
896
|
+
onInputCapture?: react0.InputEventHandler<HTMLAnchorElement> | undefined;
|
|
897
|
+
onReset?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
898
|
+
onResetCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
899
|
+
onSubmit?: react0.SubmitEventHandler<HTMLAnchorElement> | undefined;
|
|
900
|
+
onSubmitCapture?: react0.SubmitEventHandler<HTMLAnchorElement> | undefined;
|
|
901
|
+
onInvalid?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
902
|
+
onInvalidCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
903
|
+
onLoad?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
904
|
+
onLoadCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
905
|
+
onError?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
906
|
+
onErrorCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
907
|
+
onKeyDown?: react0.KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
908
|
+
onKeyDownCapture?: react0.KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
909
|
+
onKeyPress?: react0.KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
910
|
+
onKeyPressCapture?: react0.KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
911
|
+
onKeyUp?: react0.KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
912
|
+
onKeyUpCapture?: react0.KeyboardEventHandler<HTMLAnchorElement> | undefined;
|
|
913
|
+
onAbort?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
914
|
+
onAbortCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
915
|
+
onCanPlay?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
916
|
+
onCanPlayCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
917
|
+
onCanPlayThrough?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
918
|
+
onCanPlayThroughCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
919
|
+
onDurationChange?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
920
|
+
onDurationChangeCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
921
|
+
onEmptied?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
922
|
+
onEmptiedCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
923
|
+
onEncrypted?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
924
|
+
onEncryptedCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
925
|
+
onEnded?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
926
|
+
onEndedCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
927
|
+
onLoadedData?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
928
|
+
onLoadedDataCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
929
|
+
onLoadedMetadata?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
930
|
+
onLoadedMetadataCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
931
|
+
onLoadStart?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
932
|
+
onLoadStartCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
933
|
+
onPause?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
934
|
+
onPauseCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
935
|
+
onPlay?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
936
|
+
onPlayCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
937
|
+
onPlaying?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
938
|
+
onPlayingCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
939
|
+
onProgress?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
940
|
+
onProgressCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
941
|
+
onRateChange?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
942
|
+
onRateChangeCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
943
|
+
onSeeked?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
944
|
+
onSeekedCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
945
|
+
onSeeking?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
946
|
+
onSeekingCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
947
|
+
onStalled?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
948
|
+
onStalledCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
949
|
+
onSuspend?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
950
|
+
onSuspendCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
951
|
+
onTimeUpdate?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
952
|
+
onTimeUpdateCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
953
|
+
onVolumeChange?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
954
|
+
onVolumeChangeCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
955
|
+
onWaiting?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
956
|
+
onWaitingCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
957
|
+
onAuxClick?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
958
|
+
onAuxClickCapture?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
959
|
+
onClickCapture?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
960
|
+
onContextMenu?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
961
|
+
onContextMenuCapture?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
962
|
+
onDoubleClick?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
963
|
+
onDoubleClickCapture?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
964
|
+
onDrag?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
965
|
+
onDragCapture?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
966
|
+
onDragEnd?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
967
|
+
onDragEndCapture?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
968
|
+
onDragEnter?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
969
|
+
onDragEnterCapture?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
970
|
+
onDragExit?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
971
|
+
onDragExitCapture?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
972
|
+
onDragLeave?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
973
|
+
onDragLeaveCapture?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
974
|
+
onDragOver?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
975
|
+
onDragOverCapture?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
976
|
+
onDragStart?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
977
|
+
onDragStartCapture?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
978
|
+
onDrop?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
979
|
+
onDropCapture?: react0.DragEventHandler<HTMLAnchorElement> | undefined;
|
|
980
|
+
onMouseDown?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
981
|
+
onMouseDownCapture?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
982
|
+
onMouseEnter?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
983
|
+
onMouseLeave?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
984
|
+
onMouseMove?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
985
|
+
onMouseMoveCapture?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
986
|
+
onMouseOut?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
987
|
+
onMouseOutCapture?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
988
|
+
onMouseOver?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
989
|
+
onMouseOverCapture?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
990
|
+
onMouseUp?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
991
|
+
onMouseUpCapture?: react0.MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
992
|
+
onSelect?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
993
|
+
onSelectCapture?: react0.ReactEventHandler<HTMLAnchorElement> | undefined;
|
|
994
|
+
onTouchCancel?: react0.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
995
|
+
onTouchCancelCapture?: react0.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
996
|
+
onTouchEnd?: react0.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
997
|
+
onTouchEndCapture?: react0.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
998
|
+
onTouchMove?: react0.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
999
|
+
onTouchMoveCapture?: react0.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
1000
|
+
onTouchStart?: react0.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
1001
|
+
onTouchStartCapture?: react0.TouchEventHandler<HTMLAnchorElement> | undefined;
|
|
1002
|
+
onPointerDown?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1003
|
+
onPointerDownCapture?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1004
|
+
onPointerMove?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1005
|
+
onPointerMoveCapture?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1006
|
+
onPointerUp?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1007
|
+
onPointerUpCapture?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1008
|
+
onPointerCancel?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1009
|
+
onPointerCancelCapture?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1010
|
+
onPointerEnter?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1011
|
+
onPointerLeave?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1012
|
+
onPointerOver?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1013
|
+
onPointerOverCapture?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1014
|
+
onPointerOut?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1015
|
+
onPointerOutCapture?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1016
|
+
onGotPointerCapture?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1017
|
+
onGotPointerCaptureCapture?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1018
|
+
onLostPointerCapture?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1019
|
+
onLostPointerCaptureCapture?: react0.PointerEventHandler<HTMLAnchorElement> | undefined;
|
|
1020
|
+
onScroll?: react0.UIEventHandler<HTMLAnchorElement> | undefined;
|
|
1021
|
+
onScrollCapture?: react0.UIEventHandler<HTMLAnchorElement> | undefined;
|
|
1022
|
+
onScrollEnd?: react0.UIEventHandler<HTMLAnchorElement> | undefined;
|
|
1023
|
+
onScrollEndCapture?: react0.UIEventHandler<HTMLAnchorElement> | undefined;
|
|
1024
|
+
onWheel?: react0.WheelEventHandler<HTMLAnchorElement> | undefined;
|
|
1025
|
+
onWheelCapture?: react0.WheelEventHandler<HTMLAnchorElement> | undefined;
|
|
1026
|
+
onAnimationStart?: react0.AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
1027
|
+
onAnimationStartCapture?: react0.AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
1028
|
+
onAnimationEnd?: react0.AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
1029
|
+
onAnimationEndCapture?: react0.AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
1030
|
+
onAnimationIteration?: react0.AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
1031
|
+
onAnimationIterationCapture?: react0.AnimationEventHandler<HTMLAnchorElement> | undefined;
|
|
1032
|
+
onToggle?: react0.ToggleEventHandler<HTMLAnchorElement> | undefined;
|
|
1033
|
+
onBeforeToggle?: react0.ToggleEventHandler<HTMLAnchorElement> | undefined;
|
|
1034
|
+
onTransitionCancel?: react0.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
1035
|
+
onTransitionCancelCapture?: react0.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
1036
|
+
onTransitionEnd?: react0.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
1037
|
+
onTransitionEndCapture?: react0.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
1038
|
+
onTransitionRun?: react0.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
1039
|
+
onTransitionRunCapture?: react0.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
1040
|
+
onTransitionStart?: react0.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
1041
|
+
onTransitionStartCapture?: react0.TransitionEventHandler<HTMLAnchorElement> | undefined;
|
|
1042
|
+
}, HTMLElement>;
|
|
1043
|
+
//#endregion
|
|
1044
|
+
//#region ../../src/react/router/components/NestedView.d.ts
|
|
1045
|
+
interface NestedViewProps {
|
|
1046
|
+
children?: ReactNode;
|
|
1047
|
+
errorBoundary?: false | ((error: Error) => ReactNode);
|
|
1048
|
+
}
|
|
1049
|
+
declare const _default: react0.MemoExoticComponent<(props: NestedViewProps) => react_jsx_runtime0.JSX.Element>;
|
|
1050
|
+
//#endregion
|
|
1051
|
+
//#region ../../src/react/router/components/NotFound.d.ts
|
|
1052
|
+
/**
|
|
1053
|
+
* Default 404 Not Found page component.
|
|
1054
|
+
*/
|
|
1055
|
+
declare const NotFound: (props: {
|
|
1056
|
+
style?: CSSProperties;
|
|
1057
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
1058
|
+
//#endregion
|
|
1059
|
+
//#region ../../src/react/router/contexts/RouterLayerContext.d.ts
|
|
1060
|
+
interface RouterLayerContextValue {
|
|
1061
|
+
index: number;
|
|
1062
|
+
path: string;
|
|
1063
|
+
onError: ErrorHandler;
|
|
1064
|
+
}
|
|
1065
|
+
declare const RouterLayerContext: react0.Context<RouterLayerContextValue | undefined>;
|
|
1066
|
+
//#endregion
|
|
1067
|
+
//#region ../../src/react/router/hooks/useActive.d.ts
|
|
1068
|
+
interface UseActiveOptions {
|
|
1069
|
+
href: string;
|
|
1070
|
+
startWith?: boolean;
|
|
1071
|
+
}
|
|
1072
|
+
/**
|
|
1073
|
+
* Hook to determine if a given route is active and to provide anchor props for navigation.
|
|
1074
|
+
* This hook refreshes on router state changes.
|
|
1075
|
+
*/
|
|
1076
|
+
declare const useActive: (args: string | UseActiveOptions) => UseActiveHook;
|
|
1077
|
+
interface UseActiveHook {
|
|
1078
|
+
isActive: boolean;
|
|
1079
|
+
anchorProps: AnchorProps;
|
|
1080
|
+
isPending: boolean;
|
|
1081
|
+
}
|
|
1082
|
+
//#endregion
|
|
1083
|
+
//#region ../../src/react/router/hooks/useQueryParams.d.ts
|
|
1084
|
+
/**
|
|
1085
|
+
* Hook to manage query parameters in the URL using a defined schema.
|
|
1086
|
+
*/
|
|
1087
|
+
declare const useQueryParams: <T extends TObject>(schema: T, options?: UseQueryParamsHookOptions) => [Partial<Static<T>>, (data: Static<T>) => void];
|
|
1088
|
+
interface UseQueryParamsHookOptions {
|
|
1089
|
+
format?: "base64" | "querystring";
|
|
1090
|
+
key?: string;
|
|
1091
|
+
push?: boolean;
|
|
1092
|
+
}
|
|
1093
|
+
//#endregion
|
|
1094
|
+
//#region ../../src/react/router/hooks/useRouter.d.ts
|
|
1095
|
+
/**
|
|
1096
|
+
* Use this hook to access the React Router instance.
|
|
1097
|
+
*
|
|
1098
|
+
* You can add a type parameter to specify the type of your application.
|
|
1099
|
+
* This will allow you to use the router in a typesafe way.
|
|
1100
|
+
*
|
|
1101
|
+
* @example
|
|
1102
|
+
* class App {
|
|
1103
|
+
* home = $page();
|
|
1104
|
+
* }
|
|
1105
|
+
*
|
|
1106
|
+
* const router = useRouter<App>();
|
|
1107
|
+
* router.go("home"); // typesafe
|
|
1108
|
+
*/
|
|
1109
|
+
declare const useRouter: <T extends object = any>() => ReactRouter<T>;
|
|
1110
|
+
//#endregion
|
|
1111
|
+
//#region ../../src/react/router/hooks/useRouterState.d.ts
|
|
1112
|
+
declare const useRouterState: () => ReactRouterState;
|
|
1113
|
+
//#endregion
|
|
1114
|
+
//#region ../../src/system/providers/FileSystemProvider.d.ts
|
|
1115
|
+
/**
|
|
1116
|
+
* Options for creating a file from a URL
|
|
1117
|
+
*/
|
|
1118
|
+
interface CreateFileFromUrlOptions {
|
|
1119
|
+
/**
|
|
1120
|
+
* The URL to load the file from (file://, http://, or https://)
|
|
1121
|
+
*/
|
|
1122
|
+
url: string;
|
|
1123
|
+
/**
|
|
1124
|
+
* The MIME type of the file (optional, will be detected from filename if not provided)
|
|
1125
|
+
*/
|
|
1126
|
+
type?: string;
|
|
1127
|
+
/**
|
|
1128
|
+
* The name of the file (optional, will be extracted from URL if not provided)
|
|
1129
|
+
*/
|
|
1130
|
+
name?: string;
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* Options for creating a file from a path (URL with file:// scheme)
|
|
1134
|
+
*/
|
|
1135
|
+
interface CreateFileFromPathOptions {
|
|
1136
|
+
/**
|
|
1137
|
+
* The path to the file on the local filesystem
|
|
1138
|
+
*/
|
|
1139
|
+
path: string;
|
|
1140
|
+
/**
|
|
1141
|
+
* The MIME type of the file (optional, will be detected from filename if not provided)
|
|
1142
|
+
*/
|
|
1143
|
+
type?: string;
|
|
1144
|
+
/**
|
|
1145
|
+
* The name of the file (optional, will be extracted from URL if not provided)
|
|
1146
|
+
*/
|
|
1147
|
+
name?: string;
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Options for creating a file from a Buffer
|
|
1151
|
+
*/
|
|
1152
|
+
interface CreateFileFromBufferOptions {
|
|
1153
|
+
/**
|
|
1154
|
+
* The Buffer containing the file data
|
|
1155
|
+
*/
|
|
1156
|
+
buffer: Buffer;
|
|
1157
|
+
/**
|
|
1158
|
+
* The MIME type of the file (optional, will be detected from name if not provided)
|
|
1159
|
+
*/
|
|
1160
|
+
type?: string;
|
|
1161
|
+
/**
|
|
1162
|
+
* The name of the file (required for proper content type detection)
|
|
1163
|
+
*/
|
|
1164
|
+
name?: string;
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Options for creating a file from a stream
|
|
1168
|
+
*/
|
|
1169
|
+
interface CreateFileFromStreamOptions {
|
|
1170
|
+
/**
|
|
1171
|
+
* The readable stream containing the file data
|
|
1172
|
+
*/
|
|
1173
|
+
stream: StreamLike;
|
|
1174
|
+
/**
|
|
1175
|
+
* The MIME type of the file (optional, will be detected from name if not provided)
|
|
1176
|
+
*/
|
|
1177
|
+
type?: string;
|
|
1178
|
+
/**
|
|
1179
|
+
* The name of the file (required for proper content type detection)
|
|
1180
|
+
*/
|
|
1181
|
+
name?: string;
|
|
1182
|
+
/**
|
|
1183
|
+
* The size of the file in bytes (optional)
|
|
1184
|
+
*/
|
|
1185
|
+
size?: number;
|
|
1186
|
+
}
|
|
1187
|
+
/**
|
|
1188
|
+
* Options for creating a file from text content
|
|
1189
|
+
*/
|
|
1190
|
+
interface CreateFileFromTextOptions {
|
|
1191
|
+
/**
|
|
1192
|
+
* The text content to create the file from
|
|
1193
|
+
*/
|
|
1194
|
+
text: string;
|
|
1195
|
+
/**
|
|
1196
|
+
* The MIME type of the file (default: text/plain)
|
|
1197
|
+
*/
|
|
1198
|
+
type?: string;
|
|
1199
|
+
/**
|
|
1200
|
+
* The name of the file (default: "file.txt")
|
|
1201
|
+
*/
|
|
1202
|
+
name?: string;
|
|
1203
|
+
}
|
|
1204
|
+
interface CreateFileFromResponseOptions {
|
|
1205
|
+
/**
|
|
1206
|
+
* The Response object containing the file data
|
|
1207
|
+
*/
|
|
1208
|
+
response: Response;
|
|
1209
|
+
/**
|
|
1210
|
+
* Override the name (optional, uses filename from Content-Disposition header if not provided)
|
|
1211
|
+
*/
|
|
1212
|
+
name?: string;
|
|
1213
|
+
/**
|
|
1214
|
+
* Override the MIME type (optional, uses file.type if not provided)
|
|
1215
|
+
*/
|
|
1216
|
+
type?: string;
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* Options for creating a file from a Web File object
|
|
1220
|
+
*/
|
|
1221
|
+
interface CreateFileFromWebFileOptions {
|
|
1222
|
+
/**
|
|
1223
|
+
* The Web File object
|
|
1224
|
+
*/
|
|
1225
|
+
file: File;
|
|
1226
|
+
/**
|
|
1227
|
+
* Override the MIME type (optional, uses file.type if not provided)
|
|
1228
|
+
*/
|
|
1229
|
+
type?: string;
|
|
1230
|
+
/**
|
|
1231
|
+
* Override the name (optional, uses file.name if not provided)
|
|
1232
|
+
*/
|
|
1233
|
+
name?: string;
|
|
1234
|
+
/**
|
|
1235
|
+
* Override the size (optional, uses file.size if not provided)
|
|
1236
|
+
*/
|
|
1237
|
+
size?: number;
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Options for creating a file from an ArrayBuffer
|
|
1241
|
+
*/
|
|
1242
|
+
interface CreateFileFromArrayBufferOptions {
|
|
1243
|
+
/**
|
|
1244
|
+
* The ArrayBuffer containing the file data
|
|
1245
|
+
*/
|
|
1246
|
+
arrayBuffer: ArrayBuffer;
|
|
1247
|
+
/**
|
|
1248
|
+
* The MIME type of the file (optional, will be detected from name if not provided)
|
|
1249
|
+
*/
|
|
1250
|
+
type?: string;
|
|
1251
|
+
/**
|
|
1252
|
+
* The name of the file (required for proper content type detection)
|
|
1253
|
+
*/
|
|
1254
|
+
name?: string;
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* Union type for all createFile options
|
|
1258
|
+
*/
|
|
1259
|
+
type CreateFileOptions = CreateFileFromUrlOptions | CreateFileFromPathOptions | CreateFileFromBufferOptions | CreateFileFromStreamOptions | CreateFileFromTextOptions | CreateFileFromWebFileOptions | CreateFileFromResponseOptions | CreateFileFromArrayBufferOptions;
|
|
1260
|
+
/**
|
|
1261
|
+
* Options for rm (remove) operation
|
|
1262
|
+
*/
|
|
1263
|
+
interface RmOptions {
|
|
1264
|
+
/**
|
|
1265
|
+
* If true, removes directories and their contents recursively
|
|
1266
|
+
*/
|
|
1267
|
+
recursive?: boolean;
|
|
1268
|
+
/**
|
|
1269
|
+
* If true, no error will be thrown if the path does not exist
|
|
1270
|
+
*/
|
|
1271
|
+
force?: boolean;
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* Options for cp (copy) operation
|
|
1275
|
+
*/
|
|
1276
|
+
interface CpOptions {
|
|
1277
|
+
/**
|
|
1278
|
+
* If true, copy directories recursively
|
|
1279
|
+
*/
|
|
1280
|
+
recursive?: boolean;
|
|
1281
|
+
/**
|
|
1282
|
+
* If true, overwrite existing destination
|
|
1283
|
+
*/
|
|
1284
|
+
force?: boolean;
|
|
1285
|
+
}
|
|
1286
|
+
/**
|
|
1287
|
+
* Options for mkdir operation
|
|
1288
|
+
*/
|
|
1289
|
+
interface MkdirOptions {
|
|
1290
|
+
/**
|
|
1291
|
+
* If true, creates parent directories as needed
|
|
1292
|
+
*/
|
|
1293
|
+
recursive?: boolean;
|
|
1294
|
+
/**
|
|
1295
|
+
* File mode (permission and sticky bits)
|
|
1296
|
+
*/
|
|
1297
|
+
mode?: number;
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* Options for ls (list) operation
|
|
1301
|
+
*/
|
|
1302
|
+
interface LsOptions {
|
|
1303
|
+
/**
|
|
1304
|
+
* If true, list contents of directories recursively
|
|
1305
|
+
*/
|
|
1306
|
+
recursive?: boolean;
|
|
1307
|
+
/**
|
|
1308
|
+
* If true, include hidden files (starting with .)
|
|
1309
|
+
*/
|
|
1310
|
+
hidden?: boolean;
|
|
1311
|
+
}
|
|
1312
|
+
/**
|
|
1313
|
+
* FileSystem interface providing utilities for working with files.
|
|
1314
|
+
*/
|
|
1315
|
+
declare abstract class FileSystemProvider {
|
|
1316
|
+
/**
|
|
1317
|
+
* Joins multiple path segments into a single path.
|
|
1318
|
+
*
|
|
1319
|
+
* @param paths - The path segments to join
|
|
1320
|
+
* @returns The joined path
|
|
1321
|
+
*/
|
|
1322
|
+
abstract join(...paths: string[]): string;
|
|
1323
|
+
/**
|
|
1324
|
+
* Creates a FileLike object from various sources.
|
|
1325
|
+
*
|
|
1326
|
+
* @param options - Options for creating the file
|
|
1327
|
+
* @returns A FileLike object
|
|
1328
|
+
*/
|
|
1329
|
+
abstract createFile(options: CreateFileOptions): FileLike;
|
|
1330
|
+
/**
|
|
1331
|
+
* Removes a file or directory.
|
|
1332
|
+
*
|
|
1333
|
+
* @param path - The path to remove
|
|
1334
|
+
* @param options - Remove options
|
|
1335
|
+
*/
|
|
1336
|
+
abstract rm(path: string, options?: RmOptions): Promise<void>;
|
|
1337
|
+
/**
|
|
1338
|
+
* Copies a file or directory.
|
|
1339
|
+
*
|
|
1340
|
+
* @param src - Source path
|
|
1341
|
+
* @param dest - Destination path
|
|
1342
|
+
* @param options - Copy options
|
|
1343
|
+
*/
|
|
1344
|
+
abstract cp(src: string, dest: string, options?: CpOptions): Promise<void>;
|
|
1345
|
+
/**
|
|
1346
|
+
* Moves/renames a file or directory.
|
|
1347
|
+
*
|
|
1348
|
+
* @param src - Source path
|
|
1349
|
+
* @param dest - Destination path
|
|
1350
|
+
*/
|
|
1351
|
+
abstract mv(src: string, dest: string): Promise<void>;
|
|
1352
|
+
/**
|
|
1353
|
+
* Creates a directory.
|
|
1354
|
+
*
|
|
1355
|
+
* @param path - The directory path to create
|
|
1356
|
+
* @param options - Mkdir options
|
|
1357
|
+
*/
|
|
1358
|
+
abstract mkdir(path: string, options?: MkdirOptions): Promise<void>;
|
|
1359
|
+
/**
|
|
1360
|
+
* Lists files in a directory.
|
|
1361
|
+
*
|
|
1362
|
+
* @param path - The directory path to list
|
|
1363
|
+
* @param options - List options
|
|
1364
|
+
* @returns Array of filenames
|
|
1365
|
+
*/
|
|
1366
|
+
abstract ls(path: string, options?: LsOptions): Promise<string[]>;
|
|
1367
|
+
/**
|
|
1368
|
+
* Checks if a file or directory exists.
|
|
1369
|
+
*
|
|
1370
|
+
* @param path - The path to check
|
|
1371
|
+
* @returns True if the path exists, false otherwise
|
|
1372
|
+
*/
|
|
1373
|
+
abstract exists(path: string): Promise<boolean>;
|
|
1374
|
+
/**
|
|
1375
|
+
* Reads the content of a file.
|
|
1376
|
+
*
|
|
1377
|
+
* @param path - The file path to read
|
|
1378
|
+
* @returns The file content as a Buffer
|
|
1379
|
+
*/
|
|
1380
|
+
abstract readFile(path: string): Promise<Buffer>;
|
|
1381
|
+
/**
|
|
1382
|
+
* Writes data to a file.
|
|
1383
|
+
*
|
|
1384
|
+
* @param path - The file path to write to
|
|
1385
|
+
* @param data - The data to write (Buffer or string)
|
|
1386
|
+
*/
|
|
1387
|
+
abstract writeFile(path: string, data: Uint8Array | Buffer | string | FileLike): Promise<void>;
|
|
1388
|
+
/**
|
|
1389
|
+
* Reads the content of a file as a string.
|
|
1390
|
+
*
|
|
1391
|
+
* @param path - The file path to read
|
|
1392
|
+
* @returns The file content as a string
|
|
1393
|
+
*/
|
|
1394
|
+
abstract readTextFile(path: string): Promise<string>;
|
|
1395
|
+
/**
|
|
1396
|
+
* Reads the content of a file as JSON.
|
|
1397
|
+
*
|
|
1398
|
+
* @param path - The file path to read
|
|
1399
|
+
* @returns The parsed JSON content
|
|
1400
|
+
*/
|
|
1401
|
+
abstract readJsonFile<T = unknown>(path: string): Promise<T>;
|
|
1402
|
+
}
|
|
1403
|
+
//#endregion
|
|
1404
|
+
//#region ../../src/react/router/providers/ReactServerTemplateProvider.d.ts
|
|
1405
|
+
/**
|
|
1406
|
+
* Handles HTML template parsing, preprocessing, and streaming for SSR.
|
|
1407
|
+
*
|
|
1408
|
+
* Responsibilities:
|
|
1409
|
+
* - Parse template once at startup into logical slots
|
|
1410
|
+
* - Pre-encode static parts as Uint8Array for zero-copy streaming
|
|
1411
|
+
* - Render dynamic parts (attributes, head content) efficiently
|
|
1412
|
+
* - Build hydration data for client-side rehydration
|
|
1413
|
+
*
|
|
1414
|
+
* This provider is injected into ReactServerProvider to handle all
|
|
1415
|
+
* template-related operations, keeping ReactServerProvider focused
|
|
1416
|
+
* on request handling and React rendering coordination.
|
|
1417
|
+
*/
|
|
1418
|
+
declare class ReactServerTemplateProvider {
|
|
1419
|
+
protected readonly log: alepha_logger2.Logger;
|
|
1420
|
+
protected readonly alepha: Alepha;
|
|
1421
|
+
/**
|
|
1422
|
+
* Shared TextEncoder instance - reused across all requests.
|
|
1423
|
+
*/
|
|
1424
|
+
protected readonly encoder: TextEncoder;
|
|
1425
|
+
/**
|
|
1426
|
+
* Pre-encoded common strings for streaming.
|
|
1427
|
+
*/
|
|
1428
|
+
protected readonly ENCODED: {
|
|
1429
|
+
readonly HYDRATION_PREFIX: Uint8Array<ArrayBuffer>;
|
|
1430
|
+
readonly HYDRATION_SUFFIX: Uint8Array<ArrayBuffer>;
|
|
1431
|
+
readonly EMPTY: Uint8Array<ArrayBuffer>;
|
|
1432
|
+
};
|
|
1433
|
+
/**
|
|
1434
|
+
* Cached template slots - parsed once, reused for all requests.
|
|
1435
|
+
*/
|
|
1436
|
+
protected slots: TemplateSlots | null;
|
|
1437
|
+
/**
|
|
1438
|
+
* Root element ID for React mounting.
|
|
1439
|
+
*/
|
|
1440
|
+
get rootId(): string;
|
|
1441
|
+
/**
|
|
1442
|
+
* Regex pattern for matching the root div and extracting its content.
|
|
1443
|
+
*/
|
|
1444
|
+
get rootDivRegex(): RegExp;
|
|
1445
|
+
/**
|
|
1446
|
+
* Extract the content inside the root div from HTML.
|
|
1447
|
+
*
|
|
1448
|
+
* @param html - Full HTML string
|
|
1449
|
+
* @returns The content inside the root div, or undefined if not found
|
|
1450
|
+
*/
|
|
1451
|
+
extractRootContent(html: string): string | undefined;
|
|
1452
|
+
/**
|
|
1453
|
+
* Check if template has been parsed and slots are available.
|
|
1454
|
+
*/
|
|
1455
|
+
isReady(): boolean;
|
|
1456
|
+
/**
|
|
1457
|
+
* Get the parsed template slots.
|
|
1458
|
+
* Throws if template hasn't been parsed yet.
|
|
1459
|
+
*/
|
|
1460
|
+
getSlots(): TemplateSlots;
|
|
1461
|
+
/**
|
|
1462
|
+
* Parse an HTML template into logical slots for efficient streaming.
|
|
1463
|
+
*
|
|
1464
|
+
* This should be called once during server startup/configuration.
|
|
1465
|
+
* The parsed slots are cached and reused for all requests.
|
|
1466
|
+
*/
|
|
1467
|
+
parseTemplate(template: string): TemplateSlots;
|
|
1468
|
+
/**
|
|
1469
|
+
* Parse HTML attributes string into a record.
|
|
1470
|
+
*
|
|
1471
|
+
* Handles: key="value", key='value', key=value, and boolean key
|
|
1472
|
+
*/
|
|
1473
|
+
protected parseAttributes(attrStr: string): Record<string, string>;
|
|
1474
|
+
/**
|
|
1475
|
+
* Render attributes record to HTML string.
|
|
1476
|
+
*
|
|
1477
|
+
* @param attrs - Attributes to render
|
|
1478
|
+
* @returns HTML attribute string like ` lang="en" class="dark"`
|
|
1479
|
+
*/
|
|
1480
|
+
renderAttributes(attrs: Record<string, string>): string;
|
|
1481
|
+
/**
|
|
1482
|
+
* Render merged HTML attributes (original + dynamic).
|
|
1483
|
+
*/
|
|
1484
|
+
renderMergedHtmlAttrs(dynamicAttrs?: Record<string, string>): string;
|
|
1485
|
+
/**
|
|
1486
|
+
* Render merged body attributes (original + dynamic).
|
|
1487
|
+
*/
|
|
1488
|
+
renderMergedBodyAttrs(dynamicAttrs?: Record<string, string>): string;
|
|
1489
|
+
/**
|
|
1490
|
+
* Render head content (title, meta, link, script tags).
|
|
1491
|
+
*
|
|
1492
|
+
* @param head - Head data to render
|
|
1493
|
+
* @param includeOriginal - Whether to include original head content
|
|
1494
|
+
* @returns HTML string with head content
|
|
1495
|
+
*/
|
|
1496
|
+
renderHeadContent(head?: SimpleHead, includeOriginal?: boolean): string;
|
|
1497
|
+
/**
|
|
1498
|
+
* Render a meta tag.
|
|
1499
|
+
*/
|
|
1500
|
+
protected renderMetaTag(meta: {
|
|
1501
|
+
name?: string;
|
|
1502
|
+
property?: string;
|
|
1503
|
+
content: string;
|
|
1504
|
+
}): string;
|
|
1505
|
+
/**
|
|
1506
|
+
* Render a link tag.
|
|
1507
|
+
*/
|
|
1508
|
+
protected renderLinkTag(link: {
|
|
1509
|
+
rel: string;
|
|
1510
|
+
href: string;
|
|
1511
|
+
type?: string;
|
|
1512
|
+
as?: string;
|
|
1513
|
+
crossorigin?: string;
|
|
1514
|
+
}): string;
|
|
1515
|
+
/**
|
|
1516
|
+
* Render a script tag.
|
|
1517
|
+
*/
|
|
1518
|
+
protected renderScriptTag(script: string | (Record<string, string | boolean | undefined> & {
|
|
1519
|
+
content?: string;
|
|
1520
|
+
})): string;
|
|
1521
|
+
/**
|
|
1522
|
+
* Escape HTML special characters.
|
|
1523
|
+
*/
|
|
1524
|
+
escapeHtml(str: string): string;
|
|
1525
|
+
/**
|
|
1526
|
+
* Safely serialize data to JSON for embedding in HTML.
|
|
1527
|
+
* Escapes characters that could break out of script tags.
|
|
1528
|
+
*/
|
|
1529
|
+
safeJsonSerialize(data: unknown): string;
|
|
1530
|
+
/**
|
|
1531
|
+
* Build hydration data from router state.
|
|
1532
|
+
*
|
|
1533
|
+
* This creates the data structure that will be serialized to window.__ssr
|
|
1534
|
+
* for client-side rehydration.
|
|
1535
|
+
*/
|
|
1536
|
+
buildHydrationData(state: ReactRouterState): HydrationData;
|
|
1537
|
+
/**
|
|
1538
|
+
* Stream the body content: body tag, root div, React content, hydration, and closing tags.
|
|
1539
|
+
*
|
|
1540
|
+
* If an error occurs during React streaming, it injects error HTML instead of aborting,
|
|
1541
|
+
* ensuring users see an error message rather than a white screen.
|
|
1542
|
+
*/
|
|
1543
|
+
protected streamBodyContent(controller: ReadableStreamDefaultController<Uint8Array>, reactStream: ReadableStream<Uint8Array>, state: ReactRouterState, hydration: boolean): Promise<void>;
|
|
1544
|
+
/**
|
|
1545
|
+
* Create a ReadableStream that streams the HTML template with React content.
|
|
1546
|
+
*
|
|
1547
|
+
* This is the main entry point for SSR streaming. It:
|
|
1548
|
+
* 1. Sends <head> immediately (browser starts downloading assets)
|
|
1549
|
+
* 2. Streams React content as it renders
|
|
1550
|
+
* 3. Appends hydration script and closing tags
|
|
1551
|
+
*
|
|
1552
|
+
* @param reactStream - ReadableStream from renderToReadableStream
|
|
1553
|
+
* @param state - Router state with head data
|
|
1554
|
+
* @param options - Streaming options
|
|
1555
|
+
*/
|
|
1556
|
+
createHtmlStream(reactStream: ReadableStream<Uint8Array>, state: ReactRouterState, options?: {
|
|
1557
|
+
hydration?: boolean;
|
|
1558
|
+
onError?: (error: unknown) => void;
|
|
1559
|
+
}): ReadableStream<Uint8Array>;
|
|
1560
|
+
/**
|
|
1561
|
+
* Early head content for preloading.
|
|
1562
|
+
*
|
|
1563
|
+
* Contains entry assets (JS + CSS) that are always required and can be
|
|
1564
|
+
* sent before page loaders run.
|
|
1565
|
+
*/
|
|
1566
|
+
protected earlyHeadContent: string;
|
|
1567
|
+
/**
|
|
1568
|
+
* Set the early head content (entry script + CSS).
|
|
1569
|
+
*
|
|
1570
|
+
* Also strips these assets from the original head content to avoid duplicates,
|
|
1571
|
+
* since we're moving them to the early phase.
|
|
1572
|
+
*
|
|
1573
|
+
* Automatically prepends critical meta tags (charset, viewport) if not present
|
|
1574
|
+
* in $head configuration, ensuring they're sent as early as possible.
|
|
1575
|
+
*
|
|
1576
|
+
* @param content - HTML string with entry assets
|
|
1577
|
+
* @param globalHead - Global head configuration from $head primitives
|
|
1578
|
+
* @param entryAssets - Entry asset paths to strip from original head
|
|
1579
|
+
*/
|
|
1580
|
+
setEarlyHeadContent(content: string, globalHead?: SimpleHead, entryAssets?: {
|
|
1581
|
+
js?: string;
|
|
1582
|
+
css: string[];
|
|
1583
|
+
}): void;
|
|
1584
|
+
/**
|
|
1585
|
+
* Escape special regex characters in a string.
|
|
1586
|
+
*/
|
|
1587
|
+
protected escapeRegExp(str: string): string;
|
|
1588
|
+
/**
|
|
1589
|
+
* Create an optimized HTML stream with early head streaming.
|
|
1590
|
+
*
|
|
1591
|
+
* This version sends critical assets (entry.js, CSS) BEFORE page loaders run,
|
|
1592
|
+
* allowing the browser to start downloading them immediately.
|
|
1593
|
+
*
|
|
1594
|
+
* Flow:
|
|
1595
|
+
* 1. Send DOCTYPE, <html>, <head> open, entry preloads (IMMEDIATE)
|
|
1596
|
+
* 2. Run async work (createLayers, etc.)
|
|
1597
|
+
* 3. Send rest of head, body, React content, hydration
|
|
1598
|
+
*
|
|
1599
|
+
* @param globalHead - Global head with htmlAttributes (from $head primitives)
|
|
1600
|
+
* @param asyncWork - Async function to run between early head and rest of stream
|
|
1601
|
+
* @param options - Streaming options
|
|
1602
|
+
*/
|
|
1603
|
+
createEarlyHtmlStream(globalHead: SimpleHead, asyncWork: () => Promise<{
|
|
1604
|
+
state: ReactRouterState;
|
|
1605
|
+
reactStream: ReadableStream<Uint8Array>;
|
|
1606
|
+
} | {
|
|
1607
|
+
redirect: string;
|
|
1608
|
+
} | null>, options?: {
|
|
1609
|
+
hydration?: boolean;
|
|
1610
|
+
onError?: (error: unknown) => void;
|
|
1611
|
+
}): ReadableStream<Uint8Array>;
|
|
1612
|
+
/**
|
|
1613
|
+
* Inject error HTML into the stream when an error occurs during streaming.
|
|
1614
|
+
*
|
|
1615
|
+
* Uses the router state's onError handler to render the error component,
|
|
1616
|
+
* falling back to ErrorViewer if no custom handler is defined.
|
|
1617
|
+
* Renders using renderToString to produce static HTML.
|
|
1618
|
+
*
|
|
1619
|
+
* Since we may have already sent partial HTML (DOCTYPE, <html>, <head>),
|
|
1620
|
+
* we need to complete the document with an error message instead of aborting.
|
|
1621
|
+
*
|
|
1622
|
+
* Handles different states:
|
|
1623
|
+
* - headClosed=false, bodyStarted=false: Need to add head content, close head, open body, add error, close all
|
|
1624
|
+
* - headClosed=true, bodyStarted=false: Need to open body, add error, close all
|
|
1625
|
+
* - headClosed=true, bodyStarted=true: Already inside root div, add error, close all
|
|
1626
|
+
*/
|
|
1627
|
+
protected injectErrorHtml(controller: ReadableStreamDefaultController<Uint8Array>, encoder: TextEncoder, slots: TemplateSlots, error: unknown, routerState: ReactRouterState | undefined, streamState: {
|
|
1628
|
+
headClosed: boolean;
|
|
1629
|
+
bodyStarted: boolean;
|
|
1630
|
+
}): void;
|
|
1631
|
+
/**
|
|
1632
|
+
* Render an error to HTML string using the router's error handler.
|
|
1633
|
+
*
|
|
1634
|
+
* Falls back to ErrorViewer if:
|
|
1635
|
+
* - No router state is available
|
|
1636
|
+
* - The error handler returns null/undefined
|
|
1637
|
+
* - The error handler itself throws
|
|
1638
|
+
*/
|
|
1639
|
+
protected renderErrorToString(error: Error, routerState: ReactRouterState | undefined): string;
|
|
1640
|
+
}
|
|
1641
|
+
/**
|
|
1642
|
+
* Template slots - the template split into logical parts for efficient streaming.
|
|
1643
|
+
*
|
|
1644
|
+
* Static parts are pre-encoded as Uint8Array for zero-copy streaming.
|
|
1645
|
+
* Dynamic parts (attributes, head content) are kept as strings/objects for merging.
|
|
1646
|
+
*/
|
|
1647
|
+
interface TemplateSlots {
|
|
1648
|
+
doctype: Uint8Array;
|
|
1649
|
+
htmlOpen: Uint8Array;
|
|
1650
|
+
htmlClose: Uint8Array;
|
|
1651
|
+
headOpen: Uint8Array;
|
|
1652
|
+
headClose: Uint8Array;
|
|
1653
|
+
bodyOpen: Uint8Array;
|
|
1654
|
+
bodyClose: Uint8Array;
|
|
1655
|
+
rootOpen: Uint8Array;
|
|
1656
|
+
rootClose: Uint8Array;
|
|
1657
|
+
scriptClose: Uint8Array;
|
|
1658
|
+
htmlOriginalAttrs: Record<string, string>;
|
|
1659
|
+
bodyOriginalAttrs: Record<string, string>;
|
|
1660
|
+
headOriginalContent: string;
|
|
1661
|
+
beforeRoot: string;
|
|
1662
|
+
afterRoot: string;
|
|
1663
|
+
}
|
|
1664
|
+
/**
|
|
1665
|
+
* Hydration state that gets serialized to window.__ssr
|
|
1666
|
+
*/
|
|
1667
|
+
interface HydrationData {
|
|
1668
|
+
layers: Array<{
|
|
1669
|
+
data?: unknown;
|
|
1670
|
+
error?: {
|
|
1671
|
+
name: string;
|
|
1672
|
+
message: string;
|
|
1673
|
+
stack?: string;
|
|
1674
|
+
};
|
|
1675
|
+
}>;
|
|
1676
|
+
[key: string]: unknown;
|
|
1677
|
+
}
|
|
1678
|
+
//#endregion
|
|
1679
|
+
//#region ../../src/react/router/atoms/ssrManifestAtom.d.ts
|
|
1680
|
+
/**
|
|
1681
|
+
* Schema for the SSR manifest atom.
|
|
1682
|
+
*/
|
|
1683
|
+
declare const ssrManifestAtomSchema: alepha16.TObject<{
|
|
1684
|
+
/**
|
|
1685
|
+
* Base path for assets (from Vite's base config).
|
|
1686
|
+
* Used to prefix asset URLs when serving from a subpath.
|
|
1687
|
+
* @example "/devtools" or "/"
|
|
1688
|
+
*/
|
|
1689
|
+
base: alepha16.TOptional<alepha16.TString>;
|
|
1690
|
+
/**
|
|
1691
|
+
* Preload manifest mapping short keys to source paths.
|
|
1692
|
+
* Generated by viteAlephaSsrPreload plugin at build time.
|
|
1693
|
+
*/
|
|
1694
|
+
preload: alepha16.TOptional<alepha16.TRecord<"^.*$", alepha16.TString>>;
|
|
1695
|
+
/**
|
|
1696
|
+
* Client manifest mapping source files to their output information.
|
|
1697
|
+
* Only includes fields actually used for preloading.
|
|
1698
|
+
*/
|
|
1699
|
+
client: alepha16.TOptional<alepha16.TRecord<"^.*$", alepha16.TObject<{
|
|
1700
|
+
file: alepha16.TString;
|
|
1701
|
+
isEntry: alepha16.TOptional<alepha16.TBoolean>;
|
|
1702
|
+
imports: alepha16.TOptional<alepha16.TArray<alepha16.TString>>;
|
|
1703
|
+
css: alepha16.TOptional<alepha16.TArray<alepha16.TString>>;
|
|
1704
|
+
}>>>;
|
|
1705
|
+
}>;
|
|
1706
|
+
/**
|
|
1707
|
+
* Type for the SSR manifest schema.
|
|
1708
|
+
*/
|
|
1709
|
+
type SsrManifestAtomSchema = typeof ssrManifestAtomSchema;
|
|
1710
|
+
//#endregion
|
|
1711
|
+
//#region ../../src/react/router/providers/SSRManifestProvider.d.ts
|
|
1712
|
+
/**
|
|
1713
|
+
* Provider for SSR manifest data used for module preloading.
|
|
1714
|
+
*
|
|
1715
|
+
* The manifest is populated at build time by embedding data into the
|
|
1716
|
+
* generated index.js via the ssrManifestAtom. This eliminates filesystem
|
|
1717
|
+
* reads at runtime, making it optimal for serverless deployments.
|
|
1718
|
+
*
|
|
1719
|
+
* Manifest files are generated during `vite build`:
|
|
1720
|
+
* - manifest.json (client manifest)
|
|
1721
|
+
* - preload-manifest.json (from viteAlephaSsrPreload plugin)
|
|
1722
|
+
*/
|
|
1723
|
+
declare class SSRManifestProvider {
|
|
1724
|
+
protected readonly alepha: Alepha;
|
|
1725
|
+
/**
|
|
1726
|
+
* Get the manifest from the store at runtime.
|
|
1727
|
+
* This ensures the manifest is available even when set after module load.
|
|
1728
|
+
*/
|
|
1729
|
+
protected get manifest(): Static<SsrManifestAtomSchema>;
|
|
1730
|
+
/**
|
|
1731
|
+
* Get the base path for assets (from Vite's base config).
|
|
1732
|
+
* Returns empty string if base is "/" (default), otherwise returns the base path.
|
|
1733
|
+
*/
|
|
1734
|
+
protected get base(): string;
|
|
1735
|
+
/**
|
|
1736
|
+
* Get the preload manifest.
|
|
1737
|
+
*/
|
|
1738
|
+
protected get preloadManifest(): PreloadManifest | undefined;
|
|
1739
|
+
/**
|
|
1740
|
+
* Get the client manifest.
|
|
1741
|
+
*/
|
|
1742
|
+
protected get clientManifest(): ClientManifest | undefined;
|
|
1743
|
+
/**
|
|
1744
|
+
* Resolve a preload key to its source path.
|
|
1745
|
+
*
|
|
1746
|
+
* The key is a short hash injected by viteAlephaSsrPreload plugin,
|
|
1747
|
+
* which maps to the full source path in the preload manifest.
|
|
1748
|
+
*
|
|
1749
|
+
* @param key - Short hash key (e.g., "a1b2c3d4")
|
|
1750
|
+
* @returns Source path (e.g., "src/pages/UserDetail.tsx") or undefined
|
|
1751
|
+
*/
|
|
1752
|
+
resolvePreloadKey(key: string): string | undefined;
|
|
1753
|
+
/**
|
|
1754
|
+
* Get all chunks required for a source file, including transitive dependencies.
|
|
1755
|
+
*
|
|
1756
|
+
* Uses the client manifest to recursively resolve all imported chunks.
|
|
1757
|
+
*
|
|
1758
|
+
* @param sourcePath - Source file path (e.g., "src/pages/Home.tsx")
|
|
1759
|
+
* @returns Array of chunk URLs to preload, or empty array if not found
|
|
1760
|
+
*/
|
|
1761
|
+
getChunks(sourcePath: string): string[];
|
|
1762
|
+
/**
|
|
1763
|
+
* Find manifest entry for a source path, trying different extensions.
|
|
1764
|
+
*/
|
|
1765
|
+
protected findManifestEntry(sourcePath: string): {
|
|
1766
|
+
file: string;
|
|
1767
|
+
isEntry?: boolean;
|
|
1768
|
+
imports?: string[];
|
|
1769
|
+
css?: string[];
|
|
1770
|
+
} | undefined;
|
|
1771
|
+
/**
|
|
1772
|
+
* Recursively collect all chunk URLs for a manifest entry.
|
|
1773
|
+
*/
|
|
1774
|
+
protected collectChunksRecursive(key: string, chunks: Set<string>, visited: Set<string>): void;
|
|
1775
|
+
/**
|
|
1776
|
+
* Collect modulepreload links for a route and its parent chain.
|
|
1777
|
+
*/
|
|
1778
|
+
collectPreloadLinks(route: PageRoute): Array<{
|
|
1779
|
+
rel: string;
|
|
1780
|
+
href: string;
|
|
1781
|
+
as?: string;
|
|
1782
|
+
crossorigin?: string;
|
|
1783
|
+
}>;
|
|
1784
|
+
/**
|
|
1785
|
+
* Get all chunks for multiple source files.
|
|
1786
|
+
*
|
|
1787
|
+
* @param sourcePaths - Array of source file paths
|
|
1788
|
+
* @returns Deduplicated array of chunk URLs
|
|
1789
|
+
*/
|
|
1790
|
+
getChunksForMultiple(sourcePaths: string[]): string[];
|
|
1791
|
+
/**
|
|
1792
|
+
* Check if manifest is loaded and available.
|
|
1793
|
+
*/
|
|
1794
|
+
isAvailable(): boolean;
|
|
1795
|
+
/**
|
|
1796
|
+
* Cached entry assets - computed once at first access.
|
|
1797
|
+
*/
|
|
1798
|
+
protected cachedEntryAssets: EntryAssets | null;
|
|
1799
|
+
/**
|
|
1800
|
+
* Get the entry point assets (main entry.js and associated CSS files).
|
|
1801
|
+
*
|
|
1802
|
+
* These assets are always required for all pages and can be preloaded
|
|
1803
|
+
* before page-specific loaders run.
|
|
1804
|
+
*
|
|
1805
|
+
* @returns Entry assets with js and css paths, or null if manifest unavailable
|
|
1806
|
+
*/
|
|
1807
|
+
getEntryAssets(): EntryAssets | null;
|
|
1808
|
+
/**
|
|
1809
|
+
* Build preload link tags for entry assets.
|
|
1810
|
+
*
|
|
1811
|
+
* @returns Array of link objects ready to be rendered
|
|
1812
|
+
*/
|
|
1813
|
+
getEntryPreloadLinks(): Array<{
|
|
1814
|
+
rel: string;
|
|
1815
|
+
href: string;
|
|
1816
|
+
as?: string;
|
|
1817
|
+
crossorigin?: string;
|
|
1818
|
+
}>;
|
|
1819
|
+
}
|
|
1820
|
+
/**
|
|
1821
|
+
* Entry assets structure containing the main entry JS and associated CSS files.
|
|
1822
|
+
*/
|
|
1823
|
+
interface EntryAssets {
|
|
1824
|
+
/** Main entry JavaScript file (e.g., "/assets/entry.abc123.js") */
|
|
1825
|
+
js?: string;
|
|
1826
|
+
/** Associated CSS files (e.g., ["/assets/style.abc123.css"]) */
|
|
1827
|
+
css: string[];
|
|
1828
|
+
}
|
|
1829
|
+
/**
|
|
1830
|
+
* Client manifest structure from Vite.
|
|
1831
|
+
* Only includes fields actually used for preloading.
|
|
1832
|
+
*/
|
|
1833
|
+
interface ClientManifest {
|
|
1834
|
+
[key: string]: {
|
|
1835
|
+
file: string;
|
|
1836
|
+
isEntry?: boolean;
|
|
1837
|
+
imports?: string[];
|
|
1838
|
+
css?: string[];
|
|
1839
|
+
};
|
|
1840
|
+
}
|
|
1841
|
+
/**
|
|
1842
|
+
* Preload manifest mapping short keys to source paths.
|
|
1843
|
+
* Generated by viteAlephaSsrPreload plugin at build time.
|
|
1844
|
+
*/
|
|
1845
|
+
type PreloadManifest = Record<string, string>;
|
|
1846
|
+
//#endregion
|
|
1847
|
+
//#region ../../src/react/router/providers/ReactServerProvider.d.ts
|
|
1848
|
+
/**
|
|
1849
|
+
* React server provider responsible for SSR and static file serving.
|
|
1850
|
+
*
|
|
1851
|
+
* Coordinates between:
|
|
1852
|
+
* - ReactPageProvider: Page routing and layer resolution
|
|
1853
|
+
* - ReactServerTemplateProvider: HTML template parsing and streaming
|
|
1854
|
+
* - ServerHeadProvider: Head content management
|
|
1855
|
+
* - SSRManifestProvider: Module preload link collection
|
|
1856
|
+
*
|
|
1857
|
+
* Uses `react-dom/server` under the hood.
|
|
1858
|
+
*/
|
|
1859
|
+
declare class ReactServerProvider {
|
|
1860
|
+
/**
|
|
1861
|
+
* SSR response headers - pre-allocated to avoid object creation per request.
|
|
1862
|
+
*/
|
|
1863
|
+
protected readonly SSR_HEADERS: {
|
|
1864
|
+
readonly "content-type": "text/html";
|
|
1865
|
+
readonly "cache-control": "no-store, no-cache, must-revalidate, proxy-revalidate";
|
|
1866
|
+
readonly pragma: "no-cache";
|
|
1867
|
+
readonly expires: "0";
|
|
1868
|
+
};
|
|
1869
|
+
protected readonly fs: FileSystemProvider;
|
|
1870
|
+
protected readonly log: alepha_logger2.Logger;
|
|
1871
|
+
protected readonly alepha: Alepha;
|
|
1872
|
+
protected readonly env: {
|
|
1873
|
+
REACT_SSR_ENABLED?: boolean | undefined;
|
|
1874
|
+
};
|
|
1875
|
+
protected readonly pageApi: ReactPageProvider;
|
|
1876
|
+
protected readonly templateProvider: ReactServerTemplateProvider;
|
|
1877
|
+
protected readonly serverHeadProvider: ServerHeadProvider;
|
|
1878
|
+
protected readonly serverStaticProvider: ServerStaticProvider;
|
|
1879
|
+
protected readonly serverRouterProvider: ServerRouterProvider;
|
|
1880
|
+
protected readonly ssrManifestProvider: SSRManifestProvider;
|
|
1881
|
+
/**
|
|
1882
|
+
* Cached check for ServerLinksProvider - avoids has() lookup per request.
|
|
1883
|
+
*/
|
|
1884
|
+
protected hasServerLinksProvider: boolean;
|
|
1885
|
+
protected readonly options: Readonly<{
|
|
1886
|
+
publicDir: string;
|
|
1887
|
+
staticServer: {
|
|
1888
|
+
disabled: boolean;
|
|
1889
|
+
path: string;
|
|
1890
|
+
};
|
|
1891
|
+
}>;
|
|
1892
|
+
/**
|
|
1893
|
+
* Configure the React server provider.
|
|
1894
|
+
*/
|
|
1895
|
+
readonly onConfigure: alepha16.HookPrimitive<"configure">;
|
|
1896
|
+
/**
|
|
1897
|
+
* Get the current HTML template.
|
|
1898
|
+
*/
|
|
1899
|
+
get template(): string;
|
|
1900
|
+
/**
|
|
1901
|
+
* Register all pages as server routes.
|
|
1902
|
+
*/
|
|
1903
|
+
protected registerPages(templateLoader: TemplateLoader): Promise<void>;
|
|
1904
|
+
/**
|
|
1905
|
+
* Set up early head content with entry assets.
|
|
1906
|
+
*
|
|
1907
|
+
* This content is sent immediately when streaming starts, before page loaders run,
|
|
1908
|
+
* allowing the browser to start downloading entry.js and CSS files early.
|
|
1909
|
+
*
|
|
1910
|
+
* Uses <script type="module"> instead of <link rel="modulepreload"> for JS
|
|
1911
|
+
* because the script needs to execute anyway - this way the browser starts
|
|
1912
|
+
* downloading, parsing, AND will execute as soon as ready.
|
|
1913
|
+
*
|
|
1914
|
+
* Also injects critical meta tags (charset, viewport) if not specified in $head,
|
|
1915
|
+
* and strips these assets from the original template head to avoid duplicates.
|
|
1916
|
+
*/
|
|
1917
|
+
protected setupEarlyHeadContent(): void;
|
|
1918
|
+
/**
|
|
1919
|
+
* Get the public directory path where static files are located.
|
|
1920
|
+
*/
|
|
1921
|
+
protected getPublicDirectory(): Promise<string>;
|
|
1922
|
+
/**
|
|
1923
|
+
* Configure the static file server to serve files from the given root directory.
|
|
1924
|
+
*/
|
|
1925
|
+
protected configureStaticServer(root: string): Promise<void>;
|
|
1926
|
+
/**
|
|
1927
|
+
* Create the request handler for a page route.
|
|
1928
|
+
*/
|
|
1929
|
+
protected createHandler(route: PageRoute, templateLoader: TemplateLoader): ServerHandler;
|
|
1930
|
+
/**
|
|
1931
|
+
* Core page rendering logic shared between SSR handler and static prerendering.
|
|
1932
|
+
*
|
|
1933
|
+
* Handles:
|
|
1934
|
+
* - Layer resolution (loaders)
|
|
1935
|
+
* - Redirect detection
|
|
1936
|
+
* - Head content filling
|
|
1937
|
+
* - Preload link collection
|
|
1938
|
+
* - React stream rendering
|
|
1939
|
+
*
|
|
1940
|
+
* @param route - The page route to render
|
|
1941
|
+
* @param state - The router state
|
|
1942
|
+
* @returns Render result with redirect or React stream
|
|
1943
|
+
*/
|
|
1944
|
+
protected renderPage(route: PageRoute, state: ReactRouterState): Promise<{
|
|
1945
|
+
redirect?: string;
|
|
1946
|
+
reactStream?: ReadableStream<Uint8Array>;
|
|
1947
|
+
}>;
|
|
1948
|
+
/**
|
|
1949
|
+
* For testing purposes, renders a page to HTML string.
|
|
1950
|
+
* Uses the same streaming code path as production, then collects to string.
|
|
1951
|
+
*
|
|
1952
|
+
* @param name - Page name to render
|
|
1953
|
+
* @param options - Render options (params, query, html, hydration)
|
|
1954
|
+
*/
|
|
1955
|
+
render(name: string, options?: PagePrimitiveRenderOptions): Promise<PagePrimitiveRenderResult>;
|
|
1956
|
+
/**
|
|
1957
|
+
* Collect a ReadableStream into a string.
|
|
1958
|
+
*/
|
|
1959
|
+
protected streamToString(stream: ReadableStream<Uint8Array>): Promise<string>;
|
|
1960
|
+
}
|
|
1961
|
+
type TemplateLoader = () => Promise<string | undefined>;
|
|
1962
|
+
declare const envSchema: alepha16.TObject<{
|
|
1963
|
+
REACT_SSR_ENABLED: alepha16.TOptional<alepha16.TBoolean>;
|
|
1964
|
+
}>;
|
|
1965
|
+
declare module "alepha" {
|
|
1966
|
+
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
1967
|
+
interface State {
|
|
1968
|
+
"alepha.react.server.ssr"?: boolean;
|
|
1969
|
+
"alepha.react.server.template"?: string;
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
/**
|
|
1973
|
+
* React server provider configuration atom
|
|
1974
|
+
*/
|
|
1975
|
+
declare const reactServerOptions: alepha16.Atom<alepha16.TObject<{
|
|
1976
|
+
publicDir: alepha16.TString;
|
|
1977
|
+
staticServer: alepha16.TObject<{
|
|
1978
|
+
disabled: alepha16.TBoolean;
|
|
1979
|
+
path: alepha16.TString;
|
|
1980
|
+
}>;
|
|
1981
|
+
}>, "alepha.react.server.options">;
|
|
1982
|
+
type ReactServerProviderOptions = Static<typeof reactServerOptions.schema>;
|
|
1983
|
+
declare module "alepha" {
|
|
1984
|
+
interface State {
|
|
1985
|
+
[reactServerOptions.key]: ReactServerProviderOptions;
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
//#endregion
|
|
1989
|
+
//#region ../../src/react/router/index.d.ts
|
|
1990
|
+
declare module "alepha" {
|
|
1991
|
+
interface State {
|
|
1992
|
+
"alepha.react.router.state"?: ReactRouterState;
|
|
1993
|
+
}
|
|
1994
|
+
interface Hooks {
|
|
1995
|
+
/**
|
|
1996
|
+
* Fires when the React application is starting to be rendered on the server.
|
|
1997
|
+
*/
|
|
1998
|
+
"react:server:render:begin": {
|
|
1999
|
+
request?: ServerRequest;
|
|
2000
|
+
state: ReactRouterState;
|
|
2001
|
+
};
|
|
2002
|
+
/**
|
|
2003
|
+
* Fires when the React application has been rendered on the server.
|
|
2004
|
+
*/
|
|
2005
|
+
"react:server:render:end": {
|
|
2006
|
+
request?: ServerRequest;
|
|
2007
|
+
state: ReactRouterState;
|
|
2008
|
+
html: string;
|
|
2009
|
+
};
|
|
2010
|
+
/**
|
|
2011
|
+
* Fires when the React application is being rendered on the browser.
|
|
2012
|
+
*
|
|
2013
|
+
* Note: this one is not really necessary, it's a hack because we need to isolate renderer from server code in order
|
|
2014
|
+
* to avoid including react-dom/client in server bundles.
|
|
2015
|
+
*/
|
|
2016
|
+
"react:browser:render": {
|
|
2017
|
+
root: HTMLElement;
|
|
2018
|
+
element: ReactNode;
|
|
2019
|
+
state: ReactRouterState;
|
|
2020
|
+
hydration?: ReactHydrationState;
|
|
2021
|
+
};
|
|
2022
|
+
/**
|
|
2023
|
+
* Fires when a route transition is starting.
|
|
2024
|
+
*/
|
|
2025
|
+
"react:transition:begin": {
|
|
2026
|
+
previous: ReactRouterState;
|
|
2027
|
+
state: ReactRouterState;
|
|
2028
|
+
animation?: PageAnimation;
|
|
2029
|
+
};
|
|
2030
|
+
/**
|
|
2031
|
+
* Fires when a route transition has succeeded.
|
|
2032
|
+
*/
|
|
2033
|
+
"react:transition:success": {
|
|
2034
|
+
state: ReactRouterState;
|
|
2035
|
+
};
|
|
2036
|
+
/**
|
|
2037
|
+
* Fires when a route transition has failed.
|
|
2038
|
+
*/
|
|
2039
|
+
"react:transition:error": {
|
|
2040
|
+
state: ReactRouterState;
|
|
2041
|
+
error: Error;
|
|
2042
|
+
};
|
|
2043
|
+
/**
|
|
2044
|
+
* Fires when a route transition has completed, regardless of success or failure.
|
|
2045
|
+
*/
|
|
2046
|
+
"react:transition:end": {
|
|
2047
|
+
state: ReactRouterState;
|
|
2048
|
+
};
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
/**
|
|
2052
|
+
* Provides declarative routing with the `$page` primitive for building type-safe React routes.
|
|
2053
|
+
*
|
|
2054
|
+
* This module enables:
|
|
2055
|
+
* - URL pattern matching with parameters (e.g., `/users/:id`)
|
|
2056
|
+
* - Nested routing with parent-child relationships
|
|
2057
|
+
* - Type-safe URL parameter and query string validation
|
|
2058
|
+
* - Server-side data fetching with the `loader` function
|
|
2059
|
+
* - Lazy loading and code splitting
|
|
2060
|
+
* - Page animations and error handling
|
|
2061
|
+
*
|
|
2062
|
+
* @see {@link $page}
|
|
2063
|
+
* @module alepha.react.router
|
|
2064
|
+
*/
|
|
2065
|
+
declare const AlephaReactRouter: alepha16.Service<alepha16.Module>;
|
|
2066
|
+
//#endregion
|
|
2067
|
+
export { $page, AlephaReactRouter, AnchorProps, ClientManifest, ConcretePageRoute, CreateLayersResult, EntryAssets, ErrorHandler, ErrorViewer, HydrationData, Layer, Link, type LinkProps, _default as NestedView, NestedViewProps, NotFound, PAGE_PRELOAD_KEY, PageAnimation, PageConfigSchema, PageLoader, PagePrimitive, PagePrimitiveOptions, PagePrimitiveRenderOptions, PagePrimitiveRenderResult, PageRequestConfig, PageRoute, PageRouteEntry, PreloadManifest, PreviousLayerData, ReactBrowserProvider, ReactBrowserRendererOptions, ReactHydrationState, ReactPageProvider, ReactPageService, ReactRouter, ReactRouterState, ReactServerProvider, ReactServerProviderOptions, ReactServerTemplateProvider, Redirection, type RouterGoOptions, RouterLayerContext, RouterLayerContextValue, RouterRenderOptions, RouterStackItem, SSRManifestProvider, TPropsDefault, TPropsParentDefault, TemplateSlots, TransitionOptions, UseActiveHook, UseActiveOptions, UseQueryParamsHookOptions, VirtualRouter, isPageRoute, reactBrowserOptions, reactServerOptions, useActive, useQueryParams, useRouter, useRouterState };
|
|
2068
|
+
//# sourceMappingURL=index.d.ts.map
|