Skip to main content

typeset

ai-research-agent / editor/typesetting/typeset

Functions

embed()

function embed(type): EmbedType

Parameters

ParameterType

type

EmbedType

Returns

EmbedType


format()

function format(type): FormatType

Parameters

ParameterType

type

FormatType

Returns

FormatType


line()

function line(type): LineType

Parameters

ParameterType

type

LineType

Returns

LineType

Classes

Types<T>

A type store to hold types and make it easy to manage them.

Type Parameters

Type ParameterDefault type

T extends BasicType

BasicType

Accessors

default
Get Signature
get default(): T
Returns

T

Constructors

new Types()
new Types<T>(types): Types<T>
Parameters
ParameterType

types

T[]

Returns

Types<T>

Methods

add()
add(type): void
Parameters
ParameterType

type

T

Returns

void

findByAttributes()
Call Signature
findByAttributes(attributes, fallbackToDefault): T
Parameters
ParameterType

attributes

undefined | default

fallbackToDefault

true

Returns

T

Call Signature
findByAttributes(attributes, fallbackToDefault?): undefined | T
Parameters
ParameterType

attributes

undefined | default

fallbackToDefault?

boolean

Returns

undefined | T

findByNode()
Call Signature
findByNode(node, fallbackToDefault): T
Parameters
ParameterType

node

Node

fallbackToDefault

true

Returns

T

Call Signature
findByNode(node, fallbackToDefault?): undefined | T
Parameters
ParameterType

node

Node

fallbackToDefault?

boolean

Returns

undefined | T

get()
get(name): T
Parameters
ParameterType

name

string

Returns

T

init()
init(): void
Returns

void

matches()
matches(node): undefined | boolean
Parameters
ParameterType

node

null | Node

Returns

undefined | boolean

priority()
priority(name): number
Parameters
ParameterType

name

string

Returns

number

remove()
remove(type): void
Parameters
ParameterType

type

string | T

Returns

void

Properties

list
list: T[];
priorities
priorities: object;
Index Signature

[name: string]: number

selector
selector: string;
types
types: TypeMap<T>;

Typeset

Constructors

new Typeset()
new Typeset(types): Typeset
Parameters
ParameterType

types

TypesetTypes

Returns

Typeset

Properties

embeds
embeds: Types<EmbedType>;
formats
formats: Types<FormatType>;
lines
lines: Types<LineType>;
embed()
static embed: (type) => EmbedType;
Parameters
ParameterType

type

EmbedType

Returns

EmbedType

format()
static format: (type) => FormatType;
Parameters
ParameterType

type

FormatType

Returns

FormatType

line()
static line: (type) => LineType;
Parameters
ParameterType

type

LineType

Returns

LineType

Interfaces

BasicType

Extended by

Properties

commands()?
optional commands: (editor) => Function | Commands;
Parameters
ParameterType

editor

Editor

Returns

Function | Commands

fromDom?
optional fromDom: false | FromDom;
name
name: string;
render?
optional render: Renderer;
selector
selector: string;
shortcuts?
optional shortcuts: string | Shortcuts;
styleSelector?
optional styleSelector: string;

Commands

Indexable

[name: string]: (...args) => any


EmbedType

Extends

Properties

commands()?
optional commands: (editor) => Function | Commands;
Parameters
ParameterType

editor

Editor

Returns

Function | Commands

Inherited from

BasicType.commands

fromDom?
optional fromDom: false | FromDom;
Inherited from

BasicType.fromDom

name
name: string;
Inherited from

BasicType.name

noFill?
optional noFill: boolean;
render?
optional render: Renderer;
Inherited from

BasicType.render

selector
selector: string;
Inherited from

BasicType.selector

shortcuts?
optional shortcuts: string | Shortcuts;
Inherited from

BasicType.shortcuts

styleSelector?
optional styleSelector: string;
Inherited from

BasicType.styleSelector


FormatType

Extends

Properties

commands()?
optional commands: (editor) => Function | Commands;
Parameters
ParameterType

editor

Editor

Returns

Function | Commands

Inherited from

BasicType.commands

fromDom?
optional fromDom: false | FromDom;
Inherited from

BasicType.fromDom

greedy?
optional greedy: boolean;
name
name: string;
Inherited from

BasicType.name

render?
optional render: Renderer;
Inherited from

BasicType.render

selector
selector: string;
Inherited from

BasicType.selector

shortcuts?
optional shortcuts: string | Shortcuts;
Inherited from

BasicType.shortcuts

styleSelector?
optional styleSelector: string;
Inherited from

BasicType.styleSelector


LineType

Extends

Properties

child?
optional child: boolean;
commands()?
optional commands: (editor) => Function | Commands;
Parameters
ParameterType

editor

Editor

Returns

Function | Commands

Inherited from

BasicType.commands

contained?
optional contained: boolean;
defaultFollows?
optional defaultFollows: boolean;
fromDom?
optional fromDom: false | FromDom;
Inherited from

BasicType.fromDom

frozen?
optional frozen: boolean;
indentable?
optional indentable: boolean;
name
name: string;
Inherited from

BasicType.name

nextLineAttributes()?
optional nextLineAttributes: (attributes) => default;
Parameters
ParameterType

attributes

default

Returns

default

onEmptyEnter()?
optional onEmptyEnter: (editor, line) => boolean;
Parameters
ParameterType

editor

Editor

line

default

Returns

boolean

onEnter()?
optional onEnter: (editor) => void;
Parameters
ParameterType

editor

Editor

Returns

void

onTab()?
optional onTab: (editor, shiftKey) => void;
Parameters
ParameterType

editor

Editor

shiftKey

boolean

Returns

void

render?
optional render: Renderer;
Overrides

BasicType.render

renderMultiple?
optional renderMultiple: MultiLineRenderer;
selector
selector: string;
Inherited from

BasicType.selector

shortcuts?
optional shortcuts: string | Shortcuts;
Inherited from

BasicType.shortcuts

shouldCombine?
optional shouldCombine: ShouldCombine;
styleSelector?
optional styleSelector: string;
Inherited from

BasicType.styleSelector


TypeMap<T>

Type Parameters

Type ParameterDefault type

T extends BasicType

BasicType

Indexable

[name: string]: T


TypesetTypes

Properties

embeds?
optional embeds: (string | EmbedType)[];
formats?
optional formats: (string | FormatType)[];
lines?
optional lines: (string | LineType)[];

Type Aliases

FromDom()

type FromDom: (node) => any;

Parameters

ParameterType

node

HTMLElement

Returns

any


LineData

type LineData: [default, VChild[], string];

MultiLineRenderer()

type MultiLineRenderer: (lines, editor, forHTML?) => VNode;

Parameters

ParameterType

lines

LineData[]

editor

Editor

forHTML?

boolean

Returns

VNode


Renderer()

type Renderer: (attributes, children, line, editor, forHTML?) => VNode;

Parameters

ParameterType

attributes

default

children

VChild[]

line

default

editor

Editor

forHTML?

boolean

Returns

VNode


ShouldCombine()

type ShouldCombine: (prev, next) => boolean;

Parameters

ParameterType

prev

default

next

default

Returns

boolean