Skip to main content

stores

ai-research-agent / editor/stores

Functions

activeStore()

function activeStore(editorStore): Readable<default>

Parameters

ParameterType

editorStore

Readable<Editor>

Returns

Readable<default>


derivedEditorStore()

function derivedEditorStore<T>(
editorStore,
defaultValue,
changeEvents,
update,
checkEquality?): Readable<T>

Type Parameters

Type Parameter

T

Parameters

ParameterType

editorStore

Readable<Editor>

defaultValue

T

changeEvents

string[]

update

(editor) => T

checkEquality?

boolean

Returns

Readable<T>


docStore()

function docStore(editorStore): Readable<default>

Parameters

ParameterType

editorStore

Readable<Editor>

Returns

Readable<default>


editorStores()

function editorStores(editor): EditorStores

Parameters

ParameterType

editor

Editor

Returns

EditorStores


focusStore()

function focusStore(editorStore): Readable<boolean>

Parameters

ParameterType

editorStore

Readable<Editor>

Returns

Readable<boolean>


rootStore()

function rootStore(editorStore): Readable<undefined | HTMLElement>

Parameters

ParameterType

editorStore

Readable<Editor>

Returns

Readable<undefined | HTMLElement>


selectionStore()

function selectionStore(editorStore): Readable<null | EditorRange>

Parameters

ParameterType

editorStore

Readable<Editor>

Returns

Readable<null | EditorRange>

Interfaces

EditorStores

Methods

updateEditor()
updateEditor(editor): void
Parameters
ParameterType

editor

Editor

Returns

void

Properties

active
active: Readable<default>;
doc
doc: Readable<default>;
focus
focus: Readable<boolean>;
root
root: Readable<undefined | HTMLElement>;
selection
selection: Readable<null | EditorRange>;

Readable<T>

Type Parameters

Type Parameter

T

Methods

get()
get(): T

Return the current value.

Returns

T

subscribe()
subscribe(callback): Unsubscriber

Subscribe to changes with a callback. Returns an unsubscribe function.

Parameters
ParameterType

callback

Subscriber<T>

Returns

Unsubscriber

Type Aliases

Subscriber()<T>

type Subscriber<T>: (value) => void;

Callback to inform of a value updates.

Type Parameters

Type Parameter

T

Parameters

ParameterType

value

T

Returns

void


Unsubscriber()

type Unsubscriber: () => void;

Unsubscribes from value updates.

Returns

void