# types/field.types.ts

> 28 lines of code and 7 definitions.

Tree: GovLab Context
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/context#file-context-types-field-types-ts
Source text: https://banes-lab.com/source/context/types/field.types.ts.txt

Listed in [types](https://banes-lab.com/api/source/context/types.md), after [types/context.types.ts](https://banes-lab.com/source/context/types/context.types.ts.md) and before [types/grammar.document.types.ts](https://banes-lab.com/source/context/types/grammar.document.types.ts.md).

## Definitions

- `FieldType` (type_alias_declaration, line 1, exported)
- `FieldSpec` (interface_declaration, line 3, exported)
- `KindSchema` (type_alias_declaration, line 12, exported)
- `DanglingField` (interface_declaration, line 14, exported)
- `ExemplarMedium` (type_alias_declaration, line 22, exported)
- `Exemplar` (interface_declaration, line 24, exported)
- `DistinctDeclaration` (interface_declaration, line 31, exported)

## Contained in

- [types](https://banes-lab.com/anatomy/context/folder-context-types.md)

## Source

```typescript
export type FieldType = "closed" | "flag" | "label" | "labels" | "object" | "records" | "ref" | "refs" | "text";

export interface FieldSpec {
    readonly type: FieldType;
    readonly required: boolean;
    readonly target?: string;
    readonly relation?: string;
    readonly flip?: boolean;
    readonly inverse?: string;
}

export type KindSchema = Readonly<Record<string, FieldSpec>>;

export interface DanglingField {
    readonly kind: string;
    readonly id: string;
    readonly field: string;
    readonly target: string;
    readonly value: string;
}

export type ExemplarMedium = "code" | "composite";

export interface Exemplar {
    before: string;
    after: string;
    lang: string;
    medium: ExemplarMedium;
}

export interface DistinctDeclaration {
    id: string;
    reason: string;
}
```
