parent
41688901f2
commit
642ac7e230
|
@ -2300,6 +2300,7 @@ function genericPrintNoParens(path, options, print, args) {
|
|||
case "TSParenthesizedType":
|
||||
return concat(["(", path.call(print, "typeAnnotation"), ")"]);
|
||||
case "TSIndexSignature": {
|
||||
const parent = path.getParentNode();
|
||||
let printedParams = [];
|
||||
if (n.params) {
|
||||
printedParams = path.map(print, "params");
|
||||
|
@ -2319,7 +2320,8 @@ function genericPrintNoParens(path, options, print, args) {
|
|||
// it using parseDelimitedList that uses commas as delimiter.
|
||||
join(", ", printedParams),
|
||||
"]: ",
|
||||
path.call(print, "typeAnnotation")
|
||||
path.call(print, "typeAnnotation"),
|
||||
parent.type === "ClassBody" ? semi : ""
|
||||
]);
|
||||
}
|
||||
case "TSTypePredicate":
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`index-signature.ts 1`] = `
|
||||
class LocalStorage implements Storage {
|
||||
[index: number]: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
class LocalStorage implements Storage {
|
||||
[index: number]: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
`;
|
|
@ -0,0 +1,4 @@
|
|||
class LocalStorage implements Storage {
|
||||
[index: number]: string;
|
||||
[key: string]: any;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
run_spec(__dirname, { parser: "typescript" });
|
|
@ -1,5 +1,18 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`index-signature.ts 1`] = `
|
||||
class LocalStorage implements Storage {
|
||||
[index: number]: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
class LocalStorage implements Storage {
|
||||
[index: number]: string
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
`;
|
||||
|
||||
exports[`interface.ts 1`] = `
|
||||
interface Inline { x: string }
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
class LocalStorage implements Storage {
|
||||
[index: number]: string;
|
||||
[key: string]: any;
|
||||
}
|
Loading…
Reference in New Issue