@stacksjs/stx 0.2.155 → 0.2.157

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 (241) hide show
  1. package/dist/a11y.d.ts +87 -46
  2. package/dist/animation.d.ts +96 -42
  3. package/dist/appearance-bootstrap.d.ts +49 -15
  4. package/dist/asset-roots.d.ts +32 -0
  5. package/dist/asset-roots.js +7 -0
  6. package/dist/assets.d.ts +9 -7
  7. package/dist/async-components.d.ts +78 -56
  8. package/dist/auth.d.ts +3 -0
  9. package/dist/build-externalize.d.ts +40 -0
  10. package/dist/build-externalize.js +63 -0
  11. package/dist/build-id.d.ts +22 -22
  12. package/dist/build-message.d.ts +73 -2
  13. package/dist/build-message.js +47 -8
  14. package/dist/builtins/attrs.d.ts +14 -0
  15. package/dist/builtins/drawer.d.ts +22 -0
  16. package/dist/builtins/icon.d.ts +16 -2
  17. package/dist/builtins/index.d.ts +5 -15
  18. package/dist/builtins/modal.d.ts +24 -0
  19. package/dist/builtins/safe-image.d.ts +42 -0
  20. package/dist/builtins/stx-image.d.ts +27 -0
  21. package/dist/builtins/stx-link.d.ts +9 -0
  22. package/dist/builtins/stx-loading-indicator.d.ts +11 -0
  23. package/dist/builtins/suspense.d.ts +28 -0
  24. package/dist/builtins/toast.d.ts +17 -0
  25. package/dist/builtins/transition-group.d.ts +25 -0
  26. package/dist/caching.d.ts +12 -15
  27. package/dist/cli.js +1798 -908
  28. package/dist/client/directive.d.ts +7 -0
  29. package/dist/client/index.d.ts +0 -1
  30. package/dist/client-script-bundler.d.ts +63 -5
  31. package/dist/client-script-bundler.js +30 -2
  32. package/dist/client-script.d.ts +102 -47
  33. package/dist/client-script.js +15 -3
  34. package/dist/codemod.d.ts +56 -0
  35. package/dist/codemod.js +192 -0
  36. package/dist/color-mode-boot.d.ts +83 -65
  37. package/dist/component-client-factories.d.ts +1 -6
  38. package/dist/component-processing.d.ts +58 -49
  39. package/dist/component-processing.js +1 -1
  40. package/dist/component-registry.d.ts +94 -31
  41. package/dist/component-renderer.d.ts +18 -0
  42. package/dist/composable-loader.d.ts +24 -0
  43. package/dist/composable-loader.js +12 -9
  44. package/dist/composables/index.d.ts +7 -0
  45. package/dist/composables/index.js +1 -0
  46. package/dist/composables/use-fetch.js +30 -2
  47. package/dist/composables/use-form.d.ts +91 -0
  48. package/dist/composables/use-form.js +112 -0
  49. package/dist/composables.d.ts +64 -60
  50. package/dist/computed.d.ts +86 -92
  51. package/dist/conditionals.d.ts +24 -8
  52. package/dist/conditionals.js +16 -0
  53. package/dist/config.d.ts +34 -21
  54. package/dist/config.js +35 -14
  55. package/dist/craft.js +1476 -768
  56. package/dist/crosswind-config.d.ts +58 -0
  57. package/dist/crosswind-config.js +40 -0
  58. package/dist/csp.d.ts +107 -41
  59. package/dist/defer.d.ts +24 -0
  60. package/dist/dev-server/crosswind.d.ts +35 -26
  61. package/dist/dev-server/crosswind.js +2 -18
  62. package/dist/dev-server/serve-app.js +4 -3
  63. package/dist/dev-server/terminal-colors.d.ts +32 -32
  64. package/dist/directive-api.d.ts +86 -43
  65. package/dist/document-shell.d.ts +54 -41
  66. package/dist/dynamic-components.d.ts +9 -0
  67. package/dist/error-boundaries.d.ts +47 -41
  68. package/dist/error-handling.d.ts +1 -1
  69. package/dist/errors/codes.d.ts +51 -43
  70. package/dist/errors/formatter.d.ts +58 -38
  71. package/dist/errors/index.d.ts +5 -61
  72. package/dist/errors/logger.d.ts +114 -40
  73. package/dist/errors/sanitizer.d.ts +53 -23
  74. package/dist/errors/types.d.ts +44 -31
  75. package/dist/events.d.ts +86 -25
  76. package/dist/expressions.d.ts +50 -42
  77. package/dist/forms-validation.d.ts +138 -123
  78. package/dist/forms-validation.js +1 -90
  79. package/dist/forms.d.ts +120 -66
  80. package/dist/forms.js +31 -11
  81. package/dist/fragment-container.d.ts +57 -0
  82. package/dist/fragment-container.js +109 -0
  83. package/dist/framework-composables.d.ts +32 -0
  84. package/dist/head.d.ts +156 -114
  85. package/dist/heatmap.d.ts +152 -72
  86. package/dist/html-masking.d.ts +40 -34
  87. package/dist/hydration-runtime.d.ts +20 -24
  88. package/dist/i18n.d.ts +93 -32
  89. package/dist/image-optimization/auto-sibling.d.ts +32 -4
  90. package/dist/includes.d.ts +69 -7
  91. package/dist/index.d.ts +66 -0
  92. package/dist/index.js +23 -0
  93. package/dist/internal-markdown.d.ts +12 -8
  94. package/dist/island-chunking.d.ts +30 -13
  95. package/dist/keep-alive.d.ts +72 -52
  96. package/dist/layout-types.d.ts +45 -0
  97. package/dist/layout-types.js +56 -0
  98. package/dist/lazy-module.d.ts +10 -0
  99. package/dist/loops.d.ts +66 -0
  100. package/dist/loops.js +47 -6
  101. package/dist/markdown.d.ts +0 -1
  102. package/dist/media/image/component.d.ts +25 -9
  103. package/dist/media/image/directive.d.ts +15 -1
  104. package/dist/media/image/placeholder.d.ts +20 -9
  105. package/dist/media/image/processor/cache.d.ts +40 -18
  106. package/dist/media/image/processor/index.d.ts +1 -10
  107. package/dist/media/image/processor/optimizer.d.ts +12 -1
  108. package/dist/media/image/processor/responsive.d.ts +16 -6
  109. package/dist/media/image/srcset.d.ts +47 -50
  110. package/dist/media/shared/cache.d.ts +51 -31
  111. package/dist/media/shared/hash.d.ts +7 -0
  112. package/dist/media/types.d.ts +1235 -754
  113. package/dist/media/video/directive.d.ts +15 -1
  114. package/dist/media/video/index.d.ts +39 -17
  115. package/dist/media/video/processor/cache.d.ts +42 -19
  116. package/dist/media/video/processor/index.d.ts +1 -18
  117. package/dist/media/video/processor/streaming.d.ts +17 -10
  118. package/dist/media/video/processor/thumbnail.d.ts +21 -15
  119. package/dist/media/video/processor/transcoder.d.ts +11 -1
  120. package/dist/method-spoofing.d.ts +7 -0
  121. package/dist/middleware.d.ts +60 -0
  122. package/dist/owned-routes.d.ts +42 -0
  123. package/dist/owned-routes.js +26 -0
  124. package/dist/page-meta.d.ts +38 -0
  125. package/dist/page-meta.js +16 -0
  126. package/dist/parser/directive-parser.d.ts +57 -45
  127. package/dist/parser/expression-parser.d.ts +33 -35
  128. package/dist/parser/index.d.ts +4 -39
  129. package/dist/parser/tokenizer.d.ts +61 -49
  130. package/dist/partial-hydration.d.ts +82 -50
  131. package/dist/performance-utils.d.ts +217 -124
  132. package/dist/placeholder.d.ts +18 -9
  133. package/dist/plugin-system.d.ts +264 -115
  134. package/dist/process.d.ts +11 -6
  135. package/dist/process.js +21 -4
  136. package/dist/production-builder.js +7 -0
  137. package/dist/prop-sentinels.d.ts +11 -11
  138. package/dist/public-env.d.ts +14 -0
  139. package/dist/pwa/directives.d.ts +12 -3
  140. package/dist/pwa/inject.d.ts +10 -0
  141. package/dist/pwa/precache.d.ts +22 -16
  142. package/dist/pwa/service-worker.d.ts +12 -0
  143. package/dist/pwa.js +1318 -610
  144. package/dist/reactive-bindings.d.ts +34 -11
  145. package/dist/reactive.d.ts +58 -30
  146. package/dist/reactive.js +56 -31
  147. package/dist/render.d.ts +0 -14
  148. package/dist/render.js +17 -0
  149. package/dist/route-middleware.d.ts +2 -35
  150. package/dist/route-types.d.ts +134 -0
  151. package/dist/route-types.js +24 -0
  152. package/dist/router.d.ts +5 -7
  153. package/dist/routes.d.ts +1 -3
  154. package/dist/runtime-globals.d.ts +147 -24
  155. package/dist/runtime-globals.js +16 -1
  156. package/dist/runtime-injection.d.ts +8 -0
  157. package/dist/runtime-injection.js +33 -24
  158. package/dist/script-emit.d.ts +30 -0
  159. package/dist/script-json.d.ts +36 -0
  160. package/dist/script-json.js +6 -0
  161. package/dist/script-validation.d.ts +21 -4
  162. package/dist/seo.d.ts +118 -47
  163. package/dist/server-bindings.d.ts +21 -0
  164. package/dist/sfc-template.d.ts +8 -8
  165. package/dist/signal-processing.d.ts +35 -15
  166. package/dist/signals-api.d.ts +117 -58
  167. package/dist/signals-api.js +7 -4
  168. package/dist/signals.d.ts +24 -17
  169. package/dist/signals.js +765 -60
  170. package/dist/site-builder/build.js +8 -0
  171. package/dist/site-url.d.ts +46 -0
  172. package/dist/site-url.js +70 -0
  173. package/dist/slots.d.ts +86 -20
  174. package/dist/source-signature.d.ts +45 -0
  175. package/dist/source-signature.js +20 -0
  176. package/dist/ssg.d.ts +285 -142
  177. package/dist/ssg.js +1268 -556
  178. package/dist/state-dir.d.ts +4 -4
  179. package/dist/state-management.d.ts +0 -12
  180. package/dist/state-management.js +8 -25
  181. package/dist/store-imports.d.ts +23 -0
  182. package/dist/store-imports.js +3 -0
  183. package/dist/store-loader.d.ts +10 -0
  184. package/dist/store-loader.js +10 -9
  185. package/dist/story/analytics.d.ts +138 -60
  186. package/dist/story/bookmarks.d.ts +87 -34
  187. package/dist/story/cli.d.ts +123 -69
  188. package/dist/story/collect/scanner.d.ts +4 -0
  189. package/dist/story/collect/tree.d.ts +8 -1
  190. package/dist/story/commands/build.d.ts +11 -6
  191. package/dist/story/commands/dev.d.ts +15 -8
  192. package/dist/story/commands/preview.d.ts +13 -7
  193. package/dist/story/config-watcher.d.ts +20 -13
  194. package/dist/story/config.d.ts +11 -8
  195. package/dist/story/context.d.ts +14 -8
  196. package/dist/story/hmr.d.ts +24 -26
  197. package/dist/story/hot-swap.d.ts +34 -23
  198. package/dist/story/keyboard-shortcuts.d.ts +23 -18
  199. package/dist/story/output.d.ts +46 -44
  200. package/dist/story/performance.d.ts +107 -45
  201. package/dist/story/presets.d.ts +107 -41
  202. package/dist/story/renderer.d.ts +41 -27
  203. package/dist/story/search.d.ts +23 -12
  204. package/dist/story/server.d.ts +21 -11
  205. package/dist/story/setup.d.ts +23 -15
  206. package/dist/story/testing.d.ts +65 -40
  207. package/dist/story/types.d.ts +262 -160
  208. package/dist/streaming.d.ts +119 -57
  209. package/dist/stx-virtual-ts.d.ts +165 -0
  210. package/dist/stx-virtual-ts.js +372 -0
  211. package/dist/stx.d.ts +78 -1
  212. package/dist/style-scoping.d.ts +17 -4
  213. package/dist/suspense.d.ts +67 -52
  214. package/dist/teleport.d.ts +22 -0
  215. package/dist/template-tag-balance.d.ts +22 -6
  216. package/dist/transitions.d.ts +66 -55
  217. package/dist/typecheck.d.ts +77 -0
  218. package/dist/typecheck.js +156 -0
  219. package/dist/types/component-types.d.ts +187 -122
  220. package/dist/types/config-types.d.ts +758 -297
  221. package/dist/types/context-types.d.ts +46 -24
  222. package/dist/types/csp-types.d.ts +70 -66
  223. package/dist/types/directive-types.d.ts +211 -155
  224. package/dist/types/index.d.ts +6 -109
  225. package/dist/types/pwa-types.d.ts +273 -148
  226. package/dist/types.d.ts +0 -1
  227. package/dist/typescript-templates.d.ts +11 -0
  228. package/dist/unresolved-identifiers.d.ts +24 -22
  229. package/dist/unresolved-identifiers.js +2 -0
  230. package/dist/utils.d.ts +24 -21
  231. package/dist/validator.d.ts +28 -26
  232. package/dist/variable-extractor.d.ts +48 -13
  233. package/dist/variable-extractor.js +27 -4
  234. package/dist/view-composers.d.ts +80 -81
  235. package/dist/virtual-scrolling.d.ts +101 -81
  236. package/dist/vue-template.d.ts +23 -0
  237. package/dist/web-components/css-scoping.d.ts +21 -11
  238. package/dist/web-components.d.ts +81 -58
  239. package/dist/x-element.d.ts +0 -1
  240. package/package.json +5 -5
  241. package/stx.d.ts +78 -1
