UNPKG

1.16 kBTypeScriptView Raw
1import { NormalizedEnvironment, SchemaPointer, Endpoint } from './config';
2import * as probot from 'probot';
3import { Source } from 'graphql';
4declare type FileLoaderConfig = {
5 context: probot.Context;
6 owner: string;
7 repo: string;
8 action: string;
9 release: string;
10};
11interface FileLoaderInput {
12 path: string;
13 ref: string;
14 alias: string;
15 throwNotFound?: boolean;
16 onError?: (error: any) => void;
17}
18export declare type FileLoader = (input: FileLoaderInput) => Promise<string | null>;
19export declare type ConfigLoader = () => Promise<object | null | undefined>;
20export declare function createFileLoader(config: FileLoaderConfig): FileLoader;
21export declare function createConfigLoader(config: FileLoaderConfig & {
22 ref: string;
23}, loadFile: FileLoader): ConfigLoader;
24export declare function printSchemaFromEndpoint(endpoint: Endpoint): Promise<string>;
25export declare function loadSources({ config, oldPointer, newPointer, loadFile, }: {
26 config: NormalizedEnvironment;
27 oldPointer: SchemaPointer;
28 newPointer: SchemaPointer;
29 loadFile: FileLoader;
30}): Promise<{
31 old: Source;
32 new: Source;
33}>;
34export {};