@anticrm/text Package
Classes
Class | Description |
---|---|
MarkdownParser |
Enumerations
Enumeration | Description |
---|---|
MessageMarkType | |
MessageNodeType |
Functions
Function | Description |
---|---|
compareDeep(a, b) | |
messageContent(node) | |
messageMarks(node) | |
newMessageDocument() | |
parseMessage(message) | |
parseMessageMarkdown(message) | |
serializeMessage(node) | |
serializeMessageMarkdown(node) | |
traverseMarks(node, f) | |
traverseMessage(node, f) |
Interfaces
Interface | Description |
---|---|
IState | |
LinkMark | |
MessageMark | |
MessageNode | |
ReferenceMark |
Type Aliases
Type Alias | Description |
---|---|
FirstDelim |
Enumerations
MessageMarkType enum
Signature:
export declare enum MessageMarkType
Enumeration Members
Member | Value | Description |
---|---|---|
code | "code" |
|
em | "em" |
|
link | "link" |
|
reference | "reference" |
|
strong | "strong" |
MessageNodeType enum
Signature:
export declare enum MessageNodeType
Enumeration Members
Member | Value | Description |
---|---|---|
blockquote | "blockquote" |
|
bullet_list | "bullet_list" |
|
code_block | "code_block" |
|
doc | "doc" |
|
hard_break | "hard_break" |
|
heading | "heading" |
|
horizontal_rule | "horizontal_rule" |
|
image | "image" |
|
list_item | "list_item" |
|
ordered_list | "ordered_list" |
|
paragraph | "paragraph" |
|
text | "text" |
Functions
compareDeep
Signature:
export declare function compareDeep(a: any, b: any): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
a | any | |
b | any |
Returns:
boolean
messageContent
Signature:
export declare function messageContent(node: MessageNode): MessageNode[];
Parameters
Parameter | Type | Description |
---|---|---|
node | MessageNode |
Returns:
messageMarks
Signature:
export declare function messageMarks(node: MessageNode): MessageMark[];
Parameters
Parameter | Type | Description |
---|---|---|
node | MessageNode |
Returns:
newMessageDocument
Signature:
export declare function newMessageDocument(): MessageNode;
Returns:
parseMessage
Signature:
export declare function parseMessage(message: string): MessageNode;
Parameters
Parameter | Type | Description |
---|---|---|
message | string |
Returns:
parseMessageMarkdown
Signature:
export declare function parseMessageMarkdown(message: string): MessageNode;
Parameters
Parameter | Type | Description |
---|---|---|
message | string |
Returns:
serializeMessage
Signature:
export declare function serializeMessage(node: MessageNode): string;
Parameters
Parameter | Type | Description |
---|---|---|
node | MessageNode |
Returns:
string
serializeMessageMarkdown
Signature:
export declare function serializeMessageMarkdown(node: MessageNode): string;
Parameters
Parameter | Type | Description |
---|---|---|
node | MessageNode |
Returns:
string
traverseMarks
Signature:
export declare function traverseMarks(node: MessageNode, f: (el: MessageMark) => void): void;
Parameters
Parameter | Type | Description |
---|---|---|
node | MessageNode | |
f | (el: MessageMark) => void |
Returns:
void
traverseMessage
Signature:
export declare function traverseMessage(node: MessageNode, f: (el: MessageNode) => void): void;
Parameters
Parameter | Type | Description |
---|---|---|
node | MessageNode | |
f | (el: MessageNode) => void |
Returns:
void
Type Aliases
FirstDelim
Signature:
export declare type FirstDelim = (i: number) => string;