plugin

Type Aliases

AnySchemaAugments

AnySchemaAugments = readonly AnySchemaPlugin[]

Defined in: plugin.ts:94


AnySchemaPlugin

AnySchemaPlugin = PluginAugment<string, NodeMap, any, any, any>

Defined in: plugin.ts:93


DefineData

DefineData<T> = T

Defined in: plugin.ts:62

Define runtime data to expose from your plugin.

Type Parameters

T

T extends AnyRecord = AnyRecord

Example

type MyData = DefineData<{
  registry: Map<string, string>;
  cache: Record<string, unknown>;
}>;

DefineNodeMap

DefineNodeMap<T> = { [K in keyof T]: T[K] } & object

Defined in: plugin.ts:34

Define the node map for your plugin augment. The type system will automatically add the required index signature.

Type Declaration

unknown

unknown: UnknownNode

Type Parameters

T

T extends NodeMap = NodeMap

Example

type MyNodeMap = DefineNodeMap<{
  myCustomNode: MyCustomNodeType;
  anotherNode: AnotherNodeType;
}>;

DefineTypes

DefineTypes<T> = T

Defined in: plugin.ts:49

Define additional types to expose from your plugin.

Type Parameters

T

T extends AnyRecord = NeverRecord

Example

type MyTypes = DefineTypes<{
  MyHelper: { foo: string };
  MyConfig: { bar: number };
}>;

DefineUtils

DefineUtils<T> = T & object

Defined in: plugin.ts:75

Define utility functions to expose from your plugin.

Type Declaration

validate?

optional validate: ValidateHook

Type Parameters

T

T extends AnyRecord = EmptyRecord

Example

type MyUtils = DefineUtils<{
  parseFile: (path: string) => FileNode;
  validateFile: (file: FileNode) => boolean;
}>;

PluginAugment

PluginAugment<Name, Nodes, Types, Data, Utils> = object

Defined in: plugin.ts:85

Describes the structural shape of any plugin augment.

IMPORTANT: Prefer DefinePlugin if declaring a plugin's augment.

Use this when you need to reference plugins generically (e.g., constraints, schema plumbing) without enforcing literal-string 'Name' requirements.

Type Parameters

Name

Name extends string

Nodes

Nodes extends NodeMap = NodeMap

Types

Types extends DefineTypes = NeverRecord

Data

Data extends DefineData = NeverRecord

Utils

Utils extends DefineUtils<AnyRecord> = AnyRecord

Properties

data?

optional data: Data

Defined in: plugin.ts:91

name

name: Name

Defined in: plugin.ts:91

nodes

nodes: Nodes

Defined in: plugin.ts:91

types?

optional types: Types

Defined in: plugin.ts:91

utils?

optional utils: Utils

Defined in: plugin.ts:91


PluginNodeUnion

PluginNodeUnion<S> = S["plugin"]["AnyNode"]

Defined in: plugin.ts:20

Plugin helper types for nodes

Type Parameters

S

S extends StatelySchemas<any, any>