/// declare module '*.svelte' { export { SvelteComponentDev as default } from 'svelte/internal'; } /** * INTERNAL, DO NOT USE. Code may change at any time. */ interface Fragment { key: string | null; first: null; c: () => void; l: (nodes: any) => void; h: () => void; m: (target: HTMLElement, anchor: any) => void; p: (ctx: any, dirty: any) => void; r: () => void; f: () => void; a: () => void; i: (local: any) => void; o: (local: any) => void; d: (detaching: 0 | 1) => void; } interface T$$ { dirty: number[]; ctx: null | any; bound: any; update: () => void; callbacks: any; after_update: any[]; props: Record; fragment: null | false | Fragment; not_equal: any; before_update: any[]; context: Map; on_mount: any[]; on_destroy: any[]; skip_bound: boolean; on_disconnect: any[]; root: Element | ShadowRoot; } /** * Base class for Svelte components. Used when dev=false. */ declare class SvelteComponent { $$: T$$; $$set?: ($$props: any) => void; $destroy(): void; $on(type: any, callback: any): () => void; $set($$props: any): void; } declare type Props = Record; interface ComponentConstructorOptions = Record> { target: Element | ShadowRoot; anchor?: Element; props?: Props; context?: Map; hydrate?: boolean; intro?: boolean; $$inline?: boolean; } interface SvelteComponentDev$1 { $set(props?: Props): void; $on(event: string, callback: (event: any) => void): () => void; $destroy(): void; [accessor: string]: any; } /** * Base class for Svelte components with some minor dev-enhancements. Used when dev=true. */ declare class SvelteComponentDev$1 extends SvelteComponent { /** * @private * For type checking capabilities only. * Does not exist at runtime. * ### DO NOT USE! */ $$prop_def: Props; /** * @private * For type checking capabilities only. * Does not exist at runtime. * ### DO NOT USE! */ $$events_def: any; /** * @private * For type checking capabilities only. * Does not exist at runtime. * ### DO NOT USE! */ $$slot_def: any; constructor(options: ComponentConstructorOptions); $capture_state(): void; $inject_state(): void; } interface SvelteComponentTyped = any, Events extends Record = any, Slots extends Record = any> { $set(props?: Partial): void; $on>(type: K, callback: (e: Events[K]) => void): () => void; $destroy(): void; [accessor: string]: any; } /** * Base class to create strongly typed Svelte components. * This only exists for typing purposes and should be used in `.d.ts` files. * * ### Example: * * You have component library on npm called `component-library`, from which * you export a component called `MyComponent`. For Svelte+TypeScript users, * you want to provide typings. Therefore you create a `index.d.ts`: * ```ts * import { SvelteComponentTyped } from "svelte"; * export class MyComponent extends SvelteComponentTyped<{foo: string}> {} * ``` * Typing this makes it possible for IDEs like VS Code with the Svelte extension * to provide intellisense and to use the component like this in a Svelte file * with TypeScript: * ```svelte * * * ``` * * #### Why not make this part of `SvelteComponent(Dev)`? * Because * ```ts * class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {} * const component: typeof SvelteComponent = ASubclassOfSvelteComponent; * ``` * will throw a type error, so we need to separate the more strictly typed class. */ declare class SvelteComponentTyped = any, Events extends Record = any, Slots extends Record = any> extends SvelteComponentDev$1 { /** * @private * For type checking capabilities only. * Does not exist at runtime. * ### DO NOT USE! */ $$prop_def: Props; /** * @private * For type checking capabilities only. * Does not exist at runtime. * ### DO NOT USE! */ $$events_def: Events; /** * @private * For type checking capabilities only. * Does not exist at runtime. * ### DO NOT USE! */ $$slot_def: Slots; constructor(options: ComponentConstructorOptions); } /** * Convenience type to get the props the given component expects. Example: * ```html * * ``` */ declare type ComponentProps = Component extends SvelteComponentTyped ? Props : never; type SvelteConstructor = new (...args: any[]) => T; type SvelteComponentOptions = Omit>, 'hydrate' | 'target' | '$$inline'>; interface MountOptions extends SvelteComponentOptions { log?: boolean; } interface MountReturn { component: T; } /** * Mounts a Svelte component inside the Cypress browser * * @param {SvelteConstructor} Component Svelte component being mounted * @param {MountReturn} options options to customize the component being mounted * @returns Cypress.Chainable * * @example * import Counter from './Counter.svelte' * import { mount } from 'cypress/svelte' * * it('should render', () => { * mount(Counter, { props: { count: 42 } }) * cy.get('button').contains(42) * }) * * @see {@link https://on.cypress.io/mounting-svelte} for more details. */ declare function mount(Component: SvelteConstructor, options?: MountOptions): Cypress.Chainable>; export { MountOptions, MountReturn, mount };