fix(chore): patch Template generic

This commit is contained in:
Julien Oculi 2024-04-02 15:11:28 +02:00
parent a43f2c5c75
commit ad4732a217
2 changed files with 4 additions and 4 deletions

View file

@ -17,7 +17,7 @@ function Message(
)
}
const template: Template = {
const template: Template<typeof Message, Parameters<typeof Message>[0]> = {
props: [
{
name: 'Résumé',

View file

@ -1,4 +1,4 @@
import type { FunctionComponent, JSX } from 'preact'
import type { JSX } from 'preact'
import type { Contact } from './src/contact.ts'
export type Mail = {
@ -14,7 +14,7 @@ export type Mail = {
}
export type Template<
T extends FunctionComponent<P>,
T extends (props: P) => JSX.Element,
P extends Record<string, unknown>,
> = {
name: string
@ -25,6 +25,6 @@ export type Template<
description: string
required: boolean
multiline: boolean
tag: P
tag: keyof P
}[]
}