@@ -1,8 +1,31 @@
1
+ /**
2
+ * Expression Parser
3
+ *
4
+ * Provides utilities for parsing JavaScript expressions in templates,
5
+ * using proper tokenization instead of regex-based approaches.
6
+ *
7
+ * @module parser/expression-parser
8
+ */
1
9
  import { extractBalancedExpression, findMatchingDelimiter, splitByPipe, Tokenizer } from './tokenizer';
10
+ export interface ExpressionMatch {
11
+ fullMatch: string;
12
+ expression: string;
13
+ start: number;
14
+ end: number;
15
+ isRaw: boolean;
16
+ }
2
17
  /**
3
18
  * Find all template expressions in source ({{ }} and {!! !!})
4
19
  */
5
20
  export declare function findExpressions(source: string): ExpressionMatch[];
21
+ export interface FilterCall {
22
+ name: string;
23
+ args: string[];
24
+ }
25
+ export interface ParsedExpression {
26
+ baseExpression: string;
27
+ filters: FilterCall[];
28
+ }
6
29
  /**
7
30
  * Parse an expression with optional filter chain
8
31
  * e.g., "value | uppercase | truncate(10)" -> { baseExpression: "value", filters: [...] }
@@ -17,44 +40,19 @@ export declare function parseArguments(argsString: string): string[];
17
40
  * e.g., "@foreach($items as $item)" -> "$items as $item"
18
41
  */
