Files
ComfyUI_frontend/src/extension-api/identifiers.ts
Connor Byrne 3d09f89251 docs(ext-api): refresh @example blocks + deprecate notify (W17.C/D/E)
- W17.C: refresh 5 stale @example blocks (types.ts, lifecycle.ts, node.ts,
  imperatives.ts ×2) — replace deprecated `async setup()` with
  `setup() { onMounted(...) }`; remove A1-removed `node.getWidget` from
  defineNode + NodeHandle.on migration examples; align imperatives examples
  with W17.B notify-toast verdict.
- W17.D: author ~37 new @example blocks across 9 files for sparse exports
  surfaced by W17.A audit. Pure JSDoc — zero exported-type diff.
- W17.E: add @deprecated JSDoc to notify() + NotifyOptions per
  D-notify-toast-consolidation (W17.B verdict (a) soft-deprecate).

Pure JSDoc — no signature, type, or export changes.
Phase A surface remains FROZEN at ee0537fdb5 (foundation surface SHA
unchanged; only @example / @deprecated text differs).

See research/dashboard-snippet-audit-2026-05-21.md (W17.A) for full
per-edit rationale.
2026-05-20 20:07:13 -07:00

55 lines
1.5 KiB
TypeScript

/**
* Node identity helpers — re-exported from internal `nodeIdentification.ts`.
*
* `NodeLocatorId` and `NodeExecutionId` are the two stable node identity
* primitives in the public API. All extension-facing code that needs to
* reference a node across subgraph boundaries or execution runs should use
* these rather than raw LiteGraph integer node IDs.
*
* @packageDocumentation
*/
export type { NodeLocatorId, NodeExecutionId } from '@/types/nodeIdentification'
/**
* Node identity round-trip helpers. Create/parse branded `NodeLocatorId` and
* `NodeExecutionId` values, or narrow an `unknown` to one with the type
* guards. Use these instead of raw string manipulation so future changes to
* the identity scheme stay transparent.
*
* @example
* ```ts
* import {
* createNodeLocatorId,
* parseNodeLocatorId,
* isNodeLocatorId,
* createNodeExecutionId,
* parseNodeExecutionId,
* isNodeExecutionId
* } from '@comfyorg/extension-api'
*
* // Construct
* const locator = createNodeLocatorId(graphUuid, localId)
* const execId = createNodeExecutionId(locator, runTag)
*
* // Narrow
* if (isNodeLocatorId(maybe)) {
* const parts = parseNodeLocatorId(maybe)
* console.log(parts.graphUuid, parts.localId)
* }
*
* if (isNodeExecutionId(maybe)) {
* const parts = parseNodeExecutionId(maybe)
* console.log(parts.locator, parts.runTag)
* }
* ```
*/
export {
isNodeLocatorId,
isNodeExecutionId,
parseNodeLocatorId,
createNodeLocatorId,
parseNodeExecutionId,
createNodeExecutionId
} from '@/types/nodeIdentification'