-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
117 lines (99 loc) · 2.93 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import { any } from 'micromatch';
//
// Type definitions for rollup-plugin-jscc v1.0.x
// Definitions by aMarCruz
//
export = JsccPlugin
declare class JsccPlugin {
constructor (options: JsccPlugin.BrunchConf);
compile(param: JsccPlugin.File): Promise<JsccPlugin.File>;
pattern: RegExp;
staticPattern?: RegExp;
type: string;
}
declare namespace JsccPlugin {
type QuoteType = 'single' | 'double' | 'both'
type MatcherCB = (path: string) => boolean
interface BrunchConf {
[k: string]: any;
plugins: {
[k: string]: any;
jscc: Options;
}
}
interface Options {
/**
* String with the type of quotes to escape in the output of strings:
* 'single', 'double' or 'both'.
*
* It does not affects the output of regexes or strings contained in the
* JSON output of objects.
*/
escapeQuotes?: QuoteType;
/**
* Preserves the empty lines of the directives and blocks that were removed.
*
* Use this option with `sourceMap:false` if you are interested only in
* keeping the line numbering.
* @default true
*/
keepLines?: boolean;
/**
* Make a hi-res source-map, if `sourceMap:true` (the default).
* @default true
*/
mapHires?: boolean;
/**
* String, regex or array of strings or regexes matching the start of a directive.
* That is, the characters before the '#', usually the start of comments.
* @default /(?:\/[/*]|<!--) ?/
*/
prefixes?: string | RegExp | Array<string | RegExp>;
/**
* Must include a sourceMap?
* @default false
*/
sourceMaps?: boolean;
/**
* Alias for `sourceMaps`
* @deprecated
*/
sourceMap?: boolean;
/**
* [anymatch](https://github.com/es128/anymatch) of files for which sourcemap
* must be generated if `sourceMaps:true`.
* @default (JavaSctipt/TypeScript files)
*/
sourceMapFor?: string | RegExp | MatcherCB | Array<string | RegExp | MatcherCB>;
/**
* Plain object defining the variables used by jscc during the preprocessing.
*
* Each key is a varname matching the regex `_[0-9A-Z][_0-9A-Z]*`, the value
* can have any type.
*
* It has two predefined, readonly properties:
* - `_FILE` : Name of the source file, relative to the current directory
* - `_VERSION` : The version property in the package.json
*/
values?: { [k: string]: any };
/**
* [anymatch](https://github.com/es128/anymatch) of files that should not
* be processed.
*
* @default /^(bower_components|node_modules|vendor)\//
*/
ignore?: string | RegExp | MatcherCB | Array<string | RegExp | MatcherCB>;
/**
* Regular expression that matches the file paths you want to process.
*
* _Note:_ Do not use wildcards here.
* @default /\.(js|ts)x?$/
*/
pattern?: RegExp;
}
interface File {
data: string;
path: string;
map?: object;
}
}