@astrojs/compiler 0.16.0 → 0.16.1

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.
@@ -0,0 +1,61 @@
1
+ import { RootNode } from './ast';
2
+ export * from './ast';
3
+ export interface PreprocessorResult {
4
+ code: string;
5
+ map?: string;
6
+ }
7
+ export interface ParseOptions {
8
+ position?: boolean;
9
+ }
10
+ export interface TransformOptions {
11
+ internalURL?: string;
12
+ site?: string;
13
+ sourcefile?: string;
14
+ pathname?: string;
15
+ sourcemap?: boolean | 'inline' | 'external' | 'both';
16
+ /**
17
+ * @deprecated "as" has been removed and no longer has any effect!
18
+ */
19
+ as?: 'document' | 'fragment';
20
+ projectRoot?: string;
21
+ preprocessStyle?: (content: string, attrs: Record<string, string>) => Promise<PreprocessorResult>;
22
+ experimentalStaticExtraction?: boolean;
23
+ }
24
+ export declare type HoistedScript = {
25
+ type: string;
26
+ } & ({
27
+ type: 'external';
28
+ src: string;
29
+ } | {
30
+ type: 'inline';
31
+ code: string;
32
+ });
33
+ export interface HydratedComponent {
34
+ exportName: string;
35
+ specifier: string;
36
+ resolvedPath: string;
37
+ }
38
+ export interface TransformResult {
39
+ css: string[];
40
+ scripts: HoistedScript[];
41
+ hydratedComponents: HydratedComponent[];
42
+ clientOnlyComponents: HydratedComponent[];
43
+ code: string;
44
+ map: string;
45
+ }
46
+ export interface TSXResult {
47
+ code: string;
48
+ map: string;
49
+ }
50
+ export interface ParseResult {
51
+ ast: RootNode;
52
+ }
53
+ export declare function transform(input: string, options?: TransformOptions): Promise<TransformResult>;
54
+ export declare function parse(input: string, options?: ParseOptions): Promise<ParseResult>;
55
+ export declare function convertToTSX(input: string, options?: {
56
+ sourcefile?: string;
57
+ }): Promise<TSXResult>;
58
+ export declare function initialize(options: InitializeOptions): Promise<void>;
59
+ export interface InitializeOptions {
60
+ wasmURL?: string;
61
+ }
@@ -0,0 +1 @@
1
+ export * from './ast';