@umijs/bundler-utils 4.0.0-rc.2 → 4.0.0-rc.20
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/compiled/babel/index.js +63567 -35264
- package/compiled/babel/index1.js +32 -38
- package/compiled/es-module-lexer/LICENSE +1 -1
- package/compiled/es-module-lexer/index.js +1 -1
- package/compiled/express/LICENSE +24 -0
- package/compiled/express/body-parser/index.d.ts +107 -0
- package/compiled/express/connect/index.d.ts +93 -0
- package/compiled/express/express-serve-static-core/index.d.ts +1252 -0
- package/compiled/express/index.d.ts +133 -0
- package/compiled/express/index.js +321 -0
- package/compiled/express/mime/index.d.ts +35 -0
- package/compiled/express/package.json +1 -0
- package/compiled/express/qs/index.d.ts +62 -0
- package/compiled/express/range-parser/index.d.ts +35 -0
- package/compiled/express/serve-static/index.d.ts +108 -0
- package/compiled/less/index.d.ts +284 -0
- package/compiled/less/index.js +17 -0
- package/compiled/less/package.json +1 -0
- package/compiled/tapable/LICENSE +21 -0
- package/compiled/tapable/index.js +1 -0
- package/compiled/tapable/package.json +1 -0
- package/compiled/tapable/tapable.d.ts +116 -0
- package/dist/https.d.ts +9 -0
- package/dist/https.js +75 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +18 -13
- package/dist/types.d.ts +5 -0
- package/dist/types.js +2 -0
- package/package.json +27 -14
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Type definitions for mime 1.3
|
|
2
|
+
// Project: https://github.com/broofa/node-mime
|
|
3
|
+
// Definitions by: Jeff Goddard <https://github.com/jedigo>
|
|
4
|
+
// Daniel Hritzkiv <https://github.com/dhritzkiv>
|
|
5
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
6
|
+
|
|
7
|
+
// Originally imported from: https://github.com/soywiz/typescript-node-definitions/mime.d.ts
|
|
8
|
+
|
|
9
|
+
export as namespace mime;
|
|
10
|
+
|
|
11
|
+
export interface TypeMap { [key: string]: string[]; }
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Look up a mime type based on extension.
|
|
15
|
+
*
|
|
16
|
+
* If not found, uses the fallback argument if provided, and otherwise
|
|
17
|
+
* uses `default_type`.
|
|
18
|
+
*/
|
|
19
|
+
export function lookup(path: string, fallback?: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Return a file extensions associated with a mime type.
|
|
22
|
+
*/
|
|
23
|
+
export function extension(mime: string): string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Load an Apache2-style ".types" file.
|
|
26
|
+
*/
|
|
27
|
+
export function load(filepath: string): void;
|
|
28
|
+
export function define(mimes: TypeMap): void;
|
|
29
|
+
|
|
30
|
+
export interface Charsets {
|
|
31
|
+
lookup(mime: string, fallback: string): string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const charsets: Charsets;
|
|
35
|
+
export const default_type: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"express","author":"TJ Holowaychuk <tj@vision-media.ca>","license":"MIT"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Type definitions for qs 6.9
|
|
2
|
+
// Project: https://github.com/ljharb/qs
|
|
3
|
+
// Definitions by: Roman Korneev <https://github.com/RWander>
|
|
4
|
+
// Leon Yu <https://github.com/leonyu>
|
|
5
|
+
// Belinda Teh <https://github.com/tehbelinda>
|
|
6
|
+
// Melvin Lee <https://github.com/zyml>
|
|
7
|
+
// Arturs Vonda <https://github.com/artursvonda>
|
|
8
|
+
// Carlos Bonetti <https://github.com/CarlosBonetti>
|
|
9
|
+
// Dan Smith <https://github.com/dpsmith3>
|
|
10
|
+
// Hunter Perrin <https://github.com/hperrin>
|
|
11
|
+
// Jordan Harband <https://github.com/ljharb>
|
|
12
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
13
|
+
export = QueryString;
|
|
14
|
+
export as namespace qs;
|
|
15
|
+
|
|
16
|
+
declare namespace QueryString {
|
|
17
|
+
type defaultEncoder = (str: any, defaultEncoder?: any, charset?: string) => string;
|
|
18
|
+
type defaultDecoder = (str: string, decoder?: any, charset?: string) => string;
|
|
19
|
+
|
|
20
|
+
interface IStringifyOptions {
|
|
21
|
+
delimiter?: string | undefined;
|
|
22
|
+
strictNullHandling?: boolean | undefined;
|
|
23
|
+
skipNulls?: boolean | undefined;
|
|
24
|
+
encode?: boolean | undefined;
|
|
25
|
+
encoder?: ((str: any, defaultEncoder: defaultEncoder, charset: string, type: 'key' | 'value') => string) | undefined;
|
|
26
|
+
filter?: Array<string | number> | ((prefix: string, value: any) => any) | undefined;
|
|
27
|
+
arrayFormat?: 'indices' | 'brackets' | 'repeat' | 'comma' | undefined;
|
|
28
|
+
indices?: boolean | undefined;
|
|
29
|
+
sort?: ((a: any, b: any) => number) | undefined;
|
|
30
|
+
serializeDate?: ((d: Date) => string) | undefined;
|
|
31
|
+
format?: 'RFC1738' | 'RFC3986' | undefined;
|
|
32
|
+
encodeValuesOnly?: boolean | undefined;
|
|
33
|
+
addQueryPrefix?: boolean | undefined;
|
|
34
|
+
allowDots?: boolean | undefined;
|
|
35
|
+
charset?: 'utf-8' | 'iso-8859-1' | undefined;
|
|
36
|
+
charsetSentinel?: boolean | undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface IParseOptions {
|
|
40
|
+
comma?: boolean | undefined;
|
|
41
|
+
delimiter?: string | RegExp | undefined;
|
|
42
|
+
depth?: number | false | undefined;
|
|
43
|
+
decoder?: ((str: string, defaultDecoder: defaultDecoder, charset: string, type: 'key' | 'value') => any) | undefined;
|
|
44
|
+
arrayLimit?: number | undefined;
|
|
45
|
+
parseArrays?: boolean | undefined;
|
|
46
|
+
allowDots?: boolean | undefined;
|
|
47
|
+
plainObjects?: boolean | undefined;
|
|
48
|
+
allowPrototypes?: boolean | undefined;
|
|
49
|
+
parameterLimit?: number | undefined;
|
|
50
|
+
strictNullHandling?: boolean | undefined;
|
|
51
|
+
ignoreQueryPrefix?: boolean | undefined;
|
|
52
|
+
charset?: 'utf-8' | 'iso-8859-1' | undefined;
|
|
53
|
+
charsetSentinel?: boolean | undefined;
|
|
54
|
+
interpretNumericEntities?: boolean | undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface ParsedQs { [key: string]: undefined | string | string[] | ParsedQs | ParsedQs[] }
|
|
58
|
+
|
|
59
|
+
function stringify(obj: any, options?: IStringifyOptions): string;
|
|
60
|
+
function parse(str: string, options?: IParseOptions & { decoder?: never | undefined }): ParsedQs;
|
|
61
|
+
function parse(str: string | Record<string, string>, options?: IParseOptions): { [key: string]: unknown };
|
|
62
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Type definitions for range-parser 1.2
|
|
2
|
+
// Project: https://github.com/jshttp/range-parser
|
|
3
|
+
// Definitions by: Tomek Łaziuk <https://github.com/tlaziuk>
|
|
4
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* When ranges are returned, the array has a "type" property which is the type of
|
|
8
|
+
* range that is required (most commonly, "bytes"). Each array element is an object
|
|
9
|
+
* with a "start" and "end" property for the portion of the range.
|
|
10
|
+
*
|
|
11
|
+
* @returns `-1` when unsatisfiable and `-2` when syntactically invalid, ranges otherwise.
|
|
12
|
+
*/
|
|
13
|
+
declare function RangeParser(size: number, str: string, options?: RangeParser.Options): RangeParser.Result | RangeParser.Ranges;
|
|
14
|
+
|
|
15
|
+
declare namespace RangeParser {
|
|
16
|
+
interface Ranges extends Array<Range> {
|
|
17
|
+
type: string;
|
|
18
|
+
}
|
|
19
|
+
interface Range {
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
}
|
|
23
|
+
interface Options {
|
|
24
|
+
/**
|
|
25
|
+
* The "combine" option can be set to `true` and overlapping & adjacent ranges
|
|
26
|
+
* will be combined into a single range.
|
|
27
|
+
*/
|
|
28
|
+
combine?: boolean | undefined;
|
|
29
|
+
}
|
|
30
|
+
type ResultUnsatisfiable = -1;
|
|
31
|
+
type ResultInvalid = -2;
|
|
32
|
+
type Result = ResultUnsatisfiable | ResultInvalid;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export = RangeParser;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// Type definitions for serve-static 1.13
|
|
2
|
+
// Project: https://github.com/expressjs/serve-static
|
|
3
|
+
// Definitions by: Uros Smolnik <https://github.com/urossmolnik>
|
|
4
|
+
// Linus Unnebäck <https://github.com/LinusU>
|
|
5
|
+
// Devansh Jethmalani <https://github.com/devanshj>
|
|
6
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
|
+
// TypeScript Version: 2.3
|
|
8
|
+
|
|
9
|
+
/// <reference types="node" />
|
|
10
|
+
import * as m from '../mime';
|
|
11
|
+
import * as http from 'http';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Create a new middleware function to serve files from within a given root directory.
|
|
15
|
+
* The file to serve will be determined by combining req.url with the provided root directory.
|
|
16
|
+
* When a file is not found, instead of sending a 404 response, this module will instead call next() to move on to the next middleware, allowing for stacking and fall-backs.
|
|
17
|
+
*/
|
|
18
|
+
declare function serveStatic<R extends http.ServerResponse>(
|
|
19
|
+
root: string,
|
|
20
|
+
options?: serveStatic.ServeStaticOptions<R>
|
|
21
|
+
): serveStatic.RequestHandler<R>;
|
|
22
|
+
|
|
23
|
+
declare namespace serveStatic {
|
|
24
|
+
var mime: typeof m;
|
|
25
|
+
interface ServeStaticOptions<R extends http.ServerResponse = http.ServerResponse> {
|
|
26
|
+
/**
|
|
27
|
+
* Enable or disable setting Cache-Control response header, defaults to true.
|
|
28
|
+
* Disabling this will ignore the immutable and maxAge options.
|
|
29
|
+
*/
|
|
30
|
+
cacheControl?: boolean | undefined;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Set how "dotfiles" are treated when encountered. A dotfile is a file or directory that begins with a dot (".").
|
|
34
|
+
* Note this check is done on the path itself without checking if the path actually exists on the disk.
|
|
35
|
+
* If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny").
|
|
36
|
+
* The default value is 'ignore'.
|
|
37
|
+
* 'allow' No special treatment for dotfiles
|
|
38
|
+
* 'deny' Send a 403 for any request for a dotfile
|
|
39
|
+
* 'ignore' Pretend like the dotfile does not exist and call next()
|
|
40
|
+
*/
|
|
41
|
+
dotfiles?: string | undefined;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Enable or disable etag generation, defaults to true.
|
|
45
|
+
*/
|
|
46
|
+
etag?: boolean | undefined;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Set file extension fallbacks. When set, if a file is not found, the given extensions will be added to the file name and search for.
|
|
50
|
+
* The first that exists will be served. Example: ['html', 'htm'].
|
|
51
|
+
* The default value is false.
|
|
52
|
+
*/
|
|
53
|
+
extensions?: string[] | false | undefined;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Let client errors fall-through as unhandled requests, otherwise forward a client error.
|
|
57
|
+
* The default value is true.
|
|
58
|
+
*/
|
|
59
|
+
fallthrough?: boolean | undefined;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Enable or disable the immutable directive in the Cache-Control response header.
|
|
63
|
+
* If enabled, the maxAge option should also be specified to enable caching. The immutable directive will prevent supported clients from making conditional requests during the life of the maxAge option to check if the file has changed.
|
|
64
|
+
*/
|
|
65
|
+
immutable?: boolean | undefined;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* By default this module will send "index.html" files in response to a request on a directory.
|
|
69
|
+
* To disable this set false or to supply a new index pass a string or an array in preferred order.
|
|
70
|
+
*/
|
|
71
|
+
index?: boolean | string | string[] | undefined;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Enable or disable Last-Modified header, defaults to true. Uses the file system's last modified value.
|
|
75
|
+
*/
|
|
76
|
+
lastModified?: boolean | undefined;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Provide a max-age in milliseconds for http caching, defaults to 0. This can also be a string accepted by the ms module.
|
|
80
|
+
*/
|
|
81
|
+
maxAge?: number | string | undefined;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Redirect to trailing "/" when the pathname is a dir. Defaults to true.
|
|
85
|
+
*/
|
|
86
|
+
redirect?: boolean | undefined;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Function to set custom headers on response. Alterations to the headers need to occur synchronously.
|
|
90
|
+
* The function is called as fn(res, path, stat), where the arguments are:
|
|
91
|
+
* res the response object
|
|
92
|
+
* path the file path that is being sent
|
|
93
|
+
* stat the stat object of the file that is being sent
|
|
94
|
+
*/
|
|
95
|
+
setHeaders?: ((res: R, path: string, stat: any) => any) | undefined;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface RequestHandler<R extends http.ServerResponse> {
|
|
99
|
+
(request: http.IncomingMessage, response: R, next: () => void): any;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
interface RequestHandlerConstructor<R extends http.ServerResponse> {
|
|
103
|
+
(root: string, options?: ServeStaticOptions<R>): RequestHandler<R>;
|
|
104
|
+
mime: typeof m;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export = serveStatic;
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
// Type definitions for LESS 3.x
|
|
2
|
+
// Project: http://lesscss.org/
|
|
3
|
+
// Definitions by: Tom Hasner <https://github.com/thasner>
|
|
4
|
+
// Pranay Prakash <https://github.com/pranaygp>
|
|
5
|
+
// Daniel Waxweiler <https://github.com/dwaxweiler>
|
|
6
|
+
// Richard Lea <https://github.com/chigix>
|
|
7
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
8
|
+
|
|
9
|
+
declare namespace Less {
|
|
10
|
+
// https://github.com/less/less.js/blob/master/lib/less/import-manager.js#L10
|
|
11
|
+
interface RootFileInfo {
|
|
12
|
+
/** whether to adjust URL's to be relative */
|
|
13
|
+
rewriteUrls?: boolean | undefined;
|
|
14
|
+
/** full resolved filename of current file */
|
|
15
|
+
filename: string;
|
|
16
|
+
relativeUrls: boolean;
|
|
17
|
+
/** path to append to normal URLs for this node */
|
|
18
|
+
rootpath: string;
|
|
19
|
+
/** path to the current file, absolute */
|
|
20
|
+
currentDirectory: string;
|
|
21
|
+
/** absolute path to the entry file */
|
|
22
|
+
entryPath: string;
|
|
23
|
+
/** filename of the base file */
|
|
24
|
+
rootFilename: string;
|
|
25
|
+
/** whether the file should not be output and only output parts that are referenced */
|
|
26
|
+
reference: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
class PluginManager {
|
|
30
|
+
constructor(less: LessStatic);
|
|
31
|
+
|
|
32
|
+
addPreProcessor(preProcessor: PreProcessor, priority?: number): void;
|
|
33
|
+
|
|
34
|
+
addFileManager(fileManager: FileManager): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface Plugin {
|
|
38
|
+
install: (less: LessStatic, pluginManager: PluginManager) => void;
|
|
39
|
+
minVersion?: [number, number, number] | undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface PreProcessor {
|
|
43
|
+
process: (src: string, extra: PreProcessorExtraInfo) => string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface PreProcessorExtraInfo {
|
|
47
|
+
context: {
|
|
48
|
+
pluginManager: PluginManager;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
fileInfo: RootFileInfo;
|
|
52
|
+
|
|
53
|
+
imports: {
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface FileLoadResult {
|
|
59
|
+
/** Full resolved path to file. */
|
|
60
|
+
filename: string;
|
|
61
|
+
|
|
62
|
+
/** The contents of the file, as a string. */
|
|
63
|
+
contents: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface FileLoadError {
|
|
67
|
+
/** Error object if an error occurs. */
|
|
68
|
+
error: unknown;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
class FileManager extends AbstractFileManager {
|
|
72
|
+
/**
|
|
73
|
+
* Returns whether this file manager supports this file for file retrieval
|
|
74
|
+
* If true is returned, loadFile will then be called with the file.
|
|
75
|
+
*/
|
|
76
|
+
supports(filename: string, currentDirectory: string, options: LoadFileOptions, environment: Environment): boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Loads a file asynchronously. Expects a promise that either rejects with an error or fulfills with a FileLoadResult.
|
|
80
|
+
*/
|
|
81
|
+
loadFile(filename: string, currentDirectory: string, options: LoadFileOptions, environment: Environment): Promise<FileLoadResult>;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Loads a file synchronously. Expects an immediate return with wither a FileLoadResult or FileLoadError.
|
|
85
|
+
*/
|
|
86
|
+
loadFileSync(filename: string, currentDirectory: string, options: LoadFileOptions, environment: Environment): FileLoadResult | FileLoadError;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
class AbstractFileManager {
|
|
90
|
+
/**
|
|
91
|
+
* Given the full path to a file, return the path component.
|
|
92
|
+
*/
|
|
93
|
+
getPath(filename: string): string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Append a .less extension if appropriate. Only called if less thinks one could be added.
|
|
97
|
+
*/
|
|
98
|
+
tryAppendLessExtension(filename: string): string;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Whether the rootpath should be converted to be absolute.
|
|
102
|
+
* The browser ovverides this to return true because urls must be absolute.
|
|
103
|
+
*/
|
|
104
|
+
alwaysMakePathsAbsolute(): boolean;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Returns whether a path is absolute.
|
|
108
|
+
*/
|
|
109
|
+
isPathAbsolute(path: string): boolean;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Joins together 2 paths.
|
|
113
|
+
*/
|
|
114
|
+
join(basePath: string, laterPath: string): string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Returns the difference between 2 paths
|
|
118
|
+
* E.g. url = a/ baseUrl = a/b/ returns ../
|
|
119
|
+
* url = a/b/ baseUrl = a/ returns b/
|
|
120
|
+
*/
|
|
121
|
+
pathDiff(url: string, baseUrl: string): string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Returns whether this file manager supports this file for syncronous file retrieval
|
|
125
|
+
* If true is returned, loadFileSync will then be called with the file.
|
|
126
|
+
*/
|
|
127
|
+
supportsSync(filename: string, currentDirectory: string, options: LoadFileOptions, environment: Environment): boolean;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
interface LoadFileOptions {
|
|
131
|
+
paths?: string[] | undefined;
|
|
132
|
+
prefixes?: string[] | undefined;
|
|
133
|
+
ext?: string | undefined;
|
|
134
|
+
rawBuffer?: any;
|
|
135
|
+
syncImport?: boolean | undefined;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
interface Environment {
|
|
139
|
+
/**
|
|
140
|
+
* Converts a string to a base 64 string
|
|
141
|
+
*/
|
|
142
|
+
encodeBase64(str: string): string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Lookup the mime-type of a filename
|
|
146
|
+
*/
|
|
147
|
+
mimeLookup(filename: string): string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Look up the charset of a mime type
|
|
151
|
+
*/
|
|
152
|
+
charsetLookup(mime: string): string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Gets a source map generator
|
|
156
|
+
*/
|
|
157
|
+
getSourceMapGenerator(): any;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
interface SourceMapOption {
|
|
161
|
+
sourceMapURL?: string | undefined;
|
|
162
|
+
sourceMapBasepath?: string | undefined;
|
|
163
|
+
sourceMapRootpath?: string | undefined;
|
|
164
|
+
outputSourceFiles?: boolean | undefined;
|
|
165
|
+
sourceMapFileInline?: boolean | undefined;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
interface StaticOptions {
|
|
169
|
+
async: boolean;
|
|
170
|
+
fileAsync: boolean;
|
|
171
|
+
modifyVars: { [variable: string]: string };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
interface ImportManager {
|
|
175
|
+
contents: { [fileName: string]: string };
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Reference to:
|
|
180
|
+
* * https://github.com/less/less.js/blob/master/bin/lessc
|
|
181
|
+
* * http://lesscss.org/usage/#less-options
|
|
182
|
+
*
|
|
183
|
+
* @interface Options
|
|
184
|
+
*/
|
|
185
|
+
interface Options {
|
|
186
|
+
sourceMap?: SourceMapOption | undefined;
|
|
187
|
+
/** Filename of the main file to be passed to less.render() */
|
|
188
|
+
filename?: string | undefined;
|
|
189
|
+
/** The locations for less looking for files in @import rules */
|
|
190
|
+
paths?: string[] | undefined;
|
|
191
|
+
/** True, if run the less parser and just reports errors without any output. */
|
|
192
|
+
lint?: boolean | undefined;
|
|
193
|
+
/** Pre-load global Less.js plugins */
|
|
194
|
+
plugins?: Plugin[] | undefined;
|
|
195
|
+
/** @deprecated If true, compress using less built-in compression. */
|
|
196
|
+
compress?: boolean | undefined;
|
|
197
|
+
strictImports?: boolean | undefined;
|
|
198
|
+
/** If true, allow imports from insecure https hosts. */
|
|
199
|
+
insecure?: boolean | undefined;
|
|
200
|
+
depends?: boolean | undefined;
|
|
201
|
+
maxLineLen?: number | undefined;
|
|
202
|
+
/** @deprecated If false, No color in compiling. */
|
|
203
|
+
color?: boolean | undefined;
|
|
204
|
+
/** @deprecated False by default. */
|
|
205
|
+
ieCompat?: boolean | undefined;
|
|
206
|
+
/** @deprecated If true, enable evaluation of JavaScript inline in `.less` files. */
|
|
207
|
+
javascriptEnabled?: boolean | undefined;
|
|
208
|
+
/** Whether output file information and line numbers in compiled CSS code. */
|
|
209
|
+
dumpLineNumbers?: "comment" | string | undefined;
|
|
210
|
+
/** Add a path to every generated import and url in output css files. */
|
|
211
|
+
rootpath?: string | undefined;
|
|
212
|
+
/** Math mode options for avoiding symbol conficts on math expressions. */
|
|
213
|
+
math?: 'always' | 'strict' | 'parens-division' | 'parens' | 'strict-legacy' | number | undefined;
|
|
214
|
+
/** If true, stops any warnings from being shown. */
|
|
215
|
+
silent?: boolean | undefined;
|
|
216
|
+
/** Without this option, Less attempts to guess at the output unit when it does maths. */
|
|
217
|
+
strictUnits?: boolean | undefined;
|
|
218
|
+
/** Defines a variable that can be referenced by the file. */
|
|
219
|
+
globalVars?: {
|
|
220
|
+
[key: string] : string,
|
|
221
|
+
} | undefined;
|
|
222
|
+
/** Puts Var declaration at the end of base file. */
|
|
223
|
+
modifyVars?: {
|
|
224
|
+
[key: string] : string,
|
|
225
|
+
} | undefined;
|
|
226
|
+
/** Read files synchronously in Node.js */
|
|
227
|
+
syncImport?: boolean | undefined;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
interface RenderError {
|
|
231
|
+
column: number;
|
|
232
|
+
extract: string[];
|
|
233
|
+
filename: string;
|
|
234
|
+
index: number;
|
|
235
|
+
line: number;
|
|
236
|
+
message: string;
|
|
237
|
+
type: string;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
interface RenderOutput {
|
|
241
|
+
css: string;
|
|
242
|
+
map: string;
|
|
243
|
+
imports: string[];
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
interface RefreshOutput {
|
|
247
|
+
endTime: Date;
|
|
248
|
+
startTime: Date;
|
|
249
|
+
sheets: number;
|
|
250
|
+
totalMilliseconds: number;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
interface LessStatic {
|
|
255
|
+
options: Less.StaticOptions;
|
|
256
|
+
|
|
257
|
+
importManager?: Less.ImportManager | undefined;
|
|
258
|
+
sheets: HTMLLinkElement[];
|
|
259
|
+
|
|
260
|
+
modifyVars(vars: { [name: string]: string }): Promise<Less.RefreshOutput>;
|
|
261
|
+
|
|
262
|
+
refreshStyles(): void;
|
|
263
|
+
|
|
264
|
+
render(input: string, callback: (error: Less.RenderError, output: Less.RenderOutput | undefined) => void): void;
|
|
265
|
+
render(input: string, options: Less.Options, callback: (error: Less.RenderError, output: Less.RenderOutput | undefined) => void): void;
|
|
266
|
+
|
|
267
|
+
render(input: string): Promise<Less.RenderOutput>;
|
|
268
|
+
render(input: string, options: Less.Options): Promise<Less.RenderOutput>;
|
|
269
|
+
|
|
270
|
+
refresh(reload?: boolean, modifyVars?: { [variable: string]: string }, clearFileCache?: boolean): Promise<Less.RefreshOutput>;
|
|
271
|
+
|
|
272
|
+
version: number[];
|
|
273
|
+
|
|
274
|
+
watch(): void;
|
|
275
|
+
|
|
276
|
+
FileManager: typeof Less.FileManager;
|
|
277
|
+
PluginManager: typeof Less.PluginManager;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
declare module "@umijs/bundler-utils/compiled/less" {
|
|
281
|
+
export = less;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
declare var less: LessStatic;
|