[6a3a178] | 1 | /**
|
---|
| 2 | * @license
|
---|
| 3 | * Copyright Google LLC All Rights Reserved.
|
---|
| 4 | *
|
---|
| 5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
| 6 | * found in the LICENSE file at https://angular.io/license
|
---|
| 7 | */
|
---|
| 8 | import { Options, Result, SassException } from 'sass';
|
---|
| 9 | /**
|
---|
| 10 | * The callback type for the `dart-sass` asynchronous render function.
|
---|
| 11 | */
|
---|
| 12 | declare type RenderCallback = (error?: SassException, result?: Result) => void;
|
---|
| 13 | /**
|
---|
| 14 | * A Sass renderer implementation that provides an interface that can be used by Webpack's
|
---|
| 15 | * `sass-loader`. The implementation uses a Worker thread to perform the Sass rendering
|
---|
| 16 | * with the `dart-sass` package. The `dart-sass` synchronous render function is used within
|
---|
| 17 | * the worker which can be up to two times faster than the asynchronous variant.
|
---|
| 18 | */
|
---|
| 19 | export declare class SassWorkerImplementation {
|
---|
| 20 | private readonly workers;
|
---|
| 21 | private readonly availableWorkers;
|
---|
| 22 | private readonly requests;
|
---|
| 23 | private idCounter;
|
---|
| 24 | private nextWorkerIndex;
|
---|
| 25 | /**
|
---|
| 26 | * Provides information about the Sass implementation.
|
---|
| 27 | * This mimics enough of the `dart-sass` value to be used with the `sass-loader`.
|
---|
| 28 | */
|
---|
| 29 | get info(): string;
|
---|
| 30 | /**
|
---|
| 31 | * The synchronous render function is not used by the `sass-loader`.
|
---|
| 32 | */
|
---|
| 33 | renderSync(): never;
|
---|
| 34 | /**
|
---|
| 35 | * Asynchronously request a Sass stylesheet to be renderered.
|
---|
| 36 | *
|
---|
| 37 | * @param options The `dart-sass` options to use when rendering the stylesheet.
|
---|
| 38 | * @param callback The function to execute when the rendering is complete.
|
---|
| 39 | */
|
---|
| 40 | render(options: Options, callback: RenderCallback): void;
|
---|
| 41 | /**
|
---|
| 42 | * Shutdown the Sass render worker.
|
---|
| 43 | * Executing this method will stop any pending render requests.
|
---|
| 44 | */
|
---|
| 45 | close(): void;
|
---|
| 46 | private createWorker;
|
---|
| 47 | private processImporters;
|
---|
| 48 | private createRequest;
|
---|
| 49 | }
|
---|
| 50 | export {};
|
---|