import { StatesContext } from '../context'; import { Type } from '../type'; import { FieldNode } from '@neuledge/states-parser'; import { StateSortingIndex, StatePrimaryKey } from './state-index'; export type StateField = ScalarField | RelationField; /** * A scalar field is a field that exists in the current state. Typically, * this is a column in a database table and it can contain a scalar value * (including arrays and objects). */ export interface ScalarField extends AbstractField { type: 'ScalarField'; sortingIndex?: StateSortingIndex; primaryKey?: StatePrimaryKey; } /** * A relation field is a field that references another state but does not * exist in the current state. Typically, this is a foreign key. */ export interface RelationField extends AbstractField { type: 'RelationField'; referenceField: ScalarField['name']; } interface AbstractField { node: FieldNode; name: string; nullable?: boolean; index: number; description?: string; deprecated?: boolean | string; as: Type; } export declare const parseStateField: (ctx: StatesContext, node: FieldNode, baseIndex: number) => StateField; export {}; //# sourceMappingURL=field.d.ts.map