import { QTableColumn, QTableProps } from 'quasar'; export interface MediaDetails { filesize: number; } export interface SettingsGeneral { backgroundColor: string; bordered: boolean; dark: boolean; dense: boolean; flat: boolean; fullscreen: boolean; grid: { desktop: boolean; tablet: boolean; mobile: boolean }; gridColumns: { desktop: number; tablet: number; mobile: number }; separator: 'horizontal' | 'vertical' | 'cell' | 'none' | undefined; square: boolean; textColor: string; } export interface SettingsBottom { backgroundColor: string; hidePagination: boolean; initial: QTableProps['pagination']; rowsPerPageLabel: string; textColor: string; } export interface SettingsColumns { columnsMaxWidth: Record; columnsMinWidth: Record; stickyFirstColumn: boolean; stickyFirstColumnBgColor: string; stickyFirstColumnTextColor: string; stickyLastColumn: boolean; stickyLastColumnBgColor: string; stickyLastColumnTextColor: string; visibleColumns: string[]; hiddenColumns: string[]; } export interface SettingsContent { buttonText: string; buttonBgColor: string; buttonTextColor: string; linkTextColor: string; imageHeight: number; imageWidth: number; previewMode: boolean; turnLinksToButtons: boolean; turnLinksToImages: boolean; verticalAlignment: 'bottom' | 'middle' | 'top'; allowHtml: boolean; autoSync: boolean; syncInterval: number; jsonPreviewLines: number; /** Written by vTables Pro's server-side sync, never by this plugin. */ lastSyncedAt?: string; lastSyncStatus?: 'success' | 'error' | 'schema_changed'; lastSyncError?: string | null; } export interface SettingsCustomCss { cardClass: string; css: string; tableClass: string; tableHeaderClass: string; titleClass: string; } export interface SettingsDimensions { tableHeight: number | string | null; tableMaxWidth: string | null; } export interface SettingsTop { hideHeader: boolean; headerBackgroundColor: string; headerTextColor: string; hideTitle: boolean; stickyHeader: boolean; textColor: string; topBackgroundColor: string; } export interface SettingsSearch { color: string; bgColor: string; searchOn: boolean; filter: string; searchInputStyle: 'borderless' | 'filled' | 'outlined' | 'standard'; } export interface SettingsSorting { sortingOn: boolean; binaryStateSort: boolean; columnSortOrder: 'ad' | 'da'; } export type FilterOperator = | 'contains' | 'not_contains' | 'equals' | 'not_equals' | 'starts_with' | 'ends_with' | 'greater_than' | 'less_than' | 'is_empty' | 'is_not_empty'; export type FilterLogic = 'AND' | 'OR'; export interface FilterCondition { id: string; column: string; operator: FilterOperator; value: string; logic?: FilterLogic; } export interface SettingsFilter { filterOn: boolean; logic: FilterLogic; conditions: FilterCondition[]; } export interface SettingsVirtualScroll { virtualScrollOn: boolean; virtualScrollSliceSize: number; virtualScrollSliceRatioBefore: number; virtualScrollSliceRatioAfter: number; virtualScrollStickySizeStart: number; } export interface ColumnGroupNode { id: string; label: string; children: Array; } export interface SettingsColumnGroups { enabled: boolean; tree: Array; } export interface Settings { general: SettingsGeneral; bottom: SettingsBottom; content: SettingsContent; columns: SettingsColumns; customCss: SettingsCustomCss; dimensions: SettingsDimensions; filter: SettingsFilter; search: SettingsSearch; sorting: SettingsSorting; top: SettingsTop; virtualScroll: SettingsVirtualScroll; columnGroups: SettingsColumnGroups; } export interface Table { id: string; title: string; shortcode: string; file_size: string; settings: Settings; created_at: string | Date; updated_at: string | Date; source: Record; external_source: string | null; table_type?: TableType; // Google Sheets / external / WooCommerce tables, or tables with a saved row // filter: listed, but only vTables Pro can open and render them (see // vtables_table_requires_pro in includes/compat.php). requires_pro?: boolean; import_progress?: { imported_rows: number; total_rows: number }; // Server-mode (large tables): rows are paginated from the server instead of // being shipped in full. Populated by the fetch_table endpoint. server_mode?: boolean; total_rows?: number; per_page?: number; first_page?: Record[]; } export type IndexDataType = 'text' | 'number' | 'date' | 'boolean'; /** A column as returned by the upload inspect/finalize step. */ export interface InspectedColumn { name: string; label?: string; dataType?: IndexDataType; indexed?: boolean; slot?: number; } export interface Pagination { sortBy: string | undefined; descending: boolean | undefined; page: number; rowsPerPage: number; rowsNumber: number; search: string; } export interface CellMerged { mainCell: number; cells: number[]; } export interface Row { [key: string | number | symbol]: any; } export interface TopRow { cols: QTableColumn[]; } export type TableType = | 'csv' | 'json' | 'xls' | 'xlsx' // Legacy merged value on rows imported before xls/xlsx were split. | 'excel' | 'importing' // vTables Pro sources: listed here, opened and rendered by Pro only. | 'google_sheets' | 'remote' | 'woocommerce' | 'external';