@alloy-js/csharp 0.21.0-dev.20 → 0.21.0-dev.22
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/src/components/attributes/attributes.test.js.map +1 -1
- package/dist/src/components/csproj-file/csproj-file.js +1 -1
- package/dist/src/components/csproj-file/csproj-file.test.js +25 -0
- package/dist/src/components/csproj-file/csproj-file.test.js.map +1 -1
- package/dist/testing/create-wrapper.d.ts +3 -0
- package/dist/testing/create-wrapper.d.ts.map +1 -0
- package/dist/testing/create-wrapper.js +12 -0
- package/dist/testing/create-wrapper.js.map +1 -0
- package/dist/testing/create-wrapper.test.d.ts +2 -0
- package/dist/testing/create-wrapper.test.d.ts.map +1 -0
- package/dist/testing/create-wrapper.test.js +212 -0
- package/dist/testing/create-wrapper.test.js.map +1 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +2 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -4
- package/src/components/attributes/attributes.test.tsx +0 -1
- package/src/components/csproj-file/csproj-file.test.tsx +19 -0
- package/src/components/csproj-file/csproj-file.tsx +1 -1
- package/testing/create-wrapper.test.tsx +145 -0
- package/testing/create-wrapper.tsx +12 -0
- package/testing/index.ts +1 -0
- package/tsconfig.json +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ClassDeclaration","createLibrary","TestNamespace","List","namekey","describe","expect","it","Attribute","AttributeList","_$createComponent","name","toRenderTo","key","children","TestLib","TestAttribute","kind","methodKind","args","attributes"],"sources":["../../../../src/components/attributes/attributes.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,gBAAgB;AACzB,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,aAAa;AACtB,SAASC,IAAI,EAAEC,OAAO,QAAQ,gBAAgB;AAC9C,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,SAAS,EAAEC,aAAa;
|
|
1
|
+
{"version":3,"names":["ClassDeclaration","createLibrary","TestNamespace","List","namekey","describe","expect","it","Attribute","AttributeList","_$createComponent","name","toRenderTo","key","children","TestLib","TestAttribute","kind","methodKind","args","attributes"],"sources":["../../../../src/components/attributes/attributes.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,gBAAgB;AACzB,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,aAAa;AACtB,SAASC,IAAI,EAAEC,OAAO,QAAQ,gBAAgB;AAC9C,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,SAAS,EAAEC,aAAa;AACjCF,EAAE,CAAC,kBAAkB,EAAE,MAAM;EAC3BD,MAAM,CAAAI,iBAAA,CAAEF,SAAS;IAACG,IAAI;EAAA,EAAU,CAAC,CAACC,UAAU,CAAC;AAC/C;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFP,QAAQ,CAAC,2BAA2B,EAAE,MAAM;EAC1CE,EAAE,CAAC,qDAAqD,EAAE,MAAM;IAC9DD,MAAM,CAAAI,iBAAA,CAAEF,SAAS;MAACG,IAAI;IAAA,EAAmB,CAAC,CAACC,UAAU,CAAC;AAC1D;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;EAEFL,EAAE,CAAC,oBAAoB,EAAE,MAAM;IAC7B,MAAMM,GAAG,GAAGT,OAAO,CAAC,eAAe,CAAC;IACpCE,MAAM,CAAAI,iBAAA,CACHR,aAAa;MAAA,IAAAY,SAAA;QAAA,OAAAJ,iBAAA,CACXP,IAAI;UAAA,IAAAW,SAAA;YAAA,QAAAJ,iBAAA,CACFF,SAAS;cAACG,IAAI,EAAEE;YAAG,IAAAH,iBAAA,CACnBV,gBAAgB;cAACW,IAAI,EAAEE;YAAG;UAAA;QAAA;MAAA;IAAA,EAGjC,CAAC,CAACD,UAAU,CAAC;AACjB;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AC,4CAA4C,EAAE,MAAM;EACrDD,MAAM,CAAAI,iBAAA,CAAED,aAAa;IAACW,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO;EAAC,EAAI,CAAC,CAACR,UAAU,CAAC;AACvE;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFL,EAAE,CAAC,4CAA4C,EAAE,MAAM;EACrDD,MAAM,CAAAI,iBAAA,CACHD,aAAa;IACZW,UAAU,EAAE,CAAC;MAAET,IAAI,EAAE;IAAQ,CAAC,EAAE;MAAEA,IAAI,EAAE,OAAO;MAAEQ,IAAI,EAAE,CAAC,QAAQ;IAAE,CAAC;EAAC,EAExE,CAAC,CAACP,UAAU,CAAC;AACf;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFL,EAAE,CAAC,qCAAqC,EAAE,MAAM;EAC9CD,MAAM,CAAAI,iBAAA,CACHD,aAAa;IAAA,IAAAK,SAAA;MAAA,QAAAJ,iBAAA,CACXF,SAAS;QAACG,IAAI;MAAA,IAAAD,iBAAA,CACdF,SAAS;QAACG,IAAI;MAAA;IAAA;EAAA,EAEnB,CAAC,CAACC,UAAU,CAAC;AACf;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Compile, ItemGroup } from "@alloy-js/msbuild/components";
|
|
2
3
|
import { expect, it } from "vitest";
|
|
3
4
|
import { CsprojFile } from "./csproj-file.js";
|
|
4
5
|
it("create empty .csproj file", () => {
|
|
@@ -18,4 +19,28 @@ it("set different sdk", () => {
|
|
|
18
19
|
<Project Sdk="Microsoft.NET.Sdk.Web"><!-- content --></Project>
|
|
19
20
|
`);
|
|
20
21
|
});
|
|
22
|
+
it("can use msbuild components", () => {
|
|
23
|
+
expect(_$createComponent(CsprojFile, {
|
|
24
|
+
path: "foo.csproj",
|
|
25
|
+
sdk: "Microsoft.NET.Sdk.Web",
|
|
26
|
+
get children() {
|
|
27
|
+
return _$createComponent(ItemGroup, {
|
|
28
|
+
get children() {
|
|
29
|
+
return [_$createComponent(Compile, {
|
|
30
|
+
Include: "Program.cs"
|
|
31
|
+
}), _$createComponent(Compile, {
|
|
32
|
+
Include: "Other.cs"
|
|
33
|
+
})];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
})).toRenderTo(`
|
|
38
|
+
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
39
|
+
<ItemGroup>
|
|
40
|
+
<Compile Include="Program.cs" />
|
|
41
|
+
<Compile Include="Other.cs" />
|
|
42
|
+
</ItemGroup>
|
|
43
|
+
</Project>
|
|
44
|
+
`);
|
|
45
|
+
});
|
|
21
46
|
//# sourceMappingURL=csproj-file.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["expect","it","CsprojFile","_$createComponent","path","children","toRenderTo","sdk"],"sources":["../../../../src/components/csproj-file/csproj-file.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACnC,SAASC,UAAU;AAEnBD,EAAE,CAAC,2BAA2B,EAAE,MAAM;EACpCD,MAAM,CAAAG,iBAAA,CAAED,UAAU;IAACE,IAAI,EAAE,YAAY;IAAAC,QAAA,EAAG;EAAkB,EAAc,CAAC,CACtEC,UAAU,CAAC;AAChB;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFL,EAAE,CAAC,mBAAmB,EAAE,MAAM;EAC5BD,MAAM,CAAAG,iBAAA,CACHD,UAAU;IAACE,IAAI,EAAE,YAAY;IAAEG,GAAG;IAAAF,QAAA,EAChC;EAAkB,EAEvB,CAAC,CAACC,UAAU,CAAC;AACf;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Compile","ItemGroup","expect","it","CsprojFile","_$createComponent","path","children","toRenderTo","sdk","Include"],"sources":["../../../../src/components/csproj-file/csproj-file.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,OAAO,EAAEC,SAAS,QAAQ,8BAA8B;AACjE,SAASC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AACnC,SAASC,UAAU;AAEnBD,EAAE,CAAC,2BAA2B,EAAE,MAAM;EACpCD,MAAM,CAAAG,iBAAA,CAAED,UAAU;IAACE,IAAI,EAAE,YAAY;IAAAC,QAAA,EAAG;EAAkB,EAAc,CAAC,CACtEC,UAAU,CAAC;AAChB;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFL,EAAE,CAAC,mBAAmB,EAAE,MAAM;EAC5BD,MAAM,CAAAG,iBAAA,CACHD,UAAU;IAACE,IAAI,EAAE,YAAY;IAAEG,GAAG;IAAAF,QAAA,EAChC;EAAkB,EAEvB,CAAC,CAACC,UAAU,CAAC;AACf;AACA,GAAG,CAAC;AACJ,CAAC,CAAC;AAEFL,EAAE,CAAC,4BAA4B,EAAE,MAAM;EACrCD,MAAM,CAAAG,iBAAA,CACHD,UAAU;IAACE,IAAI,EAAE,YAAY;IAAEG,GAAG;IAAA,IAAAF,SAAA;MAAA,OAAAF,iBAAA,CAChCJ,SAAS;QAAA,IAAAM,SAAA;UAAA,QAAAF,iBAAA,CACPL,OAAO;YAACU,OAAO;UAAA,IAAAL,iBAAA,CACfL,OAAO;YAACU,OAAO;UAAA;QAAA;MAAA;IAAA;EAAA,EAGtB,CAAC,CAACF,UAAU,CAAC;AACf;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-wrapper.d.ts","sourceRoot":"","sources":["../../testing/create-wrapper.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG7E,wBAAgB,uBAAuB,IAAI,WAAW,CAOrD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SourceFile } from "#components/index.js";
|
|
2
|
+
import { createTestWrapper } from "@alloy-js/core/testing";
|
|
3
|
+
import { CSharpSymbol, useSourceFileScope } from "../src/index.js";
|
|
4
|
+
export function createCSharpTestWrapper() {
|
|
5
|
+
return createTestWrapper({
|
|
6
|
+
filePath: "test.cs",
|
|
7
|
+
useScope: useSourceFileScope,
|
|
8
|
+
makeSymbol: (nk, scope) => new CSharpSymbol(nk, scope.spaces),
|
|
9
|
+
SourceFile
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=create-wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SourceFile","createTestWrapper","CSharpSymbol","useSourceFileScope","createCSharpTestWrapper","filePath","useScope","makeSymbol","nk","scope","spaces"],"sources":["../../testing/create-wrapper.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,UAAU,QAAQ,sBAAsB;AACjD,SAASC,iBAAiB,QAA0B,wBAAwB;AAC5E,SAASC,YAAY,EAAEC,kBAAkB,QAAQ,iBAAiB;AAElE,OAAO,SAASC,uBAAuBA,CAAA,EAAgB;EACrD,OAAOH,iBAAiB,CAAC;IACvBI,QAAQ,EAAE,SAAS;IACnBC,QAAQ,EAAEH,kBAAkB;IAC5BI,UAAU,EAAEA,CAACC,EAAE,EAAEC,KAAK,KAAK,IAAIP,YAAY,CAACM,EAAE,EAAEC,KAAK,CAACC,MAAM,CAAC;IAC7DV;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-wrapper.test.d.ts","sourceRoot":"","sources":["../../testing/create-wrapper.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { ClassDeclaration, Method, Property, StructDeclaration } from "#components/index.js";
|
|
3
|
+
import { List } from "@alloy-js/core";
|
|
4
|
+
import { d } from "@alloy-js/core/testing";
|
|
5
|
+
import { expect, it } from "vitest";
|
|
6
|
+
import { createCSharpTestWrapper } from "./create-wrapper.js";
|
|
7
|
+
it("should render defkey inline", async () => {
|
|
8
|
+
const {
|
|
9
|
+
Wrapper,
|
|
10
|
+
defkey
|
|
11
|
+
} = createCSharpTestWrapper();
|
|
12
|
+
expect(_$createComponent(Wrapper, {
|
|
13
|
+
get children() {
|
|
14
|
+
return ["return ", _$memo(() => defkey("myResult")), ";"];
|
|
15
|
+
}
|
|
16
|
+
})).toRenderTo(`return myResult;`);
|
|
17
|
+
});
|
|
18
|
+
it("emits a single declaration per unique name", () => {
|
|
19
|
+
const {
|
|
20
|
+
Wrapper,
|
|
21
|
+
defkey
|
|
22
|
+
} = createCSharpTestWrapper();
|
|
23
|
+
const a = defkey("MyType");
|
|
24
|
+
const b = defkey("MyType");
|
|
25
|
+
expect(a).toBe(b);
|
|
26
|
+
expect(_$createComponent(Wrapper, {
|
|
27
|
+
get children() {
|
|
28
|
+
return ["return ", a, " ", b, ";"];
|
|
29
|
+
}
|
|
30
|
+
})).toRenderTo(`return MyType MyType;`); // Ensure only one 'class/struct/interface' (whatever default is) declaration appears above if that's the behavior.
|
|
31
|
+
});
|
|
32
|
+
it("reuses declarations across multiple usage sites", () => {
|
|
33
|
+
const {
|
|
34
|
+
Wrapper,
|
|
35
|
+
defkey
|
|
36
|
+
} = createCSharpTestWrapper();
|
|
37
|
+
const T = defkey("Thing");
|
|
38
|
+
const R = defkey("Result");
|
|
39
|
+
expect(_$createComponent(Wrapper, {
|
|
40
|
+
get children() {
|
|
41
|
+
return _$createComponent(ClassDeclaration, {
|
|
42
|
+
abstract: true,
|
|
43
|
+
name: "A",
|
|
44
|
+
get children() {
|
|
45
|
+
return _$createComponent(List, {
|
|
46
|
+
get children() {
|
|
47
|
+
return [_$createComponent(Method, {
|
|
48
|
+
abstract: true,
|
|
49
|
+
name: "a",
|
|
50
|
+
returns: R,
|
|
51
|
+
parameters: [{
|
|
52
|
+
name: "x",
|
|
53
|
+
type: T
|
|
54
|
+
}]
|
|
55
|
+
}), _$createComponent(Method, {
|
|
56
|
+
abstract: true,
|
|
57
|
+
name: "b",
|
|
58
|
+
returns: R,
|
|
59
|
+
parameters: [{
|
|
60
|
+
name: "y",
|
|
61
|
+
type: T
|
|
62
|
+
}]
|
|
63
|
+
})];
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
})).toRenderTo(d`
|
|
70
|
+
abstract class A
|
|
71
|
+
{
|
|
72
|
+
abstract Result a(Thing x);
|
|
73
|
+
abstract Result b(Thing y);
|
|
74
|
+
}`);
|
|
75
|
+
});
|
|
76
|
+
it("reuses declarations across multiple defkeys", () => {
|
|
77
|
+
const {
|
|
78
|
+
Wrapper,
|
|
79
|
+
defkey
|
|
80
|
+
} = createCSharpTestWrapper();
|
|
81
|
+
expect(_$createComponent(Wrapper, {
|
|
82
|
+
get children() {
|
|
83
|
+
return _$createComponent(ClassDeclaration, {
|
|
84
|
+
abstract: true,
|
|
85
|
+
name: "A",
|
|
86
|
+
get children() {
|
|
87
|
+
return _$createComponent(List, {
|
|
88
|
+
get children() {
|
|
89
|
+
return [_$createComponent(Method, {
|
|
90
|
+
abstract: true,
|
|
91
|
+
name: "a",
|
|
92
|
+
get returns() {
|
|
93
|
+
return defkey("Result");
|
|
94
|
+
},
|
|
95
|
+
get parameters() {
|
|
96
|
+
return [{
|
|
97
|
+
name: "x",
|
|
98
|
+
type: defkey("Thing")
|
|
99
|
+
}];
|
|
100
|
+
}
|
|
101
|
+
}), _$createComponent(Method, {
|
|
102
|
+
abstract: true,
|
|
103
|
+
name: "b",
|
|
104
|
+
get returns() {
|
|
105
|
+
return defkey("Result");
|
|
106
|
+
},
|
|
107
|
+
get parameters() {
|
|
108
|
+
return [{
|
|
109
|
+
name: "y",
|
|
110
|
+
type: defkey("Thing")
|
|
111
|
+
}];
|
|
112
|
+
}
|
|
113
|
+
})];
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
})).toRenderTo(d`
|
|
120
|
+
abstract class A
|
|
121
|
+
{
|
|
122
|
+
abstract Result a(Thing x);
|
|
123
|
+
abstract Result b(Thing y);
|
|
124
|
+
}`);
|
|
125
|
+
});
|
|
126
|
+
it("should render defkey in nested component", async () => {
|
|
127
|
+
function TestComponent(props) {
|
|
128
|
+
return _$createComponent(Method, {
|
|
129
|
+
name: "foo",
|
|
130
|
+
get returns() {
|
|
131
|
+
return props.returnTypeRef;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const {
|
|
136
|
+
Wrapper,
|
|
137
|
+
defkey
|
|
138
|
+
} = createCSharpTestWrapper();
|
|
139
|
+
expect(_$createComponent(Wrapper, {
|
|
140
|
+
get children() {
|
|
141
|
+
return _$createComponent(ClassDeclaration, {
|
|
142
|
+
name: "MyClass",
|
|
143
|
+
get children() {
|
|
144
|
+
return _$createComponent(TestComponent, {
|
|
145
|
+
get returnTypeRef() {
|
|
146
|
+
return defkey("MyType");
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
})).toRenderTo(d`
|
|
153
|
+
class MyClass
|
|
154
|
+
{
|
|
155
|
+
MyType foo() {}
|
|
156
|
+
}`);
|
|
157
|
+
});
|
|
158
|
+
it("should render defkey in class property", async () => {
|
|
159
|
+
const {
|
|
160
|
+
Wrapper,
|
|
161
|
+
defkey
|
|
162
|
+
} = createCSharpTestWrapper();
|
|
163
|
+
expect(_$createComponent(Wrapper, {
|
|
164
|
+
get children() {
|
|
165
|
+
return _$createComponent(ClassDeclaration, {
|
|
166
|
+
name: "TestClass",
|
|
167
|
+
get children() {
|
|
168
|
+
return _$createComponent(Property, {
|
|
169
|
+
name: "MyProperty",
|
|
170
|
+
get type() {
|
|
171
|
+
return defkey("MyType");
|
|
172
|
+
},
|
|
173
|
+
get: true,
|
|
174
|
+
set: true
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
})).toRenderTo(d`
|
|
180
|
+
class TestClass
|
|
181
|
+
{
|
|
182
|
+
MyType MyProperty { get; set; }
|
|
183
|
+
}`);
|
|
184
|
+
});
|
|
185
|
+
it("should render defkey in struct property", async () => {
|
|
186
|
+
const {
|
|
187
|
+
Wrapper,
|
|
188
|
+
defkey
|
|
189
|
+
} = createCSharpTestWrapper();
|
|
190
|
+
expect(_$createComponent(Wrapper, {
|
|
191
|
+
get children() {
|
|
192
|
+
return _$createComponent(StructDeclaration, {
|
|
193
|
+
name: "TestStruct",
|
|
194
|
+
get children() {
|
|
195
|
+
return _$createComponent(Property, {
|
|
196
|
+
name: "MyProperty",
|
|
197
|
+
get type() {
|
|
198
|
+
return defkey("MyType");
|
|
199
|
+
},
|
|
200
|
+
get: true,
|
|
201
|
+
set: true
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
})).toRenderTo(d`
|
|
207
|
+
struct TestStruct
|
|
208
|
+
{
|
|
209
|
+
MyType MyProperty { get; set; }
|
|
210
|
+
}`);
|
|
211
|
+
});
|
|
212
|
+
//# sourceMappingURL=create-wrapper.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ClassDeclaration","Method","Property","StructDeclaration","List","d","expect","it","createCSharpTestWrapper","Wrapper","defkey","_$createComponent","children","_$memo","toRenderTo","a","b","toBe","T","R","abstract","name","returns","parameters","type","TestComponent","props","returnTypeRef","get","set"],"sources":["../../testing/create-wrapper.test.tsx"],"sourcesContent":[null],"mappings":";AAAA,SACEA,gBAAgB,EAChBC,MAAM,EACNC,QAAQ,EACRC,iBAAiB,QACZ,sBAAsB;AAC7B,SAAS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IAAIA,CAAA;cAAA,OAAEd,MAAM,CAAC,QAAQ,CAAC;YAAA;YAAEkB,GAAG;YAACC,GAAG;UAAA;QAAA;MAAA;IAAA;EAAA,EAGjE,CAAC,CAACf,UAAU,CAACT,CAAC;AAChB;AACA;AACA;AACA,MAAM,CAAC;AACP,CAAC,CAAC;AAEFE,EAAE,CAAC,yCAAyC,EAAE,YAAY;EACxD,MAAM;IAAEE,OAAO;IAAEC;EAAO,CAAC,GAAGF,uBAAuB,CAAC,CAAC;EAErDF,MAAM,CAAAK,iBAAA,CACHF,OAAO;IAAA,IAAAG,SAAA;MAAA,OAAAD,iBAAA,CACLR,iBAAiB;QAACkB,IAAI;QAAA,IAAAT,SAAA;UAAA,OAAAD,iBAAA,CACpBT,QAAQ;YAACmB,IAAI;YAAA,IAAcG,IAAIA,CAAA;cAAA,OAAEd,MAAM,CAAC,QAAQ,CAAC;YAAA;YAAEkB,GAAG;YAACC,GAAG;UAAA;QAAA;MAAA;IAAA;EAAA,EAGjE,CAAC,CAACf,UAAU,CAACT,CAAC;AAChB;AACA;AACA;AACA,MAAM,CAAC;AACP,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../testing/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../testing/index.ts"],"sourcesContent":[null],"mappings":"AAAA","ignoreList":[]}
|