Skip to main content

Functions


Functions

mountDevtoolsHooks(options)open in new window

Returns: void

Arguments:

options: MountOptions

unmountDevtoolsHooks()open in new window

Returns: void

Arguments: none

create(schema, obj, [meta])

Creates a reactive object from a plain Javascript object. Optionally provides a TS-effect schema.

Returns: ReactiveObject<T>

Arguments:

schema: Schema<T, T, never>

obj: ExcludeId<T>

meta: object

createDocAccessor(obj, path)

Returns: DocAccessor<any>

Arguments:

obj: EchoReactiveObject<T>

path: KeyPath

createEchoObject(init)

Returns: EchoReactiveObject<T>

Arguments:

init: T

createSubscription(onUpdate)

Subscribe to database updates. Calls the callback when any object from the selection changes. Calls the callback when the selection changes. Always calls the callback on the first selection.update call.

Returns: SubscriptionHandle

Arguments:

onUpdate: function

fromCursor(accessor, cursor)

Returns: number

Arguments:

accessor: DocAccessor<any>

cursor: string

fullyQualifiedId(object)open in new window

Fully qualified id of a reactive object is a combination of the space id and the object id.

Returns: string

Arguments:

object: ReactiveObject<any>

getMeta(obj)

Returns: object

Arguments:

obj: T

getObjectCore(obj)

Returns: ObjectCore

Arguments:

obj: EchoReactiveObject<T>

getRangeFromCursor(accessor, cursor)

Returns: undefined | object

Arguments:

accessor: DocAccessor<any>

cursor: string

getSchema(obj)

Returns the schema for the given object if one is defined.

Returns: undefined | Schema<any, any, never>

Arguments:

obj: undefined | T

getSpace(object)open in new window

Returns: undefined | Space

Arguments:

object: ReactiveObject<any>

getTextInRange(accessor, start, end)

Returns: string

Arguments:

accessor: DocAccessor<any>

start: string

end: string

getType(obj)

Returns: undefined | Reference

Arguments:

obj: undefined | T

getTypename(obj)

Returns: undefined | string

Arguments:

obj: T

hasType(type)

Returns: function

Arguments:

type: function

internalDecodeReference(value)

Returns: Reference

Arguments:

value: any

isEchoObject(value)

Returns: value is EchoReactiveObject<any>

Arguments:

value: unknown

isSpace(object)open in new window

Returns: object is Space

Arguments:

object: unknown

loadObjectReferences(objOrArray, valueAccessor, [timeout])

EXPERIMENTAL - the API is subject to change.

Returns: Promise<[object Object] extends [object Object] ? [object Object] : [object Object]>

Arguments:

objOrArray: T | T[]

valueAccessor: function

timeout: object

toCursor(accessor, pos)

Returns: string

Arguments:

accessor: DocAccessor<any>

pos: number

toCursorRange(accessor, start, end)

Returns: string

Arguments:

accessor: DocAccessor<any>

start: number

end: number

Defaults([basePath])

JSON config.

Returns: Partial<Config>

Arguments:

basePath: string

Dynamics()

Provided dynamically by server.

Returns: Partial<Config>

Arguments: none

Envs([basePath])

ENV variable (key/value) map.

Returns: Partial<Config>

Arguments:

basePath: string

Local()

Development config.

Returns: Partial<Config>

Arguments: none

Remote(target, [authenticationToken])

Returns: Partial<Config>

Arguments:

target: undefined | string

authenticationToken: string

Storage()

Load config from storage.

Returns: Promise<Partial<Config>>

Arguments: none

createClientServices(config, [createWorker], [observabilityGroup], [signalTelemetryEnabled])open in new window

Create services from config.

Returns: Promise<ClientServicesProvider>

Arguments:

config: Config

createWorker: function

observabilityGroup: string

signalTelemetryEnabled: boolean

fromAgent(options)open in new window

Connects to locally running CLI daemon.

Returns: ClientServicesProvider

Arguments:

options: FromAgentOptions

fromHost(config, [params], [observabilityGroup], [signalTelemetryEnabled])open in new window

Creates stand-alone services without rpc.

Returns: Promise<ClientServicesProvider>

Arguments:

config: Config

params: ClientServicesHostParams

observabilityGroup: string

signalTelemetryEnabled: boolean

fromSocket(url, [authenticationToken])open in new window

Access to remote client via a socket.

Returns: Promise<ClientServicesProvider>

Arguments:

url: string

authenticationToken: string

fromWorker(config, options)open in new window

Creates services provider connected via worker.

Returns: Promise<WorkerClientServices>

Arguments:

config: Config

options: Omit<WorkerClientServicesParams, "config">

getUnixSocket(profile, protocol)open in new window

Returns: string

Arguments:

profile: string

protocol: string

createInitializedClientsWithContext(ctx, count, [options])open in new window

Returns: Promise<Client[]>

Arguments:

ctx: Context

count: number

options: CreateInitializedClientsOptions

joinCommonSpace(options, [spaceKey])open in new window

Returns: Promise<PublicKey>

Arguments:

options: Client[]

spaceKey: PublicKey

performInvitation(options)

Returns: [Promise<Result>, Promise<Result>]

Arguments:

options: PerformInvitationParams

syncItemsAutomerge(db1, db2)open in new window

Returns: Promise<void>

Arguments:

db1: EchoDatabase

db2: EchoDatabase

testSpaceAutomerge(createDb, checkDb)open in new window

Returns: Promise<object>

Arguments:

createDb: EchoDatabase

checkDb: EchoDatabase

waitForSpace(client, spaceKey, options)open in new window

Returns: Promise<Space>

Arguments:

client: Client

spaceKey: PublicKey

options: Options