import { StructureSchema } from '@ephox/boulder'; import type { Optional, Result } from '@ephox/katamari'; interface ViewButtonApi { setIcon: (newIcon: string) => void; } interface ViewToggleButtonApi extends ViewButtonApi { isActive: () => boolean; setActive: (state: boolean) => void; focus: () => void; } interface BaseButtonSpec { text?: string; icon?: string; tooltip?: string; buttonType?: 'primary' | 'secondary'; borderless?: boolean; onAction: (api: Api) => void; context?: string; } export interface ViewNormalButtonSpec extends BaseButtonSpec { text: string; type: 'button'; } export interface ViewToggleButtonSpec extends BaseButtonSpec { type: 'togglebutton'; active?: boolean; onAction: (api: ViewToggleButtonApi) => void; } export interface ViewButtonsGroupSpec { type: 'group'; buttons: Array; } export type ViewButtonSpec = ViewNormalButtonSpec | ViewToggleButtonSpec | ViewButtonsGroupSpec; interface BaseButton { text: Optional; icon: Optional; tooltip: Optional; buttonType: 'primary' | 'secondary'; borderless: boolean; onAction: (api: Api) => void; context: string; } export interface ViewNormalButton extends Omit, 'text'> { type: 'button'; text: string; onAction: (api: ViewButtonApi) => void; } export interface ViewToggleButton extends BaseButton { type: 'togglebutton'; active: boolean; onAction: (api: ViewToggleButtonApi) => void; } export interface ViewButtonsGroup { type: 'group'; buttons: Array; } export type ViewButton = ViewNormalButton | ViewToggleButton | ViewButtonsGroup; export declare const viewButtonSchema: import("@ephox/boulder").StructureProcessor; export declare const createViewButton: (spec: ViewButtonSpec) => Result>; export {}; //# sourceMappingURL=ViewButton.d.ts.map