import { ExtractProjectionResult } from "./projection-types"; import { QueryConfig } from "./query-config"; import { Simplify } from "./utils"; export declare type FragmentMetadataKeys = typeof BaseType | typeof Config; declare const BaseType: unique symbol; declare const Config: unique symbol; /** * This is used to capture metadata for the fragment's base types, * to be extracted later by `InferFragmentType` */ type FragmentBaseType = { readonly [BaseType]?: TFragmentInput; readonly [Config]?: TQueryConfig; }; /** * A Fragment is an object that can be used in a projection. */ export type Fragment = FragmentBaseType & TProjectionMap; /** * Infers the result types of a fragment. * @example * const productFragment = q.fragment().project({ * name: z.string(), * price: z.number(), * }); * * type ProductFragment = InferFragmentType; */ export type InferFragmentType> = TFragment extends Fragment ? Simplify> : never; export {};