UNPKG

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