maille
Version:
Component library for MithrilJS
39 lines (38 loc) • 1.32 kB
TypeScript
import { Children, ClassComponent, CVnode, Vnode } from "mithril";
import { ButtonType, ComponentSettings, MithrilEvent, Size } from "../../types";
interface LoadingOptions {
children?: Children;
}
export interface ButtonAttrs {
id?: string;
type?: ButtonType;
className?: string;
size?: Size;
outlined?: boolean;
rounded?: boolean;
disabled?: boolean;
loadingSettings?: LoadingOptions;
isLoading?: boolean;
onclick?: (e: MithrilEvent) => any;
componentSettings?: ComponentSettings;
attrs?: object;
}
declare class Button implements ClassComponent<ButtonAttrs> {
protected type: ButtonType;
protected size: Size;
protected outlined: boolean;
protected rounded: boolean;
protected disabled: boolean;
protected loadingSettings: LoadingOptions;
protected isLoading: boolean;
protected componentSettings: ComponentSettings;
protected internalOnClick: (e: MithrilEvent) => any;
protected vnode: Vnode;
constructor(vnode?: CVnode<ButtonAttrs>);
view(vnode: Vnode<ButtonAttrs>): any;
oncreate(vnode: CVnode<ButtonAttrs>): void;
protected buildContent(children: Children): any;
protected redrawChildren(): void;
protected onclick(e: MithrilEvent): Promise<void> | Promise<IArguments>;
}
export default Button;