Skip to content

Commit 27e2ed4

Browse files
authored
Use type definitions from DefinitelyTyped.
2 parents b22bf09 + e53da02 commit 27e2ed4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# CO2.js
22

33
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
4+
45
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-)
6+
57
<!-- ALL-CONTRIBUTORS-BADGE:END -->
68

79
<img src="https://github.com/thegreenwebfoundation/co2.js/actions/workflows/unittests.yml/badge.svg" />
@@ -75,6 +77,14 @@ You can also build the CO2.js library from the source code. To do this:
7577
- `dist/esm` - An ES Modules compatible build.
7678
- `dist/iife` - An Immediately Invoked Function Expression (IIFE) version of the library.
7779

80+
## TypeScript support
81+
82+
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`.
83+
84+
If you want to use type definitions in your project, they should be installed as a devDependency.
85+
86+
`npm install --dev @types/tgwf__co2`
87+
7888
## Marginal and average emissions intensity data
7989

8090
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.

index.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)