import { type HtmlInterpolation } from 'element-vir';
/**
 * Adds a control to an element-book page.
 *
 * @category Internal
 */
export type BookPageControl<ControlType extends BookPageControlType = BookPageControlType> = {
    controlType: ControlType;
    /** The name and label for the control. */
    controlName: string;
} & (ControlType extends BookPageControlType.Custom ? {
    /** Custom HTML template to render for this control. */
    content: HtmlInterpolation;
    initValue?: never;
} : {
    initValue: BookPageControlValueType[ControlType];
    content?: never;
}) & (ControlType extends BookPageControlType.Dropdown ? {
    options: string[];
} : {
    options?: never;
});
/**
 * Initialization options for an element-book page control.
 *
 * @category Internal
 */
export type BookPageControlInit<ControlType extends BookPageControlType> = Omit<BookPageControl<ControlType>, 'controlName'>;
/**
 * Checks and type guards that the input page control init is of the given type.
 *
 * @category Internal
 */
export declare function isControlInitType<const SpecificControlType extends BookPageControlType>(controlInit: BookPageControlInit<BookPageControlType>, specificType: SpecificControlType): controlInit is BookPageControlInit<SpecificControlType>;
/**
 * Define a page control. This doesn't do anything fancy (in fact it only returns the input) but it
 * helps immensely with type inference.
 *
 * @category Main
 */
export declare function definePageControl<const ControlType extends BookPageControlType>(controlInit: BookPageControlInit<ControlType>): BookPageControlInit<ControlType>;
/**
 * Maps an object of user-defined controls to their initial values.
 *
 * @category Internal
 */
export type ControlsToValues<ControlsInit extends BookPageControlsInitBase> = {
    [ControlName in keyof ControlsInit]: ControlsInit[ControlName]['initValue'];
};
/**
 * Base type for a arbitrary, user-defined object of page controls.
 *
 * @category Internal
 */
export type BookPageControlsInitBase = Record<string, BookPageControlInit<BookPageControlType>>;
/**
 * Base type for a arbitrary, user-defined object of page control values.
 *
 * @category Internal
 */
export type BookPageControlsValues = ControlsToValues<BookPageControlsInitBase>;
/**
 * All the supported page control types. One of these must be chosen when defining a page control.
 *
 * @category Main
 */
export declare enum BookPageControlType {
    Checkbox = "checkbox",
    Color = "color",
    /** Custom controls render user-provided HTML directly. They have no editable value. */
    Custom = "custom",
    Dropdown = "dropdown",
    /** Hidden controls allow any values but they aren't displayed to the user for editing. */
    Hidden = "hidden",
    Number = "number",
    Text = "text"
}
/**
 * Specifies the default value for each page control type, as well as its type.
 *
 * @category Internal
 */
export declare const controlValueTypes: {
    checkbox: boolean;
    color: string;
    /** Custom controls don't have a user-editable value. */
    custom: undefined;
    dropdown: string;
    hidden: any;
    number: number;
    text: string;
};
/**
 * Each page control type mapped to the type of their value.
 *
 * @category Internal
 */
export type BookPageControlValueType = typeof controlValueTypes;
/**
 * Checks that the given control init object is valid.
 *
 * @category Internal
 */
export declare function checkControls(controlsInit: BookPageControlsInitBase | undefined, pageName: string): Error[];
