@stacksjs/stx 0.2.0 → 0.2.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/dist/a11y.d.ts +109 -5
- package/dist/analytics.d.ts +40 -0
- package/dist/animation.d.ts +90 -0
- package/dist/app.d.ts +51 -0
- package/dist/ast.d.ts +286 -0
- package/dist/async-components.d.ts +101 -0
- package/dist/auth.d.ts +1 -3
- package/dist/browser-composables.d.ts +314 -0
- package/dist/build-optimizer.d.ts +126 -0
- package/dist/build-views.d.ts +37 -0
- package/dist/bundle-analyzer/collector.d.ts +66 -0
- package/dist/bundle-analyzer/index.d.ts +60 -0
- package/dist/bundle-analyzer/report.d.ts +39 -0
- package/dist/bundle-analyzer/treemap.d.ts +19 -0
- package/dist/bundle-analyzer.js +499 -0
- package/dist/caching.d.ts +7 -0
- package/dist/cli.js +10880 -1199
- package/dist/client/directive.d.ts +10 -0
- package/dist/client/index.d.ts +7 -0
- package/dist/client/router.d.ts +36 -0
- package/dist/client/stx-router.browser.d.ts +0 -0
- package/dist/client-script.d.ts +22 -0
- package/dist/component-hmr.d.ts +120 -0
- package/dist/components.d.ts +23 -1
- package/dist/composables/index.d.ts +277 -0
- package/dist/composables/use-battery.d.ts +46 -0
- package/dist/composables/use-broadcast-channel.d.ts +58 -0
- package/dist/composables/use-clipboard.d.ts +34 -0
- package/dist/composables/use-cookie.d.ts +70 -0
- package/dist/composables/use-device-orientation.d.ts +109 -0
- package/dist/composables/use-event-source.d.ts +77 -0
- package/dist/composables/use-eye-dropper.d.ts +107 -0
- package/dist/composables/use-fetch.d.ts +84 -0
- package/dist/composables/use-fullscreen.d.ts +47 -0
- package/dist/composables/use-geolocation.d.ts +62 -0
- package/dist/composables/use-idle.d.ts +84 -0
- package/dist/composables/use-intersection-observer.d.ts +81 -0
- package/dist/composables/use-keyboard.d.ts +100 -0
- package/dist/composables/use-media-query.d.ts +56 -0
- package/dist/composables/use-mouse.d.ts +64 -0
- package/dist/composables/use-mutation-observer.d.ts +101 -0
- package/dist/composables/use-network.d.ts +40 -0
- package/dist/composables/use-notification.d.ts +89 -0
- package/dist/composables/use-permissions.d.ts +109 -0
- package/dist/composables/use-resize-observer.d.ts +60 -0
- package/dist/composables/use-share.d.ts +70 -0
- package/dist/composables/use-speech.d.ts +117 -0
- package/dist/composables/use-storage.d.ts +64 -0
- package/dist/composables/use-text-selection.d.ts +97 -0
- package/dist/composables/use-wake-lock.d.ts +85 -0
- package/dist/composables/use-websocket.d.ts +69 -0
- package/dist/composables/use-window.d.ts +84 -0
- package/dist/composables.d.ts +268 -0
- package/dist/composition-api.d.ts +190 -0
- package/dist/computed.d.ts +137 -0
- package/dist/conditionals.d.ts +14 -2
- package/dist/config.d.ts +35 -2
- package/dist/craft-bridge.d.ts +319 -0
- package/dist/craft-compiler.d.ts +229 -0
- package/dist/craft-components.d.ts +411 -0
- package/dist/craft-entry.d.ts +5 -0
- package/dist/craft-ssr.d.ts +134 -0
- package/dist/craft.js +1553 -0
- package/dist/csp.d.ts +229 -0
- package/dist/database.d.ts +407 -0
- package/dist/database.js +5 -0
- package/dist/defer.d.ts +4 -0
- package/dist/deploy/config-generators.d.ts +75 -0
- package/dist/deploy/index.d.ts +84 -0
- package/dist/deploy/netlify.d.ts +109 -0
- package/dist/dev-server/crosswind.d.ts +54 -0
- package/dist/dev-server/index.d.ts +7 -0
- package/dist/dev-server/keyboard-shortcuts.d.ts +34 -0
- package/dist/dev-server/native-window.d.ts +40 -0
- package/dist/dev-server/port-utils.d.ts +27 -0
- package/dist/dev-server/terminal-colors.d.ts +60 -0
- package/dist/dev-server/theme-selector.d.ts +32 -0
- package/dist/dev-server/types.d.ts +92 -0
- package/dist/dev-server.d.ts +21 -0
- package/dist/devtools.d.ts +142 -0
- package/dist/directive-api.d.ts +111 -0
- package/dist/dynamic-components.d.ts +14 -0
- package/dist/edge-runtime.d.ts +200 -0
- package/dist/env.d.ts +9 -0
- package/dist/error-boundaries.d.ts +71 -0
- package/dist/error-handling.d.ts +1 -101
- package/dist/errors/codes.d.ts +99 -0
- package/dist/errors/formatter.d.ts +64 -0
- package/dist/errors/index.d.ts +56 -0
- package/dist/errors/logger.d.ts +74 -0
- package/dist/errors/sanitizer.d.ts +43 -0
- package/dist/errors/types.d.ts +79 -0
- package/dist/events.d.ts +106 -0
- package/dist/expressions.d.ts +86 -11
- package/dist/forms-validation.d.ts +173 -0
- package/dist/forms.d.ts +157 -8
- package/dist/head.d.ts +225 -0
- package/dist/heatmap.d.ts +125 -0
- package/dist/hot-reload.d.ts +87 -0
- package/dist/hydration-runtime.d.ts +47 -0
- package/dist/hydration.d.ts +161 -0
- package/dist/i18n.d.ts +239 -3
- package/dist/image-optimization/build-plugin.d.ts +53 -0
- package/dist/image-optimization/component.d.ts +46 -0
- package/dist/image-optimization/directive.d.ts +30 -0
- package/dist/image-optimization/index.d.ts +86 -0
- package/dist/image-optimization/processor.d.ts +112 -0
- package/dist/includes.d.ts +94 -9
- package/dist/index.d.ts +63 -3
- package/dist/index.js +11603 -1318
- package/dist/init.d.ts +32 -2
- package/dist/interactive.d.ts +14 -0
- package/dist/internal-markdown.d.ts +22 -0
- package/dist/jsx-runtime.d.ts +110 -0
- package/dist/keep-alive.d.ts +87 -0
- package/dist/lazy-loader.d.ts +122 -0
- package/dist/loading-indicator.d.ts +40 -0
- package/dist/loops.d.ts +22 -1
- package/dist/media/client/blur-up.d.ts +65 -0
- package/dist/media/client/index.d.ts +77 -0
- package/dist/media/client/lazy-load.d.ts +73 -0
- package/dist/media/client/upload-handler.d.ts +79 -0
- package/dist/media/image/component.d.ts +46 -0
- package/dist/media/image/directive.d.ts +9 -0
- package/dist/media/image/editing.d.ts +212 -0
- package/dist/media/image/index.d.ts +118 -0
- package/dist/media/image/placeholder.d.ts +78 -0
- package/dist/media/image/processor/cache.d.ts +32 -0
- package/dist/media/image/processor/index.d.ts +12 -0
- package/dist/media/image/processor/optimizer.d.ts +13 -0
- package/dist/media/image/processor/responsive.d.ts +17 -0
- package/dist/media/image/srcset.d.ts +158 -0
- package/dist/media/index.d.ts +295 -0
- package/dist/media/manager/embed.d.ts +25 -0
- package/dist/media/protected/component.d.ts +34 -0
- package/dist/media/protected/index.d.ts +34 -0
- package/dist/media/protected/signature.d.ts +72 -0
- package/dist/media/shared/cache.d.ts +54 -0
- package/dist/media/shared/hash.d.ts +24 -0
- package/dist/media/shared/index.d.ts +2 -0
- package/dist/media/types.d.ts +1051 -0
- package/dist/media/upload/component.d.ts +23 -0
- package/dist/media/upload/index.d.ts +1 -0
- package/dist/media/video/directive.d.ts +9 -0
- package/dist/media/video/index.d.ts +47 -0
- package/dist/media/video/processor/cache.d.ts +33 -0
- package/dist/media/video/processor/index.d.ts +21 -0
- package/dist/media/video/processor/streaming.d.ts +19 -0
- package/dist/media/video/processor/thumbnail.d.ts +28 -0
- package/dist/media/video/processor/transcoder.d.ts +9 -0
- package/dist/middleware.d.ts +42 -3
- package/dist/native-build.d.ts +74 -0
- package/dist/parser/directive-parser.d.ts +79 -0
- package/dist/parser/expression-parser.d.ts +59 -0
- package/dist/parser/index.d.ts +35 -0
- package/dist/parser/tokenizer.d.ts +81 -0
- package/dist/partial-hydration.d.ts +88 -0
- package/dist/performance-utils.d.ts +146 -3
- package/dist/plugin-system.d.ts +128 -0
- package/dist/precompiler.d.ts +108 -0
- package/dist/production-build.d.ts +199 -0
- package/dist/props.d.ts +199 -0
- package/dist/pwa/audit.d.ts +42 -0
- package/dist/pwa/directives.d.ts +29 -0
- package/dist/pwa/icons.d.ts +39 -0
- package/dist/pwa/index.d.ts +59 -0
- package/dist/pwa/inject.d.ts +22 -0
- package/dist/pwa/manifest.d.ts +104 -0
- package/dist/pwa/offline.d.ts +8 -0
- package/dist/pwa/precache.d.ts +29 -0
- package/dist/pwa/service-worker.d.ts +21 -0
- package/dist/pwa/workbox-strategies.d.ts +100 -0
- package/dist/pwa/workbox.d.ts +52 -0
- package/dist/pwa.d.ts +51 -0
- package/dist/pwa.js +8124 -0
- package/dist/reactive-bindings.d.ts +24 -0
- package/dist/reactive.d.ts +100 -0
- package/dist/reactivity.d.ts +253 -0
- package/dist/route-middleware.d.ts +232 -0
- package/dist/router.d.ts +31 -0
- package/dist/routes.d.ts +0 -7
- package/dist/runtime.d.ts +140 -0
- package/dist/safe-evaluator.d.ts +117 -3
- package/dist/scaffolding.d.ts +113 -0
- package/dist/seo.d.ts +120 -7
- package/dist/server-components.d.ts +134 -0
- package/dist/signals.d.ts +501 -0
- package/dist/slots.d.ts +63 -0
- package/dist/source-maps.d.ts +117 -0
- package/dist/ssg.d.ts +157 -0
- package/dist/ssg.js +6831 -0
- package/dist/ssr.d.ts +107 -0
- package/dist/state-management.d.ts +324 -0
- package/dist/stores-client.d.ts +70 -0
- package/dist/story/addons.d.ts +123 -0
- package/dist/story/analytics.d.ts +92 -0
- package/dist/story/auto-stories.d.ts +38 -0
- package/dist/story/bookmarks.d.ts +53 -0
- package/dist/story/bun-test.d.ts +44 -0
- package/dist/story/cli.d.ts +34 -0
- package/dist/story/collect/analyzer.d.ts +33 -0
- package/dist/story/collect/index.d.ts +27 -0
- package/dist/story/collect/parser.d.ts +17 -0
- package/dist/story/collect/scanner.d.ts +13 -0
- package/dist/story/collect/tree.d.ts +17 -0
- package/dist/story/commands/build.d.ts +14 -0
- package/dist/story/commands/dev.d.ts +16 -0
- package/dist/story/commands/index.d.ts +6 -0
- package/dist/story/commands/preview.d.ts +15 -0
- package/dist/story/compiled-output.d.ts +26 -0
- package/dist/story/composition.d.ts +47 -0
- package/dist/story/config-watcher.d.ts +26 -0
- package/dist/story/config.d.ts +26 -0
- package/dist/story/context.d.ts +21 -0
- package/dist/story/controls/index.d.ts +54 -0
- package/dist/story/crosswind.d.ts +29 -0
- package/dist/story/desktop-preview.d.ts +34 -0
- package/dist/story/docs-generator.d.ts +30 -0
- package/dist/story/errors.d.ts +47 -0
- package/dist/story/figma-export.d.ts +169 -0
- package/dist/story/generator.d.ts +21 -0
- package/dist/story/hmr.d.ts +64 -0
- package/dist/story/hot-swap.d.ts +35 -0
- package/dist/story/index.d.ts +51 -0
- package/dist/story/interactions.d.ts +52 -0
- package/dist/story/keyboard-shortcuts.d.ts +34 -0
- package/dist/story/output.d.ts +85 -0
- package/dist/story/performance.d.ts +76 -0
- package/dist/story/presets.d.ts +62 -0
- package/dist/story/props-validation.d.ts +45 -0
- package/dist/story/renderer.d.ts +53 -0
- package/dist/story/search-index.d.ts +47 -0
- package/dist/story/search.d.ts +45 -0
- package/dist/story/server.d.ts +21 -0
- package/dist/story/setup.d.ts +47 -0
- package/dist/story/snapshots.d.ts +65 -0
- package/dist/story/testing.d.ts +58 -0
- package/dist/story/theme.d.ts +68 -0
- package/dist/story/types.d.ts +249 -0
- package/dist/story/ui/code-panel.d.ts +42 -0
- package/dist/story/ui/controls-panel.d.ts +25 -0
- package/dist/story/ui/index.d.ts +4 -0
- package/dist/story/ui/navigation.d.ts +55 -0
- package/dist/story/ui/preview.d.ts +46 -0
- package/dist/story/visual-testing.d.ts +45 -0
- package/dist/streaming.d.ts +82 -2
- package/dist/suspense.d.ts +83 -0
- package/dist/teleport.d.ts +9 -0
- package/dist/testing.d.ts +289 -0
- package/dist/transitions.d.ts +87 -0
- package/dist/type-checker.d.ts +109 -0
- package/dist/types/component-types.d.ts +129 -0
- package/dist/types/config-types.d.ts +336 -0
- package/dist/types/context-types.d.ts +99 -0
- package/dist/types/csp-types.d.ts +79 -0
- package/dist/types/directive-types.d.ts +259 -0
- package/dist/types/index.d.ts +98 -0
- package/dist/types/pwa-types.d.ts +218 -0
- package/dist/types.d.ts +1 -315
- package/dist/typescript-templates.d.ts +178 -0
- package/dist/utils.d.ts +52 -6
- package/dist/validator.d.ts +77 -0
- package/dist/variable-extractor.d.ts +39 -0
- package/dist/view-composers.d.ts +154 -9
- package/dist/virtual-scrolling.d.ts +103 -0
- package/dist/visual-editor.d.ts +209 -0
- package/dist/visual-testing.d.ts +109 -0
- package/dist/visual-testing.js +126 -0
- package/dist/vue-template.d.ts +16 -0
- package/dist/web-components/css-scoping.d.ts +54 -0
- package/dist/web-components/index.d.ts +20 -0
- package/dist/web-components/reactive-generator.d.ts +72 -0
- package/dist/web-components.d.ts +222 -2
- package/dist/x-element.d.ts +35 -0
- package/package.json +41 -11
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type guard to check if a directive is a specific kind
|
|
3
|
+
*/
|
|
4
|
+
export declare function isDirectiveKind<K extends Directive['kind']>(directive: Directive, kind: K): directive is Extract<Directive, { kind: K }>;
|
|
5
|
+
/**
|
|
6
|
+
* Directive Types - Discriminated Unions for all directive types
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Base directive type with common properties
|
|
10
|
+
*/
|
|
11
|
+
declare interface BaseDirective {
|
|
12
|
+
kind: string
|
|
13
|
+
raw: string
|
|
14
|
+
start: number
|
|
15
|
+
end: number
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Conditional directive (@if, @elseif, @else, @unless, @isset, @empty)
|
|
19
|
+
*/
|
|
20
|
+
export declare interface ConditionalDirective extends BaseDirective {
|
|
21
|
+
kind: 'conditional'
|
|
22
|
+
type: 'if' | 'elseif' | 'else' | 'endif' | 'unless' | 'endunless' | 'isset' | 'endisset' | 'empty' | 'endempty'
|
|
23
|
+
condition?: string
|
|
24
|
+
content?: string
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Loop directive (@foreach, @for, @while, @forelse)
|
|
28
|
+
*/
|
|
29
|
+
export declare interface LoopDirective extends BaseDirective {
|
|
30
|
+
kind: 'loop'
|
|
31
|
+
type: 'foreach' | 'endforeach' | 'for' | 'endfor' | 'while' | 'endwhile' | 'forelse' | 'empty' | 'endforelse'
|
|
32
|
+
expression?: string
|
|
33
|
+
itemVar?: string
|
|
34
|
+
arrayExpr?: string
|
|
35
|
+
content?: string
|
|
36
|
+
emptyContent?: string
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Include directive (@include, @includeIf, @includeWhen, @includeUnless, @includeFirst)
|
|
40
|
+
*/
|
|
41
|
+
export declare interface IncludeDirective extends BaseDirective {
|
|
42
|
+
kind: 'include'
|
|
43
|
+
type: 'include' | 'includeIf' | 'includeWhen' | 'includeUnless' | 'includeFirst' | 'partial' | 'once'
|
|
44
|
+
path?: string
|
|
45
|
+
paths?: string[]
|
|
46
|
+
condition?: string
|
|
47
|
+
variables?: Record<string, unknown>
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Layout directive (@layout, @extends, @section, @yield, @parent)
|
|
51
|
+
*/
|
|
52
|
+
export declare interface LayoutDirective extends BaseDirective {
|
|
53
|
+
kind: 'layout'
|
|
54
|
+
type: 'layout' | 'extends' | 'section' | 'endsection' | 'yield' | 'parent' | 'show'
|
|
55
|
+
name?: string
|
|
56
|
+
defaultContent?: string
|
|
57
|
+
content?: string
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Component directive (@component, x-component)
|
|
61
|
+
*/
|
|
62
|
+
export declare interface ComponentDirective extends BaseDirective {
|
|
63
|
+
kind: 'component'
|
|
64
|
+
type: 'component' | 'endcomponent' | 'slot' | 'endslot'
|
|
65
|
+
name?: string
|
|
66
|
+
props?: Record<string, unknown>
|
|
67
|
+
slotName?: string
|
|
68
|
+
content?: string
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Auth directive (@auth, @guest, @can, @cannot)
|
|
72
|
+
*/
|
|
73
|
+
export declare interface AuthDirective extends BaseDirective {
|
|
74
|
+
kind: 'auth'
|
|
75
|
+
type: 'auth' | 'endauth' | 'guest' | 'endguest' | 'can' | 'endcan' | 'cannot' | 'endcannot' | 'role' | 'endrole'
|
|
76
|
+
guard?: string
|
|
77
|
+
ability?: string
|
|
78
|
+
arguments?: unknown[]
|
|
79
|
+
content?: string
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Form directive (@csrf, @method, @error, @old)
|
|
83
|
+
*/
|
|
84
|
+
export declare interface FormDirective extends BaseDirective {
|
|
85
|
+
kind: 'form'
|
|
86
|
+
type: 'csrf' | 'method' | 'error' | 'enderror' | 'old'
|
|
87
|
+
method?: 'PUT' | 'PATCH' | 'DELETE'
|
|
88
|
+
field?: string
|
|
89
|
+
content?: string
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Stack directive (@push, @prepend, @stack)
|
|
93
|
+
*/
|
|
94
|
+
export declare interface StackDirective extends BaseDirective {
|
|
95
|
+
kind: 'stack'
|
|
96
|
+
type: 'push' | 'endpush' | 'prepend' | 'endprepend' | 'stack'
|
|
97
|
+
name: string
|
|
98
|
+
content?: string
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Expression directive ({{ }}, {!! !!})
|
|
102
|
+
*/
|
|
103
|
+
export declare interface ExpressionDirective extends BaseDirective {
|
|
104
|
+
kind: 'expression'
|
|
105
|
+
type: 'escaped' | 'raw'
|
|
106
|
+
expression: string
|
|
107
|
+
filters?: Array<{
|
|
108
|
+
name: string
|
|
109
|
+
args?: unknown[]
|
|
110
|
+
}>
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Switch directive (@switch, @case, @default)
|
|
114
|
+
*/
|
|
115
|
+
export declare interface SwitchDirective extends BaseDirective {
|
|
116
|
+
kind: 'switch'
|
|
117
|
+
type: 'switch' | 'case' | 'default' | 'break' | 'endswitch'
|
|
118
|
+
expression?: string
|
|
119
|
+
caseValue?: unknown
|
|
120
|
+
content?: string
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* SEO directive (@meta, @seo, @og, @twitter, @jsonld)
|
|
124
|
+
*/
|
|
125
|
+
export declare interface SeoDirective extends BaseDirective {
|
|
126
|
+
kind: 'seo'
|
|
127
|
+
type: 'meta' | 'seo' | 'og' | 'twitter' | 'jsonld' | 'canonical' | 'robots'
|
|
128
|
+
name?: string
|
|
129
|
+
metaContent?: string
|
|
130
|
+
config?: Record<string, unknown>
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Accessibility directive (@a11y, @screenReader, @ariaDescribe)
|
|
134
|
+
*/
|
|
135
|
+
export declare interface A11yDirective extends BaseDirective {
|
|
136
|
+
kind: 'a11y'
|
|
137
|
+
type: 'screenReader' | 'srOnly' | 'ariaDescribe' | 'a11y'
|
|
138
|
+
text?: string
|
|
139
|
+
target?: string
|
|
140
|
+
descriptionId?: string
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* JavaScript/TypeScript execution directive (@js, @ts)
|
|
144
|
+
*/
|
|
145
|
+
export declare interface ScriptDirective extends BaseDirective {
|
|
146
|
+
kind: 'script'
|
|
147
|
+
type: 'js' | 'ts'
|
|
148
|
+
code: string
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Environment directive (@env, @production, @development)
|
|
152
|
+
*/
|
|
153
|
+
export declare interface EnvDirective extends BaseDirective {
|
|
154
|
+
kind: 'env'
|
|
155
|
+
type: 'env' | 'endenv' | 'production' | 'endproduction' | 'development' | 'enddevelopment'
|
|
156
|
+
environments?: string[]
|
|
157
|
+
content?: string
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* i18n directive (@translate, @t, @lang)
|
|
161
|
+
*/
|
|
162
|
+
export declare interface I18nDirective extends BaseDirective {
|
|
163
|
+
kind: 'i18n'
|
|
164
|
+
type: 'translate' | 't' | 'lang' | 'endlang' | 'choice'
|
|
165
|
+
key?: string
|
|
166
|
+
params?: Record<string, unknown>
|
|
167
|
+
count?: number
|
|
168
|
+
locale?: string
|
|
169
|
+
content?: string
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Custom directive (user-defined)
|
|
173
|
+
*/
|
|
174
|
+
export declare interface UserCustomDirective extends BaseDirective {
|
|
175
|
+
kind: 'custom'
|
|
176
|
+
name: string
|
|
177
|
+
params: string[]
|
|
178
|
+
content?: string
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Custom directive definition
|
|
182
|
+
*/
|
|
183
|
+
export declare interface CustomDirective {
|
|
184
|
+
name: string
|
|
185
|
+
handler: CustomDirectiveHandler
|
|
186
|
+
hasEndTag?: boolean
|
|
187
|
+
description?: string
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Middleware definition
|
|
191
|
+
*/
|
|
192
|
+
export declare interface Middleware {
|
|
193
|
+
name: string
|
|
194
|
+
handler: MiddlewareHandler
|
|
195
|
+
timing: 'before' | 'after'
|
|
196
|
+
description?: string
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Union type of all directive types (discriminated union)
|
|
200
|
+
*
|
|
201
|
+
* Use the `kind` property to narrow the type:
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* ```typescript
|
|
205
|
+
* function processDirective(directive: Directive) {
|
|
206
|
+
* switch (directive.kind) {
|
|
207
|
+
* case 'conditional':
|
|
208
|
+
* // TypeScript knows directive is ConditionalDirective here
|
|
209
|
+
* if (directive.type === 'if') {
|
|
210
|
+
* console.log(directive.condition)
|
|
211
|
+
* }
|
|
212
|
+
* break
|
|
213
|
+
* case 'loop':
|
|
214
|
+
* // TypeScript knows directive is LoopDirective here
|
|
215
|
+
* console.log(directive.expression)
|
|
216
|
+
* break
|
|
217
|
+
* // ... other cases
|
|
218
|
+
* }
|
|
219
|
+
* }
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
export type Directive = | ConditionalDirective
|
|
223
|
+
| LoopDirective
|
|
224
|
+
| IncludeDirective
|
|
225
|
+
| LayoutDirective
|
|
226
|
+
| ComponentDirective
|
|
227
|
+
| AuthDirective
|
|
228
|
+
| FormDirective
|
|
229
|
+
| StackDirective
|
|
230
|
+
| ExpressionDirective
|
|
231
|
+
| SwitchDirective
|
|
232
|
+
| SeoDirective
|
|
233
|
+
| A11yDirective
|
|
234
|
+
| ScriptDirective
|
|
235
|
+
| EnvDirective
|
|
236
|
+
| I18nDirective
|
|
237
|
+
| UserCustomDirective
|
|
238
|
+
/**
|
|
239
|
+
* Helper type to extract directive by kind
|
|
240
|
+
*/
|
|
241
|
+
export type DirectiveOfKind<K extends Directive['kind']> = Extract<Directive, { kind: K }>
|
|
242
|
+
/**
|
|
243
|
+
* Custom directive handler function
|
|
244
|
+
*/
|
|
245
|
+
export type CustomDirectiveHandler = (
|
|
246
|
+
content: string,
|
|
247
|
+
params: string[],
|
|
248
|
+
context: Record<string, unknown>,
|
|
249
|
+
filePath: string
|
|
250
|
+
) => string | Promise<string>
|
|
251
|
+
/**
|
|
252
|
+
* Middleware handler function
|
|
253
|
+
*/
|
|
254
|
+
export type MiddlewareHandler = (
|
|
255
|
+
template: string,
|
|
256
|
+
context: Record<string, unknown>,
|
|
257
|
+
filePath: string,
|
|
258
|
+
options: import('./config-types').StxOptions
|
|
259
|
+
) => string | Promise<string>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
AuthContext,
|
|
3
|
+
BaseTemplateContext,
|
|
4
|
+
ContextValue,
|
|
5
|
+
LoopContext,
|
|
6
|
+
PermissionsContext,
|
|
7
|
+
RequireContextKeys,
|
|
8
|
+
TemplateContext,
|
|
9
|
+
TranslationContext,
|
|
10
|
+
TypedContext,
|
|
11
|
+
} from './context-types';
|
|
12
|
+
export type {
|
|
13
|
+
A11yDirective,
|
|
14
|
+
AuthDirective,
|
|
15
|
+
ComponentDirective,
|
|
16
|
+
ConditionalDirective,
|
|
17
|
+
CustomDirective,
|
|
18
|
+
CustomDirectiveHandler,
|
|
19
|
+
Directive,
|
|
20
|
+
DirectiveOfKind,
|
|
21
|
+
EnvDirective,
|
|
22
|
+
ExpressionDirective,
|
|
23
|
+
FormDirective,
|
|
24
|
+
I18nDirective,
|
|
25
|
+
IncludeDirective,
|
|
26
|
+
LayoutDirective,
|
|
27
|
+
LoopDirective,
|
|
28
|
+
Middleware,
|
|
29
|
+
MiddlewareHandler,
|
|
30
|
+
ScriptDirective,
|
|
31
|
+
SeoDirective,
|
|
32
|
+
StackDirective,
|
|
33
|
+
SwitchDirective,
|
|
34
|
+
UserCustomDirective,
|
|
35
|
+
} from './directive-types';
|
|
36
|
+
export type {
|
|
37
|
+
ComponentConfig,
|
|
38
|
+
ComponentDefinition,
|
|
39
|
+
ComponentDoc,
|
|
40
|
+
ComponentPropDoc,
|
|
41
|
+
ComponentPropsSchema,
|
|
42
|
+
DirectiveDoc,
|
|
43
|
+
DocFormat,
|
|
44
|
+
DocGeneratorConfig,
|
|
45
|
+
PropDefinition,
|
|
46
|
+
PropType,
|
|
47
|
+
TemplateDoc,
|
|
48
|
+
WebComponent,
|
|
49
|
+
WebComponentConfig,
|
|
50
|
+
} from './component-types';
|
|
51
|
+
export type {
|
|
52
|
+
A11yConfig,
|
|
53
|
+
AnalyticsConfig,
|
|
54
|
+
AnalyticsDriver,
|
|
55
|
+
AnimationConfig,
|
|
56
|
+
FormConfig,
|
|
57
|
+
HydrationConfig,
|
|
58
|
+
I18nConfig,
|
|
59
|
+
Island,
|
|
60
|
+
LoopConfig,
|
|
61
|
+
MarkdownConfig,
|
|
62
|
+
OpenGraphConfig,
|
|
63
|
+
SeoConfig,
|
|
64
|
+
SeoFeatureConfig,
|
|
65
|
+
StreamingConfig,
|
|
66
|
+
StreamRenderer,
|
|
67
|
+
StxConfig,
|
|
68
|
+
StxOptions,
|
|
69
|
+
SyntaxHighlightingConfig,
|
|
70
|
+
SyntaxHighlightTheme,
|
|
71
|
+
TwitterConfig,
|
|
72
|
+
} from './config-types';
|
|
73
|
+
export type {
|
|
74
|
+
PwaBackgroundSyncConfig,
|
|
75
|
+
PwaCacheStorageConfig,
|
|
76
|
+
PwaCacheStrategy,
|
|
77
|
+
PwaConfig,
|
|
78
|
+
PwaFileHandlerConfig,
|
|
79
|
+
PwaIconConfig,
|
|
80
|
+
PwaManifestConfig,
|
|
81
|
+
PwaOfflineConfig,
|
|
82
|
+
PwaPrecacheConfig,
|
|
83
|
+
PwaProtocolHandlerConfig,
|
|
84
|
+
PwaPushConfig,
|
|
85
|
+
PwaRouteCache,
|
|
86
|
+
PwaScreenshot,
|
|
87
|
+
PwaServiceWorkerConfig,
|
|
88
|
+
PwaShareTargetConfig,
|
|
89
|
+
PwaShortcut,
|
|
90
|
+
PwaUpdateConfig,
|
|
91
|
+
} from './pwa-types';
|
|
92
|
+
export type {
|
|
93
|
+
CspConfig,
|
|
94
|
+
CspDirectives,
|
|
95
|
+
CspPreset,
|
|
96
|
+
CspSourceValue,
|
|
97
|
+
} from './csp-types';
|
|
98
|
+
export { isDirectiveKind } from './directive-types';
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PWA route cache configuration
|
|
3
|
+
* Defines how specific routes should be cached by the service worker
|
|
4
|
+
*/
|
|
5
|
+
export declare interface PwaRouteCache {
|
|
6
|
+
pattern: string
|
|
7
|
+
strategy: PwaCacheStrategy
|
|
8
|
+
cacheName?: string
|
|
9
|
+
maxAgeSeconds?: number
|
|
10
|
+
maxEntries?: number
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* PWA icon configuration for automatic generation
|
|
14
|
+
*/
|
|
15
|
+
export declare interface PwaIconConfig {
|
|
16
|
+
src: string
|
|
17
|
+
sizes?: number[]
|
|
18
|
+
generateWebP?: boolean
|
|
19
|
+
generateAppleIcons?: boolean
|
|
20
|
+
outputDir?: string
|
|
21
|
+
purpose?: ('any' | 'maskable' | 'monochrome')[]
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* PWA shortcut definition for app shortcuts menu
|
|
25
|
+
*/
|
|
26
|
+
export declare interface PwaShortcut {
|
|
27
|
+
name: string
|
|
28
|
+
shortName?: string
|
|
29
|
+
description?: string
|
|
30
|
+
url: string
|
|
31
|
+
icons?: Array<{ src: string, sizes: string, type?: string }>
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* PWA screenshot definition for app store listings
|
|
35
|
+
*/
|
|
36
|
+
export declare interface PwaScreenshot {
|
|
37
|
+
src: string
|
|
38
|
+
sizes: string
|
|
39
|
+
type?: string
|
|
40
|
+
label?: string
|
|
41
|
+
platform?: 'wide' | 'narrow'
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* PWA Web App Manifest configuration
|
|
45
|
+
*/
|
|
46
|
+
export declare interface PwaManifestConfig {
|
|
47
|
+
name: string
|
|
48
|
+
shortName?: string
|
|
49
|
+
description?: string
|
|
50
|
+
startUrl?: string
|
|
51
|
+
display?: 'fullscreen' | 'standalone' | 'minimal-ui' | 'browser'
|
|
52
|
+
displayOverride?: string[]
|
|
53
|
+
orientation?: 'portrait' | 'landscape' | 'any' | 'portrait-primary' | 'portrait-secondary' | 'landscape-primary' | 'landscape-secondary'
|
|
54
|
+
themeColor?: string
|
|
55
|
+
backgroundColor?: string
|
|
56
|
+
scope?: string
|
|
57
|
+
lang?: string
|
|
58
|
+
dir?: 'ltr' | 'rtl' | 'auto'
|
|
59
|
+
id?: string
|
|
60
|
+
categories?: string[]
|
|
61
|
+
shortcuts?: PwaShortcut[]
|
|
62
|
+
screenshots?: PwaScreenshot[]
|
|
63
|
+
launchHandler?: 'auto' | 'focus-existing' | 'navigate-new' | 'navigate-existing'
|
|
64
|
+
handleLinks?: 'auto' | 'preferred' | 'not-preferred'
|
|
65
|
+
edgeSidePanel?: {
|
|
66
|
+
enabled: boolean
|
|
67
|
+
preferredWidth?: number
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* PWA offline fallback page configuration
|
|
72
|
+
*/
|
|
73
|
+
export declare interface PwaOfflineConfig {
|
|
74
|
+
enabled: boolean
|
|
75
|
+
page?: string
|
|
76
|
+
fallbackTitle?: string
|
|
77
|
+
fallbackMessage?: string
|
|
78
|
+
precacheAssets?: string[]
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Service worker configuration
|
|
82
|
+
*/
|
|
83
|
+
export declare interface PwaServiceWorkerConfig {
|
|
84
|
+
fileName?: string
|
|
85
|
+
cacheVersion?: string
|
|
86
|
+
skipWaiting?: boolean
|
|
87
|
+
clientsClaim?: boolean
|
|
88
|
+
navigationPreload?: boolean
|
|
89
|
+
excludeRoutes?: string[]
|
|
90
|
+
cacheFileTypes?: string[]
|
|
91
|
+
useWorkbox?: boolean
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Push notification configuration
|
|
95
|
+
*/
|
|
96
|
+
export declare interface PwaPushConfig {
|
|
97
|
+
enabled: boolean
|
|
98
|
+
vapidPublicKey?: string
|
|
99
|
+
subscriptionEndpoint?: string
|
|
100
|
+
defaultIcon?: string
|
|
101
|
+
defaultBadge?: string
|
|
102
|
+
defaultOptions?: {
|
|
103
|
+
/** Enable vibration */
|
|
104
|
+
vibrate?: number[]
|
|
105
|
+
/** Require interaction to dismiss */
|
|
106
|
+
requireInteraction?: boolean
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Background sync configuration
|
|
111
|
+
*/
|
|
112
|
+
export declare interface PwaBackgroundSyncConfig {
|
|
113
|
+
enabled: boolean
|
|
114
|
+
queueName?: string
|
|
115
|
+
maxRetentionMinutes?: number
|
|
116
|
+
maxRetries?: number
|
|
117
|
+
minInterval?: number
|
|
118
|
+
forms?: string[]
|
|
119
|
+
endpoints?: string[]
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Share target configuration for receiving shared content
|
|
123
|
+
*/
|
|
124
|
+
export declare interface PwaShareTargetConfig {
|
|
125
|
+
enabled: boolean
|
|
126
|
+
action: string
|
|
127
|
+
method?: 'GET' | 'POST'
|
|
128
|
+
enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data'
|
|
129
|
+
params?: {
|
|
130
|
+
/** Parameter name for shared title */
|
|
131
|
+
title?: string
|
|
132
|
+
/** Parameter name for shared text */
|
|
133
|
+
text?: string
|
|
134
|
+
/** Parameter name for shared URL */
|
|
135
|
+
url?: string
|
|
136
|
+
}
|
|
137
|
+
acceptFiles?: Array<{
|
|
138
|
+
name: string
|
|
139
|
+
accept: string[]
|
|
140
|
+
}>
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* File handler configuration for handling specific file types
|
|
144
|
+
*/
|
|
145
|
+
export declare interface PwaFileHandlerConfig {
|
|
146
|
+
enabled: boolean
|
|
147
|
+
action?: string
|
|
148
|
+
accept?: Record<string, string[]>
|
|
149
|
+
launchType?: 'single-client' | 'multiple-clients'
|
|
150
|
+
icons?: Array<{ src: string, sizes: string, type: string }>
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Protocol handler configuration
|
|
154
|
+
*/
|
|
155
|
+
export declare interface PwaProtocolHandlerConfig {
|
|
156
|
+
protocol: string
|
|
157
|
+
url: string
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Cache storage limits configuration
|
|
161
|
+
*/
|
|
162
|
+
export declare interface PwaCacheStorageConfig {
|
|
163
|
+
maxSize?: number
|
|
164
|
+
maxEntries?: number
|
|
165
|
+
maxAge?: number
|
|
166
|
+
purgeStrategy?: 'lru' | 'fifo' | 'lfu'
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Update notification configuration
|
|
170
|
+
*/
|
|
171
|
+
export declare interface PwaUpdateConfig {
|
|
172
|
+
enabled: boolean
|
|
173
|
+
promptUser?: boolean
|
|
174
|
+
autoReload?: boolean
|
|
175
|
+
message?: string
|
|
176
|
+
uiSelector?: string
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Auto-precaching configuration
|
|
180
|
+
*/
|
|
181
|
+
export declare interface PwaPrecacheConfig {
|
|
182
|
+
enabled: boolean
|
|
183
|
+
includeHtml?: boolean
|
|
184
|
+
includeJs?: boolean
|
|
185
|
+
includeCss?: boolean
|
|
186
|
+
includeImages?: boolean
|
|
187
|
+
includeFonts?: boolean
|
|
188
|
+
include?: string[]
|
|
189
|
+
exclude?: string[]
|
|
190
|
+
maxFileSizeKB?: number
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Complete PWA configuration
|
|
194
|
+
*/
|
|
195
|
+
export declare interface PwaConfig {
|
|
196
|
+
enabled: boolean
|
|
197
|
+
manifest: PwaManifestConfig
|
|
198
|
+
icons?: PwaIconConfig
|
|
199
|
+
routes?: PwaRouteCache[]
|
|
200
|
+
offline?: PwaOfflineConfig
|
|
201
|
+
serviceWorker?: PwaServiceWorkerConfig
|
|
202
|
+
autoInject?: boolean
|
|
203
|
+
push?: PwaPushConfig
|
|
204
|
+
backgroundSync?: PwaBackgroundSyncConfig
|
|
205
|
+
shareTarget?: PwaShareTargetConfig
|
|
206
|
+
fileHandlers?: PwaFileHandlerConfig
|
|
207
|
+
protocolHandlers?: PwaProtocolHandlerConfig[]
|
|
208
|
+
cacheStorage?: PwaCacheStorageConfig
|
|
209
|
+
updates?: PwaUpdateConfig
|
|
210
|
+
precache?: PwaPrecacheConfig
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Progressive Web App (PWA) Types
|
|
214
|
+
*/
|
|
215
|
+
/**
|
|
216
|
+
* PWA caching strategy for service worker routes
|
|
217
|
+
*/
|
|
218
|
+
export type PwaCacheStrategy = 'cache-first' | 'network-first' | 'stale-while-revalidate' | 'network-only' | 'cache-only'
|