@memoized-dom/compiler 0.0.4 → 0.0.6

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 (190) hide show
  1. package/README.md +106 -28
  2. package/dist/analysis/access-table.d.ts +1 -1
  3. package/dist/analysis/access-table.d.ts.map +1 -1
  4. package/dist/analysis/component-graph.d.ts +16 -1
  5. package/dist/analysis/component-graph.d.ts.map +1 -1
  6. package/dist/analysis/component-reads.d.ts +1 -1
  7. package/dist/analysis/component-reads.d.ts.map +1 -1
  8. package/dist/analysis/computed.d.ts +9 -5
  9. package/dist/analysis/computed.d.ts.map +1 -1
  10. package/dist/analysis/instance-control-flow.d.ts +1 -1
  11. package/dist/analysis/instance-control-flow.d.ts.map +1 -1
  12. package/dist/analysis/instance.d.ts +3 -4
  13. package/dist/analysis/instance.d.ts.map +1 -1
  14. package/dist/analysis/module-discovery.d.ts +27 -0
  15. package/dist/analysis/module-discovery.d.ts.map +1 -0
  16. package/dist/analysis/opaque-volatility.d.ts +7 -0
  17. package/dist/analysis/opaque-volatility.d.ts.map +1 -0
  18. package/dist/analysis/runtime-pattern.d.ts +3 -4
  19. package/dist/analysis/runtime-pattern.d.ts.map +1 -1
  20. package/dist/analysis/type-candidates.d.ts +15 -3
  21. package/dist/analysis/type-candidates.d.ts.map +1 -1
  22. package/dist/analysis.d.ts +7 -4
  23. package/dist/analysis.d.ts.map +1 -1
  24. package/dist/ast/builders.d.ts +108 -0
  25. package/dist/ast/builders.d.ts.map +1 -0
  26. package/dist/ast/compiler-types.d.ts +196 -0
  27. package/dist/ast/compiler-types.d.ts.map +1 -0
  28. package/dist/ast/factory.d.ts +139 -0
  29. package/dist/ast/factory.d.ts.map +1 -0
  30. package/dist/ast/index.d.ts +15 -0
  31. package/dist/ast/index.d.ts.map +1 -0
  32. package/dist/ast/mutate.d.ts +17 -0
  33. package/dist/ast/mutate.d.ts.map +1 -0
  34. package/dist/ast/normalize.d.ts +9 -0
  35. package/dist/ast/normalize.d.ts.map +1 -0
  36. package/dist/ast/parser.d.ts +72 -0
  37. package/dist/ast/parser.d.ts.map +1 -0
  38. package/dist/ast/printer.d.ts +23 -0
  39. package/dist/ast/printer.d.ts.map +1 -0
  40. package/dist/ast/scope.d.ts +44 -0
  41. package/dist/ast/scope.d.ts.map +1 -0
  42. package/dist/ast/strip-typescript.d.ts +9 -0
  43. package/dist/ast/strip-typescript.d.ts.map +1 -0
  44. package/dist/ast/transform.d.ts +21 -0
  45. package/dist/ast/transform.d.ts.map +1 -0
  46. package/dist/ast/tsrx/frontend.d.ts +8 -0
  47. package/dist/ast/tsrx/frontend.d.ts.map +1 -0
  48. package/dist/ast/tsrx/index.d.ts +5 -0
  49. package/dist/ast/tsrx/index.d.ts.map +1 -0
  50. package/dist/ast/tsrx/lower.d.ts +8 -0
  51. package/dist/ast/tsrx/lower.d.ts.map +1 -0
  52. package/dist/ast/tsrx/style.d.ts +8 -0
  53. package/dist/ast/tsrx/style.d.ts.map +1 -0
  54. package/dist/ast/tsrx/types.d.ts +50 -0
  55. package/dist/ast/tsrx/types.d.ts.map +1 -0
  56. package/dist/ast/types.d.ts +478 -0
  57. package/dist/ast/types.d.ts.map +1 -0
  58. package/dist/ast/walk.d.ts +22 -0
  59. package/dist/ast/walk.d.ts.map +1 -0
  60. package/dist/cells.d.ts +10 -0
  61. package/dist/cells.d.ts.map +1 -0
  62. package/dist/compile.d.ts +30 -14
  63. package/dist/compile.d.ts.map +1 -1
  64. package/dist/component-linker.d.ts +5 -1
  65. package/dist/component-linker.d.ts.map +1 -1
  66. package/dist/components/callback-props.d.ts +1 -1
  67. package/dist/components/callback-props.d.ts.map +1 -1
  68. package/dist/components/calls.d.ts +1 -1
  69. package/dist/components/calls.d.ts.map +1 -1
  70. package/dist/components/children.d.ts +5 -3
  71. package/dist/components/children.d.ts.map +1 -1
  72. package/dist/components/declarations.d.ts +10 -3
  73. package/dist/components/declarations.d.ts.map +1 -1
  74. package/dist/components/jsx-values.d.ts +2 -4
  75. package/dist/components/jsx-values.d.ts.map +1 -1
  76. package/dist/components/local-derived.d.ts +1 -1
  77. package/dist/components/local-derived.d.ts.map +1 -1
  78. package/dist/components/manifest.d.ts +2 -3
  79. package/dist/components/manifest.d.ts.map +1 -1
  80. package/dist/components/prop-effects.d.ts.map +1 -1
  81. package/dist/components/prop-linker.d.ts.map +1 -1
  82. package/dist/components/prop-origins.d.ts +2 -0
  83. package/dist/components/prop-origins.d.ts.map +1 -1
  84. package/dist/components/prop-projections.d.ts.map +1 -1
  85. package/dist/components/prop-shape.d.ts +11 -0
  86. package/dist/components/prop-shape.d.ts.map +1 -0
  87. package/dist/components/props.d.ts +9 -1
  88. package/dist/components/props.d.ts.map +1 -1
  89. package/dist/components/ref-props.d.ts.map +1 -1
  90. package/dist/components/render-callbacks.d.ts +9 -5
  91. package/dist/components/render-callbacks.d.ts.map +1 -1
  92. package/dist/components/render-functions.d.ts +1 -0
  93. package/dist/components/render-functions.d.ts.map +1 -1
  94. package/dist/components/render-prelude.d.ts +1 -1
  95. package/dist/components/render-prelude.d.ts.map +1 -1
  96. package/dist/components/return-plan.d.ts +13 -7
  97. package/dist/components/return-plan.d.ts.map +1 -1
  98. package/dist/conds.d.ts +6 -3
  99. package/dist/conds.d.ts.map +1 -1
  100. package/dist/context/ast.d.ts +18 -5
  101. package/dist/context/ast.d.ts.map +1 -1
  102. package/dist/context/model.d.ts +146 -13
  103. package/dist/context/model.d.ts.map +1 -1
  104. package/dist/data-sources.d.ts +78 -0
  105. package/dist/data-sources.d.ts.map +1 -0
  106. package/dist/diagnostics.d.ts +20 -0
  107. package/dist/diagnostics.d.ts.map +1 -0
  108. package/dist/effects.d.ts +13 -5
  109. package/dist/effects.d.ts.map +1 -1
  110. package/dist/emission/component.d.ts +3 -3
  111. package/dist/emission/component.d.ts.map +1 -1
  112. package/dist/emission/conditional-region.d.ts +6 -5
  113. package/dist/emission/conditional-region.d.ts.map +1 -1
  114. package/dist/emission/dom-template.d.ts.map +1 -1
  115. package/dist/emission/list-region.d.ts +6 -4
  116. package/dist/emission/list-region.d.ts.map +1 -1
  117. package/dist/emission/node-emitter.d.ts +4 -3
  118. package/dist/emission/node-emitter.d.ts.map +1 -1
  119. package/dist/emission/render-callback.d.ts +4 -3
  120. package/dist/emission/render-callback.d.ts.map +1 -1
  121. package/dist/emission/route-region.d.ts +10 -0
  122. package/dist/emission/route-region.d.ts.map +1 -0
  123. package/dist/emission/scope.d.ts +14 -2
  124. package/dist/emission/scope.d.ts.map +1 -1
  125. package/dist/emit.d.ts +5 -4
  126. package/dist/emit.d.ts.map +1 -1
  127. package/dist/errors.d.ts +15 -0
  128. package/dist/errors.d.ts.map +1 -0
  129. package/dist/handler-commits.d.ts +6 -1
  130. package/dist/handler-commits.d.ts.map +1 -1
  131. package/dist/handler-origin.d.ts +1 -1
  132. package/dist/handler-origin.d.ts.map +1 -1
  133. package/dist/handlers/analyze.d.ts +1 -1
  134. package/dist/handlers/analyze.d.ts.map +1 -1
  135. package/dist/handlers/local-calls.d.ts +2 -2
  136. package/dist/handlers/local-calls.d.ts.map +1 -1
  137. package/dist/handlers.d.ts +6 -5
  138. package/dist/handlers.d.ts.map +1 -1
  139. package/dist/helper-summaries.d.ts +2 -3
  140. package/dist/helper-summaries.d.ts.map +1 -1
  141. package/dist/identifiers.d.ts +15 -8
  142. package/dist/identifiers.d.ts.map +1 -1
  143. package/dist/index.d.ts +6 -2
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/index.js +3 -1
  146. package/dist/jsx/attributes.d.ts +1 -1
  147. package/dist/jsx/attributes.d.ts.map +1 -1
  148. package/dist/jsx/children.d.ts +3 -2
  149. package/dist/jsx/children.d.ts.map +1 -1
  150. package/dist/jsx/conditional-directives.d.ts +21 -0
  151. package/dist/jsx/conditional-directives.d.ts.map +1 -0
  152. package/dist/jsx/dom-attributes.d.ts +1 -1
  153. package/dist/jsx/dom-attributes.d.ts.map +1 -1
  154. package/dist/jsx/dynamic-tags.d.ts +9 -15
  155. package/dist/jsx/dynamic-tags.d.ts.map +1 -1
  156. package/dist/jsx/events.d.ts +2 -3
  157. package/dist/jsx/events.d.ts.map +1 -1
  158. package/dist/jsx/refs.d.ts +5 -4
  159. package/dist/jsx/refs.d.ts.map +1 -1
  160. package/dist/jsx/svg.d.ts +2 -2
  161. package/dist/jsx/svg.d.ts.map +1 -1
  162. package/dist/jsx-types.d.ts +42 -0
  163. package/dist/jsx-types.d.ts.map +1 -0
  164. package/dist/lifecycle.d.ts +10 -5
  165. package/dist/lifecycle.d.ts.map +1 -1
  166. package/dist/linker.d.ts +56 -5
  167. package/dist/linker.d.ts.map +1 -1
  168. package/dist/lists/calculated-sources.d.ts +1 -1
  169. package/dist/lists/calculated-sources.d.ts.map +1 -1
  170. package/dist/lists/map-site.d.ts +16 -8
  171. package/dist/lists/map-site.d.ts.map +1 -1
  172. package/dist/lists/source-shapes.d.ts +12 -3
  173. package/dist/lists/source-shapes.d.ts.map +1 -1
  174. package/dist/lists/static-derived.d.ts +37 -0
  175. package/dist/lists/static-derived.d.ts.map +1 -0
  176. package/dist/lists/targeted-refresh.d.ts +9 -2
  177. package/dist/lists/targeted-refresh.d.ts.map +1 -1
  178. package/dist/lists.d.ts +1 -0
  179. package/dist/lists.d.ts.map +1 -1
  180. package/dist/module-control-flow.d.ts +7 -6
  181. package/dist/module-control-flow.d.ts.map +1 -1
  182. package/dist/mutation-analysis.d.ts +22 -8
  183. package/dist/mutation-analysis.d.ts.map +1 -1
  184. package/dist/plugin.d.ts +15 -14
  185. package/dist/plugin.d.ts.map +1 -1
  186. package/dist/router.d.ts +32 -0
  187. package/dist/router.d.ts.map +1 -0
  188. package/dist/server-functions.d.ts +49 -0
  189. package/dist/server-functions.d.ts.map +1 -0
  190. package/package.json +34 -30
