import { ErrorResult as GraphQLErrorResultShop } from '@subit/common/lib/generated-shop-types'; import { ErrorResult as GraphQLErrorResultAdmin } from '@subit/common/lib/generated-types'; import { VendureEntity } from '../../entity/base/base.entity'; export declare type GraphQLErrorResult = GraphQLErrorResultShop | GraphQLErrorResultAdmin; /** * @description * Takes an ErrorResult union type (i.e. a generated union type consisting of some query/mutation result * plus one or more ErrorResult types) and returns a union of _just_ the ErrorResult types. * * @example * ```TypeScript * type UpdateOrderItemsResult = Order | OrderModificationError | OrderLimitError | NegativeQuantityError; * * type T1 = JustErrorResults; * // T1 = OrderModificationError | OrderLimitError | NegativeQuantityError * ``` */ export declare type JustErrorResults = Exclude; /** * @description * Used to construct a TypeScript return type for a query or mutation which, in the GraphQL schema, * returns a union type composed of a success result (e.g. Order) plus one or more ErrorResult * types. * * Since the TypeScript entities do not correspond 1-to-1 with their GraphQL type counterparts, * we use this type to substitute them. * * @example * ```TypeScript * type UpdateOrderItemsResult = Order | OrderModificationError | OrderLimitError | NegativeQuantityError; * type T1 = ErrorResultUnion; * // T1 = VendureEntityOrder | OrderModificationError | OrderLimitError | NegativeQuantityError; */ export declare type ErrorResultUnion = JustErrorResults | E; /** * @description * Returns true if the ErrorResultUnion is actually an ErrorResult type. */ export declare function isGraphQlErrorResult(input: T): input is JustErrorResults;