MCPcopy
hub / github.com/stampit-org/stampit / InitializerContext

Interface InitializerContext

stampit.ts:40–52  ·  view source on GitHub ↗

The context object passed as the 2nd argument to every initializer.

Source from the content-addressed store, hash-verified

38
39/** The context object passed as the 2nd argument to every initializer. */
40interface InitializerContext<I> {
41 /** The object instance being produced. Returning a non-`undefined` value replaces it. */
42 instance: I;
43 /**
44 * A reference to the Stamp producing the instance. Its statics are typed
45 * loosely (`any`) on purpose: pinning them here would make `Stamp` invariant
46 * in `S`, which breaks the common `let X = stampit(...); X = X.statics(...)`
47 * reassignment pattern. `stamp()` still returns a precisely-typed instance.
48 */
49 stamp: Stamp<I, any>;
50 /** All arguments passed into the Stamp, including the options argument. */
51 args: any[];
52}
53
54/**
55 * A function used as an `.init()` / `.initializers()` argument.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…