19
42
  export declare function extractDirectiveParams(source: string, directiveEnd: number): {
20
- params: string
21
- endPos: number
43
+ params: string;
44
+ endPos: number;
22
45
  } | null;
46
+ export interface ScriptDeclaration {
47
+ type: 'variable' | 'function';
48
+ name: string;
49
+ value: string;
50
+ exported: boolean;
51
+ start: number;
52
+ end: number;
53
+ }
23
54
  /**
24
55
  * Parse script content and extract declarations
25
56
  */
26
57
  export declare function parseScriptDeclarations(scriptContent: string): ScriptDeclaration[];
27
- // =============================================================================
28
- // Expression Extraction
29
- // =============================================================================
30
- export declare interface ExpressionMatch {
31
- fullMatch: string
32
- expression: string
33
- start: number
34
- end: number
35
- isRaw: boolean
36
- }
37
- // =============================================================================
38
- // Filter Parsing
39
- // =============================================================================
40
- export declare interface FilterCall {
41
- name: string
42
- args: string[]
43
- }
44
- export declare interface ParsedExpression {
45
- baseExpression: string
46
- filters: FilterCall[]
47
- }
48
- // =============================================================================
49
- // Script Parsing Utilities
50
- // =============================================================================
51
- export declare interface ScriptDeclaration {
52
- type: 'variable' | 'function'
53
- name: string
54
- value: string
55
- exported: boolean
56
- start: number
57
- end: number
58
- }
59
- // Re-export tokenizer utilities
60
58
  export { extractBalancedExpression, findMatchingDelimiter, splitByPipe, Tokenizer };
