Skip to content

Commit

Permalink
Merge pull request #1834 from reduxjs/pr/fix-module-types-4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Dec 16, 2021
2 parents 08b92bd + bce210a commit 53f56a4
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 4 deletions.
26 changes: 26 additions & 0 deletions .yarn/patches/console-testing-library__npm_0.3.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/index.d.ts b/index.d.ts
index 1dbf70a6fdf4369188ad44166aee188c8efd2054..56b85e26b2b3030bc3407aab2b358fd4e5e39c6a 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -1,4 +1,4 @@
-export const originalConsole = Console;
+export declare const originalConsole: Console;

type Options = {
isSilent?: boolean;
@@ -24,14 +24,13 @@ export type TestingConsoleInstance = {
};
getRecord: (method: string) => string;
silence: boolean;
- private _targetConsole: TestingConsole | Console;
};

export function createConsole(options?: Options): TestingConsole;

export function mockConsole(
testingConsole: TestingConsole,
- targetConsoleParent?: {} = global,
+ targetConsoleParent?: typeof globalThis,
targetConsoleKey?: string
): () => void;

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
"resolutions": {
"react-scripts": "patch:react-scripts@npm:4.0.2#.yarn/patches/react-scripts__npm_4.0.2.patch",
"console-testing-library": "patch:console-testing-library@npm:0.3.1#.yarn/patches/console-testing-library__npm_0.3.1.patch",
"react-redux": "npm:7.2.4",
"react": "npm:17.0.2",
"react-dom": "npm:17.0.2"
Expand Down
12 changes: 10 additions & 2 deletions packages/toolkit/src/query/core/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,21 @@ declare module '../apiTypes' {
getRunningOperationPromise<EndpointName extends QueryKeys<Definitions>>(
endpointName: EndpointName,
args: QueryArgFrom<Definitions[EndpointName]>
): QueryActionCreatorResult<Definitions[EndpointName]> | undefined
):
| QueryActionCreatorResult<
Definitions[EndpointName] & { type: 'query' }
>
| undefined
getRunningOperationPromise<
EndpointName extends MutationKeys<Definitions>
>(
endpointName: EndpointName,
fixedCacheKeyOrRequestId: string
): MutationActionCreatorResult<Definitions[EndpointName]> | undefined
):
| MutationActionCreatorResult<
Definitions[EndpointName] & { type: 'mutation' }
>
| undefined

/**
* A Redux thunk that can be used to manually trigger pre-fetching of data.
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"target": "es2018",
"jsx": "react",
"baseUrl": ".",
"skipLibCheck": true,
"skipLibCheck": false,
"noImplicitReturns": false
}
}
12 changes: 11 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9913,7 +9913,7 @@ __metadata:
languageName: node
linkType: hard

"console-testing-library@npm:^0.3.1":
"console-testing-library@npm:0.3.1":
version: 0.3.1
resolution: "console-testing-library@npm:0.3.1"
dependencies:
Expand All @@ -9923,6 +9923,16 @@ __metadata:
languageName: node
linkType: hard

"console-testing-library@patch:console-testing-library@npm:0.3.1#.yarn/patches/console-testing-library__npm_0.3.1.patch::locator=rtk-monorepo%40workspace%3A.":
version: 0.3.1
resolution: "console-testing-library@patch:console-testing-library@npm%3A0.3.1#.yarn/patches/console-testing-library__npm_0.3.1.patch::version=0.3.1&hash=790984&locator=rtk-monorepo%40workspace%3A."
dependencies:
jest-snapshot: ^24.9.0
pretty-format: ^24.9.0
checksum: 8cf742ea934f40d9c6a71f2c975fb42a93fc24ffaf9b78d98d9cfd420f705bb2e31738d07273d5ce1d099255a6314df3a247a9a8eb6e228d586f8743cdb2565e
languageName: node
linkType: hard

"constant-case@npm:^3.0.4":
version: 3.0.4
resolution: "constant-case@npm:3.0.4"
Expand Down

0 comments on commit 53f56a4

Please sign in to comment.