import { Observable } from 'rxjs'; import { EntityOperationType, EntityTableColumnRenderer } from './entity.enums'; import { EntityStore } from './store'; export declare type EntityKey = string | number; export interface EntityState { [key: string]: any; } export interface EntityRecord { entity: E; state: S; revision: number; ref: string; } export interface EntityStoreOptions { getKey?: (entity: object) => EntityKey; getProperty?: (entity: object, property: string) => any; } export interface EntityStateManagerOptions { getKey?: (entity: object) => EntityKey; store?: EntityStore; } export interface EntityStoreStrategyOptions { } export interface EntityTransactionOptions { getKey?: (entity: object) => EntityKey; } export declare type EntityFilterClause = (entity: E) => boolean; export interface EntitySortClause { valueAccessor: (entity: E) => string | number; direction: string; nullsFirst?: boolean; } export interface EntityJoinClause { source: Observable; reduce: (param1: object, param2: any) => object; } export interface EntityOperation { key: EntityKey; type: EntityOperationType; previous: E | undefined; current: E | undefined; store?: EntityStore; meta?: { [key: string]: any; }; } export interface EntityOperationState { added: boolean; canceled: boolean; } export interface EntityTableTemplate { columns: EntityTableColumn[]; selection?: boolean; selectionCheckbox?: boolean; selectMany?: boolean; sort?: boolean; fixedHeader?: boolean; valueAccessor?: (entity: object, property: string, record: EntityRecord) => any; headerClassFunc?: () => { [key: string]: boolean; }; rowClassFunc?: (entity: object, record: EntityRecord) => { [key: string]: boolean; }; cellClassFunc?: (entity: object, column: EntityTableColumn, record: EntityRecord) => { [key: string]: boolean; }; } export interface EntityTableColumn { name: string; title: string; renderer?: EntityTableColumnRenderer; valueAccessor?: (entity: object, record: EntityRecord) => any; visible?: boolean; sort?: boolean; cellClassFunc?: (entity: object, record: EntityRecord) => { [key: string]: boolean; }; } export interface EntityTableButton { icon: string; click: (entity: object, record: EntityRecord) => void; color?: 'primary' | 'accent' | 'warn'; style?: 'mat-mini-fab' | 'mat-icon-button'; }