Back to Apollo Client

Api Report React Internal.Api

.api-reports/api-report-react_internal.api.md

3.14.111.0 KB
Original Source

API Report File for "@apollo/client"

Do not edit this file. It is a report generated by API Extractor.

ts

import type { ApolloClient } from '@apollo/client';
import type { DataState } from '@apollo/client';
import type { DecoratedPromise } from '@apollo/client/utilities/internal';
import type { DocumentNode } from 'graphql';
import type { DocumentTypeDecoration } from '@graphql-typed-document-node/core';
import type { InternalTypes } from '@apollo/client/react';
import type { MaybeMasked } from '@apollo/client/masking';
import type { MaybeMasked as MaybeMasked_2 } from '@apollo/client';
import type { ObservableQuery } from '@apollo/client';
import type { OperationVariables } from '@apollo/client';
import type { ResultOf } from '@graphql-typed-document-node/core';
import type { VariablesOf } from '@graphql-typed-document-node/core';

// Warning: (ae-forgotten-export) The symbol "WrappedQueryRef" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export function assertWrappedQueryRef<TData, TVariables extends OperationVariables, TStates extends DataState<TData>["dataState"]>(queryRef: QueryRef<TData, TVariables, TStates>): asserts queryRef is WrappedQueryRef<TData, TVariables, TStates>;

// @public (undocumented)
export function assertWrappedQueryRef<TData, TVariables extends OperationVariables, TStates extends DataState<TData>["dataState"]>(queryRef: QueryRef<TData, TVariables, TStates> | undefined | null): asserts queryRef is WrappedQueryRef<TData, TVariables, TStates> | undefined | null;

// @public (undocumented)
export type CacheKey = [
query: DocumentNode,
stringifiedVariables: string,
...queryKey: any[]
];

// @public (undocumented)
export type FetchMoreFunction<TData, TVariables extends OperationVariables> = <TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: ObservableQuery.FetchMoreOptions<TData, TVariables, TFetchData, TFetchVars>) => Promise<ApolloClient.QueryResult<MaybeMasked_2<TData>>>;

// @public (undocumented)
type FragmentCacheKey = [
fragment: DocumentNode,
stringifiedVariables: string,
cacheId: string | null
];

// @public (undocumented)
export interface FragmentKey {
    // (undocumented)
    __fragmentKey?: string;
}

// @public (undocumented)
class FragmentReference<TData = unknown, TVariables extends OperationVariables = OperationVariables> {
    // Warning: (ae-forgotten-export) The symbol "FragmentReferenceOptions" needs to be exported by the entry point index.d.ts
    constructor(client: ApolloClient, watchFragmentOptions: ApolloClient.WatchFragmentOptions<TData, TVariables> & {
        from: string | null | Array<string | null>;
    }, options: FragmentReferenceOptions);
    // (undocumented)
    readonly key: FragmentKey;
    // Warning: (ae-forgotten-export) The symbol "Listener_2" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    listen(listener: Listener_2<MaybeMasked<TData>>): () => void;
    // (undocumented)
    readonly observable: ApolloClient.ObservableFragment<TData | null>;
    // Warning: (ae-forgotten-export) The symbol "FragmentRefPromise" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    promise: FragmentRefPromise<MaybeMasked<TData>>;
    // (undocumented)
    retain(): () => void;
}

// @public (undocumented)
interface FragmentReferenceOptions {
    // (undocumented)
    autoDisposeTimeoutMs?: number;
    // (undocumented)
    onDispose?: () => void;
}

// @public (undocumented)
type FragmentRefPromise<TData> = DecoratedPromise<TData>;

// Warning: (ae-forgotten-export) The symbol "SuspenseCache" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export function getSuspenseCache(client: ApolloClient & {
    [suspenseCacheSymbol]?: SuspenseCache;
}): SuspenseCache;

// Warning: (ae-forgotten-export) The symbol "QueryRefPromise" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export function getWrappedPromise<TData, TStates extends DataState<TData>["dataState"]>(queryRef: WrappedQueryRef<TData, any, TStates>): QueryRefPromise<TData, TStates>;

// @public (undocumented)
export type HookWrappers = InternalTypes.HookWrappers;

// @public (undocumented)
export class InternalQueryReference<TData = unknown, TStates extends DataState<TData>["dataState"] = DataState<TData>["dataState"]> {
    // Warning: (ae-forgotten-export) The symbol "InternalQueryReferenceOptions" needs to be exported by the entry point index.d.ts
    constructor(observable: ObservableQuery<TData, any>, options: InternalQueryReferenceOptions);
    // (undocumented)
    applyOptions(watchQueryOptions: ObservedOptions): QueryRefPromise<TData, TStates>;
    // Warning: (ae-forgotten-export) The symbol "ObservedOptions" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    didChangeOptions(watchQueryOptions: ObservedOptions): boolean;
    // (undocumented)
    get disposed(): boolean;
    // (undocumented)
    fetchMore(options: ObservableQuery.FetchMoreOptions<TData, any, any, any>): Promise<ApolloClient.QueryResult<TData>>;
    // (undocumented)
    readonly key: QueryKey;
    // Warning: (ae-forgotten-export) The symbol "Listener" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    listen(listener: Listener<TData, TStates>): () => void;
    // (undocumented)
    readonly observable: ObservableQuery<TData>;
    // (undocumented)
    promise: QueryRefPromise<TData, TStates>;
    // (undocumented)
    refetch(variables: OperationVariables | undefined): Promise<ApolloClient.QueryResult<TData>>;
    // (undocumented)
    reinitialize(): void;
    // (undocumented)
    result: ObservableQuery.Result<MaybeMasked<TData>, TStates>;
    // (undocumented)
    retain(): () => void;
    // (undocumented)
    softRetain(): () => void;
    // (undocumented)
    get watchQueryOptions(): ObservableQuery.Options<TData, OperationVariables>;
}

