UNPKG

@graphql-inspector/commands

Version:
35 lines (34 loc) 1.24 kB
import { CommandModule as Command } from 'yargs'; import { InspectorConfig } from '@graphql-inspector/config'; import { Loaders } from '@graphql-inspector/loaders'; export { Command }; export interface UseCommandsAPI { config: InspectorConfig; loaders: Loaders; } export type CommandFactory<T = {}, U = {}> = (api: Required<UseCommandsAPI>) => Command<T, U>; export declare function useCommands(api: UseCommandsAPI): Command[]; export declare function createCommand<T = {}, U = {}>(factory: CommandFactory<T, U>): CommandFactory<T, U>; export declare function ensureAbsolute(filepath: string, basepath?: string): string; export interface GlobalArgs { require?: string[]; token?: string; header?: string[]; leftHeader?: string[]; rightHeader?: string[]; federation?: boolean; federationV2?: boolean; aws?: boolean; method?: string; } export declare function parseGlobalArgs(args: GlobalArgs): { headers: Record<string, string>; leftHeaders: Record<string, string>; rightHeaders: Record<string, string>; token: string | undefined; }; export declare function mockCommand(mod: Command, cmd: string): Promise<{ [x: string]: unknown; _: (string | number)[]; $0: string; }>;