@torpor/view 0.4.18 → 1.0.1

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 (72) hide show
  1. package/README.md +41 -16
  2. package/dist/Cleanup-D0wvGW5d.d.cts +9 -0
  3. package/dist/Cleanup-D0wvGW5d.d.cts.map +1 -0
  4. package/dist/Cleanup-D0wvGW5d.d.mts +9 -0
  5. package/dist/Cleanup-D0wvGW5d.d.mts.map +1 -0
  6. package/dist/Component-0MH0zd-m.d.cts +11 -0
  7. package/dist/Component-0MH0zd-m.d.cts.map +1 -0
  8. package/dist/Component-0MH0zd-m.d.mts +11 -0
  9. package/dist/Component-0MH0zd-m.d.mts.map +1 -0
  10. package/dist/Effect-BTKurOpr.d.mts +381 -0
  11. package/dist/Effect-BTKurOpr.d.mts.map +1 -0
  12. package/dist/Effect-COl3aRJV.d.cts +381 -0
  13. package/dist/Effect-COl3aRJV.d.cts.map +1 -0
  14. package/dist/compile.cjs +1734 -739
  15. package/dist/compile.d.cts +85 -50
  16. package/dist/compile.d.cts.map +1 -1
  17. package/dist/compile.d.mts +85 -50
  18. package/dist/compile.d.mts.map +1 -1
  19. package/dist/compile.mjs +1737 -741
  20. package/dist/compile.mjs.map +1 -1
  21. package/dist/dev.cjs +62 -63
  22. package/dist/dev.d.cts +4 -3
  23. package/dist/dev.d.cts.map +1 -1
  24. package/dist/dev.d.mts +4 -3
  25. package/dist/dev.d.mts.map +1 -1
  26. package/dist/dev.mjs +61 -62
  27. package/dist/dev.mjs.map +1 -1
  28. package/dist/{devContext-B3yskfhA.cjs → devContext-BulTn3U5.cjs} +6 -9
  29. package/dist/{devContext-CQ8RhBX-.mjs → devContext-ZNsPyOgB.mjs} +3 -4
  30. package/dist/devContext-ZNsPyOgB.mjs.map +1 -0
  31. package/dist/fromWebSocket-1QOjcrHE.cjs +182 -0
  32. package/dist/fromWebSocket-B52kN3-W.d.mts +91 -0
  33. package/dist/fromWebSocket-B52kN3-W.d.mts.map +1 -0
  34. package/dist/fromWebSocket-DeB35Q4w.d.cts +91 -0
  35. package/dist/fromWebSocket-DeB35Q4w.d.cts.map +1 -0
  36. package/dist/fromWebSocket-Dxc_uwm1.mjs +137 -0
  37. package/dist/fromWebSocket-Dxc_uwm1.mjs.map +1 -0
  38. package/dist/index.cjs +2109 -494
  39. package/dist/index.d.cts +608 -112
  40. package/dist/index.d.cts.map +1 -1
  41. package/dist/index.d.mts +608 -112
  42. package/dist/index.d.mts.map +1 -1
  43. package/dist/index.mjs +2088 -490
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/ssr.cjs +78 -17
  46. package/dist/ssr.d.cts +64 -11
  47. package/dist/ssr.d.cts.map +1 -1
  48. package/dist/ssr.d.mts +64 -11
  49. package/dist/ssr.d.mts.map +1 -1
  50. package/dist/ssr.mjs +67 -14
  51. package/dist/ssr.mjs.map +1 -1
  52. package/package.json +21 -19
  53. package/dist/Cleanup-CYsytTEc.d.cts +0 -9
  54. package/dist/Cleanup-CYsytTEc.d.cts.map +0 -1
  55. package/dist/Cleanup-CgjyN0lW.d.mts +0 -9
  56. package/dist/Cleanup-CgjyN0lW.d.mts.map +0 -1
  57. package/dist/Component-DmWGMgak.d.mts +0 -11
  58. package/dist/Component-DmWGMgak.d.mts.map +0 -1
  59. package/dist/Component-kGLRFYg2.d.cts +0 -11
  60. package/dist/Component-kGLRFYg2.d.cts.map +0 -1
  61. package/dist/Region-Bb6HAb-F.d.cts +0 -201
  62. package/dist/Region-Bb6HAb-F.d.cts.map +0 -1
  63. package/dist/Region-CTchywkr.d.mts +0 -201
  64. package/dist/Region-CTchywkr.d.mts.map +0 -1
  65. package/dist/devContext-CQ8RhBX-.mjs.map +0 -1
  66. package/dist/formatText-BNP3P38F.d.cts +0 -17
  67. package/dist/formatText-BNP3P38F.d.cts.map +0 -1
  68. package/dist/formatText-D6Ov8Ub0.d.mts +0 -17
  69. package/dist/formatText-D6Ov8Ub0.d.mts.map +0 -1
  70. package/dist/formatText-DTIRmc3X.mjs +0 -61
  71. package/dist/formatText-DTIRmc3X.mjs.map +0 -1
  72. package/dist/formatText-Dhl2O0Ee.cjs +0 -96
