Skip to content
中文

Id ​

CORE · type · Type contract

Opaque identifier. Format and meaning belong to the App or to the registering module.

Import ​

ts
import type { Id } from '@jangts/agent-core';
js
/** @typedef {import('@jangts/agent-core').Id} Id */

Other public entry points:@jangts/agent-core, @jangts/agent-core/types, @jangts/agent-core/structs.

Definition ​

ts
type Id = string;

Index structure ​

FieldTypeRequiredDescription
[key: number]stringRequiredRead-only. Index entry.

Using the type ​

Read the contract at the call site ​

ts
import type { Id } from '@jangts/agent-core';

// Keep the original contract at the call site; TS and JS share the same runtime behavior.
function inspect(value: Id) {
  return value;
}
js
/** @param {import('@jangts/agent-core').Id} value */
function inspect(value) {
  return value;
}

API reference, usage examples and developer guides.