/** * The shape of `context` values in `cdk.json`. CDK feature flags are * typically booleans, custom user context can be any JSON-serializable * scalar / structure. */ export type CdkContextValue = string | number | boolean | null | CdkContextValue[] | { [key: string]: CdkContextValue; }; export type CdkContext = Record; export type LoadedCdkContext = { /** * The raw `context` block from cdk.json. Empty object if cdk.json was * missing, unparseable, or had no `context` key. */ context: CdkContext; /** * True iff cdk.json was found and parsed successfully (regardless of * whether it had a `context` block). Lets callers differentiate * "no context flag set" from "we couldn't read cdk.json". */ found: boolean; /** * Path the loader actually read, when `found` is true. Useful for * diagnostic messages. */ source?: string; }; /** * Type guard: a value at `context[key]` is the boolean true. * Handles both `true` and the string `"true"` (CDK accepts both for * feature flags written from the command line via `cdk synth -c flag=true`). */ export declare const isContextFlagEnabled: (context: CdkContext, key: string) => boolean; /** * Loads the `context` block from `cdk.json` in the given directory. * Returns an empty context (with `found: false`) if cdk.json is missing * or unparseable - callers that want strictness should check `found`. * * The CDK CLI itself reads cdk.json from the current working directory * by default; we mirror that behaviour. Pass an explicit `cwd` for * tests or non-default project layouts. */ export declare const loadCdkJsonContext: (cwd?: string) => LoadedCdkContext;