import { JS } from "../tree"; import { JavaScriptVisitor } from "../visitor"; import { J, Statement } from "../../java"; import { Cursor, Tree } from "../../tree"; import { BlankLinesStyle, SpacesStyle, WrappingAndBracesStyle } from "../style"; import { NamedStyles } from "../../style"; export { TabsAndIndentsVisitor } from "./tabs-and-indents-visitor"; export { NormalizeWhitespaceVisitor } from "./normalize-whitespace-visitor"; export { MinimumViableSpacingVisitor } from "./minimum-viable-spacing-visitor"; export declare const maybeAutoFormat: (before: J2, after: J2, p: P, stopAfter?: J, parent?: Cursor) => Promise; export declare const autoFormat: (j: J2, p: P, stopAfter?: J, parent?: Cursor, styles?: NamedStyles[]) => Promise; /** * Formats JavaScript/TypeScript code using a comprehensive set of formatting rules. * * Style resolution order (first match wins): * 1. Styles passed to the constructor * 2. Styles from source file markers (NamedStyles) * 3. IntelliJ defaults * * When a PrettierStyle is present (either in the styles array or as a marker on the source file), * Prettier is used for formatting. Otherwise, built-in formatting visitors are used. */ export declare class AutoformatVisitor

extends JavaScriptVisitor

{ private stopAfter?; private readonly styles?; constructor(stopAfter?: Tree | undefined, styles?: NamedStyles[]); visit(tree: Tree, p: P, cursor?: Cursor): Promise; } export declare class SpacesVisitor

extends JavaScriptVisitor

{ private style; private stopAfter?; constructor(style: SpacesStyle, stopAfter?: Tree | undefined); visit(tree: Tree, p: P, parent?: Cursor): Promise; postVisit(tree: J, p: P): Promise; protected visitAlias(alias: JS.Alias, p: P): Promise; protected visitArrayAccess(arrayAccess: J.ArrayAccess, p: P): Promise; protected visitAssignment(assignment: J.Assignment, p: P): Promise; protected visitBinary(binary: J.Binary, p: P): Promise; protected visitCase(aCase: J.Case, p: P): Promise; protected visitClassDeclaration(classDecl: J.ClassDeclaration, p: P): Promise; visitContainer(container: J.Container, p: P): Promise>; protected visitExportDeclaration(exportDeclaration: JS.ExportDeclaration, p: P): Promise; protected visitForLoop(forLoop: J.ForLoop, p: P): Promise; protected visitIf(iff: J.If, p: P): Promise; protected visitImportDeclaration(jsImport: JS.Import, p: P): Promise; protected visitIndexSignatureDeclaration(indexSignatureDeclaration: JS.IndexSignatureDeclaration, p: P): Promise; protected visitMethodDeclaration(methodDecl: J.MethodDeclaration, p: P): Promise; protected visitMethodInvocation(methodInv: J.MethodInvocation, p: P): Promise; protected visitPropertyAssignment(propertyAssignment: JS.PropertyAssignment, p: P): Promise; protected visitSwitch(switchNode: J.Switch, p: P): Promise; protected visitTernary(ternary: J.Ternary, p: P): Promise; protected visitTry(try_: J.Try, p: P): Promise; protected visitTypeDeclaration(typeDeclaration: JS.TypeDeclaration, p: P): Promise; protected visitTypeInfo(typeInfo: JS.TypeInfo, p: P): Promise; protected visitTypeLiteral(typeLiteral: JS.TypeLiteral, p: P): Promise; protected visitUnary(unary: J.Unary, p: P): Promise; protected visitVariable(variable: J.VariableDeclarations.NamedVariable, p: P): Promise; protected visitWhileLoop(whileLoop: J.WhileLoop, p: P): Promise; protected visitTypeParameter(typeParam: J.TypeParameter, p: P): Promise; /** * Modifies the after space of a RightPadded draft in place. */ private spaceAfterRightPaddedDraft; /** * Modifies the before space of a LeftPadded draft and the element's prefix in place. */ private spaceBeforeLeftPaddedElementDraft; /** * Modifies the element's prefix of a RightPadded draft in place. */ private spaceBeforeRightPaddedElementDraft; /** * Modifies the prefix whitespace of a J draft in place. */ private spaceBeforeDraft; /** * Modifies the before space of a Container draft in place. */ private spaceBeforeContainerDraft; /** * Modifies the suffix of the last comment in an array of draft comments in place. */ private static spaceLastCommentSuffixDraft; /** * Modifies the suffix of a Comment draft in place. */ private static spaceSuffixDraft; private static isOnlySpaces; private static isOnlySpacesAndNotEmpty; private static isNotSingleSpace; protected visitNewClass(newClass: J.NewClass, p: P): Promise; } export declare class WrappingAndBracesVisitor

extends JavaScriptVisitor

{ private readonly style; private stopAfter?; constructor(style: WrappingAndBracesStyle, stopAfter?: Tree | undefined); visit(tree: Tree, p: P, parent?: Cursor): Promise; postVisit(tree: J, p: P): Promise; protected visitVariableDeclarations(multiVariable: J.VariableDeclarations, p: P): Promise; protected visitMethodDeclaration(method: J.MethodDeclaration, p: P): Promise; protected visitElse(elsePart: J.If.Else, p: P): Promise; protected visitClassDeclaration(classDecl: J.ClassDeclaration, p: P): Promise; protected visitBlock(block: J.Block, p: P): Promise; private blockIsMultiLine; private formatBlockOnOneLine; protected visitSwitch(aSwitch: J.Switch, p: P): Promise; private withNewlines; private withNewlineSpace; private withNewlineModifiers; } export declare class BlankLinesVisitor

extends JavaScriptVisitor

{ private readonly style; private stopAfter?; constructor(style: BlankLinesStyle, stopAfter?: Tree | undefined); protected preVisit(tree: J, p: P): Promise; visit(tree: Tree, p: P, cursor?: Cursor): Promise; protected visitClassDeclaration(classDecl: J.ClassDeclaration, p: P): Promise; visitStatement(statement: Statement, p: P): Promise; protected visitBlock(block: J.Block, p: P): Promise; protected visitEnumValue(enumValue: J.EnumValue, p: P): Promise; /** * Check if a statement is inside a Case's statements container or body, * not inside the caseLabels container. */ private isInsideCaseStatements; private keepMaximumBlankLines; private minimumBlankLines; private ensurePrefixHasNewLine; private static countNewlines; postVisit(tree: J, p: P): Promise; } export { prettierFormat } from "./prettier-format"; //# sourceMappingURL=format.d.ts.map