# types/search.types.ts

> 48 lines of code and 8 definitions.

Tree: Site tree
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/tree#file-types-search-types-ts
Source text: https://banes-lab.com/assets/sources/source.0c2252cbaea08c9253d8ab650aa9b2b93cb5cf86a8e259bd2461d29142c16913.generated.txt

## Definitions

- `SpreadLayout` (type_alias_declaration, line 6, exported)
- `SearchPage` (interface_declaration, line 8, exported)
- `SearchSource` (interface_declaration, line 13, exported)
- `SearchCorpus` (interface_declaration, line 23, exported)
- `SearchIndex` (interface_declaration, line 30, exported)
- `SearchHit` (interface_declaration, line 37, exported)
- `SearchToggle` (interface_declaration, line 46, exported)
- `SearchSpread` (interface_declaration, line 52, exported)

## Source

```typescript
import type { Section, Tab, TabLayout } from "#types/document.types";
import type { DefinitionLocation } from "#types/anatomy.types";
import type { Evidence } from "#types/evidence.types";
import type { PageDefinition } from "#types/page.types";

export type SpreadLayout = TabLayout | "document";

export interface SearchPage {
    readonly definition: PageDefinition;
    readonly icon: string;
}

export interface SearchSource {
    readonly first: boolean;
    readonly icon: string;
    readonly label: string;
    readonly layout: SpreadLayout;
    readonly page: string;
    readonly tab: Tab;
    readonly tone: string | null;
}

export interface SearchCorpus {
    readonly definitions: readonly DefinitionLocation[];
    readonly evidence: readonly Evidence[];
    readonly pages: readonly SearchPage[];
    readonly route: readonly string[];
}

export interface SearchIndex {
    readonly evidence: ReadonlyMap<string, number>;
    readonly links: ReadonlyMap<string, number>;
    readonly route: ReadonlyMap<string, number>;
    readonly sources: readonly SearchSource[];
}

export interface SearchHit {
    readonly home: string;
    readonly position: number;
    readonly section: Section;
    readonly sectionIndex: number;
    readonly source: SearchSource;
    readonly sourceIndex: number;
}

export interface SearchToggle {
    readonly dispose: () => void;
    readonly showButtons: () => void;
    readonly showField: (query: string) => void;
}

export interface SearchSpread {
    readonly home: string;
    readonly sections: readonly Section[];
    readonly source: SearchSource;
}
```