@@ -0,0 +1,10 @@
1
+ /** Anchored DOM region controlled by one compiler-generated route match ID. */
2
+ import type * as t from '../ast/compiler-types';
3
+ import type { Ctx } from '../context';
4
+ import type { CompilerRouteElement } from '../router';
5
+ import type { EmitScope } from './scope';
6
+ import type { NodeEmitter } from './node-emitter';
7
+ type ComponentPath = Ctx['compPaths'] extends Map<string, infer TPath> ? TPath : never;
8
+ export declare function emitRouteRegion(ctx: Ctx, scope: EmitScope, element: t.JSXElement, route: CompilerRouteElement, componentName: string, componentPath: ComponentPath, emitNode: NodeEmitter, inSvg: boolean, ownerId: t.Expression): string;
9
+ export {};
10
+ //# sourceMappingURL=route-region.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-region.d.ts","sourceRoot":"","sources":["../../src/emission/route-region.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,KAAK,KAAK,CAAC,MAAM,uBAAuB,CAAC;AAGhD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,KAAK,aAAa,GAAG,GAAG,CAAC,WAAW,CAAC,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,GAClE,KAAK,GACL,KAAK,CAAC;AAEV,wBAAgB,eAAe,CAC7B,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,CAAC,CAAC,UAAU,EACrB,KAAK,EAAE,oBAAoB,EAC3B,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,CAAC,CAAC,UAAU,GACpB,MAAM,CAkJR"}
@@ -4,7 +4,7 @@
4
4
  * Owns per-factory slots, updater declarations, guarded writes, and entity
