-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.d.cts
40 lines (35 loc) · 1.22 KB
/
index.d.cts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
type Prettier = typeof import("prettier");
type SynchronizedPrettier = {
// Prettier static properties
version: Prettier["version"];
util: Prettier["util"];
doc: Prettier["doc"];
// Prettier functions
formatWithCursor: PrettierSynchronizedFunction<"formatWithCursor">;
format: PrettierSynchronizedFunction<"format">;
check: PrettierSynchronizedFunction<"check">;
resolveConfig: PrettierSynchronizedFunction<"resolveConfig">;
resolveConfigFile: PrettierSynchronizedFunction<"resolveConfigFile">;
clearConfigCache: PrettierSynchronizedFunction<"clearConfigCache">;
getFileInfo: PrettierSynchronizedFunction<"getFileInfo">;
getSupportInfo: PrettierSynchronizedFunction<"getSupportInfo">;
};
type PrettierSynchronizedFunction<
FunctionName extends
| "formatWithCursor"
| "format"
| "check"
| "resolveConfig"
| "resolveConfigFile"
| "clearConfigCache"
| "getFileInfo"
| "getSupportInfo",
> = (
...args: Parameters<Prettier[FunctionName]>
) => Awaited<ReturnType<Prettier[FunctionName]>>;
declare const synchronizedPrettier: SynchronizedPrettier & {
createSynchronizedPrettier: (options: {
prettierEntry: string | URL;
}) => SynchronizedPrettier;
};
export = synchronizedPrettier;