This might be stretching it but can I do something like this
module BaseCollection = (
T: {
type data
},
) => {
type t
type extendedData = {
created: string,
updated: string,
// Error on this line
...T.data
}
@send
external getList: (t, int, int) => promise<array<'data>> = "getList"
@send
external create: (t, 'data) => promise<'data> = "create"
}
Usage:
type notificationSubscription = {
user: string,
active?: bool,
endpoint: string,
auth: string,
p256dh: string,
}
module NotificationSubscriptions = {
include Pocketbase.BaseCollection({
type data = notificationSubscription
})
}
Can I somehow tell ReScript type data
is a record?