@testing-library/svelte 3.1.2 → 3.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types/index.d.ts +7 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testing-library/svelte",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "Simple and complete Svelte testing utilities that encourage good testing practices.",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",
package/types/index.d.ts CHANGED
@@ -3,18 +3,11 @@
3
3
  // Definitions by: Rahim Alwer <https://github.com/mihar-22>
4
4
 
5
5
  import {queries, Queries, BoundFunction, EventType} from '@testing-library/dom'
6
- import { SvelteComponentTyped } from 'svelte/types/runtime'
6
+ import { SvelteComponent } from 'svelte/types/runtime'
7
7
 
8
8
  export * from '@testing-library/dom'
9
9
 
10
- export interface SvelteComponentOptions<P extends Record<string, any> = any> {
11
- target?: HTMLElement
12
- anchor?: string
13
- props?: P
14
- context?: any
15
- hydrate?: boolean
16
- intro?: boolean
17
- }
10
+ type SvelteComponentOptions = any
18
11
 
19
12
  type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
20
13
 
@@ -22,41 +15,30 @@ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
22
15
  * Render a Component into the Document.
23
16
  */
24
17
  export type RenderResult<Q extends Queries = typeof queries> = {
25
- container: Element
18
+ container: HTMLElement
26
19
  component: SvelteComponent
27
- component: SvelteComponentTyped
28
- debug: (el?: Element | DocumentFragment) => void
20
+ debug: (el?: HTMLElement | DocumentFragment) => void
29
21
  rerender: (options: SvelteComponentOptions) => void
30
22
  unmount: () => void
31
23
  } & { [P in keyof Q]: BoundFunction<Q[P]> }
32
24
 
33
25
  export interface RenderOptions<Q extends Queries = typeof queries> {
34
- container?: Element
26
+ container?: HTMLElement
35
27
  queries?: Q
36
28
  }
37
29
 
38
30
  export function render(
39
- component: SvelteComponentTyped,
31
+ component: typeof SvelteComponent,
40
32
  componentOptions?: SvelteComponentOptions,
41
33
  renderOptions?: Omit<RenderOptions, 'queries'>
42
34
  ): RenderResult
43
35
 
44
36
  export function render<Q extends Queries>(
45
- component: SvelteComponentTyped,
37
+ component: typeof SvelteComponent,
46
38
  componentOptions?: SvelteComponentOptions,
47
39
  renderOptions?: RenderOptions<Q>,
48
40
  ): RenderResult<Q>
49
41
 
50
- export function render<
51
- P extends Record<string, any> = any,
52
- E extends Record<string, any> = any,
53
- S extends Record<string, any> = any
54
- >(
55
- component: SvelteComponentTyped<P, E, S>,
56
- componentOptions?: SvelteComponentOptions<P>,
57
- renderOptions?: Omit<RenderOptions, "queries">
58
- ): RenderResult;
59
-
60
42
  /**
61
43
  * Unmounts trees that were mounted with render.
62
44
  */