import { SubschemaConfig } from '@graphql-tools/delegate';
import { GraphQLSchema, GraphQLDirective } from 'graphql';

interface PropertyTree {
    [property: string]: null | PropertyTree;
}
interface ParsedMergeArgsExpr {
    args: Record<string, any>;
    usedProperties: PropertyTree;
    mappingInstructions?: Array<MappingInstruction>;
    expansions?: Array<Expansion>;
}
interface MappingInstruction {
    destinationPath: Array<string>;
    sourcePath: Array<string>;
}
interface Expansion {
    valuePath: Array<string>;
    value: any;
    mappingInstructions: Array<MappingInstruction>;
}
type VariablePaths = Record<string, Array<string | number>>;
interface StitchingDirectivesOptions {
    keyDirectiveName?: string;
    computedDirectiveName?: string;
    mergeDirectiveName?: string;
    canonicalDirectiveName?: string;
    pathToDirectivesInExtensions?: Array<string>;
}
type Complete<T> = {
    [P in keyof Required<T>]: Exclude<Pick<T, P> extends Required<Pick<T, P>> ? T[P] : T[P] | undefined, undefined>;
};
type StitchingDirectivesFinalOptions = Complete<StitchingDirectivesOptions>;
interface MergedTypeResolverInfo extends ParsedMergeArgsExpr {
    fieldName: string;
    returnsList: boolean;
}

interface StitchingDirectivesResult {
    keyDirectiveTypeDefs: string;
    computedDirectiveTypeDefs: string;
    mergeDirectiveTypeDefs: string;
    canonicalDirectiveTypeDefs: string;
    stitchingDirectivesTypeDefs: string;
    allStitchingDirectivesTypeDefs: string;
    stitchingDirectivesValidator: (schema: GraphQLSchema) => GraphQLSchema;
    stitchingDirectivesTransformer: (subschemaConfig: SubschemaConfig) => SubschemaConfig;
    keyDirective: GraphQLDirective;
    computedDirective: GraphQLDirective;
    mergeDirective: GraphQLDirective;
    canonicalDirective: GraphQLDirective;
    allStitchingDirectives: Array<GraphQLDirective>;
}
declare function stitchingDirectives(options?: StitchingDirectivesOptions): StitchingDirectivesResult;

declare function federationToStitchingSDL(federationSDL: string, stitchingConfig?: StitchingDirectivesResult): string;

export { type Expansion, type MappingInstruction, type MergedTypeResolverInfo, type ParsedMergeArgsExpr, type PropertyTree, type StitchingDirectivesFinalOptions, type StitchingDirectivesOptions, type StitchingDirectivesResult, type VariablePaths, federationToStitchingSDL, stitchingDirectives };
