export type StyleDefinition = { key: string; displayName: string; isDefault: boolean; settings: Record; } & (ElementStyleDefinition | BaseStyleDefinition | NodeStyleDefinition); export type ElementStyleDefinition = { contentType: TN; }; export type BaseStyleDefinition = { baseType: TN; }; export type NodeStyleDefinition = { nodeType: TN; }; export type StyleSetting = { displayName: string; sortOrder: number; editor?: string; choices: Record; }; export type LayoutProps> = { type: T extends ElementStyleDefinition ? TN : (T extends BaseStyleDefinition ? TN : (T extends NodeStyleDefinition ? TN : null)); layoutType: string; template: T['key'] | null; settings: LayoutPropsSetting[]; }; export type LayoutPropsSetting, K extends keyof T = keyof T> = LayoutPropsSettingChoices[K]; export type LayoutPropsSettingChoices> = { [K in keyof T]: { key: K; value: keyof T[K]['choices']; }; }; export type LayoutPropsSettingKeys> = CL['settings'][number]['key']; export type LayoutPropsSettingValues, K extends LayoutPropsSettingKeys> = Extract['value']; /** * Read a configured layout setting from Style properties retrieved through Optimizely Graph * * @param from The Layout Settings as provided for Visual Builder rendered elements * @param settingName The name of the setting to retrieve the value for * @param defaultValue THe default value for when the setting is missing or not set * @returns The setting value */ export declare function readSetting, F extends LayoutPropsSettingKeys, DV extends LayoutPropsSettingValues | undefined>(from: T | undefined, settingName: F, defaultValue?: DV): DV extends undefined ? (LayoutPropsSettingValues | undefined) : Exclude, undefined>; export declare function extractSettings>(from: T | undefined): Partial<{ [K in LayoutPropsSettingKeys]: LayoutPropsSettingValues; }>;