# types/reference.types.ts

> 34 lines of code and 10 definitions.

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

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

## Definitions

- `KindMembers` (type_alias_declaration, line 3, exported)
- `PagTargets` (type_alias_declaration, line 5, exported)
- `TargetResolverFaces` (interface_declaration, line 7, exported)
- `IdRecord` (interface_declaration, line 14, exported)
- `AlgoContractView` (interface_declaration, line 18, exported)
- `ReasonKindFaces` (interface_declaration, line 24, exported)
- `CollectionRefFaces` (type_alias_declaration, line 28, exported)
- `PagGroundingFaces` (interface_declaration, line 32, exported)
- `GrammarGroundingFaces` (interface_declaration, line 36, exported)
- `ReasonRef` (interface_declaration, line 41, exported)

## Contained in

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

## Source

```typescript
import type { PagGrammar } from "#types/grammar.types";

export type KindMembers = ReadonlyMap<string, ReadonlySet<string>>;

export type PagTargets = Pick<PagGrammar, "documentType" | "keyword" | "production" | "template">;

export interface TargetResolverFaces {
    algo: { get: (id: string) => unknown };
    arch?: { get: (id: string) => unknown };
    lex?: { resolve: (id: string) => unknown };
    pag?: PagTargets;
}

export interface IdRecord {
    id: string;
}

export interface AlgoContractView {
    domain: string;
    grounds?: readonly string[];
    id: string;
}

export interface ReasonKindFaces {
    reason: { axes: () => IdRecord[]; kindMembers: () => KindMembers; models: () => IdRecord[] };
}

export type CollectionRefFaces = TargetResolverFaces & {
    reason: ReasonKindFaces["reason"] & { resolve: (id: string) => unknown };
};

export interface PagGroundingFaces extends ReasonKindFaces {
    pag: Pick<PagGrammar, "documentTypes" | "keywords" | "productions">;
}

export interface GrammarGroundingFaces {
    algo: { all: () => AlgoContractView[] };
    reason: { resolve: (id: string) => unknown; kindMembers: () => KindMembers };
}

export interface ReasonRef {
    kind: string;
    id: string;
}
```
