mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
Add types for mustache-express
This commit is contained in:
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// Type definitions for mustache-express 1.2
|
||||
// Project: https://github.com/bryanburgers/node-mustache-express#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { Cache } from 'lru-cache';
|
||||
|
||||
export = mustacheExpress;
|
||||
|
||||
declare function mustacheExpress(
|
||||
partialsPath?: string,
|
||||
partialsExt?: string
|
||||
): mustacheExpress.ExpessEngine;
|
||||
|
||||
declare namespace mustacheExpress {
|
||||
interface ExpessEngine {
|
||||
(path: string, options: any, cb: (...args: any[]) => any): any;
|
||||
cache: TemplateCache;
|
||||
}
|
||||
|
||||
type TemplateCache = Cache<string, { name: string; data: string; partials: string[] }>;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import express = require('express');
|
||||
import mustacheExpress = require('mustache-express');
|
||||
|
||||
const app = express();
|
||||
app.engine('mustache', mustacheExpress());
|
||||
app.engine('mustache', mustacheExpress('/partials'));
|
||||
app.engine('mustache', mustacheExpress('/partials', '.mst'));
|
||||
|
||||
// $ExpectType Cache<string, { name: string; data: string; partials: string[]; }>
|
||||
mustacheExpress().cache;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"mustache-express-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user