@@ -7,42 +7,7 @@
7
7
  *
8
8
  * @module parser
9
9
  */
10
- // Directive parser
11
- export {
12
- type ConditionalBranch,
13
- type DirectiveMatch,
14
- extractParenthesizedExpression,
15
- findDirectiveBlocks,
16
- findIfBlocks,
17
- findMatchingEndTag,
18
- parseConditionalBlock,
19
- type ParsedConditional,
20
- type ParsedSwitch,
21
- parseSwitchBlock,
22
- type SwitchCase,
23
- } from './directive-parser';
24
- // Expression parser
25
- export {
26
- type ExpressionMatch,
27
- extractDirectiveParams,
28
- type FilterCall,
29
- findExpressions,
30
- parseArguments,
31
- type ParsedExpression,
32
- parseExpressionWithFilters,
33
- parseScriptDeclarations,
34
- type ScriptDeclaration,
35
- } from './expression-parser';
36
- // Tokenizer
37
- export {
38
- type Token,
39
- Tokenizer,
40
- type TokenizerState,
41
- type TokenType,
42
- } from './tokenizer';
43
- // Expression parsing utilities
44
- export {
45
- extractBalancedExpression,
46
- findMatchingDelimiter,
47
- splitByPipe,
48
- } from './tokenizer';
10
+ export { type ConditionalBranch, type DirectiveMatch, extractParenthesizedExpression, findDirectiveBlocks, findIfBlocks, findMatchingEndTag, parseConditionalBlock, type ParsedConditional, type ParsedSwitch, parseSwitchBlock, type SwitchCase, } from './directive-parser';
11
+ export { type ExpressionMatch, extractDirectiveParams, type FilterCall, findExpressions, parseArguments, type ParsedExpression, parseExpressionWithFilters, parseScriptDeclarations, type ScriptDeclaration, } from './expression-parser';
12
+ export { type Token, Tokenizer, type TokenizerState, type TokenType, } from './tokenizer';
13
+ export { extractBalancedExpression, findMatchingDelimiter, splitByPipe, } from './tokenizer';
@@ -1,31 +1,3 @@
1
- /**
2
- * Find matching closing delimiter, respecting nesting and strings
3
- */
4
- export declare function findMatchingDelimiter(source: string, openChar: string, closeChar: string, startPos?: number): number;
5
- /**
6
- * Extract a balanced expression from source starting at position
7
- */
8
- export declare function extractBalancedExpression(source: string, startPos: number): {
9
- expression: string
10
- endPos: number
11
- };
12
- /**
13
- * Split expression by pipe (|) for filters, respecting nesting
14
- */
15
- export declare function splitByPipe(expression: string): string[];
16
- export declare interface Token {
17
- type: TokenType
18
- value: string
19
- start: number
20
- end: number
21
- line: number
22
- column: number
23
- }
24
- export declare interface TokenizerState {
25
- pos: number
26
- line: number
27
- column: number
28
- }
29
1
  /**
30
2
  * Tokenizer for Template Expressions
31
3
  *
@@ -37,29 +9,69 @@ export declare interface TokenizerState {
37
9
  *
38
10
  * @module parser/tokenizer
39
11
  */
