@putout/printer 2.81.0 → 2.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog +5 -0
- package/lib/tokenize/expressions/class/class.js +3 -0
- package/lib/tokenize/typescript/{ts-declare-function.js → function/ts-declare-function.js} +2 -2
- package/lib/tokenize/typescript/function/ts-declare-method.js +28 -0
- package/lib/tokenize/typescript/index.js +3 -2
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -36,11 +36,14 @@ module.exports.ClassDeclaration = {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
function classVisitor(path, {print, indent, maybe, traverse}) {
|
|
39
|
+
const {abstract} = path.node;
|
|
40
|
+
|
|
39
41
|
for (const decorator of maybeDecorators(path)) {
|
|
40
42
|
traverse(decorator);
|
|
41
43
|
print.breakline();
|
|
42
44
|
}
|
|
43
45
|
|
|
46
|
+
maybe.print(abstract, 'abstract ');
|
|
44
47
|
print('class ');
|
|
45
48
|
print('__id');
|
|
46
49
|
print('__typeParameters');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const {printParams} = require('
|
|
4
|
-
const {isNext} = require('
|
|
3
|
+
const {printParams} = require('../../expressions/functions/params');
|
|
4
|
+
const {isNext} = require('../../is');
|
|
5
5
|
|
|
6
6
|
const isInsideExport = (path) => {
|
|
7
7
|
return path.parentPath.isExportDefaultDeclaration();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const {printParams} = require('../../expressions/functions/params');
|
|
4
|
+
|
|
5
|
+
module.exports.TSDeclareMethod = (path, printer, semantics) => {
|
|
6
|
+
const {print} = printer;
|
|
7
|
+
const {accessibility, abstract} = path.node;
|
|
8
|
+
|
|
9
|
+
if (accessibility) {
|
|
10
|
+
print(accessibility);
|
|
11
|
+
print(' ');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (abstract) {
|
|
15
|
+
print('abstract');
|
|
16
|
+
print(' ');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
print('__key');
|
|
20
|
+
|
|
21
|
+
printParams(path, printer, semantics);
|
|
22
|
+
|
|
23
|
+
print(':');
|
|
24
|
+
print.space();
|
|
25
|
+
print('__returnType');
|
|
26
|
+
print(';');
|
|
27
|
+
print.newline();
|
|
28
|
+
};
|
|
@@ -6,7 +6,8 @@ const {TSTypeAliasDeclaration} = require('./ts-type-alias-declaration');
|
|
|
6
6
|
const {TSMappedType} = require('./ts-mapped-type');
|
|
7
7
|
const {TSConditionalType} = require('./ts-conditional-type');
|
|
8
8
|
const {TSTypeParameter} = require('./ts-type-parameter');
|
|
9
|
-
const {TSDeclareFunction} = require('./ts-declare-function');
|
|
9
|
+
const {TSDeclareFunction} = require('./function/ts-declare-function');
|
|
10
|
+
const {TSDeclareMethod} = require('./function/ts-declare-method');
|
|
10
11
|
|
|
11
12
|
const {
|
|
12
13
|
TSModuleDeclaration,
|
|
@@ -258,5 +259,5 @@ module.exports = {
|
|
|
258
259
|
print('__expression');
|
|
259
260
|
print(')');
|
|
260
261
|
},
|
|
262
|
+
TSDeclareMethod,
|
|
261
263
|
};
|
|
262
|
-
|
package/package.json
CHANGED