1.0.4 • Published 6 months ago

@types/prettier-linter-helpers v1.0.4

Weekly downloads
28,522
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for prettier-linter-helpers 1.0
// Project: https://github.com/prettier/prettier-linter-helpers
// Definitions by: JounQin <https://github.com/JounQin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/**
 * 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: Wed, 07 Jul 2021 17:02:36 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by JounQin.

1.0.2

8 months ago

1.0.4

6 months ago

1.0.3

7 months ago

1.0.1

3 years ago

1.0.0

4 years ago