Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Meta

@truffle/db Meta system

This exposes the forDefinitions function for building a concrete system for any defined set of resources.

Index

Definitions

Definition

Definition<C, N>: Definition<C, N> & Definition<C, N> & Definition<C, N> & Definition<C, N>

Main Definition type for whole meta system

Each definition for a given CollectionName must adhere to the Graph.Definition, Pouch.Definition, and Process.Definition definition type for that name.

Type parameters

Definitions

Definitions<C>: {[ N in CollectionName<C>]: Definition<C, N> }

Definitions type for whole meta system

Type parameters

Other

CollectionName

CollectionName<C>: string & keyof C

Type parameters

Collections

Collections: {}

Type declaration

  • [collectionName: string]: { idFields: string[]; input: object; names: {[ S in CollectionNameStyle]: string }; resource: { id: string } } & { named: true; resource: { name: string } } | { named?: false } & { mutable: true } | { mutable?: false }

IdFields

IdFields<C, N>: CollectionProperty<"idFields", C, N>

Type parameters

IdObject

IdObject<C, N, R>: {[ P in keyof R]: P extends "id" ? string : never }

Type parameters

Input

Input<C, N>: CollectionProperty<"input", C, N>

Type parameters

MutableCollectionName

MutableCollectionName<C>: FilteredCollectionName<C, { is: "mutable" }>

Type parameters

MutableResource

MutableResource<C, N>: Resource<C, N, { is: "mutable" }>

Type parameters

NamedCollectionName

NamedCollectionName<C>: FilteredCollectionName<C, { is: "named" }>

Type parameters

NamedResource

NamedResource<C, N>: Resource<C, N, { is: "named" }>

Type parameters

Resource

Resource<C, N, F>: F extends ResourceFilter ? Extract<Collection<C, N>, {[ K in F["is"]]: true }> extends never ? never : Extract<Collection<C, N>, {[ K in F["is"]]: true }>["resource"] : CollectionProperty<"resource", C, N>

Type parameters

SavedInput

SavedInput<C, N>: {[ K in keyof Input<C, N> | "id"]: K extends "id" ? string : K extends keyof Input<C, N> ? Input<C, N>[K] : never }

Type parameters

Const forDefinitions

Const toIdObject

  • toIdObject<C, N, R, I>(resource: I): Pick<R, "id"> extends I ? IdObject<C, N, R> : undefined | IdObject<C, N, R>

Generated using TypeDoc