@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.
Files changed (275) hide show
  1. package/dist/a11y.d.ts +109 -5
  2. package/dist/analytics.d.ts +40 -0
  3. package/dist/animation.d.ts +90 -0
  4. package/dist/app.d.ts +51 -0
  5. package/dist/ast.d.ts +286 -0
  6. package/dist/async-components.d.ts +101 -0
  7. package/dist/auth.d.ts +1 -3
  8. package/dist/browser-composables.d.ts +314 -0
  9. package/dist/build-optimizer.d.ts +126 -0
  10. package/dist/build-views.d.ts +37 -0
  11. package/dist/bundle-analyzer/collector.d.ts +66 -0
  12. package/dist/bundle-analyzer/index.d.ts +60 -0
  13. package/dist/bundle-analyzer/report.d.ts +39 -0
  14. package/dist/bundle-analyzer/treemap.d.ts +19 -0
  15. package/dist/bundle-analyzer.js +499 -0
  16. package/dist/caching.d.ts +7 -0
  17. package/dist/cli.js +10880 -1199
  18. package/dist/client/directive.d.ts +10 -0
  19. package/dist/client/index.d.ts +7 -0
  20. package/dist/client/router.d.ts +36 -0
  21. package/dist/client/stx-router.browser.d.ts +0 -0
  22. package/dist/client-script.d.ts +22 -0
  23. package/dist/component-hmr.d.ts +120 -0
  24. package/dist/components.d.ts +23 -1
  25. package/dist/composables/index.d.ts +277 -0
  26. package/dist/composables/use-battery.d.ts +46 -0
  27. package/dist/composables/use-broadcast-channel.d.ts +58 -0
  28. package/dist/composables/use-clipboard.d.ts +34 -0
  29. package/dist/composables/use-cookie.d.ts +70 -0
  30. package/dist/composables/use-device-orientation.d.ts +109 -0
  31. package/dist/composables/use-event-source.d.ts +77 -0
  32. package/dist/composables/use-eye-dropper.d.ts +107 -0
  33. package/dist/composables/use-fetch.d.ts +84 -0
  34. package/dist/composables/use-fullscreen.d.ts +47 -0
  35. package/dist/composables/use-geolocation.d.ts +62 -0
  36. package/dist/composables/use-idle.d.ts +84 -0
  37. package/dist/composables/use-intersection-observer.d.ts +81 -0
  38. package/dist/composables/use-keyboard.d.ts +100 -0
  39. package/dist/composables/use-media-query.d.ts +56 -0
  40. package/dist/composables/use-mouse.d.ts +64 -0
  41. package/dist/composables/use-mutation-observer.d.ts +101 -0
  42. package/dist/composables/use-network.d.ts +40 -0
  43. package/dist/composables/use-notification.d.ts +89 -0
  44. package/dist/composables/use-permissions.d.ts +109 -0
  45. package/dist/composables/use-resize-observer.d.ts +60 -0
  46. package/dist/composables/use-share.d.ts +70 -0
  47. package/dist/composables/use-speech.d.ts +117 -0
  48. package/dist/composables/use-storage.d.ts +64 -0
  49. package/dist/composables/use-text-selection.d.ts +97 -0
  50. package/dist/composables/use-wake-lock.d.ts +85 -0
  51. package/dist/composables/use-websocket.d.ts +69 -0
  52. package/dist/composables/use-window.d.ts +84 -0
  53. package/dist/composables.d.ts +268 -0
  54. package/dist/composition-api.d.ts +190 -0
  55. package/dist/computed.d.ts +137 -0
  56. package/dist/conditionals.d.ts +14 -2
  57. package/dist/config.d.ts +35 -2
  58. package/dist/craft-bridge.d.ts +319 -0
  59. package/dist/craft-compiler.d.ts +229 -0
  60. package/dist/craft-components.d.ts +411 -0
  61. package/dist/craft-entry.d.ts +5 -0
  62. package/dist/craft-ssr.d.ts +134 -0
  63. package/dist/craft.js +1553 -0
  64. package/dist/csp.d.ts +229 -0
  65. package/dist/database.d.ts +407 -0
  66. package/dist/database.js +5 -0
  67. package/dist/defer.d.ts +4 -0
  68. package/dist/deploy/config-generators.d.ts +75 -0
  69. package/dist/deploy/index.d.ts +84 -0
  70. package/dist/deploy/netlify.d.ts +109 -0
  71. package/dist/dev-server/crosswind.d.ts +54 -0
  72. package/dist/dev-server/index.d.ts +7 -0
  73. package/dist/dev-server/keyboard-shortcuts.d.ts +34 -0
  74. package/dist/dev-server/native-window.d.ts +40 -0
  75. package/dist/dev-server/port-utils.d.ts +27 -0
  76. package/dist/dev-server/terminal-colors.d.ts +60 -0
  77. package/dist/dev-server/theme-selector.d.ts +32 -0
  78. package/dist/dev-server/types.d.ts +92 -0
  79. package/dist/dev-server.d.ts +21 -0
  80. package/dist/devtools.d.ts +142 -0
  81. package/dist/directive-api.d.ts +111 -0
  82. package/dist/dynamic-components.d.ts +14 -0
  83. package/dist/edge-runtime.d.ts +200 -0
  84. package/dist/env.d.ts +9 -0
  85. package/dist/error-boundaries.d.ts +71 -0
  86. package/dist/error-handling.d.ts +1 -101
  87. package/dist/errors/codes.d.ts +99 -0
  88. package/dist/errors/formatter.d.ts +64 -0
  89. package/dist/errors/index.d.ts +56 -0
  90. package/dist/errors/logger.d.ts +74 -0
  91. package/dist/errors/sanitizer.d.ts +43 -0
  92. package/dist/errors/types.d.ts +79 -0
  93. package/dist/events.d.ts +106 -0
  94. package/dist/expressions.d.ts +86 -11
  95. package/dist/forms-validation.d.ts +173 -0
  96. package/dist/forms.d.ts +157 -8
  97. package/dist/head.d.ts +225 -0
  98. package/dist/heatmap.d.ts +125 -0
  99. package/dist/hot-reload.d.ts +87 -0
  100. package/dist/hydration-runtime.d.ts +47 -0
  101. package/dist/hydration.d.ts +161 -0
  102. package/dist/i18n.d.ts +239 -3
  103. package/dist/image-optimization/build-plugin.d.ts +53 -0
  104. package/dist/image-optimization/component.d.ts +46 -0
  105. package/dist/image-optimization/directive.d.ts +30 -0
  106. package/dist/image-optimization/index.d.ts +86 -0
  107. package/dist/image-optimization/processor.d.ts +112 -0
  108. package/dist/includes.d.ts +94 -9
  109. package/dist/index.d.ts +63 -3
  110. package/dist/index.js +11603 -1318
  111. package/dist/init.d.ts +32 -2
  112. package/dist/interactive.d.ts +14 -0
  113. package/dist/internal-markdown.d.ts +22 -0
  114. package/dist/jsx-runtime.d.ts +110 -0
  115. package/dist/keep-alive.d.ts +87 -0
  116. package/dist/lazy-loader.d.ts +122 -0
  117. package/dist/loading-indicator.d.ts +40 -0
  118. package/dist/loops.d.ts +22 -1
  119. package/dist/media/client/blur-up.d.ts +65 -0
  120. package/dist/media/client/index.d.ts +77 -0
  121. package/dist/media/client/lazy-load.d.ts +73 -0
  122. package/dist/media/client/upload-handler.d.ts +79 -0
  123. package/dist/media/image/component.d.ts +46 -0
  124. package/dist/media/image/directive.d.ts +9 -0
  125. package/dist/media/image/editing.d.ts +212 -0
  126. package/dist/media/image/index.d.ts +118 -0
  127. package/dist/media/image/placeholder.d.ts +78 -0
  128. package/dist/media/image/processor/cache.d.ts +32 -0
  129. package/dist/media/image/processor/index.d.ts +12 -0
  130. package/dist/media/image/processor/optimizer.d.ts +13 -0
  131. package/dist/media/image/processor/responsive.d.ts +17 -0
  132. package/dist/media/image/srcset.d.ts +158 -0
  133. package/dist/media/index.d.ts +295 -0
  134. package/dist/media/manager/embed.d.ts +25 -0
  135. package/dist/media/protected/component.d.ts +34 -0
  136. package/dist/media/protected/index.d.ts +34 -0
  137. package/dist/media/protected/signature.d.ts +72 -0
  138. package/dist/media/shared/cache.d.ts +54 -0
  139. package/dist/media/shared/hash.d.ts +24 -0
  140. package/dist/media/shared/index.d.ts +2 -0
  141. package/dist/media/types.d.ts +1051 -0
  142. package/dist/media/upload/component.d.ts +23 -0
  143. package/dist/media/upload/index.d.ts +1 -0
  144. package/dist/media/video/directive.d.ts +9 -0
  145. package/dist/media/video/index.d.ts +47 -0
  146. package/dist/media/video/processor/cache.d.ts +33 -0
  147. package/dist/media/video/processor/index.d.ts +21 -0
  148. package/dist/media/video/processor/streaming.d.ts +19 -0
  149. package/dist/media/video/processor/thumbnail.d.ts +28 -0
  150. package/dist/media/video/processor/transcoder.d.ts +9 -0
  151. package/dist/middleware.d.ts +42 -3
  152. package/dist/native-build.d.ts +74 -0
  153. package/dist/parser/directive-parser.d.ts +79 -0
  154. package/dist/parser/expression-parser.d.ts +59 -0
  155. package/dist/parser/index.d.ts +35 -0
  156. package/dist/parser/tokenizer.d.ts +81 -0
  157. package/dist/partial-hydration.d.ts +88 -0
  158. package/dist/performance-utils.d.ts +146 -3
  159. package/dist/plugin-system.d.ts +128 -0
  160. package/dist/precompiler.d.ts +108 -0
  161. package/dist/production-build.d.ts +199 -0
  162. package/dist/props.d.ts +199 -0
  163. package/dist/pwa/audit.d.ts +42 -0
  164. package/dist/pwa/directives.d.ts +29 -0
  165. package/dist/pwa/icons.d.ts +39 -0
  166. package/dist/pwa/index.d.ts +59 -0
  167. package/dist/pwa/inject.d.ts +22 -0
  168. package/dist/pwa/manifest.d.ts +104 -0
  169. package/dist/pwa/offline.d.ts +8 -0
  170. package/dist/pwa/precache.d.ts +29 -0
  171. package/dist/pwa/service-worker.d.ts +21 -0
  172. package/dist/pwa/workbox-strategies.d.ts +100 -0
  173. package/dist/pwa/workbox.d.ts +52 -0
  174. package/dist/pwa.d.ts +51 -0
  175. package/dist/pwa.js +8124 -0
  176. package/dist/reactive-bindings.d.ts +24 -0
  177. package/dist/reactive.d.ts +100 -0
  178. package/dist/reactivity.d.ts +253 -0
  179. package/dist/route-middleware.d.ts +232 -0
  180. package/dist/router.d.ts +31 -0
  181. package/dist/routes.d.ts +0 -7
  182. package/dist/runtime.d.ts +140 -0
  183. package/dist/safe-evaluator.d.ts +117 -3
  184. package/dist/scaffolding.d.ts +113 -0
  185. package/dist/seo.d.ts +120 -7
  186. package/dist/server-components.d.ts +134 -0
  187. package/dist/signals.d.ts +501 -0
  188. package/dist/slots.d.ts +63 -0
  189. package/dist/source-maps.d.ts +117 -0
  190. package/dist/ssg.d.ts +157 -0
  191. package/dist/ssg.js +6831 -0
  192. package/dist/ssr.d.ts +107 -0
  193. package/dist/state-management.d.ts +324 -0
  194. package/dist/stores-client.d.ts +70 -0
  195. package/dist/story/addons.d.ts +123 -0
  196. package/dist/story/analytics.d.ts +92 -0
  197. package/dist/story/auto-stories.d.ts +38 -0
  198. package/dist/story/bookmarks.d.ts +53 -0
  199. package/dist/story/bun-test.d.ts +44 -0
  200. package/dist/story/cli.d.ts +34 -0
  201. package/dist/story/collect/analyzer.d.ts +33 -0
  202. package/dist/story/collect/index.d.ts +27 -0
  203. package/dist/story/collect/parser.d.ts +17 -0
  204. package/dist/story/collect/scanner.d.ts +13 -0
  205. package/dist/story/collect/tree.d.ts +17 -0
  206. package/dist/story/commands/build.d.ts +14 -0
  207. package/dist/story/commands/dev.d.ts +16 -0
  208. package/dist/story/commands/index.d.ts +6 -0
  209. package/dist/story/commands/preview.d.ts +15 -0
  210. package/dist/story/compiled-output.d.ts +26 -0
  211. package/dist/story/composition.d.ts +47 -0
  212. package/dist/story/config-watcher.d.ts +26 -0
  213. package/dist/story/config.d.ts +26 -0
  214. package/dist/story/context.d.ts +21 -0
  215. package/dist/story/controls/index.d.ts +54 -0
  216. package/dist/story/crosswind.d.ts +29 -0
  217. package/dist/story/desktop-preview.d.ts +34 -0
  218. package/dist/story/docs-generator.d.ts +30 -0
  219. package/dist/story/errors.d.ts +47 -0
  220. package/dist/story/figma-export.d.ts +169 -0
  221. package/dist/story/generator.d.ts +21 -0
  222. package/dist/story/hmr.d.ts +64 -0
  223. package/dist/story/hot-swap.d.ts +35 -0
  224. package/dist/story/index.d.ts +51 -0
  225. package/dist/story/interactions.d.ts +52 -0
  226. package/dist/story/keyboard-shortcuts.d.ts +34 -0
  227. package/dist/story/output.d.ts +85 -0
  228. package/dist/story/performance.d.ts +76 -0
  229. package/dist/story/presets.d.ts +62 -0
  230. package/dist/story/props-validation.d.ts +45 -0
  231. package/dist/story/renderer.d.ts +53 -0
  232. package/dist/story/search-index.d.ts +47 -0
  233. package/dist/story/search.d.ts +45 -0
  234. package/dist/story/server.d.ts +21 -0
  235. package/dist/story/setup.d.ts +47 -0
  236. package/dist/story/snapshots.d.ts +65 -0
  237. package/dist/story/testing.d.ts +58 -0
  238. package/dist/story/theme.d.ts +68 -0
  239. package/dist/story/types.d.ts +249 -0
  240. package/dist/story/ui/code-panel.d.ts +42 -0
  241. package/dist/story/ui/controls-panel.d.ts +25 -0
  242. package/dist/story/ui/index.d.ts +4 -0
  243. package/dist/story/ui/navigation.d.ts +55 -0
  244. package/dist/story/ui/preview.d.ts +46 -0
  245. package/dist/story/visual-testing.d.ts +45 -0
  246. package/dist/streaming.d.ts +82 -2
  247. package/dist/suspense.d.ts +83 -0
  248. package/dist/teleport.d.ts +9 -0
  249. package/dist/testing.d.ts +289 -0
  250. package/dist/transitions.d.ts +87 -0
  251. package/dist/type-checker.d.ts +109 -0
  252. package/dist/types/component-types.d.ts +129 -0
  253. package/dist/types/config-types.d.ts +336 -0
  254. package/dist/types/context-types.d.ts +99 -0
  255. package/dist/types/csp-types.d.ts +79 -0
  256. package/dist/types/directive-types.d.ts +259 -0
  257. package/dist/types/index.d.ts +98 -0
  258. package/dist/types/pwa-types.d.ts +218 -0
  259. package/dist/types.d.ts +1 -315
  260. package/dist/typescript-templates.d.ts +178 -0
  261. package/dist/utils.d.ts +52 -6
  262. package/dist/validator.d.ts +77 -0
  263. package/dist/variable-extractor.d.ts +39 -0
  264. package/dist/view-composers.d.ts +154 -9
  265. package/dist/virtual-scrolling.d.ts +103 -0
  266. package/dist/visual-editor.d.ts +209 -0
  267. package/dist/visual-testing.d.ts +109 -0
  268. package/dist/visual-testing.js +126 -0
  269. package/dist/vue-template.d.ts +16 -0
  270. package/dist/web-components/css-scoping.d.ts +54 -0
  271. package/dist/web-components/index.d.ts +20 -0
  272. package/dist/web-components/reactive-generator.d.ts +72 -0
  273. package/dist/web-components.d.ts +222 -2
  274. package/dist/x-element.d.ts +35 -0
  275. 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'