Skip to content

Module: did-datastore

npm install @glazed/did-datastore

Classes

Type aliases

CreateOptions

Ƭ CreateOptions: Object

Type declaration

Name Type Description
controller? string Optional controller for the record
pin? boolean Pin the created record stream (default)

DIDDataStoreParams

Ƭ DIDDataStoreParams<ModelTypes>: Object

Type parameters

Name Type
ModelTypes extends ModelTypeAliases = ModelTypeAliases

Type declaration

Name Type Description
autopin? boolean Pin all created records streams (default)
cache? TileCache | boolean TileLoader cache parameter, only used if loader is not provided
ceramic CeramicApi A Ceramic client instance
id? string Fallback DID to use when not explicitly set in method calls
loader? TileLoader An optional TileLoader instance to use
model DataModel<ModelTypes> | ModelTypesToAliases<ModelTypes> A DataModel instance or runtime model aliases to use

DefinitionContentType

Ƭ DefinitionContentType<ModelTypes, Alias>: ModelTypes["schemas"][ModelTypes["definitions"][Alias]]

Type parameters

Name Type
ModelTypes extends ModelTypeAliases
Alias extends keyof ModelTypes["definitions"]

DefinitionWithID

Ƭ DefinitionWithID<Config>: Definition<Config> & { id: StreamID }

Type parameters

Name Type
Config extends Record<string, unknown> = Record<string, unknown>

DefinitionsContentTypes

Ƭ DefinitionsContentTypes<ModelTypes, Fallback>: Object

Type parameters

Name Type
ModelTypes extends ModelTypeAliases
Fallback Record<string, unknown>

Index signature

▪ [Key: string]: typeof Key extends keyof ModelTypes["definitions"] ? DefinitionContentType<ModelTypes, typeof Key> : Fallback


Entry

Ƭ Entry: Object

Type declaration

Name Type Description
id string Record ID (Ceramic StreamID)
key string Key (definition ID) identifying the record ID in the index
record unknown Record contents

Functions

assertDIDstring

assertDIDstring(did): void

Parameters

Name Type
did string

Returns

void


isDIDstring

isDIDstring(did): boolean

Parameters

Name Type
did string

Returns

boolean