-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathsass-service-legacy.d.ts
51 lines (51 loc) · 1.88 KB
/
sass-service-legacy.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
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { LegacyResult as CompileResult, LegacyException as Exception, LegacyOptions as Options } from 'sass';
/**
* The callback type for the `dart-sass` asynchronous render function.
*/
type RenderCallback = (error?: Exception, result?: CompileResult) => void;
/**
* A Sass renderer implementation that provides an interface that can be used by Webpack's
* `sass-loader`. The implementation uses a Worker thread to perform the Sass rendering
* with the `dart-sass` package. The `dart-sass` synchronous render function is used within
* the worker which can be up to two times faster than the asynchronous variant.
*/
export declare class SassLegacyWorkerImplementation {
private readonly workers;
private readonly availableWorkers;
private readonly requests;
private readonly workerPath;
private idCounter;
private nextWorkerIndex;
/**
* Provides information about the Sass implementation.
* This mimics enough of the `dart-sass` value to be used with the `sass-loader`.
*/
get info(): string;
/**
* The synchronous render function is not used by the `sass-loader`.
*/
renderSync(): never;
/**
* Asynchronously request a Sass stylesheet to be renderered.
*
* @param options The `dart-sass` options to use when rendering the stylesheet.
* @param callback The function to execute when the rendering is complete.
*/
render(options: Options<'async'>, callback: RenderCallback): void;
/**
* Shutdown the Sass render worker.
* Executing this method will stop any pending render requests.
*/
close(): void;
private createWorker;
private processImporters;
private createRequest;
}
export {};