hono 4.6.4 → 4.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/adapter/deno/serve-static.js +4 -2
  2. package/dist/cjs/adapter/deno/serve-static.js +4 -2
  3. package/dist/cjs/client/client.js +10 -16
  4. package/dist/cjs/client/utils.js +18 -0
  5. package/dist/cjs/middleware/cors/index.js +6 -2
  6. package/dist/cjs/middleware/csrf/index.js +1 -1
  7. package/dist/cjs/middleware/powered-by/index.js +2 -2
  8. package/dist/cjs/middleware/secure-headers/secure-headers.js +6 -5
  9. package/dist/client/client.js +11 -16
  10. package/dist/client/utils.js +17 -0
  11. package/dist/middleware/cors/index.js +6 -2
  12. package/dist/middleware/csrf/index.js +1 -1
  13. package/dist/middleware/powered-by/index.js +2 -2
  14. package/dist/middleware/secure-headers/secure-headers.js +6 -5
  15. package/dist/types/adapter/cloudflare-pages/handler.d.ts +1 -1
  16. package/dist/types/adapter/lambda-edge/handler.d.ts +2 -2
  17. package/dist/types/client/types.d.ts +18 -8
  18. package/dist/types/client/utils.d.ts +1 -0
  19. package/dist/types/compose.d.ts +7 -1
  20. package/dist/types/context.d.ts +26 -16
  21. package/dist/types/helper/accepts/accepts.d.ts +1 -1
  22. package/dist/types/helper/adapter/index.d.ts +1 -1
  23. package/dist/types/helper/conninfo/types.d.ts +2 -2
  24. package/dist/types/helper/css/common.d.ts +6 -1
  25. package/dist/types/helper/factory/index.d.ts +31 -10
  26. package/dist/types/helper/ssg/ssg.d.ts +1 -1
  27. package/dist/types/helper/websocket/index.d.ts +1 -1
  28. package/dist/types/hono-base.d.ts +19 -22
  29. package/dist/types/hono.d.ts +1 -1
  30. package/dist/types/jsx/base.d.ts +4 -1
  31. package/dist/types/jsx/dom/hooks/index.d.ts +9 -3
  32. package/dist/types/jsx/dom/index.d.ts +28 -7
  33. package/dist/types/jsx/dom/intrinsic-element/components.d.ts +6 -6
  34. package/dist/types/jsx/dom/render.d.ts +28 -4
  35. package/dist/types/jsx/dom/server.d.ts +28 -7
  36. package/dist/types/jsx/hooks/index.d.ts +20 -5
  37. package/dist/types/jsx/index.d.ts +28 -7
  38. package/dist/types/jsx/intrinsic-element/components.d.ts +4 -4
  39. package/dist/types/jsx/intrinsic-elements.d.ts +46 -46
  40. package/dist/types/middleware/compress/index.d.ts +4 -1
  41. package/dist/types/middleware/powered-by/index.d.ts +24 -1
  42. package/dist/types/middleware/secure-headers/permissions-policy.d.ts +3 -3
  43. package/dist/types/middleware/secure-headers/secure-headers.d.ts +1 -1
  44. package/dist/types/preset/quick.d.ts +1 -1
  45. package/dist/types/preset/tiny.d.ts +1 -1
  46. package/dist/types/request.d.ts +5 -7
  47. package/dist/types/router/linear-router/router.d.ts +5 -1
  48. package/dist/types/router/pattern-router/router.d.ts +0 -1
  49. package/dist/types/router/reg-exp-router/node.d.ts +4 -1
  50. package/dist/types/router/reg-exp-router/router.d.ts +4 -3
  51. package/dist/types/router/reg-exp-router/trie.d.ts +5 -1
  52. package/dist/types/router/smart-router/router.d.ts +6 -2
  53. package/dist/types/router/trie-router/node.d.ts +6 -2
  54. package/dist/types/router.d.ts +20 -2
  55. package/dist/types/types.d.ts +908 -120
  56. package/dist/types/utils/cookie.d.ts +3 -3
  57. package/dist/types/utils/html.d.ts +6 -2
  58. package/dist/types/utils/jwt/jwt.d.ts +1 -1
  59. package/dist/types/utils/mime.d.ts +1 -1
  60. package/dist/types/utils/stream.d.ts +0 -4
  61. package/dist/types/utils/url.d.ts +5 -1
  62. package/dist/types/validator/validator.d.ts +18 -6
  63. package/package.json +8 -7
