svelte2tsx 0.4.13 → 0.5.2

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.d.ts CHANGED
@@ -44,8 +44,21 @@ export function svelte2tsx(
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 new transformation which will replace the now deprecated 'tsx'
48
+ * transformation soon.
47
49
  */
48
- mode?: 'tsx' | 'dts',
50
+ mode?: 'ts' | 'tsx' | 'dts',
51
+ /**
52
+ * Takes effect when using the new 'ts' mode. Default 'svelteHTML'.
53
+ * Tells svelte2tsx from which namespace some specific functions to use.
54
+ *
55
+ * Example: 'svelteHTML' -> svelteHTML.createElement<..>(..)
56
+ *
57
+ * A namespace needs to implement the following functions:
58
+ * - `createElement(str: string, validAttributes: ..): Element`
59
+ * - `mapElementTag<Key extends keyof YourElements>(str: Key): YourElements[Key]`
60
+ */
61
+ typingsNamespace?: string;
49
62
  /**
50
63
  * The accessor option from svelte config.
51
64
  * Would be overridden by the same config in the svelte:option element if exist