mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
25 lines
521 B
TypeScript
25 lines
521 B
TypeScript
import Hogan = require('hogan.js');
|
|
|
|
// $ExpectType HoganTemplate
|
|
const compiled = Hogan.compile("{{#if}}{{value}}{{/if}}");
|
|
|
|
// $ExpectType string
|
|
Hogan.compile("<%_foo%><%value%><%/foo%>", {
|
|
asString: true,
|
|
sectionTags: [{
|
|
o: '_foo',
|
|
c: 'foo'
|
|
}],
|
|
delimiters: '<% %>',
|
|
disableLambda: true
|
|
});
|
|
|
|
// $ExpectType string
|
|
compiled.render({ value: "test" });
|
|
|
|
// $ExpectType Token[]
|
|
const scanned = Hogan.scan("{{#if}}{{value}}{{/if}}");
|
|
|
|
// $ExpectType Leaf[] || Tree
|
|
Hogan.parse(scanned);
|