@@ -9,11 +9,36 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
9
9
  <I extends Input = {}, R extends HandlerResponse<any> = any>(handler1: H<E, P, I, R>): [
10
10
  H<E, P, I, R>
11
11
  ];
12
- <I extends Input = {}, I2 extends Input = I, R extends HandlerResponse<any> = any>(handler1: H<E, P, I, R>, handler2: H<E, P, I2, R>): [H<E, P, I, R>, H<E, P, I2, R>];
13
- <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, R extends HandlerResponse<any> = any>(handler1: H<E, P, I, R>, handler2: H<E, P, I2, R>, handler3: H<E, P, I3, R>): [H<E, P, I, R>, H<E, P, I2, R>, H<E, P, I3, R>];
14
- <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, R extends HandlerResponse<any> = any>(handler1: H<E, P, I, R>, handler2: H<E, P, I2, R>, handler3: H<E, P, I3, R>, handler4: H<E, P, I4, R>): [H<E, P, I, R>, H<E, P, I2, R>, H<E, P, I3, R>, H<E, P, I4, R>];
15
- <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, R extends HandlerResponse<any> = any>(handler1: H<E, P, I, R>, handler2: H<E, P, I2, R>, handler3: H<E, P, I3, R>, handler4: H<E, P, I4, R>, handler5: H<E, P, I5, R>): [H<E, P, I, R>, H<E, P, I2, R>, H<E, P, I3, R>, H<E, P, I4, R>, H<E, P, I5, R>];
16
- <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, R extends HandlerResponse<any> = any>(handler1: H<E, P, I, R>, handler2: H<E, P, I2, R>, handler3: H<E, P, I3, R>, handler4: H<E, P, I4, R>, handler5: H<E, P, I5, R>, handler6: H<E, P, I6, R>): [H<E, P, I, R>, H<E, P, I2, R>, H<E, P, I3, R>, H<E, P, I4, R>, H<E, P, I5, R>, H<E, P, I6, R>];
12
+ <I extends Input = {}, I2 extends Input = I, R extends HandlerResponse<any> = any>(handler1: H<E, P, I, R>, handler2: H<E, P, I2, R>): [
13
+ H<E, P, I, R>,
14
+ H<E, P, I2, R>
15
+ ];
16
+ <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, R extends HandlerResponse<any> = any>(handler1: H<E, P, I, R>, handler2: H<E, P, I2, R>, handler3: H<E, P, I3, R>): [
17
+ H<E, P, I, R>,
18
+ H<E, P, I2, R>,
19
+ H<E, P, I3, R>
20
+ ];
21
+ <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, R extends HandlerResponse<any> = any>(handler1: H<E, P, I, R>, handler2: H<E, P, I2, R>, handler3: H<E, P, I3, R>, handler4: H<E, P, I4, R>): [
22
+ H<E, P, I, R>,
23
+ H<E, P, I2, R>,
24
+ H<E, P, I3, R>,
25
+ H<E, P, I4, R>
26
+ ];
27
+ <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, R extends HandlerResponse<any> = any>(handler1: H<E, P, I, R>, handler2: H<E, P, I2, R>, handler3: H<E, P, I3, R>, handler4: H<E, P, I4, R>, handler5: H<E, P, I5, R>): [
28
+ H<E, P, I, R>,
29
+ H<E, P, I2, R>,
30
+ H<E, P, I3, R>,
31
+ H<E, P, I4, R>,
32
+ H<E, P, I5, R>
33
+ ];
34
+ <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, R extends HandlerResponse<any> = any>(handler1: H<E, P, I, R>, handler2: H<E, P, I2, R>, handler3: H<E, P, I3, R>, handler4: H<E, P, I4, R>, handler5: H<E, P, I5, R>, handler6: H<E, P, I6, R>): [
35
+ H<E, P, I, R>,
36
+ H<E, P, I2, R>,
37
+ H<E, P, I3, R>,
38
+ H<E, P, I4, R>,
39
+ H<E, P, I5, R>,
40
+ H<E, P, I6, R>
41
+ ];
17
42
  <I extends Input = {}, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, R extends HandlerResponse<any> = any>(handler1: H<E, P, I, R>, handler2: H<E, P, I2, R>, handler3: H<E, P, I3, R>, handler4: H<E, P, I4, R>, handler5: H<E, P, I5, R>, handler6: H<E, P, I6, R>, handler7: H<E, P, I7, R>): [
18
43
  H<E, P, I, R>,
19
44
  H<E, P, I2, R>,
@@ -58,7 +83,6 @@ export interface CreateHandlersInterface<E extends Env, P extends string> {
58
83
  ];
59
84
  }
