Created
October 18, 2017 14:31
-
-
Save nodkz/bb38ee2b83454e7e81d1382903051c98 to your computer and use it in GitHub Desktop.
react-relay flowtype declaration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
declare class RelayComponentClass<Props> extends React$Component<Props, any> { | |
static getFragment: Function; | |
}; | |
declare type createFragmentContainer = <TBase>( | |
Component: Class<React$Component<TBase, any>> | (props: TBase) => React.Node, | |
fragmentSpec: any | |
) => Class<RelayComponentClass<TBase>>; | |
declare type GraphQLTaggedNode = | |
| (() => any) | |
| { modern: () => any, classic: any => any }; | |
declare type RelayModernGraphQLTag_graphql = (strings: Array<string>) => GraphQLTaggedNode; | |
declare module "react-relay/compat" { | |
declare module.exports: { | |
createFragmentContainer: createFragmentContainer, | |
graphql: RelayModernGraphQLTag_graphql, | |
commitMutation: Function, | |
} | |
} | |
declare module "react-relay" { | |
declare module.exports: { | |
createFragmentContainer: createFragmentContainer, | |
graphql: RelayModernGraphQLTag_graphql, | |
} | |
} | |
declare module "react-relay/classic" { | |
declare module.exports: { | |
QL: any, | |
createContainer: Function, // TODO need to check React props in legacy code or not? | |
Route: any, | |
Renderer: any, | |
Environment: any, | |
createQuery: any, | |
GraphQLMutation: any, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment