ng-packagr
Version:
Compile and package Angular libraries in Angular Package Format (APF)
44 lines (43 loc) • 1.68 kB
TypeScript
import type { CompileResult, StringOptions } from 'sass-embedded';
/**
* When `NG_BUILD_SASS_EMBEDDED` is set to `0` or `false`, or when running within a
* WebContainer environment, the native embedded Sass compiler is disabled
* and the pure-JavaScript Sass compiler is used instead.
*/
export declare const useSassEmbedded: boolean;
/**
* A Sass renderer implementation that uses the persistent Dart Sass embedded compiler
* daemon (`sass-embedded`) communicating over standard input/output with protocol buffers,
* or falls back to the pure-JS Dart Sass async compiler (`sass.initAsyncCompiler()`).
*/
export declare class SassCompiler {
#private;
private readonly rebase;
constructor(rebase?: boolean);
/**
* Provides information about the Sass implementation.
* This mimics enough of the `sass-embedded` or `sass` value to be used with the `sass-loader`.
*/
get info(): string;
/**
* The synchronous render function is not used by the `sass-loader`.
*/
compileString(): never;
/**
* Asynchronously request a Sass stylesheet to be rendered using the native embedded compiler
* or the pure-JS async compiler fallback.
*
* @param source The contents to compile.
* @param options The `sass` / `sass-embedded` options to use when rendering the stylesheet.
*/
compileStringAsync(source: string, options: StringOptions<'async'>): Promise<CompileResult>;
/**
* Clear the directory cache.
*/
clearCache(): void;
/**
* Shutdown the Sass compiler.
* @returns A void promise that resolves when closing is complete.
*/
close(): Promise<void>;
}