Type Definitions
This section details all data types and structural definitions utilized within the Article Editing API.
ArticleGroup
Document group object, used to describe each group in the document list:
- Name
group_id- Type
- number
- Required
- Required
- Description
- Unique identifier of the group.
- Name
name- Type
- string
- Required
- Required
- Description
- Group name.
- Name
isCreator- Type
- boolean
- Required
- Required
- Description
- Whether the current user is the creator.
- Name
articles- Type
- ArticleNode[]
- Required
- Required
- Description
- List of documents under this group.
- Name
time_create- Type
- number
- Required
- Required
- Description
- Group creation timestamp.
ArticleNode
Document object, used to describe each document entry in the document list:
- Name
outer_id- Type
- string
- Required
- Required
- Description
- Unique document identifier, used as docId when creating a session.
- Name
name- Type
- string
- Required
- Required
- Description
- Document name.
- Name
group- Type
- number
- Required
- Required
- Description
- Group ID the document belongs to. 0 means private article.
- Name
sharePermission- Type
- SharePermission
- Required
- Required
- Description
- Share permission configuration. Modification is not currently supported.
- Name
children- Type
- ArticleNode[]
- Required
- Required
- Description
- List of child documents. Currently supports a maximum of 2 levels of nesting.
- Name
fileholderDeep- Type
- number
- Required
- Required
- Description
- Document hierarchy depth. 0 means top-level document.
- Name
time_create- Type
- number
- Required
- Required
- Description
- Creation timestamp (Unix timestamp in seconds).
- Name
collectionArticle- Type
- CollectionArticle
- Optional
- Optional
- Description
- Collection link information for the article. Only present when the article is a collection source. Modification is not currently supported.
TextLeaf
Text node type, used for the children field of ElementBlock:
type TextLeaf = FormattedText | LatexText | CodeText | UrlText
ElementBlock
Document content block type, the type of the blocks field:
type ElementBlock =
| TitleElement
| AuthorElement
| AbstractElement
| ParagraphElement
| EquationElement
| H1Element
| H2Element
| H3Element
| ImageElement
| TableElement
| CodeElement
| LabelElement
| ListElement
All ElementBlocks contain id, type, children, and style fields.
ElementBlockSummary
Document content block summary, used to quickly display the basic information of an ElementBlock and its actual rendered Markdown content.
ElementStyle
Style types corresponding to ElementBlock:
type ElementStyle =
| TitleElementStyle
| AuthorElementStyle
| AbstractElementStyle
| ParagraphElementStyle
| EquationElementStyle
| H1ElementStyle
| H2ElementStyle
| H3ElementStyle
| ImageElementStyle
| TableElementStyle
| CodeElementStyle
| LabelElementStyle
| ListElementStyle
Using H1ElementStyle as an example; H2ElementStyle and H3ElementStyle have the same structure:
ImageElementStyle: Image style TableElementStyle: Table style CodeElementStyle: Code block style LabelElementStyle: Label style ListElementStyle: List styleDisplay Style Definitions
TitleElementCssStyle: Title container display style AuthorElementCssStyle: Author container display style AuthorElementAuthorCssStyle: Author name display style AuthorElementInstitutionCssStyle: Institution display style AbstractElementCssStyle: Abstract display style ParagraphElementCssStyle: Paragraph display style EquationElementCssStyle: Equation display style H1ElementCssStyle / H2ElementCssStyle / H3ElementCssStyle: Heading display styles ImageElementCssStyle: Image display style TableElementCssStyle: Table display style CodeElementCssStyle: Code block display style LabelElementCssStyle: Label display style ListElementCssStyle: List display styleArticleReference: Reference object
ArticleStyle: Global style GlobalStyle: Global configuration
Style Calculation Rules
The final display style of an element is determined by merging global and local styles:
| Condition | Result |
|---|---|
isTemplate == true | Use component style, global style is ignored |
Component style property value is null | Use corresponding global style property |
| Other cases | Use component style |