UNPKG

@focuson/form_components

Version:

Components that can be used by @focuson/forms

19 lines (18 loc) 969 B
import { LensState } from "@focuson/state"; import { NameAnd } from "@focuson/utils"; import { CommandButtonChangeCommands } from "@focuson/rest"; import { Transform } from "@focuson/lens"; import { FocusOnContext } from "@focuson/focuson"; import { CustomButtonType } from "./common"; export interface ActionButtonProps<S, C> extends CustomButtonType { id: string; state: LensState<S, any, C>; paths: NameAnd<(s: LensState<S, any, C>) => LensState<S, any, C>>; action: (s: LensState<S, any, C>, id: string, paths?: NameAnd<LensState<S, any, C>>, history?: any) => Transform<S, any>[]; text: string; history?: any; enabledBy?: string[][]; preCommands: CommandButtonChangeCommands[]; postCommands: CommandButtonChangeCommands[]; } export declare function ActionButton<S, C extends FocusOnContext<S>>({ id, state, action, text, enabledBy, paths, preCommands, postCommands, buttonType, history }: ActionButtonProps<S, C>): JSX.Element;