Skip to content

Commit 50f195a

Browse files
committed
fix: updated typescript
1 parent 017bc96 commit 50f195a

File tree

59 files changed

+189
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+189
-158
lines changed

example/storybook/stories/components/Wrapper.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
SunIcon,
1212
extendTheme,
1313
Button,
14+
Input,
1415
} from 'native-base';
1516
import type { StorageManager } from 'native-base';
1617
import AsyncStorage from '@react-native-async-storage/async-storage';
@@ -38,6 +39,12 @@ const myTheme = extendTheme({
3839
padding: myPaddingX,
3940
};
4041
},
42+
43+
myNewButton1: (props: any) => {
44+
return {
45+
padding: props.padding,
46+
};
47+
},
4148
},
4249
sizes: {
4350
newsize: ({ mySize }: { mySize: number }) => {
@@ -48,6 +55,22 @@ const myTheme = extendTheme({
4855
},
4956
},
5057

58+
Input: {
59+
variants: {
60+
newsize: ({ mySize }: { mySize: number }) => {
61+
return {
62+
padding: mySize,
63+
};
64+
},
65+
66+
newsize1: (props: any) => {
67+
return {
68+
padding: props.padding,
69+
};
70+
},
71+
},
72+
},
73+
5174
Checkbox: {
5275
sizes: {
5376
myBtn: {
@@ -115,6 +138,7 @@ export function RenderTestButton() {
115138
const [state, setState] = React.useState(1);
116139
return (
117140
<Box style={{ position: 'absolute', top: 10, left: 20 }} m={2} bg="red.100">
141+
<Input m={2} />
118142
<Button
119143
variant={'myNewButton'}
120144
// title={state.toString()}

src/components/basic/FlatList/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ export interface InterfaceFlatListProps<ItemT>
1212
_contentContainerStyle?: Partial<IFlatListProps<ItemT>>;
1313
}
1414

15-
export type IFlatListProps<ItemT> =
16-
| InterfaceFlatListProps<ItemT>
17-
| CustomProps<'FlatList'>;
15+
export type IFlatListProps<ItemT> = InterfaceFlatListProps<ItemT> &
16+
CustomProps<'FlatList'>;

src/components/basic/KeyboardAvoidingView/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ export interface InterfaceKeyboardAvoidingViewProps
1111
children?: JSX.Element | JSX.Element[] | string | any;
1212
}
1313

14-
export type IKeyboardAvoidingViewProps =
15-
| InterfaceKeyboardAvoidingViewProps
16-
| CustomProps<'KeyboardAvoidingView'>;
14+
export type IKeyboardAvoidingViewProps = InterfaceKeyboardAvoidingViewProps &
15+
CustomProps<'KeyboardAvoidingView'>;

src/components/basic/ScrollView/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ export interface InterfaceScrollViewProps
1515
_contentContainerStyle?: Partial<IScrollViewProps>;
1616
}
1717

18-
export type IScrollViewProps =
19-
| InterfaceScrollViewProps
20-
| CustomProps<'ScrollView'>;
18+
export type IScrollViewProps = InterfaceScrollViewProps &
19+
CustomProps<'ScrollView'>;

src/components/basic/SectionList/types.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export interface InterfaceSectionListProps<ItemT, sectionT = DefaultSectionT>
1010
StyledProps,
1111
PlatformProps<ISectionListProps<ItemT, sectionT>> {}
1212

13-
export type ISectionListProps<ItemT, sectionT = DefaultSectionT> =
14-
| InterfaceSectionListProps<ItemT, sectionT>
15-
| CustomProps<'SectionList'>;
13+
export type ISectionListProps<
14+
ItemT,
15+
sectionT = DefaultSectionT
16+
> = InterfaceSectionListProps<ItemT, sectionT> & CustomProps<'SectionList'>;

src/components/basic/StatusBar/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ import type { StatusBarProps } from 'react-native';
22
import type { CustomProps } from '../../../components/types';
33

44
export interface InterfaceStatusBarProps extends StatusBarProps {}
5-
export type IStatusBarProps =
6-
| InterfaceStatusBarProps
7-
| CustomProps<'StatusBar'>;
5+
export type IStatusBarProps = InterfaceStatusBarProps &
6+
CustomProps<'StatusBar'>;

src/components/basic/View/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export interface InterfaceViewProps
1111
children?: JSX.Element | JSX.Element[] | string | any;
1212
}
1313

14-
export type IViewProps = InterfaceViewProps | CustomProps<'View'>;
14+
export type IViewProps = InterfaceViewProps & CustomProps<'View'>;

src/components/composites/Actionsheet/types.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,5 @@ export type IActionsheetComponentType = ((
7575
// >;
7676
};
7777

78-
export type IActionsheetProps =
79-
| InterfaceActionsheetProps
80-
| CustomProps<'Actionsheet'>;
78+
export type IActionsheetProps = InterfaceActionsheetProps &
79+
CustomProps<'Actionsheet'>;

src/components/composites/Alert/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ export type IAlertComponentType = ((
3232
>;
3333
};
3434

35-
export type IAlertProps = InterfaceAlertProps | CustomProps<'Alert'>;
35+
export type IAlertProps = InterfaceAlertProps & CustomProps<'Alert'>;

src/components/composites/AlertDialog/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,5 @@ export type IAlertDialogComponentType = ((
101101
>;
102102
};
103103

104-
export type IAlertDialogProps =
105-
| InterfaceAlertDialogProps
106-
| CustomProps<'AlertDialog'>;
104+
export type IAlertDialogProps = InterfaceAlertDialogProps &
105+
CustomProps<'AlertDialog'>;

0 commit comments

Comments
 (0)