Skip to content

Commit

Permalink
fix(types): remove slow types (#3147)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe committed Jul 16, 2024
1 parent 20d8771 commit c632511
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion src/jsx/dom/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/jsx/dom/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = []
Expand Down
7 changes: 5 additions & 2 deletions src/jsx/intrinsic-element/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit c632511

Please sign in to comment.