es-grid-template
Version:
es-grid-template
36 lines (35 loc) • 1.07 kB
TypeScript
/// <reference types="react" />
import type { AnyObject, IFormat } from "./type";
import type { SubmitHandler } from "react-hook-form";
import type { GetRowKey } from "./type";
export interface IContext<RecordType> {
searchValue?: any;
setSearchValue?: any;
open?: boolean;
setOpen?: any;
rowKey: string | keyof RecordType | GetRowKey<RecordType>;
onSave?: any;
form?: any;
format?: IFormat;
control?: any;
errors?: any;
trigger?: any;
handleSubmit?: any;
onSubmit?: SubmitHandler<any>;
getValues?: any;
handleCellChange?: (args: ContextCellChange<RecordType>) => void;
getRowKey?: GetRowKey<RecordType>;
id: string;
}
export type ContextCellChange<RecordType = AnyObject> = {
key: string | keyof RecordType | GetRowKey<RecordType>;
record: any;
field: string | undefined;
option: any;
indexRow: number;
indexCol: number;
newState?: any;
prevState?: any;
type: 'enter' | 'blur' | 'outClick';
};
export declare const TableContext: import("react").Context<IContext<any>>;