@types/babel-template
TypeScript icon, indicating that this package has built-in type declarations

6.25.5 • Public • Published

Installation

npm install --save @types/babel-template

Summary

This package contains type definitions for babel-template (https://github.com/babel/babel/tree/master/packages/babel-template).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel-template.

index.d.ts

import * as t from "babel-types";
import { BabylonOptions } from "babylon";
type Node = t.Node;

// NB: This export doesn't match the handbook example, where `template` is the default export.
// But it does match the runtime behaviour (at least at the time of this writing). For some reason,
// babel-template/lib/index.js has this line at the bottom: module.exports = exports["default"];
export = template;
declare function template(code: string, opts?: BabylonOptions): UseTemplate;

type UseTemplate = (nodes?: { [placeholder: string]: Node }) => Node;

Additional Details

Credits

These definitions were written by Troy Gerwien, and Marvin Hagemeister.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/babel-template

Weekly Downloads

129,570

Version

6.25.5

License

MIT

Unpacked Size

4.14 kB

Total Files

5

Last publish

Collaborators

  • types