chore(vendor): import pi 1.3.0
Imported as a linear vendor commit so forge rebases do not replay the upstream root tree. git-subtree-dir: third_party/pi git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
This commit is contained in:
@@ -1,4 +1,16 @@
|
||||
import type { Context, ContextKey } from "../types.ts";
|
||||
/** Typed identity for one value carried by a {@link Context}. */
|
||||
export interface ContextKey<T> {
|
||||
readonly token: symbol;
|
||||
/** Type-only marker that prevents keys with different value types from being interchangeable. */
|
||||
readonly valueType?: (value: T) => T;
|
||||
}
|
||||
|
||||
/** Immutable invocation-scoped values passed explicitly through operations. */
|
||||
export interface Context {
|
||||
readonly abortSignal: AbortSignal | undefined;
|
||||
value<T>(key: ContextKey<T>): T | undefined;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
const ABORT_SIGNAL_CONTEXT_KEY: ContextKey<AbortSignal | undefined> = Object.freeze({
|
||||
token: Symbol("chord.abortSignal"),
|
||||
|
||||
Reference in New Issue
Block a user