40
- // =============================================================================
41
- // Token Types
42
- // =============================================================================
43
- export type TokenType = | 'STRING' // 'string' or "string"
44
- | 'TEMPLATE_STRING' // `template ${expr} string`
45
- | 'NUMBER'
46
- | 'IDENTIFIER'
47
- | 'OPERATOR'
48
- | 'PUNCTUATION' // ( ) [ ] { } , ; :
49
- | 'WHITESPACE'
50
- | 'COMMENT'
51
- | 'EXPRESSION_START' // {{
52
- | 'EXPRESSION_END' // }}
53
- | 'RAW_START' // {!!
54
- | 'RAW_END' // !!}
55
- | 'DIRECTIVE' // @name
56
- | 'EOF';
12
+ export type TokenType = 'STRING' | 'TEMPLATE_STRING' | 'NUMBER' | 'IDENTIFIER' | 'OPERATOR' | 'PUNCTUATION' | 'WHITESPACE' | 'COMMENT' | 'EXPRESSION_START' | 'EXPRESSION_END' | 'RAW_START' | 'RAW_END' | 'DIRECTIVE' | 'EOF';
13
+ export interface Token {
14
+ type: TokenType;
15
+ value: string;
16
+ start: number;
17
+ end: number;
18
+ line: number;
19
+ column: number;
20
+ }
21
+ export interface TokenizerState {
22
+ pos: number;
23
+ line: number;
24
+ column: number;
25
+ }
57
26
  /**
58
27
  * Tokenizer for template expressions
59
28
  */
