svelte2tsx 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -2
- package/index.mjs +5 -2
- package/package.json +1 -1
- package/svelte-shims.d.ts +1 -1
package/index.js
CHANGED
|
@@ -7066,6 +7066,7 @@ function processSvelteTemplate(str, options) {
|
|
|
7066
7066
|
//resolve stores
|
|
7067
7067
|
const resolvedStores = stores.resolveStores();
|
|
7068
7068
|
return {
|
|
7069
|
+
htmlAst: htmlxAst,
|
|
7069
7070
|
moduleScriptTag,
|
|
7070
7071
|
scriptTag,
|
|
7071
7072
|
slots: slotHandler.getSlotDef(),
|
|
@@ -7083,7 +7084,7 @@ function svelte2tsx(svelte, options = {}) {
|
|
|
7083
7084
|
options.mode = options.mode || 'ts';
|
|
7084
7085
|
const str = new MagicString(svelte);
|
|
7085
7086
|
// process the htmlx as a svelte template
|
|
7086
|
-
let { moduleScriptTag, scriptTag, slots, uses$$props, uses$$slots, uses$$restProps, events, componentDocumentation, resolvedStores, usesAccessors } = processSvelteTemplate(str, options);
|
|
7087
|
+
let { htmlAst, moduleScriptTag, scriptTag, slots, uses$$props, uses$$slots, uses$$restProps, events, componentDocumentation, resolvedStores, usesAccessors } = processSvelteTemplate(str, options);
|
|
7087
7088
|
/* Rearrange the script tags so that module is first, and instance second followed finally by the template
|
|
7088
7089
|
* This is a bit convoluted due to some trouble I had with magic string. A simple str.move(start,end,0) for each script wasn't enough
|
|
7089
7090
|
* since if the module script was already at 0, it wouldn't move (which is fine) but would mean the order would be swapped when the script tag tried to move to 0
|
|
@@ -7185,7 +7186,9 @@ declare function __sveltets_1_createSvelteComponentTyped<Props, Events, Slots>(
|
|
|
7185
7186
|
code: str.toString(),
|
|
7186
7187
|
map: str.generateMap({ hires: true, source: options === null || options === void 0 ? void 0 : options.filename }),
|
|
7187
7188
|
exportedNames: exportedNames.getExportsMap(),
|
|
7188
|
-
events: events.createAPI()
|
|
7189
|
+
events: events.createAPI(),
|
|
7190
|
+
// not part of the public API so people don't start using it
|
|
7191
|
+
htmlAst
|
|
7189
7192
|
};
|
|
7190
7193
|
}
|
|
7191
7194
|
}
|
package/index.mjs
CHANGED
|
@@ -7036,6 +7036,7 @@ function processSvelteTemplate(str, options) {
|
|
|
7036
7036
|
//resolve stores
|
|
7037
7037
|
const resolvedStores = stores.resolveStores();
|
|
7038
7038
|
return {
|
|
7039
|
+
htmlAst: htmlxAst,
|
|
7039
7040
|
moduleScriptTag,
|
|
7040
7041
|
scriptTag,
|
|
7041
7042
|
slots: slotHandler.getSlotDef(),
|
|
@@ -7053,7 +7054,7 @@ function svelte2tsx(svelte, options = {}) {
|
|
|
7053
7054
|
options.mode = options.mode || 'ts';
|
|
7054
7055
|
const str = new MagicString(svelte);
|
|
7055
7056
|
// process the htmlx as a svelte template
|
|
7056
|
-
let { moduleScriptTag, scriptTag, slots, uses$$props, uses$$slots, uses$$restProps, events, componentDocumentation, resolvedStores, usesAccessors } = processSvelteTemplate(str, options);
|
|
7057
|
+
let { htmlAst, moduleScriptTag, scriptTag, slots, uses$$props, uses$$slots, uses$$restProps, events, componentDocumentation, resolvedStores, usesAccessors } = processSvelteTemplate(str, options);
|
|
7057
7058
|
/* Rearrange the script tags so that module is first, and instance second followed finally by the template
|
|
7058
7059
|
* This is a bit convoluted due to some trouble I had with magic string. A simple str.move(start,end,0) for each script wasn't enough
|
|
7059
7060
|
* since if the module script was already at 0, it wouldn't move (which is fine) but would mean the order would be swapped when the script tag tried to move to 0
|
|
@@ -7155,7 +7156,9 @@ declare function __sveltets_1_createSvelteComponentTyped<Props, Events, Slots>(
|
|
|
7155
7156
|
code: str.toString(),
|
|
7156
7157
|
map: str.generateMap({ hires: true, source: options === null || options === void 0 ? void 0 : options.filename }),
|
|
7157
7158
|
exportedNames: exportedNames.getExportsMap(),
|
|
7158
|
-
events: events.createAPI()
|
|
7159
|
+
events: events.createAPI(),
|
|
7160
|
+
// not part of the public API so people don't start using it
|
|
7161
|
+
htmlAst
|
|
7159
7162
|
};
|
|
7160
7163
|
}
|
|
7161
7164
|
}
|
package/package.json
CHANGED
package/svelte-shims.d.ts
CHANGED
|
@@ -256,6 +256,6 @@ declare function __sveltets_2_ensureTransition(transitionCall: __sveltets_2_Svel
|
|
|
256
256
|
declare function __sveltets_2_ensureType<T>(type: AConstructorTypeOf<T>, el: T): {};
|
|
257
257
|
declare function __sveltets_2_ensureType<T1, T2>(type1: AConstructorTypeOf<T1>, type2: AConstructorTypeOf<T2>, el: T1 | T2): {};
|
|
258
258
|
|
|
259
|
-
declare function __sveltets_2_ensureComponent<T extends new (args: {target: any, props?: any}) => Svelte2TsxComponent<any,
|
|
259
|
+
declare function __sveltets_2_ensureComponent<T extends new (args: {target: any, props?: any}) => Svelte2TsxComponent<any, {}, any>>(type: T): T extends never ? Svelte2TsxComponent<any, any, any> : T;
|
|
260
260
|
|
|
261
261
|
declare function __sveltets_2_ensureArray<T extends ArrayLike<unknown>>(array: T): T extends ArrayLike<infer U> ? U[] : any[];
|