# types/location.types.ts

> 76 lines of code and 15 definitions.

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

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

## Definitions

- `OwnerAxis` (type_alias_declaration, line 1, exported)
- `DocKind` (type_alias_declaration, line 2, exported)
- `DocMood` (type_alias_declaration, line 3, exported)
- `DocForm` (interface_declaration, line 5, exported)
- `DocRegistries` (interface_declaration, line 15, exported)
- `LocationOptions` (interface_declaration, line 21, exported)
- `LocationFailure` (type_alias_declaration, line 26, exported)
- `LocationResult` (type_alias_declaration, line 38, exported)
- `DocEntry` (interface_declaration, line 40, exported)
- `Collision` (interface_declaration, line 48, exported)
- `LocationRequest` (interface_declaration, line 53, exported)
- `OwnerContext` (interface_declaration, line 63, exported)
- `DocLocationCode` (type_alias_declaration, line 73, exported)
- `DocLocationDefect` (interface_declaration, line 75, exported)
- `DocLocationInput` (interface_declaration, line 81, exported)

## Contained in

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

## Source

```typescript
export type OwnerAxis = "concern" | "module" | "none";
export type DocKind = "authored" | "generated" | "template";
export type DocMood = "declarative" | "directive";

export interface DocForm {
    id: string;
    folder: string;
    ownerAxis: OwnerAxis;
    kind: DocKind;
    boundary: boolean;
    mood?: DocMood;
    tag?: string;
}

export interface DocRegistries {
    forms: Readonly<Record<string, DocForm>>;
    concerns: readonly string[];
    owners?: readonly string[] | undefined;
}

export interface LocationOptions {
    rootPrefix?: string;
    resolveOwner?: (name: string) => string;
}

export type LocationFailure =
    | "axis-contradiction"
    | "bad-name"
    | "boundary-form"
    | "missing-concern"
    | "not-authored"
    | "unknown-concern"
    | "unknown-form"
    | "unknown-member"
    | "unmarked-member"
    | "unresolved-owner";

export type LocationResult = { ok: false; reason: LocationFailure; detail: string } | { ok: true; path: string };

export interface DocEntry {
    form: string;
    concern: string;
    name: string;
    member?: string | undefined;
    source: string;
}

export interface Collision {
    path: string;
    sources: string[];
}

export interface LocationRequest {
    form: string;
    concern: string;
    name: string;
    member?: string | undefined;
    generated?: boolean | undefined;
    registries: DocRegistries;
    options?: LocationOptions | undefined;
}

export interface OwnerContext {
    def: DocForm;
    concern: string;
    name: string;
    file: string;
    registries: DocRegistries;
    base: string;
    options: LocationOptions;
}

export type DocLocationCode = LocationFailure | "boundary-misplaced" | "off-location";

export interface DocLocationDefect {
    code: DocLocationCode;
    detail: string;
    expected?: string;
}

export interface DocLocationInput {
    relPath: string;
    form: string;
    concern: string;
    kind: DocKind;
    registries: DocRegistries;
    options?: LocationOptions;
}
```
