From 66af1890896bdb0ca54ecad2b219411efe35a6c8 Mon Sep 17 00:00:00 2001 From: voxmatt Date: Sun, 10 Sep 2017 17:44:00 -1000 Subject: [PATCH] removing maybe util type --- types/relay-runtime/index.d.ts | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/types/relay-runtime/index.d.ts b/types/relay-runtime/index.d.ts index b5c3b006f8..bddbc60600 100644 --- a/types/relay-runtime/index.d.ts +++ b/types/relay-runtime/index.d.ts @@ -12,11 +12,6 @@ declare namespace __Relay { * Relay 1.3.0 * https://github.com/facebook/relay/blob/b85a1d69bb72be4ace67179f55c2a54a8d761c8b/packages/react-relay/classic/environment/RelayCombinedEnvironmentTypes.js */ - // ~~~~~~~~~~~~~~~~~~~~~ - // Util - // ~~~~~~~~~~~~~~~~~~~~~ - type Maybe = T | void; - // ~~~~~~~~~~~~~~~~~~~~~ // Maybe Fix // ~~~~~~~~~~~~~~~~~~~~~ @@ -164,18 +159,18 @@ declare namespace __Relay { args?: Variables | void, ): RecordProxy; getType(): string; - getValue(name: string, args?: Variables | void): any; + getValue(name: string, args?: Variables): any; setLinkedRecord( record: RecordProxy, name: string, args?: Variables | void, ): RecordProxy; setLinkedRecords( - records: Array | void, + records: Array | undefined | null, name: string, - args?: Variables | void, + args?: Variables, ): RecordProxy; - setValue(value: any, name: string, args?: Variables | void): RecordProxy; + setValue(value: any, name: string, args?: Variables): RecordProxy; } interface RecordSourceProxy { @@ -377,9 +372,9 @@ declare namespace __Relay { */ sendQuery(config: { cacheConfig?: CacheConfig | void, - onCompleted?: Maybe<() => void>, - onError?: Maybe<(error: Error) => void>, - onNext?: Maybe<(payload: TPayload) => void>, + onCompleted?: () => void, + onError?: (error: Error) => void, + onNext?: (payload: TPayload) => void, operation: COperationSelector, }): Disposable; @@ -392,10 +387,10 @@ declare namespace __Relay { * subscription open indefinitely such that `onCompleted` is not called. */ streamQuery(config: { - cacheConfig?: Maybe, - onCompleted?: Maybe<() => void>, - onError?: Maybe<(error: Error) => void>, - onNext?: Maybe<(payload: TPayload) => void>, + cacheConfig?: CacheConfig, + onCompleted?: () => void, + onError?: (error: Error) => void, + onNext?: (payload: TPayload) => void, operation: COperationSelector, }): Disposable; @@ -518,7 +513,7 @@ declare namespace __Relay { operationVariables: Variables, fragments: CFragmentMap, props: Props, - ): { [key: string]: Maybe<(CSelector | Array>)> }; + ): { [key: string]: CSelector | Array> | null | undefined }; /** * Given a mapping of keys -> results and a mapping of keys -> fragments, @@ -530,7 +525,7 @@ declare namespace __Relay { getDataIDsFromObject( fragments: CFragmentMap, props: Props, - ): { [key: string]: Maybe<(DataID | DataID[])> }; + ): { [key: string]: DataID | DataID[] | null | undefined }; /** * Given a mapping of keys -> results and a mapping of keys -> fragments, @@ -1124,6 +1119,7 @@ declare namespace __Relay { } declare module 'relay-runtime' { + // tslint:disable strict-export-declare-modifiers export import Environment = __Relay.Runtime.Environment; export import Network = __Relay.Runtime.Network; export import RecordSource = __Relay.Runtime.RecordSource;