export * from "@testing-library/dom"; export { UnknownSvelteOptionsError } from "@testing-library/svelte-core"; /** * Customize how Svelte renders the component. */ export type SvelteComponentOptions = import("@testing-library/svelte-core/types").ComponentOptions; /** * Customize how Testing Library sets up the document and binds queries. */ export type RenderOptions = import("@testing-library/svelte-core/types").SetupOptions & { queries?: Q; }; /** * The rendered component and bound testing functions. */ export type RenderResult = { container: HTMLElement; baseElement: HTMLElement; component: import("@testing-library/svelte-core/types").Exports; debug: (el?: HTMLElement | DocumentFragment) => void; rerender: import("@testing-library/svelte-core/types").Rerender; unmount: () => void; } & { [P in keyof Q]: DomTestingLibrary.BoundFunction; }; export type FireFunction = (...args: Parameters) => Promise>; export type FireObject = { [K in DomTestingLibrary.EventType]: (...args: Parameters) => Promise>; }; /** * Call a function and wait for Svelte to flush pending changes. * * @template T * @param {() => Promise | T} [fn] - A function, which may be `async`, to call before flushing updates. * @returns {Promise} */ export function act(fn?: () => Promise | T): Promise; /** Unmount components, remove elements added to ``, and reset `@testing-library/dom`. */ export function cleanup(): void; /** * @typedef {(...args: Parameters) => Promise>} FireFunction */ /** * @typedef {{ * [K in DomTestingLibrary.EventType]: (...args: Parameters) => Promise> * }} FireObject */ /** * Fire an event on an element. * * Consider using `@testing-library/user-event` instead, if possible. * @see https://testing-library.com/docs/user-event/intro/ * * @type {FireFunction & FireObject} */ export const fireEvent: FireFunction & FireObject; /** * Customize how Svelte renders the component. * * @template {import('@testing-library/svelte-core/types').Component} C * @typedef {import('@testing-library/svelte-core/types').ComponentOptions} SvelteComponentOptions */ /** * Customize how Testing Library sets up the document and binds queries. * * @template {DomTestingLibrary.Queries} [Q=typeof DomTestingLibrary.queries] * @typedef {import('@testing-library/svelte-core/types').SetupOptions & { queries?: Q }} RenderOptions */ /** * The rendered component and bound testing functions. * * @template {import('@testing-library/svelte-core/types').Component} C * @template {DomTestingLibrary.Queries} [Q=typeof DomTestingLibrary.queries] * * @typedef {{ * container: HTMLElement * baseElement: HTMLElement * component: import('@testing-library/svelte-core/types').Exports * debug: (el?: HTMLElement | DocumentFragment) => void * rerender: import('@testing-library/svelte-core/types').Rerender * unmount: () => void * } & { * [P in keyof Q]: DomTestingLibrary.BoundFunction * }} RenderResult */ /** * Render a component into the document. * * @template {import('@testing-library/svelte-core/types').Component} C * @template {DomTestingLibrary.Queries} [Q=typeof DomTestingLibrary.queries] * * @param {import('@testing-library/svelte-core/types').ComponentImport} Component - The component to render. * @param {import('@testing-library/svelte-core/types').ComponentOptions} options - Customize how Svelte renders the component. * @param {RenderOptions} renderOptions - Customize how Testing Library sets up the document and binds queries. * @returns {RenderResult} The rendered component and bound testing functions. */ export function render(Component: import("@testing-library/svelte-core/types").ComponentImport, options?: import("@testing-library/svelte-core/types").ComponentOptions, renderOptions?: RenderOptions): RenderResult; /** * Configure `@testing-library/dom` for usage with Svelte. * * Ensures events fired from `@testing-library/dom` * and `@testing-library/user-event` wait for Svelte * to flush changes to the DOM before proceeding. */ export function setup(): void; import * as DomTestingLibrary from '@testing-library/dom'; //# sourceMappingURL=pure.d.ts.map