Files
playbook/tools/tsl-codegen/examples/example.yaml
T
csh 9edc8fc868 feat(tsl-codegen): support unified API declarations
Add TSF conversion and shared Markdown recognition for mixed
function, class, and unit declarations.

Extend generation, linting, indexing, examples, and tests around
the unified declaration model.
2026-07-29 15:45:50 +08:00

161 lines
3.8 KiB
YAML

module: OfficeXml / OpenXml
path: officexml/openxml/elements
declarations:
- kind: class
name: OpenXmlAttribute
desc: 表示 OpenXml 属性
tags: [OpenXml, XML, 属性]
members:
- kind: method
name: create
visibility: public
binding: instance
signature: create(_prefix, _local_name)
desc: 创建 OpenXml 属性
tags: [OpenXml, 属性, 创建]
params:
- name: _prefix
type: string
desc: 命名空间前缀
- name: _local_name
type: string
desc: 本地名称
- kind: method
name: CreateVirtual
visibility: public
binding: class
signature: CreateVirtual(position, row_index, _story)
desc: 创建虚段落
params:
- name: position
type: integer
desc: 段落位置
- name: row_index
type: integer
desc: 行索引
- name: _story
type: StoryNode
desc: 故事节点
returns: ParagraphSegment
- kind: property
name: Prefix
visibility: public
desc: 命名空间前缀
type: string
access: readwrite
- kind: property
name: NamespaceUri
visibility: public
desc: 命名空间 URI
access: read
- kind: field
name: value_
visibility: protected
desc: 属性值存储
type: any
- kind: field
name: Count
visibility: public
desc: 属性实例数量
type: integer
static: true
- kind: constant
name: DefaultPrefix
visibility: public
desc: 默认命名空间前缀
type: string
value: xml
- kind: constant
name: MaximumAttributes
visibility: public
desc: 最大属性数量
type: integer
value: 256
static: true
- kind: function
name: ParseOpenXml
signature: ParseOpenXml(xml)
desc: 解析 OpenXml 文本
tags: [OpenXml, 解析]
params:
- name: xml
type: string
desc: OpenXml 文本
returns: OpenXmlElement
examples:
- desc: 解析根元素
code: |-
xml := '<root/>';
return ParseOpenXml(xml);
- kind: unit
name: OpenXmlRuntime
desc: 提供 OpenXml 运行时接口
tags: [OpenXml, 运行时]
members:
- kind: constant
name: DefaultSize
desc: 默认文档容量
type: integer
value: 100
- kind: variable
name: CurrentDocument
desc: 当前文档
type: Document
- kind: function
name: OpenDocument
signature: OpenDocument(path)
desc: 打开文档
tags: [OpenXml, 文档, 打开]
params:
- name: path
type: string
desc: 文档路径
returns: Document
- kind: class
name: Document
desc: 表示 OpenXml 文档
tags: [OpenXml, 文档]
members:
- kind: method
name: Save
visibility: public
binding: instance
signature: Save(path)
desc: 保存文档
params:
- name: path
type: string
desc: 保存路径
returns: boolean
- kind: method
name: Create
visibility: public
binding: class
signature: Create(name)
desc: 创建文档
params:
- name: name
type: string
desc: 文档名称
returns: Document
- kind: property
name: Title
visibility: public
desc: 文档标题
type: string
access: readwrite