Skip to content

Commit f40cda4

Browse files
authored
remove references to "dom" ts lib (#11449)
* remove references to "dom" ts lib * changeset * api extractor
1 parent a4b4ef5 commit f40cda4

10 files changed

+17
-17
lines changed

.api-reports/api-report-core.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ const enum CacheWriteBehavior {
395395
type CanReadFunction = (value: StoreValue) => boolean;
396396

397397
// @public (undocumented)
398-
export const checkFetcher: (fetcher: WindowOrWorkerGlobalScope["fetch"] | undefined) => void;
398+
export const checkFetcher: (fetcher: typeof fetch | undefined) => void;
399399

400400
// @public (undocumented)
401401
export type ClientParseError = InvariantError & {
@@ -897,7 +897,7 @@ export class HttpLink extends ApolloLink {
897897
// @public (undocumented)
898898
export interface HttpOptions {
899899
credentials?: string;
900-
fetch?: WindowOrWorkerGlobalScope["fetch"];
900+
fetch?: typeof fetch;
901901
fetchOptions?: any;
902902
headers?: Record<string, string>;
903903
includeExtensions?: boolean;

.api-reports/api-report-link_batch-http.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ interface GraphQLRequest<TVariables = Record<string, any>> {
156156
// @public (undocumented)
157157
interface HttpOptions {
158158
credentials?: string;
159-
fetch?: WindowOrWorkerGlobalScope["fetch"];
159+
fetch?: typeof fetch;
160160
fetchOptions?: any;
161161
headers?: Record<string, string>;
162162
includeExtensions?: boolean;

.api-reports/api-report-link_http.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ interface Body_2 {
6060
}
6161

6262
// @public (undocumented)
63-
export const checkFetcher: (fetcher: WindowOrWorkerGlobalScope["fetch"] | undefined) => void;
63+
export const checkFetcher: (fetcher: typeof fetch | undefined) => void;
6464

6565
// @public (undocumented)
6666
export type ClientParseError = InvariantError & {
@@ -186,7 +186,7 @@ export class HttpLink extends ApolloLink {
186186
// @public (undocumented)
187187
export interface HttpOptions {
188188
credentials?: string;
189-
fetch?: WindowOrWorkerGlobalScope["fetch"];
189+
fetch?: typeof fetch;
190190
fetchOptions?: any;
191191
headers?: Record<string, string>;
192192
includeExtensions?: boolean;

.api-reports/api-report.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ const enum CacheWriteBehavior {
507507
type CanReadFunction = (value: StoreValue) => boolean;
508508

509509
// @public (undocumented)
510-
export const checkFetcher: (fetcher: WindowOrWorkerGlobalScope["fetch"] | undefined) => void;
510+
export const checkFetcher: (fetcher: typeof fetch | undefined) => void;
511511

512512
// @public (undocumented)
513513
export type ClientParseError = InvariantError & {
@@ -1075,7 +1075,7 @@ export class HttpLink extends ApolloLink {
10751075
// @public (undocumented)
10761076
export interface HttpOptions {
10771077
credentials?: string;
1078-
fetch?: WindowOrWorkerGlobalScope["fetch"];
1078+
fetch?: typeof fetch;
10791079
fetchOptions?: any;
10801080
headers?: Record<string, string>;
10811081
includeExtensions?: boolean;

.changeset/many-bottles-count.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@apollo/client": patch
3+
---
4+
5+
Removes refences to the typescript "dom" lib.

src/link/http/__tests__/HttpLink.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -887,10 +887,7 @@ describe("HttpLink", () => {
887887

888888
itAsync("allows uri to be a function", (resolve, reject) => {
889889
const variables = { params: "stub" };
890-
const customFetch: WindowOrWorkerGlobalScope["fetch"] = (
891-
uri,
892-
options
893-
) => {
890+
const customFetch: typeof fetch = (uri, options) => {
894891
const { operationName } = convertBatchedBody(options!.body);
895892
try {
896893
expect(operationName).toBe("SampleQuery");

src/link/http/checkFetcher.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { newInvariantError } from "../../utilities/globals/index.js";
22

3-
export const checkFetcher = (
4-
fetcher: WindowOrWorkerGlobalScope["fetch"] | undefined
5-
) => {
3+
export const checkFetcher = (fetcher: typeof fetch | undefined) => {
64
if (!fetcher && typeof fetch === "undefined") {
75
throw newInvariantError(`
86
"fetch" has not been found globally and no fetcher has been \

src/link/http/selectHttpOptionsAndBody.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface HttpOptions {
3636
/**
3737
* A `fetch`-compatible API to use when making requests.
3838
*/
39-
fetch?: WindowOrWorkerGlobalScope["fetch"];
39+
fetch?: typeof fetch;
4040

4141
/**
4242
* An object representing values to be sent as headers on the request.

src/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"compilerOptions": {
77
"noEmit": true,
8-
"lib": ["es2015", "esnext.asynciterable", "dom"],
8+
"lib": ["es2015", "esnext.asynciterable"],
99
"types": ["jest", "node", "./testing/matchers/index.d.ts"]
1010
},
1111
"extends": "../tsconfig.json",

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"esModuleInterop": true,
1616
"experimentalDecorators": true,
1717
"outDir": "./dist",
18-
"lib": ["es2015", "esnext.asynciterable", "dom"],
18+
"lib": ["es2015", "esnext.asynciterable"],
1919
"jsx": "react",
2020
"strict": true
2121
},

0 commit comments

Comments
 (0)