stores
ai-research-agent / editor/stores
Functions
activeStore()
function activeStore(editorStore): Readable<default>
Parameters
Parameter | Type |
---|---|
|
Returns
derivedEditorStore()
function derivedEditorStore<T>(
editorStore,
defaultValue,
changeEvents,
update,
checkEquality?): Readable<T>
Type Parameters
Type Parameter |
---|
|
Parameters
Parameter | Type |
---|---|
| |
|
|
|
|
| ( |
|
|
Returns
Readable
<T
>
docStore()
function docStore(editorStore): Readable<default>
Parameters
Parameter | Type |
---|---|
|
Returns
editorStores()
function editorStores(editor): EditorStores
Parameters
Parameter | Type |
---|---|
|
Returns
focusStore()
function focusStore(editorStore): Readable<boolean>
Parameters
Parameter | Type |
---|---|
|
Returns
Readable
<boolean
>
rootStore()
function rootStore(editorStore): Readable<undefined | HTMLElement>
Parameters
Parameter | Type |
---|---|
|
Returns
Readable
<undefined
| HTMLElement
>
selectionStore()
function selectionStore(editorStore): Readable<null | EditorRange>
Parameters
Parameter | Type |
---|---|
|
Returns
Readable
<null
| EditorRange
>
Interfaces
EditorStores
Methods
updateEditor()
updateEditor(editor): void
Parameters
Parameter | Type |
---|---|
|
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 |
---|
|
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
Parameter | Type |
---|---|
|
|
Returns
Type Aliases
Subscriber()<T>
type Subscriber<T>: (value) => void;
Callback to inform of a value updates.
Type Parameters
Type Parameter |
---|
|
Parameters
Parameter | Type |
---|---|
|
|
Returns
void
Unsubscriber()
type Unsubscriber: () => void;
Unsubscribes from value updates.
Returns
void