OutputIssue
KIT · interface · 类型合同
Output problem with a guaranteed field path.
导入
ts
import type { OutputIssue } from '@jangts/agent-core/kits/presentation';js
/** @typedef {import('@jangts/agent-core/kits/presentation').OutputIssue} OutputIssue */其他公开入口:@jangts/agent-core/types、@jangts/agent-core/kits/presentation、@jangts/agent-core/kits。
定义
ts
interface OutputIssue继承或实现: Issue。
字段结构
| 字段 | 类型 | 必需 | 说明 |
|---|---|---|---|
path | readonly (string | number)[] | 必需 | 只读。见类型定义及调用场景。 |
code | string | 必需 | 只读。Stable machine-readable reason code; the primary key for programmatic handling. |
message | string | 必需 | 只读。Human-readable description; not guaranteed stable for matching. |
checkId | string | undefined | 可省略 | 只读。Registered check that produced the issue, when the check belongs to a catalog. |
类型使用
在调用方读取该合同
ts
import type { OutputIssue } from '@jangts/agent-core/kits/presentation';
// 在使用点保留原合同,TS 与 JS 具有相同的运行行为。
function inspect(value: OutputIssue) {
return value.path;
}js
/** @param {import('@jangts/agent-core/kits/presentation').OutputIssue} value */
function inspect(value) {
return value.path;
}