@expressive/react 0.72.0 → 0.72.1-canary.16

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 CHANGED
@@ -1,52 +1,66 @@
1
- import State__default, { Context, State } from '@expressive/mvc';
2
- export { Context, Observable, State, State as default, get, ref, set, use } from '@expressive/mvc';
3
- export { Pragma } from './adapter';
4
- import * as React from 'react';
5
- import { ReactNode } from 'react';
6
- export { Fragment, createElement } from 'react';
1
+ import { Pragma, ReactState } from "./state";
2
+ import State$1, { Context, Context as Context$1, Observable, get, ref, set, use } from "@expressive/state";
3
+ import * as react from "react";
4
+ import { Fragment, ReactNode, createElement } from "react";
7
5
 
8
- declare module '@expressive/mvc' {
9
- namespace Context {
10
- function use(create?: true): Context;
11
- function use(create: boolean): Context | null | undefined;
12
- }
6
+ //#region src/context.d.ts
7
+ declare module '@expressive/state' {
8
+ namespace Context {
9
+ function use(create?: true): Context$1;
10
+ function use(create: boolean): Context$1 | null | undefined;
11
+ }
13
12
  }
14
13
  declare namespace Consumer {
15
- type Props<T extends State__default> = {
16
- /** Type of controller to fetch from context. */
17
- for: State__default.Extends<T>;
18
- /**
19
- * Render function, will receive instance of desired controller.
20
- *
21
- * Called every render of parent component.
22
- * Similar to `State.get()`, updates to properties accessed in
23
- * this function will cause a refresh when they change.
24
- */
25
- children: (value: T) => ReactNode | void;
26
- };
14
+ type Props<T extends State$1> = {
15
+ /** Type of controller to fetch from context. */for: State$1.Extends<T>;
16
+ /**
17
+ * Render function, will receive instance of desired controller.
18
+ *
19
+ * Called every render of parent component.
20
+ * Similar to `State.get()`, updates to properties accessed in
21
+ * this function will cause a refresh when they change.
22
+ */
23
+ children: (value: T) => ReactNode | void;
24
+ };
27
25
  }
28
- declare function Consumer<T extends State__default>(props: Consumer.Props<T>): string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal | null;
26
+ declare function Consumer<T extends State$1>(props: Consumer.Props<T>): string | number | bigint | boolean | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal | null;
29
27
  declare namespace Provider {
30
- interface Props<T extends State__default> {
31
- /** State or group of States to provide to descendant Consumers. */
32
- for: Context.Accept<T>;
33
- /**
34
- * Callback to run for each provided State.
35
- */
36
- forEach?: Context.Expect<T>;
37
- /**
38
- * Children to render within this Provider.
39
- */
40
- children?: ReactNode;
41
- /** A fallback tree to show when suspended. */
42
- fallback?: ReactNode;
43
- /**
44
- * A name for this Suspense boundary for instrumentation purposes.
45
- * The name will help identify this boundary in React DevTools.
46
- */
47
- name?: string | undefined;
48
- }
28
+ interface Props<T extends State$1> {
29
+ /** State or group of States to provide to descendant Consumers. */
30
+ for: Context$1.Accept<T>;
31
+ /**
32
+ * Callback to run for each provided State.
33
+ */
34
+ forEach?: Context$1.Expect<T>;
35
+ /**
36
+ * Children to render within this Provider.
37
+ */
38
+ children?: ReactNode;
39
+ /** A fallback tree to show when suspended. */
40
+ fallback?: ReactNode;
41
+ /**
42
+ * A name for this Suspense boundary for instrumentation purposes.
43
+ * The name will help identify this boundary in React DevTools.
44
+ */
45
+ name?: string | undefined;
46
+ }
49
47
  }
50
- declare function Provider<T extends State__default>(props: Provider.Props<T>): ReactNode;
51
-
52
- export { Consumer, Provider };
48
+ declare function Provider<T extends State$1>(props: Provider.Props<T>): ReactNode;
49
+ //#endregion
50
+ //#region src/index.d.ts
51
+ /**
52
+ * Augmented State namespace to include ReactState hooks as static methods.
53
+ *
54
+ * This retroactively adds React support to agnostic State defined
55
+ * by component libraries which import `@expressive/state` directly.
56
+ */
57
+ declare module '@expressive/state' {
58
+ namespace State {
59
+ export import as = ReactState.as;
60
+ export import get = ReactState.get;
61
+ export import use = ReactState.use;
62
+ }
63
+ }
64
+ //#endregion
65
+ export { Consumer, Context, Fragment, Observable, Pragma, Provider, ReactState as State, ReactState as default, createElement, get, ref, set, use };
66
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,95 +1,70 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- Consumer: () => Consumer,
24
- Context: () => import_mvc2.Context,
25
- Fragment: () => import_react3.Fragment,
26
- Observable: () => import_mvc2.Observable,
27
- Pragma: () => import_adapter.Pragma,
28
- Provider: () => Provider,
29
- State: () => import_mvc2.State,
30
- createElement: () => import_react3.createElement,
31
- default: () => src_default,
32
- get: () => import_mvc2.get,
33
- ref: () => import_mvc2.ref,
34
- set: () => import_mvc2.set,
35
- use: () => import_mvc2.use
36
- });
37
- module.exports = __toCommonJS(src_exports);
38
- var import_mvc2 = require("@expressive/mvc");
39
- var import_react2 = require("react");
40
- var import_adapter = require("./adapter");
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_chunk = require('./chunk-BE-pF4vm.js');
3
+ const require_context = require('./context-DEag_HVs.js');
4
+ let _expressive_state = require("@expressive/state");
5
+ let react = require("react");
6
+ let src_state = require("./state");
41
7
 
