@servicenow/sdk - v4.4.1
    Preparing search index...
    interface Printer<T = any> {
        canAttachComment?: (node: T) => boolean;
        embed?: (
            path: AstPath,
            options: Options,
        ) =>
            | Doc
            | (
                (
                    textToDoc: (text: string, options: Options) => Promise<Doc>,
                    print: (
                        selector?: string | number | (string | number)[] | AstPath<any>,
                    ) => Doc,
                    path: AstPath,
                    options: Options,
                ) => Doc | Promise<Doc | undefined> | undefined
            )
            | null;
        getCommentChildNodes?: (
            node: T,
            options: ParserOptions<T>,
        ) => T[] | undefined;
        getVisitorKeys?: (node: T, nonTraversableKeys: Set<string>) => string[];
        handleComments?: {
            endOfLine?: (
                commentNode: any,
                text: string,
                options: ParserOptions<T>,
                ast: T,
                isLastComment: boolean,
            ) => boolean;
            ownLine?: (
                commentNode: any,
                text: string,
                options: ParserOptions<T>,
                ast: T,
                isLastComment: boolean,
            ) => boolean;
            remaining?: (
                commentNode: any,
                text: string,
                options: ParserOptions<T>,
                ast: T,
                isLastComment: boolean,
            ) => boolean;
        };
        hasPrettierIgnore?: (path: AstPath<T>) => boolean;
        insertPragma?: (text: string) => string;
        isBlockComment?: (node: T) => boolean;
        massageAstNode?: (original: any, cloned: any, parent: any) => any;
        preprocess?: (ast: T, options: ParserOptions<T>) => T | Promise<T>;
        printComment?: (commentPath: AstPath<T>, options: ParserOptions<T>) => Doc;
        willPrintOwnComments?: (path: AstPath<T>) => boolean;
        print(
            path: AstPath<T>,
            options: ParserOptions<T>,
            print: (path: AstPath<T>) => Doc,
            args?: unknown,
        ): Doc;
    }

    Type Parameters

    • T = any
    Index

    Properties

    canAttachComment?: (node: T) => boolean
    embed?: (
        path: AstPath,
        options: Options,
    ) =>
        | Doc
        | (
            (
                textToDoc: (text: string, options: Options) => Promise<Doc>,
                print: (
                    selector?: string | number | (string | number)[] | AstPath<any>,
                ) => Doc,
                path: AstPath,
                options: Options,
            ) => Doc | Promise<Doc | undefined> | undefined
        )
        | null
    getCommentChildNodes?: (node: T, options: ParserOptions<T>) => T[] | undefined

    By default, Prettier searches all object properties (except for a few predefined ones) of each node recursively. This function can be provided to override that behavior.

    Type Declaration

      • (node: T, options: ParserOptions<T>): T[] | undefined
      • Parameters

        • node: T

          The node whose children should be returned.

        • options: ParserOptions<T>

          Current options.

        Returns T[] | undefined

        [] if the node has no children or undefined to fall back on the default behavior.

    getVisitorKeys?: (node: T, nonTraversableKeys: Set<string>) => string[]
    handleComments?: {
        endOfLine?: (
            commentNode: any,
            text: string,
            options: ParserOptions<T>,
            ast: T,
            isLastComment: boolean,
        ) => boolean;
        ownLine?: (
            commentNode: any,
            text: string,
            options: ParserOptions<T>,
            ast: T,
            isLastComment: boolean,
        ) => boolean;
        remaining?: (
            commentNode: any,
            text: string,
            options: ParserOptions<T>,
            ast: T,
            isLastComment: boolean,
        ) => boolean;
    }
    hasPrettierIgnore?: (path: AstPath<T>) => boolean
    insertPragma?: (text: string) => string
    isBlockComment?: (node: T) => boolean
    massageAstNode?: (original: any, cloned: any, parent: any) => any

    Type Declaration

      • (original: any, cloned: any, parent: any): any
      • Parameters

        • original: any
        • cloned: any
        • parent: any

        Returns any

        null if you want to remove this node

    preprocess?: (ast: T, options: ParserOptions<T>) => T | Promise<T>
    printComment?: (commentPath: AstPath<T>, options: ParserOptions<T>) => Doc
    willPrintOwnComments?: (path: AstPath<T>) => boolean

    Methods