// @public (undocumented)
interface InternalQueryReferenceOptions {
    // (undocumented)
    autoDisposeTimeoutMs?: number;
    // (undocumented)
    onDispose?: () => void;
}

// @public (undocumented)
type Listener<TData, TStates extends DataState<TData>["dataState"]> = (promise: QueryRefPromise<TData, TStates>) => void;

// @public (undocumented)
type Listener_2<TData> = (promise: FragmentRefPromise<TData>) => void;

// @public (undocumented)
const OBSERVED_CHANGED_OPTIONS: readonly ["context", "errorPolicy", "fetchPolicy", "refetchWritePolicy", "returnPartialData"];

// Warning: (ae-forgotten-export) The symbol "OBSERVED_CHANGED_OPTIONS" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type ObservedOptions = Pick<ApolloClient.WatchQueryOptions, (typeof OBSERVED_CHANGED_OPTIONS)[number]>;

// @public (undocumented)
const PRELOADED_QUERY_REF_BRAND: unique symbol;

// @public
export interface PreloadedQueryRef<TData = unknown, TVariables extends OperationVariables = OperationVariables, TStates extends DataState<TData>["dataState"] = "complete" | "streaming"> extends QueryRef<TData, TVariables, TStates> {
    // @internal @deprecated (undocumented)
    [PRELOADED_QUERY_REF_BRAND]: typeof PRELOADED_QUERY_REF_BRAND;
}

// @public (undocumented)
const PROMISE_SYMBOL: unique symbol;

// @public (undocumented)
const QUERY_REF_BRAND: unique symbol;

// @public (undocumented)
const QUERY_REFERENCE_SYMBOL: unique symbol;

// @public (undocumented)
export interface QueryKey {
    // (undocumented)
    __queryKey?: string;
}

// @public
export interface QueryRef<TData = unknown, TVariables extends OperationVariables = OperationVariables, TStates extends DataState<TData>["dataState"] = "complete" | "streaming"> {
    // @internal @deprecated (undocumented)
    [QUERY_REF_BRAND]?(variables: TVariables): {
        data: TData;
        states: TStates;
    };
}

// @public (undocumented)
export namespace QueryRef {
    // (undocumented)
    export type ForQuery<Document extends DocumentTypeDecoration<any, any>, TStates extends DataState<ResultOf<Document>>["dataState"] = "complete" | "streaming"> = QueryRef<ResultOf<Document>, VariablesOf<Document>, TStates>;
}

// @public (undocumented)
type QueryRefPromise<TData, TStates extends DataState<TData>["dataState"]> = DecoratedPromise<ObservableQuery.Result<MaybeMasked<TData>, TStates>>;

// @public (undocumented)
export type RefetchFunction<TData, TVariables extends OperationVariables> = (variables?: Partial<TVariables>) => Promise<ApolloClient.QueryResult<TData>>;

// @public (undocumented)
class SuspenseCache {
    constructor(options?: SuspenseCacheOptions);
    // (undocumented)
    add(cacheKey: CacheKey, queryRef: InternalQueryReference<any, any>): void;
    // Warning: (ae-forgotten-export) The symbol "FragmentCacheKey" needs to be exported by the entry point index.d.ts
    // Warning: (ae-forgotten-export) The symbol "FragmentReference" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    getFragmentRef<TData, TVariables extends OperationVariables>(cacheKey: FragmentCacheKey, client: ApolloClient, options: ApolloClient.WatchFragmentOptions<TData, TVariables> & {
        from: string | null | Array<string | null>;
    }): FragmentReference<TData, TVariables>;
    // (undocumented)
    getQueryRef<TData = unknown, TStates extends DataState<TData>["dataState"] = DataState<TData>["dataState"]>(cacheKey: CacheKey, createObservable: () => ObservableQuery<TData>): InternalQueryReference<TData, TStates>;
}

// @public (undocumented)
export interface SuspenseCacheOptions {
    autoDisposeTimeoutMs?: number;
}

// @public (undocumented)
const suspenseCacheSymbol: unique symbol;

// @public (undocumented)
export function unwrapQueryRef<TData, TStates extends DataState<TData>["dataState"]>(queryRef: WrappedQueryRef<TData, any, TStates>): InternalQueryReference<TData, TStates>;

// @public (undocumented)
export function unwrapQueryRef<TData, TStates extends DataState<TData>["dataState"]>(queryRef: Partial<WrappedQueryRef<TData, any, TStates>>): undefined | InternalQueryReference<TData, TStates>;

// @public (undocumented)
export function updateWrappedQueryRef<TData, TStates extends DataState<TData>["dataState"]>(queryRef: WrappedQueryRef<TData, any, TStates>, promise: QueryRefPromise<TData, TStates>): void;

// @internal @deprecated
interface WrappedQueryRef<TData = unknown, TVariables extends OperationVariables = OperationVariables, TStates extends DataState<TData>["dataState"] = "complete" | "streaming"> extends QueryRef<TData, TVariables, TStates> {
    // @deprecated (undocumented)
    [PROMISE_SYMBOL]: QueryRefPromise<TData, TStates>;
    // @deprecated (undocumented)
    readonly [QUERY_REFERENCE_SYMBOL]: InternalQueryReference<TData, TStates>;
}

// @public (undocumented)
export const wrapperSymbol: unique symbol;

// @public (undocumented)
export function wrapQueryRef<TData, TVariables extends OperationVariables, TStates extends DataState<TData>["dataState"]>(internalQueryRef: InternalQueryReference<TData, TStates>): WrappedQueryRef<TData, TVariables, TStates>;

// (No @packageDocumentation comment for this package)