/** * @since 1.0.0 */ import type { Document } from "@typed/dom/Document"; import { type DomServices, type DomServicesElementParams } from "@typed/dom/DomServices"; import { GlobalThis } from "@typed/dom/GlobalThis"; import { Window } from "@typed/dom/Window"; import type { CurrentEnvironment } from "@typed/environment"; import * as Fx from "@typed/fx/Fx"; import * as RefSubject from "@typed/fx/RefSubject"; import { type Rendered } from "@typed/wire"; import * as Cause from "effect/Cause"; import type { DurationInput } from "effect/Duration"; import * as Effect from "effect/Effect"; import type * as Scope from "effect/Scope"; import * as ElementRef from "./ElementRef.js"; import type * as RenderContext from "./RenderContext.js"; import type { RenderEvent } from "./RenderEvent.js"; import * as RenderQueue from "./RenderQueue.js"; import type { RenderTemplate } from "./RenderTemplate.js"; export type HappyDOMOptions = ConstructorParameters[0]; /** * @since 1.0.0 */ export interface TestRender { readonly window: Window & GlobalThis; readonly document: Document; readonly elementRef: ElementRef.ElementRef; readonly errors: RefSubject.Computed>; readonly lastError: RefSubject.Filtered; readonly interrupt: Effect.Effect; readonly makeEvent: (type: string, eventInitDict?: EventInit) => Event; readonly makeCustomEvent: (type: string, eventInitDict?: CustomEventInit) => CustomEvent; readonly dispatchEvent: (options: EventOptions) => Effect.Effect; readonly click: (options?: Omit) => Effect.Effect; } /** * @since 1.0.0 */ export declare function testRender(fx: Fx.Fx, options?: HappyDOMOptions & { readonly [K in keyof DomServicesElementParams]?: (document: Document) => DomServicesElementParams[K]; } & { renderTimeout?: DurationInput; }): Effect.Effect, never, Scope.Scope | Exclude>; /** * @since 1.0.0 */ export type EventOptions = { readonly event: string; readonly selector?: string; readonly eventInit?: EventInit; }; /** * @since 1.0.0 */ export declare function dispatchEvent({ elementRef, makeEvent }: Pick, "elementRef" | "makeEvent">, options: EventOptions): Effect.Effect; /** * @since 1.0.0 */ export declare function click(rendered: Pick, "elementRef" | "makeEvent">, options?: Omit): Effect.Effect; export declare function getOrMakeWindow(options?: HappyDOMOptions): Effect.Effect; /** * @since 1.0.0 */ export interface TestHydrate extends TestRender { readonly elements: Elements; } /** * @since 1.0.0 */ export declare function testHydrate(fx: Fx.Fx, f: (rendered: Rendered, window: Window & GlobalThis) => Elements, options?: HappyDOMOptions & { readonly [K in keyof DomServicesElementParams]?: (document: Document) => DomServicesElementParams[K]; }): Effect.Effect, E, Scope.Scope | Exclude | Exclude>; export declare function isTemplateStartComment(comment: Comment): boolean; export declare function isTemplateEndComment(comment: Comment): boolean; export declare function stripTypedTemplateComments(html: string): string; /** * @since 1.0.0 */ export declare function testHtmlString(fx: Fx.Fx): Effect.Effect>; /** * @since 1.0.0 */ export declare function testHtmlChunks(fx: Fx.Fx): Effect.Effect, E, Scope.Scope | Exclude>; //# sourceMappingURL=Test.d.ts.map