prettier-plugin-pegjs
Version:
A Prettier plugin for formatting Pegjs and Peggy-js grammars
66 lines (65 loc) • 4.46 kB
TypeScript
import { SupportOption } from "prettier";
import { AstNode } from "./types";
export declare const languages: {
name: string;
extensions: string[];
parsers: string[];
}[];
export declare const parsers: {
"pegjs-parser": {
parse: (input: string) => Grammar;
astFormat: string;
locStart: (node: AstNode) => number;
locEnd: (node: AstNode) => number;
};
};
export declare const printers: {
"pegjs-ast": {
print: (path: import("prettier").AstPath<AstNode | null | undefined>, options: import("prettier").ParserOptions<AstNode | null | undefined>, print: (path: import("prettier").AstPath<AstNode | null | undefined>) => import("prettier/doc").builders.Doc, args?: unknown) => import("prettier/doc").builders.Doc;
embed: (path: import("prettier").AstPath<any>, options: import("prettier").Options) => import("prettier/doc").builders.Doc | ((textToDoc: (text: string, options: import("prettier").Options) => Promise<import("prettier/doc").builders.Doc>, print: (selector?: string | number | import("prettier").AstPath<any> | (string | number)[] | undefined) => import("prettier/doc").builders.Doc, path: import("prettier").AstPath<any>, options: import("prettier").Options) => import("prettier/doc").builders.Doc | Promise<import("prettier/doc").builders.Doc | undefined> | undefined) | null;
canAttachComment: (node: AstNode) => boolean;
isBlockComment: (node: AstNode) => boolean;
printComment: (commentPath: import("prettier").AstPath<AstNode>, options: import("prettier").ParserOptions<AstNode>) => import("prettier/doc").builders.Doc;
handleComments: {
ownLine: (commentNode: any, text: string, options: import("prettier").ParserOptions<any>, ast: any, isLastComment: boolean) => boolean;
endOfLine: (commentNode: any, text: string, options: import("prettier").ParserOptions<any>, ast: any, isLastComment: boolean) => boolean;
remaining: (commentNode: any, text: string, options: import("prettier").ParserOptions<any>, ast: any, isLastComment: boolean) => boolean;
};
};
};
export declare const options: Record<string, SupportOption>;
export declare const defaultOptions: {
tabWidth: number;
actionParser: string;
};
declare const _default: {
languages: {
name: string;
extensions: string[];
parsers: string[];
}[];
parsers: {
"pegjs-parser": {
parse: (input: string) => Grammar;
astFormat: string;
locStart: (node: AstNode) => number;
locEnd: (node: AstNode) => number;
};
};
printers: {
"pegjs-ast": {
print: (path: import("prettier").AstPath<AstNode | null | undefined>, options: import("prettier").ParserOptions<AstNode | null | undefined>, print: (path: import("prettier").AstPath<AstNode | null | undefined>) => import("prettier/doc").builders.Doc, args?: unknown) => import("prettier/doc").builders.Doc;
embed: (path: import("prettier").AstPath<any>, options: import("prettier").Options) => import("prettier/doc").builders.Doc | ((textToDoc: (text: string, options: import("prettier").Options) => Promise<import("prettier/doc").builders.Doc>, print: (selector?: string | number | import("prettier").AstPath<any> | (string | number)[] | undefined) => import("prettier/doc").builders.Doc, path: import("prettier").AstPath<any>, options: import("prettier").Options) => import("prettier/doc").builders.Doc | Promise<import("prettier/doc").builders.Doc | undefined> | undefined) | null;
canAttachComment: (node: AstNode) => boolean;
isBlockComment: (node: AstNode) => boolean;
printComment: (commentPath: import("prettier").AstPath<AstNode>, options: import("prettier").ParserOptions<AstNode>) => import("prettier/doc").builders.Doc;
handleComments: {
ownLine: (commentNode: any, text: string, options: import("prettier").ParserOptions<any>, ast: any, isLastComment: boolean) => boolean;
endOfLine: (commentNode: any, text: string, options: import("prettier").ParserOptions<any>, ast: any, isLastComment: boolean) => boolean;
remaining: (commentNode: any, text: string, options: import("prettier").ParserOptions<any>, ast: any, isLastComment: boolean) => boolean;
};
};
};
options: Record<string, SupportOption>;
};
export default _default;