1 | import { BuildSchemaOptions, DocumentNode, GraphQLSchema } from 'graphql';
|
2 | import { GraphQLParseOptions } from './Interfaces.js';
|
3 | export interface Source {
|
4 | document?: DocumentNode;
|
5 | schema?: GraphQLSchema;
|
6 | rawSDL?: string;
|
7 | location?: string;
|
8 | }
|
9 | export type BaseLoaderOptions = GraphQLParseOptions & BuildSchemaOptions & {
|
10 | cwd?: string;
|
11 | ignore?: string | string[];
|
12 | includeSources?: boolean;
|
13 | };
|
14 | export type WithList<T> = T | T[];
|
15 | export type ElementOf<TList> = TList extends Array<infer TElement> ? TElement : never;
|
16 | export interface Loader<TOptions extends BaseLoaderOptions = BaseLoaderOptions> {
|
17 | load(pointer: string, options?: TOptions): Promise<Source[] | null | never>;
|
18 | loadSync?(pointer: string, options?: TOptions): Source[] | null | never;
|
19 | }
|