@@ -1,5 +1,4 @@
1
- import { t as Component } from "./Component-kGLRFYg2.cjs";
2
-
1
+ import { t as Component } from "./Component-0MH0zd-m.cjs";
3
2
  //#region src/compile/types/Import.d.ts
4
3
  interface Import {
5
4
  name: string;
@@ -31,6 +30,7 @@ interface Fragment {
31
30
  spans: SourceSpan[];
32
31
  offsets: number[];
33
32
  lengths: number[];
33
+ forVarMask?: number;
34
34
  }[];
35
35
  events: {
36
36
  varName: string;
@@ -39,10 +39,36 @@ interface Fragment {
39
39
  }[];
40
40
  animations: string[];
41
41
  endVarName?: string;
42
+ /**
43
+ * The variable name holding the fragment's first DOM node (the root).
44
+ * Used to restore the active region's `startNode` during hydration —
45
+ * child component rendering (via `addElement`) can overwrite it before
46
+ * `addFragment` runs.
47
+ */
48
+ rootVarName?: string;
49
+ /**
50
+ * Set during `buildFragmentText` when the fragment has exactly one
51
+ * rendering root child and that child is an `Element`. The compiler then
52
+ * emits the `t_fragment_el` / `t_root_el` / `t_add_element` path, which
53
+ * clones the cached template's `firstElementChild` directly into the
54
+ * parent — skipping the per-instance `DocumentFragment` wrapper that
55
+ * `getFragment` produces. Wins on per-row allocation in bulk-create paths
56
+ * (e.g. `@for` rows in the js-framework-bench `run`/`add`/`runlots` ops).
57
+ */
58
+ singleRootElement?: boolean;
59
+ /**
60
+ * `false` when the fragment is never rendered through the
61
+ * `buildFragment` cache path (which is what references the `t_fragments`
62
+ * / `t_fragment_els` arrays). Currently only `@html` branches, which build
63
+ * their content at runtime from an innerHTML string and only use the
64
+ * fragment's `number` for naming. Excludes such fragments from the
65
+ * decision to declare `t_fragments`, avoiding an unused declaration.
66
+ */
67
+ usesFragmentCache?: boolean;
42
68
  }
43
69
  //#endregion
44
70
  //#region src/compile/types/nodes/NodeType.d.ts
45
- type NodeType = "root" | "control" | "component" | "element" | "text" | "special";
71
+ type NodeType = "root" | "control" | "component" | "element" | "text" | "special" | "comment";
46
72
  //#endregion
47
73
  //#region src/compile/types/nodes/TemplateNode.d.ts
48
74
  interface TemplateNode {
@@ -65,23 +91,16 @@ interface RootNode extends ParentNode {
65
91
  fragment?: Fragment;
66
92
  }
67
93
  //#endregion
68
- //#region src/compile/types/styles/Attribute.d.ts
69
- interface Attribute {
70
- name: string;
71
- value: string;
72
- }
73
- //#endregion
74
- //#region src/compile/types/styles/StyleBlock.d.ts
75
- interface StyleBlock {
76
- selector: string;
77
- attributes: Attribute[];
78
- children: StyleBlock[];
94
+ //#region src/compile/types/styles/StyleNode.d.ts
95
+ interface StyleNode {
96
+ type: "block" | "attribute" | "comment";
97
+ gapBefore: boolean;
79
98
  }
80
99
  //#endregion
81
100
  //#region src/compile/types/styles/Style.d.ts
82
101
  interface Style {
83
102
  global: boolean;
84
- blocks: StyleBlock[];
103
+ children: StyleNode[];
85
104
  hash: string;
86
105
  }
87
106
  //#endregion
@@ -98,9 +117,17 @@ interface TemplateComponent {
98
117
  documentation?: string;
99
118
  /** Params declared by the user in the component's function */
100
119
  params?: string;
120
+ /** Type parameters declared by the user in the component's function, e.g. `<Data = any>` */
121
+ typeParams?: string;
101
122
  markup?: RootNode;
123
+ /** The markup of the component's top-level `@error` block, if any */
124
+ error?: RootNode;
125
+ /** The variable name bound to the error in the `@error` block */
126
+ errorVar?: string;
102
127
  head?: RootNode;
103
128
  style?: Style;
129
+ /** The index of the component's first script chunk in the template's script list */
130
+ scriptStart?: number;
104
131
  /** The type or interface that is used for the $props param */
105
132
  propsType?: string;
106
133
  /** $props that are used in the component's function */
@@ -113,8 +140,8 @@ interface TemplateComponent {
113
140
  //#endregion
114
141
  //#region src/types/Template.d.ts
115
142
  /**
116
- * The template for a component file, consisting of parts like script, markup and styles
117
- */
143
+ * The template for a component file, consisting of parts like script, markup and styles
144
+ */
118
145
  interface Template {
119
146
  imports: Import[];
120
147
  script: ScriptChunk[];
@@ -124,28 +151,36 @@ interface Template {
124
151
  //#region src/compile/types/BuildOptions.d.ts
125
152
  interface BuildOptions {
126
153
  /**
127
- * Whether to create the component for server side rendering
128
- */
154
+ * Whether to create the component for server side rendering
155
+ */
129
156
  server?: boolean;
130
157
  /**
131
- * Whether to create source maps
132
- */
158
+ * Whether to create source maps
159
+ */
133
160
  mapped?: boolean;
134
161
  /**
135
- * Whether to add debugging info etc for development mode
136
- */
162
+ * Whether to add debugging info etc for development mode
163
+ */
137
164
  dev?: boolean;
138
165
  /**
139
- * If true, fragments will be built with calls to createElement etc. If
140
- * false, fragments will be built with innerHTML. Using createElement is a
141
- * bit slower, but may be useful in the future for rendering to different
142
- * targets
143
- */
166
+ * If true, fragments will be built with calls to createElement etc. If
167
+ * false, fragments will be built with innerHTML. Using createElement is a
168
+ * bit slower, but may be useful in the future for rendering to different
169
+ * targets
170
+ */
144
171
  useCreateElement?: boolean;
145
172
  /**
146
- * For internal testing and benchmarking
147
- */
173
+ * For internal testing and benchmarking
174
+ */
148
175
  renderFolder?: string;
176
+ /**
177
+ * Whether to preserve all whitespace text nodes from the template.
178
+ * When false (the default), whitespace is trimmed Svelte 5-style:
179
+ * pure-whitespace nodes at the start/end of a container are removed,
180
+ * and pure-whitespace nodes between siblings are collapsed to a single
181
+ * space. Whitespace inside `pre`, `textarea`, and `code` is always kept.
182
+ */
183
+ preserveWhitespace?: boolean;
149
184
  }
150
185
  //#endregion
151
186
  //#region src/compile/types/SourceMapping.d.ts
@@ -167,23 +202,23 @@ interface BuildResult {
167
202
  //#endregion
168
203
  //#region src/compile/build.d.ts
169
204
  /**
170
- * Builds a component template into code and styles for rendering
171
- *
172
- * @param template The component template, possibly including script, markup and styles
173
- *
174
- * @returns The component's code and styles
175
- */
205
+ * Builds a component template into code and styles for rendering
206
+ *
207
+ * @param template The component template, possibly including script, markup and styles
208
+ *
209
+ * @returns The component's code and styles
210
+ */
176
211
  declare function build(template: Template, options?: BuildOptions): BuildResult;
177
212
  //#endregion
178
213
  //#region src/compile/buildType.d.ts
179
214
  /**
180
- * Builds a component template into a d.ts file
181
- *
182
- * @param name The name of the component
183
- * @param template The component template, possibly including script, markup and styles
184
- *
185
- * @returns The d.ts file content
186
- */
215
+ * Builds a component template into a d.ts file
216
+ *
217
+ * @param name The name of the component
218
+ * @param template The component template, possibly including script, markup and styles
219
+ *
220
+ * @returns The d.ts file content
221
+ */
187
222
  declare function buildType(template: Template, options?: BuildOptions): string;
188
223
  //#endregion
189
224
  //#region src/compile/types/CompileError.d.ts
@@ -206,13 +241,13 @@ interface ParseResult {
206
241
  //#endregion
207
242
  //#region src/compile/parse.d.ts
208
243
  /**
209
- * Parses source code into a component template
210
- *
211
- * @param source The source code
212
- *
213
- * @returns A result indicating whether parsing was ok, and if so, containing
214
- * the component template's parts such as script, markup and styles
215
- */
244
+ * Parses source code into a component template
245
+ *
246
+ * @param source The source code
247
+ *
248
+ * @returns A result indicating whether parsing was ok, and if so, containing
249
+ * the component template's parts such as script, markup and styles
250
+ */
216
251
  declare function parse(source: string): ParseResult;
217
252
  //#endregion
218
253
  export { type Component, type Template, build, buildType, parse };
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.cts","names":[],"sources":["../src/compile/types/Import.ts","../src/compile/types/SourceSpan.ts","../src/compile/types/ScriptChunk.ts","../src/compile/types/nodes/Fragment.ts","../src/compile/types/nodes/NodeType.ts","../src/compile/types/nodes/TemplateNode.ts","../src/compile/types/nodes/ParentNode.ts","../src/compile/types/nodes/RootNode.ts","../src/compile/types/styles/Attribute.ts","../src/compile/types/styles/StyleBlock.ts","../src/compile/types/styles/Style.ts","../src/types/TemplateComponent.ts","../src/types/Template.ts","../src/compile/types/BuildOptions.ts","../src/compile/types/SourceMapping.ts","../src/compile/types/BuildResult.ts","../src/compile/build.ts","../src/compile/buildType.ts","../src/compile/types/CompileError.ts","../src/compile/types/ParseResult.ts","../src/compile/parse.ts"],"sourcesContent":[],"mappings":";;;UAAyB,MAAA;;;MAAA,EAAA,MAAA;;;;;;UCAA,UAAA;;;;;;UCEA,WAAA;;MFFA,EEIlB,UFJkB;;;;UGEA,QAAA;;MHFA,EAAA,MAAA;;;;SCAA,EEQhB,UFRgB,EAAA;;;;ECAG,MAEH,EAAA;;;;ECFG,CAAA,EAEH;;;;;;KCFpB,QAAA;;;UCEoB,YAAA;QAClB;aLHkB,CAAA,EAAA,OAAA;;;;;;UMGA,UAAA,SAAmB;MNHnB,EMIlB,QNJkB;YMKd;;;;ANLc,UOIA,QAAA,SAAiB,UPJjB,CAAA;;YOMd;aAGC;;;;UCTa,SAAA;;;;;;UCEA,UAAA;;YTFA,ESIZ,STJY,EAAA;YSKd;;;;UCHc,KAAA;;QVFA,EUIhB,UVJgB,EAAA;;;;;UWGA,iBAAA;OXHA,CAAA,EAAA,MAAA;;;;UCAA,CAAA,EAAA,OAAA;;;;ECAG,aAEH,CAAA,EAAA,MAAA;;;WSaf;ERfkB,IAEH,CAAA,EQcjB,QRdiB;UQehB;;;;;;;ENjBiB;;;;;;;;UOOD,QAAA;SXPA,EWQf,MXRe,EAAA;UWShB;cACI;;;;UCVY,YAAA;;;;;;;;;;;AXAG;;;;ACAA;;;;kBCAvB,CAAA,EAAA,OAAA;;;;ECAqB,YAED,CAAA,EAAA,MAAA;;;;USAA,aAAA;;QdFA,EcIhB,UdJgB;YcKd;;;;UCHc,WAAA;;QfFA,EAAA;;;;KCAA,EcQnB,adRmB,EAAA;;;;;;;;;;;iBeeD,KAAA,WAAgB,oBAAoB,eAAe;;;;;;;;;;;iBCHnD,SAAA,WAAoB,oBAAoB;;;UCZvC,YAAA;;;WlBAA,EAAA,MAAA;;;;SCAA,EAAA,MAAA;;;;UkBGA,WAAA;MnBHA,OAAA;UmBKhB;aACG;;;;;;;;;;;;iBCKY,KAAA,kBAAuB"}
1
+ {"version":3,"file":"compile.d.cts","names":[],"sources":["../src/compile/types/Import.ts","../src/compile/types/SourceSpan.ts","../src/compile/types/ScriptChunk.ts","../src/compile/types/nodes/Fragment.ts","../src/compile/types/nodes/NodeType.ts","../src/compile/types/nodes/TemplateNode.ts","../src/compile/types/nodes/ParentNode.ts","../src/compile/types/nodes/RootNode.ts","../src/compile/types/styles/StyleNode.ts","../src/compile/types/styles/Style.ts","../src/types/TemplateComponent.ts","../src/types/Template.ts","../src/compile/types/BuildOptions.ts","../src/compile/types/SourceMapping.ts","../src/compile/types/BuildResult.ts","../src/compile/build.ts","../src/compile/buildType.ts","../src/compile/types/CompileError.ts","../src/compile/types/ParseResult.ts","../src/compile/parse.ts"],"mappings":";;UAAyB;EACxB;EACA;EACA;EACA;EACA;;;;UCLwB;EACxB;EACA;;;;UCAwB;EACxB;EACA,MAAM;;;;UCFkB;EACxB;EACA;EACA;EACA;IACC;IACA,OAAO;IACP;IACA;IACA;;EAED;IACC;IACA;IACA;;EAED;EACA;;;;;;;EAOA;;;;;;;;;;EAUA;;;;;;;;;EASA;;;;KC7CI;;;UCEoB;EACxB,MAAM;EAGN;EAKA;EAKA;;;;UCbwB,mBAAmB;EAC3C,MAAM;EACN,UAAU;;;;UCDc,iBAAiB;EACzC;EACA,UAAU;EAGV,WAAW;;;;UCTa;EACxB;EACA;;;;UCAwB;EACxB;EACA,UAAU;EACV;;;;UCFwB;EACxB;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;EACA,SAAS;;EAET,QAAQ;;EAER;EACA,OAAO;EACP,QAAQ;;EAER;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;UC1BwB;EACxB,SAAS;EACT,QAAQ;EACR,YAAY;;;;UCVY;;;;EAIxB;;;;EAIA;;;;EAIA;;;;;;;EAOA;;;;EAIA;;;;;;;;EAQA;;;;UC7BwB;EACxB;EACA,QAAQ;EACR,UAAU;;;;UCHc;EACxB;EACA;IACC;IACA;;EAED,KAAK;;;;;;;;;;;iBCQkB,MAAM,UAAU,UAAU,UAAU,eAAe;;;;;;;;;;;iBCJnD,UAAU,UAAU,UAAU,UAAU;;;UCZvC;EACxB;EACA;EACA;EACA;EACA;EACA;EACA;;;;UCJwB;EACxB;EACA,QAAQ;EACR,WAAW;;;;;;;;;;;;iBCKY,MAAM,iBAAiB"}
@@ -1,5 +1,4 @@
1
- import { t as Component } from "./Component-DmWGMgak.mjs";
2
-
1
+ import { t as Component } from "./Component-0MH0zd-m.mjs";
3
2
  //#region src/compile/types/Import.d.ts
4
3
  interface Import {
5
4
  name: string;
@@ -31,6 +30,7 @@ interface Fragment {
31
30
  spans: SourceSpan[];
32
31
  offsets: number[];
33
32
  lengths: number[];
33
+ forVarMask?: number;
34
34
  }[];
35
35
  events: {
36
36
  varName: string;
@@ -39,10 +39,36 @@ interface Fragment {
39
39
  }[];
40
40
  animations: string[];
41
41
  endVarName?: string;
42
+ /**
43
+ * The variable name holding the fragment's first DOM node (the root).
44
+ * Used to restore the active region's `startNode` during hydration —
45
+ * child component rendering (via `addElement`) can overwrite it before
46
+ * `addFragment` runs.
47
+ */
48
+ rootVarName?: string;
49
+ /**
50
+ * Set during `buildFragmentText` when the fragment has exactly one
51
+ * rendering root child and that child is an `Element`. The compiler then
52
+ * emits the `t_fragment_el` / `t_root_el` / `t_add_element` path, which
53
+ * clones the cached template's `firstElementChild` directly into the
54
+ * parent — skipping the per-instance `DocumentFragment` wrapper that
55
+ * `getFragment` produces. Wins on per-row allocation in bulk-create paths
56
+ * (e.g. `@for` rows in the js-framework-bench `run`/`add`/`runlots` ops).
57
+ */
58
+ singleRootElement?: boolean;
59
+ /**
60
+ * `false` when the fragment is never rendered through the
61
+ * `buildFragment` cache path (which is what references the `t_fragments`
62
+ * / `t_fragment_els` arrays). Currently only `@html` branches, which build
63
+ * their content at runtime from an innerHTML string and only use the
64
+ * fragment's `number` for naming. Excludes such fragments from the
65
+ * decision to declare `t_fragments`, avoiding an unused declaration.
66
+ */
67
+ usesFragmentCache?: boolean;
42
68
  }
43
69
  //#endregion
44
70
  //#region src/compile/types/nodes/NodeType.d.ts
45
- type NodeType = "root" | "control" | "component" | "element" | "text" | "special";
71
+ type NodeType = "root" | "control" | "component" | "element" | "text" | "special" | "comment";
46
72
  //#endregion
47
73
  //#region src/compile/types/nodes/TemplateNode.d.ts
48
74
  interface TemplateNode {
@@ -65,23 +91,16 @@ interface RootNode extends ParentNode {
65
91
  fragment?: Fragment;
66
92
  }
67
93
  //#endregion
68
- //#region src/compile/types/styles/Attribute.d.ts
69
- interface Attribute {
70
- name: string;
71
- value: string;
72
- }
73
- //#endregion
74
- //#region src/compile/types/styles/StyleBlock.d.ts
75
- interface StyleBlock {
76
- selector: string;
77
- attributes: Attribute[];
78
- children: StyleBlock[];
94
+ //#region src/compile/types/styles/StyleNode.d.ts
95
+ interface StyleNode {
96
+ type: "block" | "attribute" | "comment";
97
+ gapBefore: boolean;
79
98
  }
80
99
  //#endregion
81
100
  //#region src/compile/types/styles/Style.d.ts
82
101
  interface Style {
83
102
  global: boolean;
84
- blocks: StyleBlock[];
103
+ children: StyleNode[];
85
104
  hash: string;
86
105
  }
87
106
  //#endregion
@@ -98,9 +117,17 @@ interface TemplateComponent {
98
117
  documentation?: string;
99
118
  /** Params declared by the user in the component's function */
100
119
  params?: string;
120
+ /** Type parameters declared by the user in the component's function, e.g. `<Data = any>` */
121
+ typeParams?: string;
101
122
  markup?: RootNode;
123
+ /** The markup of the component's top-level `@error` block, if any */
124
+ error?: RootNode;
125
+ /** The variable name bound to the error in the `@error` block */
126
+ errorVar?: string;
102
127
  head?: RootNode;
103
128
  style?: Style;
129
+ /** The index of the component's first script chunk in the template's script list */
130
+ scriptStart?: number;
104
131
  /** The type or interface that is used for the $props param */
105
132
  propsType?: string;
106
133
  /** $props that are used in the component's function */
@@ -113,8 +140,8 @@ interface TemplateComponent {
113
140
  //#endregion
114
141
  //#region src/types/Template.d.ts
115
142
  /**
116
- * The template for a component file, consisting of parts like script, markup and styles
117
- */
143
+ * The template for a component file, consisting of parts like script, markup and styles
144
+ */
118
145
  interface Template {
119
146
  imports: Import[];
120
147
  script: ScriptChunk[];
@@ -124,28 +151,36 @@ interface Template {
124
151
  //#region src/compile/types/BuildOptions.d.ts
125
152
  interface BuildOptions {
126
153
  /**
127
- * Whether to create the component for server side rendering
128
- */
154
+ * Whether to create the component for server side rendering
155
+ */
129
156
  server?: boolean;
130
157
  /**
131
- * Whether to create source maps
132
- */
158
+ * Whether to create source maps
159
+ */
133
160
  mapped?: boolean;
134
161
  /**
135
- * Whether to add debugging info etc for development mode
136
- */
162
+ * Whether to add debugging info etc for development mode
163
+ */
137
164
  dev?: boolean;
138
165
  /**
139
- * If true, fragments will be built with calls to createElement etc. If
140
- * false, fragments will be built with innerHTML. Using createElement is a
141
- * bit slower, but may be useful in the future for rendering to different
142
- * targets
143
- */
166
+ * If true, fragments will be built with calls to createElement etc. If
167
+ * false, fragments will be built with innerHTML. Using createElement is a
168
+ * bit slower, but may be useful in the future for rendering to different
169
+ * targets
170
+ */
144
171
  useCreateElement?: boolean;
145
172
  /**
146
- * For internal testing and benchmarking
147
- */
173
+ * For internal testing and benchmarking
174
+ */
148
175
  renderFolder?: string;
176
+ /**
177
+ * Whether to preserve all whitespace text nodes from the template.
178
+ * When false (the default), whitespace is trimmed Svelte 5-style:
179
+ * pure-whitespace nodes at the start/end of a container are removed,
180
+ * and pure-whitespace nodes between siblings are collapsed to a single
181
+ * space. Whitespace inside `pre`, `textarea`, and `code` is always kept.
182
+ */
183
+ preserveWhitespace?: boolean;
149
184
  }
150
185
  //#endregion
151
186
  //#region src/compile/types/SourceMapping.d.ts
@@ -167,23 +202,23 @@ interface BuildResult {
167
202
  //#endregion
168
203
  //#region src/compile/build.d.ts
169
204
  /**
170
- * Builds a component template into code and styles for rendering
171
- *
172
- * @param template The component template, possibly including script, markup and styles
173
- *
174
- * @returns The component's code and styles
175
- */
205
+ * Builds a component template into code and styles for rendering
206
+ *
207
+ * @param template The component template, possibly including script, markup and styles
208
+ *
209
+ * @returns The component's code and styles
210
+ */
176
211
  declare function build(template: Template, options?: BuildOptions): BuildResult;
177
212
  //#endregion
178
213
  //#region src/compile/buildType.d.ts
179
214
  /**
180
- * Builds a component template into a d.ts file
181
- *
182
- * @param name The name of the component
183
- * @param template The component template, possibly including script, markup and styles
184
- *
185
- * @returns The d.ts file content
186
- */
215
+ * Builds a component template into a d.ts file
216
+ *
217
+ * @param name The name of the component
218
+ * @param template The component template, possibly including script, markup and styles
219
+ *
220
+ * @returns The d.ts file content
221
+ */
187
222
  declare function buildType(template: Template, options?: BuildOptions): string;
188
223
  //#endregion
189
224
  //#region src/compile/types/CompileError.d.ts
@@ -206,13 +241,13 @@ interface ParseResult {
206
241
  //#endregion
207
242
  //#region src/compile/parse.d.ts
208
243
  /**
209
- * Parses source code into a component template
210
- *
211
- * @param source The source code
212
- *
213
- * @returns A result indicating whether parsing was ok, and if so, containing
214
- * the component template's parts such as script, markup and styles
215
- */
244
+ * Parses source code into a component template
245
+ *
246
+ * @param source The source code
247
+ *
248
+ * @returns A result indicating whether parsing was ok, and if so, containing
249
+ * the component template's parts such as script, markup and styles
250
+ */
216
251
  declare function parse(source: string): ParseResult;
217
252
  //#endregion
218
253
  export { type Component, type Template, build, buildType, parse };
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.mts","names":[],"sources":["../src/compile/types/Import.ts","../src/compile/types/SourceSpan.ts","../src/compile/types/ScriptChunk.ts","../src/compile/types/nodes/Fragment.ts","../src/compile/types/nodes/NodeType.ts","../src/compile/types/nodes/TemplateNode.ts","../src/compile/types/nodes/ParentNode.ts","../src/compile/types/nodes/RootNode.ts","../src/compile/types/styles/Attribute.ts","../src/compile/types/styles/StyleBlock.ts","../src/compile/types/styles/Style.ts","../src/types/TemplateComponent.ts","../src/types/Template.ts","../src/compile/types/BuildOptions.ts","../src/compile/types/SourceMapping.ts","../src/compile/types/BuildResult.ts","../src/compile/build.ts","../src/compile/buildType.ts","../src/compile/types/CompileError.ts","../src/compile/types/ParseResult.ts","../src/compile/parse.ts"],"sourcesContent":[],"mappings":";;;UAAyB,MAAA;;;MAAA,EAAA,MAAA;;;;;;UCAA,UAAA;;;;;;UCEA,WAAA;;MFFA,EEIlB,UFJkB;;;;UGEA,QAAA;;MHFA,EAAA,MAAA;;;;SCAA,EEQhB,UFRgB,EAAA;;;;ECAG,MAEH,EAAA;;;;ECFG,CAAA,EAEH;;;;;;KCFpB,QAAA;;;UCEoB,YAAA;QAClB;aLHkB,CAAA,EAAA,OAAA;;;;;;UMGA,UAAA,SAAmB;MNHnB,EMIlB,QNJkB;YMKd;;;;ANLc,UOIA,QAAA,SAAiB,UPJjB,CAAA;;YOMd;aAGC;;;;UCTa,SAAA;;;;;;UCEA,UAAA;;YTFA,ESIZ,STJY,EAAA;YSKd;;;;UCHc,KAAA;;QVFA,EUIhB,UVJgB,EAAA;;;;;UWGA,iBAAA;OXHA,CAAA,EAAA,MAAA;;;;UCAA,CAAA,EAAA,OAAA;;;;ECAG,aAEH,CAAA,EAAA,MAAA;;;WSaf;ERfkB,IAEH,CAAA,EQcjB,QRdiB;UQehB;;;;;;;ENjBiB;;;;;;;;UOOD,QAAA;SXPA,EWQf,MXRe,EAAA;UWShB;cACI;;;;UCVY,YAAA;;;;;;;;;;;AXAG;;;;ACAA;;;;kBCAvB,CAAA,EAAA,OAAA;;;;ECAqB,YAED,CAAA,EAAA,MAAA;;;;USAA,aAAA;;QdFA,EcIhB,UdJgB;YcKd;;;;UCHc,WAAA;;QfFA,EAAA;;;;KCAA,EcQnB,adRmB,EAAA;;;;;;;;;;;iBeeD,KAAA,WAAgB,oBAAoB,eAAe;;;;;;;;;;;iBCHnD,SAAA,WAAoB,oBAAoB;;;UCZvC,YAAA;;;WlBAA,EAAA,MAAA;;;;SCAA,EAAA,MAAA;;;;UkBGA,WAAA;MnBHA,OAAA;UmBKhB;aACG;;;;;;;;;;;;iBCKY,KAAA,kBAAuB"}
1
+ {"version":3,"file":"compile.d.mts","names":[],"sources":["../src/compile/types/Import.ts","../src/compile/types/SourceSpan.ts","../src/compile/types/ScriptChunk.ts","../src/compile/types/nodes/Fragment.ts","../src/compile/types/nodes/NodeType.ts","../src/compile/types/nodes/TemplateNode.ts","../src/compile/types/nodes/ParentNode.ts","../src/compile/types/nodes/RootNode.ts","../src/compile/types/styles/StyleNode.ts","../src/compile/types/styles/Style.ts","../src/types/TemplateComponent.ts","../src/types/Template.ts","../src/compile/types/BuildOptions.ts","../src/compile/types/SourceMapping.ts","../src/compile/types/BuildResult.ts","../src/compile/build.ts","../src/compile/buildType.ts","../src/compile/types/CompileError.ts","../src/compile/types/ParseResult.ts","../src/compile/parse.ts"],"mappings":";;UAAyB;EACxB;EACA;EACA;EACA;EACA;;;;UCLwB;EACxB;EACA;;;;UCAwB;EACxB;EACA,MAAM;;;;UCFkB;EACxB;EACA;EACA;EACA;IACC;IACA,OAAO;IACP;IACA;IACA;;EAED;IACC;IACA;IACA;;EAED;EACA;;;;;;;EAOA;;;;;;;;;;EAUA;;;;;;;;;EASA;;;;KC7CI;;;UCEoB;EACxB,MAAM;EAGN;EAKA;EAKA;;;;UCbwB,mBAAmB;EAC3C,MAAM;EACN,UAAU;;;;UCDc,iBAAiB;EACzC;EACA,UAAU;EAGV,WAAW;;;;UCTa;EACxB;EACA;;;;UCAwB;EACxB;EACA,UAAU;EACV;;;;UCFwB;EACxB;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;EACA,SAAS;;EAET,QAAQ;;EAER;EACA,OAAO;EACP,QAAQ;;EAER;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;UC1BwB;EACxB,SAAS;EACT,QAAQ;EACR,YAAY;;;;UCVY;;;;EAIxB;;;;EAIA;;;;EAIA;;;;;;;EAOA;;;;EAIA;;;;;;;;EAQA;;;;UC7BwB;EACxB;EACA,QAAQ;EACR,UAAU;;;;UCHc;EACxB;EACA;IACC;IACA;;EAED,KAAK;;;;;;;;;;;iBCQkB,MAAM,UAAU,UAAU,UAAU,eAAe;;;;;;;;;;;iBCJnD,UAAU,UAAU,UAAU,UAAU;;;UCZvC;EACxB;EACA;EACA;EACA;EACA;EACA;EACA;;;;UCJwB;EACxB;EACA,QAAQ;EACR,WAAW;;;;;;;;;;;;iBCKY,MAAM,iBAAiB"}