42
- // src/context.ts
43
- var import_mvc = require("@expressive/mvc");
44
- var import_react = require("react");
45
- var Layers = (0, import_react.createContext)(new import_mvc.Context());
46
- import_mvc.Context.use = (create) => {
47
- const ambient = (0, import_react.useContext)(Layers);
48
- return create ? (0, import_react.useMemo)(() => ambient.push(), [ambient]) : ambient;
49
- };
50
- function Consumer(props) {
51
- return props.for.get((i) => props.children(i));
52
- }
53
- function Provider(props) {
54
- const context = import_mvc.Context.use(true);
55
- (0, import_react.useEffect)(() => () => context.pop(), [context]);
56
- context.use(props.for, (state) => {
57
- if (props.forEach) {
58
- const cleanup = props.forEach(state);
59
- if (cleanup) state.set(cleanup, null);
60
- }
61
- });
62
- return provide(context, props.children, props.fallback, props.name);
63
- }
64
- function provide(context, children, fallback, name) {
65
- if (fallback !== void 0)
66
- children = (0, import_react.createElement)(import_react.Suspense, { fallback, name }, children);
67
- return (0, import_react.createElement)(Layers.Provider, {
68
- key: context.id,
69
- value: context,
70
- children
71
- });
72
- }
8
+ //#region src/index.ts
9
+ src_state.Pragma.useEffect = react.useEffect;
10
+ src_state.Pragma.useState = react.useState;
11
+ src_state.Pragma.createElement = react.createElement;
12
+ _expressive_state.State.get = src_state.ReactState.get;
13
+ _expressive_state.State.use = src_state.ReactState.use;
14
+ _expressive_state.State.as = src_state.ReactState.as;
73
15
 
