ajo 0.1.16 → 0.1.18
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/html.cjs +1 -1
- package/dist/html.js +39 -32
- package/dist/index.cjs +1 -1
- package/dist/index.js +81 -66
- package/package.json +1 -1
- package/readme.md +6 -6
- package/types.ts +4 -2
package/dist/html.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const{assign
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const{create:p,assign:v,entries:g,hasOwn:x}=Object,{isArray:f,from:k}=Array,m="",c=e=>k(d(e)).join(""),d=function*(e){for(e of u(e))if(typeof e=="string")yield $(e);else{const{nodeName:t,skip:o,children:r=""}=e;let n="";for(const[l,i]of g(e))S.has(l)||l.startsWith("set:")||i==null||i===!1||(n+=i===!0?` ${l}`:` ${l}="${$(String(i))}"`);w.has(t)?yield`<${t}${n}>`:o?yield`<${t}${n}></${t}>`:(yield`<${t}${n}>`,typeof r=="string"&&r.startsWith(m)?yield r.slice(1):yield*d(r),yield`</${t}>`)}},u=function*(e,t={value:""},o=!0){for(e of f(e)?e:[e])if(!(e==null||typeof e=="boolean"))if(x(e,"nodeName")){const{value:r}=t,{nodeName:n}=e;if(r&&(yield r,t.value=""),typeof n=="function")if(n.constructor.name==="GeneratorFunction"){const l={},i=v({},n.attrs);for(const a in e){const y=e[a];a.startsWith("attr:")?i[a.slice(5)]=y:l[a]=y}i.nodeName=n.is??"div",i.children=N(n,l),yield i}else yield*u(n(e),t,!1);else yield e}else f(e)?yield*u(e,t,!1):t.value+=e;o&&t.value&&(yield t.value)},w=new Set("area,base,br,col,command,embed,hr,img,input,keygen,link,meta,param,source,track,wbr".split(",")),S=new Set("nodeName,key,skip,memo,ref,children".split(",")),$=e=>e.replace(/[&<>"']/g,t=>`&#${t.charCodeAt(0)};`);let s=null;const N=(e,t)=>{let o,r;try{const n=e.call(o={$args:t,$context:p(s?s.$context:null),render(){s!==o&&o.$next()},$next(){const l=s;s=o,r=c(n.next().value),s=l},$throw(l){r=c(n.throw(l).value)},$return(){n.return()}},t);o.$next()}catch(n){o.$throw(n)}finally{o.$return()}return m+r},b=(e,t=Symbol())=>function(o,r){return arguments.length===1?t in o.$context?o.$context[t]:e:o.$context[t]=r};exports.context=b;exports.html=d;exports.render=c;
|
package/dist/html.js
CHANGED
|
@@ -1,57 +1,64 @@
|
|
|
1
|
-
const { assign:
|
|
2
|
-
for (e of
|
|
3
|
-
if (typeof e == "string") yield
|
|
1
|
+
const { create: p, assign: v, entries: x, hasOwn: g } = Object, { isArray: d, from: k } = Array, f = "", y = (e) => k(m(e)).join(""), m = function* (e) {
|
|
2
|
+
for (e of c(e))
|
|
3
|
+
if (typeof e == "string") yield $(e);
|
|
4
4
|
else {
|
|
5
|
-
const { nodeName: t, skip:
|
|
5
|
+
const { nodeName: t, skip: o, children: r = "" } = e;
|
|
6
6
|
let n = "";
|
|
7
|
-
for (const [i,
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
for (const [i, l] of x(e))
|
|
8
|
+
N.has(i) || i.startsWith("set:") || l == null || l === !1 || (n += l === !0 ? ` ${i}` : ` ${i}="${$(String(l))}"`);
|
|
9
|
+
w.has(t) ? yield `<${t}${n}>` : o ? yield `<${t}${n}></${t}>` : (yield `<${t}${n}>`, typeof r == "string" && r.startsWith(f) ? yield r.slice(1) : yield* m(r), yield `</${t}>`);
|
|
10
10
|
}
|
|
11
|
-
},
|
|
11
|
+
}, c = function* (e, t = { value: "" }, o = !0) {
|
|
12
12
|
for (e of d(e) ? e : [e])
|
|
13
13
|
if (!(e == null || typeof e == "boolean"))
|
|
14
|
-
if (
|
|
15
|
-
const { value:
|
|
16
|
-
if (
|
|
17
|
-
if (
|
|
18
|
-
const i = {},
|
|
19
|
-
for (const
|
|
20
|
-
const
|
|
21
|
-
|
|
14
|
+
if (g(e, "nodeName")) {
|
|
15
|
+
const { value: r } = t, { nodeName: n } = e;
|
|
16
|
+
if (r && (yield r, t.value = ""), typeof n == "function")
|
|
17
|
+
if (n.constructor.name === "GeneratorFunction") {
|
|
18
|
+
const i = {}, l = v({}, n.attrs);
|
|
19
|
+
for (const a in e) {
|
|
20
|
+
const u = e[a];
|
|
21
|
+
a.startsWith("attr:") ? l[a.slice(5)] = u : i[a] = u;
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
} else
|
|
23
|
+
l.nodeName = n.is ?? "div", l.children = S(n, i), yield l;
|
|
24
|
+
} else yield* c(n(e), t, !1);
|
|
25
25
|
else yield e;
|
|
26
|
-
} else d(e) ? yield*
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
26
|
+
} else d(e) ? yield* c(e, t, !1) : t.value += e;
|
|
27
|
+
o && t.value && (yield t.value);
|
|
28
|
+
}, w = new Set("area,base,br,col,command,embed,hr,img,input,keygen,link,meta,param,source,track,wbr".split(",")), N = new Set("nodeName,key,skip,memo,ref,children".split(",")), $ = (e) => e.replace(/[&<>"']/g, (t) => `&#${t.charCodeAt(0)};`);
|
|
29
|
+
let s = null;
|
|
30
|
+
const S = (e, t) => {
|
|
31
|
+
let o, r;
|
|
30
32
|
try {
|
|
31
|
-
const n = e.call(
|
|
33
|
+
const n = e.call(o = {
|
|
32
34
|
$args: t,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
$context: p(s ? s.$context : null),
|
|
36
|
+
render() {
|
|
37
|
+
s !== o && o.$next();
|
|
35
38
|
},
|
|
36
39
|
$next() {
|
|
37
|
-
|
|
40
|
+
const i = s;
|
|
41
|
+
s = o, r = y(n.next().value), s = i;
|
|
38
42
|
},
|
|
39
43
|
$throw(i) {
|
|
40
|
-
|
|
44
|
+
r = y(n.throw(i).value);
|
|
41
45
|
},
|
|
42
46
|
$return() {
|
|
43
47
|
n.return();
|
|
44
48
|
}
|
|
45
49
|
}, t);
|
|
46
|
-
|
|
50
|
+
o.$next();
|
|
47
51
|
} catch (n) {
|
|
48
|
-
|
|
52
|
+
o.$throw(n);
|
|
49
53
|
} finally {
|
|
50
|
-
|
|
54
|
+
o.$return();
|
|
51
55
|
}
|
|
52
|
-
return
|
|
56
|
+
return f + r;
|
|
57
|
+
}, A = (e, t = Symbol()) => function(o, r) {
|
|
58
|
+
return arguments.length === 1 ? t in o.$context ? o.$context[t] : e : o.$context[t] = r;
|
|
53
59
|
};
|
|
54
60
|
export {
|
|
55
|
-
|
|
61
|
+
A as context,
|
|
62
|
+
m as html,
|
|
56
63
|
y as render
|
|
57
64
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=({children:i})=>i,b=function(i,e){const{length:t}=arguments;return(e??(e=v(null))).nodeName=i,"children"in e||t<3||(e.children=t===3?arguments[2]:O.call(arguments,2)),e},y=(i,e)=>{let t=e.firstChild;for(i of g(i)){let n=t;if(typeof i=="string"){for(;n&&n.nodeType!=3;)n=n.nextSibling;n?n.data!=i&&(n.data=i):n=document.createTextNode(i)}else{const{nodeName:o,key:a,skip:c,memo:s,ref:f,children:N}=i;for(;n&&!(n.localName===o&&(n.$key??(n.$key=a))==a);)n=n.nextSibling;if(n??(n=d(document.createElementNS(i.xmlns??o==="svg"?T:e.namespaceURI,o),{$key:a})),s==null||F(n.$memo,n.$memo=s)){const{$props:m}=n,x={};for(const l of w(d({},m,i))){if(C.has(l))continue;const u=x[l]=i[l];u!==(m==null?void 0:m[l])&&(l.startsWith("set:")?n[l.slice(4)]=u:u==null||u===!1?n.removeAttribute(l):n.setAttribute(l,u===!0?"":u))}n.$props=x,c||y(N,n),typeof f=="function"&&(n.$ref=f)(n)}}n===t?t=t.nextSibling:B(e,n,t)}for(;t;){const n=t.nextSibling;t.nodeType===1&&S(t),e.removeChild(t),t=n}},{isArray:$,prototype:{slice:O}}=Array,{create:v,keys:w,assign:d,hasOwn:A,setPrototypeOf:p,getPrototypeOf:h}=Object,T="http://www.w3.org/2000/svg",C=new Set("nodeName,key,skip,memo,ref,children".split(",")),F=(i,e)=>$(i)&&$(e)?i.some((t,n)=>t!==e[n]):i!==e,g=function*(i,e={value:""},t=!0){for(i of $(i)?i:[i])if(!(i==null||typeof i=="boolean"))if(A(i,"nodeName")){const{value:n}=e,{nodeName:o}=i;if(n&&(yield n,e.value=""),typeof o=="function")if(o.constructor.name==="GeneratorFunction"){const a={},c=d({},o.attrs);for(const s of w(i)){const f=i[s];s.startsWith("attr:")?c[s.slice(5)]=f:s==="key"||s==="memo"?c[s]=f:a[s]=f}c.nodeName=o.is??"div",c.skip=!0,c.ref=P.bind(null,o,a),yield c}else yield*g(o(i),e,!1);else yield i}else $(i)?yield*g(i,e,!1):e.value+=i;t&&e.value&&(yield e.value)},P=(i,e,t)=>{if(!t)return;t.$gen??(t.$gen=(new E(t),i)),t.$ref=j.bind(null,t);const{skip:n,...o}=e;d(t.$args??(t.$args={}),o),n||t.$next()},j=(i,e)=>e??i.$return(),B=(i,e,t)=>{if(e.contains(document.activeElement)){const n=e.nextSibling;for(;t&&t!=e;){const o=t.nextSibling;i.insertBefore(t,n),t=o}}else i.insertBefore(e,t)},S=i=>{for(const t of i.children)S(t);const{$ref:e}=i;typeof e=="function"&&e(null)};let r=null;class E{constructor(e){p(e,p(h(this),h(e))),e.$context=v((r==null?void 0:r.$context)??null)}render(){r!=null&&r.contains(this)||this.$next()}$next(){const e=r;r=this;try{y((this.$it??(this.$it=this.$gen.call(this,this.$args))).next().value,this),typeof this.$ref=="function"&&this.$ref(this)}catch(t){this.$throw(t)}finally{r=e}}$throw(e){var t;for(let n=this;n;n=n.parentNode)if(typeof((t=n.$it)==null?void 0:t.throw)=="function")try{return y(n.$it.throw(e).value,n)}catch{}throw e}$return(){var e;try{(e=this.$it)==null||e.return()}catch(t){this.$throw(t)}finally{this.$it=null}}}const W=(i,e=Symbol())=>function(t,n){return arguments.length===1?e in t.$context?t.$context[e]:i:t.$context[e]=n};exports.Fragment=k;exports.context=W;exports.h=b;exports.render=y;
|
package/dist/index.js
CHANGED
|
@@ -1,96 +1,111 @@
|
|
|
1
|
-
const
|
|
2
|
-
const { length:
|
|
3
|
-
return (
|
|
4
|
-
}, d = (
|
|
5
|
-
let
|
|
6
|
-
for (
|
|
7
|
-
let
|
|
8
|
-
if (typeof
|
|
9
|
-
for (;
|
|
10
|
-
|
|
1
|
+
const P = ({ children: i }) => i, W = function(i, e) {
|
|
2
|
+
const { length: t } = arguments;
|
|
3
|
+
return (e ?? (e = v(null))).nodeName = i, "children" in e || t < 3 || (e.children = t === 3 ? arguments[2] : S.call(arguments, 2)), e;
|
|
4
|
+
}, d = (i, e) => {
|
|
5
|
+
let t = e.firstChild;
|
|
6
|
+
for (i of g(i)) {
|
|
7
|
+
let n = t;
|
|
8
|
+
if (typeof i == "string") {
|
|
9
|
+
for (; n && n.nodeType != 3; ) n = n.nextSibling;
|
|
10
|
+
n ? n.data != i && (n.data = i) : n = document.createTextNode(i);
|
|
11
11
|
} else {
|
|
12
|
-
const { nodeName: o, key: a, skip:
|
|
13
|
-
for (;
|
|
14
|
-
if (
|
|
15
|
-
const { $props:
|
|
16
|
-
for (const
|
|
17
|
-
if (
|
|
18
|
-
const
|
|
19
|
-
|
|
12
|
+
const { nodeName: o, key: a, skip: c, memo: s, ref: f, children: k } = i;
|
|
13
|
+
for (; n && !(n.localName === o && (n.$key ?? (n.$key = a)) == a); ) n = n.nextSibling;
|
|
14
|
+
if (n ?? (n = $(document.createElementNS(i.xmlns ?? o === "svg" ? A : e.namespaceURI, o), { $key: a })), s == null || C(n.$memo, n.$memo = s)) {
|
|
15
|
+
const { $props: m } = n, x = {};
|
|
16
|
+
for (const l of w($({}, m, i))) {
|
|
17
|
+
if (O.has(l)) continue;
|
|
18
|
+
const u = x[l] = i[l];
|
|
19
|
+
u !== (m == null ? void 0 : m[l]) && (l.startsWith("set:") ? n[l.slice(4)] = u : u == null || u === !1 ? n.removeAttribute(l) : n.setAttribute(l, u === !0 ? "" : u));
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
n.$props = x, c || d(k, n), typeof f == "function" && (n.$ref = f)(n);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
n === t ? t = t.nextSibling : E(e, n, t);
|
|
25
25
|
}
|
|
26
|
-
for (;
|
|
27
|
-
const
|
|
28
|
-
|
|
26
|
+
for (; t; ) {
|
|
27
|
+
const n = t.nextSibling;
|
|
28
|
+
t.nodeType === 1 && N(t), e.removeChild(t), t = n;
|
|
29
29
|
}
|
|
30
|
-
}, { isArray:
|
|
31
|
-
for (
|
|
32
|
-
if (!(
|
|
33
|
-
if (
|
|
34
|
-
const { value:
|
|
35
|
-
if (
|
|
36
|
-
if (
|
|
37
|
-
const a = {},
|
|
38
|
-
for (const s of w(
|
|
39
|
-
const
|
|
40
|
-
s.startsWith("attr:") ?
|
|
30
|
+
}, { isArray: y, prototype: { slice: S } } = Array, { create: v, keys: w, assign: $, hasOwn: b, setPrototypeOf: p, getPrototypeOf: h } = Object, A = "http://www.w3.org/2000/svg", O = new Set("nodeName,key,skip,memo,ref,children".split(",")), C = (i, e) => y(i) && y(e) ? i.some((t, n) => t !== e[n]) : i !== e, g = function* (i, e = { value: "" }, t = !0) {
|
|
31
|
+
for (i of y(i) ? i : [i])
|
|
32
|
+
if (!(i == null || typeof i == "boolean"))
|
|
33
|
+
if (b(i, "nodeName")) {
|
|
34
|
+
const { value: n } = e, { nodeName: o } = i;
|
|
35
|
+
if (n && (yield n, e.value = ""), typeof o == "function")
|
|
36
|
+
if (o.constructor.name === "GeneratorFunction") {
|
|
37
|
+
const a = {}, c = $({}, o.attrs);
|
|
38
|
+
for (const s of w(i)) {
|
|
39
|
+
const f = i[s];
|
|
40
|
+
s.startsWith("attr:") ? c[s.slice(5)] = f : s === "key" || s === "memo" ? c[s] = f : a[s] = f;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
} else yield*
|
|
44
|
-
else yield
|
|
45
|
-
} else
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
c.nodeName = o.is ?? "div", c.skip = !0, c.ref = T.bind(null, o, a), yield c;
|
|
43
|
+
} else yield* g(o(i), e, !1);
|
|
44
|
+
else yield i;
|
|
45
|
+
} else y(i) ? yield* g(i, e, !1) : e.value += i;
|
|
46
|
+
t && e.value && (yield e.value);
|
|
47
|
+
}, T = (i, e, t) => {
|
|
48
|
+
if (!t) return;
|
|
49
|
+
t.$gen ?? (t.$gen = (new F(t), i)), t.$ref = B.bind(null, t);
|
|
50
|
+
const { skip: n, ...o } = e;
|
|
51
|
+
$(t.$args ?? (t.$args = {}), o), n || t.$next();
|
|
52
|
+
}, B = (i, e) => e ?? i.$return(), E = (i, e, t) => {
|
|
53
|
+
if (e.contains(document.activeElement)) {
|
|
54
|
+
const n = e.nextSibling;
|
|
55
|
+
for (; t && t != e; ) {
|
|
56
|
+
const o = t.nextSibling;
|
|
57
|
+
i.insertBefore(t, n), t = o;
|
|
55
58
|
}
|
|
56
|
-
} else
|
|
57
|
-
},
|
|
58
|
-
for (const
|
|
59
|
-
const { $ref:
|
|
60
|
-
typeof
|
|
59
|
+
} else i.insertBefore(e, t);
|
|
60
|
+
}, N = (i) => {
|
|
61
|
+
for (const t of i.children) N(t);
|
|
62
|
+
const { $ref: e } = i;
|
|
63
|
+
typeof e == "function" && e(null);
|
|
61
64
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
let r = null;
|
|
66
|
+
class F {
|
|
67
|
+
constructor(e) {
|
|
68
|
+
p(e, p(h(this), h(e))), e.$context = v((r == null ? void 0 : r.$context) ?? null);
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
r != null && r.contains(this) || this.$next();
|
|
65
72
|
}
|
|
66
73
|
$next() {
|
|
74
|
+
const e = r;
|
|
75
|
+
r = this;
|
|
67
76
|
try {
|
|
68
77
|
d((this.$it ?? (this.$it = this.$gen.call(this, this.$args))).next().value, this), typeof this.$ref == "function" && this.$ref(this);
|
|
69
78
|
} catch (t) {
|
|
70
79
|
this.$throw(t);
|
|
80
|
+
} finally {
|
|
81
|
+
r = e;
|
|
71
82
|
}
|
|
72
83
|
}
|
|
73
|
-
$throw(
|
|
74
|
-
var
|
|
75
|
-
for (let
|
|
76
|
-
return d(
|
|
84
|
+
$throw(e) {
|
|
85
|
+
var t;
|
|
86
|
+
for (let n = this; n; n = n.parentNode) if (typeof ((t = n.$it) == null ? void 0 : t.throw) == "function") try {
|
|
87
|
+
return d(n.$it.throw(e).value, n);
|
|
77
88
|
} catch {
|
|
78
89
|
}
|
|
79
|
-
throw
|
|
90
|
+
throw e;
|
|
80
91
|
}
|
|
81
92
|
$return() {
|
|
82
|
-
var
|
|
93
|
+
var e;
|
|
83
94
|
try {
|
|
84
|
-
(
|
|
85
|
-
} catch (
|
|
86
|
-
this.$throw(
|
|
95
|
+
(e = this.$it) == null || e.return();
|
|
96
|
+
} catch (t) {
|
|
97
|
+
this.$throw(t);
|
|
87
98
|
} finally {
|
|
88
99
|
this.$it = null;
|
|
89
100
|
}
|
|
90
101
|
}
|
|
91
102
|
}
|
|
103
|
+
const j = (i, e = Symbol()) => function(t, n) {
|
|
104
|
+
return arguments.length === 1 ? e in t.$context ? t.$context[e] : i : t.$context[e] = n;
|
|
105
|
+
};
|
|
92
106
|
export {
|
|
93
|
-
|
|
94
|
-
|
|
107
|
+
P as Fragment,
|
|
108
|
+
j as context,
|
|
109
|
+
W as h,
|
|
95
110
|
d as render
|
|
96
111
|
};
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -68,7 +68,7 @@ function* Counter() {
|
|
|
68
68
|
|
|
69
69
|
const handleClick = () => {
|
|
70
70
|
count++
|
|
71
|
-
this
|
|
71
|
+
this.render()
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
while (true) yield (
|
|
@@ -264,7 +264,7 @@ function* ChatComponent(props) {
|
|
|
264
264
|
|
|
265
265
|
message = event.target.value
|
|
266
266
|
|
|
267
|
-
this
|
|
267
|
+
this.render()
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
const send = () => {
|
|
@@ -275,13 +275,13 @@ function* ChatComponent(props) {
|
|
|
275
275
|
|
|
276
276
|
message = ''
|
|
277
277
|
|
|
278
|
-
this
|
|
278
|
+
this.render()
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
const handleConnectionOpen = () => {
|
|
283
283
|
connected = true
|
|
284
|
-
this
|
|
284
|
+
this.render()
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
const handleConnectionError = error => {
|
|
@@ -549,7 +549,7 @@ function* MultiStepForm({ initialData }) {
|
|
|
549
549
|
currentStep++
|
|
550
550
|
|
|
551
551
|
// Re-render with the next step
|
|
552
|
-
this
|
|
552
|
+
this.render()
|
|
553
553
|
}
|
|
554
554
|
|
|
555
555
|
const handleRestart = () => {
|
|
@@ -558,7 +558,7 @@ function* MultiStepForm({ initialData }) {
|
|
|
558
558
|
this.$return()
|
|
559
559
|
|
|
560
560
|
// Re-render the component in its initial state
|
|
561
|
-
this
|
|
561
|
+
this.render()
|
|
562
562
|
}
|
|
563
563
|
|
|
564
564
|
while (true) {
|
package/types.ts
CHANGED
|
@@ -32,11 +32,12 @@ declare module 'ajo' {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
type Context<TArguments = Props> = {
|
|
35
|
-
$args: TArguments
|
|
35
|
+
$args: TArguments,
|
|
36
|
+
$context: { [key: symbol]: unknown },
|
|
37
|
+
render: () => void,
|
|
36
38
|
$next: () => void
|
|
37
39
|
$throw: (value?: unknown) => void
|
|
38
40
|
$return: () => void
|
|
39
|
-
[Symbol.iterator]: () => Iterator<TArguments, unknown, unknown>
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
type Function<TArguments = Props> = (args: TArguments) => Children
|
|
@@ -68,6 +69,7 @@ declare module 'ajo' {
|
|
|
68
69
|
function Fragment({ children }: ElementChildrenAttribute): typeof children
|
|
69
70
|
function h<TTag extends Tag>(tag: TTag, props?: TagProps<TTag> | null, ...children: Array<unknown>): AjoNode<TTag>
|
|
70
71
|
function render(h: Children, el: Element): void
|
|
72
|
+
function context<T>(fallback?: T): { (el: ThisParameterType<Component<unknown, Tag>>, value?: T): T }
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
declare namespace JSX {
|