From 14370d8d7eaa38a4b28d2c86755d71344b69b624 Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Thu, 8 Jul 2021 21:37:09 -0400 Subject: [PATCH 1/2] Add api-extractor --- package.json | 1 + yarn.lock | 220 ++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 212 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 031361c6e..cb08e6723 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "@babel/plugin-transform-runtime": "^7.12.1", "@babel/preset-env": "^7.12.1", "@babel/preset-typescript": "^7.14.5", + "@microsoft/api-extractor": "^7.18.1", "@rollup/plugin-babel": "^5.2.1", "@rollup/plugin-commonjs": "^15.1.0", "@rollup/plugin-node-resolve": "^9.0.0", diff --git a/yarn.lock b/yarn.lock index 21b267277..9094f2a79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2665,6 +2665,58 @@ __metadata: languageName: node linkType: hard +"@microsoft/api-extractor-model@npm:7.13.3": + version: 7.13.3 + resolution: "@microsoft/api-extractor-model@npm:7.13.3" + dependencies: + "@microsoft/tsdoc": 0.13.2 + "@microsoft/tsdoc-config": ~0.15.2 + "@rushstack/node-core-library": 3.39.0 + checksum: c11cec9be6e54daaa855b5f430f9039e9d0f1ef59cefeecb609fbad3471f5b3589cdbea5e0197c4d771bf80efffb3bc1fa21e327f2aa295ff0c226271e441bc7 + languageName: node + linkType: hard + +"@microsoft/api-extractor@npm:^7.18.1": + version: 7.18.1 + resolution: "@microsoft/api-extractor@npm:7.18.1" + dependencies: + "@microsoft/api-extractor-model": 7.13.3 + "@microsoft/tsdoc": 0.13.2 + "@microsoft/tsdoc-config": ~0.15.2 + "@rushstack/node-core-library": 3.39.0 + "@rushstack/rig-package": 0.2.12 + "@rushstack/ts-command-line": 4.8.0 + colors: ~1.2.1 + lodash: ~4.17.15 + resolve: ~1.17.0 + semver: ~7.3.0 + source-map: ~0.6.1 + typescript: ~4.3.2 + bin: + api-extractor: bin/api-extractor + checksum: 99543ed1325f2453cab57478457ed1424e659991f439fd2a291e1d81e8a53836a5b624b2acfe049029f5e469796603bf7e2a617f37d7ce9bf61f0e92ac3dda0f + languageName: node + linkType: hard + +"@microsoft/tsdoc-config@npm:~0.15.2": + version: 0.15.2 + resolution: "@microsoft/tsdoc-config@npm:0.15.2" + dependencies: + "@microsoft/tsdoc": 0.13.2 + ajv: ~6.12.6 + jju: ~1.4.0 + resolve: ~1.19.0 + checksum: 1b6ba953ca8f82b9e2ae920ef48014c186ffdd8ee43b3e493bbafd8270a199829bf8a64929c6a19b537ec8df295b285eb365026fa0633d2f4529bca2ab009bc8 + languageName: node + linkType: hard + +"@microsoft/tsdoc@npm:0.13.2": + version: 0.13.2 + resolution: "@microsoft/tsdoc@npm:0.13.2" + checksum: b0ddc7689f52a69e0472fd9ca30d8242d4d7bae5cb5d3d86f2ad394a122d63feee0a82276fc2dc6b199bb96c20b309bcd3ab3c6517ddd70b98d8ae890b6995ab + languageName: node + linkType: hard + "@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents.2": version: 2.1.8-no-fsevents.2 resolution: "@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents.2" @@ -2943,6 +2995,45 @@ __metadata: languageName: node linkType: hard +"@rushstack/node-core-library@npm:3.39.0": + version: 3.39.0 + resolution: "@rushstack/node-core-library@npm:3.39.0" + dependencies: + "@types/node": 10.17.13 + colors: ~1.2.1 + fs-extra: ~7.0.1 + import-lazy: ~4.0.0 + jju: ~1.4.0 + resolve: ~1.17.0 + semver: ~7.3.0 + timsort: ~0.3.0 + z-schema: ~3.18.3 + checksum: c9765094bee7174836aeee89f697c5a7909368da105c313530adb36c57a980d3e63f136797dbd8d98d16b5de2a742b7024f7f41f07ed77d430ceefdcd13b82d6 + languageName: node + linkType: hard + +"@rushstack/rig-package@npm:0.2.12": + version: 0.2.12 + resolution: "@rushstack/rig-package@npm:0.2.12" + dependencies: + resolve: ~1.17.0 + strip-json-comments: ~3.1.1 + checksum: 29375efc039a3e9446c78c345566c0f67896f753ac66e21c4cfdab87d438b93c26e261f77b872eb6f8a0feac47f7a023d86db94ce14ccad3e14916d62cf9481b + languageName: node + linkType: hard + +"@rushstack/ts-command-line@npm:4.8.0": + version: 4.8.0 + resolution: "@rushstack/ts-command-line@npm:4.8.0" + dependencies: + "@types/argparse": 1.0.38 + argparse: ~1.0.9 + colors: ~1.2.1 + string-argv: ~0.3.1 + checksum: 8c5fcf00fcff1f0881b3cbb9c55ae533ca3e79963a28201bf62ff4aa3593370d1de3ec40c02f0893d49e4a4b9c9f69d3594914efe5afe67764835421a1e45d86 + languageName: node + linkType: hard + "@sideway/address@npm:^4.1.0": version: 4.1.2 resolution: "@sideway/address@npm:4.1.2" @@ -3235,6 +3326,13 @@ __metadata: languageName: node linkType: hard +"@types/argparse@npm:1.0.38": + version: 1.0.38 + resolution: "@types/argparse@npm:1.0.38" + checksum: 4b80a5e5c6c23fd48c88d7aab0b49e5b90285d570f2856bbaadf62538f261faaab0ee9246f25d98cb9c85a5a712d6619cad662644fe704b6a720cf1b85bbffce + languageName: node + linkType: hard + "@types/aria-query@npm:^4.2.0": version: 4.2.1 resolution: "@types/aria-query@npm:4.2.1" @@ -3458,6 +3556,13 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:10.17.13": + version: 10.17.13 + resolution: "@types/node@npm:10.17.13" + checksum: 54c6ee789e8013ba531c07e869b5a49cb6340fe59fdd4181aed65c0df9c78dab93a4098c88b726cbe9bd8f5000f5675de996290374de08cf43e3b989f23ecc4a + languageName: node + linkType: hard + "@types/node@npm:^15.0.1": version: 15.14.1 resolution: "@types/node@npm:15.14.1" @@ -4056,7 +4161,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.1.0, ajv@npm:^6.10.0, ajv@npm:^6.12.4, ajv@npm:^6.12.5": +"ajv@npm:^6.1.0, ajv@npm:^6.10.0, ajv@npm:^6.12.4, ajv@npm:^6.12.5, ajv@npm:~6.12.6": version: 6.12.6 resolution: "ajv@npm:6.12.6" dependencies: @@ -4333,7 +4438,7 @@ __metadata: languageName: node linkType: hard -"argparse@npm:^1.0.7": +"argparse@npm:^1.0.7, argparse@npm:~1.0.9": version: 1.0.10 resolution: "argparse@npm:1.0.10" dependencies: @@ -5719,6 +5824,13 @@ __metadata: languageName: node linkType: hard +"colors@npm:~1.2.1": + version: 1.2.5 + resolution: "colors@npm:1.2.5" + checksum: c396fe2a268fd95f37de874a4eb0f542698a6fd775bcecffdb8aa01fe6c67b4aab81bd7a93ee2f7a248f29a161446c1719d4590aff5e26e7315c7b9d473a513d + languageName: node + linkType: hard + "combine-promises@npm:^1.1.0": version: 1.1.0 resolution: "combine-promises@npm:1.1.0" @@ -5749,7 +5861,7 @@ __metadata: languageName: node linkType: hard -"commander@npm:^2.19.0, commander@npm:^2.20.0, commander@npm:^2.5.0": +"commander@npm:^2.19.0, commander@npm:^2.20.0, commander@npm:^2.5.0, commander@npm:^2.7.1": version: 2.20.3 resolution: "commander@npm:2.20.3" checksum: b73428e97de7624323f81ba13f8ed9271de487017432d18b4da3f07cfc528ad754bbd199004bd5d14e0ccd67d1fdfe0ec8dbbd4c438b401df3c4cc387bfd1daa @@ -8245,6 +8357,17 @@ __metadata: languageName: node linkType: hard +"fs-extra@npm:~7.0.1": + version: 7.0.1 + resolution: "fs-extra@npm:7.0.1" + dependencies: + graceful-fs: ^4.1.2 + jsonfile: ^4.0.0 + universalify: ^0.1.0 + checksum: 0de3773953a13b517f053dbfa291166da076cc563cdd8f0ecefc64018ab15d2614f1707860b82e6b0e41695f613c1855f410749bd01bcb585f0243b1018a6595 + languageName: node + linkType: hard + "fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" @@ -9211,6 +9334,13 @@ __metadata: languageName: node linkType: hard +"import-lazy@npm:~4.0.0": + version: 4.0.0 + resolution: "import-lazy@npm:4.0.0" + checksum: 8b87df6e579fb3d7c66d43efd25a46c3c61d636a1a48696d8a49d5592e1be97867fbb46de795e8f4311e85bc4eec78f9d7c638656bc41a2ecc53b9ed7883b423 + languageName: node + linkType: hard + "import-local@npm:^2.0.0": version: 2.0.0 resolution: "import-local@npm:2.0.0" @@ -9533,7 +9663,7 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.2.0, is-core-module@npm:^2.4.0": +"is-core-module@npm:^2.1.0, is-core-module@npm:^2.2.0, is-core-module@npm:^2.4.0": version: 2.4.0 resolution: "is-core-module@npm:2.4.0" dependencies: @@ -10638,6 +10768,13 @@ __metadata: languageName: node linkType: hard +"jju@npm:~1.4.0": + version: 1.4.0 + resolution: "jju@npm:1.4.0" + checksum: a58023d40e8e262366e95175dec782c7dc6ad94f2ad1fafe91f675ca6177505b4a8e679cec49c800acb8ceab9391856c7c03e871b30ef0590115d081fad814b9 + languageName: node + linkType: hard + "joi@npm:^17.3.0, joi@npm:^17.4.0": version: 17.4.0 resolution: "joi@npm:17.4.0" @@ -11168,6 +11305,20 @@ __metadata: languageName: node linkType: hard +"lodash.get@npm:^4.0.0": + version: 4.4.2 + resolution: "lodash.get@npm:4.4.2" + checksum: 447e575e3caa5131ef44e5a0c135b1614f3c937d86b3be0568f9da7b0fd015010af3b6b4e41edf6e2698c9ce2dcc061ca71b31f274f799c991dceb018be16e4f + languageName: node + linkType: hard + +"lodash.isequal@npm:^4.0.0": + version: 4.5.0 + resolution: "lodash.isequal@npm:4.5.0" + checksum: 5b47e094641c18a915497343894c66f7da6aebb9aaa2a3fcc5643455aaf29d19df60ebbed664c8374fb959c8b4ce96810ee6becd8a71ac58c6c2ca8d29762947 + languageName: node + linkType: hard + "lodash.map@npm:^4.4.0": version: 4.6.0 resolution: "lodash.map@npm:4.6.0" @@ -11245,7 +11396,7 @@ __metadata: languageName: node linkType: hard -"lodash@npm:^4.17.11, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.3.0, lodash@npm:^4.7.0": +"lodash@npm:^4.17.11, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.3.0, lodash@npm:^4.7.0, lodash@npm:~4.17.15": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: 4983720b9abca930a4a46f18db163d7dad8dd00dbed6db0cc7b499b33b717cce69f80928b27bbb1ff2cbd3b19d251ee90669a8b5ea466072ca81c2ebe91e7468 @@ -14290,6 +14441,7 @@ __metadata: "@babel/preset-env": ^7.12.1 "@babel/preset-typescript": ^7.14.5 "@babel/runtime": ^7.12.1 + "@microsoft/api-extractor": ^7.18.1 "@rollup/plugin-babel": ^5.2.1 "@rollup/plugin-commonjs": ^15.1.0 "@rollup/plugin-node-resolve": ^9.0.0 @@ -14955,6 +15107,25 @@ __metadata: languageName: node linkType: hard +"resolve@npm:~1.17.0": + version: 1.17.0 + resolution: "resolve@npm:1.17.0" + dependencies: + path-parse: ^1.0.6 + checksum: 5e3cdb8cf68c20b0c5edeb6505e7fab20c6776af0cae4b978836e557420aef7bb50acd25339bbb143b7f80533aa1988c7e827a0061aee9c237926a7d2c41f8d0 + languageName: node + linkType: hard + +"resolve@npm:~1.19.0": + version: 1.19.0 + resolution: "resolve@npm:1.19.0" + dependencies: + is-core-module: ^2.1.0 + path-parse: ^1.0.6 + checksum: 8b23c7fde1224898ffb9fec2a2295a44d1564981343bdbf5fd3769465658f6a6f6647bb7ea66dfb3c1291ca86046b0233be2edfcd8ca05b38886521e8869677c + languageName: node + linkType: hard + "responselike@npm:^1.0.2": version: 1.0.2 resolution: "responselike@npm:1.0.2" @@ -15320,7 +15491,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.2.1, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5": +"semver@npm:^7.2.1, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:~7.3.0": version: 7.3.5 resolution: "semver@npm:7.3.5" dependencies: @@ -16016,6 +16187,13 @@ __metadata: languageName: node linkType: hard +"string-argv@npm:~0.3.1": + version: 0.3.1 + resolution: "string-argv@npm:0.3.1" + checksum: 002a6902698eff6bd463ddd2b03864bf9be08a1359879243d94d3906ebbe984ff355d73224064be7504d20262eadb06897b3d40b5d7cefccacc69c9dc45c8d0e + languageName: node + linkType: hard + "string-length@npm:^4.0.1": version: 4.0.2 resolution: "string-length@npm:4.0.2" @@ -16221,7 +16399,7 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:^3.1.0, strip-json-comments@npm:^3.1.1": +"strip-json-comments@npm:^3.1.0, strip-json-comments@npm:^3.1.1, strip-json-comments@npm:~3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" checksum: f16719ce25abc58a55ef82b1c27f541dcfa5d544f17158f62d10be21ff9bd22fde45a53c592b29d80ad3c97ccb67b7451c4833913fdaeadb508a40f5e0a9c206 @@ -16550,7 +16728,7 @@ __metadata: languageName: node linkType: hard -"timsort@npm:^0.3.0": +"timsort@npm:^0.3.0, timsort@npm:~0.3.0": version: 0.3.0 resolution: "timsort@npm:0.3.0" checksum: d8300c3ecf1a3751413de82b04ad283b461ab6fb1041820c825d13b4ae74526e2101ab5fb84c57a0c6e1f4d7f67173b5d8754ed8bb7447c6a9ce1db8562eb82c @@ -16826,7 +17004,7 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^4.3.4": +"typescript@npm:^4.3.4, typescript@npm:~4.3.2": version: 4.3.5 resolution: "typescript@npm:4.3.5" bin: @@ -17348,6 +17526,13 @@ __metadata: languageName: node linkType: hard +"validator@npm:^8.0.0": + version: 8.2.0 + resolution: "validator@npm:8.2.0" + checksum: a5be1d5728164f69b615986152e3fa7723e877abf5630f6c7153cfadfbd1bd971ddc2998063896b81a25efc067df14a420d074916a4010a6d3ad5b00a191bf99 + languageName: node + linkType: hard + "value-equal@npm:^1.0.1": version: 1.0.1 resolution: "value-equal@npm:1.0.1" @@ -18115,6 +18300,23 @@ __metadata: languageName: node linkType: hard +"z-schema@npm:~3.18.3": + version: 3.18.4 + resolution: "z-schema@npm:3.18.4" + dependencies: + commander: ^2.7.1 + lodash.get: ^4.0.0 + lodash.isequal: ^4.0.0 + validator: ^8.0.0 + dependenciesMeta: + commander: + optional: true + bin: + z-schema: ./bin/z-schema + checksum: c19563899a8c1077c5350e9bb5c013729cb8b2168394a7c8d91091f1c6c269f7616a08c1218045a05322338ae29035d8ff2d674690425ef4c08388ba3d3ed875 + languageName: node + linkType: hard + "zwitch@npm:^1.0.0": version: 1.0.5 resolution: "zwitch@npm:1.0.5" From a1ed346e35a7d035dcc5c0fc402614ad73ee0546 Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Thu, 8 Jul 2021 21:38:40 -0400 Subject: [PATCH 2/2] Add initial API Extractor configs and output files --- api-extractor.dt-types.json | 356 ++++++++++++++++++++++++++++ api-extractor.json | 356 ++++++++++++++++++++++++++++ etc/react-redux.api.md | 321 +++++++++++++++++++++++++ etc/react-redux.dt-types.api.md | 407 ++++++++++++++++++++++++++++++++ package.json | 1 + 5 files changed, 1441 insertions(+) create mode 100644 api-extractor.dt-types.json create mode 100644 api-extractor.json create mode 100644 etc/react-redux.api.md create mode 100644 etc/react-redux.dt-types.api.md diff --git a/api-extractor.dt-types.json b/api-extractor.dt-types.json new file mode 100644 index 000000000..5b7e322d6 --- /dev/null +++ b/api-extractor.dt-types.json @@ -0,0 +1,356 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + "projectFolder": ".", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "node_modules/@types/react-redux/index.d.ts", + //"mainEntryPointFilePath": "/home/weber/tmp/rtk-origin-master/dist/index.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we can specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + */ + "bundledPackages": [], + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true, + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + "reportFileName": "react-redux.dt-types.api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + "reportFolder": "/etc/" + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/" + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": false + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": false, + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + "untrimmedFilePath": "/es/typings.d.ts" + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + "enabled": false + + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning" + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + } + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + }, + "ae-forgotten-export": { + "logLevel": "none", + "addToApiReportFile": false + } + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } +} diff --git a/api-extractor.json b/api-extractor.json new file mode 100644 index 000000000..e815a3241 --- /dev/null +++ b/api-extractor.json @@ -0,0 +1,356 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + "projectFolder": ".", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "es/index.d.ts", + //"mainEntryPointFilePath": "/home/weber/tmp/rtk-origin-master/dist/index.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we can specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + */ + "bundledPackages": [], + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true, + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + "reportFileName": "react-redux.api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + "reportFolder": "/etc/" + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/" + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": false + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": false, + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + "untrimmedFilePath": "/es/typings.d.ts" + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + "enabled": false + + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning" + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + } + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + }, + "ae-forgotten-export": { + "logLevel": "none", + "addToApiReportFile": false + } + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } +} diff --git a/etc/react-redux.api.md b/etc/react-redux.api.md new file mode 100644 index 000000000..a5eedaa0e --- /dev/null +++ b/etc/react-redux.api.md @@ -0,0 +1,321 @@ +## API Report File for "react-redux" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +/// +/// + +import { Action } from 'redux'; +import { AnyAction } from 'redux'; +import { unstable_batchedUpdates as batch } from 'react-dom'; +import { ClassAttributes } from 'react'; +import { ComponentClass } from 'react'; +import { ComponentType } from 'react'; +import { Context } from 'react'; +import { Dispatch } from 'redux'; +import { ForwardRefExoticComponent } from 'react'; +import hoistStatics from 'hoist-non-react-statics'; +import { MemoExoticComponent } from 'react'; +import { NamedExoticComponent } from 'react'; +import { NonReactStatics } from 'hoist-non-react-statics'; +import { default as React_2 } from 'react'; +import { ReactNode } from 'react'; +import { RefAttributes } from 'react'; +import { Store } from 'redux'; + +// @public (undocumented) +export type AdvancedComponentDecorator = (component: ComponentType) => NamedExoticComponent; + +// @public (undocumented) +export type AnyIfEmpty = keyof T extends never ? any : T; + +export { batch } + +// @public (undocumented) +export const connect: (mapStateToProps: MapStateToPropsParam, mapDispatchToProps: unknown, mergeProps: MergeProps, { pure, areStatesEqual, areOwnPropsEqual, areStatePropsEqual, areMergedPropsEqual, ...extraOptions }?: ConnectOptions) => >(WrappedComponent: WC) => (ForwardRefExoticComponent> & { + WrappedComponent: WC; +} & NonReactStatics) | ((({ + (props: ConnectProps & TOwnProps): JSX.Element; + displayName: string; +} | MemoExoticComponent< { +(props: ConnectProps & TOwnProps): JSX.Element; +displayName: string; +}>) & { + WrappedComponent: WC; +}) & NonReactStatics); + +// @public (undocumented) +export function connectAdvanced(selectorFactory: SelectorFactory, { getDisplayName, methodName, shouldHandleStateChanges, forwardRef, context, ...connectOptions }?: ConnectAdvancedOptions & Partial): >(WrappedComponent: WC) => (React_2.ForwardRefExoticComponent> & { + WrappedComponent: WC; +} & hoistStatics.NonReactStatics) | ((({ + (props: ConnectProps & TOwnProps_1): JSX.Element; + displayName: string; +} | React_2.MemoExoticComponent<{ + (props: ConnectProps & TOwnProps_1): JSX.Element; + displayName: string; +}>) & { + WrappedComponent: WC; +}) & hoistStatics.NonReactStatics); + +// @public (undocumented) +export interface ConnectAdvancedOptions { + // (undocumented) + context?: typeof ReactReduxContext; + // (undocumented) + forwardRef?: boolean; + // (undocumented) + getDisplayName?: (name: string) => string; + // (undocumented) + methodName?: string; + // (undocumented) + pure?: boolean; + // (undocumented) + shouldHandleStateChanges?: boolean; +} + +// @public (undocumented) +export type ConnectedComponent, P> = NamedExoticComponent> & NonReactStatics & { + WrappedComponent: C; +}; + +// @public (undocumented) +export interface ConnectProps { + // (undocumented) + context?: ReactReduxContextInstance; + // (undocumented) + reactReduxForwardedRef?: React_2.ForwardedRef; + // (undocumented) + store?: Store; +} + +// @public +export function createDispatchHook(context?: Context | null>): () => Dispatch; + +// @public +export function createSelectorHook(context?: Context | null>): (selector: (state: TState) => Selected, equalityFn?: EqualityFn) => Selected; + +// @public +export function createStoreHook(context?: Context | null>): () => Store; + +// @public +export interface DefaultRootState { +} + +// @public (undocumented) +export interface DispatchProp { + // (undocumented) + dispatch: Dispatch; +} + +// @public (undocumented) +export type DistributiveOmit = T extends unknown ? Omit_2 : never; + +// @public (undocumented) +export type EqualityFn = (a: T | undefined, b: T | undefined) => boolean; + +// @public (undocumented) +export type FixTypeLater = any; + +// @public (undocumented) +export type GetProps = C extends ComponentType ? C extends ComponentClass

