@types/relay-runtime
Advanced tools
Comparing version 13.0.5 to 14.1.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for relay-runtime 13.0 | ||
// Type definitions for relay-runtime 14.1 | ||
// Project: https://github.com/facebook/relay, https://facebook.github.io/relay | ||
@@ -49,5 +49,9 @@ // Definitions by: Eloy Durán <https://github.com/alloy> | ||
getInlineDataFragment, | ||
getNode, | ||
getPaginationFragment, | ||
getRefetchableFragment, | ||
getRequest, | ||
isFragment, | ||
isInlineDataFragment, | ||
isRequest, | ||
} from './lib/query/RelayModernGraphQLTag'; | ||
@@ -61,3 +65,3 @@ export { isClientID, generateClientID, generateUniqueClientID } from './lib/store/ClientID'; | ||
FragmentPointer, | ||
// DEPRECATED: use FragmentType instead of FragmentReference | ||
/** @deprecated use FragmentType instead of FragmentReference */ | ||
FragmentType as FragmentReference, | ||
@@ -67,5 +71,7 @@ FragmentType, | ||
HandleFieldPayload, | ||
HasUpdatableSpread, | ||
InvalidationState, | ||
MissingFieldHandler, | ||
ModuleImportPointer, | ||
MutableRecordSource, | ||
NormalizationSelector, | ||
@@ -98,2 +104,3 @@ OperationAvailability, | ||
LogFunction, | ||
UpdatableData, | ||
} from './lib/store/RelayStoreTypes'; | ||
@@ -110,2 +117,3 @@ export { GraphQLSubscriptionConfig } from './lib/subscription/requestSubscription'; | ||
NormalizationModuleImport, | ||
NormalizationRootNode, | ||
NormalizationScalarField, | ||
@@ -137,2 +145,3 @@ NormalizationSelection, | ||
export { ConcreteRequest, GeneratedNode, RequestParameters } from './lib/util/RelayConcreteNode'; | ||
export { RelayReplaySubject as ReplaySubject } from './lib/util/RelayReplaySubject'; | ||
export * from './lib/util/RelayRuntimeTypes'; | ||
@@ -189,2 +198,4 @@ | ||
export { ConnectionHandler }; | ||
export { MutationHandlers } from './lib/handlers/connection/MutationHandlers'; | ||
export { VIEWER_ID, VIEWER_TYPE } from './lib/store/ViewerPattern'; | ||
@@ -202,2 +213,3 @@ // Helpers (can be implemented via the above API) | ||
export { RelayProfiler } from './lib/util/RelayProfiler'; | ||
export { default as createPayloadFor3DField } from './lib/util/createPayloadFor3DField'; | ||
export { default as getRelayHandleKey } from './lib/util/getRelayHandleKey'; | ||
@@ -211,10 +223,19 @@ export { default as getRequestIdentifier } from './lib/util/getRequestIdentifier'; | ||
export { Direction } from './lib/util/getPaginationVariables'; | ||
export { default as handlePotentialSnapshotErrors } from './lib/util/handlePotentialSnapshotErrors'; | ||
export { default as PreloadableQueryRegistry } from './lib/util/PreloadableQueryRegistry'; | ||
// INTERNAL-ONLY | ||
export { RelayConcreteNode } from './lib/util/RelayConcreteNode'; | ||
export { default as RelayError } from './lib/util/RelayError'; | ||
export { RelayFeatureFlags } from './lib/util/RelayFeatureFlags'; | ||
export const DEFAULT_HANDLE_KEY = ''; | ||
export { default as deepFreeze } from './lib/util/deepFreeze'; | ||
export { default as isPromise } from './lib/util/isPromise'; | ||
export { default as isScalarAndEqual } from './lib/util/isScalarAndEqual'; | ||
export { default as recycleNodesInto } from './lib/util/recycleNodesInto'; | ||
export { default as stableCopy } from './lib/util/stableCopy'; | ||
export { default as getPendingOperationsForFragment } from './lib/util/getPendingOperationsForFragment'; | ||
import * as fetchQueryInternal from './lib/query/fetchQueryInternal'; | ||
import withProvidedVariables from './lib/util/withProvidedVariables'; | ||
@@ -229,2 +250,3 @@ import * as RelayResolverFragments from './lib/store/ResolverFragments'; | ||
ResolverFragments: typeof RelayResolverFragments; | ||
withProvidedVariables: typeof withProvidedVariables; | ||
} | ||
@@ -231,0 +253,0 @@ |
@@ -1017,1 +1017,34 @@ import { MutationParameters } from '../mutations/commitMutation'; | ||
export type ReactFlightPayloadDeserializer = (tree: ReactFlightServerTree) => ReactFlightClientResponse; | ||
interface FieldLocation { | ||
path: string; | ||
owner: string; | ||
} | ||
export type MissingRequiredFields = | ||
| Readonly<{ action: 'THROW'; field: FieldLocation }> | ||
| Readonly<{ action: 'LOG'; fields: FieldLocation[] }>; | ||
export interface RelayResolverError { | ||
field: FieldLocation; | ||
error: Error; | ||
} | ||
export type RelayResolverErrors = RelayResolverError[]; | ||
/** | ||
* The return type of calls to readUpdatableQuery_EXPERIMENTAL and | ||
* readUpdatableFragment_EXPERIMENTAL. | ||
*/ | ||
export interface UpdatableData<TData> { | ||
readonly updatableData: TData; | ||
} | ||
/** | ||
* A linked field where an updatable fragment is spread has the type | ||
* HasUpdatableSpread. | ||
* This type is expected by store.readUpdatableFragment_EXPERIMENTAL. | ||
*/ | ||
export interface HasUpdatableSpread<TFragmentType> { | ||
readonly $updatableFragmentSpreads: TFragmentType; | ||
} |
import type { ConcreteRequest } from './RelayConcreteNode'; | ||
import type { JSResourceReference } from './JSResourceReference'; | ||
@@ -12,2 +13,5 @@ /** | ||
readonly selections: ReadonlyArray<NormalizationSelection>; | ||
readonly clientAbstractTypes?: { | ||
readonly [key: string]: ReadonlyArray<string>; | ||
}; | ||
} | ||
@@ -98,2 +102,7 @@ | ||
readonly fragmentName: string; | ||
readonly componentModuleProvider?: () => unknown | Promise<unknown> | JSResourceReference<unknown>; | ||
readonly operationModuleProvider?: () => | ||
| NormalizationRootNode | ||
| Promise<NormalizationRootNode> | ||
| JSResourceReference<NormalizationRootNode>; | ||
} | ||
@@ -100,0 +109,0 @@ |
@@ -17,2 +17,7 @@ import { NormalizationOperation, NormalizationSplitOperation } from './NormalizationNode'; | ||
export interface ConcreteUpdatableQuery { | ||
readonly kind: string; // 'UpdatableQuery'; | ||
readonly fragment: ReaderFragment; | ||
} | ||
/** | ||
@@ -24,18 +29,40 @@ * Contains the parameters required for executing a GraphQL request. | ||
*/ | ||
export interface RequestParameters { | ||
readonly cacheID?: string | null | undefined; | ||
readonly name: string; | ||
readonly operationKind: string; // 'mutation' | 'query' | 'subscription'; | ||
readonly id: string | null | undefined; | ||
readonly text: string | null | undefined; | ||
readonly metadata: { [key: string]: unknown }; | ||
} | ||
export type RequestParameters = | ||
| { | ||
readonly id: string; | ||
readonly text: null; | ||
// common fields | ||
readonly name: string; | ||
readonly operationKind: string; // 'mutation' | 'query' | 'subscription'; | ||
readonly providedVariables?: ProvidedVariablesType; | ||
readonly metadata: { [key: string]: unknown }; | ||
} | ||
| { | ||
readonly cacheID: string; | ||
readonly id: null; | ||
readonly text: string | null; | ||
// common fields | ||
readonly name: string; | ||
readonly operationKind: string; // 'mutation' | 'query' | 'subscription'; | ||
readonly providedVariables?: ProvidedVariablesType; | ||
readonly metadata: { [key: string]: unknown }; | ||
}; | ||
export type GeneratedNode = ConcreteRequest | ReaderFragment | ReaderInlineDataFragment | NormalizationSplitOperation; | ||
export type GeneratedNode = | ||
| ConcreteRequest | ||
| ReaderFragment | ||
| ReaderInlineDataFragment | ||
| NormalizationSplitOperation | ||
| ConcreteUpdatableQuery; | ||
export const RelayConcreteNode: { | ||
ACTOR_CHANGE: 'ActorChange'; | ||
CONDITION: 'Condition'; | ||
CLIENT_COMPONENT: 'ClientComponent'; | ||
CLIENT_EDGE_TO_SERVER_OBJECT: 'ClientEdgeToServerObject'; | ||
CLIENT_EDGE_TO_CLIENT_OBJECT: 'ClientEdgeToClientObject'; | ||
CLIENT_EXTENSION: 'ClientExtension'; | ||
DEFER: 'Defer'; | ||
CONNECTION: 'Connection'; | ||
FLIGHT_FIELD: 'FlightField'; | ||
FRAGMENT: 'Fragment'; | ||
@@ -52,2 +79,7 @@ FRAGMENT_SPREAD: 'FragmentSpread'; | ||
MODULE_IMPORT: 'ModuleImport'; | ||
ALIASED_FRAGMENT_SPREAD: 'AliasedFragmentSpread'; | ||
ALIASED_INLINE_FRAGMENT_SPREAD: 'AliasedInlineFragmentSpread'; | ||
RELAY_RESOLVER: 'RelayResolver'; | ||
RELAY_LIVE_RESOLVER: 'RelayLiveResolver'; | ||
REQUIRED_FIELD: 'RequiredField'; | ||
OBJECT_VALUE: 'ObjectValue'; | ||
@@ -62,3 +94,8 @@ OPERATION: 'Operation'; | ||
TYPE_DISCRIMINATOR: 'TypeDiscriminator'; | ||
UPDATABLE_QUERY: 'UpdatableQuery'; | ||
VARIABLE: 'Variable'; | ||
}; | ||
export interface ProvidedVariablesType { | ||
readonly [key: string]: { get(): unknown }; | ||
} |
@@ -0,10 +1,22 @@ | ||
import { Disposable } from './RelayRuntimeTypes'; | ||
export interface FeatureFlags { | ||
ENABLE_CLIENT_EDGES: boolean; | ||
ENABLE_VARIABLE_CONNECTION_KEY: boolean; | ||
ENABLE_RELAY_CONTAINERS_SUSPENSE: boolean; | ||
ENABLE_PARTIAL_RENDERING_DEFAULT: boolean; | ||
ENABLE_UNIQUE_MUTATION_ROOT: boolean; | ||
ENABLE_REACT_FLIGHT_COMPONENT_FIELD: boolean; | ||
ENABLE_RELAY_RESOLVERS: boolean; | ||
ENABLE_CLIENT_EDGES: boolean; | ||
ENABLE_GETFRAGMENTIDENTIFIER_OPTIMIZATION: boolean; | ||
ENABLE_FRIENDLY_QUERY_NAME_GQL_URL: boolean; | ||
ENABLE_LOAD_QUERY_REQUEST_DEDUPING: boolean; | ||
ENABLE_DO_NOT_WRAP_LIVE_QUERY: boolean; | ||
ENABLE_NOTIFY_SUBSCRIPTION: boolean; | ||
BATCH_ASYNC_MODULE_UPDATES_FN: null | undefined | ((arg: () => void) => Disposable); | ||
ENABLE_CONTAINERS_SUBSCRIBE_ON_COMMIT: boolean; | ||
MAX_DATA_ID_LENGTH: number | null | undefined; | ||
STRING_INTERN_LEVEL: number; | ||
USE_REACT_CACHE: boolean; | ||
USE_REACT_CACHE_LEGACY_TIMEOUTS: boolean; | ||
} | ||
export const RelayFeatureFlags: FeatureFlags; |
{ | ||
"name": "@types/relay-runtime", | ||
"version": "13.0.5", | ||
"version": "14.1.0", | ||
"description": "TypeScript definitions for relay-runtime", | ||
@@ -33,4 +33,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/relay-runtime", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "f33d59c77fcf6418000f711087ccfd696c335684e0f93d3cda5f5d22b980edc4", | ||
"typesPublisherContentHash": "a40dacec404b28aa956b0dc4c0b6ed228754d6226c33c0cbc1934efa6d2336eb", | ||
"typeScriptVersion": "4.0" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Wed, 17 Aug 2022 09:02:32 GMT | ||
* Last updated: Wed, 17 Aug 2022 11:32:26 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
139346
71
3422