Skip to content

Commit e7ebe0d

Browse files
Dor256Dor Ben Baruch
andauthored
fix custom modifier types to be strictly boolean (#751)
* fix custom modifier types to be strictly boolean * remove reduntant type from PropsTypes Co-authored-by: Dor Ben Baruch <dorb@ta-c02c75pumd6r.lan.wixpress.com>
1 parent 856fdb8 commit e7ebe0d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/commons/modifiers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ export type AlignmentLiterals =
7474
| 'left' | 'right' | 'top' | 'bottom';
7575

7676
export type Modifier<T extends string> = Partial<Record<T, boolean>>
77-
export type CustomModifier = {[key: string]: any};
77+
export type CustomModifier = {[key: string]: boolean};
7878

79-
export type TypographyModifiers = Modifier<TypographyLiterals> & CustomModifier;
80-
export type ColorsModifiers = Modifier<ColorLiterals> & CustomModifier;
79+
export type TypographyModifiers = Modifier<TypographyLiterals> | CustomModifier;
80+
export type ColorsModifiers = Modifier<ColorLiterals> | CustomModifier;
8181
export type BackgroundColorModifier = Modifier<'bg'>;
8282
export type AlignmentModifiers = Modifier<AlignmentLiterals>;
8383
export type PaddingModifiers = Modifier<PaddingLiterals>;

src/components/text/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {Colors} from '../../style';
1313
import _ from 'lodash';
1414

1515

16-
interface TextPropTypes extends TextProps, TypographyModifiers, ColorsModifiers, MarginModifiers {
16+
type TextPropTypes = TextProps & TypographyModifiers & ColorsModifiers & MarginModifiers & {
1717
/**
1818
* color of the text
1919
*/

0 commit comments

Comments
 (0)