From ff6f767fac8a263eaba578329989bc21c09deb16 Mon Sep 17 00:00:00 2001 From: fershad <27988517+fershad@users.noreply.github.com> Date: Mon, 8 Jan 2024 12:02:46 +0800 Subject: [PATCH 1/4] remove index.d.ts file --- index.d.ts | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 4610950..0000000 --- a/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare module '@tgwf/co2'; - From b5d88284b0e939bb0fceb7fc4605124f2fa7c7d8 Mon Sep 17 00:00:00 2001 From: fershad <27988517+fershad@users.noreply.github.com> Date: Mon, 8 Jan 2024 12:03:02 +0800 Subject: [PATCH 2/4] add guidance on installing type definitions --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index b702fc7..fc854a9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # CO2.js + [![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-) + @@ -75,6 +77,14 @@ You can also build the CO2.js library from the source code. To do this: - `dist/esm` - An ES Modules compatible build. - `dist/iife` - An Immediately Invoked Function Expression (IIFE) version of the library. +## Using CO2.js in TypeScript projects + +Type definitions for CO2.js are published in the DefinitelyTyped project, and are available on NPM at `@types/tgwf__co2`. + +If you want to use type definitions in your project, they should be installed as a devDependency. + +`npm install --dev @types/tgwf__co2` + ## Marginal and average emissions intensity data CO2.js includes yearly average grid intensity data from [Ember](https://ember-climate.org/data/data-explorer/), as well as marginal intensity data from the [UNFCCC](https://unfccc.int/) (United Nations Framework Convention on Climate Change). You can find the data in JSON and CommonJS Module format in the `data/output` folder. From bf834fe8225dc8a778a7252069d12c844733aab2 Mon Sep 17 00:00:00 2001 From: fershad <27988517+fershad@users.noreply.github.com> Date: Mon, 8 Jan 2024 12:06:51 +0800 Subject: [PATCH 3/4] add links to npm and DT --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fc854a9..c7b2449 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ You can also build the CO2.js library from the source code. To do this: ## Using CO2.js in TypeScript projects -Type definitions for CO2.js are published in the DefinitelyTyped project, and are available on NPM at `@types/tgwf__co2`. +Type definitions for CO2.js are [published in the DefinitelyTyped project](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tgwf__co2), and are [available on NPM](https://www.npmjs.com/package/@types/tgwf__co2) at `@types/tgwf__co2`. If you want to use type definitions in your project, they should be installed as a devDependency. From e53da02e085ee1d08c5e0bf9db11b62c4f2dc511 Mon Sep 17 00:00:00 2001 From: fershad <27988517+fershad@users.noreply.github.com> Date: Mon, 8 Jan 2024 12:09:31 +0800 Subject: [PATCH 4/4] change title --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c7b2449..6c48f18 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ You can also build the CO2.js library from the source code. To do this: - `dist/esm` - An ES Modules compatible build. - `dist/iife` - An Immediately Invoked Function Expression (IIFE) version of the library. -## Using CO2.js in TypeScript projects +## TypeScript support Type definitions for CO2.js are [published in the DefinitelyTyped project](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tgwf__co2), and are [available on NPM](https://www.npmjs.com/package/@types/tgwf__co2) at `@types/tgwf__co2`.