UNPKG

2.11 kBTypeScriptView Raw
1/**
2 * The value of `this` in the context of a {@link LegacyImporter} or {@link
3 * LegacyFunction} callback.
4 *
5 * @category Legacy
6 * @deprecated This is only used by the legacy {@link render} and {@link
7 * renderSync} APIs. Use {@link compile}, {@link compileString}, {@link
8 * compileAsync}, and {@link compileStringAsync} instead.
9 */
10export interface LegacyPluginThis {
11 /**
12 * A partial representation of the options passed to {@link render} or {@link
13 * renderSync}.
14 */
15 options: {
16 /** The same {@link LegacyPluginThis} instance that contains this object. */
17 context: LegacyPluginThis;
18
19 /**
20 * The value passed to {@link LegacyFileOptions.file} or {@link
21 * LegacyStringOptions.file}.
22 */
23 file?: string;
24
25 /** The value passed to {@link LegacyStringOptions.data}. */
26 data?: string;
27
28 /**
29 * The value passed to {@link LegacySharedOptions.includePaths} separated by
30 * `";"` on Windows or `":"` on other operating systems. This always
31 * includes the current working directory as the first entry.
32 */
33 includePaths: string;
34
35 /** Always the number 10. */
36 precision: 10;
37
38 /** Always the number 1. */
39 style: 1;
40
41 /** 1 if {@link LegacySharedOptions.indentType} was `"tab"`, 0 otherwise. */
42 indentType: 1 | 0;
43
44 /**
45 * The value passed to {@link LegacySharedOptions.indentWidth}, or `2`
46 * otherwise.
47 */
48 indentWidth: number;
49
50 /**
51 * The value passed to {@link LegacySharedOptions.linefeed}, or `"\n"`
52 * otherwise.
53 */
54 linefeed: '\r' | '\r\n' | '\n' | '\n\r';
55
56 /** A partially-constructed {@link LegacyResult} object. */
57 result: {
58 /** Partial information about the compilation in progress. */
59 stats: {
60 /**
61 * The number of milliseconds between 1 January 1970 at 00:00:00 UTC and
62 * the time at which Sass compilation began.
63 */
64 start: number;
65
66 /**
67 * {@link LegacyFileOptions.file} if it was passed, otherwise the string
68 * `"data"`.
69 */
70 entry: string;
71 };
72 };
73 };
74}