import type { TypedDocumentNode } from "@graphql-typed-document-node/core";
import type { DataMasking } from "@apollo/client";
import type { HKT } from "@apollo/client/utilities";
import type { IsAny, Prettify } from "@apollo/client/utilities/internal";
import type { ContainsFragmentsRefs, RemoveFragmentName, RemoveMaskedMarker, UnwrapFragmentRefs } from "./internal/types.js";
export declare namespace GraphQLCodegenDataMasking {
    export interface Implementation {
        Masked: HKTImplementation.Masked;
        MaskedDocumentNode: HKTImplementation.MaskedDocumentNode;
        FragmentType: HKTImplementation.FragmentType;
        MaybeMasked: HKTImplementation.MaybeMasked;
        Unmasked: HKTImplementation.Unmasked;
    }
    namespace HKTImplementation {
        interface Masked extends HKT {
            arg1: unknown;
            return: GraphQLCodegenDataMasking.Masked<this["arg1"]>;
        }
        interface MaskedDocumentNode extends HKT {
            arg1: unknown;
            arg2: unknown;
            return: GraphQLCodegenDataMasking.MaskedDocumentNode<this["arg1"], this["arg2"]>;
        }
        interface FragmentType extends HKT {
            arg1: unknown;
            return: GraphQLCodegenDataMasking.FragmentType<this["arg1"]>;
        }
        interface MaybeMasked extends HKT {
            arg1: unknown;
            return: GraphQLCodegenDataMasking.MaybeMasked<this["arg1"]>;
        }
        interface Unmasked extends HKT {
            arg1: unknown;
            return: GraphQLCodegenDataMasking.Unmasked<this["arg1"]>;
        }
    }
    /**
     * Marks a type as masked. This is used by `MaybeMasked` when determining
     * whether to use the masked or unmasked type.
     */
    export type Masked<TData> = TData & {
        __masked?: true;
    };
    /**
     * Marks a type as masked. This is a shortcut for
     * `TypedDocumentNode<Masked<TData>, TVariables>`
     */
    export type MaskedDocumentNode<TData = {
        [key: string]: any;
    }, TVariables = {
        [key: string]: any;
    }> = TypedDocumentNode<Masked<TData>, TVariables>;
    export type FragmentType<TData> = [
        TData
    ] extends [{
        " $fragmentName"?: infer TKey;
    }] ? TKey extends string ? {
        " $fragmentRefs"?: {
            [key in TKey]: TData;
        };
    } : never : never;
    /**
     * Returns TData as either masked or unmasked depending on whether masking is
     * enabled.
     */
    export type MaybeMasked<TData> = DataMasking extends {
        mode: "unmask";
    } ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
        __masked?: true;
    } ? Prettify<RemoveMaskedMarker<TData>> : Unmasked<TData> : never : DataMasking extends {
        mode: "preserveTypes";
    } ? TData : TData;
    /**
     * Unmasks a type to provide its full result.
     */
    export type Unmasked<TData> = true extends IsAny<TData> ? TData : TData extends object ? true extends ContainsFragmentsRefs<TData> ? UnwrapFragmentRefs<RemoveMaskedMarker<RemoveFragmentName<TData>>> : TData : TData;
    export {};
}
//# sourceMappingURL=GraphQLCodegenDataMasking.d.ts.map
