Skip to content
English

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"必需见类型定义及调用场景。
textstring必需见类型定义及调用场景。

类型使用 ​

在调用方读取该合同 ​

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;
}

接口参考、使用示例与开发指南。