/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ import ts from 'typescript'; /** * The content of the comments generated by the preserveBlankLines transformer. * * Contains a fixed random string that is meaningless and serves only to make * the chance of collisions negligible. */ export declare const BLANK_LINE_PLACEHOLDER_COMMENT = "__BLANK_LINE_PLACEHOLDER_G1JVXUEBNCL6YN5NFE13MD1PT3H9OIHB__"; /** * A regular expression that matches the comments generated by the * preserveBlankLines transformer, including the leading "//" and preceding * indentation. */ export declare const BLANK_LINE_PLACEHOLDER_COMMENT_REGEXP: RegExp; /** * TypeScript transformer that replaces blank lines in the original source with * a unique comment, allowing original line formatting to be preserved after * transform using a simple search-and-replace. * * For example, given: * * import 'foo'; * * class Foo { * foo() {} * * bar() {} * } * * Produces: * * import 'foo'; * //__BLANK_LINE_PLACEHOLDER_G1JVXUEBNCL6YN5NFE13MD1PT3H9OIHB__ * class Foo { * foo() {} * //__BLANK_LINE_PLACEHOLDER_G1JVXUEBNCL6YN5NFE13MD1PT3H9OIHB__ * bar() {} * } * * These placeholder comments can be replaced with newlines after transform with * the `BLANK_LINE_PLACEHOLDER_COMMENT_REGEXP` regexp, or with any equivalent * search-and-replace operation for the comment style shown above. */ export declare function preserveBlankLinesTransformer(): ts.TransformerFactory;