@alloy-js/json 0.7.0 → 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/CHANGELOG.md +11 -0
- package/babel.config.cjs +1 -4
- package/dist/src/components/JsonArray.d.ts +3 -7
- package/dist/src/components/JsonArray.d.ts.map +1 -1
- package/dist/src/components/JsonArray.js +3 -3
- package/dist/src/components/JsonArray.js.map +1 -1
- package/dist/src/components/JsonObject.d.ts +3 -7
- package/dist/src/components/JsonObject.d.ts.map +1 -1
- package/dist/src/components/JsonObject.js +11 -5
- package/dist/src/components/JsonObject.js.map +1 -1
- package/dist/src/components/JsonValue.d.ts +3 -8
- package/dist/src/components/JsonValue.d.ts.map +1 -1
- package/dist/src/components/JsonValue.js +1 -1
- package/dist/src/components/JsonValue.js.map +1 -1
- package/dist/src/components/stc/index.d.ts +7 -28
- package/dist/src/components/stc/index.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/JsonArray.tsx +6 -14
- package/src/components/JsonObject.tsx +14 -14
- package/src/components/JsonValue.tsx +4 -13
- package/temp/api.json +29 -86
- package/vitest.config.ts +2 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog - @alloy-js/json
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
No changes, version bump only.
|
|
6
|
+
|
|
7
|
+
## 0.8.0
|
|
8
|
+
|
|
9
|
+
### Breaking Changes
|
|
10
|
+
|
|
11
|
+
- [#74](https://github.com/alloy-framework/alloy/pull/74) Remove plural `refkeys` prop. Can now pass an array for the `refkey` prop.
|
|
12
|
+
|
|
13
|
+
|
|
3
14
|
## 0.7.0
|
|
4
15
|
|
|
5
16
|
### Features
|
package/babel.config.cjs
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { Children, Refkey } from "@alloy-js/core";
|
|
2
2
|
export interface JsonArrayPropsBase {
|
|
3
|
-
/** The refkey for the JSON array. When provided, this value can be referenced
|
|
4
|
-
* elsewhere via this refkey.
|
|
5
|
-
**/
|
|
6
|
-
refkey?: Refkey;
|
|
7
3
|
/**
|
|
8
|
-
* The refkeys for the JSON array. When provided, this
|
|
9
|
-
* elsewhere via
|
|
4
|
+
* The refkey or array of refkeys for the JSON array. When provided, this
|
|
5
|
+
* value can be referenced elsewhere via this refkey.
|
|
10
6
|
**/
|
|
11
|
-
|
|
7
|
+
refkey?: Refkey | Refkey[];
|
|
12
8
|
}
|
|
13
9
|
/**
|
|
14
10
|
* Create a JSON Array by serializing the given JavaScript array to JSON.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonArray.d.ts","sourceRoot":"","sources":["../../../src/components/JsonArray.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQR,MAAM,EAGP,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,kBAAkB;IACjC
|
|
1
|
+
{"version":3,"file":"JsonArray.d.ts","sourceRoot":"","sources":["../../../src/components/JsonArray.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQR,MAAM,EAGP,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,kBAAkB;IACjC;;;QAGI;IACJ,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACnE;;OAEG;IACH,OAAO,EAAE,OAAO,EAAE,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;IACpE;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,MAAM,MAAM,cAAc,GACtB,yBAAyB,GACzB,0BAA0B,CAAC;AAE/B;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,YA0C9C;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,MAAM,MAAM,qBAAqB,GAC7B,gCAAgC,GAChC,iCAAiC,CAAC;AAEtC;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,YA6B5D"}
|
|
@@ -28,7 +28,7 @@ export function JsonArray(props) {
|
|
|
28
28
|
const binder = memberSymbol.binder;
|
|
29
29
|
binder.addStaticMembersToSymbol(memberSymbol);
|
|
30
30
|
if (props.refkey) {
|
|
31
|
-
memberSymbol.refkeys = [
|
|
31
|
+
memberSymbol.refkeys = [props.refkey].flat();
|
|
32
32
|
}
|
|
33
33
|
if (!("jsValue" in props)) {
|
|
34
34
|
return _$createComponent(MemberScope, {
|
|
@@ -37,7 +37,7 @@ export function JsonArray(props) {
|
|
|
37
37
|
return _$createIntrinsic("group", {
|
|
38
38
|
get children() {
|
|
39
39
|
return ["[", _$createComponent(Indent, {
|
|
40
|
-
|
|
40
|
+
softline: true,
|
|
41
41
|
trailingBreak: true,
|
|
42
42
|
get children() {
|
|
43
43
|
return _$createComponent(List, {
|
|
@@ -61,7 +61,7 @@ export function JsonArray(props) {
|
|
|
61
61
|
return _$createIntrinsic("group", {
|
|
62
62
|
get children() {
|
|
63
63
|
return ["[", _$createComponent(Indent, {
|
|
64
|
-
|
|
64
|
+
softline: true,
|
|
65
65
|
trailingBreak: true,
|
|
66
66
|
get children() {
|
|
67
67
|
return _$createComponent(For, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonArray.js","names":["For","Indent","List","MemberDeclaration","MemberScope","onCleanup","OutputSymbolFlags","useMemberDeclaration","useMemberScope","createJsonOutputSymbol","JsonValue","JsonArray","props","memberSymbol","Error","binder","addStaticMembersToSymbol","refkey","refkeys","_$createComponent","owner","children","_$createIntrinsic","trailingBreak","comma","line","jsValue","each","value","JsonArrayElement","memberScope","staticMembers","name","String","symbols","size","sym","flags","StaticMember","deleteSymbol","wrap","symbol"],"sources":["../../../src/components/JsonArray.tsx"],"sourcesContent":[null],"mappings":";;;AAAA,SAEEA,GAAG,EACHC,MAAM,EACNC,IAAI,EACJC,iBAAiB,EACjBC,WAAW,EACXC,SAAS,EACTC,iBAAiB,EAEjBC,oBAAoB,EACpBC,cAAc,QACT,gBAAgB;AACvB,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,SAAS;;
|
|
1
|
+
{"version":3,"file":"JsonArray.js","names":["For","Indent","List","MemberDeclaration","MemberScope","onCleanup","OutputSymbolFlags","useMemberDeclaration","useMemberScope","createJsonOutputSymbol","JsonValue","JsonArray","props","memberSymbol","Error","binder","addStaticMembersToSymbol","refkey","refkeys","flat","_$createComponent","owner","children","_$createIntrinsic","softline","trailingBreak","comma","line","jsValue","each","value","JsonArrayElement","memberScope","staticMembers","name","String","symbols","size","sym","flags","StaticMember","deleteSymbol","wrap","symbol"],"sources":["../../../src/components/JsonArray.tsx"],"sourcesContent":[null],"mappings":";;;AAAA,SAEEA,GAAG,EACHC,MAAM,EACNC,IAAI,EACJC,iBAAiB,EACjBC,WAAW,EACXC,SAAS,EACTC,iBAAiB,EAEjBC,oBAAoB,EACpBC,cAAc,QACT,gBAAgB;AACvB,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,SAAS;;AAUlB;AACA;AACA;;AAQA;AACA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,KAAqB,EAAE;EAC/C,MAAMC,YAAY,GAAGN,oBAAoB,CAAC,CAAC;EAC3C,IAAI,CAACM,YAAY,EAAE;IACjB,MAAM,IAAIC,KAAK,CAAC,4BAA4B,CAAC;EAC/C;EACA,MAAMC,MAAM,GAAGF,YAAY,CAACE,MAAM;EAClCA,MAAM,CAACC,wBAAwB,CAACH,YAAY,CAAC;EA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AAW,EAAE;IAChB,MAAM,IAAIlB,KAAK,CAAC,uBAAuB,CAAC;EAC1C;EAEA,IAAI,CAACkB,WAAW,CAACC,aAAa,EAAE;IAC9B,MAAM,IAAInB,KAAK,CAAC,+BAA+B,CAAC;EAClD;EAEA,MAAMoB,IAAI,GAAGC,MAAM,CAACH,WAAW,CAACC,aAAa,CAACG,OAAO,CAACC,IAAI,CAAC;EAE3D,MAAMC,GAAG,GAAG7B,sBAAsB,CAAC;IACjCyB,IAAI;IACJK,KAAK,EAAEjC,iBAAiB,CAACkC;EAC3B,CAAC,CAAC;EAEFnC,SAAS,CAAC,MAAM;IACdiC,GAAG,CAACvB,MAAM,CAAC0B,YAAY,CAACH,GAAG,CAAC;EAC9B,CAAC,CAAC;EAEF,SAASI,IAAIA,CAACpB,QAAkB,EAAE;IAChC,OAAAF,iBAAA,CAAQjB,iBAAiB;MAACwC,MAAM,EAAEL,GAAG;MAAAhB,QAAA,EAAGA;IAAQ;EAClD;EACA,IAAI,EAAE,SAAS,IAAIV,KAAK,CAAC,EAAE;IACzB,OAAO8B,IAAI,CAAC,MAAM9B,KAAK,CAACU,QAAQ,CAAC;EACnC,CAAC,MAAM;IACL,OAAOoB,IAAI,CAAAtB,iBAAA,CAAEV,SAAS;MAAA,IAACkB,OAAOA,CAAA;QAAA,OAAEhB,KAAK,CAACgB,OAAO;MAAA;IAAA,EAAI,CAAC;EACpD;AACF","ignoreList":[]}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { Children, Refkey } from "@alloy-js/core";
|
|
2
2
|
export interface JsonObjectPropsBase {
|
|
3
|
-
/** The refkey for the JSON object. When provided, this value can be referenced
|
|
4
|
-
* elsewhere via this refkey.
|
|
5
|
-
**/
|
|
6
|
-
refkey?: Refkey;
|
|
7
3
|
/**
|
|
8
|
-
* The refkeys for the JSON object. When provided, this
|
|
9
|
-
* referenced elsewhere via
|
|
4
|
+
* The refkey or array of refkeys for the JSON object. When provided, this
|
|
5
|
+
* value can be referenced elsewhere via this refkey.
|
|
10
6
|
**/
|
|
11
|
-
|
|
7
|
+
refkey?: Refkey | Refkey[];
|
|
12
8
|
style?: {
|
|
13
9
|
concise?: boolean;
|
|
14
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonObject.d.ts","sourceRoot":"","sources":["../../../src/components/JsonObject.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EASR,MAAM,EAEP,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,mBAAmB;IAClC
|
|
1
|
+
{"version":3,"file":"JsonObject.d.ts","sourceRoot":"","sources":["../../../src/components/JsonObject.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EASR,MAAM,EAEP,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,mBAAmB;IAClC;;;QAGI;IACJ,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE3B,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE;;;OAGG;IACH,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA2B,SAAQ,mBAAmB;IACrE;;;OAGG;IACH,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/E;AAED,MAAM,MAAM,eAAe,GACvB,2BAA2B,GAC3B,0BAA0B,CAAC;AAE/B;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YA+DhD;AAED;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,mBAAmB,GAC3B,+BAA+B,GAC/B,8BAA8B,CAAC;AAEnC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,YAuB5D"}
|
|
@@ -30,7 +30,7 @@ export function JsonObject(props) {
|
|
|
30
30
|
const binder = memberSymbol.binder;
|
|
31
31
|
binder.addStaticMembersToSymbol(memberSymbol);
|
|
32
32
|
if (props.refkey) {
|
|
33
|
-
memberSymbol.refkeys = [
|
|
33
|
+
memberSymbol.refkeys = [props.refkey].flat();
|
|
34
34
|
}
|
|
35
35
|
if (!("jsValue" in props)) {
|
|
36
36
|
return _$createComponent(MemberScope, {
|
|
@@ -39,8 +39,11 @@ export function JsonObject(props) {
|
|
|
39
39
|
return _$createIntrinsic("group", {
|
|
40
40
|
get children() {
|
|
41
41
|
return ["{", _$createComponent(Indent, {
|
|
42
|
-
get
|
|
43
|
-
return props.style?.concise
|
|
42
|
+
get softline() {
|
|
43
|
+
return !!props.style?.concise;
|
|
44
|
+
},
|
|
45
|
+
get hardline() {
|
|
46
|
+
return !props.style?.concise;
|
|
44
47
|
},
|
|
45
48
|
trailingBreak: true,
|
|
46
49
|
get children() {
|
|
@@ -76,8 +79,11 @@ export function JsonObject(props) {
|
|
|
76
79
|
return _$createIntrinsic("group", {
|
|
77
80
|
get children() {
|
|
78
81
|
return ["{", _$createComponent(Indent, {
|
|
79
|
-
get
|
|
80
|
-
return props.style?.concise
|
|
82
|
+
get softline() {
|
|
83
|
+
return !!props.style?.concise;
|
|
84
|
+
},
|
|
85
|
+
get hardline() {
|
|
86
|
+
return !props.style?.concise;
|
|
81
87
|
},
|
|
82
88
|
trailingBreak: true,
|
|
83
89
|
get children() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonObject.js","names":["computed","For","Indent","List","MemberDeclaration","MemberScope","onCleanup","OutputSymbolFlags","useMemberDeclaration","createJsonOutputSymbol","JsonValue","JsonObject","props","memberSymbol","Error","binder","addStaticMembersToSymbol","refkey","refkeys","_$createComponent","owner","children","_$createIntrinsic","
|
|
1
|
+
{"version":3,"file":"JsonObject.js","names":["computed","For","Indent","List","MemberDeclaration","MemberScope","onCleanup","OutputSymbolFlags","useMemberDeclaration","createJsonOutputSymbol","JsonValue","JsonObject","props","memberSymbol","Error","binder","addStaticMembersToSymbol","refkey","refkeys","flat","_$createComponent","owner","children","_$createIntrinsic","softline","style","concise","hardline","trailingBreak","comma","entries","jsValue","Array","isArray","Map","undefined","globalThis","Object","each","name","value","JsonObjectProperty","sym","flags","StaticMember","deleteSymbol","wrap","symbol","_$memo"],"sources":["../../../src/components/JsonObject.tsx"],"sourcesContent":[null],"mappings":";;;AAAA,SAEEA,QAAQ,EACRC,GAAG,EACHC,MAAM,EACNC,IAAI,EACJC,iBAAiB,EACjBC,WAAW,EACXC,SAAS,EACTC,iBAAiB,EAEjBC,oBAAoB,QACf,gBAAgB;AACvB,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,SAAS;;AAYlB;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,KAAsB,EAAE;EACjD,MAAMC,YAAY,GAAGL,oBAAoB,CAAC,CAAC;EAC3C,IAAI,CAACK,YAAY,EAAE;IACjB,MAAM,IAAIC,KAAK,CAAC,4BAA4B,CAAC;EAC/C;EACA,MAAMC,MAAM,GAAGF,YAAY,CAACE,MAAM;EAClCA,MAAM,CAACC,wBAAwB,CAACH,YAAY,CAAC;EAC7C,IAAID,KAAK,CAACK,MAAM,EAAE;IAChBJ,YAAY,CAACK,OAAO,GAAG,CAACN,KAAK,CAACK,MAAM,CAAC,CAACE,IAAI,CAAC,CAAC;EAC9C;EAEA,IAAI,EAAE,SAAS,IAAIP,KA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OA,CAAA;MAAA,OAAEnB,KAAK,CAACmB,OAAO;IAAA;EAAA,EAAI,CAAC;AACpD","ignoreList":[]}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { Refkey } from "@alloy-js/core";
|
|
2
2
|
export interface JsonValueProps {
|
|
3
3
|
/**
|
|
4
|
-
* The refkey for the JSON value. When provided, this
|
|
5
|
-
* elsewhere via this refkey.
|
|
4
|
+
* The refkey or array of refkeys for the JSON value. When provided, this
|
|
5
|
+
* value can be referenced elsewhere via this refkey.
|
|
6
6
|
**/
|
|
7
|
-
refkey?: Refkey;
|
|
8
|
-
/**
|
|
9
|
-
* The refkeys for the JSON value. When provided, these values can be
|
|
10
|
-
* referenced elsewhere via any of these refkeys.
|
|
11
|
-
**/
|
|
12
|
-
refkeys?: Refkey[];
|
|
7
|
+
refkey?: Refkey | Refkey[];
|
|
13
8
|
/**
|
|
14
9
|
* The JS value to serialize to JSON. When provided, thi
|
|
15
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonValue.d.ts","sourceRoot":"","sources":["../../../src/components/JsonValue.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAwB,MAAM,gBAAgB,CAAC;AAI9D,MAAM,WAAW,cAAc;IAC7B;;;QAGI;IACJ,MAAM,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"JsonValue.d.ts","sourceRoot":"","sources":["../../../src/components/JsonValue.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAwB,MAAM,gBAAgB,CAAC;AAI9D,MAAM,WAAW,cAAc;IAC7B;;;QAGI;IACJ,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE3B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qCA0B9C"}
|
|
@@ -10,7 +10,7 @@ import { JsonObject } from "./JsonObject.js";
|
|
|
10
10
|
* appropriate.
|
|
11
11
|
*/
|
|
12
12
|
export function JsonValue(props) {
|
|
13
|
-
const refkeys = [
|
|
13
|
+
const refkeys = [props.refkey ?? []].flat();
|
|
14
14
|
if (props.jsValue === null) {
|
|
15
15
|
setMemberRefkey(refkeys);
|
|
16
16
|
return "null";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonValue.js","names":["useMemberDeclaration","JsonArray","JsonObject","JsonValue","props","refkeys","refkey","jsValue","setMemberRefkey","String","Array","isArray","_$createComponent","Error","keys","length","member"],"sources":["../../../src/components/JsonValue.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAAiBA,oBAAoB,QAAQ,gBAAgB;AAC7D,SAASC,SAAS;AAClB,SAASC,UAAU;
|
|
1
|
+
{"version":3,"file":"JsonValue.js","names":["useMemberDeclaration","JsonArray","JsonObject","JsonValue","props","refkeys","refkey","flat","jsValue","setMemberRefkey","String","Array","isArray","_$createComponent","Error","keys","length","member"],"sources":["../../../src/components/JsonValue.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAAiBA,oBAAoB,QAAQ,gBAAgB;AAC7D,SAASC,SAAS;AAClB,SAASC,UAAU;AAenB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,KAAqB,EAAE;EAC/C,MAAMC,OAAO,GAAG,CAACD,KAAK,CAACE,MAAM,IAAI,EAAE,CAAC,CAACC,IAAI,CAAC,CAAC;EAC3C,IAAIH,KAAK,CAACI,OAAO,KAAK,IAAI,EAAE;IAC1BC,eAAe,CAACJ,OAAO,CAAC;IACxB,OAAO,MAAM;EACf;EAEA,IAAI,OAAOD,KAAK,CAACI,OAAO,KAAK,QAAQ,IAAI,OAAOJ,KAAK,CAACI,OAAO,KAAK,SAAS,EAAE;IAC3EC,eAAe,CAACJ,OAAO,CAAC;IACxB,OAAOK,MAAM,CAACN,KAAK,CAACI,OAAO,CAAC;EAC9B;EAEA,IAAI,OAAOJ,KAAK,CAACI,OAAO,KAAK,QAAQ,EAAE;IACrCC,eAAe,CAACJ,OAAO,CAAC;IACxB,OAAO,IAAID,KAAK,CAACI,OAAO,GAAG;EAC7B;EAEA,IAAIG,KAAK,CAACC,OAAO,CAACR,KAAK,CAACI,OAAO,CAAC,EAAE;IAChC,OAAAK,iBAAA,CAAQZ,SAAS;MAAA,IAACO,OAAOA,CAAA;QAAA,OAAEJ,KAAK,CAACI,OAAO;MAAA;IAAA;EAC1C;EAEA,IAAI,OAAOJ,KAAK,CAACI,OAAO,KAAK,QAAQ,EAAE;IACrC,OAAAK,iBAAA,CAAQX,UAAU;MAAA,IAACM,OAAOA,CAAA;QAAA,OAAEJ,KAAK,CAACI,OAAO;MAAA;IAAA;EAC3C;EAEA,MAAM,IAAIM,KAAK,CAAC,oCAAoC,GAAG,OAAOV,KAAK,CAACI,OAAO,CAAC;AAC9E;AAEA,SAASC,eAAeA,CAACM,IAAc,EAAE;EACvC,IAAIA,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE;EACvB,MAAMC,MAAM,GAAGjB,oBAAoB,CAAC,CAAC;EACrC,IAAI,CAACiB,MAAM,EAAE;IACX,MAAM,IAAIH,KAAK,CAAC,6BAA6B,CAAC;EAChD;EAEAG,MAAM,CAACZ,OAAO,GAAGU,IAAI;AACvB","ignoreList":[]}
|
|
@@ -1,30 +1,9 @@
|
|
|
1
1
|
import * as Jsx from "../index.js";
|
|
2
|
-
export declare const JsonArray:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
export declare const JsonObject: (props?: Jsx.JsonObjectPropsWithJsValue | (Omit<Jsx.JsonObjectPropsWithChildren, "children"> & Partial<Pick<Jsx.JsonObjectPropsWithChildren, "children">>) | undefined) => import("@alloy-js/core").ComponentCreator<Jsx.JsonObjectProps> & {
|
|
11
|
-
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.JsonObjectProps>;
|
|
12
|
-
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.JsonObjectProps>;
|
|
13
|
-
};
|
|
14
|
-
export declare const JsonObjectProperty: (props: Jsx.ObjectPropertyPropsWithJsValue | (Omit<Jsx.ObjectPropertyPropsWithChildren, "children"> & Partial<Pick<Jsx.ObjectPropertyPropsWithChildren, "children">>)) => import("@alloy-js/core").ComponentCreator<Jsx.ObjectPropertyProps> & {
|
|
15
|
-
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.ObjectPropertyProps>;
|
|
16
|
-
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.ObjectPropertyProps>;
|
|
17
|
-
};
|
|
18
|
-
export declare const JsonValue: (props: Jsx.JsonValueProps) => import("@alloy-js/core").ComponentCreator<Jsx.JsonValueProps> & {
|
|
19
|
-
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.JsonValueProps>;
|
|
20
|
-
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.JsonValueProps>;
|
|
21
|
-
};
|
|
22
|
-
export declare const Reference: (props: Jsx.ReferenceProps) => import("@alloy-js/core").ComponentCreator<Jsx.ReferenceProps> & {
|
|
23
|
-
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.ReferenceProps>;
|
|
24
|
-
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.ReferenceProps>;
|
|
25
|
-
};
|
|
26
|
-
export declare const SourceFile: (props: Omit<Jsx.SourceFileProps, "children"> & Partial<Pick<Jsx.SourceFileProps, "children">>) => import("@alloy-js/core").ComponentCreator<Jsx.SourceFileProps> & {
|
|
27
|
-
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.SourceFileProps>;
|
|
28
|
-
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<Jsx.SourceFileProps>;
|
|
29
|
-
};
|
|
2
|
+
export declare const JsonArray: import("@alloy-js/core").StcSignature<Jsx.JsonArrayProps>;
|
|
3
|
+
export declare const JsonArrayElement: import("@alloy-js/core").StcSignature<Jsx.JsonArrayElementProps>;
|
|
4
|
+
export declare const JsonObject: import("@alloy-js/core").StcSignature<Jsx.JsonObjectProps>;
|
|
5
|
+
export declare const JsonObjectProperty: import("@alloy-js/core").StcSignature<Jsx.ObjectPropertyProps>;
|
|
6
|
+
export declare const JsonValue: import("@alloy-js/core").StcSignature<Jsx.JsonValueProps>;
|
|
7
|
+
export declare const Reference: import("@alloy-js/core").StcSignature<Jsx.ReferenceProps>;
|
|
8
|
+
export declare const SourceFile: import("@alloy-js/core").StcSignature<Jsx.SourceFileProps>;
|
|
30
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/stc/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAEnC,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/stc/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AAEnC,eAAO,MAAM,SAAS,2DAAqB,CAAC;AAC5C,eAAO,MAAM,gBAAgB,kEAA4B,CAAC;AAC1D,eAAO,MAAM,UAAU,4DAAsB,CAAC;AAC9C,eAAO,MAAM,kBAAkB,gEAA8B,CAAC;AAC9D,eAAO,MAAM,SAAS,2DAAqB,CAAC;AAC5C,eAAO,MAAM,SAAS,2DAAqB,CAAC;AAC5C,eAAO,MAAM,UAAU,4DAAsB,CAAC"}
|