@types/prettier-linter-helpers
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Installation

npm install --save @types/prettier-linter-helpers

Summary

This package contains type definitions for prettier-linter-helpers (https://github.com/prettier/prettier-linter-helpers).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prettier-linter-helpers.

index.d.ts

/**
 * Converts invisible characters to a commonly recognizable visible form.
 * @param str - The string with invisibles to convert.
 * @returns The converted string.
 */
export function showInvisibles(str: string): string;

export interface GenerateDifferences {
    /**
     * Generate results for differences between source code and formatted version.
     *
     * @param source - The original source.
     * @param prettierSource - The Prettier formatted source.
     * @returns An array containing { operation, offset, insertText, deleteText }
     */
    (source: string, prettierSource: string): Difference[];
    INSERT: "insert";
    DELETE: "delete";
    REPLACE: "replace";
}

export const generateDifferences: GenerateDifferences;

export interface Difference {
    operation: "insert" | "delete" | "replace";
    offset: number;
    insertText?: string | undefined;
    deleteText?: string | undefined;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by JounQin.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/prettier-linter-helpers

Weekly Downloads

3,400

Version

1.0.4

License

MIT

Unpacked Size

4.48 kB

Total Files

5

Last publish

Collaborators

  • types