@types/react-relay
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -120,3 +120,3 @@ import * as React from "react"; | ||
export function createContainer<T>( | ||
component: React.ComponentClass<T> | React.StatelessComponent<T>, | ||
component: React.ComponentType<T>, | ||
params?: CreateContainerOpts | ||
@@ -123,0 +123,0 @@ ): RelayContainerClass<T>; |
@@ -1,11 +0,8 @@ | ||
export { | ||
QueryRenderer, | ||
fetchQuery, | ||
graphql, | ||
} from "./index"; | ||
export { QueryRenderer, fetchQuery, graphql } from "./index"; | ||
import { | ||
ConnectionConfig, | ||
RelayPaginationProp as RelayModernPaginationProp, | ||
RelayRefetchProp as RelayModernRefetchProp | ||
RelayRefetchProp as RelayModernRefetchProp, | ||
} from "./index"; | ||
export { ConcreteFragment, ConcreteRequest, ConcreteBatchRequest } from "relay-runtime"; | ||
import * as RelayRuntimeTypes from "relay-runtime"; | ||
@@ -17,4 +14,2 @@ import { RelayEnvironmentInterface } from "./classic"; | ||
// ~~~~~~~~~~~~~~~~~~~~~ | ||
export type ConcreteFragment = any; | ||
export type ConcreteBatch = any; | ||
export type ConcreteFragmentDefinition = object; | ||
@@ -34,3 +29,2 @@ export type ConcreteOperationDefinition = object; | ||
export type ReactFragmentComponent<T> = ComponentWithFragment<T> | StatelessWithFragment<T>; | ||
export type ReactBaseComponent<T> = React.ComponentClass<T> | React.StatelessComponent<T>; | ||
export type RelayClassicEnvironment = RelayEnvironmentInterface; | ||
@@ -73,3 +67,3 @@ | ||
export function createFragmentContainer<T>( | ||
Component: ReactBaseComponent<T>, | ||
Component: React.ComponentType<T>, | ||
fragmentSpec: RelayRuntimeTypes.GraphQLTaggedNode | GeneratedNodeMap | ||
@@ -79,3 +73,3 @@ ): ReactFragmentComponent<T>; | ||
export function createRefetchContainer<T>( | ||
Component: ReactBaseComponent<T>, | ||
Component: React.ComponentType<T>, | ||
fragmentSpec: RelayRuntimeTypes.GraphQLTaggedNode | GeneratedNodeMap, | ||
@@ -86,3 +80,3 @@ taggedNode: RelayRuntimeTypes.GraphQLTaggedNode | ||
export function createPaginationContainer<T>( | ||
Component: ReactBaseComponent<T>, | ||
Component: React.ComponentType<T>, | ||
fragmentSpec: RelayRuntimeTypes.GraphQLTaggedNode | GeneratedNodeMap, | ||
@@ -89,0 +83,0 @@ connectionConfig: ConnectionConfig<T> |
@@ -14,2 +14,3 @@ // Type definitions for react-relay 1.3 | ||
fetchRelayModernQuery as fetchQuery, | ||
GraphQLTaggedNode, | ||
requestRelaySubscription as requestSubscription, | ||
@@ -22,9 +23,24 @@ } from "relay-runtime"; | ||
// ~~~~~~~~~~~~~~~~~~~~~ | ||
// Utility types | ||
// ~~~~~~~~~~~~~~~~~~~~~ | ||
// Taken from https://github.com/pelotom/type-zoo | ||
// tslint:disable-next-line:strict-export-declare-modifiers | ||
type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; | ||
// tslint:disable-next-line:strict-export-declare-modifiers | ||
type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>; | ||
export type RemoveRelayProp<P> = Omit<P & { relay: never }, "relay">; | ||
export interface ComponentRef { | ||
componentRef?: (ref: any) => void; | ||
} | ||
export type RelayContainer<T> = React.ComponentType<RemoveRelayProp<T> & ComponentRef>; | ||
// ~~~~~~~~~~~~~~~~~~~~~ | ||
// Maybe Fix | ||
// ~~~~~~~~~~~~~~~~~~~~~ | ||
export type ConcreteFragment = any; | ||
export type ConcreteBatch = any; | ||
export type ConcreteFragmentDefinition = object; | ||
export type ConcreteOperationDefinition = object; | ||
export type ReactBaseComponent<T> = React.ComponentClass<T> | React.StatelessComponent<T>; | ||
@@ -45,13 +61,8 @@ // ~~~~~~~~~~~~~~~~~~~~~ | ||
// ~~~~~~~~~~~~~~~~~~~~~ | ||
// RelayModernGraphQLTag | ||
// ReactRelayTypes | ||
// ~~~~~~~~~~~~~~~~~~~~~ | ||
export interface GeneratedNodeMap { | ||
[key: string]: GraphQLTaggedNode; | ||
[key: string]: RelayRuntimeTypes.GraphQLTaggedNode; | ||
} | ||
export type GraphQLTaggedNode = | ||
| (() => ConcreteFragment | ConcreteBatch) | ||
| { | ||
modern(): ConcreteFragment | ConcreteBatch; | ||
classic(relayQL: typeof RelayQL): ConcreteFragmentDefinition | ConcreteOperationDefinition; | ||
}; | ||
/** | ||
@@ -62,4 +73,4 @@ * Runtime function to correspond to the `graphql` tagged template function. | ||
export interface GraphqlInterface { | ||
(strings: string[] | TemplateStringsArray): GraphQLTaggedNode; | ||
experimental(strings: string[] | TemplateStringsArray): GraphQLTaggedNode; | ||
(strings: string[] | TemplateStringsArray): RelayRuntimeTypes.GraphQLTaggedNode; | ||
experimental(strings: string[] | TemplateStringsArray): RelayRuntimeTypes.GraphQLTaggedNode; | ||
} | ||
@@ -74,3 +85,3 @@ export const graphql: GraphqlInterface; | ||
environment: RelayRuntimeTypes.Environment; | ||
query: GraphQLTaggedNode; | ||
query: RelayRuntimeTypes.GraphQLTaggedNode; | ||
render(readyState: ReadyState): React.ReactElement<any> | undefined | null; | ||
@@ -95,5 +106,5 @@ variables: RelayRuntimeTypes.Variables; | ||
export function createFragmentContainer<T>( | ||
Component: ReactBaseComponent<T>, | ||
fragmentSpec: GraphQLTaggedNode | GeneratedNodeMap | ||
): ReactBaseComponent<T>; | ||
Component: React.ComponentType<T>, | ||
fragmentSpec: RelayRuntimeTypes.GraphQLTaggedNode | GeneratedNodeMap | ||
): RelayContainer<T>; | ||
@@ -140,12 +151,12 @@ // ~~~~~~~~~~~~~~~~~~~~~ | ||
): RelayRuntimeTypes.Variables; | ||
query: GraphQLTaggedNode; | ||
query: RelayRuntimeTypes.GraphQLTaggedNode; | ||
} | ||
export function createPaginationContainer<T>( | ||
Component: ReactBaseComponent<T>, | ||
fragmentSpec: GraphQLTaggedNode | GeneratedNodeMap, | ||
Component: React.ComponentType<T>, | ||
fragmentSpec: RelayRuntimeTypes.GraphQLTaggedNode | GeneratedNodeMap, | ||
connectionConfig: ConnectionConfig<T> | ||
): ReactBaseComponent<T>; | ||
): RelayContainer<T>; | ||
// ~~~~~~~~~~~~~~~~~~~~~ | ||
// createFragmentContainer | ||
// createRefetchContainer | ||
// ~~~~~~~~~~~~~~~~~~~~~ | ||
@@ -167,5 +178,5 @@ export interface RefetchOptions { | ||
export function createRefetchContainer<T>( | ||
Component: ReactBaseComponent<T>, | ||
fragmentSpec: GraphQLTaggedNode | GeneratedNodeMap, | ||
taggedNode: GraphQLTaggedNode | ||
): ReactBaseComponent<T>; | ||
Component: React.ComponentType<T>, | ||
fragmentSpec: RelayRuntimeTypes.GraphQLTaggedNode | GeneratedNodeMap, | ||
taggedNode: RelayRuntimeTypes.GraphQLTaggedNode | ||
): RelayContainer<T>; |
{ | ||
"name": "@types/react-relay", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "TypeScript definitions for react-relay", | ||
@@ -35,7 +35,7 @@ "license": "MIT", | ||
"dependencies": { | ||
"@types/react": "*", | ||
"@types/relay-runtime": "*" | ||
"@types/relay-runtime": "*", | ||
"@types/react": "*" | ||
}, | ||
"typesPublisherContentHash": "71adff5a28775e7d5258ce6e77bd8e473cb3b3e7cd5974ff6eb5f97c93bf2d3c", | ||
"typesPublisherContentHash": "4668127923b884f67be8cc0775403195109f69c912129946bc4f2bbe8b3cfd1c", | ||
"typeScriptVersion": "2.4" | ||
} |
@@ -11,4 +11,4 @@ # Installation | ||
Additional Details | ||
* Last updated: Thu, 01 Feb 2018 18:55:42 GMT | ||
* Dependencies: react, relay-runtime | ||
* Last updated: Tue, 06 Feb 2018 20:15:32 GMT | ||
* Dependencies: relay-runtime, react | ||
* Global values: none | ||
@@ -15,0 +15,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19516
425