@types/estree
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The @types/estree package provides TypeScript definitions for the ESTree specification.
The @types/estree package is mainly used by adding it as a dependency to your JavaScript project. This is done by simply installing the package via npm like so:
npm install --save @types/estree
Once installed, you can then import and use its definitions in your TypeScript files. Here's a basic usage example:
import * as ESTree from "@types/estree";
let node: ESTree.Node = {
type: "Identifier",
name: "foo"
};
console.log(node.name); // prints: foo
In the above example, we have defined a variable node
of type ESTree.Node
. This package provides many such pre-defined typings that makes working with the ESTree specification easier.
The documentation for the @types/estree package is not provided in the readme file of the repository. On GitHub, the best source of documentation is the code itself as the TypeScript definitions are self-explanatory and directly relate to the ESTree specification. You can navigate to the DefinitelyTyped repository shared in your question and go to the @types/estree
folder to check the TypeScript definition files.