@testing-library/svelte-core 1.0.0-next.1 → 1.0.0-next.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/README.md +1 -1
- package/dist/cleanup.d.ts +15 -0
- package/dist/cleanup.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/mount.d.ts +10 -0
- package/dist/mount.d.ts.map +1 -0
- package/dist/props.svelte.d.ts +12 -0
- package/dist/props.svelte.d.ts.map +1 -0
- package/dist/render.d.ts +12 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/setup.d.ts +13 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/svelte-version.d.ts +3 -0
- package/dist/svelte-version.d.ts.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ const { baseElement, container, component, unmount, rerender } = render(
|
|
|
75
75
|
| `unmount` | `() => void` | Unmount the component from the document | N/A |
|
|
76
76
|
|
|
77
77
|
> \[!TIP]
|
|
78
|
-
> Calling `render` is equivalent to calling `setup` followed by `mount`
|
|
78
|
+
> Calling `render` is equivalent to calling [`setup`](#setup) followed by [`mount`](#mount)
|
|
79
79
|
>
|
|
80
80
|
> ```ts
|
|
81
81
|
> const { baseElement, container, mountOptions } = setup(
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Register later cleanup task
|
|
3
|
+
*
|
|
4
|
+
* @param {() => void} onCleanup
|
|
5
|
+
*/
|
|
6
|
+
export function addCleanupTask(onCleanup: () => void): () => void;
|
|
7
|
+
/** Clean up all components and elements added to the document. */
|
|
8
|
+
export function cleanup(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Remove a cleanup task without running it.
|
|
11
|
+
*
|
|
12
|
+
* @param {() => void} onCleanup
|
|
13
|
+
*/
|
|
14
|
+
export function removeCleanupTask(onCleanup: () => void): void;
|
|
15
|
+
//# sourceMappingURL=cleanup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../src/cleanup.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,0CAFW,MAAM,IAAI,SAAJ,IAAI,CAKpB;AAWD,kEAAkE;AAClE,gCAMC;AAhBD;;;;GAIG;AACH,6CAFW,MAAM,IAAI,QAIpB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
|
package/dist/mount.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render a Svelte component into the document.
|
|
3
|
+
*
|
|
4
|
+
* @template {import('../types.js').Component} C
|
|
5
|
+
* @param {import('../types.js').ComponentImport<C>} Component
|
|
6
|
+
* @param {import('../types.js').MountOptions<C>} options
|
|
7
|
+
* @returns {import('../types.js').MountResult<C>}
|
|
8
|
+
*/
|
|
9
|
+
export function mount<C extends import("../types.js").Component>(Component: import("../types.js").ComponentImport<C>, options: import("../types.js").MountOptions<C>): import("../types.js").MountResult<C>;
|
|
10
|
+
//# sourceMappingURL=mount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../src/mount.js"],"names":[],"mappings":"AA2EA;;;;;;;GAOG;AACH,sBAL+C,CAAC,SAAnC,OAAQ,aAAa,EAAE,SAAU,aACnC,OAAO,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC,WACxC,OAAO,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,GACnC,OAAO,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAwBhD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a shallowly reactive props object.
|
|
3
|
+
*
|
|
4
|
+
* This allows us to update props on `rerender`
|
|
5
|
+
* without turing `props` into a deep set of Proxy objects
|
|
6
|
+
*
|
|
7
|
+
* @template {Record<string, unknown>} Props
|
|
8
|
+
* @param {Props} initialProps
|
|
9
|
+
* @returns {[Props, (nextProps: Partial<Props>) => void]}
|
|
10
|
+
*/
|
|
11
|
+
export function createProps<Props extends Record<string, unknown>>(initialProps?: Props): [Props, (nextProps: Partial<Props>) => void];
|
|
12
|
+
//# sourceMappingURL=props.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.svelte.d.ts","sourceRoot":"","sources":["../src/props.svelte.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,4BAJuC,KAAK,SAA9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,iBAC3B,KAAK,GACH,CAAC,KAAK,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CA0BxD"}
|
package/dist/render.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render a component into the document.
|
|
3
|
+
*
|
|
4
|
+
* @template {import('../types.js').Component} C
|
|
5
|
+
*
|
|
6
|
+
* @param {import('../types.js').ComponentImport<C>} Component - The component to render.
|
|
7
|
+
* @param {import('../types.js').ComponentOptions<C>} componentOptions - Customize how Svelte renders the component.
|
|
8
|
+
* @param {import('../types.js').SetupOptions<C>} setupOptions - Customize how the document is set up.
|
|
9
|
+
* @returns {import('../types.js').RenderResult<C>} The rendered component.
|
|
10
|
+
*/
|
|
11
|
+
export function render<C extends import("../types.js").Component>(Component: import("../types.js").ComponentImport<C>, componentOptions: import("../types.js").ComponentOptions<C>, setupOptions?: import("../types.js").SetupOptions<C>): import("../types.js").RenderResult<C>;
|
|
12
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.js"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,uBAP+C,CAAC,SAAnC,OAAQ,aAAa,EAAE,SAAU,aAEnC,OAAO,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC,oBACxC,OAAO,aAAa,EAAE,gBAAgB,CAAC,CAAC,CAAC,iBACzC,OAAO,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,GACnC,OAAO,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,CAOjD"}
|
package/dist/setup.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set up the document to render a component.
|
|
3
|
+
*
|
|
4
|
+
* @template {import('../types.js').Component} C
|
|
5
|
+
* @param {import('../types.js').ComponentOptions<C>} componentOptions - props or mount options
|
|
6
|
+
* @param {import('../types.js').SetupOptions<C>} setupOptions - base element of the document to bind any queries
|
|
7
|
+
* @returns {import('../types.js').SetupResult<C>}
|
|
8
|
+
*/
|
|
9
|
+
export function setup<C extends import("../types.js").Component>(componentOptions: import("../types.js").ComponentOptions<C>, setupOptions?: import("../types.js").SetupOptions<C>): import("../types.js").SetupResult<C>;
|
|
10
|
+
export class UnknownSvelteOptionsError extends TypeError {
|
|
11
|
+
constructor(unknownOptions: any);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.js"],"names":[],"mappings":"AAsDA;;;;;;;GAOG;AACH,sBAL+C,CAAC,SAAnC,OAAQ,aAAa,EAAE,SAAU,oBACnC,OAAO,aAAa,EAAE,gBAAgB,CAAC,CAAC,CAAC,iBACzC,OAAO,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,GACnC,OAAO,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC,CAuBhD;AA1ED;IACE,iCAaC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svelte-version.d.ts","sourceRoot":"","sources":["../src/svelte-version.js"],"names":[],"mappings":"AAGA,uCAAuC;AACvC,uCAA2D"}
|