@servicenow/sdk-build-core 3.0.3 → 4.0.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/dist/app.d.ts +25 -0
- package/dist/app.js +8 -0
- package/dist/app.js.map +1 -0
- package/dist/compiler.d.ts +60 -0
- package/dist/compiler.js +320 -0
- package/dist/compiler.js.map +1 -0
- package/dist/compression.d.ts +7 -0
- package/dist/compression.js +79 -0
- package/dist/compression.js.map +1 -0
- package/dist/crypto.d.ts +1 -0
- package/dist/crypto.js +9 -0
- package/dist/crypto.js.map +1 -0
- package/dist/diagnostic.d.ts +41 -0
- package/dist/diagnostic.js +130 -0
- package/dist/diagnostic.js.map +1 -0
- package/dist/{plugins/Diagnostic.d.ts → fluent-diagnostic.d.ts} +3 -2
- package/dist/fluent-diagnostic.js +23 -0
- package/dist/fluent-diagnostic.js.map +1 -0
- package/dist/fluent-directive.d.ts +8 -0
- package/dist/fluent-directive.js +54 -0
- package/dist/fluent-directive.js.map +1 -0
- package/dist/fluent-file.d.ts +5 -0
- package/dist/fluent-file.js +15 -0
- package/dist/fluent-file.js.map +1 -0
- package/dist/formatter.d.ts +11 -0
- package/dist/formatter.js +77 -0
- package/dist/formatter.js.map +1 -0
- package/dist/fs.d.ts +174 -0
- package/dist/fs.js +313 -0
- package/dist/fs.js.map +1 -0
- package/dist/guid.d.ts +2 -0
- package/dist/{GUID.js → guid.js} +3 -6
- package/dist/guid.js.map +1 -0
- package/dist/index.d.ts +19 -5
- package/dist/index.js +19 -5
- package/dist/index.js.map +1 -1
- package/dist/json.d.ts +5 -0
- package/dist/json.js +43 -0
- package/dist/json.js.map +1 -0
- package/dist/keys-registry.d.ts +64 -0
- package/dist/keys-registry.js +339 -0
- package/dist/keys-registry.js.map +1 -0
- package/dist/logger.d.ts +8 -0
- package/dist/logger.js +17 -0
- package/dist/logger.js.map +1 -0
- package/dist/now-config.d.ts +348 -0
- package/dist/now-config.js +283 -0
- package/dist/now-config.js.map +1 -0
- package/dist/path.d.ts +3 -0
- package/dist/path.js +12 -0
- package/dist/path.js.map +1 -0
- package/dist/plugins/cache.d.ts +20 -0
- package/dist/plugins/cache.js +46 -0
- package/dist/plugins/cache.js.map +1 -0
- package/dist/plugins/context.d.ts +85 -0
- package/dist/plugins/{Context.js → context.js} +1 -1
- package/dist/plugins/context.js.map +1 -0
- package/dist/plugins/database.d.ts +27 -0
- package/dist/plugins/database.js +102 -0
- package/dist/plugins/database.js.map +1 -0
- package/dist/plugins/file.d.ts +10 -0
- package/dist/plugins/{behaviors/Arranger.js → file.js} +1 -1
- package/dist/plugins/file.js.map +1 -0
- package/dist/plugins/index.d.ts +9 -5
- package/dist/plugins/index.js +9 -6
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/plugin.d.ts +478 -0
- package/dist/plugins/plugin.js +533 -0
- package/dist/plugins/plugin.js.map +1 -0
- package/dist/plugins/product.d.ts +15 -0
- package/dist/plugins/product.js +38 -0
- package/dist/plugins/product.js.map +1 -0
- package/dist/plugins/project.d.ts +25 -0
- package/dist/plugins/{behaviors/Generator.js → project.js} +1 -1
- package/dist/plugins/project.js.map +1 -0
- package/dist/plugins/shape.d.ts +424 -0
- package/dist/plugins/shape.js +1181 -0
- package/dist/plugins/shape.js.map +1 -0
- package/dist/plugins/time.d.ts +12 -0
- package/dist/plugins/time.js +84 -0
- package/dist/plugins/time.js.map +1 -0
- package/dist/plugins/usage.d.ts +11 -0
- package/dist/plugins/usage.js +26 -0
- package/dist/plugins/usage.js.map +1 -0
- package/dist/prettier/config-loader.d.ts +13 -0
- package/dist/prettier/config-loader.js +105 -0
- package/dist/prettier/config-loader.js.map +1 -0
- package/dist/telemetry/index.d.ts +25 -0
- package/dist/telemetry/index.js +18 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/typescript.d.ts +293 -0
- package/dist/typescript.js +454 -0
- package/dist/typescript.js.map +1 -0
- package/dist/util/get-file-type.d.ts +2 -0
- package/dist/util/get-file-type.js +13 -0
- package/dist/util/get-file-type.js.map +1 -0
- package/dist/util/index.d.ts +2 -6
- package/dist/util/index.js +2 -6
- package/dist/util/index.js.map +1 -1
- package/dist/util/{Scope.js → is-sn-scope.js} +1 -1
- package/dist/util/is-sn-scope.js.map +1 -0
- package/dist/xml.d.ts +24 -0
- package/dist/xml.js +71 -0
- package/dist/xml.js.map +1 -0
- package/now.config.schema.json +336 -0
- package/package.json +22 -12
- package/src/app.ts +33 -0
- package/src/compiler.ts +384 -0
- package/src/compression.ts +93 -0
- package/src/crypto.ts +5 -0
- package/src/diagnostic.ts +108 -0
- package/src/{plugins/Diagnostic.ts → fluent-diagnostic.ts} +3 -10
- package/src/fluent-directive.ts +63 -0
- package/src/fluent-file.ts +13 -0
- package/src/formatter.ts +58 -0
- package/src/fs.ts +438 -0
- package/src/{GUID.ts → guid.ts} +2 -6
- package/src/index.ts +19 -5
- package/src/json.ts +20 -0
- package/src/keys-registry.ts +384 -0
- package/src/logger.ts +20 -0
- package/src/now-config.ts +337 -0
- package/src/path.ts +9 -0
- package/src/plugins/cache.ts +45 -0
- package/src/plugins/context.ts +93 -0
- package/src/plugins/database.ts +121 -0
- package/src/plugins/file.ts +19 -0
- package/src/plugins/index.ts +9 -5
- package/src/plugins/plugin.ts +995 -0
- package/src/plugins/product.ts +44 -0
- package/src/plugins/project.ts +39 -0
- package/src/plugins/shape.ts +1532 -0
- package/src/plugins/time.ts +108 -0
- package/src/plugins/usage.ts +26 -0
- package/src/prettier/config-loader.ts +130 -0
- package/src/telemetry/index.ts +27 -0
- package/src/typescript.ts +502 -0
- package/src/util/get-file-type.ts +11 -0
- package/src/util/index.ts +2 -6
- package/src/xml.ts +86 -0
- package/dist/GUID.d.ts +0 -2
- package/dist/GUID.js.map +0 -1
- package/dist/IncludePaths.d.ts +0 -25
- package/dist/IncludePaths.js +0 -97
- package/dist/IncludePaths.js.map +0 -1
- package/dist/Keys.d.ts +0 -32
- package/dist/Keys.js +0 -245
- package/dist/Keys.js.map +0 -1
- package/dist/TypeScript.d.ts +0 -5
- package/dist/TypeScript.js +0 -58
- package/dist/TypeScript.js.map +0 -1
- package/dist/XML.d.ts +0 -32
- package/dist/XML.js +0 -83
- package/dist/XML.js.map +0 -1
- package/dist/plugins/Context.d.ts +0 -190
- package/dist/plugins/Context.js.map +0 -1
- package/dist/plugins/Diagnostic.js +0 -28
- package/dist/plugins/Diagnostic.js.map +0 -1
- package/dist/plugins/Plugin.d.ts +0 -175
- package/dist/plugins/Plugin.js +0 -15
- package/dist/plugins/Plugin.js.map +0 -1
- package/dist/plugins/behaviors/Arranger.d.ts +0 -26
- package/dist/plugins/behaviors/Arranger.js.map +0 -1
- package/dist/plugins/behaviors/Composer.d.ts +0 -102
- package/dist/plugins/behaviors/Composer.js +0 -15
- package/dist/plugins/behaviors/Composer.js.map +0 -1
- package/dist/plugins/behaviors/Diagnostics.d.ts +0 -7
- package/dist/plugins/behaviors/Diagnostics.js +0 -3
- package/dist/plugins/behaviors/Diagnostics.js.map +0 -1
- package/dist/plugins/behaviors/Generator.d.ts +0 -21
- package/dist/plugins/behaviors/Generator.js.map +0 -1
- package/dist/plugins/behaviors/OwnedTables.d.ts +0 -6
- package/dist/plugins/behaviors/OwnedTables.js +0 -3
- package/dist/plugins/behaviors/OwnedTables.js.map +0 -1
- package/dist/plugins/behaviors/PostProcessor.d.ts +0 -5
- package/dist/plugins/behaviors/PostProcessor.js +0 -3
- package/dist/plugins/behaviors/PostProcessor.js.map +0 -1
- package/dist/plugins/behaviors/Serializer.d.ts +0 -30
- package/dist/plugins/behaviors/Serializer.js +0 -3
- package/dist/plugins/behaviors/Serializer.js.map +0 -1
- package/dist/plugins/behaviors/Transformer.d.ts +0 -23
- package/dist/plugins/behaviors/Transformer.js +0 -3
- package/dist/plugins/behaviors/Transformer.js.map +0 -1
- package/dist/plugins/behaviors/extractors/Data.d.ts +0 -119
- package/dist/plugins/behaviors/extractors/Data.js +0 -244
- package/dist/plugins/behaviors/extractors/Data.js.map +0 -1
- package/dist/plugins/behaviors/extractors/Extractors.d.ts +0 -63
- package/dist/plugins/behaviors/extractors/Extractors.js +0 -3
- package/dist/plugins/behaviors/extractors/Extractors.js.map +0 -1
- package/dist/plugins/behaviors/extractors/index.d.ts +0 -2
- package/dist/plugins/behaviors/extractors/index.js +0 -19
- package/dist/plugins/behaviors/extractors/index.js.map +0 -1
- package/dist/plugins/behaviors/index.d.ts +0 -9
- package/dist/plugins/behaviors/index.js +0 -26
- package/dist/plugins/behaviors/index.js.map +0 -1
- package/dist/plugins/util/CallExpression.d.ts +0 -5
- package/dist/plugins/util/CallExpression.js +0 -88
- package/dist/plugins/util/CallExpression.js.map +0 -1
- package/dist/plugins/util/CodeTransformation.d.ts +0 -95
- package/dist/plugins/util/CodeTransformation.js +0 -624
- package/dist/plugins/util/CodeTransformation.js.map +0 -1
- package/dist/plugins/util/ObjectLiteral.d.ts +0 -9
- package/dist/plugins/util/ObjectLiteral.js +0 -37
- package/dist/plugins/util/ObjectLiteral.js.map +0 -1
- package/dist/plugins/util/index.d.ts +0 -3
- package/dist/plugins/util/index.js +0 -20
- package/dist/plugins/util/index.js.map +0 -1
- package/dist/util/Debug.d.ts +0 -4
- package/dist/util/Debug.js +0 -20
- package/dist/util/Debug.js.map +0 -1
- package/dist/util/Directive.d.ts +0 -16
- package/dist/util/Directive.js +0 -107
- package/dist/util/Directive.js.map +0 -1
- package/dist/util/RuntimeTableSchema.d.ts +0 -5
- package/dist/util/RuntimeTableSchema.js +0 -58
- package/dist/util/RuntimeTableSchema.js.map +0 -1
- package/dist/util/Scope.js.map +0 -1
- package/dist/util/Util.d.ts +0 -1
- package/dist/util/Util.js +0 -12
- package/dist/util/Util.js.map +0 -1
- package/dist/util/XMLUploadParser.d.ts +0 -22
- package/dist/util/XMLUploadParser.js +0 -67
- package/dist/util/XMLUploadParser.js.map +0 -1
- package/src/IncludePaths.ts +0 -122
- package/src/Keys.ts +0 -274
- package/src/TypeScript.ts +0 -65
- package/src/XML.ts +0 -98
- package/src/plugins/Context.ts +0 -239
- package/src/plugins/Plugin.ts +0 -278
- package/src/plugins/behaviors/Arranger.ts +0 -42
- package/src/plugins/behaviors/Composer.ts +0 -125
- package/src/plugins/behaviors/Diagnostics.ts +0 -12
- package/src/plugins/behaviors/Generator.ts +0 -31
- package/src/plugins/behaviors/OwnedTables.ts +0 -5
- package/src/plugins/behaviors/PostProcessor.ts +0 -6
- package/src/plugins/behaviors/Serializer.ts +0 -40
- package/src/plugins/behaviors/Transformer.ts +0 -32
- package/src/plugins/behaviors/extractors/Data.ts +0 -332
- package/src/plugins/behaviors/extractors/Extractors.ts +0 -73
- package/src/plugins/behaviors/extractors/index.ts +0 -2
- package/src/plugins/behaviors/index.ts +0 -9
- package/src/plugins/util/CallExpression.ts +0 -110
- package/src/plugins/util/CodeTransformation.ts +0 -731
- package/src/plugins/util/ObjectLiteral.ts +0 -37
- package/src/plugins/util/index.ts +0 -3
- package/src/util/Debug.ts +0 -24
- package/src/util/Directive.ts +0 -123
- package/src/util/RuntimeTableSchema.ts +0 -44
- package/src/util/Util.ts +0 -7
- package/src/util/XMLUploadParser.ts +0 -90
- /package/dist/util/{Scope.d.ts → is-sn-scope.d.ts} +0 -0
- /package/src/util/{Scope.ts → is-sn-scope.ts} +0 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For some reason ts-morph.d.ts doesn't export these types even though they are actually
|
|
3
|
+
* exported by the runtime library, so we are declaring them here
|
|
4
|
+
*
|
|
5
|
+
* @version 23.0.0
|
|
6
|
+
*/
|
|
7
|
+
declare module 'ts-morph' {
|
|
8
|
+
abstract class BaseError extends Error {
|
|
9
|
+
protected constructor();
|
|
10
|
+
}
|
|
11
|
+
class PathNotFoundError extends BaseError {
|
|
12
|
+
readonly path: string;
|
|
13
|
+
constructor(path: string, prefix?: string);
|
|
14
|
+
readonly code: 'ENOENT';
|
|
15
|
+
}
|
|
16
|
+
class FileNotFoundError extends Error {
|
|
17
|
+
constructor(filePath: string);
|
|
18
|
+
}
|
|
19
|
+
class DirectoryNotFoundError extends Error {
|
|
20
|
+
constructor(dirPath: string);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
import * as ts from 'ts-morph';
|
|
24
|
+
import { ts as tsc } from 'ts-morph';
|
|
25
|
+
export { ts, tsc };
|
|
26
|
+
export declare function getValueDeclaration(node: ts.Node): ts.Node<ts.ts.Node> | undefined;
|
|
27
|
+
export declare function parseType(type: ts.Type, location: ts.Node, unparsableTypeHandler?: (unparsableType: ts.Type) => unknown): unknown;
|
|
28
|
+
/**
|
|
29
|
+
* A lot of the extra information here only exists because TypeScript doesn't
|
|
30
|
+
* export a union containing all the different node types, so you can't narrow
|
|
31
|
+
* a node's type by its kind. Narrowing based on kind is very useful for plugins
|
|
32
|
+
* since you can define a property using a kind name and the type of the 'node'
|
|
33
|
+
* argument can be inferred instead of every plugin needing to cast it manually.
|
|
34
|
+
* If you find yourself needing to parse any node kinds that aren't on this list,
|
|
35
|
+
* please add them here.
|
|
36
|
+
*
|
|
37
|
+
* See: https://github.com/microsoft/TypeScript/issues/13634
|
|
38
|
+
*/
|
|
39
|
+
export declare const SupportedKinds: {
|
|
40
|
+
265: {
|
|
41
|
+
name: "TypeAliasDeclaration";
|
|
42
|
+
node: ts.TypeAliasDeclaration;
|
|
43
|
+
};
|
|
44
|
+
183: {
|
|
45
|
+
name: "TypeReference";
|
|
46
|
+
node: ts.TypeReferenceNode;
|
|
47
|
+
};
|
|
48
|
+
187: {
|
|
49
|
+
name: "TypeLiteral";
|
|
50
|
+
node: ts.TypeLiteralNode;
|
|
51
|
+
};
|
|
52
|
+
171: {
|
|
53
|
+
name: "PropertySignature";
|
|
54
|
+
node: ts.PropertySignature;
|
|
55
|
+
};
|
|
56
|
+
189: {
|
|
57
|
+
name: "TupleType";
|
|
58
|
+
node: ts.TupleTypeNode;
|
|
59
|
+
};
|
|
60
|
+
226: {
|
|
61
|
+
name: "BinaryExpression";
|
|
62
|
+
node: ts.BinaryExpression;
|
|
63
|
+
};
|
|
64
|
+
218: {
|
|
65
|
+
name: "FunctionExpression";
|
|
66
|
+
node: ts.FunctionExpression;
|
|
67
|
+
};
|
|
68
|
+
262: {
|
|
69
|
+
name: "FunctionDeclaration";
|
|
70
|
+
node: ts.FunctionDeclaration;
|
|
71
|
+
};
|
|
72
|
+
209: {
|
|
73
|
+
name: "ArrayLiteralExpression";
|
|
74
|
+
node: ts.ArrayLiteralExpression;
|
|
75
|
+
};
|
|
76
|
+
213: {
|
|
77
|
+
name: "CallExpression";
|
|
78
|
+
node: ts.CallExpression;
|
|
79
|
+
};
|
|
80
|
+
11: {
|
|
81
|
+
name: "StringLiteral";
|
|
82
|
+
node: ts.StringLiteral;
|
|
83
|
+
};
|
|
84
|
+
9: {
|
|
85
|
+
name: "NumericLiteral";
|
|
86
|
+
node: ts.NumericLiteral;
|
|
87
|
+
};
|
|
88
|
+
112: {
|
|
89
|
+
name: "TrueKeyword";
|
|
90
|
+
node: ts.TrueLiteral;
|
|
91
|
+
};
|
|
92
|
+
97: {
|
|
93
|
+
name: "FalseKeyword";
|
|
94
|
+
node: ts.FalseLiteral;
|
|
95
|
+
};
|
|
96
|
+
106: {
|
|
97
|
+
name: "NullKeyword";
|
|
98
|
+
node: ts.NullLiteral;
|
|
99
|
+
};
|
|
100
|
+
80: {
|
|
101
|
+
name: "Identifier";
|
|
102
|
+
node: ts.Identifier;
|
|
103
|
+
};
|
|
104
|
+
307: {
|
|
105
|
+
name: "SourceFile";
|
|
106
|
+
node: ts.SourceFile;
|
|
107
|
+
};
|
|
108
|
+
260: {
|
|
109
|
+
name: "VariableDeclaration";
|
|
110
|
+
node: ts.VariableDeclaration;
|
|
111
|
+
};
|
|
112
|
+
263: {
|
|
113
|
+
name: "ClassDeclaration";
|
|
114
|
+
node: ts.ClassDeclaration;
|
|
115
|
+
};
|
|
116
|
+
278: {
|
|
117
|
+
name: "ExportDeclaration";
|
|
118
|
+
node: ts.ExportDeclaration;
|
|
119
|
+
};
|
|
120
|
+
210: {
|
|
121
|
+
name: "ObjectLiteralExpression";
|
|
122
|
+
node: ts.ObjectLiteralExpression;
|
|
123
|
+
};
|
|
124
|
+
234: {
|
|
125
|
+
name: "AsExpression";
|
|
126
|
+
node: ts.AsExpression;
|
|
127
|
+
};
|
|
128
|
+
167: {
|
|
129
|
+
name: "ComputedPropertyName";
|
|
130
|
+
node: ts.ComputedPropertyName;
|
|
131
|
+
};
|
|
132
|
+
303: {
|
|
133
|
+
name: "PropertyAssignment";
|
|
134
|
+
node: ts.PropertyAssignment;
|
|
135
|
+
};
|
|
136
|
+
211: {
|
|
137
|
+
name: "PropertyAccessExpression";
|
|
138
|
+
node: ts.PropertyAccessExpression;
|
|
139
|
+
};
|
|
140
|
+
15: {
|
|
141
|
+
name: "NoSubstitutionTemplateLiteral";
|
|
142
|
+
node: ts.NoSubstitutionTemplateLiteral;
|
|
143
|
+
};
|
|
144
|
+
244: {
|
|
145
|
+
name: "ExpressionStatement";
|
|
146
|
+
node: ts.ExpressionStatement;
|
|
147
|
+
};
|
|
148
|
+
215: {
|
|
149
|
+
name: "TaggedTemplateExpression";
|
|
150
|
+
node: ts.TaggedTemplateExpression;
|
|
151
|
+
};
|
|
152
|
+
277: {
|
|
153
|
+
name: "ExportAssignment";
|
|
154
|
+
node: ts.ExportAssignment;
|
|
155
|
+
};
|
|
156
|
+
279: {
|
|
157
|
+
name: "NamedExports";
|
|
158
|
+
node: ts.NamedExports;
|
|
159
|
+
};
|
|
160
|
+
281: {
|
|
161
|
+
name: "ExportSpecifier";
|
|
162
|
+
node: ts.ExportSpecifier;
|
|
163
|
+
};
|
|
164
|
+
212: {
|
|
165
|
+
name: "ElementAccessExpression";
|
|
166
|
+
node: ts.ElementAccessExpression;
|
|
167
|
+
};
|
|
168
|
+
228: {
|
|
169
|
+
name: "TemplateExpression";
|
|
170
|
+
node: ts.TemplateExpression;
|
|
171
|
+
};
|
|
172
|
+
273: {
|
|
173
|
+
name: "ImportClause";
|
|
174
|
+
node: ts.ImportClause;
|
|
175
|
+
};
|
|
176
|
+
276: {
|
|
177
|
+
name: "ImportSpecifier";
|
|
178
|
+
node: ts.ImportSpecifier;
|
|
179
|
+
};
|
|
180
|
+
272: {
|
|
181
|
+
name: "ImportDeclaration";
|
|
182
|
+
node: ts.ImportDeclaration;
|
|
183
|
+
};
|
|
184
|
+
275: {
|
|
185
|
+
name: "NamedImports";
|
|
186
|
+
node: ts.NamedImports;
|
|
187
|
+
};
|
|
188
|
+
243: {
|
|
189
|
+
name: "VariableStatement";
|
|
190
|
+
node: ts.VariableStatement;
|
|
191
|
+
};
|
|
192
|
+
261: {
|
|
193
|
+
name: "VariableDeclarationList";
|
|
194
|
+
node: ts.VariableDeclarationList;
|
|
195
|
+
};
|
|
196
|
+
40: {
|
|
197
|
+
name: "PlusToken";
|
|
198
|
+
node: ts.Node<tsc.PlusToken>;
|
|
199
|
+
};
|
|
200
|
+
1: {
|
|
201
|
+
name: "EndOfFileToken";
|
|
202
|
+
node: ts.Node<tsc.EndOfFileToken>;
|
|
203
|
+
};
|
|
204
|
+
95: {
|
|
205
|
+
name: "ExportKeyword";
|
|
206
|
+
node: ts.Node<tsc.ExportKeyword>;
|
|
207
|
+
};
|
|
208
|
+
133: {
|
|
209
|
+
name: "AnyKeyword";
|
|
210
|
+
node: ts.Node<tsc.KeywordTypeNode<tsc.SyntaxKind.AnyKeyword>>;
|
|
211
|
+
};
|
|
212
|
+
267: {
|
|
213
|
+
name: "ModuleDeclaration";
|
|
214
|
+
node: ts.ModuleDeclaration;
|
|
215
|
+
};
|
|
216
|
+
268: {
|
|
217
|
+
name: "ModuleBlock";
|
|
218
|
+
node: ts.ModuleBlock;
|
|
219
|
+
};
|
|
220
|
+
241: {
|
|
221
|
+
name: "Block";
|
|
222
|
+
node: ts.Block;
|
|
223
|
+
};
|
|
224
|
+
169: {
|
|
225
|
+
name: "Parameter";
|
|
226
|
+
node: ts.ParameterDeclaration;
|
|
227
|
+
};
|
|
228
|
+
64: {
|
|
229
|
+
name: "EqualsToken";
|
|
230
|
+
node: ts.Node<tsc.EqualsToken>;
|
|
231
|
+
};
|
|
232
|
+
39: {
|
|
233
|
+
name: "EqualsGreaterThanToken";
|
|
234
|
+
node: ts.Node<tsc.EqualsGreaterThanToken>;
|
|
235
|
+
};
|
|
236
|
+
219: {
|
|
237
|
+
name: "ArrowFunction";
|
|
238
|
+
node: ts.ArrowFunction;
|
|
239
|
+
};
|
|
240
|
+
16: {
|
|
241
|
+
name: "TemplateHead";
|
|
242
|
+
node: ts.TemplateHead;
|
|
243
|
+
};
|
|
244
|
+
17: {
|
|
245
|
+
name: "TemplateMiddle";
|
|
246
|
+
node: ts.TemplateMiddle;
|
|
247
|
+
};
|
|
248
|
+
239: {
|
|
249
|
+
name: "TemplateSpan";
|
|
250
|
+
node: ts.TemplateSpan;
|
|
251
|
+
};
|
|
252
|
+
18: {
|
|
253
|
+
name: "TemplateTail";
|
|
254
|
+
node: ts.TemplateTail;
|
|
255
|
+
};
|
|
256
|
+
224: {
|
|
257
|
+
name: "PrefixUnaryExpression";
|
|
258
|
+
node: ts.PrefixUnaryExpression;
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
export type SupportedKind = keyof typeof SupportedKinds;
|
|
262
|
+
export type SupportedKindName = (typeof SupportedKinds)[SupportedKind]['name'];
|
|
263
|
+
export type SupportedNode = (typeof SupportedKinds)[SupportedKind]['node'];
|
|
264
|
+
export type SupportedNodeByKind<K extends SupportedKind> = (typeof SupportedKinds)[K]['node'];
|
|
265
|
+
export type SupportedNodeByKindName<K extends SupportedKindName> = Extract<(typeof SupportedKinds)[SupportedKind], {
|
|
266
|
+
name: K;
|
|
267
|
+
}>['node'];
|
|
268
|
+
export declare function isSupportedKind(kind: ts.SyntaxKind): kind is SupportedKind;
|
|
269
|
+
export declare function isSupportedNode(node: ts.Node | undefined): node is SupportedNode;
|
|
270
|
+
export declare function getKind(node: SupportedNode): SupportedKind;
|
|
271
|
+
export declare function getKindName(nodeOrKind: SupportedNode | SupportedKind): SupportedKindName;
|
|
272
|
+
export declare function isUndefined(node: ts.Node): boolean;
|
|
273
|
+
export declare function isOnlyChild(node: ts.Node | undefined): boolean;
|
|
274
|
+
type RemovableNode = Extract<SupportedNode, {
|
|
275
|
+
remove(): void;
|
|
276
|
+
}>;
|
|
277
|
+
export declare function isRemovable(node: ts.Node | undefined): node is RemovableNode;
|
|
278
|
+
/**
|
|
279
|
+
* Recursively walks up the tree to remove the furthest possible ancestor along a
|
|
280
|
+
* unary chain from this node, or the node itself if that's all we can do. This
|
|
281
|
+
* avoids leaving behind dead code as much as possible.
|
|
282
|
+
*
|
|
283
|
+
* @throws Error if the node cannot be removed
|
|
284
|
+
*/
|
|
285
|
+
export declare function remove(target: ts.Node): void;
|
|
286
|
+
/**
|
|
287
|
+
* Recursively walks up the tree removing references to this node and any ancestors
|
|
288
|
+
* along a unary chain. In other words, if this node is the only child of its parent,
|
|
289
|
+
* we also remove references to the parent, and repeat that process recursively. This
|
|
290
|
+
* avoids leaving behind dead code as much as possible.
|
|
291
|
+
*/
|
|
292
|
+
export declare function removeReferences(target: ts.Node): void;
|
|
293
|
+
export declare function getUnsupportedKindName(node: ts.Node): string | undefined;
|