JsonTransportPart
SUPPORT · type · 类型合同
One scanned span: a complete object frame or a character outside any frame.
导入
ts
import type { JsonTransportPart } from '@jangts/agent-core/types';js
/** @typedef {import('@jangts/agent-core/types').JsonTransportPart} JsonTransportPart */其他公开入口:@jangts/agent-core/types、@jangts/agent-core/structs。
定义
类型: JsonTransportPart
字段结构
| 字段 | 类型 | 必需 | 说明 |
|---|---|---|---|
kind | "frame" | "outside" | 必需 | 见类型定义及调用场景。 |
text | string | 必需 | 见类型定义及调用场景。 |
类型使用
在调用方读取该合同
ts
import type { JsonTransportPart } from '@jangts/agent-core/types';
// 在使用点保留原合同,TS 与 JS 具有相同的运行行为。
function inspect(value: JsonTransportPart) {
return value.kind;
}js
/** @param {import('@jangts/agent-core/types').JsonTransportPart} value */
function inspect(value) {
return value.kind;
}