Skip to content

Commit 4246f1a

Browse files
committed
chore: fix tsc
1 parent b922860 commit 4246f1a

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

docs/examples/components/Button.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ import React from 'react';
1010
import type { DerivativeToken } from './theme';
1111
import { useToken } from './theme';
1212

13+
interface ButtonToken extends DerivativeToken {
14+
buttonPadding: string;
15+
}
16+
1317
// 通用框架
1418
const genSharedButtonStyle = (
1519
prefixCls: string,
16-
token: DerivativeToken,
20+
token: ButtonToken,
1721
): CSSInterpolation => ({
1822
[`.${prefixCls}`]: {
1923
borderColor: token.borderColor,
@@ -39,7 +43,7 @@ const genSharedButtonStyle = (
3943
// 实心底色样式
4044
const genSolidButtonStyle = (
4145
prefixCls: string,
42-
token: DerivativeToken,
46+
token: ButtonToken,
4347
postFn: () => CSSObject,
4448
): CSSInterpolation => [
4549
genSharedButtonStyle(prefixCls, token),
@@ -53,7 +57,7 @@ const genSolidButtonStyle = (
5357
// 默认样式
5458
const genDefaultButtonStyle = (
5559
prefixCls: string,
56-
token: DerivativeToken,
60+
token: ButtonToken,
5761
): CSSInterpolation =>
5862
genSolidButtonStyle(prefixCls, token, () => ({
5963
backgroundColor: token.componentBackgroundColor,
@@ -68,7 +72,7 @@ const genDefaultButtonStyle = (
6872
// 主色样式
6973
const genPrimaryButtonStyle = (
7074
prefixCls: string,
71-
token: DerivativeToken,
75+
token: ButtonToken,
7276
): CSSInterpolation =>
7377
genSolidButtonStyle(prefixCls, token, () => ({
7478
backgroundColor: token.primaryColor,
@@ -83,7 +87,7 @@ const genPrimaryButtonStyle = (
8387
// 透明按钮
8488
const genGhostButtonStyle = (
8589
prefixCls: string,
86-
token: DerivativeToken,
90+
token: ButtonToken,
8791
): CSSInterpolation => [
8892
genSharedButtonStyle(prefixCls, token),
8993
{

docs/examples/components/theme.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export interface DesignToken {
2222

2323
export interface DerivativeToken extends DesignToken {
2424
primaryColorDisabled: string;
25-
buttonPadding: string;
2625
}
2726

2827
const defaultDesignToken: DesignToken = {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"pretty-quick": "pretty-quick",
3939
"test": "vitest --watch=false",
4040
"test:watch": "vitest",
41+
"tsc": "tsc --noEmit",
4142
"coverage": "vitest run --coverage"
4243
},
4344
"dependencies": {

0 commit comments

Comments
 (0)