For sure:
type choice<'id> = {
label: string,
id: 'id,
}
type getCompareValue<'item, 'compareValue> = 'item => 'compareValue
module FilterTypes = {
type settings<'item, 'compareValue, 'id> = {
getCompareValue: getCompareValue<'item, 'compareValue>,
initialValue?: option<choice<'id>>,
choices: array<choice<'id>>,
defaultLabel?: option<string>,
}
type getCompareValue<'item, 'compareValue> = getCompareValue<'item, 'compareValue>
type hookValue<'item, 'compareValue, 'id> = {
reset: unit => unit,
selected: option<choice<'id>>,
component: React.element,
settings: option<settings<'item, 'compareValue, 'id>>,
}
}