UNPKG

1.17 kBTypeScriptView Raw
1import { Env, CISource } from "./ci_source";
2/**
3 * Gets a CI Source from the current environment, by asking all known
4 * sources if they can be represented in this environment.
5 * @param {Env} env The environment.
6 * @returns {?CISource} a CI source if it's OK, otherwise Danger can't run.
7 */
8export declare function getCISourceForEnv(env: Env): CISource | undefined;
9/**
10 * Gets a CI Source from externally provided provider module.
11 * Module must implement CISource interface, and should export it as default
12 * @export
13 * @param {Env} env The environment.
14 * @param {string} modulePath relative path to CI provider
15 * @returns {Promise<?CISource>} a CI source if module loaded successfully, undefined otherwise
16 */
17export declare function getCISourceForExternal(env: Env, modulePath: string): Promise<CISource | undefined>;
18/**
19 * Gets a CI Source.
20 * @export
21 * @param {Env} env The environment.
22 * @param {string} modulePath relative path to CI provider
23 * @returns {Promise<?CISource>} a CI source if module loaded successfully, undefined otherwise
24 */
25export declare function getCISource(env: Env, modulePath: string | undefined): Promise<CISource | undefined>;