File tree 7 files changed +458
-281
lines changed
7 files changed +458
-281
lines changed Original file line number Diff line number Diff line change 42
42
},
43
43
"files" : [
44
44
" dist" ,
45
- " types"
45
+ " types" ,
46
+ " public.d.ts"
46
47
],
47
48
"peerDependencies" : {
48
49
"webpack" : " ^5.0.0"
53
54
"devDependencies" : {
54
55
"@babel/cli" : " ^7.16.7" ,
55
56
"@babel/core" : " ^7.16.7" ,
56
- "@babel/eslint-parser" : " ^7.16.0 " ,
57
+ "@babel/eslint-parser" : " ^7.16.5 " ,
57
58
"@babel/preset-env" : " ^7.16.7" ,
58
- "@commitlint/cli" : " ^15 .0.0 " ,
59
- "@commitlint/config-conventional" : " ^15 .0.0" ,
59
+ "@commitlint/cli" : " ^16 .0.2 " ,
60
+ "@commitlint/config-conventional" : " ^16 .0.0" ,
60
61
"@webpack-contrib/eslint-config-webpack" : " ^3.0.0" ,
61
62
"babel-jest" : " ^27.0.6" ,
62
63
"bootstrap" : " ^4.6.0" ,
63
64
"cross-env" : " ^7.0.3" ,
64
65
"css-loader" : " ^6.2.0" ,
65
66
"del" : " ^6.0.0" ,
66
67
"del-cli" : " ^4.0.0" ,
67
- "es-check" : " ^6.0.0 " ,
68
- "eslint" : " ^8.6 .0" ,
69
- "eslint-config-prettier" : " ^8.1 .0" ,
68
+ "es-check" : " ^6.1.1 " ,
69
+ "eslint" : " ^8.7 .0" ,
70
+ "eslint-config-prettier" : " ^8.3 .0" ,
70
71
"eslint-plugin-import" : " ^2.25.4" ,
71
72
"file-loader" : " ^6.2.0" ,
72
73
"husky" : " ^7.0.0" ,
73
74
"jest" : " ^27.0.6" ,
74
75
"jsdom" : " ^19.0.0" ,
75
- "lint-staged" : " ^12.1.5 " ,
76
+ "lint-staged" : " ^12.1.7 " ,
76
77
"memfs" : " ^3.4.1" ,
77
78
"npm-run-all" : " ^4.1.5" ,
78
- "prettier" : " ^2.3.2 " ,
79
+ "prettier" : " ^2.5.1 " ,
79
80
"sass" : " ^1.45.2" ,
80
81
"sass-loader" : " ^12.1.0" ,
81
82
"standard-version" : " ^9.3.0" ,
Original file line number Diff line number Diff line change
1
+ type Module = import ( "webpack" ) . Module ;
2
+ type Dependency = import ( "webpack" ) . Dependency ;
3
+ type Source = import ( "webpack" ) . sources . Source ;
4
+ type AssetInfo = import ( "webpack" ) . AssetInfo ;
5
+
6
+ export interface CssModule {
7
+ new ( {
8
+ context,
9
+ identifier,
10
+ identifierIndex,
11
+ content,
12
+ layer,
13
+ supports,
14
+ media,
15
+ sourceMap,
16
+ assets,
17
+ assetsInfo,
18
+ } : {
19
+ context : string ;
20
+ identifier : string ;
21
+ identifierIndex : number ;
22
+ content : Buffer ;
23
+ layer : string | null ;
24
+ supports ?: string ;
25
+ media : string ;
26
+ sourceMap ?: Buffer ;
27
+ assets : { [ key : string ] : Source } ;
28
+ assetsInfo : Map < string , AssetInfo > ;
29
+ } ) : Module ;
30
+ }
31
+
32
+ interface CssDependencyPublicOptions {
33
+ identifier : string ;
34
+ content : Buffer ;
35
+ layer ?: string ;
36
+ supports ?: string ;
37
+ media : string ;
38
+ sourceMap ?: Buffer ;
39
+ }
40
+
41
+ export interface CssDependency {
42
+ new (
43
+ {
44
+ identifier,
45
+ content,
46
+ layer,
47
+ supports,
48
+ media,
49
+ sourceMap,
50
+ } : CssDependencyPublicOptions ,
51
+ context : string | null ,
52
+ identifierIndex : number
53
+ ) : Dependency & {
54
+ assetsInfo ?: Map < string , AssetInfo > ;
55
+ assets ?: { [ key : string ] : Source } ;
56
+ } ;
57
+ }
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ class MiniCssExtractPlugin {
88
88
/**
89
89
* @public
90
90
* @param {Compiler["webpack"] } webpack
91
- * @returns {typeof CssModule }
91
+ * @returns {import("../public"). CssModule }
92
92
*/
93
93
static getCssModule ( webpack ) {
94
94
/**
@@ -348,7 +348,7 @@ class MiniCssExtractPlugin {
348
348
/**
349
349
* @public
350
350
* @param {Compiler["webpack"] } webpack
351
- * @returns {typeof CssDependency }
351
+ * @returns {import("../public"). CssDependency }
352
352
*/
353
353
static getCssDependency ( webpack ) {
354
354
/**
Original file line number Diff line number Diff line change @@ -126,12 +126,11 @@ function pitch(request) {
126
126
identifierCountMap . get (
127
127
/** @type {Dependency } */ ( dependency ) . identifier
128
128
) || 0 ;
129
- // @ts -ignore
129
+
130
130
const CssDependency = MiniCssExtractPlugin . getCssDependency ( webpack ) ;
131
131
132
132
/** @type {NormalModule } */
133
133
( this . _module ) . addDependency (
134
- // @ts -ignore
135
134
( lastDep = new CssDependency (
136
135
/** @type {Dependency } */
137
136
( dependency ) ,
Original file line number Diff line number Diff line change 9
9
"resolveJsonModule" : true ,
10
10
"allowSyntheticDefaultImports" : true
11
11
},
12
- "include" : [" ./src/**/*" ]
12
+ "include" : [" ./src/**/*" , " public.d.ts " ]
13
13
}
Original file line number Diff line number Diff line change @@ -3,15 +3,19 @@ declare class MiniCssExtractPlugin {
3
3
/**
4
4
* @public
5
5
* @param {Compiler["webpack"] } webpack
6
- * @returns {typeof CssModule }
6
+ * @returns {import("../public"). CssModule }
7
7
*/
8
- private static getCssModule ;
8
+ public static getCssModule (
9
+ webpack : Compiler [ "webpack" ]
10
+ ) : import ( "../public" ) . CssModule ;
9
11
/**
10
12
* @public
11
13
* @param {Compiler["webpack"] } webpack
12
- * @returns {typeof CssDependency }
14
+ * @returns {import("../public"). CssDependency }
13
15
*/
14
- private static getCssDependency ;
16
+ public static getCssDependency (
17
+ webpack : Compiler [ "webpack" ]
18
+ ) : import ( "../public" ) . CssDependency ;
15
19
/**
16
20
* @param {PluginOptions } [options]
17
21
*/
You can’t perform that action at this time.
0 commit comments