fix(chore): patch Template
generic
This commit is contained in:
parent
a43f2c5c75
commit
ad4732a217
|
@ -17,7 +17,7 @@ function Message(
|
|||
)
|
||||
}
|
||||
|
||||
const template: Template = {
|
||||
const template: Template<typeof Message, Parameters<typeof Message>[0]> = {
|
||||
props: [
|
||||
{
|
||||
name: 'Résumé',
|
||||
|
|
6
types.ts
6
types.ts
|
@ -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
|
||||
}[]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue