/** * Classification of how a `Context` field behaves on `Context.resetRuntimeState()`. * * Every field on Context that holds mutable collection state (Array/Map/Set) MUST carry a * classification via the {@link resettable} decorator — this is enforced by a test * (tests/context/test context reset classification.ts), so adding a new runtime-state field * without deciding its reset behavior fails CI instead of silently leaking. */ export type ContextResetBehavior = /** Collections are emptied in place: arrays → length 0, Map/Set → clear(), * plain container objects (e.g. the coroutines map) → each array entry emptied */ "empty" /** Field is set to null */ | "null" /** Field is set to undefined */ | "undefined" /** Deliberately NOT reset — document why at the field declaration */ | "keep" /** Reset by explicit code (e.g. Context.resetSubsystems) — the decorator only records * that the decision was made consciously */ | "custom"; /** * @internal Classifies how a `Context` field behaves on `Context.resetRuntimeState()`. * Fields marked `"empty"`/`"null"`/`"undefined"` are reset automatically by * {@link applyContextReset}; `"keep"` and `"custom"` only record the decision. */ export declare function resettable(behavior?: ContextResetBehavior): PropertyDecorator; /** @internal Returns the reset classifications declared via {@link resettable} for an instance's class. */ export declare function getContextResetBehaviors(instance: object): ReadonlyMap | undefined; /** @internal Applies all automatic reset behaviors ("empty"/"null"/"undefined") declared via {@link resettable}. */ export declare function applyContextReset(instance: object): void;