Skip to content

Commit 9cc4df7

Browse files
committed
fix: types fixes/regression
1 parent 2ff78a8 commit 9cc4df7

File tree

1 file changed

+34
-21
lines changed

1 file changed

+34
-21
lines changed

index.d.ts

+34-21
Original file line numberDiff line numberDiff line change
@@ -38,37 +38,39 @@ export interface Styles {
3838
listContainer?: ReactNative.StyleProp<ReactNative.ViewStyle>
3939
}
4040

41+
export interface Colors {
42+
primary?: string
43+
success?: string
44+
cancel?: string
45+
text?: string
46+
subText?: string
47+
selectToggleTextColor?: string
48+
searchPlaceholderTextColor?: string
49+
searchSelectionColor?: string
50+
chipColor?: string
51+
itemBackground?: string
52+
subItemBackground?: string
53+
disabled?: string
54+
}
55+
4156
export interface SectionedMultiSelectProps<ItemType> {
4257
single?: boolean
4358
selectedItems?: any[]
4459
items?: ItemType[]
4560
displayKey?: string
4661
uniqueKey: string
4762
subKey?: string
48-
onSelectedItemsChange: (items: ItemType[]) => void
63+
onSelectedItemsChange: (items: any[]) => void
4964
showDropDowns?: boolean
5065
showChips?: boolean
5166
readOnlyHeadings?: boolean
5267
selectText?: string
5368
selectedText?: string | (() => void)
54-
renderSelectText?: (props: object) => void
69+
renderSelectText?: (props: this) => void
5570
confirmText?: string
5671
hideConfirm?: boolean
5772
styles?: Styles
58-
colors?: {
59-
primary?: string
60-
success?: string
61-
cancel?: string
62-
text?: string
63-
subText?: string
64-
selectToggleTextColor?: string
65-
searchPlaceholderTextColor?: string
66-
searchSelectionColor?: string
67-
chipColor?: string
68-
itemBackground?: string
69-
subItemBackground?: string
70-
disabled?: string
71-
}
73+
colors?: Colors
7274
searchPlaceholderText?: string
7375
noResultsComponent?: React.ReactNode
7476
loadingComponent?: React.ReactNode
@@ -113,18 +115,29 @@ export interface SectionedMultiSelectProps<ItemType> {
113115
filterItems?: (searchTerm: string) => void
114116
onToggleSelector?: (selected: boolean) => void
115117
noItemsComponent?: React.ReactNode
116-
customChipsRenderer?: (chipProperties: object) => void
118+
customChipsRenderer?: (chipProperties: {
119+
colors: Colors
120+
displayKey: string
121+
items: ItemType[]
122+
selectedItems: any[]
123+
styles: Styles
124+
subKey: string
125+
uniqueKey: string
126+
}) => void
117127
chipsPosition?: 'top' | 'bottom'
118128
autoFocus?: boolean
119129
iconKey?: string
120130
disabled?: boolean
121131
selectedIconOnLeft?: boolean
122132
parentChipsRemoveChildren?: boolean
123133
hideChipRemove?: boolean
124-
IconRenderer?: React.ReactNode
125-
itemsFlatListProps?: Omit<ReactNative.FlatListProps<T>, 'data' | 'renderItem'>
134+
IconRenderer: React.ReactNode
135+
itemsFlatListProps?: Omit<
136+
ReactNative.FlatListProps<ItemType>,
137+
'data' | 'renderItem'
138+
>
126139
subItemsFlatListProps?: Omit<
127-
ReactNative.FlatListProps<T>,
140+
ReactNative.FlatListProps<ItemType>,
128141
'data' | 'renderItem'
129142
>
130143

@@ -144,7 +157,7 @@ export default class SectionedMultiSelect<ItemType> extends React.Component<
144157
_removeAllItems: () => void
145158
_removeItem: (item: ItemType) => void
146159
_selectAllItems: () => void
147-
_findItem: (id: string | number) => ItemType | object | undefined
160+
_findItem: (id: any) => ItemType | undefined
148161
_itemSelected: (item: ItemType) => boolean
149162
_getSearchTerm: () => string
150163
_submitSelection: () => void

0 commit comments

Comments
 (0)