This repository was archived by the owner on Jan 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { buildContext } from './interop/context' ;
2
+ import { buildImporter } from './interop/importer' ;
3
+ import { wrapSassImporter } from './interop/importer/wrapSassImporter' ;
2
4
import { buildInteropUtility } from './interop/interopUtility' ;
3
5
import { getVersion } from './interop/miscellaneous' ;
4
6
import { wrapSassOptions } from './interop/options/wrapSassOptions' ;
@@ -14,9 +16,13 @@ interface SassFactory {
14
16
*/
15
17
getVersion : ReturnType < typeof getVersion > ;
16
18
/**
17
- * creation method to context api
19
+ * Creation method to context api
18
20
*/
19
21
context : ReturnType < typeof buildContext > ;
22
+ /**
23
+ * Create method to importer api
24
+ */
25
+ importer : ReturnType < typeof buildImporter > ;
20
26
/**
21
27
* utility functions to interop raw libsass interface
22
28
*/
@@ -27,6 +33,7 @@ interface SassFactory {
27
33
raw : {
28
34
context : ReturnType < typeof wrapSassContext > ;
29
35
options : ReturnType < typeof wrapSassOptions > ;
36
+ importer : ReturnType < typeof wrapSassImporter > ;
30
37
} ;
31
38
}
32
39
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ import { StringMethodInterface } from '../interopUtility';
4
4
import { wrapSassContext } from '../wrapSassContext' ;
5
5
import { wrapSassOptions } from './wrapSassOptions' ;
6
6
7
+ /**
8
+ * Interop interface to `sass_option*` api
9
+ * (https://github.com/sass/libsass/blob/master/docs/api-context.md#sass-options-api)
10
+ */
7
11
interface SassOptionsInterface {
8
12
/**
9
13
* Property accessor to `sass_option_(get|set)_precision`
@@ -84,9 +88,6 @@ enum OutputStyle {
84
88
/**
85
89
* @internal
86
90
*
87
- * Interop interface to `sass_option*` api
88
- * (https://github.com/sass/libsass/blob/master/docs/api-context.md#sass-options-api)
89
- *
90
91
*/
91
92
class SassOptions implements SassOptionsInterface {
92
93
/**
Original file line number Diff line number Diff line change 1
1
import { buildContext } from './interop/context' ;
2
+ import { buildImporter } from './interop/importer' ;
3
+ import { wrapSassImporter } from './interop/importer/wrapSassImporter' ;
2
4
import { buildInteropUtility } from './interop/interopUtility' ;
3
5
import { getVersion } from './interop/miscellaneous' ;
4
6
import { wrapSassOptions } from './interop/options/wrapSassOptions' ;
@@ -16,15 +18,19 @@ export const sassLoader = (asmModule: SassAsmModule): SassFactory => {
16
18
const { cwrap } = asmModule ;
17
19
const cwrapCtx = wrapSassContext ( cwrap ) ;
18
20
const cwrapOptions = wrapSassOptions ( cwrap ) ;
21
+ const cwrapImporter = wrapSassImporter ( cwrap ) ;
22
+
19
23
const interop = buildInteropUtility ( asmModule ) ;
20
24
21
25
return {
22
26
getVersion : getVersion ( asmModule ) ,
23
27
context : buildContext ( cwrapCtx , cwrapOptions , interop ) ,
28
+ importer : buildImporter ( cwrapImporter , interop ) ,
24
29
interop,
25
30
raw : {
26
31
context : cwrapCtx ,
27
- options : cwrapOptions
32
+ options : cwrapOptions ,
33
+ importer : cwrapImporter
28
34
}
29
35
} ;
30
36
} ;
You can’t perform that action at this time.
0 commit comments