import type { Agent } from 'https'; import type { Context } from '../context'; import type { IIoHost } from '../io'; import type { FilteredNotice } from './filter'; import type { BootstrappedEnvironment, NoticeDataSource } from './types'; /** * Options for the HTTPS requests made by Notices */ export interface NoticesHttpOptions { /** * The agent responsible for making the network requests. * * Use this so set up a proxy connection. * * @default - Uses the shared global node agent */ readonly agent?: Agent; } export interface NoticesProps { /** * CDK context */ readonly context: Context; /** * Global CLI option for output directory for synthesized cloud assembly * * @default 'cdk.out' */ readonly output?: string; /** * The detected CDK app language. * * @default - no language filtering */ readonly language?: string; /** * Options for the HTTPS requests made by Notices */ readonly httpOptions?: NoticesHttpOptions; /** * Where messages are going to be sent */ readonly ioHost: IIoHost; /** * The version of the CLI */ readonly cliVersion: string; } export interface NoticesFilterOptions { /** * Include notices that have already been acknowledged. * * @default false */ readonly includeAcknowledged?: boolean; } export interface NoticesDisplayOptions extends NoticesFilterOptions { /** * Whether to append the total number of unacknowledged notices to the display. * * @default false */ readonly showTotal?: boolean; } export interface NoticesRefreshOptions { /** * Whether to force a cache refresh regardless of expiration time. * * @default false */ readonly force?: boolean; /** * Data source for fetch notices from. * * @default - WebsiteNoticeDataSource */ readonly dataSource?: NoticeDataSource; } /** * Provides access to notices the CLI can display. */ export declare class Notices { /** * Create an instance. Note that this replaces the singleton. */ static create(props: NoticesProps): Notices; /** * Get the singleton instance. May return `undefined` if `create` has not been called. */ static get(): Notices | undefined; private static _instance; private readonly context; private readonly output; private readonly language?; private readonly acknowledgedIssueNumbers; private readonly httpOptions; private readonly ioHelper; private readonly cliVersion; private data; private readonly bootstrappedEnvironments; private constructor(); /** * Add a bootstrap information to filter on. Can have multiple values * in case of multi-environment deployments. */ addBootstrappedEnvironment(bootstrapped: BootstrappedEnvironment): void; /** * Refresh the list of notices this instance is aware of. * * This method throws an error if the data source fails to fetch notices. * When using, consider if execution should halt immdiately or if catching the error and continuing is more appropriate * * @throws on failure to refresh the data source */ refresh(options?: NoticesRefreshOptions): Promise; /** * Filter the data source for relevant notices */ filter(options?: NoticesDisplayOptions): Promise; /** * Display the relevant notices (unless context dictates we shouldn't). */ display(options?: NoticesDisplayOptions): Promise; /** * List all notices available in the data source. * * @param includeAcknowlegded - Whether to include acknowledged notices. */ private noticesFromData; } //# sourceMappingURL=notices.d.ts.map