-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
121 lines (115 loc) · 3.2 KB
/
types.ts
File metadata and controls
121 lines (115 loc) · 3.2 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import type {Writable} from 'stream';
import type {Matcher} from 'anymatch';
import type {AwaitWriteFinishOptions, WatchOptions} from 'chokidar';
import type {AcceptedPlugin, ProcessOptions, SourceMapOptions} from 'postcss';
import type {PluginOptions} from '../postcssPlugin/types';
export interface SessionOptions {
/**
* Pattern(s) to be included
* @default "*"
*/
include?: Array<string> | string,
/**
* Pattern(s) to be excluded.
* @default ['node_modules']
*/
exclude?: Matcher,
/**
* File extension(s) to be included.
* @default ['.css']
*/
extensions?: Array<string>,
/**
* Where this plugin outputs the helper script.
* If you use TypeScript, set a value like '*.ts'.
* You can't use this option with the css option.
* The {hash} in the default value is calculated from the include option.
* @default "helper.{hash}.css.js"
*/
helper?: string,
/**
* File extension of generated script.
* @default options.helper ? path.extname(options.helper) : '.js'
*/
ext?: string,
/**
* Where this plugin outputs the css.
* You can't use this option with the helper option.
* @default undefined
*/
css?: string,
/**
* It it is true, a watcher is enabled.
* @default false
*/
watch?: boolean,
/**
* Options passed to chokidar.
* You can't set ignoreInitial to true.
* @default {
* ignore: exclude,
* ignoreInitial: false,
* useFsEvents: false,
* }
*/
chokidar?: WatchOptions,
/**
* An array of postcss plugins.
* esifycss.plugin is appended to this array.
* @default []
*/
postcssPlugins?: Array<AcceptedPlugin>,
/**
* https://github.com/postcss/postcss#options
* @default undefined
*/
postcssOptions?: ProcessOptions,
/**
* Parameters for esifycss.plugin.
*/
esifycssPluginParameter?: PluginOptions,
/**
* A stream where the runner outputs logs.
* @default process.stdout
*/
stdout?: Writable,
/**
* A stream where the runner outputs errorlogs.
* @default process.stderr
*/
stderr?: Writable,
}
export interface ReadonlyWatchOptions extends Readonly<WatchOptions> {
awaitWriteFinish?: Readonly<AwaitWriteFinishOptions> | boolean,
}
export interface SessionOutput {
type: 'css' | 'script',
path: string,
}
export interface SessionConfiguration {
readonly watch: boolean,
readonly output: SessionOutput,
readonly ext: string,
readonly path: ReadonlyArray<string>,
readonly chokidar: ReadonlyWatchOptions,
readonly stdout: Writable,
readonly stderr: Writable,
readonly postcssPlugins: Array<AcceptedPlugin>,
readonly postcssOptions: ProcessOptions,
readonly cssKey: string,
}
export interface CSSParserParameters {
file: string,
css?: Buffer | string,
options?: ProcessOptions,
plugins: Array<AcceptedPlugin>,
map?: SourceMapOptions,
}
export interface CSSParserConfigurations {
readonly css: string,
readonly plugins: Array<AcceptedPlugin>,
readonly options: {
readonly from: string,
readonly map: SourceMapOptions,
},
}