Skip to content

Class: PublicID<ModelTypes, Alias>

core.PublicID

A PublicID instance provides a client associated to a specific DID.

It is exported by the core module.

import { PublicID } from '@self.id/core'

Type parameters

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

Constructors

constructor

new PublicID<ModelTypes, Alias>(params)

Type parameters

Name Type
ModelTypes extends ModelTypeAliases<Record<string, any>, Record<string, string>, Record<string, string>> = CoreModelTypes
Alias extends string | number | symbol = keyof ModelTypes["definitions"]

Parameters

Name Type
params PublicIDParams<ModelTypes>

Accessors

id

get id(): string

DID string associated to the PublicID instance.

Returns

string

Methods

get

get<Key, ContentType>(key): Promise<null | ContentType>

Load the record contents for a given definition alias.

Type parameters

Name Type
Key extends string | number | symbol
ContentType DefinitionContentType<ModelTypes, Key>

Parameters

Name Type
key Key

Returns

Promise<null | ContentType>