UNPKG

1.57 kBTypeScriptView Raw
1import { Options, SucraseContext, Transform } from "../index";
2import { ClassInfo } from "../util/getClassInfo";
3export default class RootTransformer {
4 private transformers;
5 private nameManager;
6 private tokens;
7 private generatedVariables;
8 private isImportsTransformEnabled;
9 private isReactHotLoaderTransformEnabled;
10 constructor(sucraseContext: SucraseContext, transforms: Array<Transform>, enableLegacyBabel5ModuleInterop: boolean, options: Options);
11 transform(): string;
12 processBalancedCode(): void;
13 processToken(): void;
14 /**
15 * Skip past a class with a name and return that name.
16 */
17 processNamedClass(): string;
18 processClass(): void;
19 /**
20 * We want to just handle class fields in all contexts, since TypeScript supports them. Later,
21 * when some JS implementations support class fields, this should be made optional.
22 */
23 processClassBody(classInfo: ClassInfo, className: string | null): void;
24 makeConstructorInitCode(constructorInitializerStatements: Array<string>, instanceInitializerNames: Array<string>, className: string): string;
25 /**
26 * Normally it's ok to simply remove type tokens, but we need to be more careful when dealing with
27 * arrow function return types since they can confuse the parser. In that case, we want to move
28 * the close-paren to the same line as the arrow.
29 *
30 * See https://github.com/alangpierce/sucrase/issues/391 for more details.
31 */
32 processPossibleArrowParamEnd(): boolean;
33 processPossibleTypeRange(): boolean;
34}