DefinitelyTyped/types/hbs/index.d.ts
DavidM77 067defebd0 Add types for hbs npm package (#23091)
* Add types for hbs

* Use dtsg-gen generated tsconfig.json

* Add additional tests

* Now lints with less cheating

* Avoid losing type information
2018-01-23 16:19:23 -08:00

27 lines
917 B
TypeScript

// Type definitions for hbs 4.0
// Project: https://github.com/pillarjs/hbs
// Definitions by: David Muller <https://github.com/davidm77>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import handlebars = require('handlebars');
type handlebarsModule = typeof handlebars;
interface hbsModule {
readonly handlebars: handlebarsModule;
localsAsTemplateData(app: any): void;
registerHelper(helperName: string, helperFunction: (...args: any[]) => any): void;
registerPartial(partialName: string, partialValue: string): void;
registerPartials(directoryName: string, callback?: () => void): void;
__express(filename: string, options: any, cb: (...args: any[]) => any): any;
}
interface hbsModuleWithCreate extends hbsModule {
create(handlebars?: handlebarsModule): hbsModule;
}
declare var baseModule: hbsModuleWithCreate;
export = baseModule;