import type { AnnotationCstNode, ClassPermitsCstNode, ClassTypeCtx, CstElement, CstNode, ExpressionCstNode, InterfacePermitsCstNode, IToken, StatementCstNode } from "java-parser"; import type { AstPath, Doc, ParserOptions } from "prettier"; import { builders } from "prettier/doc"; import type { JavaComment } from "../comments.js"; export declare function onlyDefinedKey, K extends Key & string>(obj: T, options?: K[]): K; export declare function definedKeys, K extends Key & string>(obj: T, options?: K[]): K[]; export declare function printWithModifiers>(path: AstPath, print: JavaPrintFn, modifierChild: P, contents: Doc, noTypeAnnotations?: boolean): builders.Doc[]; export declare function hasDeclarationAnnotations(modifiers: ModifierNode[]): boolean; export declare function call>(path: AstPath, callback: MapCallback, P>, U>, child: P): U; export declare function each>(path: AstPath, callback: MapCallback, P>, void>, child: P): void; export declare function map>(path: AstPath, callback: MapCallback, P>, U>, child: P): U[]; export declare function flatMap>(path: AstPath, callback: MapCallback, P>, U>, children: P[]): U[]; export declare function printSingle(path: AstPath, print: JavaPrintFn, _?: JavaParserOptions, args?: unknown): builders.Doc; export declare function lineStartWithComments(node: JavaNonTerminal): number; export declare function lineEndWithComments(node: JavaNonTerminal): number; export declare function printDanglingComments(path: AstPath): builders.Doc[]; export declare function printComment(node: JavaTerminal): string | builders.Doc[]; export declare function hasLeadingComments(node: JavaNode): boolean | undefined; export declare function indentInParentheses(contents: Doc, opts?: { shouldBreak?: boolean; }): builders.Group | "()"; export declare function printArrayInitializer>(path: AstPath, print: JavaPrintFn, options: JavaParserOptions, child: P): builders.Group | "{}"; export declare function printBlock(path: AstPath, contents: Doc[]): builders.Group | "{}" | (string | builders.Indent | builders.Hardline)[]; export declare function printName(path: AstPath, print: JavaPrintFn): builders.Doc[]; export declare function printList>(path: AstPath, print: JavaPrintFn, child: P): builders.Doc[]; export declare function printClassPermits(path: AstPath, print: JavaPrintFn): builders.Group; export declare function printClassType(path: AstPath, print: JavaPrintFn): builders.Doc[]; export declare function isBinaryExpression(expression: ExpressionCstNode): boolean; export declare function findBaseIndent(lines: string[]): number; export declare function isEmptyStatement(statement: StatementCstNode): boolean; export declare function isNonTerminal(node: CstElement): node is JavaNonTerminal; export declare function isTerminal(node: CstElement): node is IToken; export type JavaNode = CstElement & { comments?: JavaComment[]; }; export type JavaNonTerminal = Exclude; export type JavaTerminal = Exclude; export type JavaNodePrinters = { [T in JavaNonTerminal["name"]]: JavaNodePrinter; }; export type JavaNodePrinter = (path: AstPath>, print: JavaPrintFn, options: JavaParserOptions, args?: unknown) => Doc; export type JavaPrintFn = (path: AstPath, args?: unknown) => Doc; export type JavaParserOptions = ParserOptions & { entrypoint?: string; }; export type IterProperties = T extends any[] ? IndexProperties : ArrayProperties; type Key = T extends T ? keyof T : never; type ModifierNode = JavaNonTerminal & { children: { annotation?: AnnotationCstNode[]; }; }; type IsTuple = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple : false; type IndexProperties = IsTuple extends true ? Exclude["length"], T["length"]> : number; type ArrayProperties = { [K in keyof T]: NonNullable extends readonly any[] ? K : never; }[keyof T]; type ArrayElement = T extends Array ? E : never; type MapCallback = (path: AstPath>, index: number, value: any) => U; type IndexValue = T extends any[] ? P extends number ? T[P] : never : P extends keyof T ? T[P] : never; export {};