60
29
  export declare class Tokenizer {
61
- constructor(source: string);
62
- tokenize(): Token[];
63
- saveState(): TokenizerState;
64
- restoreState(state: TokenizerState): void;
30
+ private source;
31
+ private pos;
32
+ private line;
33
+ private column;
34
+ private tokens;
35
+ constructor(source: string);
36
+ /**
37
+ * Tokenize the entire source
38
+ */
39
+ tokenize(): Token[];
40
+ /**
41
+ * Get the next token
42
+ */
43
+ private nextToken;
44
+ private readWhitespace;
45
+ private readLineComment;
46
+ private readBlockComment;
47
+ private readString;
48
+ private readTemplateString;
49
+ private readNumber;
50
+ private readIdentifier;
51
+ private readDirective;
52
+ private advance;
53
+ private peek;
54
+ /**
55
+ * Save current state for backtracking
56
+ */
57
+ saveState(): TokenizerState;
58
+ /**
59
+ * Restore state for backtracking
60
+ */
61
+ restoreState(state: TokenizerState): void;
65
62
  }
63
+ /**
64
+ * Find matching closing delimiter, respecting nesting and strings
65
+ */
66
+ export declare function findMatchingDelimiter(source: string, openChar: string, closeChar: string, startPos?: number): number;
67
+ /**
68
+ * Extract a balanced expression from source starting at position
69
+ */
70
+ export declare function extractBalancedExpression(source: string, startPos: number): {
71
+ expression: string;
72
+ endPos: number;
73
+ };
74
+ /**
75
+ * Split expression by pipe (|) for filters, respecting nesting
76
+ */
77
+ export declare function splitByPipe(expression: string): string[];
@@ -1,3 +1,73 @@
1
+ /**
2
+ * Partial Hydration Module (Islands Architecture)
3
+ *
4
+ * Enables selective hydration of interactive components, leaving static
5
+ * content as plain HTML. This dramatically reduces JavaScript bundle size
6
+ * and improves page load performance.
7
+ *
8
+ * Hydration Strategies:
9
+ * - @client:load - Hydrate immediately on page load
10
+ * - @client:idle - Hydrate when browser is idle (requestIdleCallback)
11
+ * - @client:visible - Hydrate when component enters viewport (IntersectionObserver)
12
+ * - @client:media - Hydrate when media query matches
13
+ * - @client:only - Only render on client (no SSR)
14
+ * - @client:hover - Hydrate on first hover/focus
15
+ * - @client:event - Hydrate on custom event
16
+ *
17
+ * @example
18
+ * ```html
19
+ * @client:visible(rootMargin: '100px')
20
+ * <InteractiveCarousel :items="items" />
21
+ * @endclient
22
+ * ```
23
+ */
24
+ export type HydrationStrategy = 'load' | 'idle' | 'visible' | 'media' | 'only' | 'hover' | 'event';
25
+ export interface HydrationOptions {
26
+ /** Strategy for when to hydrate */
27
+ strategy: HydrationStrategy;
28
+ /** Priority for idle hydration (default: 'low') */
29
+ priority?: 'high' | 'low';
30
+ /** Root margin for intersection observer (visible strategy) */
31
+ rootMargin?: string;
32
+ /** Threshold for intersection observer */
33
+ threshold?: number | number[];
34
+ /** Media query string (media strategy) */
35
+ media?: string;
36
+ /** Event name to listen for (event strategy) */
37
+ event?: string;
38
+ /** Timeout in ms before forcing hydration */
39
+ timeout?: number;
40
+ /** Placeholder content while loading */
41
+ placeholder?: string;
42
+ /** Whether to preserve server HTML until hydration */
43
+ preserveServerHTML?: boolean;
44
+ }
45
+ export interface IslandComponent {
46
+ /** Unique identifier for the island */
47
+ id: string;
48
+ /** Component name or path */
49
+ component: string;
50
+ /** Props to pass to the component */
51
+ props: Record<string, unknown>;
52
+ /** Hydration options */
53
+ options: HydrationOptions;
54
+ /** Server-rendered HTML */
55
+ serverHTML: string;
56
+ /** Whether the island has been hydrated */
57
+ hydrated: boolean;
58
+ }
59
+ export interface IslandRegistry {
60
+ /** All registered islands */
61
+ islands: Map<string, IslandComponent>;
62
+ /** Register an island */
63
+ register: (island: IslandComponent) => void;
64
+ /** Get an island by ID */
65
+ get: (id: string) => IslandComponent | undefined;
66
+ /** Hydrate an island */
67
+ hydrate: (id: string) => Promise<void>;
68
+ /** Hydrate all islands */
69
+ hydrateAll: () => Promise<void>;
70
+ }
1
71
  /**
2
72
  * Create a registry for managing island components
3
73
  */
