Functions
Functions
mountDevtoolsHooks(options)
Returns: void
Arguments:
options
: MountOptions
unmountDevtoolsHooks()
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)
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)
Returns: Partial<Config>
Arguments:
target
: undefined | string
createClientServices(config, [createWorker])
Create services from config.
Returns: Promise<ClientServicesProvider>
Arguments:
config
: Config
createWorker
: function
fromAgent(options)
Connects to locally running CLI daemon.
Returns: ClientServicesProvider
Arguments:
options
: FromAgentOptions
fromHost(config, [params])
Creates stand-alone services without rpc.
Returns: Promise<ClientServicesProvider>
Arguments:
config
: Config
params
: ClientServicesHostParams
fromIFrame(config, options)
Create services provider proxy connected via iFrame to host.
Returns: Promise<ClientServicesProvider>
Arguments:
config
: Config
options
: Omit<Partial<IFrameClientServicesProxyOptions>, "source">
fromSocket(url)
Access to remote client via a socket.
Returns: Promise<ClientServicesProvider>
Arguments:
url
: string
fromWorker(config, options)
Creates services provider connected via worker.
Returns: Promise<WorkerClientServices>
Arguments:
config
: Config
options
: Omit<WorkerClientServicesParams, "config">
getUnixSocket(profile, protocol)
Returns: string
Arguments:
profile
: string
protocol
: string
joinCommonSpace(options, [spaceKey])
Returns: Promise<PublicKey>
Arguments:
options
: Client[]
spaceKey
: PublicKey
performInvitation(options)
Returns: [Promise<Result>, Promise<Result>]
Arguments:
options
: PerformInvitationParams
syncItemsAutomerge(db1, db2)
Returns: Promise<void>
Arguments:
db1
: EchoDatabase
db2
: EchoDatabase
testSpaceAutomerge(create, check)
Returns: Promise<object>
Arguments:
create
: EchoDatabase
check
: EchoDatabase
waitForSpace(client, spaceKey, options)
Returns: Promise<Space>
Arguments:
client
: Client
spaceKey
: PublicKey
options
: Options