UNPKG

1.72 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
6import { ResolveConfigOptions } from 'prettier';
7
8declare namespace prettyQuick {
9 interface Options {
10 config?: ResolveConfigOptions | undefined;
11 since?: string | undefined;
12 /** @default false */
13 staged?: boolean | undefined;
14 pattern?: string | string[] | undefined;
15 /** @default true */
16 restage?: boolean | undefined;
17 /**
18 * @default 'master' | 'default'
19 */
20 branch?: string | undefined;
21 bail?: boolean | undefined;
22 check?: boolean | undefined;
23 ignorePath?: string | undefined;
24 verbose?: boolean | undefined;
25 onFoundSinceRevision?: ((name: string, revision: string) => void) | undefined;
26 onFoundChangedFiles?: ((changedFiles: string[]) => void) | undefined;
27 onPartiallyStagedFile?: ((file: string) => void) | undefined;
28 onExamineFile?: ((file: string) => void) | undefined;
29 onCheckFile?: ((file: string, isFormatted: boolean) => void) | undefined;
30 onWriteFile?: ((file: string) => void) | undefined;
31 // ...args support
32 [key: string]: any;
33 }
34
35 interface Results {
36 readonly success: boolean;
37 readonly errors: string[];
38 }
39}
40
41/**
42 * Runs Prettier on your changed files.
43 * Supported source control managers:
44 * * Git
45 * * Mercurial
46 */
47declare function prettyQuick(currentDirectory: string, options?: prettyQuick.Options): prettyQuick.Results;
48
49export = prettyQuick;
50
\No newline at end of file