? ClassAttributes> & P : P : never; + +// @public (undocumented) +export type HandleThunkActionCreator = TActionCreator extends (...args: any[]) => any ? InferThunkActionCreatorType : TActionCreator; + +// @public (undocumented) +export type InferableComponentEnhancer = InferableComponentEnhancerWithProps; + +// @public (undocumented) +export type InferableComponentEnhancerWithProps = >>>(component: C) => ConnectedComponent, keyof Shared>> & TNeedsProps>; + +// @public (undocumented) +export type InferThunkActionCreatorType any> = TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn ? (...args: TParams) => TReturn : TActionCreator; + +// @public (undocumented) +export type MapDispatchToProps = MapDispatchToPropsFunction | TDispatchProps; + +// @public (undocumented) +export type MapDispatchToPropsFactory = (dispatch: Dispatch, ownProps: TOwnProps) => MapDispatchToPropsFunction; + +// @public (undocumented) +export type MapDispatchToPropsFunction = (dispatch: Dispatch, ownProps: TOwnProps) => TDispatchProps; + +// @public (undocumented) +export type MapDispatchToPropsNonObject = MapDispatchToPropsFactory | MapDispatchToPropsFunction; + +// @public (undocumented) +export type MapDispatchToPropsParam = MapDispatchToPropsFactory | MapDispatchToProps; + +// @public (undocumented) +export type MapStateToProps = (state: State, ownProps: TOwnProps) => TStateProps; + +// @public (undocumented) +export type MapStateToPropsFactory = (initialState: State, ownProps: TOwnProps) => MapStateToProps; + +// @public (undocumented) +export type MapStateToPropsParam = MapStateToPropsFactory | MapStateToProps | null | undefined; + +// @public +export type Matching = { + [P in keyof DecorationTargetProps]: P extends keyof InjectedProps ? InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : InjectedProps[P] : DecorationTargetProps[P]; +}; + +// @public (undocumented) +export type MergeProps = (stateProps: TStateProps, dispatchProps: TDispatchProps, ownProps: TOwnProps) => TMergedProps; + +// @public (undocumented) +type Omit_2 = Pick>; +export { Omit_2 as Omit } + +// @public (undocumented) +export function Provider({ store, context, children }: ProviderProps): JSX.Element; + +// @public (undocumented) +export interface ProviderProps { + // (undocumented) + children: ReactNode; + context?: Context; + store: Store; +} + +// @public (undocumented) +export const ReactReduxContext: React_2.Context | null>; + +// @public (undocumented) +export interface ReactReduxContextValue { + // (undocumented) + store: Store; + // (undocumented) + subscription: Subscription; +} + +// @public (undocumented) +export type ResolveArrayThunks> = TDispatchProps extends [ +infer A1, +infer A2, +infer A3, +infer A4, +infer A5, +infer A6, +infer A7, +infer A8, +infer A9 +] ? [ +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator +] : TDispatchProps extends [ +infer A1, +infer A2, +infer A3, +infer A4, +infer A5, +infer A6, +infer A7, +infer A8 +] ? [ +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator +] : TDispatchProps extends [ +infer A1, +infer A2, +infer A3, +infer A4, +infer A5, +infer A6, +infer A7 +] ? [ +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator +] : TDispatchProps extends [ +infer A1, +infer A2, +infer A3, +infer A4, +infer A5, +infer A6 +] ? [ +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator +] : TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5] ? [ +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator +] : TDispatchProps extends [infer A1, infer A2, infer A3, infer A4] ? [ +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator +] : TDispatchProps extends [infer A1, infer A2, infer A3] ? [ +HandleThunkActionCreator, +HandleThunkActionCreator, +HandleThunkActionCreator +] : TDispatchProps extends [infer A1, infer A2] ? [HandleThunkActionCreator, HandleThunkActionCreator] : TDispatchProps extends [infer A1] ? [HandleThunkActionCreator] : TDispatchProps extends Array ? Array> : TDispatchProps extends ReadonlyArray ? ReadonlyArray> : never; + +// @public (undocumented) +export type ResolveThunks = TDispatchProps extends { + [key: string]: any; +} ? { + [C in keyof TDispatchProps]: HandleThunkActionCreator; +} : TDispatchProps; + +// @public (undocumented) +export type RootStateOrAny = AnyIfEmpty; + +// @public (undocumented) +export type Selector = TOwnProps extends null | undefined ? (state: S) => TProps : (state: S, ownProps: TOwnProps) => TProps; + +// @public (undocumented) +export type SelectorFactory = (dispatch: Dispatch, factoryOptions: TFactoryOptions) => Selector; + +// @public (undocumented) +export function shallowEqual(objA: any, objB: any): boolean; + +// @public +export type Shared = { + [P in Extract]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never; +}; + +// @public +export interface TypedUseSelectorHook { + // (undocumented) + (selector: (state: TState) => TSelected, equalityFn?: (left: TSelected, right: TSelected) => boolean): TSelected; +} + +// @public +export const useDispatch: () => Dispatch; + +// @public +export const useSelector: (selector: (state: TState) => Selected, equalityFn?: EqualityFn | undefined) => Selected; + +// @public +export const useStore: () => Store; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/etc/react-redux.dt-types.api.md b/etc/react-redux.dt-types.api.md new file mode 100644 index 000000000..418d1175d --- /dev/null +++ b/etc/react-redux.dt-types.api.md @@ -0,0 +1,407 @@ +## API Report File for "react-redux" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { Action } from 'redux'; +import { AnyAction } from 'redux'; +import { ClassAttributes } from 'react'; +import { Component } from 'react'; +import { ComponentClass } from 'react'; +import { ComponentType } from 'react'; +import { Context } from 'react'; +import { Dispatch } from 'redux'; +import hoistNonReactStatics = require('hoist-non-react-statics'); +import { NamedExoticComponent } from 'react'; +import { Store } from 'redux'; + +// @public (undocumented) +export type AdvancedComponentDecorator = +(component: ComponentType) => NamedExoticComponent; + +// @public (undocumented) +export type AnyIfEmpty = keyof T extends never ? any : T; + +// @public +export function batch(cb: () => void): void; + +// @public +export interface Connect { + // tslint:disable:no-unnecessary-generics + // (undocumented) + (): InferableComponentEnhancer; + + // (undocumented) + ( + mapStateToProps: MapStateToPropsParam + ): InferableComponentEnhancerWithProps; + + // (undocumented) + ( + mapStateToProps: null | undefined, + mapDispatchToProps: MapDispatchToPropsNonObject + ): InferableComponentEnhancerWithProps; + + // (undocumented) + ( + mapStateToProps: null | undefined, + mapDispatchToProps: MapDispatchToPropsParam, + ): InferableComponentEnhancerWithProps< + ResolveThunks, + TOwnProps + >; + + // (undocumented) + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: MapDispatchToPropsNonObject + ): InferableComponentEnhancerWithProps; + + // (undocumented) + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: MapDispatchToPropsParam, + ): InferableComponentEnhancerWithProps< + TStateProps & ResolveThunks, + TOwnProps + >; + + // (undocumented) + ( + mapStateToProps: null | undefined, + mapDispatchToProps: null | undefined, + mergeProps: MergeProps, + ): InferableComponentEnhancerWithProps; + + // (undocumented) + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: null | undefined, + mergeProps: MergeProps, + ): InferableComponentEnhancerWithProps; + + // (undocumented) + ( + mapStateToProps: null | undefined, + mapDispatchToProps: MapDispatchToPropsParam, + mergeProps: MergeProps, + ): InferableComponentEnhancerWithProps; + + // (undocumented) + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: null | undefined, + mergeProps: null | undefined, + options: Options + ): InferableComponentEnhancerWithProps; + + // (undocumented) + ( + mapStateToProps: null | undefined, + mapDispatchToProps: MapDispatchToPropsNonObject, + mergeProps: null | undefined, + options: Options<{}, TStateProps, TOwnProps> + ): InferableComponentEnhancerWithProps; + + // (undocumented) + ( + mapStateToProps: null | undefined, + mapDispatchToProps: MapDispatchToPropsParam, + mergeProps: null | undefined, + options: Options<{}, TStateProps, TOwnProps> + ): InferableComponentEnhancerWithProps< + ResolveThunks, + TOwnProps + >; + + // (undocumented) + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: MapDispatchToPropsNonObject, + mergeProps: null | undefined, + options: Options + ): InferableComponentEnhancerWithProps; + + // (undocumented) + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: MapDispatchToPropsParam, + mergeProps: null | undefined, + options: Options + ): InferableComponentEnhancerWithProps< + TStateProps & ResolveThunks, + TOwnProps + >; + + // (undocumented) + ( + mapStateToProps: MapStateToPropsParam, + mapDispatchToProps: MapDispatchToPropsParam, + mergeProps: MergeProps, + options?: Options + ): InferableComponentEnhancerWithProps; + // tslint:enable:no-unnecessary-generics +} + +// @public +export const connect: Connect; + +// @public +export function connectAdvanced( +// tslint:disable-next-line no-unnecessary-generics +selectorFactory: SelectorFactory, +connectOptions?: ConnectOptions & TFactoryOptions +): AdvancedComponentDecorator; + +// @public (undocumented) +export type ConnectedComponent< +C extends ComponentType, +P +> = NamedExoticComponent> & hoistNonReactStatics.NonReactStatics & { + WrappedComponent: C; +}; + +// @public +export type ConnectedProps = +TConnector extends InferableComponentEnhancerWithProps +? unknown extends TInjectedProps +? TConnector extends InferableComponentEnhancer +? TInjectedProps +: never +: TInjectedProps +: never; + +// @public (undocumented) +export interface ConnectOptions { + context?: Context; + getDisplayName?: (componentName: string) => string; + methodName?: string; + renderCountProp?: string; + shouldHandleStateChanges?: boolean; + storeKey?: string; + // @deprecated (undocumented) + withRef?: boolean; +} + +// @public +export function createDispatchHook( +context?: Context>, +): () => Dispatch; + +// @public +export function createSelectorHook( +context?: Context>, +): ( +selector: (state: S) => Selected, +equalityFn?: (previous: Selected, next: Selected) => boolean, +) => Selected; + +// @public +export function createStoreHook( +context?: Context>, +): () => Store; + +// @public +export interface DefaultRootState {} + +// @public (undocumented) +export interface DispatchProp { + // (undocumented) + dispatch: Dispatch; +} + +// @public (undocumented) +export type DistributiveOmit = T extends unknown ? Omit_2 : never; + +// @public (undocumented) +export type GetProps = C extends ComponentType +? C extends ComponentClass

