diff --git a/package.json b/package.json index 2d3baa7..4c49070 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "README.md", "LICENSE" ], + "types": "./types/index.d.ts", "scripts": { "build": "babel src -d dist --ignore *.test.js", "contributor": "all-contributors add", @@ -41,6 +42,7 @@ }, "homepage": "https://github.com/mattphillips/jest-chain#readme", "devDependencies": { + "@types/jest": "^23.3.7", "all-contributors-cli": "^4.11.1", "babel-cli": "^6.26.0", "babel-core": "^6.26.3", diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 0000000..cf79a17 --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,13 @@ +declare namespace jest { + type ChainedMatchers = { [K in keyof jest.Matchers]: jest.Matchers>[K] }; + + interface Expect { + /** + * The `expect` function is used every time you want to test a value. + * You will rarely call `expect` by itself. + * + * @param actual The value to apply matchers against. + */ + (actual: T): ChainedMatchers; + } +} diff --git a/yarn.lock b/yarn.lock index 307c2a9..635e888 100644 --- a/yarn.lock +++ b/yarn.lock @@ -92,6 +92,10 @@ lodash "^4.2.0" to-fast-properties "^2.0.0" +"@types/jest@^23.3.7": + version "23.3.7" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.7.tgz#77f9a4332ccf8db680a31818ade3ee454c831a79" + abab@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e"