import { nothing, PropertyValueMap } from 'lit'; import { FileType } from '../types/files.types'; import { WeavySubAppComponent } from '../classes/weavy-sub-app-component'; import { ShadowPartsController } from '../controllers/shadow-parts-controller'; declare global { interface HTMLElementTagNameMap { "wy-file-versions": WyFileVersions; } } /** * File versions list for a file — displays available versions and actions (download, revert, remove). * * **Used sub components:** * * - [``](./ui/wy-item.ts) * - [``](./ui/wy-item.ts) * - [``](./ui/wy-dropdown.ts) * - [``](./ui/wy-dropdown.ts) * - [``](./ui/wy-dropdown.ts) * - [``](./ui/wy-icon.ts) * - [``](./ui/wy-progress-circular.ts) * - [``](./wy-empty.ts) * * @csspart wy-versions - Wrapper for the versions list. * * @fires {FileVersionSelectEventType} file-version-select - Emitted when a file version, or the unsaved draft (`draft` set), is selected. * @fires {FileEditEventType} edit - Emitted when the file/draft should be edited. * */ export declare class WyFileVersions extends WeavySubAppComponent { /** @internal */ protected exportParts: ShadowPartsController; /** * Source file whose version timeline should be displayed. */ file?: FileType; /** * Currently selected version. Falls back to the latest when unset. */ activeVersion?: FileType; /** * Whether the unsaved draft is the selected entry rather than a stored version. */ activeDraft: boolean; /** * Id used for handling drafts. * @internal */ draftKey?: string; /** * Query controller for getting file draft. * @internal */ private draftQuery; /** * Query controller fetching the file versions list. * @internal */ private fileVersionsQuery; /** * Mutation used when reverting to an older version. * @internal */ private fileVersionRestoreMutation?; /** * Mutation used when removing a version. * @internal */ private fileVersionDeleteMutation?; /** * Selects the provided version and emits `file-version-select`. * * @param versionFile - Version to select. */ selectVersion(versionFile: FileType): void; /** * Selects the unsaved draft and emits `file-version-select` with `draft` set, so the host can show the draft * without entering edit mode. */ selectDraft(): void; /** * Emit a `file-version-select` event with the chosen version. * * @internal * @param versionFile - Version to announce. * @returns Whether the event was not canceled. */ dispatchFileVersionSelect(versionFile: FileType, draft?: boolean): boolean; /** * Emit a `edit` event for the file. * * @internal * @returns Whether the event was not canceled. */ dispatchFileEdit(): boolean | undefined; /** * Revert the file to the supplied version. * * @internal * @param versionFile - Version to restore. */ handleRevert(versionFile: FileType): void; /** * Remove the supplied version and adjust the active selection if needed. * * @internal * @param versionFile - Version to delete. */ handleRemove(versionFile: FileType): void; /** * Download the provided version via the browser. * * @internal * @param file - Version file to download. */ triggerDownload(file: FileType): void; /** * Removes any draft for the current file. */ removeDraft(): void; willUpdate(changedProperties: PropertyValueMap): Promise; render(): import('../../node_modules/lit-html/node/lit-html.js').TemplateResult<1> | typeof nothing; } //# sourceMappingURL=wy-file-versions.d.ts.map