type ValuesOf = Target[keyof Target]; export declare const CachePolicy: { readonly CacheOrNetwork: "CacheOrNetwork"; readonly CacheOnly: "CacheOnly"; readonly NetworkOnly: "NetworkOnly"; readonly CacheAndNetwork: "CacheAndNetwork"; readonly NoCache: "NoCache"; }; export type CachePolicies = ValuesOf; export declare const DedupeMatchMode: { readonly Variables: "Variables"; readonly Operation: "Operation"; readonly None: "None"; }; export type DedupeMatchModes = ValuesOf; export declare const PaginateMode: { readonly Infinite: "Infinite"; readonly SinglePage: "SinglePage"; }; export type PaginateModes = ValuesOf; export * from '../router/types'; declare global { namespace App { interface Session { } interface Metadata { } interface Stuff { inputs: { init: boolean; marshaled: Record; changed: boolean; }; optimisticResponse?: GraphQLObject; parentID?: string; silenceLoading?: boolean; mutationID?: number; } } } export type RuntimeScalarResolver = (args: { session: App.Session; }) => any; export type Fragment<_Result> = { readonly shape?: _Result; }; export type Operation<_Result, _Input> = { readonly result: _Result; readonly input: _Input; }; export type Maybe = T | null | undefined; export type DocumentArtifact = FragmentArtifact | QueryArtifact | MutationArtifact | SubscriptionArtifact; export declare const ArtifactKind: { readonly Query: "HoudiniQuery"; readonly Subscription: "HoudiniSubscription"; readonly Mutation: "HoudiniMutation"; readonly Fragment: "HoudiniFragment"; }; export type ArtifactKinds = ValuesOf; export declare const CompiledFragmentKind: "HoudiniFragment"; export declare const CompiledMutationKind: "HoudiniMutation"; export declare const CompiledQueryKind: "HoudiniQuery"; export declare const CompiledSubscriptionKind: "HoudiniSubscription"; export type CompiledDocumentKind = ArtifactKinds; export type QueryArtifact = BaseCompiledDocument<'HoudiniQuery'> & { policy?: CachePolicies; partial?: boolean; enableLoadingState?: 'global' | 'local'; dedupe?: { cancel: 'first' | 'last'; match: DedupeMatchModes; }; }; export type MutationArtifact = BaseCompiledDocument<'HoudiniMutation'> & { optimisticKeys?: boolean; dedupe?: { cancel: 'first' | 'last'; match: DedupeMatchModes; }; }; export type FragmentArtifact = BaseCompiledDocument<'HoudiniFragment'> & { enableLoadingState?: 'global' | 'local'; }; export type SubscriptionArtifact = BaseCompiledDocument<'HoudiniSubscription'>; export declare const RefetchUpdateMode: { readonly append: "append"; readonly prepend: "prepend"; readonly replace: "replace"; }; export type RefetchUpdateModes = ValuesOf; export type InputObject = { fields: Record; types: Record>; defaults: Record; runtimeScalars: Record; }; export type BaseCompiledDocument<_Kind extends ArtifactKinds> = { name: string; kind: _Kind; raw: string; hash: string; selection: SubscriptionSelection; rootType: string; input?: InputObject; hasComponents?: boolean; stripVariables: Array; refetch?: { path: string[]; method: 'cursor' | 'offset'; pageSize: number; start?: string | number; embedded: boolean; targetType: string; paginated: boolean; direction: 'forward' | 'backward' | 'both'; mode: PaginateModes; }; pluginData: Record; }; export type HoudiniFetchContext = { variables: () => {}; }; type Filter = { [key: string]: string | boolean | number; }; export type ListWhen = { must?: Filter; must_not?: Filter; }; export declare const DataSource: { /** * from the browser cache */ readonly Cache: "cache"; /** * from a browser side `fetch` */ readonly Network: "network"; /** * from a server side `fetch` */ readonly Ssr: "ssr"; }; export type DataSources = ValuesOf; export type MutationOperation = { action: 'insert' | 'remove' | 'delete' | 'toggle'; list?: string; type?: string; parentID?: { kind: string; value: string; }; position?: 'first' | 'last'; target?: 'all'; when?: ListWhen; }; export type GraphQLObject = { [key: string]: GraphQLValue; }; export type GraphQLDefaultScalar = string | number | boolean; export type GraphQLValue = GraphQLDefaultScalar | null | GraphQLObject | GraphQLValue[] | undefined; export type GraphQLVariables = { [key: string]: any; } | null; export type LoadingSpec = { kind: 'continue'; list?: { depth: number; count: number; }; } | { kind: 'value'; value?: any; list?: { depth: number; count: number; }; }; export type SubscriptionSelection = { loadingTypes?: string[]; fragments?: Record; components?: Record; fields?: { [fieldName: string]: { type: string; keyRaw: string; nullable?: boolean; required?: boolean; operations?: MutationOperation[]; list?: { name: string; connection: boolean; type: string; }; loading?: LoadingSpec; directives?: { name: string; arguments: ValueMap; }[]; updates?: string[]; visible?: boolean; filters?: Record; selection?: SubscriptionSelection; abstract?: boolean; abstractHasRequired?: boolean; component?: { prop: string; key: string; fragment: string; variables: ValueMap | null; }; optimisticKey?: boolean; }; }; abstractFields?: { fields: { [typeName: string]: SubscriptionSelection['fields']; }; typeMap: { [typeName: string]: string; }; }; }; export type SubscriptionSpec = { rootType: string; selection: SubscriptionSelection; set: (data: any) => void; parentID?: string; variables?: () => any; }; export type FetchQueryResult<_Data> = { result: RequestPayload<_Data | null>; source: DataSources | null; }; export type QueryResult<_Data = GraphQLObject, _Input = GraphQLVariables> = { data: _Data | null; errors: { message: string; }[] | null; fetching: boolean; partial: boolean; stale: boolean; source: DataSources | null; variables: _Input | null; }; export type RequestPayload = { data: GraphQLObject | null; errors: { message: string; }[] | null; }; export type NestedList<_Result = string> = (_Result | null | NestedList<_Result>)[]; export type ValueOf = Parent[keyof Parent]; export declare const fragmentKey: " $fragments"; export type ValueNode = VariableNode | IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode; export type ValueMap = Record; export type FetchParams<_Input> = { variables?: _Input; /** * The policy to use when performing the fetch. If set to CachePolicy.NetworkOnly, * a request will always be sent, even if the variables are the same as the last call * to fetch. */ policy?: CachePolicies; /** * An object that will be passed to the fetch function. * You can do what you want with it! */ metadata?: App.Metadata; /** * An abort controller to abort the operation */ abortController?: AbortController; }; export type FetchFn<_Data extends GraphQLObject, _Input = any> = (params?: FetchParams<_Input>) => Promise>; export type CursorHandlers<_Data extends GraphQLObject, _Input> = { loadNextPage: (args?: { first?: number; after?: string; fetch?: typeof globalThis.fetch; metadata?: {}; }) => Promise>; loadPreviousPage: (args?: { last?: number; before?: string; fetch?: typeof globalThis.fetch; metadata?: {}; }) => Promise>; fetch(args?: FetchParams<_Input> | undefined): Promise>; }; export type OffsetHandlers<_Data extends GraphQLObject, _Input> = { loadNextPage: (args?: { limit?: number; offset?: number; metadata?: {}; fetch?: typeof globalThis.fetch; }) => Promise; fetch(args?: FetchParams<_Input> | undefined): Promise>; }; export type PageInfo = { startCursor: string | null; endCursor: string | null; hasNextPage: boolean; hasPreviousPage: boolean; }; interface IntValueNode { readonly kind: 'IntValue'; readonly value: string; } interface FloatValueNode { readonly kind: 'FloatValue'; readonly value: string; } interface StringValueNode { readonly kind: 'StringValue'; readonly value: string; } interface BooleanValueNode { readonly kind: 'BooleanValue'; readonly value: boolean; } interface NullValueNode { readonly kind: 'NullValue'; } interface EnumValueNode { readonly kind: 'EnumValue'; readonly value: string; } interface ListValueNode { readonly kind: 'ListValue'; readonly values: ReadonlyArray; } interface ObjectValueNode { readonly kind: 'ObjectValue'; readonly fields: ReadonlyArray; } interface ObjectFieldNode { readonly kind: 'ObjectField'; readonly name: NameNode; readonly value: ValueNode; } interface NameNode { readonly kind: 'Name'; readonly value: string; } interface VariableNode { readonly kind: 'Variable'; readonly name: NameNode; } export declare const PendingValue: unique symbol; export type LoadingType = typeof PendingValue; export declare function isPending(value: any): value is LoadingType; export type ProjectManifest = { /** All of the pages in the project */ pages: Record; /** All of the layouts in the project */ layouts: Record; /** All of the page queries in the project */ page_queries: Record; /** All of the layout queries in the project */ layout_queries: Record; /** All of the artifacts in the project */ artifacts: string[]; /** Whether or not there is a local schema defined */ local_schema: boolean; /** Whether or not there is a custom instance of yoga defined */ local_yoga: boolean; /** Information about componentFields defined in the project */ component_fields: Record; }; export type PageManifest = { id: string; /** the name of every query that the page depends on */ queries: string[]; /** the list of queries that this page could potentially ask for */ query_options: string[]; /** the full url pattern of the page */ url: string; /** the ids of layouts that wrap this page */ layouts: string[]; /** The filepath of the unit */ path: string; /** * The name and type of every route paramter that this page can use. * null indicates the type is unknown (not constrained by a query) **/ params: Record; }; export type QueryManifest = { /** the name of the query */ name: string; /** the url tied with the query */ url: string; /** wether the query uses the loading directive (ie, wants a fallback) */ loading: boolean; /** The filepath of the unit */ path: string; /** The name and GraphQL type for the variables that this query cares about */ variables: Record; };