mirror of
https://github.com/honojs/hono.git
synced 2024-11-24 11:07:29 +01:00
fix(types): remove slow types (#3147)
This commit is contained in:
parent
20d877167c
commit
c63251172c
@ -34,8 +34,8 @@ export const compose = <C extends ComposeContext, E extends Env = Env>(
|
||||
middleware: [[Function, unknown], ParamIndexMap | Params][],
|
||||
onError?: ErrorHandler<E>,
|
||||
onNotFound?: NotFoundHandler<E>
|
||||
) => {
|
||||
return (context: C, next?: Function) => {
|
||||
): ((context: C, next?: Function) => Promise<C>) => {
|
||||
return (context, next) => {
|
||||
let index = -1
|
||||
return dispatch(0)
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
* Provide hooks used only in jsx/dom
|
||||
*/
|
||||
|
||||
import type { Context } from '../../context'
|
||||
import { useContext } from '../../context'
|
||||
import { createContext } from '../context'
|
||||
import { useCallback, useState } from '../../hooks'
|
||||
@ -20,7 +21,7 @@ type FormStatus =
|
||||
method: 'get' | 'post'
|
||||
action: string | ((formData: FormData) => void | Promise<void>)
|
||||
}
|
||||
export const FormContext = createContext<FormStatus>({
|
||||
export const FormContext: Context<FormStatus> = createContext<FormStatus>({
|
||||
pending: false,
|
||||
data: null,
|
||||
method: null,
|
||||
|
@ -344,7 +344,7 @@ const findChildNodeIndex = (
|
||||
return
|
||||
}
|
||||
|
||||
const cancelBuild = Symbol()
|
||||
const cancelBuild: symbol = Symbol()
|
||||
const applyNodeObject = (node: NodeObject, container: Container): void => {
|
||||
const next: Node[] = []
|
||||
const remove: Node[] = []
|
||||
|
@ -168,5 +168,8 @@ const formActionableElement = (
|
||||
}
|
||||
return newJSXNode(tag, props)
|
||||
}
|
||||
export const input = (props: PropsWithChildren) => formActionableElement('input', props)
|
||||
export const button = (props: PropsWithChildren) => formActionableElement('button', props)
|
||||
|
||||
export const input: (props: PropsWithChildren) => unknown = (props) =>
|
||||
formActionableElement('input', props)
|
||||
export const button: (props: PropsWithChildren) => unknown = (props) =>
|
||||
formActionableElement('button', props)
|
||||
|
Loading…
Reference in New Issue
Block a user