import { EventBase } from "survey-core"; import { ICreatorPlugin, SurveyCreatorModel, saveToFileHandler, IPreset } from "survey-creator-core"; import { CreatorPresetEditorModel } from "./presets-editor"; import { IPresetListItem } from "./presets-manager"; import { TabContainerViewModel } from "survey-creator-core"; /** * A class that instantiates the UI Preset Editor and provides APIs to manage presets and their configuration. * * [UI Preset Editor Documentation](https://surveyjs.io/survey-creator/documentation/ui-preset-editor (linkStyle)) * * [UI Preset Editor Demo](https://surveyjs.io/survey-creator/examples/ui-preset-editor/ (linkStyle)) * @since 3.0.0 */ export declare class UIPresetEditor implements ICreatorPlugin { private creator; static defaultPresetName: string; editor: CreatorPresetEditorModel; model: TabContainerViewModel; static iconName: string; private activeTab; private currentPresetIndex; private currentValue; private designerPlugin; private toolboxCompact; private defaultJson; private presetsManager; private pagesList; private presetsList; private saveAction; private saveCount; /** * A function that handles saving a preset. * * Use the [`preset`](#preset) property to access the preset being saved. * * [How to Save and Load Presets](https://surveyjs.io/survey-creator/documentation/ui-preset-editor#save-and-load-custom-presets (linkStyle)) * @param saveNo An incremental number that identifies the current change. * @param callback A callback function. Pass `saveNo` as the first argument. Set the second argument to `true` if the server successfully applied the change or `false` if it was rejected. * @since 3.0.0 */ savePresetFunc: (saveNo: number, callback: (no: number, isSuccess: boolean) => void) => void; /** * An event that is raised when the preset list is saved in the **Manage Presets** dialog. * * Parameters: * * - `sender`: `UIPresetEditor`\ * A `UIPresetEditor` instance that raised the event. * - `options.presets`: [`IPresetListItem[]`](/survey-creator/documentation/api-reference/ipresetlistitem)\ * The updated preset list. * @since 3.0.0 */ onPresetListSaved: EventBase; private showPresets; private hidePresets; private checkIfNotSaved; private confirmReset; private confirmImport; private confirmQuit; constructor(creator: SurveyCreatorModel); /** * Adds a new preset to the UI Preset Editor. * @param preset An [`IPreset`](https://surveyjs.io/survey-creator/documentation/api-reference/ipreset) object to add. * @since 3.0.0 * @see removePreset */ addPreset(preset: IPreset): void; /** * Removes a preset from the UI Preset Editor. * @param presetAccessor An [`IPreset`](https://surveyjs.io/survey-creator/documentation/api-reference/ipreset) object to delete or a preset name. * @since 3.0.0 * @see addPreset */ removePreset(presetAccessor: string | IPreset): void; /** * Returns a preset with the specified `name`. * @param name The preset name. * @returns An [`IPreset`](https://surveyjs.io/survey-creator/documentation/api-reference/ipreset) object or `undefined` if a preset with this `name` is not found. * @since 3.0.0 */ getPreset(name: string): IPreset | undefined; /** * A [preset](/survey-creator/documentation/api-reference/ipreset) being configured in the UI Preset Editor. * * [UI Preset Editor Demo](https://surveyjs.io/survey-creator/examples/ui-preset-editor/ (linkStyle)) * @since 3.0.0 * @see savePresetFunc */ get preset(): IPreset | undefined; /** * A mutable array of presets added to the UI Preset Editor either in code (using `registerUIPreset` or [`addPreset`](#addPreset)) or by the user. * @since 3.0.0 */ get availablePresets(): IPresetListItem[]; protected discardUnsaved(): void; protected performSave(closeOnSave?: boolean): void; protected saveHandler(closeOnSave?: boolean): void; private saveOrSaveAs; protected saveAs(closeOnSave?: boolean): void; protected setStatus(status: "saved" | "unsaved" | "saving" | "initial"): void; saveToFileHandler: typeof saveToFileHandler; private preventTabSwitch; private getActivePresetJson; activate(): void; deactivate(): boolean; onLocaleChanged(): void; getLicenseText(hasCreatorLicense: boolean, creatorLicenseDateString: string): string; }