74
- // src/index.ts
75
- var import_react3 = require("react");
76
- import_adapter.Pragma.useEffect = import_react2.useEffect;
77
- import_adapter.Pragma.useState = import_react2.useState;
78
- import_adapter.Pragma.createElement = import_react2.createElement;
79
- var src_default = import_mvc2.State;
80
- // Annotate the CommonJS export names for ESM import in node:
81
- 0 && (module.exports = {
82
- Consumer,
83
- Context,
84
- Fragment,
85
- Observable,
86
- Pragma,
87
- Provider,
88
- State,
89
- createElement,
90
- get,
91
- ref,
92
- set,
93
- use
16
+ //#endregion
17
+ exports.Consumer = require_context.Consumer;
18
+ Object.defineProperty(exports, 'Context', {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _expressive_state.Context;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, 'Fragment', {
25
+ enumerable: true,
26
+ get: function () {
27
+ return react.Fragment;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, 'Observable', {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _expressive_state.Observable;
34
+ }
35
+ });
36
+ exports.Pragma = src_state.Pragma;
37
+ exports.Provider = require_context.Provider;
38
+ exports.State = src_state.ReactState;
39
+ exports.default = src_state.ReactState;
40
+ Object.defineProperty(exports, 'createElement', {
41
+ enumerable: true,
42
+ get: function () {
43
+ return react.createElement;
44
+ }
45
+ });
46
+ Object.defineProperty(exports, 'get', {
47
+ enumerable: true,
48
+ get: function () {
49
+ return _expressive_state.get;
50
+ }
51
+ });
52
+ Object.defineProperty(exports, 'ref', {
53
+ enumerable: true,
54
+ get: function () {
55
+ return _expressive_state.ref;
56
+ }
57
+ });
58
+ Object.defineProperty(exports, 'set', {
59
+ enumerable: true,
60
+ get: function () {
61
+ return _expressive_state.set;
62
+ }
63
+ });
64
+ Object.defineProperty(exports, 'use', {
65
+ enumerable: true,
66
+ get: function () {
67
+ return _expressive_state.use;
68
+ }
94
69
  });
95
70
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/context.ts"],"sourcesContent":["import {\n Context,\n Observable,\n State,\n get,\n use,\n ref,\n set\n} from '@expressive/mvc';\nimport { createElement, useEffect, useState } from 'react';\n\nimport { Pragma } from './adapter';\n\nPragma.useEffect = useEffect;\nPragma.useState = useState;\nPragma.createElement = createElement;\n\nexport default State;\nexport { Context, get, State, Observable, ref, set, use };\nexport { Consumer, Provider } from './context';\nexport { Fragment, createElement } from 'react';\nexport { Pragma };\n","import State, { Context } from '@expressive/mvc';\nimport {\n createContext,\n createElement,\n ReactNode,\n Suspense,\n useContext,\n useEffect,\n useMemo\n} from 'react';\n\nexport const Layers = createContext(new Context());\n\ndeclare module '@expressive/mvc' {\n namespace Context {\n function use(create?: true): Context;\n function use(create: boolean): Context | null | undefined;\n }\n}\n\nContext.use = (create?: boolean) => {\n const ambient = useContext(Layers);\n\n return create ? useMemo(() => ambient.push(), [ambient]) : ambient;\n};\n\ndeclare namespace Consumer {\n type Props<T extends State> = {\n /** Type of controller to fetch from context. */\n for: State.Extends<T>;\n\n /**\n * Render function, will receive instance of desired controller.\n *\n * Called every render of parent component.\n * Similar to `State.get()`, updates to properties accessed in\n * this function will cause a refresh when they change.\n */\n children: (value: T) => ReactNode | void;\n };\n}\n\nfunction Consumer<T extends State>(props: Consumer.Props<T>) {\n return props.for.get((i) => props.children(i));\n}\n\ndeclare namespace Provider {\n interface Props<T extends State> {\n /** State or group of States to provide to descendant Consumers. */\n for: Context.Accept<T>;\n\n /**\n * Callback to run for each provided State.\n */\n forEach?: Context.Expect<T>;\n\n /**\n * Children to render within this Provider.\n */\n children?: ReactNode;\n\n /** A fallback tree to show when suspended. */\n fallback?: ReactNode;\n\n /**\n * A name for this Suspense boundary for instrumentation purposes.\n * The name will help identify this boundary in React DevTools.\n */\n name?: string | undefined;\n }\n}\n\nfunction Provider<T extends State>(props: Provider.Props<T>) {\n const context = Context.use(true);\n\n useEffect(() => () => context.pop(), [context]);\n\n context.use(props.for, (state) => {\n if (props.forEach) {\n const cleanup = props.forEach(state);\n\n if (cleanup) state.set(cleanup, null);\n }\n });\n\n return provide(context, props.children, props.fallback, props.name);\n}\n\nfunction provide(\n context: Context,\n children: ReactNode,\n fallback?: ReactNode,\n name?: string | undefined\n): ReactNode {\n if (fallback !== undefined)\n children = createElement(Suspense, { fallback, name }, children);\n\n return createElement(Layers.Provider, {\n key: context.id,\n value: context,\n children\n });\n}\n\nexport { Consumer, Provider, provide };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAQO;AACP,IAAAC,gBAAmD;AAEnD,qBAAuB;;;ACXvB,iBAA+B;AAC/B,mBAQO;AAEA,IAAM,aAAS,4BAAc,IAAI,mBAAQ,CAAC;AASjD,mBAAQ,MAAM,CAAC,WAAqB;AAClC,QAAM,cAAU,yBAAW,MAAM;AAEjC,SAAO,aAAS,sBAAQ,MAAM,QAAQ,KAAK,GAAG,CAAC,OAAO,CAAC,IAAI;AAC7D;AAkBA,SAAS,SAA0B,OAA0B;AAC3D,SAAO,MAAM,IAAI,IAAI,CAAC,MAAM,MAAM,SAAS,CAAC,CAAC;AAC/C;AA4BA,SAAS,SAA0B,OAA0B;AAC3D,QAAM,UAAU,mBAAQ,IAAI,IAAI;AAEhC,8BAAU,MAAM,MAAM,QAAQ,IAAI,GAAG,CAAC,OAAO,CAAC;AAE9C,UAAQ,IAAI,MAAM,KAAK,CAAC,UAAU;AAChC,QAAI,MAAM,SAAS;AACjB,YAAM,UAAU,MAAM,QAAQ,KAAK;AAEnC,UAAI,QAAS,OAAM,IAAI,SAAS,IAAI;AAAA,IACtC;AAAA,EACF,CAAC;AAED,SAAO,QAAQ,SAAS,MAAM,UAAU,MAAM,UAAU,MAAM,IAAI;AACpE;AAEA,SAAS,QACP,SACA,UACA,UACA,MACW;AACX,MAAI,aAAa;AACf,mBAAW,4BAAc,uBAAU,EAAE,UAAU,KAAK,GAAG,QAAQ;AAEjE,aAAO,4BAAc,OAAO,UAAU;AAAA,IACpC,KAAK,QAAQ;AAAA,IACb,OAAO;AAAA,IACP;AAAA,EACF,CAAC;AACH;;;ADlFA,IAAAC,gBAAwC;AAPxC,sBAAO,YAAY;AACnB,sBAAO,WAAW;AAClB,sBAAO,gBAAgB;AAEvB,IAAO,cAAQ;","names":["import_mvc","import_react","import_react"]}
1
+ {"version":3,"file":"index.js","names":["useEffect","useState","createElement","ReactState"],"sources":["../src/index.ts"],"sourcesContent":["import { State } from '@expressive/state';\n\nimport { createElement, useEffect, useState } from 'react';\n\nimport { ReactState, Pragma } from './state';\n\nPragma.useEffect = useEffect;\nPragma.useState = useState;\nPragma.createElement = createElement;\n\n/**\n * Augmented State namespace to include ReactState hooks as static methods.\n *\n * This retroactively adds React support to agnostic State defined\n * by component libraries which import `@expressive/state` directly.\n */\ndeclare module '@expressive/state' {\n namespace State {\n export import as = ReactState.as;\n export import get = ReactState.get;\n export import use = ReactState.use;\n }\n}\n\nState.get = ReactState.get;\nState.use = ReactState.use;\nState.as = ReactState.as;\n\nexport { ReactState as State, ReactState as default };\nexport { Context, Observable, get, use, ref, set } from '@expressive/state';\nexport { Consumer, Provider } from './context';\nexport { Fragment, createElement } from 'react';\nexport { Pragma };\n"],"mappings":";;;;;;;;AAMA,iBAAO,YAAYA;AACnB,iBAAO,WAAWC;AAClB,iBAAO,gBAAgBC;AAgBvB,wBAAM,MAAMC,qBAAW;AACvB,wBAAM,MAAMA,qBAAW;AACvB,wBAAM,KAAKA,qBAAW"}
@@ -1,8 +1,10 @@
1
- import * as State from '@expressive/mvc';
2
- import * as React from 'react';
3
- export { Fragment } from 'react';
4
- export { JSX } from './jsx-runtime';
1
+ import * as _expressive_state0 from "@expressive/state";
2
+ import * as react from "react";
3
+ import { Fragment } from "react";
4
+ import { JSX } from "./jsx-runtime";
5
5
 
6
- declare const jsxDEV: (type: React.ElementType<any, keyof React.JSX.IntrinsicElements> | State.State.Class<State.State>, ...args: any[]) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
7
-
8
- export { jsxDEV };
6
+ //#region src/jsx-dev-runtime.d.ts
7
+ declare const jsxDEV: (type: react.ElementType<any, keyof react.JSX.IntrinsicElements> | _expressive_state0.State.Type<_expressive_state0.State>, ...args: any[]) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
8
+ //#endregion
9
+ export { Fragment, type JSX, jsxDEV };
10
+ //# sourceMappingURL=jsx-dev-runtime.d.ts.map
@@ -1,46 +1,19 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_chunk = require('./chunk-BE-pF4vm.js');
3
+ let react = require("react");
4
+ let react_jsx_dev_runtime = require("react/jsx-dev-runtime");
5
+ react_jsx_dev_runtime = require_chunk.__toESM(react_jsx_dev_runtime);
6
+ let src_jsx_runtime = require("./jsx-runtime");
29
7
 
30
- // src/jsx-dev-runtime.ts
31
- var jsx_dev_runtime_exports = {};
32
- __export(jsx_dev_runtime_exports, {
33
- Fragment: () => import_react.Fragment,
34
- jsxDEV: () => jsxDEV
35
- });
36
- module.exports = __toCommonJS(jsx_dev_runtime_exports);
37
- var import_jsx_dev_runtime = __toESM(require("react/jsx-dev-runtime"));
38
- var import_jsx_runtime = require("./jsx-runtime");
39
- var import_react = require("react");
40
- var jsxDEV = import_jsx_runtime.patch.bind(import_jsx_dev_runtime.default.jsxDEV);
41
- // Annotate the CommonJS export names for ESM import in node:
42
- 0 && (module.exports = {
43
- Fragment,
44
- jsxDEV
8
+ //#region src/jsx-dev-runtime.ts
9
+ const jsxDEV = src_jsx_runtime.patch.bind(react_jsx_dev_runtime.default.jsxDEV);
10
+
11
+ //#endregion
12
+ Object.defineProperty(exports, 'Fragment', {
13
+ enumerable: true,
14
+ get: function () {
15
+ return react.Fragment;
16
+ }
45
17
  });
18
+ exports.jsxDEV = jsxDEV;
46
19
  //# sourceMappingURL=jsx-dev-runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/jsx-dev-runtime.ts"],"sourcesContent":["import Runtime from 'react/jsx-dev-runtime';\n\nimport { patch } from './jsx-runtime';\n\nexport const jsxDEV = patch.bind(Runtime.jsxDEV);\n\nexport { type JSX } from './jsx-runtime';\nexport { Fragment } from 'react';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAoB;AAEpB,yBAAsB;AAKtB,mBAAyB;AAHlB,IAAM,SAAS,yBAAM,KAAK,uBAAAA,QAAQ,MAAM;","names":["Runtime"]}
1
+ {"version":3,"file":"jsx-dev-runtime.js","names":["patch","Runtime"],"sources":["../src/jsx-dev-runtime.ts"],"sourcesContent":["import Runtime from 'react/jsx-dev-runtime';\n\nimport { patch } from './jsx-runtime';\n\nexport const jsxDEV = patch.bind(Runtime.jsxDEV);\n\nexport { type JSX } from './jsx-runtime';\nexport { Fragment } from 'react';\n"],"mappings":";;;;;;;;AAIA,MAAa,SAASA,sBAAM,KAAKC,8BAAQ,OAAO"}
@@ -1,30 +1,43 @@
1
- import { State } from '@expressive/mvc';
2
- import React__default from 'react';
3
- export { Fragment } from 'react';
1
+ import { State } from "@expressive/state";
2
+ import React, { Fragment } from "react";
4
3
 
4
+ //#region src/jsx-runtime.d.ts
5
+ type Reserved = keyof State | 'render' | 'fallback';
6
+ type StateProps<T extends State> = { [K in Exclude<keyof T, Reserved>]?: T[K] };
7
+ type ComponentProps<T extends State> = StateProps<T> & {
8
+ is?: (instance: T) => void;
9
+ fallback?: React.ReactNode;
10
+ };
11
+ type ValidProps<T extends State> = StateProps<T> & {
12
+ is?: never;
13
+ get?: never;
14
+ set?: never;
15
+ };
16
+ interface AsComponent extends State {
17
+ render?(props: ValidProps<this>, self: this): React.ReactNode;
18
+ fallback?: React.ReactNode;
19
+ }
20
+ type Props<T extends State> = T extends {
21
+ render(props: infer P, self: any): any;
22
+ } ? ComponentProps<T> & Omit<P, keyof AsComponent> : ComponentProps<T> & {
23
+ children?: React.ReactNode;
24
+ };
5
25
  declare namespace JSX {
6
- type ElementType = State.Extends<State.AsComponent> | React__default.JSX.ElementType | ((props: {}, ref?: any) => void);
7
- type LibraryManagedAttributes<C, P> = C extends new (...args: any[]) => {
8
- props: infer U;
9
- } ? U : C extends State.Extends<infer U> ? State.Props<U> : React__default.JSX.LibraryManagedAttributes<C, P>;
10
- interface Element extends React__default.JSX.Element {
11
- }
12
- interface ElementClass extends React__default.JSX.ElementClass {
13
- }
14
- interface ElementAttributesProperty {
15
- }
16
- interface ElementChildrenAttribute extends React__default.JSX.ElementChildrenAttribute {
17
- }
18
- interface IntrinsicAttributes extends React__default.JSX.IntrinsicAttributes {
19
- }
20
- interface IntrinsicClassAttributes<T> extends React__default.JSX
21
- .IntrinsicClassAttributes<T> {
22
- }
23
- interface IntrinsicElements extends React__default.JSX.IntrinsicElements {
24
- }
26
+ type ElementType = State.Extends<AsComponent> | React.JSX.ElementType | ((props: {}, ref?: any) => void);
27
+ type LibraryManagedAttributes<C, P> = C extends (new (...args: any[]) => {
28
+ props: infer U;
29
+ }) ? U : C extends State.Extends<infer U> ? Props<U> : React.JSX.LibraryManagedAttributes<C, P>;
30
+ interface Element extends React.JSX.Element {}
31
+ interface ElementClass extends React.JSX.ElementClass {}
32
+ interface ElementAttributesProperty {}
33
+ interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
34
+ interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
35
+ interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
36
+ interface IntrinsicElements extends React.JSX.IntrinsicElements {}
25
37
  }
26
- declare function patch(this: (type: React__default.ElementType, ...args: any[]) => React__default.ReactElement, type: React__default.ElementType | State.Class, ...args: any[]): React__default.ReactElement;
27
- declare const jsx: (type: React__default.ElementType<any, keyof React__default.JSX.IntrinsicElements> | State.Class<State>, ...args: any[]) => React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>>;
28
- declare const jsxs: (type: React__default.ElementType<any, keyof React__default.JSX.IntrinsicElements> | State.Class<State>, ...args: any[]) => React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>>;
29
-
30
- export { JSX, jsx, jsxs, patch };
38
+ declare function patch(this: (type: React.ElementType, ...args: any[]) => React.ReactElement, type: React.ElementType | State.Type, ...args: any[]): React.ReactElement;
39
+ declare const jsx: (type: React.ElementType<any, keyof React.JSX.IntrinsicElements> | State.Type<State>, ...args: any[]) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
40
+ declare const jsxs: (type: React.ElementType<any, keyof React.JSX.IntrinsicElements> | State.Type<State>, ...args: any[]) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
41
+ //#endregion
42
+ export { Fragment, JSX, jsx, jsxs, patch };
43
+ //# sourceMappingURL=jsx-runtime.d.ts.map