# types/metadata.types.ts

> 31 lines of code and 7 definitions.

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

Listed in [types](https://banes-lab.com/api/source/docs/types.md), after [types/markdown.types.ts](https://banes-lab.com/source/docs/types/markdown.types.ts.md) and before [types/readme.types.ts](https://banes-lab.com/source/docs/types/readme.types.ts.md).

## Definitions

- `Frontmatter` (interface_declaration, line 1, exported)
- `FrontmatterFields` (interface_declaration, line 7, exported)
- `FieldSpec` (interface_declaration, line 12, exported)
- `FrontmatterSchema` (interface_declaration, line 18, exported)
- `FrontmatterSchemaCode` (type_alias_declaration, line 23, exported)
- `FrontmatterSchemaDefect` (interface_declaration, line 25, exported)
- `FieldCheck` (interface_declaration, line 32, exported)

## Contained in

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

## Source

```typescript
export interface Frontmatter {
    present: boolean;
    fields: Record<string, string>;
    bodyStart: number;
}

export interface FrontmatterFields {
    fields: Record<string, string>;
    end: number;
}

export interface FieldSpec {
    enum?: readonly string[];
    items?: readonly string[];
    kind?: "boolean" | "integer" | "kebab";
}

export interface FrontmatterSchema {
    required: readonly string[];
    fields: Record<string, FieldSpec>;
}

export type FrontmatterSchemaCode = "invalid-enum" | "invalid-type" | "missing-required";

export interface FrontmatterSchemaDefect {
    code: FrontmatterSchemaCode;
    field: string;
    detail: string;
    line: number;
}

export interface FieldCheck {
    source: string;
    field: string;
    value: string;
    spec: FieldSpec;
}
```
