Id
CORE · type · 类型合同
Opaque identifier. Format and meaning belong to the App or to the registering module.
导入
ts
import type { Id } from '@jangts/agent-core';js
/** @typedef {import('@jangts/agent-core').Id} Id */其他公开入口:@jangts/agent-core、@jangts/agent-core/types、@jangts/agent-core/structs。
定义
ts
type Id = string;索引结构
| 字段 | 类型 | 必需 | 说明 |
|---|---|---|---|
[key: number] | string | 必需 | 只读。索引项。 |
类型使用
在调用方读取该合同
ts
import type { Id } from '@jangts/agent-core';
// 在使用点保留原合同,TS 与 JS 具有相同的运行行为。
function inspect(value: Id) {
return value;
}js
/** @param {import('@jangts/agent-core').Id} value */
function inspect(value) {
return value;
}