forked from sveltejs/rollup-plugin-svelte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
94 lines (80 loc) · 1.92 KB
/
index.d.ts
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import { Plugin, RollupWarning } from 'rollup';
import { PreprocessorGroup } from 'svelte/types/compiler/preprocess';
interface Css {
code: any;
map: any;
}
declare class CssWriter {
code: string;
filename: string;
map: {
version: number;
file?: boolean;
sources: string[];
sourcesContent: string[];
names: any[];
mappings: string;
};
warn: RollupWarning;
emit(fileName: string, source: string): void;
write(dest: string, map: boolean): void;
toString(): string;
}
type CssEmitter = (css: CssWriter) => any;
interface Options {
/**
* By default, all .svelte and .html files are compiled
* @default ['.html', '.svelte']
*/
extensions?: string[];
/**
* You can restrict which files are compiled
* using `include` and `exclude`
* @typedef {string} InclureAndExclude
*/
/**
* @type {IncludeAndExclude}
*/
include?: string;
/**
* @type {IncludeAndExclude}
*/
exclude?: string;
/**
* By default, the client-side compiler is used. You
* can also use the server-side rendering compiler
*/
generate?: 'dom' | 'ssr' | false;
/**
* Optionally, preprocess components with svelte.preprocess:
* https://svelte.dev/docs#svelte_preprocess
*/
preprocess?: PreprocessorGroup | PreprocessorGroup[];
// {
// style: ({ content }) => {
// return transformStyles(content);
// }
// },
/**
* Emit CSS as "files" for other plugins to process
* @default false
*/
emitCss?: boolean;
/**
* Extract CSS into a separate file (recommended).
*/
css?: false | CssEmitter;
/**
* Compile Svelte components to custom elements (aka web components).
* @default false
*/
customElement?: boolean;
/**
* let Rollup handle all other warnings normally
*/
onwarn?: (
warning: RollupWarning,
handler: (w: RollupWarning | string) => void
) => void;
}
export default function svelte(options: Options): Plugin;