@hekana/prettier-plugin-sneferu 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/LICENSE +1 -0
- package/README.md +14 -2
- package/dist/index.cjs +646 -0
- package/dist/index.d.cts +68 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +614 -0
- package/package.json +50 -3
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Plugin, SupportOption } from 'prettier';
|
|
2
|
+
|
|
3
|
+
interface Attr {
|
|
4
|
+
name: string;
|
|
5
|
+
value: string | null;
|
|
6
|
+
quote: '"' | "'" | '';
|
|
7
|
+
}
|
|
8
|
+
interface Base {
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
}
|
|
12
|
+
type Node = (Base & {
|
|
13
|
+
type: 'text';
|
|
14
|
+
value: string;
|
|
15
|
+
}) | (Base & {
|
|
16
|
+
type: 'comment';
|
|
17
|
+
value: string;
|
|
18
|
+
}) | (Base & {
|
|
19
|
+
type: 'interp';
|
|
20
|
+
src: string;
|
|
21
|
+
}) | (Base & {
|
|
22
|
+
type: 'directive';
|
|
23
|
+
kw: string;
|
|
24
|
+
src: string;
|
|
25
|
+
}) | (Base & {
|
|
26
|
+
type: 'schema';
|
|
27
|
+
json: string;
|
|
28
|
+
raw: string;
|
|
29
|
+
}) | (Base & {
|
|
30
|
+
type: 'element';
|
|
31
|
+
name: string;
|
|
32
|
+
attrs: Attr[];
|
|
33
|
+
selfClosing: boolean;
|
|
34
|
+
children: Node[];
|
|
35
|
+
openEnd: number;
|
|
36
|
+
closeStart: number;
|
|
37
|
+
}) | (Base & {
|
|
38
|
+
type: 'if';
|
|
39
|
+
branches: {
|
|
40
|
+
src: string;
|
|
41
|
+
body: Node[];
|
|
42
|
+
}[];
|
|
43
|
+
else?: {
|
|
44
|
+
src: string;
|
|
45
|
+
body: Node[];
|
|
46
|
+
};
|
|
47
|
+
endSrc: string;
|
|
48
|
+
}) | (Base & {
|
|
49
|
+
type: 'for';
|
|
50
|
+
src: string;
|
|
51
|
+
body: Node[];
|
|
52
|
+
endSrc: string;
|
|
53
|
+
});
|
|
54
|
+
interface Root extends Base {
|
|
55
|
+
type: 'root';
|
|
56
|
+
children: Node[];
|
|
57
|
+
source: string;
|
|
58
|
+
}
|
|
59
|
+
declare function parse(src: string): Root;
|
|
60
|
+
|
|
61
|
+
declare const languages: Plugin['languages'];
|
|
62
|
+
declare const parsers: Plugin<Node | Root>['parsers'];
|
|
63
|
+
declare const printers: Plugin<Node | Root>['printers'];
|
|
64
|
+
declare const options: Record<string, SupportOption>;
|
|
65
|
+
declare const defaultOptions: Plugin['defaultOptions'];
|
|
66
|
+
declare const plugin: Plugin<Node | Root>;
|
|
67
|
+
|
|
68
|
+
export { plugin as default, defaultOptions, languages, options, parse, parsers, printers };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Plugin, SupportOption } from 'prettier';
|
|
2
|
+
|
|
3
|
+
interface Attr {
|
|
4
|
+
name: string;
|
|
5
|
+
value: string | null;
|
|
6
|
+
quote: '"' | "'" | '';
|
|
7
|
+
}
|
|
8
|
+
interface Base {
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
}
|
|
12
|
+
type Node = (Base & {
|
|
13
|
+
type: 'text';
|
|
14
|
+
value: string;
|
|
15
|
+
}) | (Base & {
|
|
16
|
+
type: 'comment';
|
|
17
|
+
value: string;
|
|
18
|
+
}) | (Base & {
|
|
19
|
+
type: 'interp';
|
|
20
|
+
src: string;
|
|
21
|
+
}) | (Base & {
|
|
22
|
+
type: 'directive';
|
|
23
|
+
kw: string;
|
|
24
|
+
src: string;
|
|
25
|
+
}) | (Base & {
|
|
26
|
+
type: 'schema';
|
|
27
|
+
json: string;
|
|
28
|
+
raw: string;
|
|
29
|
+
}) | (Base & {
|
|
30
|
+
type: 'element';
|
|
31
|
+
name: string;
|
|
32
|
+
attrs: Attr[];
|
|
33
|
+
selfClosing: boolean;
|
|
34
|
+
children: Node[];
|
|
35
|
+
openEnd: number;
|
|
36
|
+
closeStart: number;
|
|
37
|
+
}) | (Base & {
|
|
38
|
+
type: 'if';
|
|
39
|
+
branches: {
|
|
40
|
+
src: string;
|
|
41
|
+
body: Node[];
|
|
42
|
+
}[];
|
|
43
|
+
else?: {
|
|
44
|
+
src: string;
|
|
45
|
+
body: Node[];
|
|
46
|
+
};
|
|
47
|
+
endSrc: string;
|
|
48
|
+
}) | (Base & {
|
|
49
|
+
type: 'for';
|
|
50
|
+
src: string;
|
|
51
|
+
body: Node[];
|
|
52
|
+
endSrc: string;
|
|
53
|
+
});
|
|
54
|
+
interface Root extends Base {
|
|
55
|
+
type: 'root';
|
|
56
|
+
children: Node[];
|
|
57
|
+
source: string;
|
|
58
|
+
}
|
|
59
|
+
declare function parse(src: string): Root;
|
|
60
|
+
|
|
61
|
+
declare const languages: Plugin['languages'];
|
|
62
|
+
declare const parsers: Plugin<Node | Root>['parsers'];
|
|
63
|
+
declare const printers: Plugin<Node | Root>['printers'];
|
|
64
|
+
declare const options: Record<string, SupportOption>;
|
|
65
|
+
declare const defaultOptions: Plugin['defaultOptions'];
|
|
66
|
+
declare const plugin: Plugin<Node | Root>;
|
|
67
|
+
|
|
68
|
+
export { plugin as default, defaultOptions, languages, options, parse, parsers, printers };
|