Skip to content

Commit 8be6541

Browse files
author
Andrii Kirmas
committed
Add TS declarations for css
1 parent 23f2f37 commit 8be6541

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

src/some.module.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.class1{}
2+
.class2{}

src/some.module.css.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export = {
2+
class1: string,
3+
class2: string
4+
}

src/versus-classnames.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/// <reference path="../global.d.ts" />
22

3-
import css from "./some.css"
43
import type {ClassNames} from "."
54
import {
65
classNamesCheck,
@@ -11,7 +10,9 @@ import {
1110
import classnames_default from "classnames"
1211
import classnames_bind from "classnames/bind"
1312

14-
const module_css = {
13+
import css from "./some.css"
14+
import module from "./some.module.css"
15+
const module_css: typeof module = {
1516
"class1": "hash1",
1617
"class2": "hash2"
1718
}

tsconfig.compile.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
"noEmit": false
55
},
66
"exclude": [
7-
"src/**/*.test.ts",
8-
"src/**/*.spec.ts",
9-
"src/**/*.test.tsx",
10-
"src/**/*.spec.tsx"
7+
"**/*.test.ts",
8+
"**/*.spec.ts",
9+
"**/*.test.tsx",
10+
"**/*.spec.tsx",
11+
"**/*.css*"
1112
]
1213
}

0 commit comments

Comments
 (0)