UNPKG

964 BTypeScriptView Raw
1////////////////////////////////////////
2// For pg-minify v1.6.0 or later.
3////////////////////////////////////////
4
5declare namespace pgMinify {
6
7 interface IMinifyOptions {
8 compress?: boolean;
9 removeAll?: boolean;
10 }
11
12 interface IErrorPosition {
13 line: number;
14 column: number;
15 }
16
17 enum parsingErrorCode {
18 unclosedMLC = 0, // Unclosed multi-line comment.
19 unclosedText = 1, // Unclosed text block.
20 unclosedQI = 2, // Unclosed quoted identifier.
21 multiLineQI = 3 // Multi-line quoted identifiers are not supported.
22 }
23
24 class SQLParsingError implements Error {
25 name: string;
26 message: string;
27 stack: string;
28 error: string;
29 code: parsingErrorCode;
30 position: IErrorPosition;
31 }
32}
33
34declare function pgMinify(sql: string, options?: pgMinify.IMinifyOptions): string;
35
36export = pgMinify;