UNPKG

@ztimson/momentum

Version:

Client library for momentum

79 lines 2.34 kB
import { TreeAssetController } from './asset-controller'; import { Meta } from './core'; import { Momentum } from './momentum'; export type Schema = Meta & { /** Collection path */ path: string; /** Description of data */ description: string | null; /** Associated form for viewing/editing */ form?: string | null; /** Lock collection from changes */ lock: boolean | null; /** Default row sorting */ sort?: { /** Property to sort by */ prop: string; /** Ascending by default, true to reverse (descending) */ desc?: boolean; }; /** Data must match defined columns */ strict: boolean | null; /** Automatically create instead of update if it doesn't exist */ upsert: boolean | null; /** Defined fields */ columns: SchemaColumn[] | null; /** Aggregate columns */ aggregate?: SchemaAggregate[] | null; }; export type SchemaAggregate = { /*** How to process aggragate value */ type: 'Formula' | 'Function' | 'string'; /** Aggregate value */ value: string; /** Style */ style: SchemaColumnStyle; }; export type SchemaColumn = { /** Display label */ label: string; /** Property key */ prop: string; /** Variable type */ type?: 'any' | 'boolean' | 'Formula' | 'Function' | 'Link' | 'number' | 'string' | 'Date'; /** Display formating */ format?: any; /** Default value */ default?: any; /** Must have value */ required?: boolean; /** Style */ style: SchemaColumnStyle; }; export type SchemaColumnStyle = { /** Align column content */ align?: 'center' | 'left' | 'right'; /** Background color */ background?: string; /** Bold column text */ bold?: boolean; /** Column text color */ color?: string; /** Italicize column text */ italics?: boolean; /** Strikethrough column text */ strike?: boolean; /** Underline column text */ underline?: boolean; /** Column width */ width?: string; /** Conditional formating */ conditional: (Omit<SchemaColumnStyle, 'conditional'> & { condition: string; })[]; }; export declare class Schemas extends TreeAssetController<Schema> { protected momentum: Momentum; constructor(momentum: Momentum); } //# sourceMappingURL=schemas.d.ts.map