参数与契约
参数与契约的可用示例与编写接口。
API 输入的标识符、类型与说明需要完整阅读宽度时,请使用 DocumentParameters。必填与可选状态都用文字表示,两者都不是验证控件。嵌套路径保留完整名称,并说明父项已提供时的必填条件。
- class
Name stringRequired One complete class, including any selector or condition suffix.
- modestringOptional
Use the active manifest’s default behavior when omitted.
- range.start.characterintegerRequired when parent is provided
Zero-based UTF-16 code-unit offset. Keep the full path visible so readers can build the correct request object.
完整输入结构定义
{ "type": "object", "properties": { "className": { "type": "string", "minLength": 1 } }, "required": ["className"]}展开的补充细节
原生折叠元素将补充内容保留在文档中,让读者使用键盘展开或收起。必要说明应放在折叠元素之外。
<DocumentParameters label="Parameters" parameters={[ { name: 'className', type: 'string', requirement: 'Required', description: 'One complete class.' }]} /><DocumentDisclosure title="Complete input schema"> <Code lang="json">{schema}</Code></DocumentDisclosure>两种组件都应放在文档流中、示例布局之外。参数列表为空时,用普通句子说明。长代码可在展开区域内滚动,参数说明则自然换行。即使页面最初将其折叠,可移植 Markdown 与搜索仍须保留完整契约。