Skip to main content

Functions

About 2 min

Functions

mountDevtoolsHooks(options)open in new window

Returns: void

Arguments:

options: MountOptions

unmountDevtoolsHooks()open in new window

Returns: void

Arguments: none

createDocAccessor(text)

Returns: DocAccessor<T>

Arguments:

text: TextObject | EchoReactiveObject<object>

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(object, cursor)

Returns: number

Arguments:

object: TextObject

cursor: string

getRawDoc(obj, [path])

Returns: DocAccessor<any>

Arguments:

obj: OpaqueEchoObject

path: KeyPath

getSpaceForObject(object)open in new window

Returns: undefined | Space

Arguments:

object: OpaqueEchoObject

getTextContent(object, defaultValue)

Returns: string

Arguments:

object: undefined | TextObject | EchoReactiveObject<object>

defaultValue: string

getTextInRange(object, begin, end)

TODO(dima?): This API will change.

Returns: string

Arguments:

object: TextObject

begin: string

end: string

hasType(schema)

Returns: function

Arguments:

schema: Schema

isAutomergeObject(object)

Returns: object is AutomergeObject

Arguments:

object: unknown

isTypedObject(object)

Returns: object is TypedObject<Record<string, any>>

Arguments:

object: unknown

setTextContent(object, text)

Returns: void

Arguments:

object: TextObject

text: string

toCursor(object, pos)

Returns: string

Arguments:

object: TextObject

pos: number

Remote(target)open in new window

Returns: Partial<Config>

Arguments:

target: undefined | string

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

Create services from config.

Returns: Promise<ClientServicesProvider>

Arguments:

config: Config

createWorker: function

fromAgent(options)open in new window

Connects to locally running CLI daemon.

Returns: ClientServicesProvider

Arguments:

options: FromAgentOptions

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

Creates stand-alone services without rpc.

Returns: Promise<ClientServicesProvider>

Arguments:

config: Config

params: ClientServicesHostParams

fromIFrame(config, options)open in new window

Create services provider proxy connected via iFrame to host.

Returns: Promise<ClientServicesProvider>

Arguments:

config: Config

options: Omit<Partial<IFrameClientServicesProxyOptions>, "source">

fromSocket(url)open in new window

Access to remote client via a socket.

Returns: Promise<ClientServicesProvider>

Arguments:

url: 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

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(create, check)open in new window

Returns: Promise<object>

Arguments:

create: EchoDatabase

check: EchoDatabase

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

Returns: Promise<Space>

Arguments:

client: Client

spaceKey: PublicKey

options: Options