add typings for async getSource and runtime.SafeString class

This commit is contained in:
Tyler Johnson
2018-08-14 13:03:55 -06:00
parent 175f675667
commit 36b6312eee
3 changed files with 11 additions and 2 deletions
+7 -1
View File
@@ -94,7 +94,7 @@ export function installJinjaCompat(): void;
export interface ILoader {
async?: boolean;
getSource(name: string): LoaderSource;
getSource(name: string, callback?: (err?: any, result?: LoaderSource) => void): LoaderSource | void;
extend?(extender: ILoader): ILoader;
}
@@ -137,3 +137,9 @@ export class PrecompiledLoader extends Loader implements ILoader {
init(searchPaths: string[], opts: any): void;
getSource(name: string): LoaderSource;
}
export namespace runtime {
class SafeString {
constructor(...args: any[]);
}
}
+2
View File
@@ -52,3 +52,5 @@ class MyLoader extends nunjucks.Loader implements nunjucks.ILoader {
}
env = new nunjucks.Environment(new MyLoader());
new nunjucks.runtime.SafeString();
+2 -1
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"interface-name": false
"interface-name": false,
"no-unnecessary-class": false // to allow SafeString class
}
}