resuxjs 0.3.11 → 0.4.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -1
- package/dist/bin.d.ts +1 -2
- package/dist/bin.js +5 -0
- package/dist/bin.js.map +1 -1
- package/dist/build/index.d.ts +29 -0
- package/dist/build/index.js +51 -0
- package/dist/build/index.js.map +1 -0
- package/dist/cli.d.ts +19 -8
- package/dist/cli.js +2653 -3688
- package/dist/cli.js.map +1 -1
- package/dist/compiler/adapter.d.ts +19 -15
- package/dist/compiler/adapter.js +69 -93
- package/dist/compiler/adapter.js.map +1 -1
- package/dist/compiler/dev-warnings.d.ts +14 -10
- package/dist/compiler/dev-warnings.js +247 -319
- package/dist/compiler/dev-warnings.js.map +1 -1
- package/dist/compiler/directives.d.ts +7 -3
- package/dist/compiler/directives.js +125 -150
- package/dist/compiler/directives.js.map +1 -1
- package/dist/compiler/implementation.d.ts +117 -112
- package/dist/compiler/implementation.js +2954 -3426
- package/dist/compiler/index.d.ts +19 -15
- package/dist/compiler/index.js +69 -93
- package/dist/compiler/index.js.map +1 -1
- package/dist/core/config.d.ts +19 -10
- package/dist/core/config.js +42 -25
- package/dist/core/config.js.map +1 -1
- package/dist/core/hooks.d.ts +133 -131
- package/dist/core/hooks.js +45 -55
- package/dist/core/hooks.js.map +1 -1
- package/dist/core/index.d.ts +5 -4
- package/dist/core/index.js +6 -5
- package/dist/core/module-container.d.ts +97 -93
- package/dist/core/module-container.js +180 -185
- package/dist/core/module-container.js.map +1 -1
- package/dist/core/resux.d.ts +20 -15
- package/dist/core/resux.js +18 -13
- package/dist/core/resux.js.map +1 -1
- package/dist/create-bin.d.ts +1 -2
- package/dist/create-bin.js +5 -0
- package/dist/create-bin.js.map +1 -1
- package/dist/create.d.ts +6 -2
- package/dist/create.js +496 -638
- package/dist/create.js.map +1 -1
- package/dist/deploy/cloudflare.d.ts +7 -2
- package/dist/deploy/cloudflare.js +31 -34
- package/dist/deploy/cloudflare.js.map +1 -1
- package/dist/deploy/common.d.ts +19 -15
- package/dist/deploy/common.js +119 -188
- package/dist/deploy/common.js.map +1 -1
- package/dist/deploy/framework-runtime.d.ts +5 -1
- package/dist/deploy/framework-runtime.js +44 -48
- package/dist/deploy/framework-runtime.js.map +1 -1
- package/dist/deploy/index.d.ts +8 -3
- package/dist/deploy/index.js +56 -80
- package/dist/deploy/index.js.map +1 -1
- package/dist/deploy/netlify.d.ts +7 -2
- package/dist/deploy/netlify.js +41 -41
- package/dist/deploy/netlify.js.map +1 -1
- package/dist/deploy/node.d.ts +7 -2
- package/dist/deploy/node.js +24 -19
- package/dist/deploy/node.js.map +1 -1
- package/dist/deploy/production-report.d.ts +5 -1
- package/dist/deploy/production-report.js +15 -14
- package/dist/deploy/production-report.js.map +1 -1
- package/dist/deploy/runtime-dependencies.d.ts +8 -4
- package/dist/deploy/runtime-dependencies.js +158 -220
- package/dist/deploy/runtime-dependencies.js.map +1 -1
- package/dist/deploy/static.d.ts +7 -2
- package/dist/deploy/static.js +17 -14
- package/dist/deploy/static.js.map +1 -1
- package/dist/deploy/types.d.ts +33 -29
- package/dist/deploy/types.js +1 -2
- package/dist/deploy/vercel.d.ts +8 -3
- package/dist/deploy/vercel.js +138 -188
- package/dist/deploy/vercel.js.map +1 -1
- package/dist/fonts/index.d.ts +19 -14
- package/dist/fonts/index.js +115 -134
- package/dist/fonts/index.js.map +1 -1
- package/dist/globals.d.ts +79 -78
- package/dist/globals.js +1 -2
- package/dist/halal-core/ai/classifyProject.d.ts +9 -4
- package/dist/halal-core/ai/classifyProject.js +82 -95
- package/dist/halal-core/ai/classifyProject.js.map +1 -1
- package/dist/halal-core/ai/classifyRuntimeContent.d.ts +8 -3
- package/dist/halal-core/ai/classifyRuntimeContent.js +78 -95
- package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
- package/dist/halal-core/ai/createProjectSummary.d.ts +40 -36
- package/dist/halal-core/ai/createProjectSummary.js +39 -39
- package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
- package/dist/halal-core/ai/halalClassifierPrompt.d.ts +5 -1
- package/dist/halal-core/ai/halalClassifierPrompt.js +5 -1
- package/dist/halal-core/ai/halalClassifierPrompt.js.map +1 -1
- package/dist/halal-core/ai/redactSensitiveData.d.ts +5 -1
- package/dist/halal-core/ai/redactSensitiveData.js +82 -110
- package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
- package/dist/halal-core/ai/validateAiResponse.d.ts +7 -2
- package/dist/halal-core/ai/validateAiResponse.js +56 -83
- package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
- package/dist/halal-core/cli/check.d.ts +5 -1
- package/dist/halal-core/cli/check.js +28 -30
- package/dist/halal-core/cli/check.js.map +1 -1
- package/dist/halal-core/cli/explain.d.ts +5 -1
- package/dist/halal-core/cli/explain.js +27 -31
- package/dist/halal-core/cli/explain.js.map +1 -1
- package/dist/halal-core/cli/report.d.ts +5 -1
- package/dist/halal-core/cli/report.js +14 -10
- package/dist/halal-core/cli/report.js.map +1 -1
- package/dist/halal-core/cli/submitReview.d.ts +5 -1
- package/dist/halal-core/cli/submitReview.js +13 -9
- package/dist/halal-core/cli/submitReview.js.map +1 -1
- package/dist/halal-core/cli/verifyReview.d.ts +5 -1
- package/dist/halal-core/cli/verifyReview.js +17 -15
- package/dist/halal-core/cli/verifyReview.js.map +1 -1
- package/dist/halal-core/config.d.ts +39 -35
- package/dist/halal-core/config.js +77 -118
- package/dist/halal-core/config.js.map +1 -1
- package/dist/halal-core/crypto/integrity.d.ts +12 -8
- package/dist/halal-core/crypto/integrity.js +65 -87
- package/dist/halal-core/crypto/integrity.js.map +1 -1
- package/dist/halal-core/enforce.d.ts +9 -5
- package/dist/halal-core/enforce.js +90 -105
- package/dist/halal-core/enforce.js.map +1 -1
- package/dist/halal-core/index.d.ts +20 -16
- package/dist/halal-core/index.js +19 -19
- package/dist/halal-core/lifecycle.d.ts +5 -1
- package/dist/halal-core/lifecycle.js +16 -13
- package/dist/halal-core/lifecycle.js.map +1 -1
- package/dist/halal-core/policy.d.ts +7 -2
- package/dist/halal-core/policy.js +7 -2
- package/dist/halal-core/policy.js.map +1 -1
- package/dist/halal-core/report/formatBrowserOverlay.d.ts +7 -2
- package/dist/halal-core/report/formatBrowserOverlay.js +10 -8
- package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
- package/dist/halal-core/report/formatTerminalReport.d.ts +7 -2
- package/dist/halal-core/report/formatTerminalReport.js +27 -37
- package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
- package/dist/halal-core/report/generateHalalReport.d.ts +11 -6
- package/dist/halal-core/report/generateHalalReport.js +25 -27
- package/dist/halal-core/report/generateHalalReport.js.map +1 -1
- package/dist/halal-core/report/signReport.d.ts +8 -3
- package/dist/halal-core/report/signReport.js +17 -12
- package/dist/halal-core/report/signReport.js.map +1 -1
- package/dist/halal-core/report/verifyReport.d.ts +14 -9
- package/dist/halal-core/report/verifyReport.js +52 -41
- package/dist/halal-core/report/verifyReport.js.map +1 -1
- package/dist/halal-core/review/createReviewRequest.d.ts +7 -2
- package/dist/halal-core/review/createReviewRequest.js +21 -17
- package/dist/halal-core/review/createReviewRequest.js.map +1 -1
- package/dist/halal-core/review/reviewPolicy.d.ts +7 -3
- package/dist/halal-core/review/reviewPolicy.js +19 -17
- package/dist/halal-core/review/reviewPolicy.js.map +1 -1
- package/dist/halal-core/review/signedReviewFile.d.ts +17 -12
- package/dist/halal-core/review/signedReviewFile.js +25 -22
- package/dist/halal-core/review/signedReviewFile.js.map +1 -1
- package/dist/halal-core/review/verifyReviewApproval.d.ts +12 -8
- package/dist/halal-core/review/verifyReviewApproval.js +69 -62
- package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
- package/dist/halal-core/rules/adultContentRules.d.ts +6 -2
- package/dist/halal-core/rules/adultContentRules.js +23 -23
- package/dist/halal-core/rules/adultContentRules.js.map +1 -1
- package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +6 -2
- package/dist/halal-core/rules/alcoholDrugVapeRules.js +22 -22
- package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
- package/dist/halal-core/rules/childSafetyRules.d.ts +6 -2
- package/dist/halal-core/rules/childSafetyRules.js +19 -19
- package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
- package/dist/halal-core/rules/coreCategories.d.ts +10 -6
- package/dist/halal-core/rules/coreCategories.js +237 -110
- package/dist/halal-core/rules/coreCategories.js.map +1 -1
- package/dist/halal-core/rules/cyberAbuseRules.d.ts +6 -2
- package/dist/halal-core/rules/cyberAbuseRules.js +27 -27
- package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
- package/dist/halal-core/rules/defaultBlockedRules.d.ts +24 -19
- package/dist/halal-core/rules/defaultBlockedRules.js +156 -199
- package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
- package/dist/halal-core/rules/dependencyRules.d.ts +11 -7
- package/dist/halal-core/rules/dependencyRules.js +50 -56
- package/dist/halal-core/rules/dependencyRules.js.map +1 -1
- package/dist/halal-core/rules/endpointRules.d.ts +9 -5
- package/dist/halal-core/rules/endpointRules.js +21 -23
- package/dist/halal-core/rules/endpointRules.js.map +1 -1
- package/dist/halal-core/rules/environmentalHarmRules.d.ts +6 -2
- package/dist/halal-core/rules/environmentalHarmRules.js +17 -17
- package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
- package/dist/halal-core/rules/financeRibaRules.d.ts +6 -2
- package/dist/halal-core/rules/financeRibaRules.js +20 -20
- package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
- package/dist/halal-core/rules/gamblingRules.d.ts +6 -2
- package/dist/halal-core/rules/gamblingRules.js +22 -22
- package/dist/halal-core/rules/gamblingRules.js.map +1 -1
- package/dist/halal-core/rules/generalHarmRules.d.ts +6 -2
- package/dist/halal-core/rules/generalHarmRules.js +15 -15
- package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
- package/dist/halal-core/rules/healthHarmRules.d.ts +6 -2
- package/dist/halal-core/rules/healthHarmRules.js +19 -19
- package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
- package/dist/halal-core/rules/keywordRules.d.ts +13 -9
- package/dist/halal-core/rules/keywordRules.js +90 -39
- package/dist/halal-core/rules/keywordRules.js.map +1 -1
- package/dist/halal-core/rules/privacyAbuseRules.d.ts +6 -2
- package/dist/halal-core/rules/privacyAbuseRules.js +21 -21
- package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
- package/dist/halal-core/rules/scamFraudRules.d.ts +6 -2
- package/dist/halal-core/rules/scamFraudRules.js +29 -29
- package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
- package/dist/halal-core/rules/selfHarmRules.d.ts +6 -2
- package/dist/halal-core/rules/selfHarmRules.js +17 -17
- package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
- package/dist/halal-core/rules/violenceExtremismRules.d.ts +6 -2
- package/dist/halal-core/rules/violenceExtremismRules.js +30 -30
- package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
- package/dist/halal-core/runtime/guard.d.ts +22 -17
- package/dist/halal-core/runtime/guard.js +163 -183
- package/dist/halal-core/runtime/guard.js.map +1 -1
- package/dist/halal-core/runtime/index.d.ts +5 -4
- package/dist/halal-core/runtime/index.js +5 -5
- package/dist/halal-core/runtime/reviewedMemory.d.ts +10 -5
- package/dist/halal-core/runtime/reviewedMemory.js +75 -110
- package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
- package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +17 -12
- package/dist/halal-core/runtime/serializeRuntimeContent.js +133 -156
- package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
- package/dist/halal-core/runtime/types.d.ts +55 -50
- package/dist/halal-core/runtime/types.js +1 -2
- package/dist/halal-core/scanner/scanApiRoutes.d.ts +5 -1
- package/dist/halal-core/scanner/scanApiRoutes.js +33 -36
- package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
- package/dist/halal-core/scanner/scanComponents.d.ts +5 -1
- package/dist/halal-core/scanner/scanComponents.js +13 -13
- package/dist/halal-core/scanner/scanComponents.js.map +1 -1
- package/dist/halal-core/scanner/scanContent.d.ts +8 -4
- package/dist/halal-core/scanner/scanContent.js +192 -261
- package/dist/halal-core/scanner/scanContent.js.map +1 -1
- package/dist/halal-core/scanner/scanDependencies.d.ts +5 -1
- package/dist/halal-core/scanner/scanDependencies.js +17 -15
- package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
- package/dist/halal-core/scanner/scanDomains.d.ts +7 -3
- package/dist/halal-core/scanner/scanDomains.js +12 -12
- package/dist/halal-core/scanner/scanDomains.js.map +1 -1
- package/dist/halal-core/scanner/scanEnvNames.d.ts +5 -1
- package/dist/halal-core/scanner/scanEnvNames.js +24 -26
- package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
- package/dist/halal-core/scanner/scanMetadata.d.ts +9 -5
- package/dist/halal-core/scanner/scanMetadata.js +21 -29
- package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
- package/dist/halal-core/scanner/scanPages.d.ts +5 -1
- package/dist/halal-core/scanner/scanPages.js +13 -15
- package/dist/halal-core/scanner/scanPages.js.map +1 -1
- package/dist/halal-core/scanner/scanProject.d.ts +19 -12
- package/dist/halal-core/scanner/scanProject.js +44 -49
- package/dist/halal-core/scanner/scanProject.js.map +1 -1
- package/dist/halal-core/scanner/scanRoutes.d.ts +5 -1
- package/dist/halal-core/scanner/scanRoutes.js +33 -39
- package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
- package/dist/halal-core/scanner/scanTranslations.d.ts +5 -1
- package/dist/halal-core/scanner/scanTranslations.js +22 -29
- package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
- package/dist/halal-core/status.d.ts +17 -13
- package/dist/halal-core/status.js +1 -2
- package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +5 -1
- package/dist/halal-core/tamper/verifyCoreIntegrity.js +27 -24
- package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
- package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +5 -1
- package/dist/halal-core/tamper/verifyLifecycleHooks.js +13 -12
- package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
- package/dist/halal-core/tamper/verifyReportSignature.d.ts +9 -4
- package/dist/halal-core/tamper/verifyReportSignature.js +20 -14
- package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
- package/dist/halal.d.ts +20 -1
- package/dist/halal.js +19 -2
- package/dist/i18n/index.d.ts +44 -40
- package/dist/i18n/index.js +218 -288
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/shared.d.ts +33 -29
- package/dist/i18n/shared.js +204 -266
- package/dist/i18n/shared.js.map +1 -1
- package/dist/icons/index.d.ts +160 -154
- package/dist/icons/index.js +323 -273
- package/dist/icons/index.js.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +8 -2
- package/dist/kit/index.d.ts +32 -27
- package/dist/kit/index.js +46 -43
- package/dist/kit/index.js.map +1 -1
- package/dist/nitro-server/index.d.ts +10 -6
- package/dist/nitro-server/index.js +6 -2
- package/dist/nitro-server/index.js.map +1 -1
- package/dist/node.d.ts +9 -4
- package/dist/node.js +89 -116
- package/dist/node.js.map +1 -1
- package/dist/reactivity/computed.d.ts +11 -6
- package/dist/reactivity/computed.js +46 -53
- package/dist/reactivity/computed.js.map +1 -1
- package/dist/reactivity/effect.d.ts +23 -18
- package/dist/reactivity/effect.js +105 -147
- package/dist/reactivity/effect.js.map +1 -1
- package/dist/reactivity/index.d.ts +8 -8
- package/dist/reactivity/index.js +8 -8
- package/dist/reactivity/reactive.d.ts +9 -5
- package/dist/reactivity/reactive.js +95 -134
- package/dist/reactivity/reactive.js.map +1 -1
- package/dist/reactivity/readonly.d.ts +2 -1
- package/dist/reactivity/readonly.js +3 -2
- package/dist/reactivity/ref.d.ts +23 -21
- package/dist/reactivity/ref.js +71 -81
- package/dist/reactivity/ref.js.map +1 -1
- package/dist/reactivity/scheduler.d.ts +8 -5
- package/dist/reactivity/scheduler.js +67 -69
- package/dist/reactivity/scheduler.js.map +1 -1
- package/dist/reactivity/types.d.ts +29 -25
- package/dist/reactivity/types.js +1 -2
- package/dist/reactivity/utils.d.ts +17 -13
- package/dist/reactivity/utils.js +25 -24
- package/dist/reactivity/utils.js.map +1 -1
- package/dist/reactivity/watch.d.ts +8 -4
- package/dist/reactivity/watch.js +74 -103
- package/dist/reactivity/watch.js.map +1 -1
- package/dist/runtime/core.d.ts +32 -0
- package/dist/runtime/core.js +155 -0
- package/dist/runtime/core.js.map +1 -0
- package/dist/runtime/index.d.ts +649 -622
- package/dist/runtime/index.js +4105 -5243
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/reactivity.d.ts +7 -0
- package/dist/runtime/reactivity.js +7 -0
- package/dist/runtime/resume.d.ts +80 -0
- package/dist/runtime/resume.js +482 -0
- package/dist/runtime/resume.js.map +1 -0
- package/dist/runtime/router.d.ts +21 -0
- package/dist/runtime/router.js +60 -0
- package/dist/runtime/router.js.map +1 -0
- package/dist/runtime/streaming.d.ts +25 -0
- package/dist/runtime/streaming.js +200 -0
- package/dist/runtime/streaming.js.map +1 -0
- package/dist/security/media-fetch.d.ts +33 -0
- package/dist/security/media-fetch.js +302 -0
- package/dist/security/media-fetch.js.map +1 -0
- package/dist/security/path-boundary.d.ts +8 -0
- package/dist/security/path-boundary.js +71 -0
- package/dist/security/path-boundary.js.map +1 -0
- package/dist/ui/index.d.ts +1774 -1768
- package/dist/ui/index.js +974 -674
- package/dist/ui/index.js.map +1 -1
- package/dist/vite-builder/index.d.ts +9 -5
- package/dist/vite-builder/index.js +6 -2
- package/dist/vite-builder/index.js.map +1 -1
- package/package.json +46 -86
- package/dist/compiler/implementation.js.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/deploy/types.js.map +0 -1
- package/dist/globals.js.map +0 -1
- package/dist/halal-core/index.js.map +0 -1
- package/dist/halal-core/runtime/index.js.map +0 -1
- package/dist/halal-core/runtime/types.js.map +0 -1
- package/dist/halal-core/status.js.map +0 -1
- package/dist/halal.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/reactivity/index.js.map +0 -1
- package/dist/reactivity/readonly.js.map +0 -1
- package/dist/reactivity/types.js.map +0 -1
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,651 +1,678 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ComputedRef, MaybeRef, MaybeRefOrGetter, ReactiveEffectOptions, ReactiveEffectRunner, Ref, WatchCallback, WatchOptions, WatchSource, WatchStopHandle } from "../reactivity/types.js";
|
|
2
|
+
import { isRef, ref, toRef, toRefs, unref } from "../reactivity/ref.js";
|
|
3
|
+
import { isReactive, isReadonly, reactive, readonly } from "../reactivity/reactive.js";
|
|
4
|
+
import { computed } from "../reactivity/computed.js";
|
|
5
|
+
import { watch, watchEffect } from "../reactivity/watch.js";
|
|
6
|
+
import { nextTick } from "../reactivity/scheduler.js";
|
|
7
|
+
|
|
8
|
+
//#region src/runtime/index.d.ts
|
|
9
|
+
type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
10
|
+
[key: string]: JsonValue;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
expiresIn?: number | string;
|
|
107
|
-
ttl?: number | string;
|
|
12
|
+
interface AsyncDataError {
|
|
13
|
+
name: string;
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
interface ResuxError extends Error {
|
|
17
|
+
statusCode?: number;
|
|
18
|
+
fatal?: boolean;
|
|
19
|
+
data?: JsonValue;
|
|
20
|
+
}
|
|
21
|
+
interface AsyncDataResource<T = unknown> {
|
|
22
|
+
data: Ref<T | undefined>;
|
|
23
|
+
value: Ref<T | undefined>;
|
|
24
|
+
pending: Ref<boolean>;
|
|
25
|
+
error: Ref<AsyncDataError | null>;
|
|
26
|
+
then<TResult1 = AwaitedAsyncDataResource<T>, TResult2 = never>(onfulfilled?: ((value: AwaitedAsyncDataResource<T>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
|
|
27
|
+
}
|
|
28
|
+
interface AwaitedAsyncDataResource<T = unknown> {
|
|
29
|
+
data: Ref<T | undefined>;
|
|
30
|
+
value: Ref<T | undefined>;
|
|
31
|
+
pending: Ref<boolean>;
|
|
32
|
+
error: Ref<AsyncDataError | null>;
|
|
33
|
+
}
|
|
34
|
+
interface AsyncDataHandlerContext {
|
|
35
|
+
signal?: AbortSignal;
|
|
36
|
+
}
|
|
37
|
+
interface RouteContext {
|
|
38
|
+
path: string;
|
|
39
|
+
params: Record<string, string>;
|
|
40
|
+
query: Record<string, string | string[]>;
|
|
41
|
+
origin?: string;
|
|
42
|
+
userAgent?: string;
|
|
43
|
+
}
|
|
44
|
+
interface ResuxRouter {
|
|
45
|
+
push(to: string): Promise<void> | void;
|
|
46
|
+
replace(to: string): Promise<void> | void;
|
|
47
|
+
back(): void;
|
|
48
|
+
forward(): void;
|
|
49
|
+
go(delta: number): void;
|
|
50
|
+
}
|
|
51
|
+
interface PageMeta {
|
|
52
|
+
layout?: string | false;
|
|
53
|
+
middleware?: string | string[];
|
|
54
|
+
title?: string | Record<string, string>;
|
|
55
|
+
meta?: Array<Record<string, string>>;
|
|
56
|
+
}
|
|
57
|
+
interface HeadEntry {
|
|
58
|
+
title?: string;
|
|
59
|
+
meta?: Array<Record<string, string>>;
|
|
60
|
+
link?: Array<Record<string, string>>;
|
|
61
|
+
style?: ComponentStyle[];
|
|
62
|
+
htmlAttrs?: Record<string, string>;
|
|
63
|
+
}
|
|
64
|
+
interface ComponentStyle {
|
|
65
|
+
id: string;
|
|
66
|
+
css: string;
|
|
67
|
+
scoped?: boolean;
|
|
68
|
+
}
|
|
69
|
+
type SeoMetaValue = string | number | boolean | null | undefined;
|
|
70
|
+
interface SeoMetaInput {
|
|
71
|
+
title?: SeoMetaValue;
|
|
72
|
+
description?: SeoMetaValue | SeoMetaValue[];
|
|
73
|
+
keywords?: SeoMetaValue | SeoMetaValue[];
|
|
74
|
+
robots?: SeoMetaValue;
|
|
75
|
+
author?: SeoMetaValue;
|
|
76
|
+
themeColor?: SeoMetaValue;
|
|
77
|
+
colorScheme?: SeoMetaValue;
|
|
78
|
+
applicationName?: SeoMetaValue;
|
|
79
|
+
referrer?: SeoMetaValue;
|
|
80
|
+
generator?: SeoMetaValue;
|
|
81
|
+
ogTitle?: SeoMetaValue;
|
|
82
|
+
ogDescription?: SeoMetaValue;
|
|
83
|
+
ogImage?: SeoMetaValue | SeoMetaValue[];
|
|
84
|
+
ogImageSecureUrl?: SeoMetaValue;
|
|
85
|
+
ogImageAlt?: SeoMetaValue;
|
|
86
|
+
ogImageWidth?: SeoMetaValue;
|
|
87
|
+
ogImageHeight?: SeoMetaValue;
|
|
88
|
+
ogUrl?: SeoMetaValue;
|
|
89
|
+
ogType?: SeoMetaValue;
|
|
90
|
+
ogSiteName?: SeoMetaValue;
|
|
91
|
+
ogLocale?: SeoMetaValue;
|
|
92
|
+
fbAppId?: SeoMetaValue;
|
|
93
|
+
twitterCard?: SeoMetaValue;
|
|
94
|
+
twitterTitle?: SeoMetaValue;
|
|
95
|
+
twitterDescription?: SeoMetaValue;
|
|
96
|
+
twitterImage?: SeoMetaValue | SeoMetaValue[];
|
|
97
|
+
twitterImageAlt?: SeoMetaValue;
|
|
98
|
+
twitterSite?: SeoMetaValue;
|
|
99
|
+
twitterCreator?: SeoMetaValue;
|
|
100
|
+
twitterUrl?: SeoMetaValue;
|
|
101
|
+
[key: string]: SeoMetaValue | SeoMetaValue[];
|
|
102
|
+
}
|
|
103
|
+
interface RuntimeConfig {
|
|
104
|
+
public: Record<string, JsonValue>;
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
}
|
|
107
|
+
type ResuxImageFit = "cover" | "contain" | "fill" | "inside" | "outside";
|
|
108
|
+
type ResuxImageCacheInput = boolean | string | number | {
|
|
109
|
+
maxAge?: number | string;
|
|
110
|
+
expiresIn?: number | string;
|
|
111
|
+
ttl?: number | string;
|
|
108
112
|
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
113
|
+
interface ResuxImageModifiers {
|
|
114
|
+
width?: number;
|
|
115
|
+
height?: number;
|
|
116
|
+
quality?: number | false;
|
|
117
|
+
format?: string | false;
|
|
118
|
+
fit?: ResuxImageFit;
|
|
119
|
+
[key: string]: string | number | boolean | undefined;
|
|
120
|
+
}
|
|
121
|
+
interface ResuxImageProviderConfig {
|
|
122
|
+
baseURL?: string;
|
|
123
|
+
modifiers?: ResuxImageModifiers;
|
|
124
|
+
}
|
|
125
|
+
interface ResuxImageConfig {
|
|
126
|
+
provider?: string;
|
|
127
|
+
quality?: number;
|
|
128
|
+
format?: string;
|
|
129
|
+
cache?: ResuxImageCacheInput;
|
|
130
|
+
densities?: number[];
|
|
131
|
+
providers?: Record<string, ResuxImageProviderConfig>;
|
|
132
|
+
}
|
|
133
|
+
interface UseResuxImageOptions {
|
|
134
|
+
provider?: string;
|
|
135
|
+
modifiers?: ResuxImageModifiers;
|
|
136
|
+
width?: number;
|
|
137
|
+
height?: number;
|
|
138
|
+
quality?: number;
|
|
139
|
+
fit?: ResuxImageFit;
|
|
140
|
+
format?: string;
|
|
141
|
+
cache?: ResuxImageCacheInput;
|
|
142
|
+
}
|
|
143
|
+
type ResuxImageBuilder = (src: string, options?: UseResuxImageOptions) => string;
|
|
144
|
+
interface ResuxAppInjections {}
|
|
145
|
+
type ResuxSupportMode = "all" | "server" | "client";
|
|
146
|
+
interface ClientPluginManifestRecord {
|
|
147
|
+
id: string;
|
|
148
|
+
file: string;
|
|
149
|
+
mode: ResuxSupportMode;
|
|
150
|
+
src: string;
|
|
151
|
+
}
|
|
152
|
+
interface ClientRouteMiddlewareManifestRecord {
|
|
153
|
+
id: string;
|
|
154
|
+
name: string;
|
|
155
|
+
file: string;
|
|
156
|
+
global: boolean;
|
|
157
|
+
mode: ResuxSupportMode;
|
|
158
|
+
src: string;
|
|
159
|
+
}
|
|
160
|
+
type ResuxAppProvides = ResuxAppInjections & Record<string, unknown>;
|
|
161
|
+
interface ResuxAppLike {
|
|
162
|
+
route: RouteContext;
|
|
163
|
+
payload: ResuxPayload;
|
|
164
|
+
$config: RuntimeConfig;
|
|
165
|
+
provides: ResuxAppProvides;
|
|
166
|
+
provide<Key extends keyof ResuxAppInjections & string>(key: Key, value: ResuxAppInjections[Key]): void;
|
|
167
|
+
provide<Key extends string, Value>(key: Key, value: Value): void;
|
|
168
|
+
vueApp?: any;
|
|
169
|
+
}
|
|
170
|
+
type ResuxPlugin = (resuxApp: ResuxAppLike) => unknown | Promise<unknown>;
|
|
171
|
+
interface ResuxModuleContext {
|
|
172
|
+
rootDir: string;
|
|
173
|
+
buildDir: string;
|
|
174
|
+
options: Record<string, unknown>;
|
|
175
|
+
addCss(href: string): void;
|
|
176
|
+
addHead(head: Record<string, unknown>): void;
|
|
177
|
+
addRouteRule(path: string, rule: Record<string, unknown>): void;
|
|
178
|
+
extendRuntimeConfig(config: Record<string, unknown>): void;
|
|
179
|
+
hook(name: string, handler: (payload: unknown) => void | Promise<void>): () => void;
|
|
180
|
+
addComponent(component: string | {
|
|
145
181
|
file: string;
|
|
146
|
-
|
|
182
|
+
name?: string;
|
|
183
|
+
global?: boolean;
|
|
184
|
+
mode?: ResuxSupportMode;
|
|
185
|
+
lazy?: boolean;
|
|
186
|
+
}): void;
|
|
187
|
+
addComponentsDir(dir: string | {
|
|
188
|
+
path: string;
|
|
189
|
+
global?: boolean;
|
|
190
|
+
mode?: ResuxSupportMode;
|
|
191
|
+
pathPrefix?: boolean;
|
|
192
|
+
}): void;
|
|
193
|
+
addImports(imports: {
|
|
194
|
+
from: string;
|
|
195
|
+
name: string;
|
|
196
|
+
as?: string;
|
|
197
|
+
} | Array<{
|
|
198
|
+
from: string;
|
|
199
|
+
name: string;
|
|
200
|
+
as?: string;
|
|
201
|
+
}>): void;
|
|
202
|
+
addImportsDir(dir: string): void;
|
|
203
|
+
addPlugin(plugin: string | {
|
|
147
204
|
src: string;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
205
|
+
mode?: ResuxSupportMode;
|
|
206
|
+
}): void;
|
|
207
|
+
addRouteMiddleware(middleware: {
|
|
151
208
|
name: string;
|
|
152
|
-
file: string;
|
|
153
|
-
global: boolean;
|
|
154
|
-
mode: ResuxSupportMode;
|
|
155
209
|
src: string;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}): void;
|
|
190
|
-
addImports(imports: {
|
|
191
|
-
from: string;
|
|
192
|
-
name: string;
|
|
193
|
-
as?: string;
|
|
194
|
-
} | Array<{
|
|
195
|
-
from: string;
|
|
196
|
-
name: string;
|
|
197
|
-
as?: string;
|
|
198
|
-
}>): void;
|
|
199
|
-
addImportsDir(dir: string): void;
|
|
200
|
-
addPlugin(plugin: string | {
|
|
201
|
-
src: string;
|
|
202
|
-
mode?: ResuxSupportMode;
|
|
203
|
-
}): void;
|
|
204
|
-
addRouteMiddleware(middleware: {
|
|
205
|
-
name: string;
|
|
206
|
-
src: string;
|
|
207
|
-
global?: boolean;
|
|
208
|
-
mode?: ResuxSupportMode;
|
|
209
|
-
}): void;
|
|
210
|
-
addServerHandler(handler: {
|
|
211
|
-
route: string;
|
|
212
|
-
handler: string;
|
|
213
|
-
middleware?: boolean;
|
|
214
|
-
method?: string;
|
|
215
|
-
}): void;
|
|
216
|
-
addServerPlugin(plugin: string): void;
|
|
217
|
-
addTemplate(template: {
|
|
218
|
-
filename: string;
|
|
219
|
-
getContents: () => string | Promise<string>;
|
|
220
|
-
write?: boolean;
|
|
221
|
-
}): void;
|
|
222
|
-
addTypeTemplate(template: {
|
|
223
|
-
filename: string;
|
|
224
|
-
getContents: () => string | Promise<string>;
|
|
225
|
-
write?: boolean;
|
|
226
|
-
}): void;
|
|
227
|
-
extendPages(extender: (pages: Array<Record<string, unknown>>) => void | Promise<void>): void;
|
|
228
|
-
extendViteConfig(extender: (config: Record<string, unknown>) => void | Promise<void>): void;
|
|
229
|
-
extendNitroConfig(extender: (config: Record<string, unknown>) => void | Promise<void>): void;
|
|
230
|
-
addVitePlugin(plugin: unknown): void;
|
|
231
|
-
addPrerenderRoutes(route: string | string[]): void;
|
|
232
|
-
}
|
|
233
|
-
export type ResuxModule<TOptions = Record<string, unknown>> = ((options: TOptions, context: ResuxModuleContext) => unknown | Promise<unknown>) | {
|
|
234
|
-
meta?: {
|
|
235
|
-
name?: string;
|
|
236
|
-
configKey?: string;
|
|
237
|
-
};
|
|
238
|
-
defaults?: TOptions;
|
|
239
|
-
setup: (options: TOptions, context: ResuxModuleContext) => unknown | Promise<unknown>;
|
|
210
|
+
global?: boolean;
|
|
211
|
+
mode?: ResuxSupportMode;
|
|
212
|
+
}): void;
|
|
213
|
+
addServerHandler(handler: {
|
|
214
|
+
route: string;
|
|
215
|
+
handler: string;
|
|
216
|
+
middleware?: boolean;
|
|
217
|
+
method?: string;
|
|
218
|
+
}): void;
|
|
219
|
+
addServerPlugin(plugin: string): void;
|
|
220
|
+
addTemplate(template: {
|
|
221
|
+
filename: string;
|
|
222
|
+
getContents: () => string | Promise<string>;
|
|
223
|
+
write?: boolean;
|
|
224
|
+
}): void;
|
|
225
|
+
addTypeTemplate(template: {
|
|
226
|
+
filename: string;
|
|
227
|
+
getContents: () => string | Promise<string>;
|
|
228
|
+
write?: boolean;
|
|
229
|
+
}): void;
|
|
230
|
+
extendPages(extender: (pages: Array<Record<string, unknown>>) => void | Promise<void>): void;
|
|
231
|
+
extendViteConfig(extender: (config: Record<string, unknown>) => void | Promise<void>): void;
|
|
232
|
+
extendNitroConfig(extender: (config: Record<string, unknown>) => void | Promise<void>): void;
|
|
233
|
+
addVitePlugin(plugin: unknown): void;
|
|
234
|
+
addPrerenderRoutes(route: string | string[]): void;
|
|
235
|
+
}
|
|
236
|
+
type ResuxModule<TOptions = Record<string, unknown>> = ((options: TOptions, context: ResuxModuleContext) => unknown | Promise<unknown>) | {
|
|
237
|
+
meta?: {
|
|
238
|
+
name?: string;
|
|
239
|
+
configKey?: string;
|
|
240
|
+
};
|
|
241
|
+
defaults?: TOptions;
|
|
242
|
+
setup: (options: TOptions, context: ResuxModuleContext) => unknown | Promise<unknown>;
|
|
240
243
|
};
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
244
|
+
type ResuxDeployTarget = "auto" | "node" | "vercel" | "netlify" | "cloudflare" | "static";
|
|
245
|
+
interface ResuxDeployOptions {
|
|
246
|
+
target?: ResuxDeployTarget;
|
|
247
|
+
nitroPreset?: string;
|
|
248
|
+
}
|
|
249
|
+
interface ResuxConfigInput extends Record<string, unknown> {
|
|
250
|
+
builder?: string;
|
|
251
|
+
serverBuilder?: string;
|
|
252
|
+
buildDir?: string;
|
|
253
|
+
compatibilityDate?: string;
|
|
254
|
+
deploy?: ResuxDeployOptions;
|
|
255
|
+
i18n?: Record<string, unknown>;
|
|
256
|
+
packages?: ResuxPackagesConfig;
|
|
257
|
+
video?: Record<string, unknown>;
|
|
258
|
+
}
|
|
259
|
+
interface ResuxPackageCssMap {
|
|
260
|
+
[packageName: string]: string[];
|
|
261
|
+
}
|
|
262
|
+
type ResuxPackageMode = "ssr" | "clientOnly" | "serverOnly" | "progressive";
|
|
263
|
+
interface ResuxPackageModeMap {
|
|
264
|
+
[packageName: string]: ResuxPackageMode;
|
|
265
|
+
}
|
|
266
|
+
interface ResuxPackagesConfig {
|
|
267
|
+
lazy?: boolean | string[];
|
|
268
|
+
clientOnly?: string[];
|
|
269
|
+
serverOnly?: string[];
|
|
270
|
+
mode?: ResuxPackageModeMap;
|
|
271
|
+
external?: string[];
|
|
272
|
+
noExternal?: string[];
|
|
273
|
+
transpile?: string[];
|
|
274
|
+
optimizeDeps?: string[];
|
|
275
|
+
css?: string[] | ResuxPackageCssMap;
|
|
276
|
+
aliases?: Record<string, string>;
|
|
277
|
+
guards?: boolean;
|
|
278
|
+
diagnostics?: boolean;
|
|
279
|
+
}
|
|
280
|
+
interface ResuxClientPackageImportRegistry {
|
|
281
|
+
importers?: string[];
|
|
282
|
+
css?: Record<string, string[]>;
|
|
283
|
+
declared?: string[];
|
|
284
|
+
}
|
|
285
|
+
interface ClientRuntimeSourceOptions {
|
|
286
|
+
packageRegistry?: ResuxClientPackageImportRegistry;
|
|
287
|
+
}
|
|
288
|
+
interface ResuxLazyPackageOptions {
|
|
289
|
+
clientOnly?: boolean;
|
|
290
|
+
mode?: ResuxPackageMode;
|
|
291
|
+
css?: string[];
|
|
292
|
+
exportName?: string;
|
|
293
|
+
preferDefault?: boolean;
|
|
294
|
+
}
|
|
295
|
+
type ResuxLazyPackageLoader<T = unknown> = () => Promise<T>;
|
|
296
|
+
type ClientEnhancementTrigger = "visible" | "interaction" | "idle" | "immediate" | "manual" | "page-load";
|
|
297
|
+
interface ClientEnhancementContext {
|
|
298
|
+
trigger: ClientEnhancementTrigger;
|
|
299
|
+
options?: Record<string, unknown>;
|
|
300
|
+
__resux?: {
|
|
295
301
|
trigger: ClientEnhancementTrigger;
|
|
296
302
|
options?: Record<string, unknown>;
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
export type RouteMiddlewareResult = void | string | false | {
|
|
325
|
-
redirect: string | {
|
|
326
|
-
to: string;
|
|
327
|
-
statusCode?: number;
|
|
328
|
-
};
|
|
329
|
-
} | {
|
|
330
|
-
type: "redirect";
|
|
303
|
+
};
|
|
304
|
+
[key: string]: unknown;
|
|
305
|
+
}
|
|
306
|
+
type ClientEnhancementSetup = (target: Element, context: ClientEnhancementContext) => void | (() => void | Promise<void>) | Promise<void | (() => void | Promise<void>)>;
|
|
307
|
+
interface UseClientEnhancementOptions {
|
|
308
|
+
target?: Element | string;
|
|
309
|
+
trigger?: ClientEnhancementTrigger;
|
|
310
|
+
options?: Record<string, unknown>;
|
|
311
|
+
}
|
|
312
|
+
interface PackageAdapterContext {
|
|
313
|
+
packageName: string;
|
|
314
|
+
mode: ResuxPackageMode;
|
|
315
|
+
modules: unknown[];
|
|
316
|
+
}
|
|
317
|
+
interface PackageAdapterDefinition<TOptions extends Record<string, unknown> = Record<string, unknown>> {
|
|
318
|
+
name: string;
|
|
319
|
+
packageName?: string;
|
|
320
|
+
mode?: ResuxPackageMode;
|
|
321
|
+
imports?: string[];
|
|
322
|
+
css?: string[];
|
|
323
|
+
defaults?: TOptions;
|
|
324
|
+
validateOptions?: (options: TOptions) => void;
|
|
325
|
+
enhance: (target: Element, options: TOptions, context: PackageAdapterContext) => void | (() => void | Promise<void>) | Promise<void | (() => void | Promise<void>)>;
|
|
326
|
+
}
|
|
327
|
+
type RouteMiddlewareResult = void | string | false | {
|
|
328
|
+
redirect: string | {
|
|
331
329
|
to: string;
|
|
332
330
|
statusCode?: number;
|
|
331
|
+
};
|
|
333
332
|
} | {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
333
|
+
type: "redirect";
|
|
334
|
+
to: string;
|
|
335
|
+
statusCode?: number;
|
|
336
|
+
} | {
|
|
337
|
+
type: "abort";
|
|
338
|
+
message?: string;
|
|
339
|
+
statusCode?: number;
|
|
337
340
|
};
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
|
|
341
|
+
type ResuxRouteMiddleware = (to: RouteContext, from: RouteContext) => RouteMiddlewareResult | Promise<RouteMiddlewareResult>;
|
|
342
|
+
interface EventHandlerEvent {
|
|
343
|
+
path: string;
|
|
344
|
+
method: string;
|
|
345
|
+
query: Record<string, string | string[]>;
|
|
346
|
+
params: Record<string, string>;
|
|
347
|
+
node: {
|
|
348
|
+
req: unknown;
|
|
349
|
+
res: unknown;
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
type EventHandler = (event: EventHandlerEvent) => unknown | Promise<unknown>;
|
|
353
|
+
type ServerMiddlewareResult = unknown | Promise<unknown>;
|
|
354
|
+
type ServerMiddleware = (event: EventHandlerEvent) => ServerMiddlewareResult;
|
|
355
|
+
type TemplateNode = TextTemplateNode | InterpolationTemplateNode | ElementTemplateNode;
|
|
356
|
+
interface TextTemplateNode {
|
|
357
|
+
type: "text";
|
|
358
|
+
value: string;
|
|
359
|
+
}
|
|
360
|
+
interface InterpolationTemplateNode {
|
|
361
|
+
type: "interpolation";
|
|
362
|
+
expression: string;
|
|
363
|
+
bindingId: string;
|
|
364
|
+
}
|
|
365
|
+
interface TemplateAttribute {
|
|
366
|
+
kind: "static" | "dynamic";
|
|
367
|
+
name: string;
|
|
368
|
+
value: string;
|
|
369
|
+
bindingId?: string;
|
|
370
|
+
}
|
|
371
|
+
interface TemplateEvent {
|
|
372
|
+
name: string;
|
|
373
|
+
handler: string;
|
|
374
|
+
modifiers?: string[];
|
|
375
|
+
/** Template-local bindings captured by an inline resumable handler. */
|
|
376
|
+
locals?: string[];
|
|
377
|
+
}
|
|
378
|
+
interface IfDirective {
|
|
379
|
+
expression: string;
|
|
380
|
+
blockId: string;
|
|
381
|
+
}
|
|
382
|
+
interface ForDirective {
|
|
383
|
+
source: string;
|
|
384
|
+
value: string;
|
|
385
|
+
index?: string;
|
|
386
|
+
blockId: string;
|
|
387
|
+
}
|
|
388
|
+
interface HtmlDirective {
|
|
389
|
+
expression: string;
|
|
390
|
+
bindingId: string;
|
|
391
|
+
}
|
|
392
|
+
interface ElementTemplateNode {
|
|
393
|
+
type: "element";
|
|
394
|
+
tag: string;
|
|
395
|
+
attrs: TemplateAttribute[];
|
|
396
|
+
events: TemplateEvent[];
|
|
397
|
+
children: TemplateNode[];
|
|
398
|
+
if?: IfDirective;
|
|
399
|
+
for?: ForDirective;
|
|
400
|
+
html?: HtmlDirective;
|
|
401
|
+
}
|
|
402
|
+
interface SetupContext {
|
|
403
|
+
props: Record<string, unknown>;
|
|
404
|
+
ref: typeof ref;
|
|
405
|
+
reactive: typeof reactive;
|
|
406
|
+
computed: typeof computed;
|
|
407
|
+
watch<T = unknown>(source: WatchSource<T> | WatchSource<T>[], callback: WatchCallback<T>, options?: WatchOptions): WatchStopHandle;
|
|
408
|
+
watchEffect(effect: (onCleanup: (cleanup: () => void) => void) => void, options?: WatchOptions): WatchStopHandle;
|
|
409
|
+
readonly: typeof readonly;
|
|
410
|
+
toRef: typeof toRef;
|
|
411
|
+
toRefs: typeof toRefs;
|
|
412
|
+
unref: typeof unref;
|
|
413
|
+
isRef: typeof isRef;
|
|
414
|
+
isReactive: typeof isReactive;
|
|
415
|
+
isReadonly: typeof isReadonly;
|
|
416
|
+
nextTick: typeof nextTick;
|
|
417
|
+
useState<T>(key: string, factory?: () => T): Ref<T>;
|
|
418
|
+
useGlobalState<T>(key: string, factory?: () => T): Ref<T>;
|
|
419
|
+
useAsyncData<T>(key: string, handler?: (context: AsyncDataHandlerContext) => T | Promise<T>): AsyncDataResource<T>;
|
|
420
|
+
defineProps<T extends Record<string, unknown> = Record<string, unknown>>(): T;
|
|
421
|
+
defineEmits<T = (...args: any[]) => void>(emits?: unknown): (...args: any[]) => void;
|
|
422
|
+
emit(...args: any[]): void;
|
|
423
|
+
defineExpose(exposed?: Record<string, any>): void;
|
|
424
|
+
defineSlots<T = Record<string, any>>(): T;
|
|
425
|
+
defineOptions(options?: Record<string, any>): void;
|
|
426
|
+
defineModel<T>(name?: string, options?: unknown): Ref<T>;
|
|
427
|
+
useRoute(): RouteContext;
|
|
428
|
+
useRouter(): ResuxRouter;
|
|
429
|
+
useHead(input: HeadEntry): void;
|
|
430
|
+
useSeoMeta(input: SeoMetaInput): void;
|
|
431
|
+
useRuntimeConfig(): RuntimeConfig;
|
|
432
|
+
useResuxApp(): ResuxAppLike;
|
|
433
|
+
apiURL(path: string): string;
|
|
434
|
+
useResuxImage(): ResuxImageBuilder;
|
|
435
|
+
useFetch<T>(url: string, init?: RequestInit): AsyncDataResource<T>;
|
|
436
|
+
$fetch<T>(url: string, init?: RequestInit): Promise<T>;
|
|
437
|
+
useError(): Ref<ResuxError | null>;
|
|
438
|
+
clearError(): void;
|
|
439
|
+
showError(input: string | Partial<ResuxError>): never;
|
|
440
|
+
createError(input: string | Partial<ResuxError>): ResuxError;
|
|
441
|
+
useLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): Promise<T>;
|
|
442
|
+
useClientPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): Promise<T>;
|
|
443
|
+
usePackageReady(name: string): boolean;
|
|
444
|
+
defineLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): ResuxLazyPackageLoader<T>;
|
|
445
|
+
defineClientOnlyPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): ResuxLazyPackageLoader<T>;
|
|
446
|
+
definePackageAdapter<TOptions extends Record<string, unknown> = Record<string, unknown>>(definition: PackageAdapterDefinition<TOptions>): {
|
|
364
447
|
name: string;
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
export interface TemplateEvent {
|
|
369
|
-
name: string;
|
|
370
|
-
handler: string;
|
|
371
|
-
modifiers?: string[];
|
|
372
|
-
/** Template-local bindings captured by an inline resumable handler. */
|
|
373
|
-
locals?: string[];
|
|
374
|
-
}
|
|
375
|
-
export interface IfDirective {
|
|
376
|
-
expression: string;
|
|
377
|
-
blockId: string;
|
|
378
|
-
}
|
|
379
|
-
export interface ForDirective {
|
|
380
|
-
source: string;
|
|
381
|
-
value: string;
|
|
382
|
-
index?: string;
|
|
383
|
-
blockId: string;
|
|
384
|
-
}
|
|
385
|
-
export interface HtmlDirective {
|
|
386
|
-
expression: string;
|
|
387
|
-
bindingId: string;
|
|
388
|
-
}
|
|
389
|
-
export interface ElementTemplateNode {
|
|
390
|
-
type: "element";
|
|
391
|
-
tag: string;
|
|
392
|
-
attrs: TemplateAttribute[];
|
|
393
|
-
events: TemplateEvent[];
|
|
394
|
-
children: TemplateNode[];
|
|
395
|
-
if?: IfDirective;
|
|
396
|
-
for?: ForDirective;
|
|
397
|
-
html?: HtmlDirective;
|
|
398
|
-
}
|
|
399
|
-
export interface SetupContext {
|
|
400
|
-
props: Record<string, unknown>;
|
|
401
|
-
ref: typeof ref;
|
|
402
|
-
reactive: typeof reactive;
|
|
403
|
-
computed: typeof computed;
|
|
404
|
-
watch<T = unknown>(source: WatchSource<T> | WatchSource<T>[], callback: WatchCallback<T>, options?: WatchOptions): WatchStopHandle;
|
|
405
|
-
watchEffect(effect: (onCleanup: (cleanup: () => void) => void) => void, options?: WatchOptions): WatchStopHandle;
|
|
406
|
-
readonly: typeof readonly;
|
|
407
|
-
toRef: typeof toRef;
|
|
408
|
-
toRefs: typeof toRefs;
|
|
409
|
-
unref: typeof unref;
|
|
410
|
-
isRef: typeof isRef;
|
|
411
|
-
isReactive: typeof isReactive;
|
|
412
|
-
isReadonly: typeof isReadonly;
|
|
413
|
-
nextTick: typeof nextTick;
|
|
414
|
-
useState<T>(key: string, factory?: () => T): Ref<T>;
|
|
415
|
-
useGlobalState<T>(key: string, factory?: () => T): Ref<T>;
|
|
416
|
-
useAsyncData<T>(key: string, handler?: (context: AsyncDataHandlerContext) => T | Promise<T>): AsyncDataResource<T>;
|
|
417
|
-
defineProps<T extends Record<string, unknown> = Record<string, unknown>>(): T;
|
|
418
|
-
defineEmits<T = (...args: any[]) => void>(emits?: unknown): (...args: any[]) => void;
|
|
419
|
-
emit(...args: any[]): void;
|
|
420
|
-
defineExpose(exposed?: Record<string, any>): void;
|
|
421
|
-
defineSlots<T = Record<string, any>>(): T;
|
|
422
|
-
defineOptions(options?: Record<string, any>): void;
|
|
423
|
-
defineModel<T>(name?: string, options?: unknown): Ref<T>;
|
|
424
|
-
useRoute(): RouteContext;
|
|
425
|
-
useRouter(): ResuxRouter;
|
|
426
|
-
useHead(input: HeadEntry): void;
|
|
427
|
-
useSeoMeta(input: SeoMetaInput): void;
|
|
428
|
-
useRuntimeConfig(): RuntimeConfig;
|
|
429
|
-
useResuxApp(): ResuxAppLike;
|
|
430
|
-
apiURL(path: string): string;
|
|
431
|
-
useResuxImage(): ResuxImageBuilder;
|
|
432
|
-
useFetch<T>(url: string, init?: RequestInit): AsyncDataResource<T>;
|
|
433
|
-
$fetch<T>(url: string, init?: RequestInit): Promise<T>;
|
|
434
|
-
useError(): Ref<ResuxError | null>;
|
|
435
|
-
clearError(): void;
|
|
436
|
-
showError(input: string | Partial<ResuxError>): never;
|
|
437
|
-
createError(input: string | Partial<ResuxError>): ResuxError;
|
|
438
|
-
useLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): Promise<T>;
|
|
439
|
-
useClientPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): Promise<T>;
|
|
440
|
-
usePackageReady(name: string): boolean;
|
|
441
|
-
defineLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): ResuxLazyPackageLoader<T>;
|
|
442
|
-
defineClientOnlyPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): ResuxLazyPackageLoader<T>;
|
|
443
|
-
definePackageAdapter<TOptions extends Record<string, unknown> = Record<string, unknown>>(definition: PackageAdapterDefinition<TOptions>): {
|
|
444
|
-
name: string;
|
|
445
|
-
setup: ClientEnhancementSetup;
|
|
446
|
-
};
|
|
447
|
-
defineClientEnhancement(name: string, setup: ClientEnhancementSetup): {
|
|
448
|
-
name: string;
|
|
449
|
-
setup: ClientEnhancementSetup;
|
|
450
|
-
};
|
|
451
|
-
useClientEnhancement(name: string, options?: UseClientEnhancementOptions): Promise<{
|
|
452
|
-
ready: boolean;
|
|
453
|
-
activate: () => Promise<void>;
|
|
454
|
-
dispose: () => Promise<void>;
|
|
455
|
-
}>;
|
|
456
|
-
onMounted(callback: () => unknown | Promise<unknown>): void;
|
|
457
|
-
definePageMeta(_meta: PageMeta): void;
|
|
458
|
-
useI18n(): any;
|
|
459
|
-
useLocalePath(): any;
|
|
460
|
-
useSwitchLocalePath(): any;
|
|
461
|
-
useDevice(): DeviceInfo;
|
|
462
|
-
$device: DeviceInfo;
|
|
463
|
-
$t(key: string, params?: Record<string, unknown>): string;
|
|
464
|
-
$tm(key: string): unknown;
|
|
465
|
-
}
|
|
466
|
-
export interface ComponentDefinition {
|
|
467
|
-
id: string;
|
|
448
|
+
setup: ClientEnhancementSetup;
|
|
449
|
+
};
|
|
450
|
+
defineClientEnhancement(name: string, setup: ClientEnhancementSetup): {
|
|
468
451
|
name: string;
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
452
|
+
setup: ClientEnhancementSetup;
|
|
453
|
+
};
|
|
454
|
+
useClientEnhancement(name: string, options?: UseClientEnhancementOptions): Promise<{
|
|
455
|
+
ready: boolean;
|
|
456
|
+
activate: () => Promise<void>;
|
|
457
|
+
dispose: () => Promise<void>;
|
|
458
|
+
}>;
|
|
459
|
+
onMounted(callback: () => unknown | Promise<unknown>): void;
|
|
460
|
+
definePageMeta(_meta: PageMeta): void;
|
|
461
|
+
useI18n(): any;
|
|
462
|
+
useLocalePath(): any;
|
|
463
|
+
useSwitchLocalePath(): any;
|
|
464
|
+
useDevice(): DeviceInfo;
|
|
465
|
+
$device: DeviceInfo;
|
|
466
|
+
$t(key: string, params?: Record<string, unknown>): string;
|
|
467
|
+
$tm(key: string): unknown;
|
|
468
|
+
}
|
|
469
|
+
interface ComponentDefinition {
|
|
470
|
+
id: string;
|
|
471
|
+
name: string;
|
|
472
|
+
file: string;
|
|
473
|
+
script: (ctx: SetupContext) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
474
|
+
template: TemplateNode[];
|
|
475
|
+
handlers: string[];
|
|
476
|
+
styles?: ComponentStyle[];
|
|
477
|
+
styleScopeId?: string;
|
|
478
|
+
meta?: PageMeta;
|
|
479
|
+
}
|
|
480
|
+
interface SerializedScope {
|
|
481
|
+
id: string;
|
|
482
|
+
moduleId: string;
|
|
483
|
+
props?: Record<string, JsonValue>;
|
|
484
|
+
state: Record<string, JsonValue>;
|
|
485
|
+
globalStateKeys?: string[];
|
|
486
|
+
asyncData: Record<string, SerializedAsyncData>;
|
|
487
|
+
}
|
|
488
|
+
interface SerializedAsyncData {
|
|
489
|
+
value: JsonValue;
|
|
490
|
+
pending: boolean;
|
|
491
|
+
error: AsyncDataError | null;
|
|
492
|
+
}
|
|
493
|
+
interface ResuxPayload {
|
|
494
|
+
route: RouteContext;
|
|
495
|
+
scopes: Record<string, SerializedScope>;
|
|
496
|
+
globalState?: Record<string, JsonValue>;
|
|
497
|
+
modules: Record<string, string>;
|
|
498
|
+
vueIslands?: Record<string, string>;
|
|
499
|
+
config?: RuntimeConfig;
|
|
500
|
+
plugins?: ClientPluginManifestRecord[];
|
|
501
|
+
middleware?: ClientRouteMiddlewareManifestRecord[];
|
|
502
|
+
pageMeta?: PageMeta;
|
|
503
|
+
}
|
|
504
|
+
interface RouteRecord {
|
|
505
|
+
id: string;
|
|
506
|
+
path: string;
|
|
507
|
+
file: string;
|
|
508
|
+
params: string[];
|
|
509
|
+
component: ComponentDefinition;
|
|
510
|
+
match(pathname: string): Record<string, string> | null;
|
|
511
|
+
}
|
|
512
|
+
interface RenderAppOptions {
|
|
513
|
+
app?: ComponentDefinition;
|
|
514
|
+
page: ComponentDefinition;
|
|
515
|
+
pageProps?: Record<string, unknown>;
|
|
516
|
+
pageMeta?: PageMeta;
|
|
517
|
+
route: RouteContext;
|
|
518
|
+
components?: Record<string, ComponentDefinition>;
|
|
519
|
+
layouts?: Record<string, ComponentDefinition>;
|
|
520
|
+
modules?: Record<string, string>;
|
|
521
|
+
vueIslands?: Record<string, string>;
|
|
522
|
+
runtimeConfig?: RuntimeConfig;
|
|
523
|
+
appHead?: HeadEntry;
|
|
524
|
+
plugins?: ResuxPlugin[];
|
|
525
|
+
}
|
|
526
|
+
interface RenderResult {
|
|
527
|
+
html: string;
|
|
528
|
+
payload: ResuxPayload;
|
|
529
|
+
head: HeadEntry;
|
|
530
|
+
}
|
|
531
|
+
interface RenderDocumentOptions {
|
|
532
|
+
devReload?: boolean;
|
|
533
|
+
isStatic?: boolean;
|
|
531
534
|
}
|
|
532
535
|
interface RenderTemplateContext {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
536
|
+
scope: Record<string, unknown>;
|
|
537
|
+
scopeId: string;
|
|
538
|
+
moduleId: string;
|
|
539
|
+
styleScopeId?: string;
|
|
540
|
+
route: RouteContext;
|
|
541
|
+
runtimeConfig: RuntimeConfig;
|
|
542
|
+
components: Record<string, ComponentDefinition>;
|
|
543
|
+
layouts: Record<string, ComponentDefinition>;
|
|
544
|
+
pageMeta: PageMeta;
|
|
545
|
+
addHeadEntry?: (entry: HeadEntry) => void;
|
|
546
|
+
renderPage?: () => Promise<string>;
|
|
547
|
+
renderSlot?: () => Promise<string>;
|
|
548
|
+
renderLayout?: (name: string | false | undefined, slot: () => Promise<string>) => Promise<string>;
|
|
546
549
|
}
|
|
547
550
|
type ComponentProps = Record<string, unknown>;
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
551
|
+
declare function defineComponent(definition: ComponentDefinition): ComponentDefinition;
|
|
552
|
+
declare function defineResuxConfig<T extends ResuxConfigInput>(config: T): T;
|
|
553
|
+
declare function defineResuxModule<TOptions = Record<string, unknown>>(module: ResuxModule<TOptions>): ResuxModule<TOptions>;
|
|
554
|
+
declare function defineResuxPlugin(plugin: ResuxPlugin): ResuxPlugin;
|
|
555
|
+
declare function defineResuxRouteMiddleware(middleware: ResuxRouteMiddleware): ResuxRouteMiddleware;
|
|
556
|
+
declare function useResuxApp(): ResuxAppLike;
|
|
557
|
+
interface DeviceInfo {
|
|
558
|
+
isMobile: boolean;
|
|
559
|
+
isTablet: boolean;
|
|
560
|
+
isDesktop: boolean;
|
|
561
|
+
isIos: boolean;
|
|
562
|
+
isAndroid: boolean;
|
|
563
|
+
[key: string]: boolean;
|
|
564
|
+
}
|
|
565
|
+
declare function parseUserAgent(ua?: string): DeviceInfo;
|
|
566
|
+
declare function useDevice(): DeviceInfo;
|
|
567
|
+
declare function useRoute(): RouteContext;
|
|
568
|
+
declare function useRouter(): ResuxRouter;
|
|
569
|
+
declare function useRuntimeConfig(): RuntimeConfig;
|
|
570
|
+
declare function useResuxImage(): ResuxImageBuilder;
|
|
571
|
+
declare function navigateTo(to: string, options?: {
|
|
572
|
+
statusCode?: number;
|
|
570
573
|
}): RouteMiddlewareResult;
|
|
571
|
-
|
|
572
|
-
|
|
574
|
+
declare function abortNavigation(message?: string, options?: {
|
|
575
|
+
statusCode?: number;
|
|
573
576
|
}): RouteMiddlewareResult;
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
577
|
+
declare function createError(input: string | Partial<ResuxError>): ResuxError;
|
|
578
|
+
declare function useError(): Ref<ResuxError | null>;
|
|
579
|
+
declare function showError(input: string | Partial<ResuxError>): never;
|
|
580
|
+
declare function clearError(): void;
|
|
581
|
+
declare function useLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): Promise<T>;
|
|
582
|
+
declare function useClientPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): Promise<T>;
|
|
583
|
+
declare function usePackageReady(name: string): boolean;
|
|
584
|
+
declare function defineLazyPackage<T = unknown>(name: string, options?: ResuxLazyPackageOptions): ResuxLazyPackageLoader<T>;
|
|
585
|
+
declare function defineClientOnlyPackage<T = unknown>(name: string, options?: Omit<ResuxLazyPackageOptions, "clientOnly" | "mode">): ResuxLazyPackageLoader<T>;
|
|
586
|
+
declare function definePackageAdapter<TOptions extends Record<string, unknown> = Record<string, unknown>>(definition: PackageAdapterDefinition<TOptions>): {
|
|
587
|
+
name: string;
|
|
588
|
+
setup: ClientEnhancementSetup;
|
|
586
589
|
};
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
+
declare function defineClientEnhancement(name: string, setup: ClientEnhancementSetup): {
|
|
591
|
+
name: string;
|
|
592
|
+
setup: ClientEnhancementSetup;
|
|
590
593
|
};
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
594
|
+
declare function useClientEnhancement(name: string, options?: UseClientEnhancementOptions): Promise<{
|
|
595
|
+
ready: boolean;
|
|
596
|
+
activate: () => Promise<void>;
|
|
597
|
+
dispose: () => Promise<void>;
|
|
595
598
|
}>;
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
599
|
+
declare function disposeClientEnhancements(): Promise<void>;
|
|
600
|
+
declare function hasClientEnhancement(name: string): boolean;
|
|
601
|
+
declare function getClientEnhancement(name: string): ClientEnhancementSetup | undefined;
|
|
602
|
+
declare function scanClientEnhancements(root?: ParentNode): Promise<void>;
|
|
603
|
+
declare function defineEventHandler(handler: EventHandler): EventHandler;
|
|
604
|
+
declare const eventHandler: typeof defineEventHandler;
|
|
605
|
+
declare function defineServerMiddleware(middleware: ServerMiddleware): ServerMiddleware;
|
|
606
|
+
declare function readBody<T = unknown>(event: EventHandlerEvent): Promise<T>;
|
|
607
|
+
declare function getQuery(event: EventHandlerEvent): Record<string, string | string[]>;
|
|
608
|
+
declare function setHeader(event: EventHandlerEvent, name: string, value: number | string | string[]): void;
|
|
609
|
+
declare function renderApp(options: RenderAppOptions): Promise<RenderResult>;
|
|
610
|
+
type ResuxClientBootMode = "none" | "interaction" | "eager";
|
|
611
|
+
interface ResuxClientBootPlan {
|
|
612
|
+
mode: ResuxClientBootMode;
|
|
613
|
+
eventNames: string[];
|
|
614
|
+
deferEnhancements: boolean;
|
|
615
|
+
deferVueIslands: boolean;
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Plans the smallest browser boot path needed by a server-rendered document.
|
|
619
|
+
*
|
|
620
|
+
* - `none`: HTML is already complete; ship no Resux client payload or runtime.
|
|
621
|
+
* - `interaction`: ship only the tiny resume bootstrap. It waits for a
|
|
622
|
+
* resumable event or a declared enhancement/island trigger before importing
|
|
623
|
+
* the full browser runtime.
|
|
624
|
+
* - `eager`: preserve startup semantics for work that must begin immediately
|
|
625
|
+
* (pending data, plugins/middleware, immediate islands/enhancements, and
|
|
626
|
+
* managed media).
|
|
627
|
+
*/
|
|
628
|
+
declare function getClientRuntimeBootPlan(result: RenderResult): ResuxClientBootPlan;
|
|
629
|
+
/** Returns whether a document needs any Resux browser execution. */
|
|
630
|
+
declare function shouldLoadClientRuntime(result: RenderResult): boolean;
|
|
631
|
+
declare function renderDocument(result: RenderResult, title?: string, options?: RenderDocumentOptions): string;
|
|
632
|
+
declare function createServerSetupContext(route: RouteContext, props: ComponentProps, stateRefs: Record<string, Ref<unknown>>, asyncDataRefs: Record<string, AsyncDataResource<unknown>>, headEntries: HeadEntry[], resuxApp: ResuxAppLike, runtimeConfig: RuntimeConfig, globalStateRefs?: Record<string, Ref<unknown>>, globalStateKeys?: Set<string>): SetupContext;
|
|
633
|
+
declare function renderTemplateNodesAsync(nodes: TemplateNode[], context: RenderTemplateContext, renderComponent: (component: ComponentDefinition, props?: ComponentProps, renderSlot?: () => Promise<string>) => Promise<string>, locals?: Record<string, unknown>): Promise<string>;
|
|
634
|
+
declare class AsyncResuxRenderer {
|
|
635
|
+
private readonly route;
|
|
636
|
+
private readonly components;
|
|
637
|
+
private readonly modules;
|
|
638
|
+
private readonly vueIslands;
|
|
639
|
+
private readonly layouts;
|
|
640
|
+
private readonly pageMeta;
|
|
641
|
+
private readonly runtimeConfig;
|
|
642
|
+
private nextScopeId;
|
|
643
|
+
private readonly scopes;
|
|
644
|
+
private readonly globalStateRefs;
|
|
645
|
+
private readonly styleIds;
|
|
646
|
+
readonly headEntries: HeadEntry[];
|
|
647
|
+
readonly resuxApp: ResuxAppLike;
|
|
648
|
+
constructor(route: RouteContext, components: Record<string, ComponentDefinition>, modules: Record<string, string>, vueIslands?: Record<string, string>, layouts?: Record<string, ComponentDefinition>, pageMeta?: PageMeta, runtimeConfig?: RuntimeConfig);
|
|
649
|
+
renderComponent(definition: ComponentDefinition, renderPage?: () => Promise<string>, renderSlot?: () => Promise<string>, props?: ComponentProps): Promise<string>;
|
|
650
|
+
private collectComponentStyles;
|
|
651
|
+
renderLayout(name: string | false | undefined, renderSlot: () => Promise<string>): Promise<string>;
|
|
652
|
+
createPayload(): ResuxPayload;
|
|
653
|
+
}
|
|
654
|
+
declare function renderAppAsync(options: RenderAppOptions): Promise<RenderResult>;
|
|
655
|
+
declare function evaluateExpression(expression: string, scope: Record<string, unknown>, locals?: Record<string, unknown>): unknown;
|
|
632
656
|
type ClientPatch = {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
657
|
+
type: "text";
|
|
658
|
+
id: string;
|
|
659
|
+
value: string;
|
|
636
660
|
} | {
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
661
|
+
type: "attr";
|
|
662
|
+
id: string;
|
|
663
|
+
attr: string;
|
|
664
|
+
value: string;
|
|
641
665
|
} | {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
666
|
+
type: "html";
|
|
667
|
+
id: string;
|
|
668
|
+
value: string;
|
|
645
669
|
} | {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
670
|
+
type: "block";
|
|
671
|
+
id: string;
|
|
672
|
+
value: string;
|
|
649
673
|
};
|
|
650
|
-
|
|
651
|
-
|
|
674
|
+
declare function renderClientPatches(template: TemplateNode[], scope: Record<string, unknown>, scopeId: string, styleScopeId?: string): ClientPatch[];
|
|
675
|
+
declare function getClientRuntimeSource(options?: ClientRuntimeSourceOptions): string;
|
|
676
|
+
//#endregion
|
|
677
|
+
export { AsyncDataError, AsyncDataHandlerContext, AsyncDataResource, AsyncResuxRenderer, AwaitedAsyncDataResource, ClientEnhancementContext, ClientEnhancementSetup, ClientEnhancementTrigger, ClientPluginManifestRecord, ClientRouteMiddlewareManifestRecord, ClientRuntimeSourceOptions, ComponentDefinition, ComponentStyle, type ComputedRef, DeviceInfo, ElementTemplateNode, EventHandler, EventHandlerEvent, ForDirective, HeadEntry, HtmlDirective, IfDirective, InterpolationTemplateNode, JsonValue, type MaybeRef, type MaybeRefOrGetter, PackageAdapterContext, PackageAdapterDefinition, PageMeta, type ReactiveEffectOptions, type ReactiveEffectRunner, type Ref, RenderAppOptions, RenderDocumentOptions, RenderResult, ResuxAppInjections, ResuxAppLike, ResuxAppProvides, ResuxClientBootMode, ResuxClientBootPlan, ResuxClientPackageImportRegistry, ResuxConfigInput, ResuxDeployOptions, ResuxDeployTarget, ResuxError, ResuxImageBuilder, ResuxImageCacheInput, ResuxImageConfig, ResuxImageFit, ResuxImageModifiers, ResuxImageProviderConfig, ResuxLazyPackageLoader, ResuxLazyPackageOptions, ResuxModule, ResuxModuleContext, ResuxPackageCssMap, ResuxPackageMode, ResuxPackageModeMap, ResuxPackagesConfig, ResuxPayload, ResuxPlugin, ResuxRouteMiddleware, ResuxRouter, ResuxSupportMode, RouteContext, RouteMiddlewareResult, RouteRecord, RuntimeConfig, SeoMetaInput, SeoMetaValue, SerializedAsyncData, SerializedScope, ServerMiddleware, ServerMiddlewareResult, SetupContext, TemplateAttribute, TemplateEvent, TemplateNode, TextTemplateNode, UseClientEnhancementOptions, UseResuxImageOptions, type WatchCallback, type WatchOptions, type WatchSource, type WatchStopHandle, abortNavigation, clearError, computed, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, isReactive, isReadonly, isRef, navigateTo, nextTick, parseUserAgent, reactive, readBody, readonly, ref, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, toRef, toRefs, unref, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig, watch, watchEffect };
|
|
678
|
+
//# sourceMappingURL=index.d.ts.map
|