1 | // Type definitions for babel-template 6.25
|
2 | // Project: https://github.com/babel/babel/tree/master/packages/babel-template, https://babeljs.io
|
3 | // Definitions by: Troy Gerwien <https://github.com/yortus>
|
4 | // Marvin Hagemeister <https://github.com/marvinhagemeister>
|
5 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
6 | // TypeScript Version: 2.8
|
7 |
|
8 | import { BabylonOptions } from 'babylon';
|
9 | import * as t from 'babel-types';
|
10 | type Node = t.Node;
|
11 |
|
12 | // NB: This export doesn't match the handbook example, where `template` is the default export.
|
13 | // But it does match the runtime behaviour (at least at the time of this writing). For some reason,
|
14 | // babel-template/lib/index.js has this line at the bottom: module.exports = exports["default"];
|
15 | export = template;
|
16 | declare function template(code: string, opts?: BabylonOptions): UseTemplate;
|
17 |
|
18 | type UseTemplate = (nodes?: {[placeholder: string]: Node}) => Node;
|