import {ComputedRef, Ref} from 'vue'; import Table from '@/components/table/Table.vue'; declare global { interface ListLayoutProps { navActions: ListActionGroup[]; tableColumns: TableColumns; tableData: TableData; tablePagination: TablePagination; tableActionsPrefix: ListActionButton[]; tableActionsSuffix: ListActionButton[]; tableListFilter: FilterConditionData[]; tableListSort: SortData[]; actionFunctions: ListLayoutActionFunctions; noActions: boolean; selectableFunction: TableSelectableFunction; visibleButtons: BuiltInTableActionButtonName[]; tablePaginationLayout?: string; tableLoading?: boolean; tablePaginationPosition?: TablePaginationPosition; embedded?: boolean; } interface ListLayoutComponentData { navActions?: Ref; tableColumns?: Ref>; tableData: Ref>; tableTotal: Ref; tablePagination: Ref; tableListFilter: Ref; tableListSort: Ref; actionFunctions: ListLayoutActionFunctions; activeDialogKey: ComputedRef; } interface UseListOptions { navActions: Ref; tableColumns: Ref>; } interface ListActionGroup { name?: string; children?: (ListActionButton | ListActionFilter)[]; } interface ListAction { id?: string; label?: string; action?: GenericAction; className?: string; size?: BasicSize; } interface ListActionButton extends ListAction { buttonType?: ButtonType; tooltip?: string; icon?: Icon; type?: BasicType; disabled?: boolean | ListActionButtonDisabledFunc; onClick?: () => void; } interface ListActionFilter extends ListAction { placeholder?: string; options?: SelectOption[]; optionsRemote?: FilterSelectOptionsRemote; onChange?: (value: any) => void; } interface ListLayoutActionFunctions { setPagination: (pagination: TablePagination) => void; getList: () => Promise; getAll: () => Promise; deleteList: (ids: string[]) => Promise; deleteByIdConfirm: (row: BaseModel) => Promise; onHeaderChange?: (column: TableColumn, sort: SortData, filter: TableHeaderDialogFilterData) => Promise; } type ListActionButtonDisabledFunc = (table: typeof Table) => boolean; }