60
85
  export declare class Factory<E extends Env = any, P extends string = any> {
61
- private initApp?;
62
86
  constructor(init?: {
63
87
  initApp?: InitApp<E>;
64
88
  });
@@ -69,8 +93,5 @@ export declare class Factory<E extends Env = any, P extends string = any> {
69
93
  export declare const createFactory: <E extends Env = any, P extends string = any>(init?: {
70
94
  initApp?: InitApp<E>;
71
95
  }) => Factory<E, P>;
72
- export declare const createMiddleware: <E extends Env = any, P extends string = string, I extends Input = {}, E2 extends Env = {
73
- Bindings: undefined extends E["Bindings"] ? any : E["Bindings"];
74
- Variables: undefined extends E["Variables"] ? any : E["Variables"];
75
- }>(middleware: MiddlewareHandler<E2, P, I>) => MiddlewareHandler<E2, P, I>;
96
+ export declare const createMiddleware: <E extends Env = any, P extends string = string, I extends Input = {}>(middleware: MiddlewareHandler<E, P, I>) => MiddlewareHandler<E, P, I>;
76
97
  export {};
@@ -64,7 +64,7 @@ export interface ToSSGInterface {
64
64
  * `ToSSGAdaptorInterface` is an experimental feature.
65
65
  * The API might be changed.
66
66
  */
67
- export interface ToSSGAdaptorInterface<E extends Env = Env, S extends Schema = {}, BasePath extends string = '/'> {
67
+ export interface ToSSGAdaptorInterface<E extends Env = Env, S extends Schema = {}, BasePath extends string = "/"> {
68
68
  (app: Hono<E, S, BasePath>, options?: ToSSGOptions): Promise<ToSSGResult>;
69
69
  }
70
70
  /**
@@ -17,7 +17,7 @@ export interface WSEvents<T = unknown> {
17
17
  * Upgrade WebSocket Type
18
18
  */
19
19
  export type UpgradeWebSocket<T = unknown, U = any> = (createEvents: (c: Context) => WSEvents<T> | Promise<WSEvents<T>>, options?: U) => MiddlewareHandler<any, string, {
20
- outputFormat: 'ws';
20
+ outputFormat: "ws";
21
21
  }>;
22
22
  export type WSReadyState = 0 | 1 | 2 | 3;
23
23
  export type WSContext<T = unknown> = {
@@ -11,7 +11,7 @@ import type { Env, ErrorHandler, H, HandlerInterface, MergePath, MergeSchemaPath
11
11
  */
12
12
  export declare const COMPOSED_HANDLER: unique symbol;
13
13
  type GetPath<E extends Env> = (request: Request, options?: {
14
- env?: E['Bindings'];
14
+ env?: E["Bindings"];
15
15
  }) => string;
16
16
  export type HonoOptions<E extends Env> = {
17
17
  /**
@@ -32,7 +32,10 @@ export type HonoOptions<E extends Env> = {
32
32
  * const app = new Hono({ router: new RegExpRouter() })
33
33
  * ```
34
34
  */
35
- router?: Router<[H, RouterRoute]>;
35
+ router?: Router<[
36
+ H,
37
+ RouterRoute
38
+ ]>;
36
39
  /**
37
40
  * `getPath` can handle the host header value.
38
41
  *
@@ -61,25 +64,23 @@ type MountOptions = MountOptionHandler | {
61
64
  optionHandler?: MountOptionHandler;
62
65
  replaceRequest?: MountReplaceRequest;
63
66
  };
64
- declare class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends string = '/'> {
65
- #private;
66
- get: HandlerInterface<E, 'get', S, BasePath>;
67
- post: HandlerInterface<E, 'post', S, BasePath>;
68
- put: HandlerInterface<E, 'put', S, BasePath>;
69
- delete: HandlerInterface<E, 'delete', S, BasePath>;
70
- options: HandlerInterface<E, 'options', S, BasePath>;
71
- patch: HandlerInterface<E, 'patch', S, BasePath>;
72
- all: HandlerInterface<E, 'all', S, BasePath>;
67
+ declare class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends string = "/"> {
68
+ get: HandlerInterface<E, "get", S, BasePath>;
69
+ post: HandlerInterface<E, "post", S, BasePath>;
70
+ put: HandlerInterface<E, "put", S, BasePath>;
71
+ delete: HandlerInterface<E, "delete", S, BasePath>;
72
+ options: HandlerInterface<E, "options", S, BasePath>;
73
+ patch: HandlerInterface<E, "patch", S, BasePath>;
74
+ all: HandlerInterface<E, "all", S, BasePath>;
73
75
  on: OnHandlerInterface<E, S, BasePath>;
74
76
  use: MiddlewareHandlerInterface<E, S, BasePath>;
75
- router: Router<[H, RouterRoute]>;
77
+ router: Router<[
78
+ H,
79
+ RouterRoute
80
+ ]>;
76
81
  readonly getPath: GetPath<E>;
77
- private _basePath;
78
82
  routes: RouterRoute[];
79
83
  constructor(options?: HonoOptions<E>);
80
- private clone;
81
- private notFoundHandler;
82
- private errorHandler;
83
84
  /**
84
85
  * `.route()` allows grouping other Hono instance in routes.
85
86
  *
@@ -98,7 +99,7 @@ declare class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends
98
99
  * app.route("/api", app2) // GET /api/user
99
100
  * ```
100
101
  */
101
- route<SubPath extends string, SubEnv extends Env, SubSchema extends Schema, SubBasePath extends string>(path: SubPath, app: Hono<SubEnv, SubSchema, SubBasePath>): Hono<E, MergeSchemaPath<SubSchema, MergePath<BasePath, SubPath>> & S, BasePath>;
102
+ route<SubPath extends string, SubEnv extends Env, SubSchema extends Schema, SubBasePath extends string>(path: SubPath, app: Hono<SubEnv, SubSchema, SubBasePath>): Hono<E, MergeSchemaPath<SubSchema, MergePath<BasePath, SubPath>> | S, BasePath>;
102
103
  /**
103
104
  * `.basePath()` allows base paths to be specified.
104
105
  *
@@ -179,10 +180,6 @@ declare class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends
179
180
  * ```
180
181
  */
181
182
  mount(path: string, applicationHandler: (request: Request, ...args: any) => Response | Promise<Response>, options?: MountOptions): Hono<E, S, BasePath>;
182
- private addRoute;
183
- private matchRoute;
184
- private handleError;
185
- private dispatch;
186
183
  /**
187
184
  * `.fetch()` will be entry point of your app.
188
185
  *
@@ -194,7 +191,7 @@ declare class Hono<E extends Env = Env, S extends Schema = {}, BasePath extends
194
191
  * @returns {Response | Promise<Response>} response of request
195
192
  *
196
193
  */
197
- fetch: (request: Request, Env?: E['Bindings'] | {}, executionCtx?: ExecutionContext) => Response | Promise<Response>;
194
+ fetch: (request: Request, Env?: E["Bindings"] | {}, executionCtx?: ExecutionContext) => Response | Promise<Response>;
198
195
  /**
199
196
  * `.request()` is a useful method for testing.
200
197
  * You can pass a URL or pathname to send a GET request.
@@ -9,7 +9,7 @@ import type { BlankEnv, BlankSchema, Env, Schema } from './types';
9
9
  * @template S - The schema type.
10
10
  * @template BasePath - The base path type.
11
11
  */
12
- export declare class Hono<E extends Env = BlankEnv, S extends Schema = BlankSchema, BasePath extends string = '/'> extends HonoBase<E, S, BasePath> {
12
+ export declare class Hono<E extends Env = BlankEnv, S extends Schema = BlankSchema, BasePath extends string = "/"> extends HonoBase<E, S, BasePath> {
13
13
  /**
14
14
  * Creates an instance of the Hono class.
15
15
  *
@@ -22,7 +22,10 @@ export declare namespace JSX {
22
22
  }
23
23
  export declare const getNameSpaceContext: () => Context<string> | undefined;
24
24
  export declare const booleanAttributes: string[];
25
- type LocalContexts = [Context<unknown>, unknown][];
25
+ type LocalContexts = [
26
+ Context<unknown>,
27
+ unknown
28
+ ][];
26
29
  export type Child = string | Promise<string> | number | JSXNode | null | undefined | boolean | Child[];
27
30
  export declare class JSXNode implements HtmlEscaped {
28
31
  tag: string | Function;
@@ -10,7 +10,7 @@ type FormStatus = {
10
10
  } | {
11
11
  pending: true;
12
12
  data: FormData;
13
- method: 'get' | 'post';
13
+ method: "get" | "post";
14
14
  action: string | ((formData: FormData) => void | Promise<void>);
15
15
  };
16
16
  export declare const FormContext: Context<FormStatus>;
@@ -27,7 +27,10 @@ export declare const useFormStatus: () => FormStatus;
27
27
  * @param updateState
28
28
  * @returns [T, (action: N) => void]
29
29
  */
30
- export declare const useOptimistic: <T, N>(state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void];
30
+ export declare const useOptimistic: <T, N>(state: T, updateState: (currentState: T, action: N) => T) => [
31
+ T,
32
+ (action: N) => void
33
+ ];
31
34
  /**
32
35
  * This hook returns the current state and a function to update the state by form action
33
36
  * @param fn
@@ -35,5 +38,8 @@ export declare const useOptimistic: <T, N>(state: T, updateState: (currentState:
35
38
  * @param permalink
36
39
  * @returns [T, (data: FormData) => void]
37
40
  */
38
- export declare const useActionState: <T>(fn: Function, initialState: T, permalink?: string) => [T, Function];
41
+ export declare const useActionState: <T>(fn: Function, initialState: T, permalink?: string) => [
42
+ T,
43
+ Function
44
+ ];
39
45
  export {};
@@ -19,22 +19,37 @@ export { reactAPICompatVersion as version, createElement as jsx, useState, useEf
19
19
  declare const _default: {
20
20
  version: string;
21
21
  useState: {
22
- <T>(initialState: T | (() => T)): [T, (newState: T | ((currentState: T) => T)) => void];
23
- <T = undefined>(): [T | undefined, (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void];
22
+ <T>(initialState: T | (() => T)): [
23
+ T,
24
+ (newState: T | ((currentState: T) => T)) => void
25
+ ];
26
+ <T = undefined>(): [
27
+ T | undefined,
28
+ (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void
29
+ ];
24
30
  };
25
31
  useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
26
32
  useRef: <T>(initialValue: T | null) => import("..").RefObject<T>;
27
33
  useCallback: <T extends Function>(callback: T, deps: readonly unknown[]) => T;
28
34
  use: <T>(promise: Promise<T>) => T;
29
35
  startTransition: (callback: () => void) => void;
30
- useTransition: () => [boolean, (callback: () => void | Promise<void>) => void];
36
+ useTransition: () => [
37
+ boolean,
38
+ (callback: () => void | Promise<void>) => void
39
+ ];
31
40
  useDeferredValue: <T>(value: T, initialValue?: T) => T;
32
41
  startViewTransition: (callback: () => void) => void;
33
- useViewTransition: () => [boolean, (callback: () => void) => void];
42
+ useViewTransition: () => [
43
+ boolean,
44
+ (callback: () => void) => void
45
+ ];
34
46
  useMemo: <T>(factory: () => T, deps: readonly unknown[]) => T;
35
47
  useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
36
48
  useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
37
- useReducer: <T, A>(reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void];
49
+ useReducer: <T, A>(reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [
50
+ T,
51
+ (action: A) => void
52
+ ];
38
53
  useId: () => string;
39
54
  useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void;
40
55
  createRef: <T>() => import("..").RefObject<T>;
@@ -54,8 +69,14 @@ declare const _default: {
54
69
  method: "get" | "post";
55
70
  action: string | ((formData: FormData) => void | Promise<void>);
56
71
  };
57
- useActionState: <T>(fn: Function, initialState: T, permalink?: string) => [T, Function];
58
- useOptimistic: <T, N>(state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void];
72
+ useActionState: <T>(fn: Function, initialState: T, permalink?: string) => [
73
+ T,
74
+ Function
75
+ ];
76
+ useOptimistic: <T, N>(state: T, updateState: (currentState: T, action: N) => T) => [
77
+ T,
78
+ (action: N) => void
79
+ ];
59
80
  Suspense: import("..").FC<import("..").PropsWithChildren<{
60
81
  fallback: any;
61
82
  }>>;
@@ -3,14 +3,14 @@ import type { FC, PropsWithChildren, RefObject } from '../../types';
3
3
  export declare const clearCache: () => void;
4
4
  export declare const composeRef: <T>(ref: RefObject<T> | Function | undefined, cb: (e: T) => void | (() => void)) => ((e: T) => () => void);
5
5
  export declare const title: FC<PropsWithChildren>;
6
- export declare const script: FC<PropsWithChildren<IntrinsicElements['script']>>;
7
- export declare const style: FC<PropsWithChildren<IntrinsicElements['style']>>;
8
- export declare const link: FC<PropsWithChildren<IntrinsicElements['link']>>;
6
+ export declare const script: FC<PropsWithChildren<IntrinsicElements["script"]>>;
7
+ export declare const style: FC<PropsWithChildren<IntrinsicElements["style"]>>;
8
+ export declare const link: FC<PropsWithChildren<IntrinsicElements["link"]>>;
9
9
  export declare const meta: FC<PropsWithChildren>;
10
10
  export declare const form: FC<PropsWithChildren<{
11
11
  action?: Function | string;
12
- method?: 'get' | 'post';
12
+ method?: "get" | "post";
13
13
  ref?: RefObject<HTMLFormElement> | ((e: HTMLFormElement | null) => void | (() => void));
14
14
  }>>;
15
- export declare const input: FC<PropsWithChildren<IntrinsicElements['input']>>;
16
- export declare const button: FC<PropsWithChildren<IntrinsicElements['button']>>;
15
+ export declare const input: FC<PropsWithChildren<IntrinsicElements["input"]>>;
16
+ export declare const button: FC<PropsWithChildren<IntrinsicElements["button"]>>;
@@ -6,7 +6,10 @@ export type HasRenderToDom = FC<any> & {
6
6
  };
7
7
  export type ErrorHandler = (error: any, retry: () => void) => Child | undefined;
8
8
  type Container = HTMLElement | DocumentFragment;
9
- type LocalJSXContexts = [JSXContext<unknown>, unknown][] | undefined;
9
+ type LocalJSXContexts = [
10
+ JSXContext<unknown>,
11
+ unknown
12
+ ][] | undefined;
10
13
  type SupportedElement = HTMLElement | SVGElement | MathMLElement;
11
14
  export type PreserveNodeType = 1 | 2;
12
15
  export type NodeObject = {
@@ -31,7 +34,10 @@ export type NodeObject = {
31
34
  Function,
32
35
  NodeObject
33
36
  ]
34
- ] | [number, any[][]];
37
+ ] | [
38
+ number,
39
+ any[][]
40
+ ];
35
41
  } & JSXNode;
36
42
  type NodeString = {
37
43
  t: string;
@@ -59,8 +65,26 @@ export type Context = [
59
65
  Function,
60
66
  NodeObject
61
67
  ][]
62
- ] | [PendingType, boolean, UpdateHook, boolean] | [PendingType, boolean, UpdateHook] | [PendingType, boolean] | [PendingType] | [];
63
- export declare const buildDataStack: [Context, Node][];
68
+ ] | [
69
+ PendingType,
70
+ boolean,
71
+ UpdateHook,
72
+ boolean
73
+ ] | [
74
+ PendingType,
75
+ boolean,
76
+ UpdateHook
77
+ ] | [
78
+ PendingType,
79
+ boolean
80
+ ] | [
81
+ PendingType
82
+ ] | [
83
+ ];
84
+ export declare const buildDataStack: [
85
+ Context,
86
+ Node
87
+ ][];
64
88
  export declare const getNameSpaceContext: () => JSXContext<string> | undefined;
65
89
  export declare const build: (context: Context, node: NodeObject, children?: Child[]) => void;
66
90
  export declare const buildNode: (node: Child) => Node | undefined;
@@ -39,22 +39,37 @@ declare const _default: {
39
39
  version: {
40
40
  version: string;
41
41
  useState: {
42
- <T>(initialState: T | (() => T)): [T, (newState: T | ((currentState: T) => T)) => void];
43
- <T = undefined>(): [T | undefined, (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void];
42
+ <T>(initialState: T | (() => T)): [
43
+ T,
44
+ (newState: T | ((currentState: T) => T)) => void
45
+ ];
46
+ <T = undefined>(): [
47
+ T | undefined,
48
+ (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void
49
+ ];
44
50
  };
45
51
  useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
46
52
  useRef: <T>(initialValue: T | null) => import("..").RefObject<T>;
47
53
  useCallback: <T extends Function>(callback: T, deps: readonly unknown[]) => T;
48
54
  use: <T>(promise: Promise<T>) => T;
49
55
  startTransition: (callback: () => void) => void;
50
- useTransition: () => [boolean, (callback: () => void | Promise<void>) => void];
56
+ useTransition: () => [
57
+ boolean,
58
+ (callback: () => void | Promise<void>) => void
59
+ ];
51
60
  useDeferredValue: <T>(value: T, initialValue?: T) => T;
52
61
  startViewTransition: (callback: () => void) => void;
53
- useViewTransition: () => [boolean, (callback: () => void) => void];
62
+ useViewTransition: () => [
63
+ boolean,
64
+ (callback: () => void) => void
65
+ ];
54
66
  useMemo: <T>(factory: () => T, deps: readonly unknown[]) => T;
55
67
  useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
56
68
  useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
57
- useReducer: <T, A>(reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void];
69
+ useReducer: <T, A>(reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [
70
+ T,
71
+ (action: A) => void
72
+ ];
58
73
  useId: () => string;
59
74
  useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void;
60
75
  createRef: <T>() => import("..").RefObject<T>;
@@ -74,8 +89,14 @@ declare const _default: {
74
89
  method: "get" | "post";
75
90
  action: string | ((formData: FormData) => void | Promise<void>);
76
91
  };
77
- useActionState: <T>(fn: Function, initialState: T, permalink?: string) => [T, Function];
78
- useOptimistic: <T, N>(state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void];
92
+ useActionState: <T>(fn: Function, initialState: T, permalink?: string) => [
93
+ T,
94
+ Function
95
+ ];
96
+ useOptimistic: <T, N>(state: T, updateState: (currentState: T, action: N) => T) => [
97
+ T,
98
+ (action: N) => void
99
+ ];
79
100
  Suspense: import("..").FC<import("..").PropsWithChildren<{
80
101
  fallback: any;
81
102
  }>>;
@@ -13,17 +13,32 @@ export type EffectData = [
13
13
  (() => void) | undefined
14
14
  ];
15
15
  export declare const startViewTransition: (callback: () => void) => void;
16
- export declare const useViewTransition: () => [boolean, (callback: () => void) => void];
16
+ export declare const useViewTransition: () => [
17
+ boolean,
18
+ (callback: () => void) => void
19
+ ];
17
20
  export declare const startTransition: (callback: () => void) => void;
18
- export declare const useTransition: () => [boolean, (callback: () => void | Promise<void>) => void];
21
+ export declare const useTransition: () => [
22
+ boolean,
23
+ (callback: () => void | Promise<void>) => void
24
+ ];
19
25
  type UseDeferredValue = <T>(value: T, initialValue?: T) => T;
20
26
  export declare const useDeferredValue: UseDeferredValue;
21
27
  type UseStateType = {
22
- <T>(initialState: T | (() => T)): [T, UpdateStateFunction<T>];
23
- <T = undefined>(): [T | undefined, UpdateStateFunction<T | undefined>];
28
+ <T>(initialState: T | (() => T)): [
29
+ T,
30
+ UpdateStateFunction<T>
31
+ ];
32
+ <T = undefined>(): [
33
+ T | undefined,
34
+ UpdateStateFunction<T | undefined>
35
+ ];
24
36
  };
25
37
  export declare const useState: UseStateType;
26
- export declare const useReducer: <T, A>(reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void];
38
+ export declare const useReducer: <T, A>(reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [
39
+ T,
40
+ (action: A) => void
41
+ ];
27
42
  export declare const useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
28
43
  export declare const useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
29
44
  export declare const useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
@@ -33,21 +33,36 @@ declare const _default: {
33
33
  createContext: <T>(defaultValue: T) => import("./context").Context<T>;
34
34
  useContext: <T>(context: import("./context").Context<T>) => T;
35
35
  useState: {
36
- <T>(initialState: T | (() => T)): [T, (newState: T | ((currentState: T) => T)) => void];
37
- <T = undefined>(): [T | undefined, (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void];
36
+ <T>(initialState: T | (() => T)): [
37
+ T,
38
+ (newState: T | ((currentState: T) => T)) => void
39
+ ];
40
+ <T = undefined>(): [
41
+ T | undefined,
42
+ (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void
43
+ ];
38
44
  };
39
45
  useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
40
46
  useRef: <T>(initialValue: T | null) => import("./hooks").RefObject<T>;
41
47
  useCallback: <T extends Function>(callback: T, deps: readonly unknown[]) => T;
42
- useReducer: <T, A>(reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void];
48
+ useReducer: <T, A>(reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [
49
+ T,
50
+ (action: A) => void
51
+ ];
43
52
  useId: () => string;
44
53
  useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void;
45
54
  use: <T>(promise: Promise<T>) => T;
46
55
  startTransition: (callback: () => void) => void;
47
- useTransition: () => [boolean, (callback: () => void | Promise<void>) => void];
56
+ useTransition: () => [
57
+ boolean,
58
+ (callback: () => void | Promise<void>) => void
59
+ ];
48
60
  useDeferredValue: <T>(value: T, initialValue?: T) => T;
49
61
  startViewTransition: (callback: () => void) => void;
50
- useViewTransition: () => [boolean, (callback: () => void) => void];
62
+ useViewTransition: () => [
63
+ boolean,
64
+ (callback: () => void) => void
65
+ ];
51
66
  useMemo: <T>(factory: () => T, deps: readonly unknown[]) => T;
52
67
  useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
53
68
  useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
@@ -57,8 +72,14 @@ declare const _default: {
57
72
  }) => import("./base").JSX.Element);
58
73
  useImperativeHandle: <T>(ref: import("./hooks").RefObject<T>, createHandle: () => T, deps: readonly unknown[]) => void;
59
74
  useSyncExternalStore: <T>(subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T;
60
- useActionState: <T>(fn: Function, initialState: T, permalink?: string) => [T, Function];
61
- useOptimistic: <T, N>(state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void];
75
+ useActionState: <T>(fn: Function, initialState: T, permalink?: string) => [
76
+ T,
77
+ Function
78
+ ];
79
+ useOptimistic: <T, N>(state: T, updateState: (currentState: T, action: N) => T) => [
80
+ T,
81
+ (action: N) => void
82
+ ];
62
83
  Suspense: import("./base").FC<import("./types").PropsWithChildren<{
63
84
  fallback: any;
64
85
  }>>;
@@ -1,13 +1,13 @@
1
1
  import type { IntrinsicElements } from '../intrinsic-elements';
2
2
  import type { FC, PropsWithChildren } from '../types';
3
3
  export declare const title: FC<PropsWithChildren>;
4
- export declare const script: FC<PropsWithChildren<IntrinsicElements['script']>>;
5
- export declare const style: FC<PropsWithChildren<IntrinsicElements['style']>>;
6
- export declare const link: FC<PropsWithChildren<IntrinsicElements['link']>>;
4
+ export declare const script: FC<PropsWithChildren<IntrinsicElements["script"]>>;
5
+ export declare const style: FC<PropsWithChildren<IntrinsicElements["style"]>>;
6
+ export declare const link: FC<PropsWithChildren<IntrinsicElements["link"]>>;
7
7
  export declare const meta: FC<PropsWithChildren>;
8
8
  export declare const form: FC<PropsWithChildren<{
9
9
  action?: Function | string;
10
- method?: 'get' | 'post';
10
+ method?: "get" | "post";
11
11
  }>>;
12
12
  export declare const input: (props: PropsWithChildren) => unknown;
13
13
  export declare const button: (props: PropsWithChildren) => unknown;