Guest User

Untitled

a guest
Oct 19th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. import * as React from "react";
  2. declare class RelayComponentClass<Props> extends React$Component<Props, any> {
  3. static getFragment: Function;
  4. };
  5.  
  6. declare type createFragmentContainer = <TBase>(
  7. Component: Class<React$Component<TBase, any>> | (props: TBase) => React.Node,
  8. fragmentSpec: any
  9. ) => Class<RelayComponentClass<TBase>>;
  10.  
  11. declare type GraphQLTaggedNode =
  12. | (() => any)
  13. | { modern: () => any, classic: any => any };
  14. declare type RelayModernGraphQLTag_graphql = (strings: Array<string>) => GraphQLTaggedNode;
  15.  
  16. declare module "react-relay/compat" {
  17. declare module.exports: {
  18. createFragmentContainer: createFragmentContainer,
  19. graphql: RelayModernGraphQLTag_graphql,
  20. commitMutation: Function,
  21. }
  22. }
  23. declare module "react-relay" {
  24. declare module.exports: {
  25. createFragmentContainer: createFragmentContainer,
  26. graphql: RelayModernGraphQLTag_graphql,
  27. }
  28. }
  29. declare module "react-relay/classic" {
  30. declare module.exports: {
  31. QL: any,
  32. createContainer: Function, // TODO need to check React props in legacy code or not?
  33. Route: any,
  34. Renderer: any,
  35. Environment: any,
  36. createQuery: any,
  37. GraphQLMutation: any,
  38. }
  39. }
Add Comment
Please, Sign In to add comment