svelte2tsx 0.5.23 → 0.6.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.
- package/README.md +2 -2
- package/index.d.ts +8 -6
- package/index.js +1123 -951
- package/index.mjs +1003 -821
- package/package.json +14 -14
- package/svelte-jsx.d.ts +1216 -1138
- package/svelte-native-jsx.d.ts +0 -2
- package/svelte-shims.d.ts +93 -68
- package/CHANGELOG.md +0 -3
- package/svelte-html-do-not-use.d.ts +0 -1583
package/README.md
CHANGED
|
@@ -37,8 +37,8 @@ function render() {
|
|
|
37
37
|
return { props: { world }, slots: {}, events: {} };
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
export default class _World_ extends
|
|
41
|
-
|
|
40
|
+
export default class _World_ extends __sveltets_2_createSvelte2TsxComponent(
|
|
41
|
+
__sveltets_2_partial(__sveltets_2_with_any_event(render))
|
|
42
42
|
) {}
|
|
43
43
|
```
|
|
44
44
|
|
package/index.d.ts
CHANGED
|
@@ -38,18 +38,18 @@ export function svelte2tsx(
|
|
|
38
38
|
*/
|
|
39
39
|
namespace?: string;
|
|
40
40
|
/**
|
|
41
|
-
* When setting this to 'dts', all
|
|
41
|
+
* When setting this to 'dts', all ts/js code and the template code will be thrown out.
|
|
42
42
|
* Only the `code` property will be set on the returned element.
|
|
43
43
|
* Use this as an intermediate step to generate type definitions from a component.
|
|
44
44
|
* It is expected to pass the result to TypeScript which should handle emitting the d.ts files.
|
|
45
45
|
* The shims need to be provided by the user ambient-style,
|
|
46
46
|
* for example through `filenames.push(require.resolve('svelte2tsx/svelte-shims.d.ts'))`.
|
|
47
|
-
* If you pass 'ts', it uses the
|
|
48
|
-
*
|
|
47
|
+
* If you pass 'ts', it uses the regular Svelte->TS/JS transformation.
|
|
48
|
+
*
|
|
49
|
+
* @default 'ts'
|
|
49
50
|
*/
|
|
50
|
-
mode?: 'ts' | '
|
|
51
|
+
mode?: 'ts' | 'dts',
|
|
51
52
|
/**
|
|
52
|
-
* Takes effect when using the new 'ts' mode. Default 'svelteHTML'.
|
|
53
53
|
* Tells svelte2tsx from which namespace some specific functions to use.
|
|
54
54
|
*
|
|
55
55
|
* Example: 'svelteHTML' -> svelteHTML.createElement<..>(..)
|
|
@@ -57,6 +57,8 @@ export function svelte2tsx(
|
|
|
57
57
|
* A namespace needs to implement the following functions:
|
|
58
58
|
* - `createElement(str: string, validAttributes: ..): Element`
|
|
59
59
|
* - `mapElementTag<Key extends keyof YourElements>(str: Key): YourElements[Key]`
|
|
60
|
+
*
|
|
61
|
+
* @default 'svelteHTML'
|
|
60
62
|
*/
|
|
61
63
|
typingsNamespace?: string;
|
|
62
64
|
/**
|
|
@@ -89,7 +91,7 @@ export interface EmitDtsConfig {
|
|
|
89
91
|
|
|
90
92
|
// to make typo fix non-breaking, continue to export the old name but mark it as deprecated
|
|
91
93
|
/**@deprecated*/
|
|
92
|
-
export interface EmitDtsConig extends EmitDtsConfig {}
|
|
94
|
+
export interface EmitDtsConig extends EmitDtsConfig {}
|
|
93
95
|
|
|
94
96
|
/**
|
|
95
97
|
* Searches for a jsconfig or tsconfig starting at `root` and emits d.ts files
|