UNPKG

@bexis2/bexis2-core-ui

Version:

Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).

197 lines (196 loc) 4.68 kB
import type { SvelteComponent } from 'svelte'; import type { ColumnFilterFn } from 'svelte-headless-table/lib/plugins'; import type { Writable } from 'svelte/store'; import type { FilterOptionsEnum, decimalCharacterType, notificationType, orientationType, textMarkerType, textSeperatorType } from './Enums'; export interface linkType { label: string; url: string; } export interface inputType { id: string; label: string; feedback: string[]; invalid: boolean; valid: boolean; required: boolean; placeholder: string; } export interface fileInfoType { name: string; type: string; length: number; description: string; validationHash: string; } export interface fileUploaderType { accept: string[]; existingFiles: fileInfoType[]; descriptionType: number; multiple: boolean; maxSize: number; } export interface asciiFileReaderInfoType extends fileReaderInfoType { cells: boolean[]; seperator: textSeperatorType; textMarker: textMarkerType; } export interface fileReaderInfoType { decimal: decimalCharacterType; orientation: orientationType; offset: number; variables: number; data: number; unit: number; description: number; dateformat: string; } export interface filesType { accepted: Blob[]; rejected: Blob[]; } export type userType = { name: string; }; export interface fileObjType { path: string; lastModified: number; lastModifiedDate: Date; name: string; size: number; type: string; webkitRelativePath: string; } export interface ColumnInstructions { toStringFn?: (any: any) => string; toSortableValueFn?: (any: any) => string | number; toFilterableValueFn?: (any: any) => string | number | Date; renderComponent?: typeof SvelteComponent; } export interface Column { header?: string; exclude?: boolean; instructions?: ColumnInstructions; disableFiltering?: boolean; disableSorting?: boolean; colFilterFn?: ColumnFilterFn; colFilterComponent?: typeof SvelteComponent; minWidth?: number; fixedWidth?: number; } export interface Columns { [key: string]: Column; } export type ServerConfig = { baseUrl?: string; sendModel?: Send; entityId?: number; versionId?: number; }; export interface TableConfig<T> { id: string; data: Writable<T[]>; resizable?: 'none' | 'rows' | 'columns' | 'both'; showColumnsMenu?: boolean; toggle?: boolean; search?: boolean; fitToScreen?: boolean; height?: null | number; rowHeight?: number; columns?: Columns; exportable?: boolean; pageSizes?: number[]; defaultPageSize?: number; optionsComponent?: typeof SvelteComponent; server?: ServerConfig; } export interface keyValuePairType { id: number; text: string; } export interface listItemType { id: number; text: string; group: string; description: string; } export interface helpItemType { id?: string; name: string; description: string; link?: string; } export interface helpStoreType { itemId?: string; helpItems: helpItemType[]; } export interface notificationItemType { notificationType?: notificationType; message: string; } export interface notificationStoreType { notificationType: notificationType; message: string; btnStyle: string; } export type ServerColumn = { column: string; key: string; exclude?: boolean; instructions?: { missingValues?: { [key: string | number]: string; }; displayPattern?: string; }; }; export type OrderBy = { column: string; direction: 'asc' | 'desc'; }; export type Filter = { column: string; filterBy: FilterOptionsEnum; value: string | number | Date | boolean; }; export interface FacetOption { name: string; displayName: string; count?: number; selected?: boolean; } export interface FacetGroup { name: string; displayName: string; selected?: boolean; children: FacetOption[]; count?: number; } export interface SelectedFacetGroup extends Omit<FacetGroup, 'children'> { children: { [key: string]: FacetOption; }; } export declare class Send { id: number; limit: number; offset: number; q: string; version?: number; filter: Filter[]; order: OrderBy[]; constructor(); } export declare class Receive { count: number; data: any[]; send: Send; columns?: ServerColumn[]; constructor(); } export declare class errorType { statusText: string; status: number; error: string; stackTrace: string; constructor(); }