acrylblends 0.8.1 → 0.9.0
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.
- package/dist/index.d.ts +2 -0
- package/dist/index.js +83 -7
- package/dist/index.js.map +1 -1
- package/lib/audit-BXnYsLge.d.ts +58 -0
- package/lib/cell-ChU41DZD.d.ts +32 -0
- package/lib/client-modules-CLvWOjbd.js +267 -0
- package/lib/connection-ZLEso7XL.d.ts +25 -0
- package/lib/conninfo.d.ts +1 -23
- package/lib/cordis/db-sqlite.d.ts +56 -0
- package/lib/cordis/db-sqlite.js +58 -0
- package/lib/cordis/db.d.ts +8 -0
- package/lib/cordis/db.js +1 -0
- package/lib/cordis/door.d.ts +159 -0
- package/lib/cordis/door.js +757 -0
- package/lib/cordis/inspect.d.ts +77 -0
- package/lib/cordis/inspect.js +149 -0
- package/lib/cordis/kv-db.d.ts +16 -0
- package/lib/cordis/kv-db.js +18 -0
- package/lib/cordis/kv-json.d.ts +16 -0
- package/lib/cordis/kv-json.js +44 -0
- package/lib/cordis/kv.d.ts +8 -0
- package/lib/cordis/kv.js +1 -0
- package/lib/cordis/node-server.d.ts +45 -0
- package/lib/cordis/node-server.js +93 -0
- package/lib/cordis/router-http.d.ts +56 -0
- package/lib/cordis/router-http.js +117 -0
- package/lib/cordis/router.d.ts +8 -0
- package/lib/cordis/router.js +7 -0
- package/lib/cordis/state/react.d.ts +6 -0
- package/lib/cordis/state/react.js +11 -0
- package/lib/cordis/state.d.ts +33 -0
- package/lib/cordis/state.js +163 -0
- package/lib/core-CaY8XDZ6.js +19 -0
- package/lib/database-DBHdwefi.d.ts +44 -0
- package/lib/db/conformance.d.ts +11 -0
- package/lib/db/conformance.js +267 -0
- package/lib/db/sqlite.d.ts +1 -1
- package/lib/db/sqlite.js +1 -196
- package/lib/db.d.ts +2 -1
- package/lib/{src-0hI7M7cN.js → deprecated-BP4fPt38.js} +0 -17
- package/lib/door/host.d.ts +24 -0
- package/lib/door/host.js +2 -0
- package/lib/door/page.d.ts +105 -0
- package/lib/door/page.js +1030 -0
- package/lib/door/protocol.d.ts +2 -0
- package/lib/door/protocol.js +197 -0
- package/lib/error-t4N2js2I.d.ts +8 -0
- package/lib/etag-DaKMOjty.js +135 -0
- package/lib/etag.js +1 -134
- package/lib/helpers-CvTauQT5.js +5 -0
- package/lib/http-exception-kpGJkmpi.d.ts +57 -0
- package/lib/http-exception.d.ts +1 -56
- package/lib/{index-BLTYsyc1.d.ts → index-BnGgRKTv.d.ts} +3 -39
- package/lib/index-BqVQkTnu.d.ts +98 -0
- package/lib/index-Dmst2QCQ.d.ts +44 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/jwk-LkzeoaU8.js +117 -0
- package/lib/jwk.js +1 -116
- package/lib/jwt-CskdhEW9.js +115 -0
- package/lib/jwt.js +2 -114
- package/lib/kv/conformance.d.ts +13 -0
- package/lib/kv/conformance.js +301 -0
- package/lib/kv/db.d.ts +2 -2
- package/lib/kv/json.d.ts +1 -1
- package/lib/kv-9f-AlRKN.d.ts +39 -0
- package/lib/kv.d.ts +2 -1
- package/lib/language-D9a4zqvn.js +198 -0
- package/lib/language.js +1 -197
- package/lib/middleware-CPQ8himN.js +12 -0
- package/lib/node-server/serve-static.d.ts +0 -1
- package/lib/node-server/serve-static.js +1 -1
- package/lib/node-server.d.ts +1 -7
- package/lib/node-server.js +3 -1586
- package/lib/open-CMhnJODn.js +197 -0
- package/lib/protocol-BizVt4J6.d.ts +144 -0
- package/lib/request-id-CKVvHOO1.js +34 -0
- package/lib/request-id.js +1 -33
- package/lib/secure-headers-mP3j6Hm6.js +163 -0
- package/lib/secure-headers.js +1 -162
- package/lib/{serve-static-B849HlX2.js → serve-static-3uo_9rjF.js} +1 -4
- package/lib/server-DvgMGtzo.js +1323 -0
- package/lib/snapshot-text-D3NspDyT.js +338 -0
- package/lib/src-CwABFr6r.js +328 -0
- package/lib/timeout.d.ts +1 -1
- package/lib/timing-Cky7C1Jf.js +183 -0
- package/lib/timing.js +1 -182
- package/package.json +89 -1
- package/plugins/acryl-db/plugin.json +6 -1
- package/plugins/acryl-db-sqlite/plugin.json +4 -0
- package/plugins/acryl-db-sqlite/src/facade/node.ts +1 -1
- package/plugins/acryl-db-sqlite/src/index.ts +2 -2
- package/plugins/acryl-db-sqlite/src/open.ts +2 -2
- package/plugins/acryl-door/plugin.json +4 -1
- package/plugins/acryl-door/src/host/http.ts +2 -2
- package/plugins/acryl-door/src/host/mcp-routes.ts +1 -1
- package/plugins/acryl-door/src/host/operator-routes.ts +1 -1
- package/plugins/acryl-door/src/host/page-routes.ts +3 -3
- package/plugins/acryl-door/src/index.ts +2 -2
- package/plugins/acryl-inspect/plugin.json +4 -1
- package/plugins/acryl-inspect/src/service.ts +2 -2
- package/plugins/acryl-kv/plugin.json +6 -1
- package/plugins/acryl-kv-db/plugin.json +4 -0
- package/plugins/acryl-kv-db/src/index.ts +1 -1
- package/plugins/acryl-kv-db/src/open.ts +3 -3
- package/plugins/acryl-kv-json/plugin.json +4 -0
- package/plugins/acryl-kv-json/src/index.ts +1 -1
- package/plugins/acryl-kv-json/src/open.ts +2 -2
- package/plugins/acryl-node-server/plugin.json +5 -1
- package/plugins/acryl-node-server/src/adapter/conninfo.ts +1 -1
- package/plugins/acryl-node-server/src/adapter/early-hints.ts +1 -1
- package/plugins/acryl-node-server/src/adapter/serve-static.ts +2 -2
- package/plugins/acryl-node-server/src/adapter/websocket.ts +2 -2
- package/plugins/acryl-node-server/src/client-modules.ts +2 -2
- package/plugins/acryl-node-server/src/index.ts +1 -1
- package/plugins/acryl-router/plugin.json +11 -1
- package/plugins/acryl-router/src/connection.d.ts +25 -0
- package/plugins/acryl-router/src/core/app-base.d.ts +215 -0
- package/plugins/acryl-router/src/core/app.d.ts +19 -0
- package/plugins/acryl-router/src/core/client/client.d.ts +4 -0
- package/plugins/acryl-router/src/core/client/fetch-result-please.d.ts +35 -0
- package/plugins/acryl-router/src/core/client/index.d.ts +7 -0
- package/plugins/acryl-router/src/core/client/types.d.ts +229 -0
- package/plugins/acryl-router/src/core/client/utils.d.ts +18 -0
- package/plugins/acryl-router/src/core/compose.d.ts +14 -0
- package/plugins/acryl-router/src/core/context.d.ts +443 -0
- package/plugins/acryl-router/src/core/helper/accepts/accepts.d.ts +30 -0
- package/plugins/acryl-router/src/core/helper/accepts/index.d.ts +5 -0
- package/plugins/acryl-router/src/core/helper/conninfo/index.d.ts +5 -0
- package/plugins/acryl-router/src/core/helper/conninfo/types.d.ts +36 -0
- package/plugins/acryl-router/src/core/helper/cookie/index.d.ts +25 -0
- package/plugins/acryl-router/src/core/helper/css/common.d.ts +59 -0
- package/plugins/acryl-router/src/core/helper/css/index.d.ts +80 -0
- package/plugins/acryl-router/src/core/helper/dev/index.d.ts +20 -0
- package/plugins/acryl-router/src/core/helper/factory/index.d.ts +82 -0
- package/plugins/acryl-router/src/core/helper/html/index.d.ts +8 -0
- package/plugins/acryl-router/src/core/helper/proxy/index.d.ts +73 -0
- package/plugins/acryl-router/src/core/helper/route/index.d.ts +75 -0
- package/plugins/acryl-router/src/core/helper/ssg/index.d.ts +7 -0
- package/plugins/acryl-router/src/core/helper/ssg/middleware.d.ts +44 -0
- package/plugins/acryl-router/src/core/helper/ssg/plugins.d.ts +27 -0
- package/plugins/acryl-router/src/core/helper/ssg/ssg.d.ts +91 -0
- package/plugins/acryl-router/src/core/helper/ssg/utils.d.ts +16 -0
- package/plugins/acryl-router/src/core/helper/streaming/index.d.ts +8 -0
- package/plugins/acryl-router/src/core/helper/streaming/sse.d.ts +13 -0
- package/plugins/acryl-router/src/core/helper/streaming/stream.d.ts +3 -0
- package/plugins/acryl-router/src/core/helper/streaming/text.d.ts +3 -0
- package/plugins/acryl-router/src/core/helper/streaming/utils.d.ts +1 -0
- package/plugins/acryl-router/src/core/helper/testing/index.d.ts +13 -0
- package/plugins/acryl-router/src/core/helper/websocket/index.d.ts +70 -0
- package/plugins/acryl-router/src/core/http-exception.d.ts +58 -0
- package/plugins/acryl-router/src/core/index.d.ts +37 -0
- package/plugins/acryl-router/src/core/jsx/base.d.ts +61 -0
- package/plugins/acryl-router/src/core/jsx/children.d.ts +9 -0
- package/plugins/acryl-router/src/core/jsx/components.d.ts +15 -0
- package/plugins/acryl-router/src/core/jsx/constants.d.ts +6 -0
- package/plugins/acryl-router/src/core/jsx/context.d.ts +51 -0
- package/plugins/acryl-router/src/core/jsx/dom/components.d.ts +10 -0
- package/plugins/acryl-router/src/core/jsx/dom/context.d.ts +3 -0
- package/plugins/acryl-router/src/core/jsx/dom/css.d.ts +83 -0
- package/plugins/acryl-router/src/core/jsx/dom/hooks/index.d.ts +39 -0
- package/plugins/acryl-router/src/core/jsx/dom/intrinsic-element/components.d.ts +16 -0
- package/plugins/acryl-router/src/core/jsx/dom/jsx-dev-runtime.d.ts +8 -0
- package/plugins/acryl-router/src/core/jsx/dom/jsx-runtime.d.ts +7 -0
- package/plugins/acryl-router/src/core/jsx/dom/render.d.ts +73 -0
- package/plugins/acryl-router/src/core/jsx/dom/utils.d.ts +1 -0
- package/plugins/acryl-router/src/core/jsx/hooks/index.d.ts +47 -0
- package/plugins/acryl-router/src/core/jsx/index.d.ts +76 -0
- package/plugins/acryl-router/src/core/jsx/intrinsic-element/common.d.ts +6 -0
- package/plugins/acryl-router/src/core/jsx/intrinsic-element/components.d.ts +13 -0
- package/plugins/acryl-router/src/core/jsx/intrinsic-elements.d.ts +735 -0
- package/plugins/acryl-router/src/core/jsx/streaming.d.ts +36 -0
- package/plugins/acryl-router/src/core/jsx/types.d.ts +36 -0
- package/plugins/acryl-router/src/core/jsx/utils.d.ts +4 -0
- package/plugins/acryl-router/src/core/request/constants.d.ts +1 -0
- package/plugins/acryl-router/src/core/request.d.ts +306 -0
- package/plugins/acryl-router/src/core/router/reg-exp-router/index.d.ts +6 -0
- package/plugins/acryl-router/src/core/router/reg-exp-router/matcher.d.ts +7 -0
- package/plugins/acryl-router/src/core/router/reg-exp-router/node.d.ts +13 -0
- package/plugins/acryl-router/src/core/router/reg-exp-router/prepared-router.d.ts +17 -0
- package/plugins/acryl-router/src/core/router/reg-exp-router/router.d.ts +11 -0
- package/plugins/acryl-router/src/core/router/reg-exp-router/trie.d.ts +8 -0
- package/plugins/acryl-router/src/core/router/smart-router/index.d.ts +5 -0
- package/plugins/acryl-router/src/core/router/smart-router/router.d.ts +11 -0
- package/plugins/acryl-router/src/core/router/trie-router/index.d.ts +5 -0
- package/plugins/acryl-router/src/core/router/trie-router/node.d.ts +6 -0
- package/plugins/acryl-router/src/core/router/trie-router/router.d.ts +7 -0
- package/plugins/acryl-router/src/core/router/utils.d.ts +1 -0
- package/plugins/acryl-router/src/core/router.d.ts +97 -0
- package/plugins/acryl-router/src/core/types.d.ts +573 -0
- package/plugins/acryl-router/src/core/utils/accept.d.ts +6 -0
- package/plugins/acryl-router/src/core/utils/body.d.ts +79 -0
- package/plugins/acryl-router/src/core/utils/buffer.d.ts +17 -0
- package/plugins/acryl-router/src/core/utils/color.d.ts +21 -0
- package/plugins/acryl-router/src/core/utils/concurrent.d.ts +11 -0
- package/plugins/acryl-router/src/core/utils/constants.d.ts +4 -0
- package/plugins/acryl-router/src/core/utils/cookie.d.ts +41 -0
- package/plugins/acryl-router/src/core/utils/crypto.d.ts +15 -0
- package/plugins/acryl-router/src/core/utils/handler.d.ts +6 -0
- package/plugins/acryl-router/src/core/utils/headers.d.ts +8 -0
- package/plugins/acryl-router/src/core/utils/html.d.ts +44 -0
- package/plugins/acryl-router/src/core/utils/http-status.d.ts +32 -0
- package/plugins/acryl-router/src/core/utils/mime.d.ts +70 -0
- package/plugins/acryl-router/src/core/utils/stream.d.ts +31 -0
- package/plugins/acryl-router/src/core/utils/types.d.ts +128 -0
- package/plugins/acryl-router/src/core/utils/url.d.ts +44 -0
- package/plugins/acryl-router/src/core/validator/index.d.ts +7 -0
- package/plugins/acryl-router/src/core/validator/utils.d.ts +29 -0
- package/plugins/acryl-router/src/core/validator/validator.d.ts +16 -0
- package/plugins/acryl-router/src/helpers/index.d.ts +17 -0
- package/plugins/acryl-router/src/helpers/schema-validator.d.ts +54 -0
- package/plugins/acryl-router-http/plugin.json +4 -1
- package/plugins/acryl-router-http/src/index.ts +1 -1
- package/plugins/acryl-state/plugin.json +5 -1
- package/plugins/acryl-state/src/service.ts +3 -3
- package/plugins/tsconfig.json +32 -20
- package/docs/framework/UPSTREAM.md +0 -3
- package/docs/framework/upstream.json +0 -9
- package/lib/index-D4FAsBZu.d.ts +0 -85
- package/plugins/acryl-db/upstream.json +0 -18
- package/plugins/acryl-db-sqlite/upstream.json +0 -21
- package/plugins/acryl-door/upstream.json +0 -28
- package/plugins/acryl-inspect/upstream.json +0 -18
- package/plugins/acryl-kv/upstream.json +0 -18
- package/plugins/acryl-kv-db/upstream.json +0 -21
- package/plugins/acryl-kv-json/upstream.json +0 -22
- package/plugins/acryl-node-server/upstream.json +0 -21
- package/plugins/acryl-router/upstream.json +0 -20
- package/plugins/acryl-router-http/upstream.json +0 -22
- package/plugins/acryl-state/NOTICE +0 -30
- package/plugins/acryl-state/upstream.json +0 -22
- package/plugins/desktop/upstream.json +0 -12
- package/plugins/desktop-web/upstream.json +0 -12
- package/templates/todo/upstream.json +0 -12
- /package/lib/{index-CTy4N7ng.d.ts → deprecated-CTy4N7ng.d.ts} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
*
|
|
4
|
+
* Acryl - Web Framework built on Web Standards
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { Acryl } from 'acrylblends'
|
|
9
|
+
* const app = new Acryl()
|
|
10
|
+
*
|
|
11
|
+
* app.get('/', (c) => c.text('Acryl!'))
|
|
12
|
+
*
|
|
13
|
+
* export default app
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
import { Acryl } from './app.ts';
|
|
17
|
+
/**
|
|
18
|
+
* Types for environment variables, error handlers, handlers, middleware handlers, and more.
|
|
19
|
+
*/
|
|
20
|
+
export type { Env, ErrorHandler, Handler, MiddlewareHandler, Next, NotFoundResponse, NotFoundHandler, ValidationTargets, Input, Schema, ToSchema, TypedResponse, } from './types.ts';
|
|
21
|
+
/**
|
|
22
|
+
* Types for context, context variable map, context renderer, and execution context.
|
|
23
|
+
*/
|
|
24
|
+
export { Context } from './context.ts';
|
|
25
|
+
export type { ContextVariableMap, ContextRenderer, ExecutionContext } from './context.ts';
|
|
26
|
+
/**
|
|
27
|
+
* Type for AcrylRequest.
|
|
28
|
+
*/
|
|
29
|
+
export type { AcrylRequest } from './request.ts';
|
|
30
|
+
/**
|
|
31
|
+
* Types for inferring request and response types and client request options.
|
|
32
|
+
*/
|
|
33
|
+
export type { InferRequestType, InferResponseType, ClientRequestOptions } from './client/index.ts';
|
|
34
|
+
/**
|
|
35
|
+
* Acryl framework for building web applications.
|
|
36
|
+
*/
|
|
37
|
+
export { Acryl };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { HtmlEscaped, HtmlEscapedString, StringBufferWithCallbacks } from '../utils/html.ts';
|
|
2
|
+
import { DOM_MEMO } from './constants.ts';
|
|
3
|
+
import type { Context } from './context.ts';
|
|
4
|
+
import type { JSX as AcrylJSX } from './intrinsic-elements.ts';
|
|
5
|
+
export type Props = Record<string, any>;
|
|
6
|
+
type FunctionComponentResult = HtmlEscapedString | JSXNode | Child[] | Promise<HtmlEscapedString | JSXNode | Child[]> | null;
|
|
7
|
+
export type FC<P = Props> = {
|
|
8
|
+
(props: P): FunctionComponentResult;
|
|
9
|
+
defaultProps?: Partial<P> | undefined;
|
|
10
|
+
displayName?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
export type DOMAttributes = AcrylJSX.HTMLAttributes;
|
|
13
|
+
export declare namespace JSX {
|
|
14
|
+
type Element = HtmlEscapedString | Promise<HtmlEscapedString>;
|
|
15
|
+
type ElementType = string | ((props: never) => FunctionComponentResult);
|
|
16
|
+
interface ElementChildrenAttribute {
|
|
17
|
+
children: Child;
|
|
18
|
+
}
|
|
19
|
+
interface IntrinsicElements extends AcrylJSX.IntrinsicElements {
|
|
20
|
+
[tagName: string]: Props;
|
|
21
|
+
}
|
|
22
|
+
interface IntrinsicAttributes {
|
|
23
|
+
key?: string | number | bigint | null | undefined;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export declare const getNameSpaceContext: () => Context<string> | undefined;
|
|
27
|
+
export declare const booleanAttributes: string[];
|
|
28
|
+
export type Child = string | Promise<string> | number | JSXNode | null | undefined | boolean | Child[];
|
|
29
|
+
export declare const renderChildren: (children: Child[]) => HtmlEscapedString | Promise<HtmlEscapedString>;
|
|
30
|
+
export declare const isUntrustedObject: (value: unknown) => boolean;
|
|
31
|
+
export declare const renderUntrustedObject: (value: unknown) => HtmlEscapedString | Promise<HtmlEscapedString>;
|
|
32
|
+
export declare class JSXNode implements HtmlEscaped {
|
|
33
|
+
tag: string | Function;
|
|
34
|
+
props: Props;
|
|
35
|
+
key?: string;
|
|
36
|
+
children: Child[];
|
|
37
|
+
isEscaped: true;
|
|
38
|
+
constructor(tag: string | Function, props: Props, children: Child[]);
|
|
39
|
+
get type(): string | Function;
|
|
40
|
+
get ref(): any;
|
|
41
|
+
toString(): string | Promise<string>;
|
|
42
|
+
toStringToBuffer(buffer: StringBufferWithCallbacks): void;
|
|
43
|
+
}
|
|
44
|
+
export declare class JSXFragmentNode extends JSXNode {
|
|
45
|
+
toStringToBuffer(buffer: StringBufferWithCallbacks): void;
|
|
46
|
+
}
|
|
47
|
+
export declare const jsx: (tag: string | Function, props: Props | null, ...children: Child[]) => JSXNode;
|
|
48
|
+
export declare const jsxFn: (tag: string | Function, props: Props, children: Child[]) => JSXNode;
|
|
49
|
+
export declare const shallowEqual: (a: Props, b: Props) => boolean;
|
|
50
|
+
export type MemorableFC<T> = FC<T> & {
|
|
51
|
+
[DOM_MEMO]: (prevProps: Readonly<T>, nextProps: Readonly<T>) => boolean;
|
|
52
|
+
};
|
|
53
|
+
export declare const memo: <T>(component: FC<T>, propsAreEqual?: (prevProps: Readonly<T>, nextProps: Readonly<T>) => boolean) => FC<T>;
|
|
54
|
+
export declare const Fragment: ({ children, }: {
|
|
55
|
+
key?: string;
|
|
56
|
+
children?: Child | HtmlEscapedString;
|
|
57
|
+
}) => HtmlEscapedString;
|
|
58
|
+
export declare const isValidElement: (element: unknown) => element is JSXNode;
|
|
59
|
+
export declare const cloneElement: <T extends JSXNode | JSX.Element>(element: T, props: Partial<Props>, ...children: Child[]) => T;
|
|
60
|
+
export declare const reactAPICompatVersion = "19.0.0-acryl-jsx";
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Child } from './base.ts';
|
|
2
|
+
export declare const toArray: (children: Child) => Child[];
|
|
3
|
+
export declare const Children: {
|
|
4
|
+
map: (children: Child[], fn: (child: Child, index: number) => Child) => Child[];
|
|
5
|
+
forEach: (children: Child[], fn: (child: Child, index: number) => void) => void;
|
|
6
|
+
count: (children: Child[]) => number;
|
|
7
|
+
only: (_children: Child[]) => Child;
|
|
8
|
+
toArray: (children: Child) => Child[];
|
|
9
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HtmlEscapedString } from '../utils/html.ts';
|
|
2
|
+
import type { Child, FC, PropsWithChildren } from './index.ts';
|
|
3
|
+
export declare const childrenToString: (children: Child[]) => Promise<HtmlEscapedString[]>;
|
|
4
|
+
export type ErrorHandler = (error: Error) => void;
|
|
5
|
+
export type FallbackRender = (error: Error) => Child;
|
|
6
|
+
/**
|
|
7
|
+
* @experimental
|
|
8
|
+
* `ErrorBoundary` is an experimental feature.
|
|
9
|
+
* The API might be changed.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ErrorBoundary: FC<PropsWithChildren<{
|
|
12
|
+
fallback?: Child;
|
|
13
|
+
fallbackRender?: FallbackRender;
|
|
14
|
+
onError?: ErrorHandler;
|
|
15
|
+
}>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const DOM_RENDERER: unique symbol;
|
|
2
|
+
export declare const DOM_ERROR_HANDLER: unique symbol;
|
|
3
|
+
export declare const DOM_STASH: unique symbol;
|
|
4
|
+
export declare const DOM_INTERNAL_TAG: unique symbol;
|
|
5
|
+
export declare const DOM_MEMO: unique symbol;
|
|
6
|
+
export declare const PERMALINK: unique symbol;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { FC, PropsWithChildren } from './index.ts';
|
|
2
|
+
export interface Context<T> extends FC<PropsWithChildren<{
|
|
3
|
+
value: T;
|
|
4
|
+
}>> {
|
|
5
|
+
values: T[];
|
|
6
|
+
Provider: FC<PropsWithChildren<{
|
|
7
|
+
value: T;
|
|
8
|
+
}>>;
|
|
9
|
+
}
|
|
10
|
+
export declare const globalContexts: Context<unknown>[];
|
|
11
|
+
/** Per-render context store, isolated per request so values never leak across renders. */
|
|
12
|
+
type RenderStore = WeakMap<Context<unknown>, unknown[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Establish the request-scoped context store for a render.
|
|
15
|
+
*
|
|
16
|
+
* `resumeStore` continues a suspended subtree in the same store on the fallback
|
|
17
|
+
* path (ignored when `AsyncLocalStorage` is available, where isolation is
|
|
18
|
+
* automatic).
|
|
19
|
+
*
|
|
20
|
+
* Without `AsyncLocalStorage` a render can't be followed across `await`, so the
|
|
21
|
+
* store lives in `fallbackStore` only during synchronous work (mirroring
|
|
22
|
+
* React's request storage). Reading context after `await` then finds no store
|
|
23
|
+
* and falls back to the default value — never another request's value.
|
|
24
|
+
*/
|
|
25
|
+
export declare const runWithRenderContext: <T>(callback: () => T, resumeStore?: RenderStore) => T;
|
|
26
|
+
/**
|
|
27
|
+
* Capture the current render store and return a resumer that re-establishes it
|
|
28
|
+
* around a deferred continuation (e.g. a re-render after a suspended promise
|
|
29
|
+
* settles). Shared by every suspension point so none reimplements it.
|
|
30
|
+
*/
|
|
31
|
+
export declare const captureRenderContext: () => (<T>(callback: () => T) => T);
|
|
32
|
+
/**
|
|
33
|
+
* Create a context whose value can be provided with `<Context.Provider>` and
|
|
34
|
+
* read with {@link useContext}.
|
|
35
|
+
*
|
|
36
|
+
* Server-side renders are isolated per request, so a provided value never leaks
|
|
37
|
+
* into a concurrent request — even across `await` in an async component, when
|
|
38
|
+
* `AsyncLocalStorage` is available (Node.js >= 20.16, Deno, Bun, Cloudflare
|
|
39
|
+
* Workers with `nodejs_compat`). Without it, reading context after `await`
|
|
40
|
+
* returns the default value; synchronous components and `use()`-based
|
|
41
|
+
* suspension are unaffected.
|
|
42
|
+
*/
|
|
43
|
+
export declare const createContext: <T>(defaultValue: T) => Context<T>;
|
|
44
|
+
/**
|
|
45
|
+
* Read the current value of a context created with {@link createContext}.
|
|
46
|
+
*
|
|
47
|
+
* Safe to call from async components after `await`. See {@link createContext}
|
|
48
|
+
* for the per-runtime isolation guarantees.
|
|
49
|
+
*/
|
|
50
|
+
export declare const useContext: <T>(context: Context<T>) => T;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Child, FC, PropsWithChildren } from '../index.ts';
|
|
2
|
+
import type { ErrorHandler, FallbackRender } from '../components.ts';
|
|
3
|
+
export declare const ErrorBoundary: FC<PropsWithChildren<{
|
|
4
|
+
fallback?: Child;
|
|
5
|
+
fallbackRender?: FallbackRender;
|
|
6
|
+
onError?: ErrorHandler;
|
|
7
|
+
}>>;
|
|
8
|
+
export declare const Suspense: FC<PropsWithChildren<{
|
|
9
|
+
fallback: any;
|
|
10
|
+
}>>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
* This module provides APIs that enable `acryl-router/jsx/dom` to support.
|
|
4
|
+
*/
|
|
5
|
+
import type { FC, PropsWithChildren } from '../index.ts';
|
|
6
|
+
import type { ClassNameSlug, CssClassName, CssVariableType, OnInvalidSlug } from '../../helper/css/common.ts';
|
|
7
|
+
export { rawCssString } from '../../helper/css/common.ts';
|
|
8
|
+
interface CreateCssJsxDomObjectsType {
|
|
9
|
+
(args: {
|
|
10
|
+
id: Readonly<string>;
|
|
11
|
+
}): readonly [
|
|
12
|
+
{
|
|
13
|
+
toString(this: CssClassName): string;
|
|
14
|
+
},
|
|
15
|
+
FC<PropsWithChildren<void>>
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
export declare const createCssJsxDomObjects: CreateCssJsxDomObjectsType;
|
|
19
|
+
interface CssType {
|
|
20
|
+
(strings: TemplateStringsArray, ...values: CssVariableType[]): string;
|
|
21
|
+
}
|
|
22
|
+
interface CxType {
|
|
23
|
+
(...args: (string | boolean | null | undefined)[]): string;
|
|
24
|
+
}
|
|
25
|
+
interface KeyframesType {
|
|
26
|
+
(strings: TemplateStringsArray, ...values: CssVariableType[]): CssClassName;
|
|
27
|
+
}
|
|
28
|
+
interface ViewTransitionType {
|
|
29
|
+
(strings: TemplateStringsArray, ...values: CssVariableType[]): string;
|
|
30
|
+
(content: string): string;
|
|
31
|
+
(): string;
|
|
32
|
+
}
|
|
33
|
+
interface DefaultContextType {
|
|
34
|
+
css: CssType;
|
|
35
|
+
cx: CxType;
|
|
36
|
+
keyframes: KeyframesType;
|
|
37
|
+
viewTransition: ViewTransitionType;
|
|
38
|
+
Style: FC<PropsWithChildren<void>>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @experimental
|
|
42
|
+
* `createCssContext` is an experimental feature.
|
|
43
|
+
* The API might be changed.
|
|
44
|
+
*
|
|
45
|
+
* @param options.id - The ID for the style element
|
|
46
|
+
* @param options.classNameSlug - Optional function to customize generated CSS class names
|
|
47
|
+
* @param options.onInvalidSlug - Optional callback function called when an invalid slug is returned from ClassNameSlug
|
|
48
|
+
*/
|
|
49
|
+
export declare const createCssContext: ({ id, classNameSlug, onInvalidSlug, }: {
|
|
50
|
+
id: Readonly<string>;
|
|
51
|
+
classNameSlug?: ClassNameSlug;
|
|
52
|
+
onInvalidSlug?: OnInvalidSlug;
|
|
53
|
+
}) => DefaultContextType;
|
|
54
|
+
/**
|
|
55
|
+
* @experimental
|
|
56
|
+
* `css` is an experimental feature.
|
|
57
|
+
* The API might be changed.
|
|
58
|
+
*/
|
|
59
|
+
export declare const css: CssType;
|
|
60
|
+
/**
|
|
61
|
+
* @experimental
|
|
62
|
+
* `cx` is an experimental feature.
|
|
63
|
+
* The API might be changed.
|
|
64
|
+
*/
|
|
65
|
+
export declare const cx: CxType;
|
|
66
|
+
/**
|
|
67
|
+
* @experimental
|
|
68
|
+
* `keyframes` is an experimental feature.
|
|
69
|
+
* The API might be changed.
|
|
70
|
+
*/
|
|
71
|
+
export declare const keyframes: KeyframesType;
|
|
72
|
+
/**
|
|
73
|
+
* @experimental
|
|
74
|
+
* `viewTransition` is an experimental feature.
|
|
75
|
+
* The API might be changed.
|
|
76
|
+
*/
|
|
77
|
+
export declare const viewTransition: ViewTransitionType;
|
|
78
|
+
/**
|
|
79
|
+
* @experimental
|
|
80
|
+
* `Style` is an experimental feature.
|
|
81
|
+
* The API might be changed.
|
|
82
|
+
*/
|
|
83
|
+
export declare const Style: FC<PropsWithChildren<void>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provide hooks used only in jsx/dom
|
|
3
|
+
*/
|
|
4
|
+
import type { Context } from '../../context.ts';
|
|
5
|
+
type FormStatus = {
|
|
6
|
+
pending: false;
|
|
7
|
+
data: null;
|
|
8
|
+
method: null;
|
|
9
|
+
action: null;
|
|
10
|
+
} | {
|
|
11
|
+
pending: true;
|
|
12
|
+
data: FormData;
|
|
13
|
+
method: 'get' | 'post';
|
|
14
|
+
action: string | ((formData: FormData) => void | Promise<void>);
|
|
15
|
+
};
|
|
16
|
+
export declare const FormContext: Context<FormStatus>;
|
|
17
|
+
export declare const registerAction: (action: Promise<unknown>) => void;
|
|
18
|
+
/**
|
|
19
|
+
* This hook returns the current form status
|
|
20
|
+
* @returns FormStatus
|
|
21
|
+
*/
|
|
22
|
+
export declare const useFormStatus: () => FormStatus;
|
|
23
|
+
/**
|
|
24
|
+
* This hook returns the current state and a function to update the state optimistically
|
|
25
|
+
* The current state is updated optimistically and then reverted to the original state when all actions are resolved
|
|
26
|
+
* @param state
|
|
27
|
+
* @param updateState
|
|
28
|
+
* @returns [T, (action: N) => void]
|
|
29
|
+
*/
|
|
30
|
+
export declare const useOptimistic: <T, N>(state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void];
|
|
31
|
+
/**
|
|
32
|
+
* This hook returns the current state and a function to update the state by form action
|
|
33
|
+
* @param fn
|
|
34
|
+
* @param initialState
|
|
35
|
+
* @param permalink
|
|
36
|
+
* @returns [T, (data: FormData) => void]
|
|
37
|
+
*/
|
|
38
|
+
export declare const useActionState: <T>(fn: Function, initialState: T, permalink?: string) => [T, Function];
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IntrinsicElements } from '../../intrinsic-elements.ts';
|
|
2
|
+
import type { FC, PropsWithChildren, RefObject } from '../../types.ts';
|
|
3
|
+
export declare const clearCache: () => void;
|
|
4
|
+
export declare const composeRef: <T>(ref: RefObject<T | null> | Function | undefined, cb: (e: T) => void | (() => void)) => ((e: T) => () => void);
|
|
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']>>;
|
|
9
|
+
export declare const meta: FC<PropsWithChildren>;
|
|
10
|
+
export declare const form: FC<PropsWithChildren<{
|
|
11
|
+
action?: Function | string;
|
|
12
|
+
method?: 'get' | 'post';
|
|
13
|
+
ref?: RefObject<HTMLFormElement | null> | ((e: HTMLFormElement | null) => void | (() => void));
|
|
14
|
+
}>>;
|
|
15
|
+
export declare const input: FC<PropsWithChildren<IntrinsicElements['input']>>;
|
|
16
|
+
export declare const button: FC<PropsWithChildren<IntrinsicElements['button']>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
* This module provides the `acryl-router/jsx/dom` dev runtime.
|
|
4
|
+
*/
|
|
5
|
+
import type { JSXNode, Props } from '../base.ts';
|
|
6
|
+
export type { JSX } from '../base.ts';
|
|
7
|
+
export declare const jsxDEV: (tag: string | Function, props: Props, key?: string) => JSXNode;
|
|
8
|
+
export declare const Fragment: (props: Record<string, unknown>) => JSXNode;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Child, FC, JSXNode, Props } from '../base.ts';
|
|
2
|
+
import { DOM_RENDERER, DOM_STASH } from '../constants.ts';
|
|
3
|
+
import type { Context as JSXContext } from '../context.ts';
|
|
4
|
+
export type HasRenderToDom = FC<any> & {
|
|
5
|
+
[DOM_RENDERER]: FC<any>;
|
|
6
|
+
};
|
|
7
|
+
export type ErrorHandler = (error: any, retry: () => void) => Child | undefined;
|
|
8
|
+
type Container = HTMLElement | DocumentFragment;
|
|
9
|
+
type LocalJSXContexts = [JSXContext<unknown>, unknown][] | undefined;
|
|
10
|
+
type SupportedElement = HTMLElement | SVGElement | MathMLElement;
|
|
11
|
+
export type PreserveNodeType = 1 | 2;
|
|
12
|
+
export type NodeObject = {
|
|
13
|
+
pP: Props | undefined;
|
|
14
|
+
nN: Node | undefined;
|
|
15
|
+
vC: Node[];
|
|
16
|
+
pC?: Node[];
|
|
17
|
+
vR: Node[];
|
|
18
|
+
n?: string;
|
|
19
|
+
f?: boolean;
|
|
20
|
+
s?: boolean;
|
|
21
|
+
c: Container | undefined;
|
|
22
|
+
e: SupportedElement | Text | undefined;
|
|
23
|
+
p?: PreserveNodeType;
|
|
24
|
+
a?: boolean;
|
|
25
|
+
o?: NodeObject;
|
|
26
|
+
[DOM_STASH]: [
|
|
27
|
+
number,
|
|
28
|
+
any[][],
|
|
29
|
+
LocalJSXContexts,
|
|
30
|
+
[
|
|
31
|
+
Context,
|
|
32
|
+
Function,
|
|
33
|
+
NodeObject
|
|
34
|
+
]
|
|
35
|
+
] | [number, any[][]];
|
|
36
|
+
} & JSXNode;
|
|
37
|
+
type NodeString = {
|
|
38
|
+
t: string;
|
|
39
|
+
d: boolean;
|
|
40
|
+
s?: boolean;
|
|
41
|
+
} & {
|
|
42
|
+
e?: Text;
|
|
43
|
+
vC: undefined;
|
|
44
|
+
nN: undefined;
|
|
45
|
+
p?: true;
|
|
46
|
+
key: undefined;
|
|
47
|
+
tag: undefined;
|
|
48
|
+
};
|
|
49
|
+
export type Node = NodeString | NodeObject;
|
|
50
|
+
export type PendingType = 0 | 1 | 2;
|
|
51
|
+
export type UpdateHook = (context: Context, node: Node, cb: (context: Context) => void) => Promise<void>;
|
|
52
|
+
export type Context = [
|
|
53
|
+
PendingType,
|
|
54
|
+
boolean,
|
|
55
|
+
UpdateHook,
|
|
56
|
+
boolean,
|
|
57
|
+
boolean,
|
|
58
|
+
[
|
|
59
|
+
Context,
|
|
60
|
+
Function,
|
|
61
|
+
NodeObject
|
|
62
|
+
][]
|
|
63
|
+
] | [PendingType, boolean, UpdateHook, boolean] | [PendingType, boolean, UpdateHook] | [PendingType, boolean] | [PendingType] | [];
|
|
64
|
+
export declare const buildDataStack: [Context, Node][];
|
|
65
|
+
export declare const getNameSpaceContext: () => JSXContext<string> | undefined;
|
|
66
|
+
export declare const build: (context: Context, node: NodeObject, children?: Child[]) => void;
|
|
67
|
+
export declare const buildNode: (node: Child) => Node | undefined;
|
|
68
|
+
export declare const update: (context: Context, node: NodeObject) => Promise<NodeObject | undefined>;
|
|
69
|
+
export declare const renderNode: (node: NodeObject, container: Container) => void;
|
|
70
|
+
export declare const render: (jsxNode: Child, container: Container) => void;
|
|
71
|
+
export declare const flushSync: (callback: () => void) => void;
|
|
72
|
+
export declare const createPortal: (children: Child, container: HTMLElement, key?: string) => Child;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const setInternalTagFlag: (fn: Function) => Function;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { JSX } from '../base.ts';
|
|
2
|
+
type UpdateStateFunction<T> = (newState: T | ((currentState: T) => T)) => void;
|
|
3
|
+
export declare const STASH_EFFECT = 1;
|
|
4
|
+
export type EffectData = [
|
|
5
|
+
readonly unknown[] | undefined,
|
|
6
|
+
// deps
|
|
7
|
+
(() => void | (() => void)) | undefined,
|
|
8
|
+
// layout effect
|
|
9
|
+
(() => void) | undefined,
|
|
10
|
+
// cleanup
|
|
11
|
+
(() => void) | undefined,
|
|
12
|
+
// effect
|
|
13
|
+
(() => void) | undefined
|
|
14
|
+
];
|
|
15
|
+
export declare const startViewTransition: (callback: () => void) => void;
|
|
16
|
+
export declare const useViewTransition: () => [boolean, (callback: () => void) => void];
|
|
17
|
+
export declare const startTransition: (callback: () => void) => void;
|
|
18
|
+
export declare const useTransition: () => [boolean, (callback: () => void | Promise<void>) => void];
|
|
19
|
+
type UseDeferredValue = <T>(value: T, initialValue?: T) => T;
|
|
20
|
+
export declare const useDeferredValue: UseDeferredValue;
|
|
21
|
+
type UseStateType = {
|
|
22
|
+
<T>(initialState: T | (() => T)): [T, UpdateStateFunction<T>];
|
|
23
|
+
<T = undefined>(): [T | undefined, UpdateStateFunction<T | undefined>];
|
|
24
|
+
};
|
|
25
|
+
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];
|
|
27
|
+
export declare const useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
|
|
28
|
+
export declare const useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
|
|
29
|
+
export declare const useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
|
|
30
|
+
export declare const useCallback: <T extends Function>(callback: T, deps: readonly unknown[]) => T;
|
|
31
|
+
export type RefObject<T> = {
|
|
32
|
+
current: T;
|
|
33
|
+
};
|
|
34
|
+
export declare function useRef<T>(initialValue: T): RefObject<T>;
|
|
35
|
+
export declare function useRef<T>(initialValue: T | null): RefObject<T | null>;
|
|
36
|
+
export declare function useRef<T>(initialValue: T | undefined): RefObject<T | undefined>;
|
|
37
|
+
export declare const use: <T>(promise: Promise<T>) => T;
|
|
38
|
+
export declare const useMemo: <T>(factory: () => T, deps: readonly unknown[]) => T;
|
|
39
|
+
export declare const useId: () => string;
|
|
40
|
+
export declare const useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void;
|
|
41
|
+
export declare const createRef: <T>() => RefObject<T | null>;
|
|
42
|
+
export declare const forwardRef: <T, P = {}>(Component: (props: P, ref?: RefObject<T | null>) => JSX.Element) => ((props: P & {
|
|
43
|
+
ref?: RefObject<T | null>;
|
|
44
|
+
}) => JSX.Element);
|
|
45
|
+
export declare const useImperativeHandle: <T>(ref: RefObject<T | null>, createHandle: () => T, deps: readonly unknown[]) => void;
|
|
46
|
+
export declare const useSyncExternalStore: <T>(subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module
|
|
3
|
+
* JSX for Acryl.
|
|
4
|
+
*/
|
|
5
|
+
import { Fragment, cloneElement, isValidElement, jsx, memo, reactAPICompatVersion } from './base.ts';
|
|
6
|
+
import type { DOMAttributes } from './base.ts';
|
|
7
|
+
import { Children } from './children.ts';
|
|
8
|
+
import { ErrorBoundary } from './components.ts';
|
|
9
|
+
import { createContext, useContext } from './context.ts';
|
|
10
|
+
import { useActionState, useOptimistic } from './dom/hooks/index.ts';
|
|
11
|
+
import { createRef, forwardRef, startTransition, startViewTransition, use, useCallback, useDebugValue, useDeferredValue, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore, useTransition, useViewTransition } from './hooks/index.ts';
|
|
12
|
+
import { Suspense } from './streaming.ts';
|
|
13
|
+
export { reactAPICompatVersion as version, jsx, memo, Fragment, Fragment as StrictMode, isValidElement, jsx as createElement, cloneElement, ErrorBoundary, createContext, useContext, useState, useEffect, useRef, useCallback, useReducer, useId, useDebugValue, use, startTransition, useTransition, useDeferredValue, startViewTransition, useViewTransition, useMemo, useLayoutEffect, useInsertionEffect, createRef, forwardRef, useImperativeHandle, useSyncExternalStore, useActionState, useOptimistic, Suspense, Children, };
|
|
14
|
+
export type { DOMAttributes };
|
|
15
|
+
declare const _default: {
|
|
16
|
+
version: string;
|
|
17
|
+
memo: <T>(component: import("./base.ts").FC<T>, propsAreEqual?: (prevProps: Readonly<T>, nextProps: Readonly<T>) => boolean) => import("./base.ts").FC<T>;
|
|
18
|
+
Fragment: ({ children, }: {
|
|
19
|
+
key?: string;
|
|
20
|
+
children?: import("./base.ts").Child | import("../utils/html.ts").HtmlEscapedString;
|
|
21
|
+
}) => import("../utils/html.ts").HtmlEscapedString;
|
|
22
|
+
StrictMode: ({ children, }: {
|
|
23
|
+
key?: string;
|
|
24
|
+
children?: import("./base.ts").Child | import("../utils/html.ts").HtmlEscapedString;
|
|
25
|
+
}) => import("../utils/html.ts").HtmlEscapedString;
|
|
26
|
+
isValidElement: (element: unknown) => element is import("./base.ts").JSXNode;
|
|
27
|
+
createElement: (tag: string | Function, props: import("./base.ts").Props | null, ...children: import("./base.ts").Child[]) => import("./base.ts").JSXNode;
|
|
28
|
+
cloneElement: <T extends import("./base.ts").JSXNode | import("./base.ts").JSX.Element>(element: T, props: Partial<import("./base.ts").Props>, ...children: import("./base.ts").Child[]) => T;
|
|
29
|
+
ErrorBoundary: import("./base.ts").FC<import("./types.ts").PropsWithChildren<{
|
|
30
|
+
fallback?: import("./base.ts").Child;
|
|
31
|
+
fallbackRender?: import("./components.ts").FallbackRender;
|
|
32
|
+
onError?: import("./components.ts").ErrorHandler;
|
|
33
|
+
}>>;
|
|
34
|
+
createContext: <T>(defaultValue: T) => import("./context.ts").Context<T>;
|
|
35
|
+
useContext: <T>(context: import("./context.ts").Context<T>) => T;
|
|
36
|
+
useState: {
|
|
37
|
+
<T>(initialState: T | (() => T)): [T, (newState: T | ((currentState: T) => T)) => void];
|
|
38
|
+
<T = undefined>(): [T | undefined, (newState: T | ((currentState: T | undefined) => T | undefined) | undefined) => void];
|
|
39
|
+
};
|
|
40
|
+
useEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
|
|
41
|
+
useRef: typeof useRef;
|
|
42
|
+
useCallback: <T extends Function>(callback: T, deps: readonly unknown[]) => T;
|
|
43
|
+
useReducer: <T, A>(reducer: (state: T, action: A) => T, initialArg: T, init?: (initialState: T) => T) => [T, (action: A) => void];
|
|
44
|
+
useId: () => string;
|
|
45
|
+
useDebugValue: (_value: unknown, _formatter?: (value: unknown) => string) => void;
|
|
46
|
+
use: <T>(promise: Promise<T>) => T;
|
|
47
|
+
startTransition: (callback: () => void) => void;
|
|
48
|
+
useTransition: () => [boolean, (callback: () => void | Promise<void>) => void];
|
|
49
|
+
useDeferredValue: <T>(value: T, initialValue?: T) => T;
|
|
50
|
+
startViewTransition: (callback: () => void) => void;
|
|
51
|
+
useViewTransition: () => [boolean, (callback: () => void) => void];
|
|
52
|
+
useMemo: <T>(factory: () => T, deps: readonly unknown[]) => T;
|
|
53
|
+
useLayoutEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
|
|
54
|
+
useInsertionEffect: (effect: () => void | (() => void), deps?: readonly unknown[]) => void;
|
|
55
|
+
createRef: <T>() => import("./types.ts").RefObject<T | null>;
|
|
56
|
+
forwardRef: <T, P = {}>(Component: (props: P, ref?: import("./types.ts").RefObject<T | null>) => import("./base.ts").JSX.Element) => ((props: P & {
|
|
57
|
+
ref?: import("./types.ts").RefObject<T | null>;
|
|
58
|
+
}) => import("./base.ts").JSX.Element);
|
|
59
|
+
useImperativeHandle: <T>(ref: import("./types.ts").RefObject<T | null>, createHandle: () => T, deps: readonly unknown[]) => void;
|
|
60
|
+
useSyncExternalStore: <T>(subscribe: (callback: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T) => T;
|
|
61
|
+
useActionState: <T>(fn: Function, initialState: T, permalink?: string) => [T, Function];
|
|
62
|
+
useOptimistic: <T, N>(state: T, updateState: (currentState: T, action: N) => T) => [T, (action: N) => void];
|
|
63
|
+
Suspense: import("./base.ts").FC<import("./types.ts").PropsWithChildren<{
|
|
64
|
+
fallback: any;
|
|
65
|
+
}>>;
|
|
66
|
+
Children: {
|
|
67
|
+
map: (children: import("./base.ts").Child[], fn: (child: import("./base.ts").Child, index: number) => import("./base.ts").Child) => import("./base.ts").Child[];
|
|
68
|
+
forEach: (children: import("./base.ts").Child[], fn: (child: import("./base.ts").Child, index: number) => void) => void;
|
|
69
|
+
count: (children: import("./base.ts").Child[]) => number;
|
|
70
|
+
only: (_children: import("./base.ts").Child[]) => import("./base.ts").Child;
|
|
71
|
+
toArray: (children: import("./base.ts").Child) => import("./base.ts").Child[];
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export default _default;
|
|
75
|
+
export type * from './types.ts';
|
|
76
|
+
export type { JSX } from './intrinsic-elements.ts';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Props } from '../base.ts';
|
|
2
|
+
export declare const deDupeKeyMap: Record<string, string[]>;
|
|
3
|
+
export declare const domRenderers: Record<string, Function>;
|
|
4
|
+
export declare const dataPrecedenceAttr = "data-precedence";
|
|
5
|
+
export declare const isStylesheetLinkWithPrecedence: (props: Props) => boolean;
|
|
6
|
+
export declare const shouldDeDupeByKey: (tagName: string, supportSort: boolean) => boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IntrinsicElements } from '../intrinsic-elements.ts';
|
|
2
|
+
import type { FC, PropsWithChildren } from '../types.ts';
|
|
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']>>;
|
|
7
|
+
export declare const meta: FC<PropsWithChildren>;
|
|
8
|
+
export declare const form: FC<PropsWithChildren<{
|
|
9
|
+
action?: Function | string;
|
|
10
|
+
method?: 'get' | 'post';
|
|
11
|
+
}>>;
|
|
12
|
+
export declare const input: (props: PropsWithChildren) => unknown;
|
|
13
|
+
export declare const button: (props: PropsWithChildren) => unknown;
|