declare namespace CanvasJS {
    const DESIGN_GRID_UNIT: number;
}
declare namespace CanvasJS {
    enum CanvasType {
        Design = 0,
        Actual = 1
    }
}
declare namespace CanvasJS {
    class Surface extends Jade.UI.Control {
        constructor(options: Jade.UI.IControlOptions);
    }
}
declare namespace CanvasJS {
    class SurfaceBehavior {
        private m_options;
        constructor(options: any);
        protected get options(): Jade.StateBag;
        start(): void;
        stop(): void;
    }
}
declare namespace CanvasJS {
    interface ITypeResolverOptions {
        element: ElementModel;
        designScript: string;
        actualScript: string;
    }
    interface ITypeResolverCloneOptions {
        id: string;
        height?: number;
        width?: number;
        x?: number;
        y?: number;
    }
    class TypeResolver {
        private m_element;
        private m_designScript;
        private m_actualScript;
        constructor(options: ITypeResolverOptions);
        protected get designScript(): string;
        protected get actualScript(): string;
        getView(canvasType: CanvasType): ElementView;
        getViewOf<T extends ElementView>(canvasType: CanvasType): T;
        clone(options: ITypeResolverCloneOptions): ElementModel;
        private getInvalidElementView;
        static isGroupType(input: any): any;
        static createElement(state: IElementModelState): ElementModel;
    }
}
declare namespace CanvasJS {
    interface IDocumentModel {
        id?: string;
        elements: Array<IElementModel>;
    }
    interface IDocumentModelAttributes {
        [key: string]: any;
    }
    class DocumentModel {
        private m_fillComplete;
        private m_state;
        private m_onStateChangeCallback;
        private m_elements;
        constructor(state: IDocumentModel);
        get id(): string;
        get attributes(): IDocumentModelAttributes;
        get elements(): Jade.ObservableMappedCollection<ElementModel>;
        get state(): Jade.StateBag;
        get onStateChangeCallback(): () => void;
        set onStateChangeCallback(value: () => void);
        get hasChanges(): boolean;
        set hasChanges(value: boolean);
        toJSON(): any;
        getErroredElements(): Jade.MappedCollection<ElementModel>;
        clone(): DocumentModel;
        createElement(state: IElementModelState, addToElements?: boolean): ElementModel;
        fill(state: IDocumentModel): void;
        protected onElementRemoved(e: Jade.ObservableCollectionChangeEventArgs<ElementModel>): void;
        protected onElementAdded(e: Jade.ObservableCollectionChangeEventArgs<ElementModel>): void;
        protected onElementInserted(e: Jade.ObservableCollectionChangeEventArgs<ElementModel>): void;
        protected onStateChanged(): void;
        private onStateChangedTrigger;
    }
}
declare namespace CanvasJS {
    interface IElementError {
        code: number;
        message: string;
        recoverable: boolean;
        componentId: string;
    }
    interface IElementErrorOptions {
        code: number;
        message: string;
        recoverable: boolean;
        componentId?: string;
    }
    class ElementError implements IElementError {
        private m_code;
        private m_message;
        private m_recoverable;
        private m_componentId;
        constructor(options: IElementErrorOptions);
        get code(): number;
        get componentId(): string;
        get message(): string;
        get recoverable(): boolean;
    }
}
declare namespace CanvasJS {
    interface IElementModelState {
        id?: string;
        document: DocumentModel;
        componentName?: string;
        componentScript?: string;
        height?: number;
        width?: number;
        x?: number;
        y?: number;
        anchorBottom?: number;
        anchorRight?: number;
        readonly errors?: Array<IElementError>;
        [key: string]: any;
    }
    interface IElementModel {
        id?: string;
        componentName?: string;
        componentScript?: string;
        height?: number;
        width?: number;
        x?: number;
        y?: number;
        anchorBottom?: number;
        anchorRight?: number;
        readonly errors?: Array<IElementError>;
        [key: string]: any;
    }
    class ElementModel implements IElementModel {
        private m_state;
        private m_resolver;
        private m_document;
        private m_onStateChangeCallback;
        private m_suspendStateChanged;
        constructor(state: IElementModelState);
        get state(): Jade.StateBag;
        get id(): string;
        set id(value: string);
        get componentName(): string;
        set componentName(value: string);
        get componentType(): string;
        set componentType(value: string);
        get componentScript(): string;
        get document(): DocumentModel;
        get height(): number;
        set height(value: number);
        get width(): number;
        set width(value: number);
        get x(): number;
        set x(value: number);
        get y(): number;
        set y(value: number);
        get anchorBottom(): number;
        set anchorBottom(value: number);
        get anchorRight(): number;
        set anchorRight(value: number);
        get onStateChangeCallback(): () => void;
        set onStateChangeCallback(value: () => void);
        get resolver(): TypeResolver;
        set resolver(value: TypeResolver);
        get errors(): Array<IElementError>;
        get hasErrors(): boolean;
        get hasNonRecoverableErrors(): boolean;
        get maxHeight(): number;
        set maxHeight(value: number);
        get minHeight(): number;
        set minHeight(value: number);
        get maxWidth(): number;
        set maxWidth(value: number);
        get minWidth(): number;
        set minWidth(value: number);
        get suspendStateChanged(): boolean;
        set suspendStateChanged(value: boolean);
        protected getDocument<TType extends DocumentModel>(): TType;
        protected onStateChanged(): void;
        protected triggerStateChanged(): void;
        toJSON(): any;
        delete(): void;
        has(name: string): boolean;
    }
}
declare namespace CanvasJS {
    const GROUP_COMPONENT_SCRIPT_DEFAULT = "CanvasJS.GroupModel";
    interface IGroupModel extends IElementModel {
        readonly elements: Array<string>;
    }
    class GroupModel extends ElementModel implements IGroupModel {
        private static m_componentTypeDefault;
        constructor(state: IElementModelState);
        get elements(): Array<string>;
        static get componentTypeDefault(): string;
        static set componentTypeDefault(value: string);
    }
}
declare namespace CanvasJS {
    export interface IDocumentViewParameters {
    }
    export interface IDocumentViewOptions<T extends DocumentModel> extends Jade.UI.IControlOptions {
        $source: T;
        parameters?: IDocumentViewParameters;
    }
    class DocumentRoot<T extends DocumentModel> extends Jade.UI.Control {
        protected m_source: any;
        get source(): T;
    }
    export abstract class DocumentView extends DocumentRoot<DocumentModel> {
        constructor(options: IDocumentViewOptions<DocumentModel>);
        get parameters(): any;
        template(): string | JQuery | Array<string>;
        toJSON(): any;
        getParametersOf<T>(): any;
    }
    export class DocumentViewBase<T extends DocumentModel> extends DocumentView {
        get source(): T;
    }
    export {};
}
declare namespace CanvasJS {
    export interface IElementViewOptions<T extends ElementModel> extends Jade.UI.IControlOptions {
        $source: T;
    }
    class ElementRoot<T extends ElementModel> extends Jade.UI.Control {
        protected m_source: any;
        get source(): T;
    }
    export abstract class ElementView extends ElementRoot<ElementModel> {
        get height(): number;
        set height(value: number);
        get width(): number;
        set width(value: number);
        get x(): number;
        set x(value: number);
        get y(): number;
        set y(value: number);
        get anchorBottom(): number;
        set anchorBottom(value: number);
        get anchorRight(): number;
        set anchorRight(value: number);
        get nodeHeight(): number;
        get nodeWidth(): number;
        template(): string | Array<string> | JQuery;
        toJSON(): any;
        protected onBrowserResize(): void;
    }
    export abstract class ElementViewBase<T extends ElementModel> extends ElementView {
        constructor(options: IElementViewOptions<T>);
        get source(): T;
    }
    export {};
}
declare namespace CanvasJS.Actual {
    enum CanvasCss {
        Element = "-canvasjs-actual-element"
    }
}
declare namespace CanvasJS.Actual {
    class Environment {
        private static m_context;
        static get document(): DocumentActualView;
        static get surface(): Surface;
        static get events(): Jade.ContextEventBus;
        static get store(): Jade.StateBag;
        static get context(): Jade.Context;
        static getControlID(node: JQuery | HTMLElement): string;
        static reset(): void;
        private static ensureContext;
    }
}
declare namespace CanvasJS.Actual {
    class DocumentActualView extends DocumentViewBase<DocumentModel> {
        constructor(options: IDocumentViewOptions<DocumentModel>);
        protected onDestroy(e: Jade.UI.ControlEventArgs): void;
        protected fill(): void;
    }
    class DocumentActualViewBase<T extends DocumentModel> extends DocumentActualView {
        get source(): T;
    }
}
declare namespace CanvasJS.Actual {
    class ElementActualView extends ElementViewBase<ElementModel> {
        protected onActivate(e: Jade.UI.ControlEventArgs): void;
        protected wrapTemplate(template: JQuery): JQuery;
    }
    class ElementActualViewBase<T extends ElementModel> extends ElementActualView {
        get source(): T;
    }
}
declare namespace CanvasJS.Actual {
    class GroupActualView extends ElementActualViewBase<GroupModel> {
    }
}
declare namespace CanvasJS.Actual {
    class InvalidElementView extends ElementActualViewBase<ElementModel> {
        template(): string | Array<string> | JQuery;
    }
}
declare namespace CanvasJS.Design {
    class Environment {
        static m_context: Jade.Context;
        static get gridUnit(): number;
        static get document(): DocumentDesignView;
        static get documentExists(): boolean;
        static get surface(): Surface;
        static get surfaceExists(): boolean;
        static get dialog(): Jade.UI.Dialog;
        static get selection(): Selection;
        static get selectionBox(): SelectionBox;
        static get toolBox(): ToolBox;
        static get toolBoxExists(): boolean;
        static get statusBar(): StatusBar;
        static get statusBarExists(): boolean;
        static get ribbonBar(): Jade.UI.Controls.RibbonBar;
        static get ribbonBarExists(): boolean;
        static get events(): Jade.ContextEventBus;
        static get store(): Jade.StateBag;
        static get context(): Jade.Context;
        static getControlID(node: JQuery | HTMLElement): string;
        static reset(): void;
        private static ensureContext;
        private static nodeExists;
    }
}
declare namespace CanvasJS.Design {
    enum ClipboardActionType {
        copy = 1,
        cut = 2,
        paste = 3
    }
    interface IClipboardPasteEvent {
        (args: IClipboardPasteEventArgs): any;
    }
    interface IClipboardPasteEventArgs {
        states: Array<IElementState>;
        commit: (states: Array<IElementState>) => void;
        cancel: Function;
    }
    class Clipboard {
        static copy(): void;
        static cut(): void;
        static paste(): void;
        static duplicate(): void;
        static hasContent(success: (result: boolean) => void): void;
        private static getClipboardItem;
        private static setClipboardItem;
        private static clear;
    }
}
declare namespace CanvasJS.Design {
    interface IElementState {
        id: string;
        type: string;
        x: number;
        y: number;
        elements: string[];
        [id: string]: any;
        selected: boolean;
    }
    interface IClipboardAction {
        id?: "canvas.clipboard";
        type: ClipboardActionType;
        data: Array<any>;
        executionCount?: number;
    }
    class ClipboardAction {
        private m_type;
        private m_data;
        private m_dataMap;
        private m_executionCount;
        constructor(options: IClipboardAction);
        get type(): ClipboardActionType;
        private get data();
        toJSON(): IClipboardAction;
        getData(): Array<IElementState>;
        private processDataForStorage;
        private processElementForStorage;
        private processGroupForStorage;
        private processDataForRetrieval;
    }
}
declare namespace CanvasJS.Design {
    export interface IClipboardPasteEvent {
        (args: IClipboardPasteEventArgs): any;
    }
    export interface IClipboardPasteEventOptions {
        cancelled?: Function;
        committed?: Function;
        states: Array<IElementState>;
        reset?: boolean;
    }
    export interface IClipboardPasteEventArgs {
        states: Array<IElementState>;
        commit: (states: Array<IElementState>) => void;
        cancel: Function;
    }
    interface ISelectedElements {
        [id: string]: boolean;
    }
    export class ClipboardPasteEvent {
        private static m_handler;
        private m_states;
        private m_selected;
        private m_cancelled;
        private m_committed;
        private m_reset;
        constructor(options: IClipboardPasteEventOptions);
        static get handler(): IClipboardPasteEvent;
        static set handler(value: IClipboardPasteEvent);
        get reset(): boolean;
        get selected(): ISelectedElements;
        get states(): Array<IElementState>;
        cancel(): void;
        commit(newStates: Array<IElementState>): void;
        private storeSelected;
    }
    export {};
}
declare namespace CanvasJS.Design {
    class ClipboardTable extends Jade.Data.TableOf<IClipboardAction> {
        constructor();
        get(success: (result: IClipboardAction) => void, error?: () => void): void;
        set(value: IClipboardAction, success: () => void, error?: () => void): void;
        delete(success: () => void, error?: () => void): void;
    }
}
declare namespace CanvasJS.Design {
    class AlignBottomCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
        private getBottomMostValue;
    }
}
declare namespace CanvasJS.Design {
    class AlignCenterCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class AlignLeftCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class AlignMiddleCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
        private getLargestHeightElement;
    }
}
declare namespace CanvasJS.Design {
    class AlignRightCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class AlignTopCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class BackgroundColorCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class BorderColorCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class BorderStyleCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class BorderWidthCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class BringForwardCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class StandardCommands extends Jade.CommandGroup<Jade.ICommandState> {
        constructor();
        protected registerCommands(e: Jade.OnRegisterCommandsEventArgs): void;
    }
    class ClipboardCommands extends Jade.CommandGroup<Jade.ICommandState> {
        constructor();
        protected registerCommands(e: Jade.OnRegisterCommandsEventArgs): void;
    }
}
declare namespace CanvasJS.Design {
    class CopyCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class CutCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    interface IDeleteCommandExecuteOptions {
        suppressConfirmation?: boolean;
    }
    class DeleteCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: IDeleteCommandExecuteOptions): void;
        private deleteSelections;
        private gatherElementStates;
        private deleteElements;
    }
}
declare namespace CanvasJS.Design {
    interface IDeleteElementEvent {
        (args: IDeleteElementEventArgs): any;
    }
    interface IDeleteElementEventOptions {
        cancelled?: Function;
        committed?: Function;
        states: Array<IElementState>;
    }
    interface IDeleteElementEventArgs {
        states: Array<IElementState>;
        commit: Function;
        cancel: Function;
    }
    class DeleteElementEvent {
        private static m_handler;
        private m_states;
        private m_cancelled;
        private m_committed;
        constructor(options: IDeleteElementEventOptions);
        static get handler(): IDeleteElementEvent;
        static set handler(value: IDeleteElementEvent);
        get states(): Array<IElementState>;
        cancel(): void;
        commit(newStates: Array<IElementState>): void;
        hasDestroyableElements(): boolean;
    }
}
declare namespace CanvasJS.Design {
    class DistributeHorizontallyCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class DistributeVerticallyCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class DuplicateCommand extends Jade.Command {
        private m_duplicates;
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class FillHorizontalCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class FillVerticalCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class GroupCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class PasteCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    interface ISelectionAreaCommandOptions extends Jade.ICommandProps {
        helper: SelectionBoxHelper;
    }
    class SelectionAreaCommand extends Jade.Command {
        constructor(props: ISelectionAreaCommandOptions);
        protected get helper(): SelectionBoxHelper;
        onExecute(e: any): void;
        private positionElements;
    }
}
declare namespace CanvasJS.Design {
    interface ISelectionPositionCommandOptions {
        ghost: GeometryBoxGhost;
    }
    class SelectionPositionCommand extends Jade.Command {
        constructor(props: ISelectionPositionCommandOptions);
        protected get ghost(): GeometryBoxGhost;
        onExecute(e: any): void;
        private positionElements;
        private positionSelectionHandle;
    }
}
declare namespace CanvasJS.Design {
    class SendBackCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
    }
}
declare namespace CanvasJS.Design {
    class UngroupCommand extends Jade.Command {
        protected getDefaultValuesForProps(): any;
        protected onStateChanged(state: any): void;
        onExecute(e: any): void;
        private selectionContainsGroups;
    }
}
declare namespace CanvasJS.Design {
    enum ScrollDirection {
        none = 0,
        up = 1,
        right = 2,
        down = 3,
        left = 4
    }
    interface IScrollOptions {
        container: JQuery;
    }
    interface IScrollDirection {
        direction: ScrollDirection;
        factor: number;
    }
    class Scroll {
        m_mouseXDelta: number;
        m_mouseYDelta: number;
        private m_container;
        private m_isScrolling;
        private m_boundaries;
        private m_setContainerScrollDebounced;
        constructor(options: IScrollOptions);
        protected get container(): JQuery;
        protected get isScrolling(): boolean;
        protected set isScrolling(value: boolean);
        startScroll(e: JQueryInputEventObject, ui: JQueryUI.DraggableEventUIParams): void;
        stopScroll(): void;
        scroll(e?: JQueryEventObject, ui?: JQueryUI.DraggableEventUIParams): void;
        private setContainerScroll;
    }
}
declare namespace CanvasJS.Design {
    interface IScrollCommand {
        direction: ScrollDirection;
        acceleration: number;
    }
    class ScrollBoundaries {
        private m_mouseX;
        private m_mouseY;
        private m_container;
        constructor(options: IScrollOptions);
        private get container();
        private get mouseX();
        private get mouseY();
        private get top();
        private get left();
        private get bottom();
        private get right();
        private get isScrollableUp();
        private get isScrollableDown();
        private get isScrollableRight();
        private get isScrollableLeft();
        private get locationTop();
        private get locationRight();
        private get locationBottom();
        private get locationLeft();
        getScroll(mouseX: number, mouseY: number): IScrollCommand;
        private getAcceleration;
    }
}
declare namespace CanvasJS.Design {
    class Selection {
        private m_elements;
        private get elements();
        get count(): number;
        get box(): SelectionBox;
        get dimensions(): Dimensions;
        first(): ElementDesignView;
        last(): ElementDesignView;
        add(element: ElementDesignView): void;
        remove(element: ElementDesignView): void;
        clear(): void;
        each(fn: (item: ElementDesignView, index?: number) => any): void;
        toArray(): Array<ElementDesignView>;
        contains(element: ElementDesignView): boolean;
        item(index: number): ElementDesignView;
        inDomOrder(): Jade.Collection<ElementDesignView>;
        get isResizing(): boolean;
    }
}
declare namespace CanvasJS.Design {
    class SelectionCollection extends Jade.ObservableCollection<ElementDesignView> {
        private m_dictionary;
        get dimensions(): Dimensions;
        add(element: ElementDesignView): boolean;
        remove(element: ElementDesignView): ElementDesignView;
        insert(element: ElementDesignView, index: number): boolean;
        clear(): void;
        contains(component: ElementDesignView): boolean;
        sort(fn?: (item1: ElementDesignView, item2: ElementDesignView) => number): void;
        getById(id: string): ElementDesignView;
        inDomOrder(): Jade.Collection<ElementDesignView>;
    }
}
declare namespace CanvasJS.Design {
    class EventTrigger {
        private static m_triggerSelectionChangedEvent;
        private static m_triggerBrowserFocusedEvent;
        static triggerSelectionChangedEvent(): void;
        static triggerBrowserFocusedEvent(): void;
    }
}
declare namespace CanvasJS.Design {
    enum IGeometryBoxEvent {
        none = 0,
        size = 1,
        move = 2
    }
    class GeometryBox extends Jade.UI.Control {
        private m_executingEvent;
        private m_executingEventArgs;
        private m_handles;
        constructor(options: Jade.UI.IControlOptions);
        get dimensions(): Dimensions;
        get role(): string;
        get visible(): boolean;
        set visible(value: boolean);
        get executingEvent(): IGeometryBoxEvent;
        get resizable(): JQueryUI.Resizable;
        get draggable(): JQueryUI.Draggable;
        get handles(): GeometryBoxHandles;
        hide(): void;
        show(): void;
        protected onActivate(e: Jade.UI.ControlEventArgs): void;
        protected onSizeStart(e: GeometryBoxSizeEventArgs): void;
        protected onSizing(e: GeometryBoxSizeEventArgs): void;
        protected onSizeStop(e: GeometryBoxSizeEventArgs): void;
        protected onMoveStart(e: GeometryBoxMoveEventArgs): void;
        protected onMoving(e: GeometryBoxMoveEventArgs): void;
        protected onMoveStop(e: GeometryBoxMoveEventArgs): void;
        protected onClick(e: JQueryEventObject): void;
        protected onDoubleClick(e: JQueryEventObject): void;
        private onMouseUp;
        private onResizeStart;
        private onResize;
        private onResizeStop;
        private onDragStart;
        private onDrag;
        private onDragStop;
        private draggable_onInit;
        private resizable_onInit;
        private setExecutingEvent;
    }
}
declare namespace CanvasJS.Design {
    interface IGeometryBoxEventOptions {
        box: GeometryBox;
        event: JQueryEventObject;
    }
    interface IGeometryBoxSizeEventOptions extends IGeometryBoxEventOptions {
        sized: JQueryUI.ResizableUIParams;
    }
    interface IGeometryBoxMoveEventOptions extends IGeometryBoxEventOptions {
        moved: JQueryUI.DraggableEventUIParams;
    }
    abstract class GeometryBoxEventArgs {
        private m_box;
        private m_event;
        constructor(options: IGeometryBoxEventOptions);
        get box(): GeometryBox;
        get event(): JQueryEventObject;
    }
    class GeometryBoxMoveEventArgs extends GeometryBoxEventArgs {
        private m_moved;
        constructor(options: IGeometryBoxMoveEventOptions);
        get moved(): JQueryUI.DraggableEventUIParams;
        get helper(): JQuery;
    }
    class GeometryBoxSizeEventArgs extends GeometryBoxEventArgs {
        private m_sized;
        constructor(options: IGeometryBoxSizeEventOptions);
        get sized(): JQueryUI.ResizableUIParams;
        get handle(): GeometryBoxHandle;
    }
}
declare namespace CanvasJS.Design {
    interface IGeometryBoxGhostOptions {
        ui: JQueryUI.DroppableEventUIParam | JQueryUI.DraggableEventUIParams;
        event: JQueryEventObject;
    }
    class GeometryBoxGhost {
        private m_node;
        private m_top;
        private m_left;
        private m_offsetTop;
        private m_offsetLeft;
        constructor(options: IGeometryBoxGhostOptions);
        get node(): JQuery;
        get top(): number;
        get left(): number;
        get height(): number;
        get width(): number;
        get offsetTop(): number;
        get offsetLeft(): number;
        getDimensons(): Dimensions;
    }
}
declare namespace CanvasJS.Design {
    enum GeometryBoxHandle {
        n = "n",
        s = "s",
        e = "e",
        w = "w",
        ne = "ne",
        nw = "nw",
        se = "se",
        sw = "sw"
    }
    interface IGeometryBoxHandlesOptions {
        box: GeometryBox;
    }
    class GeometryBoxHandles {
        private m_box;
        private m_handles;
        private m_handleClassPrefix;
        constructor(options: IGeometryBoxHandlesOptions);
        private get box();
        show(handles: Array<GeometryBoxHandle>): void;
        hide(handles: Array<GeometryBoxHandle>): void;
        showAll(): void;
        hideAll(): void;
        showVertical(): void;
        showHorizontal(): void;
        getHandle(handle: string): JQuery;
    }
}
declare namespace CanvasJS.Design {
    class SelectionBoxBase extends GeometryBox {
        private m_onDocumentReadyInterval;
        private m_onElementMouseDown;
        private m_onDocumentDoubleClick;
        private m_onDocumentDrop;
        hide(): void;
        show(): void;
        draw(): void;
        template(): string | Array<string> | JQuery;
        protected onInit(e: Jade.UI.ControlEventArgs): void;
        protected onActivate(e: Jade.UI.ControlEventArgs): void;
        protected onDestroy(e: Jade.UI.ControlEventArgs): void;
        protected onElementMouseDown(e: JQueryEventObject): void;
        protected onDocumentDoubleClick(e: JQueryEventObject): void;
        protected onBrowserResize(): void;
        protected onClick(e: JQueryEventObject): void;
        protected onDoubleClick(e: JQueryEventObject): void;
        protected onElementInclude(e: SelectionBoxIncludeEventArgs): void;
        protected onElementExclude(e: SelectionBoxExcludeEventArgs): void;
        protected onElementInspect(e: SelectionBoxInspectEventArgs): void;
        protected onElementsMoved(): void;
        protected onElementsSized(): void;
        protected onMoveStart(e: GeometryBoxMoveEventArgs): void;
        protected onMoving(e: GeometryBoxMoveEventArgs): void;
        protected onMoveStop(e: GeometryBoxMoveEventArgs): void;
        protected onSizing(e: GeometryBoxSizeEventArgs): void;
        protected onSizeStop(e: GeometryBoxSizeEventArgs): void;
        protected onDocumentDrop(e: DocumentDropEventArgs): void;
    }
}
declare namespace CanvasJS.Design {
    class SelectionBox extends SelectionBoxBase {
        show(): void;
        protected onElementInclude(e: SelectionBoxIncludeEventArgs): void;
        protected onElementExclude(e: SelectionBoxExcludeEventArgs): void;
        protected onElementsSized(): void;
        private showHandles;
    }
}
declare namespace CanvasJS.Design {
    interface ISelectionBoxExcludeEventArgsOptions {
        event: JQueryEventObject;
        element: ElementDesignView;
    }
    class SelectionBoxEventArgs {
        private m_event;
        private m_element;
        constructor(options: ISelectionBoxExcludeEventArgsOptions);
        get event(): JQueryEventObject;
        get element(): ElementDesignView;
        get isCtrlKeyPressed(): boolean;
    }
    class SelectionBoxExcludeEventArgs extends SelectionBoxEventArgs {
    }
    interface ISelectionBoxIncludeEventArgsOptions {
        event: JQueryEventObject;
        element: ElementDesignView;
        isNewSelection: boolean;
    }
    class SelectionBoxIncludeEventArgs extends SelectionBoxEventArgs {
        private m_isNewSelection;
        constructor(options: ISelectionBoxIncludeEventArgsOptions);
        get isNewSelection(): boolean;
    }
    class SelectionBoxInspectEventArgs extends SelectionBoxEventArgs {
    }
}
declare namespace CanvasJS.Design {
    interface ISelectionHandleHelperOptions {
        ui: JQueryUI.ResizableUIParams;
        e?: JQueryEventObject;
    }
    class SelectionBoxHelper {
        private m_node;
        private m_target;
        private m_top;
        private m_left;
        private m_height;
        private m_width;
        private m_originalTop;
        private m_originalLeft;
        private m_originalHeight;
        private m_originalWidth;
        constructor(options: ISelectionHandleHelperOptions);
        get node(): JQuery;
        get target(): JQuery;
        get top(): number;
        get left(): number;
        get height(): number;
        get width(): number;
        get originalTop(): number;
        get originalLeft(): number;
        get originalHeight(): number;
        get originalWidth(): number;
        getDimensons(): Dimensions;
        getOriginalDimensons(): Dimensions;
    }
}
declare namespace CanvasJS.Design {
    class StatusBar extends Jade.UI.Control {
        constructor(options: Jade.UI.IControlOptions);
        get dimensions(): JQuery;
        get selections(): JQuery;
        get errors(): JQuery;
        template(): string | string[] | JQuery;
        setDimesionsDisplay(d: IDimensionUnits): void;
        setSelectionsDisplay(count: number): void;
        private selectionDimesionsChange;
        private selectionChange;
    }
}
declare namespace CanvasJS.Design {
    class Surface extends Jade.UI.Control {
        private m_scroll;
        private m_behaviors;
        constructor(options: Jade.UI.IControlOptions);
        protected get behaviors(): Jade.Collection<SurfaceBehavior>;
        get scrolling(): Scroll;
        onActivate(): void;
        onDestroy(): void;
        focus(): void;
        loadDocument(document: DocumentDesignView): void;
        refresh(): void;
        clearMessage(): void;
        addMessage(message: string): void;
        showGridLines(show: boolean): void;
        template(): string | Array<string> | JQuery;
        protected applyBehaviors(): void;
        protected defaultBeahviorTypes(): Jade.Collection<Function>;
    }
}
declare namespace CanvasJS.Design {
    class SurfaceBehavior {
        private m_options;
        constructor(options: any);
        protected get options(): Jade.StateBag;
        start(): void;
        stop(): void;
    }
}
declare namespace CanvasJS.Design {
    class CaptureKeystrokeBehavior extends SurfaceBehavior {
        private m_debouncedMoveXFunction;
        private m_debouncedMoveYFunction;
        private m_debouncedAdjustHeightFunction;
        private m_debouncedAdjustWidthFunction;
        private m_debouncedShiftTabFunction;
        start(): void;
        private tab;
        private moveX;
        private moveY;
        private adjustHeight;
        private adjustWidth;
    }
}
declare namespace CanvasJS.Design {
    class ContextMenuBehavior extends SurfaceBehavior {
        private m_contextMenu;
        private m_discriminatorFn;
        start(): void;
        stop(): void;
        private element_onRightClick;
    }
}
declare namespace CanvasJS.Design {
    class DocumentClickBehavior extends SurfaceBehavior {
        start(): void;
        stop(): void;
        private surface_onClick;
    }
}
declare namespace CanvasJS.Design {
    interface DocumentDropEventArgs {
        event: JQueryEventObject;
        dropped: JQueryUI.DroppableEventUIParam;
    }
    class DocumentDropBehavior extends SurfaceBehavior {
        start(): void;
        private onDrop;
    }
}
declare namespace CanvasJS.Design {
    class DragSelectElementsBehavior extends SurfaceBehavior {
        start(): void;
        private selection_onStart;
        private selection_onStop;
        private select;
    }
}
declare namespace CanvasJS.Design {
    class RibbonBarBehavior extends SurfaceBehavior {
        private m_eventSubscription;
        start(): void;
        stop(): void;
        private onSelectionChange;
    }
}
declare namespace CanvasJS.Design {
    class ToolBox extends Jade.UI.Control {
        private m_toolBoxItems;
        constructor(options: any);
        get toolBoxItems(): ToolBoxItemCollection;
        protected onComplete(e: Jade.UI.ControlEventArgs): void;
        onToolBoxItemDrop(e: ToolBoxItemDropEventArgs): void;
        getToolBoxItem(id: string): ToolBoxItem;
        loadToolBoxItems(items: Array<any>): void;
        template(): string | Array<string> | JQuery;
        private onToolBoxItemsDiscovered;
        private addToolBoxGroup;
    }
}
declare namespace CanvasJS.Design {
    interface IToolBoxItemExecuteArgs {
        x: number;
        y: number;
    }
    interface IToolBoxItemOptions {
        name: string;
        icon: string;
        iconSet: string;
        group: string;
        script: any;
        parameters: any;
        instance?: any;
    }
    interface IToolBoxItemAddArgs {
        item: ToolBoxItem;
        elements: Array<ElementDesignView>;
    }
    class ToolBoxItem {
        private m_state;
        constructor(options: IToolBoxItemOptions);
        get state(): Jade.StateBag;
        get name(): string;
        get ID(): string;
        get icon(): string;
        get iconSet(): string;
        get group(): string;
        protected fireToolBoxItemAddedEvent(e: IToolBoxItemAddArgs): void;
        execute(e: IToolBoxItemExecuteArgs): void;
    }
}
declare namespace CanvasJS.Design {
    class ToolBoxAction extends ToolBoxItem {
        get parameters(): any;
    }
}
declare namespace CanvasJS.Design {
    class ToolBoxElement extends ToolBoxItem {
        get instance(): any;
        get script(): string;
        execute(e: IToolBoxItemExecuteArgs): void;
    }
}
declare namespace CanvasJS.Design {
    interface IToolBoxGroupOptions extends Jade.UI.IControlOptions {
        name: string;
        toolBoxItems: Array<ToolBoxItem>;
    }
    class ToolBoxGroup extends Jade.UI.Control {
        constructor(options: IToolBoxGroupOptions);
        get name(): string;
        get label(): JQuery;
        get items(): JQuery;
        get toolBoxItems(): Array<ToolBoxItem>;
        protected onActivate(e: Jade.UI.ControlEventArgs): void;
        template(): string | Array<string> | JQuery;
        private getToolBoxItems;
    }
}
declare namespace CanvasJS.Design {
    class ToolBoxItemCollection extends Jade.MappedCollection<ToolBoxItem> {
        constructor(data?: Array<any>);
        getGroups(): Array<string>;
        getItemsInGroup(groupName: string): Array<ToolBoxItem>;
        private createToolBoxItem;
    }
}
declare namespace CanvasJS.Design {
    interface IToolBoxItemDropEventArgsOptions {
        event: JQueryEventObject;
        dropped: JQueryUI.DroppableEventUIParam;
    }
    class ToolBoxItemDropEventArgs {
        private m_x;
        private m_y;
        private m_toolBoxItemId;
        constructor(options: IToolBoxItemDropEventArgsOptions);
        get x(): number;
        get y(): number;
        get toolBoxItemId(): string;
        private calculateDropCoordinates;
    }
}
declare namespace CanvasJS.Design {
    interface IToolBoxMessageOptions extends Jade.UI.IControlOptions {
        message: string;
    }
    class ToolBoxMessage extends Jade.UI.Control {
        constructor(options: IToolBoxMessageOptions);
        private get messageNode();
        private get message();
        template(): string | Array<string> | JQuery;
        protected onStateChanged(): void;
    }
}
declare namespace CanvasJS.Design {
    class RibbonBar extends Jade.UI.Controls.RibbonBar {
        constructor(options: Jade.UI.IControlOptions);
        protected onActivate(e: Jade.UI.ControlEventArgs): void;
    }
}
declare namespace CanvasJS.Design {
    class Alignment {
        static AlignLeft(elements: Jade.Collection<ElementDesignView>): void;
        static AlignTop(elements: Jade.Collection<ElementDesignView>): void;
    }
}
declare namespace CanvasJS.Design {
    class AllowedSizingHandles {
        private static handles;
        static ATTRIBUTE_KEY: string;
        static getVisibleHandles(controls: Array<ElementDesignView>): Array<GeometryBoxHandle>;
    }
    function allowedSizingHandles<TTarget extends ElementDesignView>(...handles: Array<GeometryBoxHandle>): <T extends new (...args: any[]) => {}>(constr: T) => {
        new (...args: any[]): {};
    } & T;
}
declare namespace CanvasJS.Design {
    enum CanvasCss {
        Design = "-canvasjs-design",
        Workspace = "-canvasjs-workspace",
        ToolBox = "-canvasjs-toolbox",
        ToolBoxPanelBar = "-canvasjs-toolbox-panelbar",
        ToolBoxItem = "-canvasjs-toolbox-item",
        ToolBoxGroup = "-canvasjs-toolbox-group",
        Surface = "-canvasjs-surface",
        Document = "-canvasjs-document",
        Element = "-canvasjs-element",
        ElementOverlay = "-canvasjs-overlay",
        ElementTransparency = "-canvasjs-transparency",
        ElementHighlight = "-canvasjs-highlight",
        Selectable = "ui-selectable",
        Selectee = "ui-selectee",
        Selecting = "ui-selecting",
        Selected = "ui-selected",
        SelectionBox = "-canvasjs-selection-box",
        SelectionBoxResizing = "ui-resizable-resizing",
        SelectionBoxDimensions = "-canvasjs-selection-box-dimensions",
        Group = "-canvasjs-group",
        GroupMaster = "-canvasjs-group-master",
        Grouped = "-canvasjs-grouped",
        StatusBar = "-canvasjs-statusbar",
        IgnoreSelect = "-canvas-ignore-select"
    }
}
declare namespace CanvasJS.Design {
    enum CanvasEvent {
        SELECTION_CHANGE = "canvas/selection/change",
        SELECTION_DIMENSIONS_CHANGE = "canvas/selection/dimensions/change",
        SELECTION_BOX_DROP = "canvas/document/selection-box/ondrop",
        ELEMENT_SELECT = "canvas/element/select",
        ELEMENT_DELETE = "canvas/element/delete",
        ELEMENT_EDIT = "canvas/element/edit",
        ELEMENT_CUT = "canvas/element/cut",
        ELEMENT_COPY = "canvas/element/copy",
        ELEMENT_PASTE = "canvas/element/paste",
        TOOLBOX_ITEMS_LOAD = "canvas/toolbox-items/load",
        TOOLBOX_ITEMS_DROP = "canvas/toolbox-items/ondrop",
        TOOLBOX_ITEMS_ADD = "canvas/toolbox-items/add",
        DOCUMENT_LOAD = "canvas/document/load"
    }
}
declare namespace CanvasJS.Design {
    class Convert {
        static fromNodesToDesignViews(nodes: JQuery): Jade.MappedCollection<ElementView>;
        static fromNodeToDesignView(node: JQuery): ElementDesignView;
        static fromNodesToDesignViewIds(nodes: JQuery): Jade.Collection<string>;
        static fromIdsToDesignViews(ids: Array<string>): Jade.MappedCollection<ElementDesignView>;
    }
}
declare namespace CanvasJS.Design {
    interface IDimensionUnits extends IPositionUnits, IAreaUnits {
        top: number;
        left: number;
        bottom?: number;
        right?: number;
        height: number;
        width: number;
    }
    interface IPositionUnits {
        top: number;
        left: number;
        bottom?: number;
        right?: number;
    }
    interface IAreaUnits {
        height: number;
        width: number;
    }
    class Dimensions implements IDimensionUnits {
        static MIN_HEIGHT: number;
        static MIN_WIDTH: number;
        private m_units;
        constructor(input: IDimensionUnits);
        get units(): IDimensionUnits;
        get top(): number;
        get left(): number;
        get bottom(): number;
        get right(): number;
        get height(): number;
        get width(): number;
        delta(input: IDimensionUnits): IDimensionUnits;
        toJSON(): IDimensionUnits;
        copyDimensionsToTarget(target: JQuery | ElementDesignView): void;
        static fromUnits(units: Array<IDimensionUnits>): IDimensionUnits;
        static fromNodes(nodes: JQuery): IDimensionUnits;
        static fromElements(elements: ElementDesignView | Array<ElementDesignView>): IDimensionUnits;
        static fromHtml(htmlElements: HTMLElement | Array<HTMLElement>): IDimensionUnits;
        static getAtCoordinates(x: number, y: number): ElementDesignView;
        static relativeDimension(element: JQuery, delta: IDimensionUnits): Dimensions;
        private static isWithinRange;
        private static fromNode;
    }
}
declare namespace CanvasJS.Design {
    interface IReadOnlyElementCollection<T> extends Jade.IReadOnlyCollection<T> {
        inDomOrder(): Jade.Collection<T>;
    }
    class ElementCollection<T extends ElementView> extends Jade.Collection<T> {
        inDomOrder(): Jade.Collection<T>;
    }
    class GroupedElementCollection extends ElementCollection<ElementDesignView> {
        private m_groupsOnly;
        private m_elementsOnly;
        get dimensions(): IDimensionUnits;
        get groupsOnly(): IReadOnlyElementCollection<GroupDesignView>;
        get elementsOnly(): IReadOnlyElementCollection<ElementDesignView>;
        protected onChange(): void;
        private ensureCollectionsArePopulated;
    }
}
declare namespace CanvasJS.Design {
    interface IDimensionsChangedEventArgs {
        old: Dimensions;
        new: Dimensions;
    }
    class DimensionsChangedEventArgs {
        private m_old;
        private m_new;
        constructor(options: IDimensionsChangedEventArgs);
        get old(): Dimensions;
        get new(): Dimensions;
    }
}
declare namespace CanvasJS.Design {
    class DocumentDesignView extends DocumentViewBase<DocumentModel> {
        saveSource(): DocumentModel;
        createElement(state: IElementModelState, addToElements?: boolean): ElementDesignView;
        createElementOf<TType extends ElementDesignView>(state: IElementModelState, addToElements?: boolean): TType;
        protected onActivate(e: Jade.UI.ControlEventArgs): void;
        protected addSelectionBox(): void;
    }
    class DocumentDesignViewBase<T extends DocumentModel> extends DocumentDesignView {
        protected m_source: T;
        get source(): T;
    }
}
declare namespace CanvasJS.Design {
    class ElementDesignView extends ElementViewBase<ElementModel> {
        protected m_grouping: ElementDesignViewGrouping;
        protected m_tooling: Jade.UI.Controls.Tooling;
        get dimensions(): Design.Dimensions;
        get isSelected(): boolean;
        get grouping(): ElementDesignViewGrouping;
        get tooling(): Jade.UI.Controls.Tooling;
        template(): string | Array<string> | JQuery;
        setPosition(units?: Dimensions | IDimensionUnits | IPositionUnits): void;
        setArea(units?: Dimensions | IDimensionUnits | IAreaUnits): void;
        onSelect(): void;
        onDeselect(): void;
        bringForward(): void;
        sendBack(): void;
        destroy(): void;
        protected onBrowserResize(): void;
        onResize(): void;
        protected onActivate(e: Jade.UI.ControlEventArgs): void;
        protected onStateChanged(): void;
        protected onAreaChanged(e: DimensionsChangedEventArgs): void;
        protected onPositionChanged(e: DimensionsChangedEventArgs): void;
        protected onTemplate(e: Jade.UI.ControlEventArgs): void;
        protected overlay(): string;
        protected wrapTemplate(template: JQuery): JQuery;
    }
    class ElementDesignViewBase<T extends ElementModel> extends ElementDesignView {
        get source(): T;
    }
}
declare namespace CanvasJS.Design {
    interface IGroupingOptions {
        group: GroupDesignView;
        onAreaChanged(units: Dimensions): void;
        onPositionChanged(units: Dimensions): void;
        onUngroup(element: ElementDesignView): void;
    }
    class ElementDesignViewGrouping {
        private m_element;
        private m_group;
        private m_onAreaChangedCallback;
        private m_onPositionChangedCallback;
        private m_onUngroup;
        constructor(element: ElementDesignView);
        get Group(): GroupDesignView;
        get isGrouped(): boolean;
        ungroup(): void;
        group(options: IGroupingOptions): void;
        onAreaChanged(newDimensions: Dimensions): void;
        onPositionChanged(newDimensions: Dimensions): void;
    }
}
declare namespace CanvasJS.Design {
    interface IGroupDesignViewOptions extends IElementViewOptions<GroupModel> {
        elements: Array<string>;
    }
    class GroupDesignView extends ElementDesignViewBase<GroupModel> {
        static GROUP_ID_ATTRIBUTE: string;
        private m_grouped;
        constructor(options: IGroupDesignViewOptions);
        get type(): string;
        get grouped(): GroupedElementCollection;
        get box(): JQuery;
        get cssClass(): string;
        protected onActivate(e: Jade.UI.ControlEventArgs): void;
        onAreaChanged(e: DimensionsChangedEventArgs): void;
        onPositionChanged(e: DimensionsChangedEventArgs): void;
        template(): string | Array<string> | JQuery;
        bringForward(): void;
        sendBack(): void;
        destroy(): void;
        private group;
        ungroup(): void;
        protected onStateChanged(): void;
        private setAreaForContainedElements;
        private setPositionForContainedElements;
        private updateGroupingWhenGroupedElementIsRemoved;
    }
}
declare namespace CanvasJS.Design {
    class InvalidElementView extends ElementDesignViewBase<ElementModel> {
        template(): string | Array<string> | JQuery;
    }
}
declare namespace CanvasJS.Design {
    class Workspace extends Jade.UI.Control {
        protected onInit(e: Jade.UI.ControlEventArgs): void;
        template(): string | Array<string> | JQuery;
    }
}