? ClassAttributes> & P : P +: never; + +// @public (undocumented) +export type HandleThunkActionCreator = +TActionCreator extends (...args: any[]) => any +? InferThunkActionCreatorType +: TActionCreator; + +// @public (undocumented) +export type InferableComponentEnhancer = +InferableComponentEnhancerWithProps; + +// @public (undocumented) +export type InferableComponentEnhancerWithProps = +>>>( +component: C +) => ConnectedComponent, keyof Shared>> & TNeedsProps>; + +// @public (undocumented) +export type InferThunkActionCreatorType any> = +TActionCreator extends (...args: infer TParams) => (...args: any[]) => infer TReturn +? (...args: TParams) => TReturn +: TActionCreator; + +// @public (undocumented) +export type MapDispatchToProps = +MapDispatchToPropsFunction | TDispatchProps; + +// @public (undocumented) +export type MapDispatchToPropsFactory = +(dispatch: Dispatch, ownProps: TOwnProps) => MapDispatchToPropsFunction; + +// @public (undocumented) +export type MapDispatchToPropsFunction = +(dispatch: Dispatch, ownProps: TOwnProps) => TDispatchProps; + +// @public (undocumented) +export type MapDispatchToPropsNonObject = MapDispatchToPropsFactory | MapDispatchToPropsFunction; + +// @public (undocumented) +export type MapDispatchToPropsParam = MapDispatchToPropsFactory | MapDispatchToProps; + +// @public (undocumented) +export type MapStateToProps = +(state: State, ownProps: TOwnProps) => TStateProps; + +// @public (undocumented) +export type MapStateToPropsFactory = +(initialState: State, ownProps: TOwnProps) => MapStateToProps; + +// @public (undocumented) +export type MapStateToPropsParam = +MapStateToPropsFactory | MapStateToProps | null | undefined; + +// @public +export type Matching = { + [P in keyof DecorationTargetProps]: P extends keyof InjectedProps + ? InjectedProps[P] extends DecorationTargetProps[P] + ? DecorationTargetProps[P] + : InjectedProps[P] + : DecorationTargetProps[P]; +}; + +// @public (undocumented) +export type MergeProps = +(stateProps: TStateProps, dispatchProps: TDispatchProps, ownProps: TOwnProps) => TMergedProps; + +// @public (undocumented) +type Omit_2 = Pick>; +export { Omit_2 as Omit } + +// @public (undocumented) +export interface Options extends ConnectOptions { + areMergedPropsEqual?: (nextMergedProps: TMergedProps, prevMergedProps: TMergedProps) => boolean; + + areOwnPropsEqual?: (nextOwnProps: TOwnProps, prevOwnProps: TOwnProps) => boolean; + + areStatePropsEqual?: (nextStateProps: TStateProps, prevStateProps: TStateProps) => boolean; + + areStatesEqual?: (nextState: State, prevState: State) => boolean; + + forwardRef?: boolean; + + pure?: boolean; +} + +// @public +export class Provider extends Component> { } + +// @public (undocumented) +export interface ProviderProps { + context?: Context; + store: Store; +} + +// @public +export const ReactReduxContext: Context; + +// @public (undocumented) +export interface ReactReduxContextValue { + // (undocumented) + store: Store; + // (undocumented) + storeState: SS; +} + +// @public (undocumented) +export type ResolveArrayThunks> = +TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, infer A8, infer A9] +? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, +HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] +: TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, infer A8] +? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, +HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] +: TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7] +? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, +HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] +: TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6] +? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] +: TDispatchProps extends [infer A1, infer A2, infer A3, infer A4, infer A5] +? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] +: TDispatchProps extends [infer A1, infer A2, infer A3, infer A4] ? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] +: TDispatchProps extends [infer A1, infer A2, infer A3] ? [HandleThunkActionCreator, HandleThunkActionCreator, HandleThunkActionCreator] +: TDispatchProps extends [infer A1, infer A2] ? [HandleThunkActionCreator, HandleThunkActionCreator] +: TDispatchProps extends [infer A1] ? [HandleThunkActionCreator] +: TDispatchProps extends Array ? Array> +: TDispatchProps extends ReadonlyArray ? ReadonlyArray> +: never +; + +// @public (undocumented) +export type ResolveThunks = +TDispatchProps extends { [key: string]: any } +? { + [C in keyof TDispatchProps]: HandleThunkActionCreator +} +: TDispatchProps; + +// @public (undocumented) +export type RootStateOrAny = AnyIfEmpty; + +// @public (undocumented) +export type Selector = TOwnProps extends null | undefined +? (state: S) => TProps +: (state: S, ownProps: TOwnProps) => TProps; + +// @public +export type SelectorFactory = +(dispatch: Dispatch, factoryOptions: TFactoryOptions) => Selector; + +// @public +export function shallowEqual(left: T, right: any): boolean; + +// @public +export type Shared< +InjectedProps, +DecorationTargetProps +> = { + [P in Extract]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never; +}; + +// @public +export interface TypedUseSelectorHook { + // (undocumented) + ( + selector: (state: TState) => TSelected, + equalityFn?: (left: TSelected, right: TSelected) => boolean + ): TSelected; +} + +// @public +export function useDispatch>(): TDispatch; + +// @public (undocumented) +export function useDispatch(): Dispatch; + +// @public +export function useSelector( +selector: (state: TState) => TSelected, +equalityFn?: (left: TSelected, right: TSelected) => boolean +): TSelected; + +// @public +export function useStore(): Store; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/package.json b/package.json index cb08e6723..19ee78f8f 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "build:types": "tsc", "build": "yarn build:types && yarn build:commonjs && yarn build:es && yarn build:umd && yarn build:umd:min", "clean": "rimraf lib dist es coverage", + "api-types": "api-extractor --local", "format": "prettier --write \"{src,test}/**/*.{js,ts}\" \"docs/**/*.md\"", "lint": "eslint src --ext ts,js test/utils test/components test/hooks", "prepare": "yarn clean && yarn build",