import type { NormalizedKeyMetadata } from './interfaces/queryability'; import type { Reader } from './Reader'; export type SelectionKind = 'Link' | 'Scalar' | 'Fragment' | 'Custom'; export type SelectionPropertyKey = Exclude; interface OpaqueSelection { opaque?: boolean; } interface MapSelection { map?: boolean; } interface PluralSelection { plural?: boolean; } interface NullableSelection { nullable?: boolean; } export interface ObjectUnionSelection extends NullableSelection { name: string; kind: 'Object'; union: true; discriminator: string; unionSelections: { [key: string]: FragmentSelection; }; } export declare function isUnionObjectSelection(sel: PathSelection | Fragment): sel is ObjectUnionSelection; export interface ScalarSelection extends PluralSelection, MapSelection { kind: 'Scalar'; name: string; required?: false; } export interface ObjectSelection extends OpaqueSelection, NullableSelection, PluralSelection, MapSelection { kind: 'Object'; name: string; private?: string[]; required?: false; selections?: PathSelection[]; supportsMissingMarker?: boolean; } export interface LinkSelection extends OpaqueSelection, NullableSelection, PluralSelection, MapSelection { name: string; kind: 'Link'; fragment: Fragment; required?: false; } export type PathSelection = LinkSelection | ObjectSelection | ScalarSelection | ObjectUnionSelection; export interface FragmentUnionSelection { kind: 'Fragment'; union: true; discriminator: string; unionSelections: { [key: string]: FragmentSelection; }; } export interface FragmentSelection extends OpaqueSelection { kind: 'Fragment'; private: string[]; version: string; selections: PathSelection[]; } export interface BaseFragment extends OpaqueSelection { kind: 'Fragment'; private: string[]; version?: string; selections?: PathSelection[]; } interface SyntheticReaderFragment { synthetic: true; read: (reader: Reader) => any; } interface ConcreteReaderFragment { synthetic: false; version: string; read: (source: any, reader: Reader) => any; } export type ReaderFragment = { kind: 'Fragment'; reader: true; } & (ConcreteReaderFragment | SyntheticReaderFragment); export declare function isReaderFragment(fragment: Fragment): fragment is ReaderFragment; export declare function isFragmentUnionSelection(sel: Fragment): sel is FragmentUnionSelection; export type Fragment = FragmentSelection | BaseFragment | FragmentUnionSelection | ReaderFragment; export interface Selector { recordId: string | NormalizedKeyMetadata; node: Fragment; variables: V; } export {};