diff --git a/types/relay-runtime/index.d.ts b/types/relay-runtime/index.d.ts index 93a11a9252..7af27e4934 100644 --- a/types/relay-runtime/index.d.ts +++ b/types/relay-runtime/index.d.ts @@ -5,6 +5,7 @@ // Cameron Knight // Renan Machado // Stephen Pittman +// Martin Zlámal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 diff --git a/types/relay-runtime/lib/store/RelayModernStore.d.ts b/types/relay-runtime/lib/store/RelayModernStore.d.ts index 57ec1b3b31..59be500dcd 100644 --- a/types/relay-runtime/lib/store/RelayModernStore.d.ts +++ b/types/relay-runtime/lib/store/RelayModernStore.d.ts @@ -7,7 +7,6 @@ import { OperationAvailability, OperationDescriptor, RecordSource, - NormalizationSelector, ReaderSelector, Snapshot, RequestDescriptor, @@ -22,7 +21,11 @@ import { } from './RelayConnection'; export class RelayModernStore implements Store { - constructor(source: MutableRecordSource, gcScheduler?: Scheduler, operationLoader?: OperationLoader | null); + constructor(source: MutableRecordSource, options?: { + gcScheduler?: Scheduler | null, + operationLoader?: OperationLoader | null, + gcReleaseBufferSize?: number | null, + }); getSource(): RecordSource; check(operation: OperationDescriptor, options?: CheckOptions): OperationAvailability; retain(operation: OperationDescriptor): Disposable; diff --git a/types/relay-runtime/relay-runtime-tests.tsx b/types/relay-runtime/relay-runtime-tests.tsx index 9c04471e02..2597ff74a2 100644 --- a/types/relay-runtime/relay-runtime-tests.tsx +++ b/types/relay-runtime/relay-runtime-tests.tsx @@ -16,6 +16,19 @@ import { const source = new RecordSource(); const store = new Store(source); +const storeWithNullOptions = new Store(source, { + gcScheduler: null, + operationLoader: null, + gcReleaseBufferSize: null, +}); +const storeWithOptions = new Store(source, { + gcScheduler: () => undefined, + operationLoader: { + get: () => null, + load: () => Promise.resolve(null), + }, + gcReleaseBufferSize: 10, +}); // ~~~~~~~~~~~~~~~~~~~~~ // Network Layer