import { LitElement } from 'lit'; import { ShadowPartsController } from '../controllers/shadow-parts-controller'; declare global { interface HTMLElementTagNameMap { "wy-filename-input": WyFilenameInput; } } /** * Handles a submitted filename while the prompt stays open. * * Return an error message to reject the name and keep the prompt open with the message shown inline. * Return nothing to accept the name and close the prompt. A thrown error closes the prompt and rejects the pending `open()` call. */ export type FilenameSubmitHandler = (filename: string) => Promise | string | undefined | void; /** * Internal filename prompt shared by file creation components. */ export declare class WyFilenameInput extends LitElement { static styles: import('lit').CSSResult[]; protected exportParts: ShadowPartsController; private show; /** A submit handler is running; input and button are disabled until it settles. */ private pending; /** Message from the last rejected submission, shown inline until the input changes. */ private error?; private inputRef; private resolveFilename?; private rejectFilename?; private submitHandler?; private initialFilename; /** * Prompt for a filename, replacing any previous pending prompt. * * @param ext - Suggested initial extension, not a restriction. * @param submit - Optional handler run on submit while the prompt stays open, e.g. to create the file and report a taken name. * @returns The accepted filename unchanged, or undefined on cancellation. Rejects when the submit handler throws. */ open(ext?: string, submit?: FilenameSubmitHandler): Promise; /** * Focus and select the basename, leaving the extension editable. * Dotfiles such as `.env` have no basename to select, so the whole name is selected instead. */ private focusInput; /** * Settle the pending prompt and hide the modal. * @param filename - Accepted filename, or undefined to cancel. */ private close; /** * Hide the modal and reject the pending prompt with the submit handler's error. * @param reason - The thrown error. */ private fail; /** * Run the submit handler, keeping the prompt open with an inline error when the name is rejected. */ private handleSubmit; /** Cancel pending input when the prompt is removed. */ disconnectedCallback(): void; /** Render the filename modal without performing any network operations. */ protected render(): import('../../node_modules/lit-html/node/directive.js').DirectiveResult<{ new (_partInfo: import('../../node_modules/lit-html/node/directive.js').PartInfo): import('../../node_modules/lit-html/node/directives/keyed.js').Keyed>; }>; } //# sourceMappingURL=wy-filename-input.d.ts.map