Skip to main content

smartEntry

ai-research-agent / editor/modules/smartEntry

Functions

lineReplace()

function lineReplace(
editor,
index,
prefix): boolean

Allow text representations to format a line

Parameters

ParameterType

editor

Editor

index

number

prefix

string

Returns

boolean


linkReplace()

function linkReplace(
editor,
index,
prefix): boolean

Parameters

ParameterType

editor

Editor

index

number

prefix

string

Returns

boolean


markReplace()

function markReplace(
editor,
index,
prefix,
wholeText): boolean

Parameters

ParameterType

editor

Editor

index

number

prefix

string

wholeText

string

Returns

boolean


smartEntry()

function smartEntry(handlers): (editor) => object

Parameters

ParameterTypeDefault value

handlers

Handler[]

defaultHandlers

Returns

Function

Parameters
ParameterType

editor

Editor

Returns

object

NameType
destroy()

textReplace()

function textReplace(
editor,
index,
prefix): boolean

Parameters

ParameterType

editor

Editor

index

number

prefix

string

Returns

boolean

Type Aliases

Handler()

type Handler: (editor?, index?, prefix?, wholeText?) => void;

Parameters

ParameterType

editor?

Editor

index?

number

prefix?

string

wholeText?

string

Returns

void


Replacement

type Replacement: [RegExp, (captured, attr) => default];

TextReplacement

type TextReplacement: [RegExp, (captured) => string];

Variables

defaultHandlers

const defaultHandlers: (editor, index, prefix) => boolean[];

Allow text representations to format a line

Parameters

ParameterType

editor

Editor

index

number

prefix

string

Returns

boolean


lineReplacements

const lineReplacements: Replacement[];

A list of [ RegExp, Function ] tuples to convert text into a formatted line with the attributes returned by the function. The function's argument will be the captured text from the regular expression.


linkReplacements

const linkReplacements: Replacement[];

markReplacements

const markReplacements: Replacement[];

A list of [ RegExp, Function ] tuples to convert text into formatted text with the attributes returned by the function. The function's argument will be the captured text from the regular expression.


textReplacements

const textReplacements: TextReplacement[];

A list of [ RegExp, Function ] tuples to convert text into another string of text which is returned by the function. The function's argument will be the captured text from the regular expression.