/** * A storage place for context used in synthesis */ export interface IContextStore { /** * Read the context from the context store, plus all updates we have made so far. */ read(): Promise>; /** * Commit the given updates to the context store * * `undefined` is used as a value to indicate that the key needs to be removed. * * If a context value is an object that is a superset of `{ [TRANSIENT_CONTEXT_KEY]: true }` * it *should* be returned by subsequent `read()` operations on this object, * but it *should not* be persisted to permanent storage. * * You can use the `persistableContext()` function to filter a context dictionary * down to remove all values that shouldn't be persisted. */ update(updates: Record): Promise; } /** * A context store as used by a CDK app. * * Will source context from the following locations: * * - Any context values passed to the constructor (expected * to come from the command line, treated as ephemeral). * - The `context` key in `/cdk.json`. * - `/cdk.context.json`. * - The `context` key in `~/.cdk.json`. * * Updates will be written to `/cdk.context.json`. */ export declare class CdkAppMultiContext implements IContextStore { private readonly commandlineContext?; private _context?; private configContextFile; private projectContextFile; private userConfigFile; constructor(appDirectory: string, commandlineContext?: Record | undefined); read(): Promise>; update(updates: Record): Promise; /** * Initialize the `Context` object * * This code all exists to reuse code that's already there, to minimize * the chances of the new code behaving subtly differently than the * old code. * * It might be most of this is unnecessary now... */ private asyncInitialize; } /** * On-disk context stored in a single file */ export declare class FileContext implements IContextStore { private readonly fileName; private _cache?; constructor(fileName: string); read(): Promise>; update(updates: Record): Promise; } /** * An in-memory context store */ export declare class MemoryContext implements IContextStore { private context; constructor(initialContext?: Record); read(): Promise>; update(updates: Record): Promise; } /** * Filter the given context, leaving only entries that should be persisted */ export declare function persistableContext(context: Record): Record; //# sourceMappingURL=context-store.d.ts.map