Print declare for TSInterfaceDeclaration (#2574)

master
Brian Ng 2017-08-01 09:00:01 -05:00 committed by Lucas Azzola
parent 4c335cae0a
commit 1701f4a0d5
3 changed files with 18 additions and 0 deletions

View File

@ -856,6 +856,10 @@ function genericPrintNoParens(path, options, print, args) {
]);
}
case "TSInterfaceDeclaration":
if (isNodeStartingWithDeclare(n, options)) {
parts.push("declare ");
}
parts.push(
n.abstract ? "abstract " : "",
printTypeScriptModifiers(path, options, print),

View File

@ -18,3 +18,14 @@ declare namespace A {
}
`;
exports[`declare_interface.ts 1`] = `
declare interface Dictionary<T> {
[index: string]: T
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
declare interface Dictionary<T> {
[index: string]: T;
}
`;

View File

@ -0,0 +1,3 @@
declare interface Dictionary<T> {
[index: string]: T
}