/** * Registers a new element with an automatically generated unique name. * Helps to make a test fully isolated. * * @example * const tag = defineCE(class extends MyMixin(HTMLElement) { * // define custom element class body * }); * const el = fixture(`<${tag}>`); * // test el * * @template {HTMLElement} T * @param {import("@open-wc/dedupe-mixin").Constructor} klass Class which extends HTMLElement * @returns {string} Tag name of the registered element */ export function defineCE(klass: import("@open-wc/dedupe-mixin").Constructor): string; /** * Indicates that this is Internet Explorer. * * @returns {boolean} */ export function isIE(): boolean; /** * Resolves after provided amount of miliseconds. * * @example * await aTimeout(100); * * @param {number} ms Miliseconds. * @returns {Promise} Promise to await until time is up */ export function aTimeout(ms: number): Promise; /** * Resolves after requestAnimationFrame. * * @example * await nextFrame(); * * @returns {Promise} Promise that resolved after requestAnimationFrame */ export function nextFrame(): Promise; /** * Blurs the provided element and await time before and after it on IE. * * @example * const el = await fixture(''); * await triggerBlurFor(el); * // el is no longer focused * * @param {HTMLElement} element Element/Node to blur * @returns {Promise} Promise to await until blur is done (for IE) */ export function triggerBlurFor(element: HTMLElement): Promise; /** * Focuses the provided element and await time before and after it on IE. * * Background info: * Adding an event and immediately trigger it fails in IE. * Also before checking the effects of a trigger IE needs some time. * * @example * const el = await fixture(''); * await triggerFocusFor(el); * // el is now focused * * @param {HTMLElement} element Element/Node to focus * @returns {Promise} Promise to await until focus is done (for IE) */ export function triggerFocusFor(element: HTMLElement): Promise; /** * Registers a new element with an automatically generated unique name. * Helps to make a test fully isolated. * * @example * const tag = defineCE(class extends MyMixin(HTMLElement) { * // define custom element class body * }); * const el = fixture(`<${tag}>`); * // test el * * @template {HTMLElement} T * @param {import("@open-wc/dedupe-mixin").Constructor} klass Class which extends HTMLElement * @returns {string} Tag name of the registered element */ export function oneEvent>(eventTarget: EventTarget, eventName: string): Promise; /** * Registers a new element with an automatically generated unique name. * Helps to make a test fully isolated. * * @example * const tag = defineCE(class extends MyMixin(HTMLElement) { * // define custom element class body * }); * const el = fixture(`<${tag}>`); * // test el * * @template {HTMLElement} T * @param {import("@open-wc/dedupe-mixin").Constructor} klass Class which extends HTMLElement * @returns {string} Tag name of the registered element */ export function oneDefaultPreventedEvent>(eventTarget: EventTarget, eventName: string): Promise; /** * Waits until the given predicate returns a truthy value. Calls and awaits the predicate * function at the given interval time. Can be used to poll until a certain condition is true. * * @example * ```js * import { fixture, waitUntil } from '@open-wc/testing-helpers'; * * const element = await fixture(html``); * * await waitUntil(() => element.someAsyncProperty, 'element should become ready'); * ``` * * @param {() => unknown | Promise} predicate - predicate function which is called each poll interval. * The predicate is awaited, so it can return a promise. * @param {string} [message] an optional message to display when the condition timed out * @param {{ interval?: number, timeout?: number }} [options] timeout and polling interval */ export function waitUntil(predicate: () => unknown | Promise, message?: string, options?: { interval?: number; timeout?: number; }): Promise; //# sourceMappingURL=helpers.d.ts.map