Skip to content

Module: types

Common types used by Glaze packages.

Type aliases

CastModelTo

Ƭ CastModelTo<Model, ToType>: Model extends ModelData<any> ? MapModelTypes<Model, ToType> : ModelData<ToType>

Utility type for mapping a model structure to a given type.

Type parameters

Name Type
Model extends ModelData<any> | void
ToType ToType

EncodedDagJWS

Ƭ EncodedDagJWS: Object

JSON-encoded DAG-JWS.

Type declaration

Name Type
link? string
payload string
signatures JWSSignature[]

EncodedDagJWSResult

Ƭ EncodedDagJWSResult: Object

JSON-encoded DAG-JWS result representing a Ceramic stream commit.

Type declaration

Name Type
jws EncodedDagJWS
linkedBlock string

EncodedManagedModel

Ƭ EncodedManagedModel: ManagedModel<EncodedDagJWSResult>

JSON-encoded version of the ManagedModel, used by the ModelManager.


ManagedDoc

Ƭ ManagedDoc<CommitType>: Object

Shared structure for representing streams used in a ManagedModel.

Type parameters

Name Type
CommitType DagJWSResult

Type declaration

Name Type
alias string
commits CommitType[]
version string

ManagedEntry

Ƭ ManagedEntry<CommitType>: ManagedDoc<CommitType> & { schema: ManagedID }

Structure for representing streams having a schema dependency, used in a ManagedModel.

Type parameters

Name Type
CommitType DagJWSResult

ManagedID

Ƭ ManagedID: string

ID of a stream used in a ManagedModel.


ManagedModel

Ƭ ManagedModel<CommitType>: Object

Structure used internally by the ModelManager to represent a data model.

Type parameters

Name Type
CommitType DagJWSResult

Type declaration

Name Type
definitions Record<ManagedID, ManagedEntry<CommitType>>
schemas Record<ManagedID, ManagedSchema<CommitType>>
tiles Record<ManagedID, ManagedEntry<CommitType>>

ManagedSchema

Ƭ ManagedSchema<CommitType>: ManagedDoc<CommitType> & { dependencies: Record<string, ManagedID[]> }

Structure for representing schema streams and their dependencies, used in a ManagedModel.

Type parameters

Name Type
CommitType DagJWSResult

MapModelTypes

Ƭ MapModelTypes<Model, ToType>: Object

Utility type for mapping a model structure of a given type to another.

Type parameters

Name Type
Model extends ModelData<any>
ToType ToType

Type declaration

Name Type
definitions Record<keyof Model["definitions"], ToType>
schemas Record<keyof Model["schemas"], ToType>
tiles Record<keyof Model["tiles"], ToType>

ModelAliases

Ƭ ModelAliases<Model>: CastModelTo<Model, string>

Data model aliases created by deploying a managed model and used at runtime by the DataModel class.

Type parameters

Name Type
Model extends ModelData<any> | void = void

ModelData

Ƭ ModelData<T>: Object

Generic structure for storing model data.

Type parameters

Name
T

Type declaration

Name Type
definitions Record<string, T>
schemas Record<string, T>
tiles Record<string, T>

ModelTypeAliases

Ƭ ModelTypeAliases<Schemas, Definitions, Tiles>: Object

Model aliases relations between schemas and the definitions and tiles using them.

Type parameters

Name Type
Schemas extends Record<string, any> = Record<string, any>
Definitions extends Record<string, keyof Schemas> = Record<string, string>
Tiles extends Record<string, keyof Schemas> = Record<string, string>

Type declaration

Name Type
definitions Definitions
schemas Schemas
tiles Tiles

ModelTypesToAliases

Ƭ ModelTypesToAliases<TypeAliases>: MapModelTypes<TypeAliases, string>

Utility type to cast ModelTypeAliases to ModelAliases.

Type parameters

Name Type
TypeAliases extends ModelTypeAliases

Schema

Ƭ Schema<T>: JSONSchemaType<T> & { $comment?: string ; title?: string }

JSON schema declaration, used for validating Ceramic streams.

Type parameters

Name Type
T Record<string, any>