# types/loader.types.ts

> 57 lines of code and 3 definitions.

Tree: Bane's Lab Build Scripts
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/build-scripts#file-build-scripts-types-loader-types-ts
Source text: https://banes-lab.com/source/build-scripts/types/loader.types.ts.txt

Listed in [types](https://banes-lab.com/api/source/build-scripts/types.md), after [types/learning.types.ts](https://banes-lab.com/source/build-scripts/types/learning.types.ts.md) and before [types/markup.types.ts](https://banes-lab.com/source/build-scripts/types/markup.types.ts.md).

## Definitions

- `WebModules` (interface_declaration, line 11, exported)
- `RunnerModule` (interface_declaration, line 55, exported)
- `ModuleImporter` (type_alias_declaration, line 60, exported)

## Contained in

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

## Source

```typescript
import type { SearchCorpus, SearchIndex, SearchSource } from "@banes-lab/web/types/search.types.js";
import type { AnatomyFolder } from "@banes-lab/web/types/anatomy.types.js";
import type { DefinitionIndex } from "@banes-lab/web/types/definition.types.js";
import type { Evidence } from "@banes-lab/web/types/evidence.types.js";
import type { LearningBlock } from "@banes-lab/web/types/learning.types.js";
import type { ModuleRunner } from "vite/module-runner";
import type { ReferenceTarget } from "@banes-lab/web/types/reference.types.js";
import type { Section } from "@banes-lab/web/types/document.types.js";
import type { SourceTree } from "#types/source.types";

export interface WebModules {
    readonly anatomyConstants: { readonly LINE_INFIX: string };
    readonly anatomyIds: { readonly DEFINITION_ANCHOR: string };
    readonly analyzer: {
        readonly anchorPath: (source: SearchSource, section: string) => string;
        readonly textsOf: (value: unknown) => readonly string[];
    };
    readonly anatomy: { readonly ANATOMY_TREES: readonly Omit<SourceTree, "label">[] };
    readonly company: Readonly<Record<string, string>>;
    readonly corpus: { readonly loadCorpus: () => Promise<SearchCorpus> };
    readonly definition: { readonly definitionIndexOf: (roots: readonly AnatomyFolder[]) => DefinitionIndex };
    readonly evidence: {
        readonly evidenceFor: (target: ReferenceTarget, registry: readonly Evidence[]) => readonly Evidence[];
    };
    readonly evidenceConstants: { readonly EVIDENCE: readonly Evidence[] };
    readonly folder: { readonly localPath: (path: string) => string };
    readonly learning: { readonly LEARNING: readonly LearningBlock[] };
    readonly links: Readonly<Record<string, unknown>>;
    readonly markup: { readonly summarizeMarkup: (markup: string, fallback: string) => string };
    readonly matcher: { readonly markupWords: (markup: string) => readonly string[] };
    readonly ontology: { readonly anchorHrefOf: (ref: string) => string | null };
    readonly reference: { readonly plainMarkdown: (text: string) => string };
    readonly search: {
        readonly indexOf: (corpus: SearchCorpus) => SearchIndex;
        readonly positionOf: (index: SearchIndex, source: SearchSource, section: Section) => number;
    };
    readonly searchConstants: { readonly FUZZY_MIN_TERM_LENGTH: number };
    readonly source: {
        readonly fileId: (path: string) => string;
        readonly folderHref: (path: string) => string;
        readonly folderId: (path: string) => string;
        readonly languageOf: (name: string) => string;
        readonly nodeHref: (file: string, line: number | null) => string;
        readonly nodeRoute: (path: string, folder: boolean) => string;
        readonly sourceTitle: (path: string) => string;
        readonly treeLabelOf: (tab: string) => string;
    };
    readonly vocabulary: {
        readonly ANATOMY_FACE: string;
        readonly CHAPTER_FACE: string;
        readonly WORD_CHARACTERS: string;
    };
}

export interface RunnerModule {
    readonly names: readonly string[] | "*";
    readonly path: string;
}

export type ModuleImporter = Pick<ModuleRunner, "import">;
```
