Skip to content

Commit

Permalink
Enable strict mode in tsconfig and fix type errors (#11200)
Browse files Browse the repository at this point in the history
Co-authored-by: Lenz Weber-Tronic <[email protected]>
  • Loading branch information
jerelmiller and phryneas authored Nov 10, 2023
1 parent e5acf91 commit ae5091a
Show file tree
Hide file tree
Showing 82 changed files with 434 additions and 380 deletions.
4 changes: 2 additions & 2 deletions .api-reports/api-report-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace Cache_2 {
// (undocumented)
interface BatchOptions<TCache extends ApolloCache<any>, TUpdateResult = void> {
// (undocumented)
onWatchUpdated?: (this: TCache, watch: Cache_2.WatchOptions, diff: Cache_2.DiffResult<any>, lastDiff: Cache_2.DiffResult<any> | undefined) => any;
onWatchUpdated?: (this: TCache, watch: Cache_2.WatchOptions, diff: Cache_2.DiffResult<any>, lastDiff?: Cache_2.DiffResult<any> | undefined) => any;
// (undocumented)
optimistic?: string | boolean;
// (undocumented)
Expand Down Expand Up @@ -894,7 +894,7 @@ export type StoreValue = number | string | string[] | Reference | Reference[] |
class Stump extends Layer {
constructor(root: EntityStore.Root);
// (undocumented)
merge(): any;
merge(older: string | StoreObject, newer: string | StoreObject): void;
// (undocumented)
removeLayer(): this;
}
Expand Down
34 changes: 15 additions & 19 deletions .api-reports/api-report-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ namespace Cache_2 {
// (undocumented)
interface BatchOptions<TCache extends ApolloCache<any>, TUpdateResult = void> {
// (undocumented)
onWatchUpdated?: (this: TCache, watch: Cache_2.WatchOptions, diff: Cache_2.DiffResult<any>, lastDiff: Cache_2.DiffResult<any> | undefined) => any;
onWatchUpdated?: (this: TCache, watch: Cache_2.WatchOptions, diff: Cache_2.DiffResult<any>, lastDiff?: Cache_2.DiffResult<any> | undefined) => any;
// (undocumented)
optimistic?: string | boolean;
// (undocumented)
Expand Down Expand Up @@ -433,7 +433,7 @@ class Concast<T> extends Observable<T> {
// (undocumented)
cancel: (reason: any) => void;
// (undocumented)
readonly promise: Promise<T>;
readonly promise: Promise<T | undefined>;
// (undocumented)
removeObserver(observer: Observer<T>): void;
}
Expand Down Expand Up @@ -929,8 +929,6 @@ export class HttpLink extends ApolloLink {
constructor(options?: HttpOptions);
// (undocumented)
options: HttpOptions;
// (undocumented)
requester: RequestHandler;
}

// @public (undocumented)
Expand Down Expand Up @@ -1164,15 +1162,13 @@ class LocalState<TCacheShape> {
// Warning: (ae-forgotten-export) The symbol "LocalStateOptions" needs to be exported by the entry point index.d.ts
constructor({ cache, client, resolvers, fragmentMatcher, }: LocalStateOptions<TCacheShape>);
// (undocumented)
addExportedVariables(document: DocumentNode, variables?: OperationVariables, context?: {}): Promise<{
[x: string]: any;
}>;
addExportedVariables<TVars extends OperationVariables>(document: DocumentNode, variables?: TVars, context?: {}): Promise<TVars>;
// (undocumented)
addResolvers(resolvers: Resolvers | Resolvers[]): void;
// (undocumented)
clientQuery(document: DocumentNode): DocumentNode | null;
// (undocumented)
getFragmentMatcher(): FragmentMatcher;
getFragmentMatcher(): FragmentMatcher | undefined;
// (undocumented)
getResolvers(): Resolvers;
// (undocumented)
Expand Down Expand Up @@ -1553,7 +1549,7 @@ export type OptimisticStoreItem = {
};

// @public (undocumented)
type OptionsUnion<TData, TVariables extends OperationVariables, TContext> = WatchQueryOptions<TVariables, TData> | QueryOptions<TVariables, TData> | MutationOptions<TData, TVariables, TContext>;
type OptionsUnion<TData, TVariables extends OperationVariables, TContext> = WatchQueryOptions<TVariables, TData> | QueryOptions<TVariables, TData> | MutationOptions<TData, TVariables, TContext, any>;

// @public (undocumented)
export function parseAndCheckHttpResponse(operations: Operation | Operation[]): (response: Response) => Promise<any>;
Expand Down Expand Up @@ -1633,7 +1629,7 @@ class QueryInfo {
document: DocumentNode;
variables: Record<string, any> | undefined;
networkStatus?: NetworkStatus;
observableQuery?: ObservableQuery<any>;
observableQuery?: ObservableQuery<any, any>;
lastRequestId?: number;
}): this;
// (undocumented)
Expand All @@ -1655,7 +1651,7 @@ class QueryInfo {
// (undocumented)
notify(): void;
// (undocumented)
readonly observableQuery: ObservableQuery<any> | null;
readonly observableQuery: ObservableQuery<any, any> | null;
// (undocumented)
readonly queryId: string;
// (undocumented)
Expand All @@ -1665,7 +1661,7 @@ class QueryInfo {
// (undocumented)
setDiff(diff: Cache_2.DiffResult<any> | null): void;
// (undocumented)
setObservableQuery(oq: ObservableQuery<any> | null): void;
setObservableQuery(oq: ObservableQuery<any, any> | null): void;
// (undocumented)
stop(): void;
// (undocumented)
Expand Down Expand Up @@ -1939,7 +1935,7 @@ export interface Resolvers {
//
// @public (undocumented)
export function rewriteURIForGET(chosenURI: string, body: Body_2): {
parseError: any;
parseError: unknown;
newURI?: undefined;
} | {
newURI: string;
Expand Down Expand Up @@ -2022,7 +2018,7 @@ export type StoreValue = number | string | string[] | Reference | Reference[] |
class Stump extends Layer {
constructor(root: EntityStore.Root);
// (undocumented)
merge(): any;
merge(older: string | StoreObject, newer: string | StoreObject): void;
// (undocumented)
removeLayer(): this;
}
Expand Down Expand Up @@ -2186,11 +2182,11 @@ interface WriteContext extends ReadMergeModifyContext {
// src/cache/inmemory/policies.ts:167:3 - (ae-forgotten-export) The symbol "KeySpecifier" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/policies.ts:167:3 - (ae-forgotten-export) The symbol "KeyArgsFunction" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/types.ts:126:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:112:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:113:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:116:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:149:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:378:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:113:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:114:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:117:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:150:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:379:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:191:3 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/link/http/selectHttpOptionsAndBody.ts:128:32 - (ae-forgotten-export) The symbol "HttpQueryOptions" needs to be exported by the entry point index.d.ts

Expand Down
4 changes: 1 addition & 3 deletions .api-reports/api-report-link_http.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ export class HttpLink extends ApolloLink {
constructor(options?: HttpOptions);
// (undocumented)
options: HttpOptions;
// (undocumented)
requester: RequestHandler;
}

// @public (undocumented)
Expand Down Expand Up @@ -278,7 +276,7 @@ type RequestHandler = (operation: Operation, forward: NextLink) => Observable<Fe
//
// @public (undocumented)
export function rewriteURIForGET(chosenURI: string, body: Body_2): {
parseError: any;
parseError: unknown;
newURI?: undefined;
} | {
newURI: string;
Expand Down
30 changes: 14 additions & 16 deletions .api-reports/api-report-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ namespace Cache_2 {
// (undocumented)
interface BatchOptions<TCache extends ApolloCache<any>, TUpdateResult = void> {
// (undocumented)
onWatchUpdated?: (this: TCache, watch: Cache_2.WatchOptions, diff: Cache_2.DiffResult<any>, lastDiff: Cache_2.DiffResult<any> | undefined) => any;
onWatchUpdated?: (this: TCache, watch: Cache_2.WatchOptions, diff: Cache_2.DiffResult<any>, lastDiff?: Cache_2.DiffResult<any> | undefined) => any;
// (undocumented)
optimistic?: string | boolean;
// (undocumented)
Expand Down Expand Up @@ -552,7 +552,7 @@ class Concast<T> extends Observable<T> {
// (undocumented)
cancel: (reason: any) => void;
// (undocumented)
readonly promise: Promise<T>;
readonly promise: Promise<T | undefined>;
// (undocumented)
removeObserver(observer: Observer<T>): void;
}
Expand Down Expand Up @@ -1021,15 +1021,13 @@ class LocalState<TCacheShape> {
// Warning: (ae-forgotten-export) The symbol "LocalStateOptions" needs to be exported by the entry point index.d.ts
constructor({ cache, client, resolvers, fragmentMatcher, }: LocalStateOptions<TCacheShape>);
// (undocumented)
addExportedVariables(document: DocumentNode, variables?: OperationVariables, context?: {}): Promise<{
[x: string]: any;
}>;
addExportedVariables<TVars extends OperationVariables>(document: DocumentNode, variables?: TVars, context?: {}): Promise<TVars>;
// (undocumented)
addResolvers(resolvers: Resolvers | Resolvers[]): void;
// (undocumented)
clientQuery(document: DocumentNode): DocumentNode | null;
// (undocumented)
getFragmentMatcher(): FragmentMatcher;
getFragmentMatcher(): FragmentMatcher | undefined;
// (undocumented)
getResolvers(): Resolvers;
// (undocumented)
Expand Down Expand Up @@ -1452,7 +1450,7 @@ class QueryInfo {
document: DocumentNode;
variables: Record<string, any> | undefined;
networkStatus?: NetworkStatus;
observableQuery?: ObservableQuery<any>;
observableQuery?: ObservableQuery<any, any>;
lastRequestId?: number;
}): this;
// (undocumented)
Expand All @@ -1476,7 +1474,7 @@ class QueryInfo {
// (undocumented)
notify(): void;
// (undocumented)
readonly observableQuery: ObservableQuery<any> | null;
readonly observableQuery: ObservableQuery<any, any> | null;
// (undocumented)
readonly queryId: string;
// (undocumented)
Expand All @@ -1486,7 +1484,7 @@ class QueryInfo {
// (undocumented)
setDiff(diff: Cache_2.DiffResult<any> | null): void;
// (undocumented)
setObservableQuery(oq: ObservableQuery<any> | null): void;
setObservableQuery(oq: ObservableQuery<any, any> | null): void;
// (undocumented)
stop(): void;
// (undocumented)
Expand Down Expand Up @@ -2206,18 +2204,18 @@ interface WatchQueryOptions<TVariables extends OperationVariables = OperationVar
// src/cache/core/types/common.ts:100:3 - (ae-forgotten-export) The symbol "StorageType" needs to be exported by the entry point index.d.ts
// src/core/ApolloClient.ts:47:3 - (ae-forgotten-export) The symbol "UriFunction" needs to be exported by the entry point index.d.ts
// src/core/LocalState.ts:46:5 - (ae-forgotten-export) The symbol "FragmentMap" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:112:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:113:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:116:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:149:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:378:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:113:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:114:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:117:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:150:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:379:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/types.ts:158:3 - (ae-forgotten-export) The symbol "ApolloError" needs to be exported by the entry point index.d.ts
// src/core/types.ts:160:3 - (ae-forgotten-export) The symbol "NetworkStatus" needs to be exported by the entry point index.d.ts
// src/core/types.ts:178:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts
// src/core/types.ts:205:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:191:3 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/react/hooks/useBackgroundQuery.ts:24:3 - (ae-forgotten-export) The symbol "FetchMoreFunction" needs to be exported by the entry point index.d.ts
// src/react/hooks/useBackgroundQuery.ts:25:3 - (ae-forgotten-export) The symbol "RefetchFunction" needs to be exported by the entry point index.d.ts
// src/react/hooks/useBackgroundQuery.ts:26:3 - (ae-forgotten-export) The symbol "FetchMoreFunction" needs to be exported by the entry point index.d.ts
// src/react/hooks/useBackgroundQuery.ts:27:3 - (ae-forgotten-export) The symbol "RefetchFunction" needs to be exported by the entry point index.d.ts
// src/utilities/graphql/DocumentTransform.ts:122:7 - (ae-forgotten-export) The symbol "DocumentTransformCacheKey" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)
Expand Down
26 changes: 12 additions & 14 deletions .api-reports/api-report-react_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ namespace Cache_2 {
// (undocumented)
interface BatchOptions<TCache extends ApolloCache<any>, TUpdateResult = void> {
// (undocumented)
onWatchUpdated?: (this: TCache, watch: Cache_2.WatchOptions, diff: Cache_2.DiffResult<any>, lastDiff: Cache_2.DiffResult<any> | undefined) => any;
onWatchUpdated?: (this: TCache, watch: Cache_2.WatchOptions, diff: Cache_2.DiffResult<any>, lastDiff?: Cache_2.DiffResult<any> | undefined) => any;
// (undocumented)
optimistic?: string | boolean;
// (undocumented)
Expand Down Expand Up @@ -491,7 +491,7 @@ class Concast<T> extends Observable<T> {
// (undocumented)
cancel: (reason: any) => void;
// (undocumented)
readonly promise: Promise<T>;
readonly promise: Promise<T | undefined>;
// (undocumented)
removeObserver(observer: Observer<T>): void;
}
Expand Down Expand Up @@ -819,15 +819,13 @@ class LocalState<TCacheShape> {
// Warning: (ae-forgotten-export) The symbol "LocalStateOptions" needs to be exported by the entry point index.d.ts
constructor({ cache, client, resolvers, fragmentMatcher, }: LocalStateOptions<TCacheShape>);
// (undocumented)
addExportedVariables(document: DocumentNode, variables?: OperationVariables, context?: {}): Promise<{
[x: string]: any;
}>;
addExportedVariables<TVars extends OperationVariables>(document: DocumentNode, variables?: TVars, context?: {}): Promise<TVars>;
// (undocumented)
addResolvers(resolvers: Resolvers | Resolvers[]): void;
// (undocumented)
clientQuery(document: DocumentNode): DocumentNode | null;
// (undocumented)
getFragmentMatcher(): FragmentMatcher;
getFragmentMatcher(): FragmentMatcher | undefined;
// (undocumented)
getResolvers(): Resolvers;
// (undocumented)
Expand Down Expand Up @@ -1256,7 +1254,7 @@ class QueryInfo {
document: DocumentNode;
variables: Record<string, any> | undefined;
networkStatus?: NetworkStatus;
observableQuery?: ObservableQuery<any>;
observableQuery?: ObservableQuery<any, any>;
lastRequestId?: number;
}): this;
// (undocumented)
Expand All @@ -1280,7 +1278,7 @@ class QueryInfo {
// (undocumented)
notify(): void;
// (undocumented)
readonly observableQuery: ObservableQuery<any> | null;
readonly observableQuery: ObservableQuery<any, any> | null;
// (undocumented)
readonly queryId: string;
// (undocumented)
Expand All @@ -1290,7 +1288,7 @@ class QueryInfo {
// (undocumented)
setDiff(diff: Cache_2.DiffResult<any> | null): void;
// (undocumented)
setObservableQuery(oq: ObservableQuery<any> | null): void;
setObservableQuery(oq: ObservableQuery<any, any> | null): void;
// (undocumented)
stop(): void;
// (undocumented)
Expand Down Expand Up @@ -1738,11 +1736,11 @@ interface WatchQueryOptions<TVariables extends OperationVariables = OperationVar
// src/cache/core/types/common.ts:100:3 - (ae-forgotten-export) The symbol "StorageType" needs to be exported by the entry point index.d.ts
// src/core/ApolloClient.ts:47:3 - (ae-forgotten-export) The symbol "UriFunction" needs to be exported by the entry point index.d.ts
// src/core/LocalState.ts:46:5 - (ae-forgotten-export) The symbol "FragmentMap" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:112:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:113:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:116:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:149:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:378:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:113:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:114:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:117:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:150:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:379:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/types.ts:158:3 - (ae-forgotten-export) The symbol "ApolloError" needs to be exported by the entry point index.d.ts
// src/core/types.ts:160:3 - (ae-forgotten-export) The symbol "NetworkStatus" needs to be exported by the entry point index.d.ts
// src/core/types.ts:178:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts
Expand Down
Loading

0 comments on commit ae5091a

Please sign in to comment.