@@ -38,54 +108,16 @@ export declare function processStaticDirectives(template: string): string;
38
108
  * Generate island manifest for client
39
109
  */
40
110
  export declare function generateIslandManifest(islands: IslandComponent[]): string;
41
- export declare interface HydrationOptions {
42
- strategy: HydrationStrategy
43
- priority?: 'high' | 'low'
44
- rootMargin?: string
45
- threshold?: number | number[]
46
- media?: string
47
- event?: string
48
- timeout?: number
49
- placeholder?: string
50
- preserveServerHTML?: boolean
51
- }
52
- export declare interface IslandComponent {
53
- id: string
54
- component: string
55
- props: Record<string, unknown>
56
- options: HydrationOptions
57
- serverHTML: string
58
- hydrated: boolean
59
- }
60
- export declare interface IslandRegistry {
61
- islands: Map<string, IslandComponent>
62
- register: (island: IslandComponent) => void
63
- get: (id: string) => IslandComponent | undefined
64
- hydrate: (id: string) => Promise<void>
65
- hydrateAll: () => Promise<void>
66
- }
67
- // ============================================================================
68
- // Types
69
- // ============================================================================
70
- export type HydrationStrategy = | 'load'
71
- | 'idle'
72
- | 'visible'
73
- | 'media'
74
- | 'only'
75
- | 'hover'
76
- | 'event';
77
- // ============================================================================
78
- // Exports
79
- // ============================================================================
80
- export default {
81
- processPartialHydrationDirectives,
82
- processStaticDirectives,
83
- generatePartialHydrationCSS,
84
- generateIslandManifest,
85
- createIslandRegistry,
86
- hydrateIsland,
87
- hydrateByStrategy,
88
- hydrateAll,
89
- isHydrated,
90
- onHydrated,
111
+ declare const _default: {
112
+ processPartialHydrationDirectives: typeof processPartialHydrationDirectives;
113
+ processStaticDirectives: typeof processStaticDirectives;
114
+ generatePartialHydrationCSS: typeof generatePartialHydrationCSS;
115
+ generateIslandManifest: typeof generateIslandManifest;
116
+ createIslandRegistry: typeof createIslandRegistry;
117
+ hydrateIsland: typeof hydrateIsland;
118
+ hydrateByStrategy: typeof hydrateByStrategy;
119
+ hydrateAll: typeof hydrateAll;
120
+ isHydrated: typeof isHydrated;
121
+ onHydrated: typeof onHydrated;
91
122
  };
123
+ export default _default;