survey-creator-core
Version:
A framework-independent core package of the SurveyJS Survey Creator component. With Survey Creator, you can visually design complex, interactive JSON forms and surveys in a drag-and-drop interface.
61 lines (60 loc) • 2.38 kB
TypeScript
import { CreatorPresetBase, ICreatorPreset } from "./presets-base";
import { ICreatorPresetToolboxItem } from "./presets-toolbox";
import { ICreatorPresetTab } from "./presets-tabs";
import { IToolboxCategoryDefinition } from "../toolbox";
import { ISurveyPropertyGridDefinition } from "../question-editor/definition";
import { SurveyCreatorModel } from "../creator-base";
import { ConfigsHash } from "../utils/configs";
export interface ICreatorPresetData {
languages?: {
creator?: string;
surveyLocales?: Array<string>;
useEnglishNames?: boolean;
};
propertyGrid?: {
definition?: ISurveyPropertyGridDefinition;
};
tabs?: {
items?: Array<ICreatorPresetTab>;
activeTab?: string;
};
toolbox?: {
definition?: Array<ICreatorPresetToolboxItem>;
categories?: Array<IToolboxCategoryDefinition>;
showCategoryTitles?: boolean;
};
options?: any;
localization?: any;
}
export interface ICreatorPresetConfig {
presetName?: string;
visible?: boolean;
json?: ICreatorPresetData | any;
}
export declare const PredefinedCreatorPresets: string[];
export declare const defaultCreatorPresetsOrder: string[];
/**
* Registers UI presets to make them available for customization in the Preset Editor UI.
* @param presets One or more UI preset configuations separated by commas, or an object containing multiple configurations.
*/
export declare function registerUIPreset(...presets: Array<ConfigsHash<ICreatorPresetConfig> | ICreatorPresetConfig>): void;
/**
* A class that instantiates a UI preset and provides an API to apply it.
*/
export declare class UIPreset extends CreatorPresetBase {
constructor(data: ICreatorPresetData | ICreatorPresetConfig);
name: string;
getPath(): string;
getJson(): ICreatorPresetData;
/**
* Applies the preset to a Survey Creator instance.
* @param creator A [`SurveyCreatorModel`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator) instance to which the preset is applied.
*/
applyTo(creator: SurveyCreatorModel): void;
apply(creator: SurveyCreatorModel, internal?: boolean): void;
protected applyLocalization(): void;
protected createPresets(): Array<ICreatorPreset>;
}
export declare const CreatorPresets: {
[index: string]: ICreatorPresetConfig;
};