UNPKG

1.75 kBTypeScriptView Raw
1// Type definitions for pretty-quick 3.1
2// Project: https://github.com/azz/pretty-quick#readme
3// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5// Minimum TypeScript Version: 4.2
6
7import { ResolveConfigOptions } from 'prettier';
8
9declare namespace prettyQuick {
10 interface Options {
11 config?: ResolveConfigOptions | undefined;
12 since?: string | undefined;
13 /** @default false */
14 staged?: boolean | undefined;
15 pattern?: string | string[] | undefined;
16 /** @default true */
17 restage?: boolean | undefined;
18 /**
19 * @default 'master' | 'default'
20 */
21 branch?: string | undefined;
22 bail?: boolean | undefined;
23 check?: boolean | undefined;
24 ignorePath?: string | undefined;
25 verbose?: boolean | undefined;
26 onFoundSinceRevision?: ((name: string, revision: string) => void) | undefined;
27 onFoundChangedFiles?: ((changedFiles: string[]) => void) | undefined;
28 onPartiallyStagedFile?: ((file: string) => void) | undefined;
29 onExamineFile?: ((file: string) => void) | undefined;
30 onCheckFile?: ((file: string, isFormatted: boolean) => void) | undefined;
31 onWriteFile?: ((file: string) => void) | undefined;
32 // ...args support
33 [key: string]: any;
34 }
35
36 interface Results {
37 readonly success: boolean;
38 readonly errors: string[];
39 }
40}
41
42/**
43 * Runs Prettier on your changed files.
44 * Supported source control managers:
45 * * Git
46 * * Mercurial
47 */
48declare function prettyQuick(currentDirectory: string, options?: prettyQuick.Options): prettyQuick.Results;
49
50export = prettyQuick;
51
\No newline at end of file