mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-29 00:18:20 +08:00
[relay] Fix lint issues.
This commit is contained in:
3
types/react-relay/index.d.ts
vendored
3
types/react-relay/index.d.ts
vendored
@@ -23,9 +23,12 @@ import * as RelayRuntimeTypes from "relay-runtime";
|
||||
// ~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
// 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>>;
|
||||
|
||||
// tslint:disable-next-line:strict-export-declare-modifiers
|
||||
type RemoveRelayProp<P> = Omit<P & { relay: never }, "relay">;
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// tslint:disable:interface-over-type-literal
|
||||
|
||||
import * as React from "react";
|
||||
import { Environment, Network, RecordSource, Store, ConnectionHandler, FragmentReference } from "relay-runtime";
|
||||
|
||||
@@ -61,8 +59,10 @@ const MyQueryRenderer = (props: { name: string }) => (
|
||||
type StoryLike = (storyID: string) => void;
|
||||
|
||||
// Artifact produced by relay-compiler-language-typescript
|
||||
// tslint:disable-next-line:no-const-enum
|
||||
const enum _Story_story$ref {}
|
||||
type Story_story$ref = _Story_story$ref & FragmentReference;
|
||||
// tslint:disable-next-line:interface-over-type-literal
|
||||
type Story_story = {
|
||||
readonly id: string;
|
||||
readonly text: string;
|
||||
@@ -145,8 +145,10 @@ const Story = (() => {
|
||||
// ~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
// Artifact produced by relay-compiler-language-typescript
|
||||
// tslint:disable-next-line:no-const-enum
|
||||
const enum _FeedStories_feed$ref {}
|
||||
type FeedStories_feed$ref = _FeedStories_feed$ref & FragmentReference;
|
||||
// tslint:disable-next-line:interface-over-type-literal
|
||||
type FeedStories_feed = {
|
||||
readonly edges: ReadonlyArray<{
|
||||
readonly node: {
|
||||
@@ -207,8 +209,10 @@ const Feed = (() => {
|
||||
// ~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
// Artifact produced by relay-compiler-language-typescript
|
||||
// tslint:disable-next-line:no-const-enum
|
||||
const enum _UserFeed_user$ref {}
|
||||
type UserFeed_user$ref = _UserFeed_user$ref & FragmentReference;
|
||||
// tslint:disable-next-line:interface-over-type-literal
|
||||
type UserFeed_user = {
|
||||
readonly feed: {
|
||||
readonly pageInfo: {
|
||||
|
||||
3
types/relay-runtime/index.d.ts
vendored
3
types/relay-runtime/index.d.ts
vendored
@@ -37,13 +37,14 @@ export type RelayContainer = any;
|
||||
// ~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
// File: https://github.com/facebook/relay/blob/fe0e70f10bbcba1fff89911313ea69f24569464b/packages/relay-runtime/util/RelayConcreteNode.js
|
||||
// Using enum here to create a distinct types.
|
||||
export type ConcreteFragment = any;
|
||||
export type ConcreteRequest = any;
|
||||
export type ConcreteBatchRequest = any;
|
||||
|
||||
export type RequestNode = ConcreteRequest | ConcreteBatchRequest;
|
||||
|
||||
// Using `enum` here to create a distinct type and `const` to ensure it doesn’t leave any generated code.
|
||||
// tslint:disable-next-line:no-const-enum
|
||||
export const enum FragmentReference {}
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user