svelte2tsx 0.6.17 → 0.6.19
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 -5
- package/index.mjs +5 -5
- package/package.json +1 -1
- package/svelte-shims-v4.d.ts +6 -8
package/index.js
CHANGED
|
@@ -6428,15 +6428,15 @@ async function createTsCompilerHost(options, svelteMap) {
|
|
|
6428
6428
|
async function createSvelteMap(config) {
|
|
6429
6429
|
const svelteFiles = new Map();
|
|
6430
6430
|
function add(path) {
|
|
6431
|
-
var _a, _b;
|
|
6432
6431
|
const code = ts.sys.readFile(path, 'utf-8');
|
|
6433
|
-
const isTsFile =
|
|
6434
|
-
['ts', 'typescript'].includes((_b = (_a = config.preprocess) === null || _a === void 0 ? void 0 : _a.defaultLanguages) === null || _b === void 0 ? void 0 : _b.script) ||
|
|
6435
|
-
/<script\s+[^>]*?lang=('|")(ts|typescript)('|")/.test(code);
|
|
6432
|
+
const isTsFile = /<script\s+[^>]*?lang=('|")(ts|typescript)('|")/.test(code);
|
|
6436
6433
|
const transformed = svelte2tsx(code, {
|
|
6437
6434
|
filename: path,
|
|
6438
6435
|
isTsFile,
|
|
6439
|
-
mode: 'dts'
|
|
6436
|
+
mode: 'dts',
|
|
6437
|
+
noSvelteComponentTyped: config.svelteShimsPath
|
|
6438
|
+
.replace(/\\/g, '/')
|
|
6439
|
+
.endsWith('svelte2tsx/svelte-shims-v4.d.ts')
|
|
6440
6440
|
}).code;
|
|
6441
6441
|
svelteFiles.set(path, transformed);
|
|
6442
6442
|
return isTsFile;
|
package/index.mjs
CHANGED
|
@@ -6408,15 +6408,15 @@ async function createTsCompilerHost(options, svelteMap) {
|
|
|
6408
6408
|
async function createSvelteMap(config) {
|
|
6409
6409
|
const svelteFiles = new Map();
|
|
6410
6410
|
function add(path) {
|
|
6411
|
-
var _a, _b;
|
|
6412
6411
|
const code = ts.sys.readFile(path, 'utf-8');
|
|
6413
|
-
const isTsFile =
|
|
6414
|
-
['ts', 'typescript'].includes((_b = (_a = config.preprocess) === null || _a === void 0 ? void 0 : _a.defaultLanguages) === null || _b === void 0 ? void 0 : _b.script) ||
|
|
6415
|
-
/<script\s+[^>]*?lang=('|")(ts|typescript)('|")/.test(code);
|
|
6412
|
+
const isTsFile = /<script\s+[^>]*?lang=('|")(ts|typescript)('|")/.test(code);
|
|
6416
6413
|
const transformed = svelte2tsx(code, {
|
|
6417
6414
|
filename: path,
|
|
6418
6415
|
isTsFile,
|
|
6419
|
-
mode: 'dts'
|
|
6416
|
+
mode: 'dts',
|
|
6417
|
+
noSvelteComponentTyped: config.svelteShimsPath
|
|
6418
|
+
.replace(/\\/g, '/')
|
|
6419
|
+
.endsWith('svelte2tsx/svelte-shims-v4.d.ts')
|
|
6420
6420
|
}).code;
|
|
6421
6421
|
svelteFiles.set(path, transformed);
|
|
6422
6422
|
return isTsFile;
|
package/package.json
CHANGED
package/svelte-shims-v4.d.ts
CHANGED
|
@@ -100,8 +100,6 @@ declare function __sveltets_2_with_any_event<Props = {}, Events = {}, Slots = {}
|
|
|
100
100
|
declare function __sveltets_2_store_get<T = any>(store: SvelteStore<T>): T
|
|
101
101
|
declare function __sveltets_2_store_get<Store extends SvelteStore<any> | undefined | null>(store: Store): Store extends SvelteStore<infer T> ? T : Store;
|
|
102
102
|
declare function __sveltets_2_any(dummy: any): any;
|
|
103
|
-
// declare function __sveltets_1_empty(...dummy: any[]): {};
|
|
104
|
-
// declare function __sveltets_1_componentType(): AConstructorTypeOf<import("svelte").SvelteComponentTyped<any, any, any>>
|
|
105
103
|
declare function __sveltets_2_invalidate<T>(getValue: () => T): T
|
|
106
104
|
|
|
107
105
|
declare function __sveltets_2_mapWindowEvent<K extends keyof HTMLBodyElementEventMap>(
|
|
@@ -129,16 +127,16 @@ declare function __sveltets_2_unionType<T1, T2, T3>(t1: T1, t2: T2, t3: T3): T1
|
|
|
129
127
|
declare function __sveltets_2_unionType<T1, T2, T3, T4>(t1: T1, t2: T2, t3: T3, t4: T4): T1 | T2 | T3 | T4;
|
|
130
128
|
declare function __sveltets_2_unionType(...types: any[]): any;
|
|
131
129
|
|
|
132
|
-
declare function __sveltets_2_createSvelte2TsxComponent<Props, Events, Slots>(
|
|
130
|
+
declare function __sveltets_2_createSvelte2TsxComponent<Props extends {}, Events extends {}, Slots extends {}>(
|
|
133
131
|
render: {props: Props, events: Events, slots: Slots }
|
|
134
|
-
): SvelteComponentConstructor<import("svelte").
|
|
132
|
+
): SvelteComponentConstructor<import("svelte").SvelteComponent<Props, Events, Slots>,import('svelte').ComponentConstructorOptions<Props>>;
|
|
135
133
|
|
|
136
134
|
declare function __sveltets_2_unwrapArr<T>(arr: ArrayLike<T>): T
|
|
137
135
|
declare function __sveltets_2_unwrapPromiseLike<T>(promise: PromiseLike<T> | T): T
|
|
138
136
|
|
|
139
137
|
// v2
|
|
140
138
|
declare function __sveltets_2_createCreateSlot<Slots = Record<string, Record<string, any>>>(): <SlotName extends keyof Slots>(slotName: SlotName, attrs: Slots[SlotName]) => Record<string, any>;
|
|
141
|
-
declare function __sveltets_2_createComponentAny(props: Record<string, any>): import("svelte").
|
|
139
|
+
declare function __sveltets_2_createComponentAny(props: Record<string, any>): import("svelte").SvelteComponent<any, any, any>;
|
|
142
140
|
|
|
143
141
|
declare function __sveltets_2_any(...dummy: any[]): any;
|
|
144
142
|
declare function __sveltets_2_empty(...dummy: any[]): {};
|
|
@@ -214,11 +212,11 @@ declare type ATypedSvelteComponent = {
|
|
|
214
212
|
/**
|
|
215
213
|
* Ambient type only used for intellisense, DO NOT USE IN YOUR PROJECT.
|
|
216
214
|
*
|
|
217
|
-
* If you're looking for the type of a Svelte Component, use `
|
|
215
|
+
* If you're looking for the type of a Svelte Component, use `SvelteComponent` and `ComponentType` instead:
|
|
218
216
|
*
|
|
219
217
|
* ```ts
|
|
220
|
-
* import type { ComponentType,
|
|
221
|
-
* let myComponentConstructor: ComponentType<
|
|
218
|
+
* import type { ComponentType, SvelteComponent } from "svelte";
|
|
219
|
+
* let myComponentConstructor: ComponentType<SvelteComponent> = ..;
|
|
222
220
|
* ```
|
|
223
221
|
*/
|
|
224
222
|
declare type ConstructorOfATypedSvelteComponent = new (args: {target: any, props?: any}) => ATypedSvelteComponent
|