@types/react-relay
Advanced tools
Comparing version
@@ -16,8 +16,3 @@ import * as React from 'react'; | ||
export { | ||
FragmentRef, | ||
RelayPaginationProp, | ||
RelayProp, | ||
RelayRefetchProp, | ||
} from './ReactRelayTypes'; | ||
export { FragmentRef, RelayPaginationProp, RelayProp, RelayRefetchProp } from './ReactRelayTypes'; | ||
@@ -64,3 +59,3 @@ import { RelayProp, MappedFragmentProps, RelayRefetchProp, RelayPaginationProp } from './ReactRelayTypes'; | ||
} & QueryRendererProps<TOperation> | ||
> { } | ||
> {} | ||
export { ReactRelayQueryRenderer as QueryRenderer }; | ||
@@ -70,3 +65,3 @@ | ||
QueryRendererProps<TOperation> | ||
> { } | ||
> {} | ||
export { ReactRelayLocalQueryRenderer as LocalQueryRenderer }; | ||
@@ -85,3 +80,5 @@ | ||
export type RelayProps<Props> = ContainerProps<Props>; // TODO: validate this | ||
export type Container<Props> = React.ComponentType<ContainerProps<Props> & { componentRef?: ((ref: any) => void) | undefined }>; | ||
export type Container<Props> = React.ComponentType< | ||
ContainerProps<Props> & { componentRef?: ((ref: any) => void) | undefined } | ||
>; | ||
@@ -101,7 +98,9 @@ // TODO: validate the bellow three | ||
export function createFragmentContainer<Props>( | ||
Component: React.ComponentType<Props & { relay?: RelayProp | undefined }>, | ||
fragmentSpec: Record<string, GraphQLTaggedNode>, | ||
): Container<Props>; | ||
type PropsWithoutRelay<C extends keyof JSX.IntrinsicElements | React.JSXElementConstructor<any>> = | ||
JSX.LibraryManagedAttributes<C, Omit<React.ComponentProps<C>, 'relay'>>; | ||
export function createFragmentContainer< | ||
C extends React.ComponentType<React.ComponentProps<C> & { relay?: RelayProp | undefined }>, | ||
>(Component: C, fragmentSpec: Record<string, GraphQLTaggedNode>): Container<PropsWithoutRelay<C>>; | ||
export { fetchQuery_DEPRECATED } from 'relay-runtime'; | ||
@@ -113,21 +112,17 @@ | ||
export function createPaginationContainer<Props>( | ||
Component: React.ComponentType< | ||
Props & { | ||
relay: RelayPaginationProp; | ||
} | ||
>, | ||
export function createPaginationContainer< | ||
C extends React.ComponentType<React.ComponentProps<C> & { relay: RelayPaginationProp }>, | ||
>( | ||
Component: C, | ||
fragmentSpec: Record<string, GraphQLTaggedNode>, | ||
connectionConfig: ConnectionConfig<Props>, | ||
): Container<Props>; | ||
connectionConfig: ConnectionConfig<PropsWithoutRelay<C>>, | ||
): Container<PropsWithoutRelay<C>>; | ||
export function createRefetchContainer<Props>( | ||
Component: React.ComponentType< | ||
Props & { | ||
relay: RelayRefetchProp; | ||
} | ||
>, | ||
export function createRefetchContainer< | ||
C extends React.ComponentType<React.ComponentProps<C> & { relay: RelayRefetchProp }>, | ||
>( | ||
Component: C, | ||
fragmentSpec: Record<string, GraphQLTaggedNode>, | ||
refetchQuery: GraphQLTaggedNode, | ||
): Container<Props>; | ||
): Container<PropsWithoutRelay<C>>; | ||
@@ -134,0 +129,0 @@ export interface ConnectionConfig<Props = object> { |
{ | ||
"name": "@types/react-relay", | ||
"version": "13.0.0", | ||
"version": "13.0.1", | ||
"description": "TypeScript definitions for react-relay", | ||
@@ -36,4 +36,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-relay", | ||
}, | ||
"typesPublisherContentHash": "ddb772160e8a3e90ecc09195e707b7e230e8c750300e77e964c9e0fcdce0dbaf", | ||
"typesPublisherContentHash": "ee6b0f256e3a10281de4c2c6a4c6b70a4a1b475461d140db4976b87a8084e150", | ||
"typeScriptVersion": "3.8" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Mon, 10 Jan 2022 21:31:42 GMT | ||
* Last updated: Thu, 03 Feb 2022 03:01:27 GMT | ||
* Dependencies: [@types/relay-runtime](https://npmjs.com/package/@types/relay-runtime), [@types/react](https://npmjs.com/package/@types/react) | ||
@@ -14,0 +14,0 @@ * Global values: none |
42415
0.54%935
-0.64%