import * as React from "react"; import { _FragmentRefs, _RefType, CacheConfig, FetchPolicy, GraphQLTaggedNode, IEnvironment, OperationType, PageInfo, RelayContext, Variables, } from "relay-runtime"; export { FragmentRef, RelayPaginationProp, RelayProp, RelayRefetchProp } from "./ReactRelayTypes"; import { MappedFragmentProps, RelayPaginationProp, RelayProp, RelayRefetchProp } from "./ReactRelayTypes"; export { DataID, DeclarativeMutationConfig, Disposable, FetchPolicy, GraphQLTaggedNode, // RelayRuntime has two environment exports: one interface, one concrete. IEnvironment as Environment, MutationType, NormalizationSelector, OperationDescriptor, RangeOperation, ReaderSelector, RelayContext, Snapshot, Variables, } from "relay-runtime"; /** * Legacy react-relay exports. * Should prefer using interface defined in ./hooks.js */ export { ConnectionHandler } from "relay-runtime"; export interface QueryRendererProps { environment: IEnvironment; query: GraphQLTaggedNode | null | undefined; render: (renderProps: { error: Error | null; props: TOperation["response"] | null; retry: (() => void) | null; }) => React.ReactNode; variables: TOperation["variables"]; } declare class ReactRelayQueryRenderer extends React.Component< { cacheConfig?: CacheConfig | null | undefined; fetchPolicy?: FetchPolicy | undefined; } & QueryRendererProps > {} export { ReactRelayQueryRenderer as QueryRenderer }; declare class ReactRelayLocalQueryRenderer extends React.Component< QueryRendererProps > {} export { ReactRelayLocalQueryRenderer as LocalQueryRenderer }; export { MutationTypes } from "relay-runtime"; export { RangeOperations } from "relay-runtime"; export const ReactRelayContext: React.Context; export { applyOptimisticMutation } from "relay-runtime"; export { commitLocalUpdate } from "relay-runtime"; export { commitMutation } from "relay-runtime"; export type ContainerProps = MappedFragmentProps>>; export type RelayProps = ContainerProps; // TODO: validate this export type Container = React.ComponentType< ContainerProps & { componentRef?: ((ref: any) => void) | undefined } >; // TODO: validate the bellow three export type RelayFragmentContainer = React.ComponentType< ContainerProps> >; export type RelayPaginationContainer = React.ComponentType< ContainerProps> >; export type RelayRefetchContainer = React.ComponentType< ContainerProps> >; type PropsWithoutRelay> = React.JSX.LibraryManagedAttributes, "relay">>; export function createFragmentContainer< C extends React.ComponentType & { relay?: RelayProp | undefined }>, >(Component: C, fragmentSpec: Record): Container>; export { fetchQuery_DEPRECATED } from "relay-runtime"; export { graphql } from "relay-runtime"; export { readInlineData } from "relay-runtime"; export { requestSubscription } from "relay-runtime"; export function createPaginationContainer< C extends React.ComponentType & { relay: RelayPaginationProp }>, >( Component: C, fragmentSpec: Record, connectionConfig: ConnectionConfig>, ): Container>; export function createRefetchContainer< C extends React.ComponentType & { relay: RelayRefetchProp }>, >( Component: C, fragmentSpec: Record, refetchQuery: GraphQLTaggedNode, ): Container>; export interface ConnectionConfig { direction?: "backward" | "forward" | undefined; getConnectionFromProps?: ((props: Props) => ConnectionData | null | undefined) | undefined; getFragmentVariables?: ((prevVars: Variables, totalCount: number) => Variables) | undefined; getVariables: ( props: Props, paginationInfo: { count: number; cursor?: string | null | undefined }, fragmentVariables: Variables, ) => Variables; query: GraphQLTaggedNode; } interface ConnectionData { edges?: readonly any[] | null | undefined; pageInfo?: Partial | null | undefined; }