Sha256: 5dc165229ad3db8fabf95c0673475bd24bec4fdd678e523505d6b9a2e183031e

Contents?: true

Size: 1.39 KB

Versions: 17

Compression:

Stored size: 1.39 KB

Contents

import { CursorOptions, CursorResult, Options, SupportInfo } from "./index.js";

/**
 * formatWithCursor both formats the code, and translates a cursor position from unformatted code to formatted code.
 * This is useful for editor integrations, to prevent the cursor from moving when code is formatted
 *
 * The cursorOffset option should be provided, to specify where the cursor is. This option cannot be used with rangeStart and rangeEnd.
 *
 * ```js
 * await prettier.formatWithCursor(" 1", { cursorOffset: 2, parser: "babel" });
 * ```
 * `-> { formatted: "1;\n", cursorOffset: 1 }`
 */
export function formatWithCursor(
  source: string,
  options: CursorOptions,
): Promise<CursorResult>;

/**
 * `format` is used to format text using Prettier. [Options](https://prettier.io/docs/en/options.html) may be provided to override the defaults.
 */
export function format(source: string, options?: Options): Promise<string>;

/**
 * `check` checks to see if the file has been formatted with Prettier given those options and returns a `Boolean`.
 * This is similar to the `--list-different` parameter in the CLI and is useful for running Prettier in CI scenarios.
 */
export function check(source: string, options?: Options): Promise<boolean>;

/**
 * Returns an object representing the parsers, languages and file types Prettier supports for the current version.
 */
export function getSupportInfo(): Promise<SupportInfo>;

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.22 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.21 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.20 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.19 node_modules/prettier/standalone.d.ts
prettier-4.0.3 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.18 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.17 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.16 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.14 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.13 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.12 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.11 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.10 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.9 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.8 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.7 node_modules/prettier/standalone.d.ts
immosquare-cleaner-0.1.6 node_modules/prettier/standalone.d.ts