5
5
  * registration so emit.ts can focus on component and JSX structure.
6
6
  */
7
- import * as t from '@babel/types';
7
+ import type * as t from '../ast/compiler-types';
8
8
  import type { Ctx } from '../context';
9
9
  export interface EmitScope {
10
10
  slots: string[];
@@ -14,6 +14,10 @@ export interface EmitScope {
14
14
  reasonVar: string | null;
15
15
  /** Event name to compiler-private prebound list/event binding. */
16
16
  delegatedEventBindings: Map<string, string>;
17
+ /** Active renderer document, resolved once when this factory creates DOM. */
18
+ documentVar: string | null;
19
+ /** Factory-local setup emitted before authored and creation statements. */
20
+ prelude: t.Statement[];
17
21
  creation: t.Statement[];
18
22
  /** Lifecycle setup that runs only after this scope's full DOM is created. */
19
23
  mounts: t.Statement[];
@@ -26,6 +30,12 @@ export interface EmitScope {
26
30
  };
27
31
  textCounter: number;
28
32
  regionCounter: number;
33
+ /** Stable source-order identities for exact transparent-data sinks. */
34
+ dataSiteCounter: {
35
+ count: number;
36
+ };
37
+ /** Source routes already owned by an enclosing transparent region. */
38
+ coveredTransparentSources: Set<string>;
29
39
  /** Structural regions whose retained entries drain with this scope. */
30
40
  disposableRegions: string[];
31
41
  /** Component entity ids created lexically inside this scope. */
@@ -38,10 +48,12 @@ export interface EmitScope {
38
48
  manualDisposal: boolean;
39
49
  }
40
50
  export declare function newEmitScope(ctx: Ctx, manualDisposal?: boolean): EmitScope;
51
+ /** Resolve the active renderer document once per DOM-producing factory. */
52
+ export declare function renderDocument(ctx: Ctx, scope: EmitScope): t.Identifier;
41
53
  export declare function cacheDecl(scope: EmitScope): t.Statement;
42
54
  export declare function freshSlot(ctx: Ctx, scope: EmitScope): string;
43
55
  export declare function freshNodeName(ctx: Ctx, scope: EmitScope, tag: string): string;
44
56
  export declare function slotGuard(scope: EmitScope, slot: string, expression: t.Expression, write: (value: t.Identifier) => t.Statement): t.Statement;
45
57
  export declare function updateDecl(scope: EmitScope): t.Statement;
46
- export declare function registerStmt(ctx: Ctx, id: t.Expression, parent: t.Expression, render: t.Expression): t.Statement;
58
+ export declare function registerStmt(ctx: Ctx, id: t.Expression, parent: t.Expression, render: t.Expression, volatile?: boolean): t.Statement;
47
59
  //# sourceMappingURL=scope.d.ts.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,GAAG,CAAC,CAAC,UAAU,CAgBvE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,CAAC,CAAC,SAAS,CAKvD;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAI5D;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAIR;AAED,wBAAgB,SAAS,CACvB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,CAAC,CAAC,UAAU,EACxB,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,SAAS,GAC1C,CAAC,CAAC,SAAS,CAcb;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,CAAC,CAAC,SAAS,CAiBxD;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,CAAC,CAAC,UAAU,EAChB,MAAM,EAAE,CAAC,CAAC,UAAU,EACpB,MAAM,EAAE,CAAC,CAAC,UAAU,EACpB,QAAQ,UAAQ,GACf,CAAC,CAAC,SAAS,CAab"}
package/dist/emit.d.ts CHANGED
@@ -12,18 +12,19 @@
12
12
  * entity factory of its own (own slots, own update, register parent=id),
13
13
  * created per item by the region.
14
14
  */
15
- import type { NodePath } from '@babel/traverse';
16
- import * as t from '@babel/types';
15
+ import type * as t from './ast/compiler-types';
17
16
  import { type Ctx, type RowCtx } from './context';
18
17
  import { type EmitScope } from './emission/scope';
19
18
  import { type JsxNode } from './jsx/children';
20
- export declare function emitNode(ctx: Ctx, scope: EmitScope, node: JsxNode, compName: string, compPath: NodePath<t.FunctionDeclaration>, nestedIn?: 'row' | 'cond' | null, rowCtx?: RowCtx, eventOriginId?: t.Expression, inSvg?: boolean, ownerId?: t.Expression): string;
19
+ type ComponentPath = Ctx['compPaths'] extends Map<string, infer TPath> ? TPath : never;
20
+ export declare function emitNode(ctx: Ctx, scope: EmitScope, node: JsxNode, compName: string, compPath: ComponentPath, nestedIn?: 'row' | 'cond' | null, rowCtx?: RowCtx, eventOriginId?: t.Expression, inSvg?: boolean, ownerId?: t.Expression): string;
21
21
  /**
22
22
  * A branch is a small factory: own slot cache, own guarded update closure,
23
23
  * NO register (branches are not entities — a swap just removes their nodes).
24
24
  * Emitted into a fresh EmitScope so variables and slots never collide.
25
25
  */
26
- export declare function buildBranchCreate(ctx: Ctx, jsx: JsxNode, compName: string, compPath: NodePath<t.FunctionDeclaration>, regionId: t.Expression, inSvg?: boolean, ownerId?: t.Expression, allowConditions?: boolean, usedConds?: {
26
+ export declare function buildBranchCreate(ctx: Ctx, jsx: JsxNode, compName: string, compPath: ComponentPath, regionId: t.Expression, inSvg?: boolean, ownerId?: t.Expression, allowConditions?: boolean, usedConds?: {
27
27
  count: number;
28
28
  }): t.ArrowFunctionExpression;
29
+ export {};
29
30
  //# sourceMappingURL=emit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../src/emit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAIL,KAAK,GAAG,EACR,KAAK,MAAM,EACZ,MAAM,WAAW,CAAC;AAMnB,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAC;AAc1B,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAC;AAkIxB,wBAAgB,QAAQ,CACtB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,EACzC,Q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AAC,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,CAAC,CAAC,UAAU,EAC5B,KAAK,UAAQ,EACb,OAAO,GAAE,CAAC,CAAC,UAAuC,GACjD,MAAM,CA0BR;AAojCD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,CAAC,CAAC,UAAU,EACtB,KAAK,UAAQ,EACb,OAAO,GAAE,CAAC,CAAC,UAAqB,EAChC,eAAe,UAAQ,EACvB,SAAS,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAC5B,CAAC,CAAC,uBAAuB,CAa3B"}
@@ -0,0 +1,15 @@
1
+ import type { BaseNode } from './ast';
2
+ export interface CompilerErrorLocation {
3
+ line: number;
4
+ column: number;
5
+ endLine?: number;
6
+ endColumn?: number;
7
+ }
8
+ /** Compiler-owned error carrying an authored ESTree source location. */
9
+ export declare class MemoizedDomCompilerError extends Error {
10
+ readonly moduleId?: string;
11
+ readonly loc?: CompilerErrorLocation;
12
+ constructor(message: string, moduleId?: string, at?: BaseNode | null);
13
+ }
14
+ export declare function compilerError(message: string, moduleId?: string, at?: BaseNode | null): MemoizedDomCompilerError;
15
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wEAAwE;AACxE,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,CAAC,EAAE,qBAAqB,CAAC;IAErC,YAAY,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,EAenE;CACF;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EACjB,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,GACnB,wBAAwB,CAE1B"}
@@ -4,10 +4,14 @@
4
4
  * Converts analyzed scope effects into local, routed, or unbounded
5
5
  * invalidation statements and inserts them on every normal function exit.
6
6
  */
7
- import * as t from '@babel/types';
7
+ import type * as t from './ast/compiler-types';
8
8
  import { type Ctx, type RowCtx } from './context';
9
9
  export interface ScopeWrites {
10
10
  writes: Set<string>;
11
+ /** Writes proven to affect a rendered collection's structure only. */
12
+ structuralWrites: Set<string>;
13
+ /** Writes whose effect on retained row content is not structurally bounded. */
14
+ contentWrites: Set<string>;
11
15
  rootFallback: boolean;
12
16
  /** This scope writes fields observed by one keyed row. */
13
17
  rowLocal: boolean;
@@ -21,6 +25,7 @@ export interface ScopeWrites {
21
25
  eventOrigin: t.Statement | null;
22
26
  }
23
27
  export declare function createScopeWrites(): ScopeWrites;
28
+ export declare function recordRoutedWrite(scope: ScopeWrites, source: string, structural?: boolean): void;
24
29
  /** Record an exact write to state owned by one component instance. */
25
30
  export declare function recordInstanceWrite(scope: ScopeWrites, source: string): void;
26
31
  /** Build the static commit form for one analyzed function scope. */
@@ -1 +1 @@
1
- {"version":3,"file":"handler-commits.d.ts","sourceRoot":"","sources":["../src/handler-commits.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAGL,KAAK,GAAG,EACR,KAAK,MAAM,EACZ,MAAM,WAAW,CAAC;AAOnB,MAAM,WAAW,WAAW;IAC1B,MAAM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,CAAC,CAAC;IAC9B,+EAA+E;IAC/E,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,0DAA0D;IAC1D,QAAQ,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,aAAa,EAAE,OAAO,CAAC;IACvB,+DAA+D;IAC/D,aAAa,EAAE,OAAO,CAAC;IACvB,0DAA0D;IAC1D,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,oEAAoE;IACpE,WAAW,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;CACjC;AAED,wBAAgB,iBAAiB,IAAI,WAAW,CAY/C;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,EACd,UAAU,UAAQ,GACjB,IAAI,CAGN;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,GACb,IAAI,CAGN;AAED,oEAAoE;AACpE,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,CAAC,EAAE,MAAM,GACd,CAAC,CAAC,SAAS,GAAG,IAAI,CAkGpB;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,CAAC,CAAC,uBAAuB,GAAG,CAAC,CAAC,kBAAkB,GAAG,CAAC,CAAC,mBAAmB,EAC5E,MAAM,EAAE,CAAC,CAAC,SAAS,GAClB,IAAI,CAcN"}
@@ -4,7 +4,7 @@
4
4
  * Produces the nearest entity refresh for write-free event handlers and wraps
5
5
  * shared module handlers when their declaration cannot close over a site ID.
6
6
  */
7
- import * as t from '@babel/types';
7
+ import type * as t from './ast/compiler-types';
8
8
  import type { Ctx, RowCtx } from './context';
9
9
  /** The nearest update unit from which an event-triggered render starts. */
10
10
  export declare function buildEventOriginCommit(ctx: Ctx, compName: string | null, rowCtx?: RowCtx, eventOriginId?: t.Expression): t.Statement;
@@ -1 +1 @@
1
- {"version":3,"file":"handler-origin.d.ts","sourceRoot":"","sources":["../src/handler-origin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAO7C,2EAA2E;AAC3E,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,CAAC,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,CAAC,CAAC,UAAU,GAC3B,CAAC,CAAC,SAAS,CAgBb;AAED,8EAA8E;AAC9E,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,CAAC,CAAC,UAAU,EACrB,YAAY,EAAE,CAAC,CAAC,SAAS,GACxB,CAAC,CAAC,uBAAuB,CAgB3B"}
1
+ {"version":3,"file":"handler-origin.d.ts","sourceRoot":"","sources":["../src/handler-origin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,CAAC,MAAM,sBAAsB,CAAC;AAG/C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAO7C,2EAA2E;AAC3E,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,CAAC,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,CAAC,CAAC,UAAU,GAC3B,CAAC,CAAC,SAAS,CAgBb;AAED,8EAA8E;AAC9E,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,CAAC,CAAC,UAAU,EACrB,YAAY,EAAE,CAAC,CAAC,SAAS,GACxB,CAAC,CAAC,uBAAuB,CAgB3B"}
@@ -1,4 +1,4 @@
1
- import * as t from '@babel/types';
1
+ import type * as t from '../ast/compiler-types';
2
2
  import { type Ctx, type RowCtx } from '../context';
3
3
  export declare function analyzeHandler(ctx: Ctx, rootFn: t.ArrowFunctionExpression | t.FunctionExpression | t.FunctionDeclaration, compName: string | null, rowCtx?: RowCtx, eventBoundary?: boolean, eventOriginId?: t.Expression, executionAwareRoot?: boolean): void;
4
4
  //# sourceMappingURL=analyze.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/handlers/analyze.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAIL,KAAK,GAAG,EAER,KAAK,MAAM,EACZ,MAAM,YAAY,CAAC;AAmIpB,wBAAgB,cAAc,CAC5B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,CAAC,CAAC,uBAAuB,GAAG,CAAC,CAAC,kBAAkB,GAAG,CAAC,CAAC,mBAAmB,EAChF,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,CAAC,EAAE,MAAM,EACf,aAAa,UAAQ,EACrB,aAAa,CAAC,EAAE,CAAC,CAAC,UAAU,EAC5B,kBAAkB,UAAQ,GACzB,IAAI,CAs0BN"}
1
+ {"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/handlers/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,uBAAuB,CAAC;AAahD,OAAO,EAIL,KAAK,GAAG,EAER,KAAK,MAAM,EACZ,MAAM,YAAY,CAAC;AAiWpB,wBAAgB,cAAc,CAC5B,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,CAAC,CAAC,uBAAuB,GAAG,CAAC,CAAC,kBAAkB,GAAG,CAAC,CAAC,mBAAmB,EAChF,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,CAAC,EAAE,MAAM,EACf,aAAa,UAAQ,EACrB,aAAa,CAAC,EAAE,CAAC,CAAC,UAAU,EAC5B,kBAAkB,UAAQ,GACzB,IAAI,CAw8BN"}
@@ -6,6 +6,6 @@
6
6
  * Calls inside nested callbacks are deliberately ignored: those callbacks
7
7
  * have their own execution boundary and are instrumented separately.
8
8
  */
9
- import type { HandlerFn } from '../handlers';
10
- export declare function callsOnlyCommittedLocalHelpers(root: HandlerFn, isCommittedHelper: (name: string) => boolean): boolean;
9
+ import { type BaseNode } from '../ast';
10
+ export declare function callsOnlyCommittedLocalHelpers(root: BaseNode, isCommittedHelper: (name: string) => boolean): boolean;
11
11
  //# sourceMappingURL=local-calls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-calls.d.ts","sourceRoot":"","sources":["../../src/handlers/local-calls.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,SAAS,EACf,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAC3C,OAAO,CAoCT"}
1
+ {"version":3,"file":"local-calls.d.ts","sourceRoot":"","sources":["../../src/handlers/local-calls.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AA2BhD,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,QAAQ,EACd,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAC3C,OAAO,CAwBT"}
@@ -18,23 +18,24 @@
18
18
  * `items.push()` and `items.filter()` invalidate the same readers, whose
19
19
  * memoized update guards absorb unchanged values.
20
20
  */
21
- import type { NodePath } from '@babel/traverse';
22
- import * as t from '@babel/types';
21
+ import type * as t from './ast/compiler-types';
23
22
  import { type Ctx, type RowCtx } from './context';
24
23
  export type HandlerFn = t.ArrowFunctionExpression | t.FunctionExpression | t.FunctionDeclaration;
24
+ type ComponentPath = Ctx['compPaths'] extends Map<string, infer TPath> ? TPath : never;
25
25
  /** Resolve a component-local helper declared directly in the factory body. */
26
- export declare function resolveLocalHelper(compPath: NodePath<t.FunctionDeclaration>, name: string): HandlerFn | null;
26
+ export declare function resolveLocalHelper(ctx: Ctx, compPath: ComponentPath, name: string): HandlerFn | null;
27
27
  /**
28
28
  * Instrument a callback that executes outside the component's synchronous
29
29
  * factory call. The callback owns its normal-exit commit; no event boundary
30
30
  * or exception wrapper is introduced.
31
31
  */
32
- export declare function instrumentComponentCallback(ctx: Ctx, compPath: NodePath<t.FunctionDeclaration>, target: HandlerFn, compName: string, rowCtx?: RowCtx, executionAwareRoot?: boolean): void;
32
+ export declare function instrumentComponentCallback(ctx: Ctx, compPath: ComponentPath, target: HandlerFn, compName: string, rowCtx?: RowCtx, executionAwareRoot?: boolean): void;
33
33
  /** Instrument a module-owned callback through canonical access-table writes. */
34
34
  export declare function instrumentSharedCallback(ctx: Ctx, target: HandlerFn, executionAwareRoot?: boolean): void;
35
35
  /**
36
36
  * Resolve a JSX handler attribute to an analyzable function, augmenting
37
37
  * named `const` handlers in place. Returns the expression to assign.
38
38
  */
39
- export declare function buildHandler(ctx: Ctx, compPath: NodePath<t.FunctionDeclaration>, value: t.Expression, attrName: string, compName: string, rowCtx?: RowCtx, eventOriginId?: t.Expression): t.Expression;
39
+ export declare function buildHandler(ctx: Ctx, compPath: ComponentPath, value: t.Expression, attrName: string, compName: string, rowCtx?: RowCtx, eventOriginId?: t.Expression): t.Expression;
40
+ export {};
40
41
  //# sourceMappingURL=handlers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../src/handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,CAAC,MAAM,cAAc,CA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AAC;AAkBnB,MAAM,MAAM,SAAS,GACjB,CAAC,CAAC,uBAAuB,GACzB,CAAC,CAAC,kBAAkB,GACpB,CAAC,CAAC,mBAAmB,CAAC;AAE1B,KAAK,aAAa,GAAG,GAAG,CAAC,WAAW,CAAC,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,GAClE,KAAK,GACL,KAAK,CAAC;AAaV,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,GACX,SAAS,GAAG,IAAI,CAwBlB;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,kBAAkB,UAAQ,GACzB,IAAI,CAaN;AAED,gFAAgF;AAChF,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,SAAS,EACjB,kBAAkB,UAAQ,GACzB,IAAI,CAYN;AAmCD;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,CAAC,CAAC,UAAU,EACnB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,CAAC,CAAC,UAAU,GAC3B,CAAC,CAAC,UAAU,CAsKd"}
@@ -1,10 +1,9 @@
1
1
  /**
2
- * helper-summaries.ts - interprocedural effects for module-local helpers.
2
+ * Interprocedural read/write summaries for module-local helpers.
3
3
  *
4
4
  * Summaries distinguish exact writes from effects conservatively bounded to
5
5
  * a receiver. Parameter receiver effects are retained by argument position,
6
- * so callers can map them back to their own state. Only effects with no
7
- * finite receiver/argument boundary are unbounded.
6
+ * so callers can map them back to their own state.
8
7
  */
9
8
  import { type Ctx, type FnSummary } from './context';
10
9
  /** Read/write summary of a module-level helper, memoized and cycle-safe. */
@@ -1 +1 @@
1
- {"version":3,"file":"helper-summaries.d.ts","sourceRoot":"","sources":["../src/helper-summaries.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAEL,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,WAAW,CAAC;AAWnB,4EAA4E;AAC5E,wBAAgB,eAAe,CAC7B,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,GAAG,CAAC,MAAM,CAAa,GAChC,SAAS,CA2RX"}
1
+ {"version":3,"file":"helper-summaries.d.ts","sourceRoot":"","sources":["../src/helper-summaries.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAKL,KAAK,GAAG,EACR,KAAK,SAAS,EACf,MAAM,WAAW,CAAC;AA+EnB,4EAA4E;AAC5E,wBAAgB,eAAe,CAC7B,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,GAAG,CAAC,MAAM,CAAa,GAChC,SAAS,CAuTX"}
@@ -1,19 +1,22 @@
1
1
  /**
2
2
  * identifiers.ts - compiler-wide lexical binding allocation.
3
3
  *
4
- * Every compiler-owned binding is reserved through one Babel Program scope.
5
- * Source identifiers from descendant scopes are also reserved so generated
6
- * outer bindings cannot be shadowed inside user callbacks.
4
+ * Source identifiers from every descendant scope are reserved so generated
5
+ * outer bindings cannot be shadowed inside user callbacks. Allocation mirrors
6
+ * Babel's historical UID sequence while remaining parser/scope independent.
7
7
  */
8
- import type { NodePath, Scope } from '@babel/traverse';
9
- import * as t from '@babel/types';
8
+ import type * as t from './ast/compiler-types';
9
+ import { type BaseNode } from './ast';
10
10
  export declare class GeneratedIdentifiers {
11
- private readonly scope;
12
11
  readonly runtimeId: string;
12
+ readonly hotRuntimeId: string;
13
+ readonly routerId: string;
14
+ readonly dataRuntimeId: string;
13
15
  private readonly reserved;
14
16
  private readonly componentIds;
15
- constructor(scope: Scope, programPath: NodePath<t.Program>);
17
+ constructor(program: BaseNode);
16
18
  generate(hint: string): t.Identifier;
19
+ generateComponent(hint: string): t.Identifier;
17
20
  registerComponentId(component: string, id: string): void;
18
21
  componentId(component: string): t.Identifier;
19
22
  runtimeMember(name: string): t.MemberExpression;
@@ -21,9 +24,13 @@ export declare class GeneratedIdentifiers {
21
24
  export interface IdentifierOwner {
22
25
  identifiers: GeneratedIdentifiers | null;
23
26
  }
24
- export declare function initializeGeneratedIdentifiers(owner: IdentifierOwner, programPath: NodePath<t.Program>): GeneratedIdentifiers;
27
+ export declare function initializeGeneratedIdentifiers(owner: IdentifierOwner, program: BaseNode): GeneratedIdentifiers;
25
28
  export declare function generatedIdentifier(owner: IdentifierOwner, hint: string): t.Identifier;
29
+ export declare function generatedComponentIdentifier(owner: IdentifierOwner, hint: string): t.Identifier;
26
30
  export declare function componentId(owner: IdentifierOwner, component: string): t.Identifier;
27
31
  export declare function md(owner: IdentifierOwner, name: string): t.MemberExpression;
32
+ export declare function mdHot(owner: IdentifierOwner, name: string): t.MemberExpression;
33
+ export declare function mr(owner: IdentifierOwner, name: string): t.MemberExpression;
34
+ export declare function mdd(owner: IdentifierOwner, name: string): t.MemberExpression;
28
35
  export declare function requireIdentifiers(owner: IdentifierOwner): GeneratedIdentifiers;
29
36
  //# sourceMappingURL=identifiers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"identifiers.d.ts","sourceRoot":"","sources":["../src/identifiers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,qBAAa,oBAAoB;IAKnB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJlC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,OAAO,CA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AAK,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,gBAAgB,CAM9E;AAED,wBAAgB,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,gBAAgB,CAM3E;AAED,wBAAgB,GAAG,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,gBAAgB,CAM5E;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,oBAAoB,CAK/E"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  /** Public compiler package entry. */
2
- export { compile, type MemoDomOptions } from './compile';
3
- export { compileModules, type CompileModulesOptions, } from './linker';
2
+ export { compile, compileDetailed, type CompiledSource, type CompileOptions, type CompilerSourceMap, type MemoDomOptions, } from './compile';
3
+ export { createExtensionEstreeFrontend, parseWithEstreeFrontend, parseWithEstreeFrontendOrThrow, yukuEstreeFrontend, type EstreeFrontend, type ParseEstreeOptions, type ParsedEstree, } from './ast/parser';
4
+ export { experimentalTsrxEstreeFrontend, memoizedEstreeFrontend, parseTsrxEstree, } from './ast/tsrx';
5
+ export { compileModules, compileModulesDetailed, type CompiledComponentExport, type CompiledFunctionExport, type CompiledModuleMetadata, type CompiledModules, type CompiledStateExport, type CompileModulesOptions, } from './linker';
6
+ export { compilerDiagnosticCode, compilerDiagnosticSource, diagnose, diagnoseModules, toCompilerDiagnostic, type CompilerDiagnostic, } from './diagnostics';
7
+ export { analyzeServerFunctionModule, generateServerFunctionClient, generateServerFunctionDeclarations, serverFunctionModuleName, type AnalyzeServerFunctionOptions, type ServerFunctionDeclarationOptions, type ServerFunctionDefinition, type ServerFunctionMethod, type ServerFunctionModule, type ServerFunctionParameter, type ServerFunctionQueryKind, } from './server-functions';
4
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,GAC3B,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,OAAO,EACL,OAAO,EACP,eAAe,EACf,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,8BAA8B,EAC9B,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EACtB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,QAAQ,EACR,eAAe,EACf,oBAAoB,EACpB,KAAK,kBAAkB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,kCAAkC,EAClC,wBAAwB,EACxB,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EACrC,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAC"}