import type { DangerDSLType } from "../dsl/danger-dsl.ts"; import type { DangerRuntimeContainer } from "../dsl/results.ts"; import type { MarkdownString } from "../dsl/types.ts"; /** A function with a callback, which Danger wraps in a Promise */ export type CallbackableFn = (callback: (done: any) => void) => void; /** * Types of things which Danger will schedule for you. * Recommended: just throw in an `async () => { [...] }` function. */ export type Scheduleable = Promise | Promise | CallbackableFn; /** * The DangerContext is the set of functions and values available * to a Dangerfile at runtime. */ export interface DangerContext { /** * Register async code to evaluate. Use `schedule` when you need * to do async work in a Dangerfile. */ schedule(asyncFunction: Scheduleable): void; /** Highlights critical issues. Shown inside a HTML table. */ fail(message: MarkdownString, file?: string, line?: number): void; /** Highlights low-priority issues. Shown inside a HTML table. */ warn(message: MarkdownString, file?: string, line?: number): void; /** Adds an info message to the Danger table. */ message(message: MarkdownString, file?: string, line?: number): void; /** Adds an info message with optional icon/file/line via options object. */ message(message: MarkdownString, opts?: { file?: string; line?: number; icon?: MarkdownString; }): void; /** Adds raw markdown into the Danger comment, under the table. */ markdown(message: MarkdownString, file?: string, line?: number): void; /** The root Danger object with all metadata. */ danger: DangerDSLType; /** The current results of a Danger run. */ results: DangerRuntimeContainer; } /** * Creates a Danger context. This provides all of the global functions * which are available to the Danger eval runtime. */ export declare function contextForDanger(dsl: DangerDSLType): DangerContext; /** * Run all scheduled async tasks from a Danger run. */ export declare function runAllScheduledTasks(results: DangerRuntimeContainer): Promise; //# sourceMappingURL=context.d.ts.map