import { IDataSource } from '@poweredsoft/data'; import { IDynamicComponent } from '../dynamic-component/IDynamicComponent'; export interface IColumnOptions { type?: 'field' | 'command'; title: string; editable?: boolean; order?: number; visible?: boolean; } export interface IFieldColumnOptions extends IColumnOptions { field: string; sortable?: boolean; sortPath?: string; filterable?: boolean; filterPath?: string; groupable?: boolean; groupPath?: string; displayComponent?: (model: any, column?: IFieldColumnOptions) => IDynamicComponent; editComponent?: (model: any, column?: IFieldColumnOptions) => IDynamicComponent; format?: (model: any, column: IFieldColumnOptions) => string; } export interface ICommandColumnAction { title?: string; tooltip?: string; icon?: string; buttonClass?: string; callback?: (() => void) | ((model: any) => void); visible?: (() => boolean) | ((model: any) => boolean); } export interface ICommandColumnOptions extends IColumnOptions { actions: ICommandColumnAction[]; } export interface IGridCommand { title: string; type: 'create' | 'edit' | 'delete' | 'custom'; name: string; component?: (model: any, command?: IGridCommand) => IDynamicComponent; } export interface IGridOptions { defaultModel?: any; editableMode?: 'inline' | 'popup' | 'row'; popupUseFullScreen?: boolean; dataSource: IDataSource; commands: IGridCommand[]; columns: Array; selectable?: boolean; groupable?: boolean; stackable?: boolean; striped?: boolean; detailComponent?: (model: any) => IDynamicComponent; } export declare enum GridColumnSortState { notSorted = 0, asc = 1, desc = 2 }