/** * COMPILE-TIME assertions that a context can only be restored from a REAL capture. * * The runtime half — that a snapshot round-trips, and that mutating the source afterwards does not * reach it — is in `CapturedContext.spec.ts`. What a spec CANNOT express is the half that matters * most: that `RequestContext.restoreContext(new Map([['userId', 'victim']]))` does not compile. Each * `@ts-expect-error` below fails the build with TS2578 the day its line starts compiling again. * * In COMPILED source deliberately — `tsconfig.lib.json` excludes specs and vitest strips types with * esbuild, so a `@ts-expect-error` in a `.spec.ts` is inert and the suite would pass either way. See * `RequestContextTrustCompileAssertions` for the trust-verb half. */ export declare class CapturedContextCompileAssertions { /** THE hole this change closes: a hand-assembled payload forging a trusted value. */ cannotRestoreAHandBuiltMap(): void; /** Same hole through the other door. */ cannotRunWithAHandBuiltMap(): void; /** Nor by asserting an object literal into the shape — the private `#entries` makes it nominal. */ cannotFakeTheShape(): void; /** Nor by constructing one directly — the constructor is private. */ cannotConstructOneDirectly(): void; /** * Nor by calling the factory: it demands a capability token whose own constructor is private, so * even code that can NAME the token (this package) cannot mint a second one. */ cannotMintAnAuthority(): void; /** And the factory is not callable without one at all. */ cannotCaptureWithoutAnAuthority(): void; /** * THE new hole this pair closes: a BARE capture must not run. If it did, `runWithContext(snapshot, * fn)` would sit next to `runWithContext(snapshot.withTrusted(), fn)` as a second spelling whose * shorter form silently carries a user identity — a widening that is an absence rather than a * token, and ungreppable. The capture is inert until it states its intent. */ cannotRunABareCapture(): void; /** Same, through the in-place door. */ cannotRestoreABareCapture(): void; /** * And the intent is stated by NARROWING, never by a flag on the run call. A `keepTrusted: boolean` * would make the wide intent as easy to type as the narrow one and impossible to grep; this line * fails the build the day such a parameter appears. */ cannotStateTheIntentViaAFlagOnTheRunCall(): void; /** Nor can a narrowed snapshot be minted directly — same private constructor, same token. */ cannotConstructARestorableContextDirectly(): void; /** Nor through its factory, which demands the same unobtainable authority. */ cannotMintARestorableContextWithoutAnAuthority(): void; /** POSITIVE: both narrowings produce the ONE type both consumers take. */ bothNarrowingsFeedBothConsumers(): void; /** POSITIVE: the real round trip must keep compiling — restoring a proven value IS the point. */ theRealRoundTripCompiles(): void; }