diff --git a/view/tree2/to/dts/dts.ts b/view/tree2/to/dts/dts.ts index aae8e9c9845..1bd73269395 100644 --- a/view/tree2/to/dts/dts.ts +++ b/view/tree2/to/dts/dts.ts @@ -87,7 +87,9 @@ namespace $ { obj.kids.map( field => { if( field.type === '^' ) return null return field.struct( 'line', [ + field.data('\''), field.data( field.type ), + field.data('\''), field.data( ': ' ), ... field.hack( belt ), field.data( ',' ), @@ -102,7 +104,7 @@ namespace $ { if( input.type[0] === '/' ) return [ input.data('readonly '), - input.data( input.type.slice(1) ), + input.data( input.type.slice(1) || 'unknown' ), input.data('[]'), ] diff --git a/view/tree2/to/dts/test/array_channel_boolean.test.d.ts b/view/tree2/to/dts/test/array_channel_boolean.test.d.ts new file mode 100644 index 00000000000..beb50df9327 --- /dev/null +++ b/view/tree2/to/dts/test/array_channel_boolean.test.d.ts @@ -0,0 +1,9 @@ +declare namespace $ { + + export class Foo extends $mol_object { + bar( ): readonly unknown[] + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctbar%20%2F%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctfalse%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Cttrue%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%3BAADL%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/array_channel_inheritance.test.d.ts b/view/tree2/to/dts/test/array_channel_inheritance.test.d.ts new file mode 100644 index 00000000000..f020e58b621 --- /dev/null +++ b/view/tree2/to/dts/test/array_channel_inheritance.test.d.ts @@ -0,0 +1,13 @@ +declare namespace $ { + + export class Foo extends $mol_object { + arr( ): readonly unknown[] + } + + export class Bar extends Foo { + arr( ): readonly unknown[] + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctarr%20%2F%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5C%5Cv1%5Cn%5Ct%5Ct%5Ct%5CtBar%20Foo%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctarr%20%2F%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5C%5Cv3%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5E%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5C%5Cv4%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%3BAADL%3BAADJ%3BAAII%2CiBAAI%2CYAAJ%3BAACC%2CAAAA%2CUAAI%3BAADL%3BAAJJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/array_channel_number.test.d.ts b/view/tree2/to/dts/test/array_channel_number.test.d.ts new file mode 100644 index 00000000000..f0843276ad7 --- /dev/null +++ b/view/tree2/to/dts/test/array_channel_number.test.d.ts @@ -0,0 +1,9 @@ +declare namespace $ { + + export class Foo extends $mol_object { + bar( ): readonly unknown[] + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctbar%20%2F%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct-%20NaN%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct-Infinity%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%2BInfinity%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct0%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%3BAADL%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/array_channel_of_array_or_object.test.d.ts b/view/tree2/to/dts/test/array_channel_of_array_or_object.test.d.ts new file mode 100644 index 00000000000..daece295871 --- /dev/null +++ b/view/tree2/to/dts/test/array_channel_of_array_or_object.test.d.ts @@ -0,0 +1,9 @@ +declare namespace $ { + + export class Foo extends $mol_object { + complex( ): readonly unknown[] + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctcomplex%20%2F%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%2F%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5C%5Ctest1%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctstr%20%5C%5Csome%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctnul%20null%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CcAAQ%3BAADT%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/array_channel_spread_other_channel.test.d.ts b/view/tree2/to/dts/test/array_channel_spread_other_channel.test.d.ts new file mode 100644 index 00000000000..a016aba6e76 --- /dev/null +++ b/view/tree2/to/dts/test/array_channel_spread_other_channel.test.d.ts @@ -0,0 +1,10 @@ +declare namespace $ { + + export class Bar extends $mol_object { + sup( ): readonly unknown[] + arr( ): readonly unknown[] + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtBar%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctsup%20%2F%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5C%5Cv1%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctarr%20%2F%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5C%5Cv2%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5E%20sup%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%3BAAEJ%2CAAAA%2CUAAI%3BAAHL%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/array_channel_with_types.test.d.ts b/view/tree2/to/dts/test/array_channel_with_types.test.d.ts new file mode 100644 index 00000000000..6a723fafb23 --- /dev/null +++ b/view/tree2/to/dts/test/array_channel_with_types.test.d.ts @@ -0,0 +1,9 @@ +declare namespace $ { + + export class Foo extends $mol_object { + arr( ): readonly readonly(number)[][] + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctarr%20%2Freadonly(number)%5B%5D%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%3BAADL%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/bidi_bind_chaining.test.d.ts b/view/tree2/to/dts/test/bidi_bind_chaining.test.d.ts new file mode 100644 index 00000000000..ea322fd6b41 --- /dev/null +++ b/view/tree2/to/dts/test/bidi_bind_chaining.test.d.ts @@ -0,0 +1,11 @@ +declare namespace $ { + + export class Foo extends $mol_object { + a( next?: ReturnType< Foo["b"] > ): ReturnType< Foo["b"] > + c( next?: any ): any + b( next?: ReturnType< Foo["c"] > ): ReturnType< Foo["c"] > + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Cta%3F%20%3C%3D%3E%20b%3F%20%3C%3D%3E%20c%3F%20null%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CYAAG%2CYADJ%2CGACI%2CEAAI%2CCAAJ%2CIAAH%2CIAAG%2CYADJ%2CGACI%2CEAAI%2CCAAJ%3BAAAW%2CAAAA%2CYAAG%2CGAAH%2CIAAG%3BAAAV%2CAAAA%2CYAAG%2CYADX%2CGACW%2CEAAI%2CCAAJ%2CIAAH%2CIAAG%2CYADX%2CGACW%2CEAAI%2CCAAJ%3BAADX%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/bidi_bind_doubing_right_part_with_same_default.test.d.ts b/view/tree2/to/dts/test/bidi_bind_doubing_right_part_with_same_default.test.d.ts new file mode 100644 index 00000000000..a2b17542e21 --- /dev/null +++ b/view/tree2/to/dts/test/bidi_bind_doubing_right_part_with_same_default.test.d.ts @@ -0,0 +1,12 @@ +declare namespace $ { + + export class Foo extends $mol_object { + a( next?: ReturnType< Foo["b"] > ): ReturnType< Foo["b"] > + c( next?: ReturnType< Foo["b"] > ): ReturnType< Foo["b"] > + b( next?: any ): any + b( next?: any ): any + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Cta%3F%20%3C%3D%3E%20b%3F%20null%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctc%3F%20%3C%3D%3E%20b%3F%20null%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CYAAG%2CYADJ%2CGACI%2CEAAI%2CCAAJ%2CIAAH%2CIAAG%2CYADJ%2CGACI%2CEAAI%2CCAAJ%3BAACH%2CAAAA%2CYAAG%2CYAFJ%2CGAEI%2CEAAI%2CCAAJ%2CIAAH%2CIAAG%2CYAFJ%2CGAEI%2CEAAI%2CCAAJ%3BAADI%2CAAAA%2CYAAG%2CGAAH%2CIAAG%3BAACH%2CAAAA%2CYAAG%2CGAAH%2CIAAG%3BAAFX%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/bidi_bind_fallback.test.d.ts b/view/tree2/to/dts/test/bidi_bind_fallback.test.d.ts new file mode 100644 index 00000000000..351a225e895 --- /dev/null +++ b/view/tree2/to/dts/test/bidi_bind_fallback.test.d.ts @@ -0,0 +1,10 @@ +declare namespace $ { + + export class Foo extends $mol_object { + bar1( next?: ReturnType< Foo["bar2"] > ): ReturnType< Foo["bar2"] > + bar2( next?: number ): number + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctbar1%3F%20%3C%3D%3E%20bar2%3F%201%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CeAAM%2CYADP%2CGACO%2CEAAI%2CIAAJ%2CIAAN%2CIAAM%2CYADP%2CGACO%2CEAAI%2CIAAJ%3BAAAI%2CAAAA%2CeAAM%2CMAAN%2CIAAM%3BAADjB%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/bidi_bind_in_dictionary.test.d.ts b/view/tree2/to/dts/test/bidi_bind_in_dictionary.test.d.ts new file mode 100644 index 00000000000..8e0dd09c83a --- /dev/null +++ b/view/tree2/to/dts/test/bidi_bind_in_dictionary.test.d.ts @@ -0,0 +1,12 @@ +declare namespace $ { + + export class Foo extends $mol_object { + event( ): ({ + 'click?': ReturnType< Foo["run"] >, + }) + run( next?: any ): any + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctevent%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctclick%3F%20%3C%3D%3E%20run%3F%20null%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CYAAM%3BAAAA%2CAACL%2CaAAO%2CYAFT%2CGAES%2CEAAI%2CGAAJ%2CIAAP%3BAADK%3BAACM%2CAAAA%2CcAAK%2CGAAL%2CIAAK%3BAAFlB%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/bidi_bind_indexed.test.d.ts b/view/tree2/to/dts/test/bidi_bind_indexed.test.d.ts new file mode 100644 index 00000000000..b2f9a330cb7 --- /dev/null +++ b/view/tree2/to/dts/test/bidi_bind_indexed.test.d.ts @@ -0,0 +1,10 @@ +declare namespace $ { + + export class Foo extends $mol_object { + indexed( id: any, next?: ReturnType< Foo["owner"] > ): ReturnType< Foo["owner"] > + owner( id: any, next?: any ): any + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctindexed*%3F%20%3C%3D%3E%20owner*%3F%20null%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2C2BAAU%2CYADX%2CGACW%2CEAAI%2CKAAJ%2CIAAV%2CIAAU%2CYADX%2CGACW%2CEAAI%2CKAAJ%3BAAAI%2CAAAA%2CyBAAQ%2CGAAR%2CIAAQ%3BAADvB%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/bidi_bind_indexed_second_level.test.d.ts b/view/tree2/to/dts/test/bidi_bind_indexed_second_level.test.d.ts new file mode 100644 index 00000000000..626358d518f --- /dev/null +++ b/view/tree2/to/dts/test/bidi_bind_indexed_second_level.test.d.ts @@ -0,0 +1,14 @@ +declare namespace $ { + + type $mol_object__expanded_D14CYQ3C = $mol_type_enforce< + ReturnType< Foo["owner"] >, + ReturnType< $mol_object["expanded"] > + > + export class Foo extends $mol_object { + indexed( id: any, next?: $mol_object ): $mol_object + owner( id: any, next?: any ): any + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctindexed*%3F%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctexpanded%20%3C%3D%3E%20owner*%3F%20null%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAAGM%3BAAAA%2CAAAA%2CEAAS%2CYAFX%2CGAEW%2CEAAI%2CKAAJ%2CIADA%3BAACT%2CEADS%2CyBACT%2CQADS%3BAAAA%3BAADX%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2C2BAAU%2CWAAV%2CIAAU%3BAACI%2CAAAA%2CyBAAQ%2CGAAR%2CIAAQ%3BAAFvB%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/bidi_bind_legacy_value.test.d.ts b/view/tree2/to/dts/test/bidi_bind_legacy_value.test.d.ts new file mode 100644 index 00000000000..23bd97f40e8 --- /dev/null +++ b/view/tree2/to/dts/test/bidi_bind_legacy_value.test.d.ts @@ -0,0 +1,10 @@ +declare namespace $ { + + export class Foo extends $mol_object { + a( next?: ReturnType< Foo["b"] > ): ReturnType< Foo["b"] > + b( next?: number ): number + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Cta%3Fv%20%3C%3D%3E%20b%3Fv%201%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CYAAI%2CYADL%2CGACK%2CEAAI%2CCAAJ%2CIAAJ%2CIAAI%2CYADL%2CGACK%2CEAAI%2CCAAJ%3BAAAI%2CAAAA%2CYAAI%2CMAAJ%2CIAAI%3BAADb%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/bidi_bind_localized_default_value.test.d.ts b/view/tree2/to/dts/test/bidi_bind_localized_default_value.test.d.ts new file mode 100644 index 00000000000..cf4dfc5f45b --- /dev/null +++ b/view/tree2/to/dts/test/bidi_bind_localized_default_value.test.d.ts @@ -0,0 +1,10 @@ +declare namespace $ { + + export class Foo extends $mol_object { + a( next?: ReturnType< Foo["b"] > ): ReturnType< Foo["b"] > + b( next?: string ): string + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Cta%3F%20%3C%3D%3E%20b%3F%20%40%20%5C%5Csome1%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CYAAG%2CYADJ%2CGACI%2CEAAI%2CCAAJ%2CIAAH%2CIAAG%2CYADJ%2CGACI%2CEAAI%2CCAAJ%3BAAAI%2CAAAA%2CYAAM%2CMAAN%2CIAAM%3BAADd%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/bidi_bind_localized_in_object.test.d.ts b/view/tree2/to/dts/test/bidi_bind_localized_in_object.test.d.ts new file mode 100644 index 00000000000..a7765520936 --- /dev/null +++ b/view/tree2/to/dts/test/bidi_bind_localized_in_object.test.d.ts @@ -0,0 +1,12 @@ +declare namespace $ { + + export class Foo extends $mol_object { + obj( ): ({ + 'loc?': ReturnType< Foo["outer"] >, + }) + outer( next?: string ): string + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctobj%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctloc%3F%20%3C%3D%3E%20outer%3F%20%40%20%5C%5Ctest1%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%3BAAAA%2CAACH%2CWAAK%2CYAFP%2CGAEO%2CEAAI%2CKAAJ%2CIAAL%3BAADG%3BAACM%2CAAAA%2CgBAAU%2CMAAV%2CIAAU%3BAAFrB%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/bidi_bind_with_default_object.test.d.ts b/view/tree2/to/dts/test/bidi_bind_with_default_object.test.d.ts new file mode 100644 index 00000000000..0a732235d1d --- /dev/null +++ b/view/tree2/to/dts/test/bidi_bind_with_default_object.test.d.ts @@ -0,0 +1,10 @@ +declare namespace $ { + + export class Foo extends $mol_object { + class( next?: ReturnType< Foo["owner"] > ): ReturnType< Foo["owner"] > + owner( next?: $mol_object ): $mol_object + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctclass%3F%20%3C%3D%3E%20owner%3F%20%24mol_object%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CgBAAO%2CYADR%2CGACQ%2CEAAI%2CKAAJ%2CIAAP%2CIAAO%2CYADR%2CGACQ%2CEAAI%2CKAAJ%3BAAAI%2CAAAA%2CgBAAO%2CWAAP%2CIAAO%3BAADnB%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/bidi_bind_with_separate_default_in_right_part.test.d.ts b/view/tree2/to/dts/test/bidi_bind_with_separate_default_in_right_part.test.d.ts new file mode 100644 index 00000000000..702151002f6 --- /dev/null +++ b/view/tree2/to/dts/test/bidi_bind_with_separate_default_in_right_part.test.d.ts @@ -0,0 +1,10 @@ +declare namespace $ { + + export class Foo extends $mol_object { + a( next?: ReturnType< Foo["b"] > ): ReturnType< Foo["b"] > + b( next?: any ): any + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Cta%3F%20%3C%3D%3E%20b%3F%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctb%3F%20null%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CYAAG%2CYADJ%2CGACI%2CEAAI%2CCAAJ%2CIAAH%2CIAAG%2CYADJ%2CGACI%2CEAAI%2CCAAJ%3BAACH%2CAAAA%2CYAAG%2CGAAH%2CIAAG%3BAAFJ%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/left_bind_chaining.test.d.ts b/view/tree2/to/dts/test/left_bind_chaining.test.d.ts new file mode 100644 index 00000000000..9db982b05c1 --- /dev/null +++ b/view/tree2/to/dts/test/left_bind_chaining.test.d.ts @@ -0,0 +1,11 @@ +declare namespace $ { + + export class Foo extends $mol_object { + a( next?: ReturnType< Foo["b"] > ): ReturnType< Foo["b"] > + c( next?: any ): any + b( next?: ReturnType< Foo["c"] > ): ReturnType< Foo["c"] > + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Cta%3F%20%3C%3D%20b%3F%20%3C%3D%20c%3F%20null%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CYAAG%2CYADJ%2CGACI%2CEAAG%2CCAAH%2CIAAH%2CIAAG%2CYADJ%2CGACI%2CEAAG%2CCAAH%3BAAAS%2CAAAA%2CYAAG%2CGAAH%2CIAAG%3BAAAT%2CAAAA%2CYAAG%2CYADV%2CGACU%2CEAAG%2CCAAH%2CIAAH%2CIAAG%2CYADV%2CGACU%2CEAAG%2CCAAH%3BAADV%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/left_bind_in_array_and_object.test.d.ts b/view/tree2/to/dts/test/left_bind_in_array_and_object.test.d.ts new file mode 100644 index 00000000000..234d83e455b --- /dev/null +++ b/view/tree2/to/dts/test/left_bind_in_array_and_object.test.d.ts @@ -0,0 +1,18 @@ +declare namespace $ { + + type $mol_object__rows_2B435VAM = $mol_type_enforce< + ReturnType< Foo["content"] >, + ReturnType< $mol_object["rows"] > + > + export class Foo extends $mol_object { + obj( ): ({ + 'prop': ReturnType< Foo["Obj"] >, + }) + arr( ): readonly unknown[] + content( ): readonly unknown[] + Obj( ): $mol_object + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctobj%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctprop%20%3C%3D%20Obj%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctarr%20%2F%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%3C%3D%20Obj%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctrows%20%3C%3D%20content%20%2F%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAAMO%3BAAAA%2CAAAA%2CEAAK%2CYALR%2CGAKQ%2CEAAG%2COAAH%2CIADC%3BAACN%2CEADM%2CyBACN%2CIADM%3BAAAA%3BAAJT%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%3BAAAA%2CAACH%2CWAAK%2CYAFP%2CGAEO%2CEAAG%2CGAAH%2CIAAL%3BAADG%3BAAEJ%2CAAAA%2CUAAI%3BAAEM%2CAAAA%2CcAAQ%3BAADd%2CAAAA%2CUAAI%3BAAJT%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/left_bind_read_only.test.d.ts b/view/tree2/to/dts/test/left_bind_read_only.test.d.ts new file mode 100644 index 00000000000..829fff9f55d --- /dev/null +++ b/view/tree2/to/dts/test/left_bind_read_only.test.d.ts @@ -0,0 +1,10 @@ +declare namespace $ { + + export class Foo extends $mol_object { + bar1( ): ReturnType< Foo["bar2"] > + bar2( next?: number ): number + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctbar1%20%3C%3D%20bar2%3F%201%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CWAAK%2CYADN%2CGACM%2CEAAG%2CIAAH%3BAAAG%2CAAAA%2CeAAM%2CMAAN%2CIAAM%3BAADf%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/left_bind_second_level_index.test.d.ts b/view/tree2/to/dts/test/left_bind_second_level_index.test.d.ts new file mode 100644 index 00000000000..20d6f403c6f --- /dev/null +++ b/view/tree2/to/dts/test/left_bind_second_level_index.test.d.ts @@ -0,0 +1,15 @@ +declare namespace $ { + + type $mol_object__localized_2NYAWVBQ = $mol_type_enforce< + ReturnType< Foo["some"] >, + ReturnType< $mol_object["localized"] > + > + export class Foo extends $mol_object { + cls( id: any, ): ReturnType< Foo["owner"] > + some( id: any, next?: string ): string + owner( id: any, next?: $mol_object ): $mol_object + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctcls*%20%3C%3D%20owner*%3F%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctlocalized%20%3C%3D%20some*%3F%20%40%20%5C%5Cv1%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAAGM%3BAAAA%2CAAAA%2CEAAU%2CYAFZ%2CGAEY%2CEAAG%2CIAAH%2CIADK%3BAACf%2CEADe%2CyBACf%2CSADe%3BAAAA%3BAADjB%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CmBAAK%2CYADN%2CGACM%2CEAAG%2CKAAH%3BAACS%2CAAAA%2CwBAAU%2CMAAV%2CIAAU%3BAADhB%2CAAAA%2CyBAAQ%2CWAAR%2CIAAQ%3BAADjB%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/left_bind_with_separate_default_and_comment.test.d.ts b/view/tree2/to/dts/test/left_bind_with_separate_default_and_comment.test.d.ts new file mode 100644 index 00000000000..8837c6a24cb --- /dev/null +++ b/view/tree2/to/dts/test/left_bind_with_separate_default_and_comment.test.d.ts @@ -0,0 +1,14 @@ +declare namespace $ { + + type $mol_object__rows_ZZ2VUPVS = $mol_type_enforce< + ReturnType< Foo["content"] >, + ReturnType< $mol_object["rows"] > + > + export class Foo extends $mol_object { + content( ): number + Obj( ): $mol_object + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctcontent%20123%5Cn%5Ct%5Ct%5Ct%5Ct%5CtObj%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctrows%20%3C%3D%20content%20-%20321%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAAIM%3BAAAA%2CAAAA%2CEAAK%2CYAHP%2CGAGO%2CEAAG%2COAAH%2CIADF%3BAACH%2CEADG%2CyBACH%2CIADG%3BAAAA%3BAAFL%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CcAAQ%3BAACR%2CAAAA%2CUAAI%3BAAFL%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/right_bind_in_left_bind.test.d.ts b/view/tree2/to/dts/test/right_bind_in_left_bind.test.d.ts new file mode 100644 index 00000000000..0dbf650b87b --- /dev/null +++ b/view/tree2/to/dts/test/right_bind_in_left_bind.test.d.ts @@ -0,0 +1,19 @@ +declare namespace $ { + + export class Foo extends $mol_object { + a( ): any + } + + type Foo__a_7XFXZG27 = $mol_type_enforce< + ReturnType< Bar["b"] >, + ReturnType< Foo["a"] > + > + export class Bar extends $mol_object { + foo( ): ReturnType< Bar["Cls"] > + Cls( ): Foo + b: ( )=> ReturnType< Foo["a"] > + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Cta%20null%5Cn%5Ct%5Ct%5Ct%5CtBar%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctfoo%20%3C%3D%20Cls%20Foo%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Cta%20%3D%3E%20b%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CQAAE%3BAADH%3BAADJ%3BAAKM%3BAAAA%2CAAAA%2CEAAE%2CYAFJ%2CGAEI%2CEAAG%2CCAAH%2CIADQ%3BAACV%2CEADU%2CiBACV%2CCADU%3BAAAA%3BAADZ%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%2CYADL%2CGACK%2CEAAG%2CGAAH%3BAAAG%2CAAAA%2CUAAI%3BAACL%2CAAAA%2CGAAH%2CEAAG%2CGAAH%2CeAFJ%2CGAEI%2CEAAF%2CCAAE%3BAAFJ%3BAAHJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/right_bind_indexed.test.d.ts b/view/tree2/to/dts/test/right_bind_indexed.test.d.ts new file mode 100644 index 00000000000..90710070180 --- /dev/null +++ b/view/tree2/to/dts/test/right_bind_indexed.test.d.ts @@ -0,0 +1,22 @@ +declare namespace $ { + + export class Foo extends $mol_object { + a( next?: ({ + 'some': number, + }) ): ({ + 'some': number, + }) + } + + type Foo__a_K7UUVX4U = $mol_type_enforce< + ReturnType< Bar["b"] >, + ReturnType< Foo["a"] > + > + export class Bar extends $mol_object { + Cls( id: any, ): Foo + b: ( id: any, )=> ReturnType< Foo["a"] > + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Cta%3F%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctsome%20123%5Cn%5Ct%5Ct%5Ct%5CtBar%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5CtCls*%20Foo%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Cta%20%3D%3E%20b*%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CYAAG%3BAAAA%2CAACF%2CWAAK%2CMAAL%3BAADE%2CEAAH%2CIAAG%3BAAAA%2CAACF%2CWAAK%2CMAAL%3BAADE%3BAADJ%3BAADJ%3BAAMM%3BAAAA%2CAAAA%2CEAAE%2CYAFJ%2CGAEI%2CEAAG%2CCAAH%2CIADE%3BAACJ%2CEADI%2CiBACJ%2CCADI%3BAAAA%3BAADN%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CmBAAK%3BAACC%2CAAAA%2CGAAH%2CEAAG%2CYAAH%2CeAFJ%2CGAEI%2CEAAF%2CCAAE%3BAAFJ%3BAAJJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/right_bind_read_only.test.d.ts b/view/tree2/to/dts/test/right_bind_read_only.test.d.ts new file mode 100644 index 00000000000..9b86dbf9de2 --- /dev/null +++ b/view/tree2/to/dts/test/right_bind_read_only.test.d.ts @@ -0,0 +1,18 @@ +declare namespace $ { + + export class Foo extends $mol_object { + a( id: any, next?: any ): any + } + + type Foo__a_HSQ8HGD5 = $mol_type_enforce< + ReturnType< Bar["b"] >, + ReturnType< Foo["a"] > + > + export class Bar extends $mol_object { + Obj( ): Foo + b: ( id: any, next?: ReturnType< Foo["a"] > )=> ReturnType< Foo["a"] > + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Cta*%3F%20null%5Cn%5Ct%5Ct%5Ct%5CtBar%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5CtObj%20Foo%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Cta*%3F%20%3D%3E%20b*%3F%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CqBAAI%2CGAAJ%2CIAAI%3BAADL%3BAADJ%3BAAKM%3BAAAA%2CAAAA%2CEAAI%2CYAFN%2CGAEM%2CEAAG%2CCAAH%2CIADD%3BAACH%2CEADG%2CiBACH%2CCADG%3BAAAA%3BAADL%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%3BAACI%2CAAAA%2CGAAH%2CEAAG%2CkBAAH%2CYAFN%2CGAEM%2CEAAJ%2CCAAI%2CIAAG%2CEAAH%2CeAFN%2CGAEM%2CEAAJ%2CCAAI%3BAAFN%3BAAHJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/simple_commented_node.test.d.ts b/view/tree2/to/dts/test/simple_commented_node.test.d.ts new file mode 100644 index 00000000000..10e0297c115 --- /dev/null +++ b/view/tree2/to/dts/test/simple_commented_node.test.d.ts @@ -0,0 +1,9 @@ +declare namespace $ { + + export class A2 extends $mol_object { + str( ): string + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtA2%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctstr%20%5C%5Csome%5Cn%5Ct%5Ct%5Ct%5Ct-%20B2%20A2%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctstr%20%5C%5Csome2%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CgBAAG%2CoBAAH%3BAACC%2CAAAA%2CUAAK%3BAADN%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/simple_default_indexed_channel.test.d.ts b/view/tree2/to/dts/test/simple_default_indexed_channel.test.d.ts new file mode 100644 index 00000000000..c52fc303341 --- /dev/null +++ b/view/tree2/to/dts/test/simple_default_indexed_channel.test.d.ts @@ -0,0 +1,9 @@ +declare namespace $ { + + export class Foo extends $mol_object { + a( id: any, next?: any ): any + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Cta*%3F%20null%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CqBAAI%2CGAAJ%2CIAAI%3BAADL%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/simple_empty_class.test.d.ts b/view/tree2/to/dts/test/simple_empty_class.test.d.ts new file mode 100644 index 00000000000..0f4d56acee6 --- /dev/null +++ b/view/tree2/to/dts/test/simple_empty_class.test.d.ts @@ -0,0 +1,8 @@ +declare namespace $ { + + export class Foo extends $mol_object { + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAAAA%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/simple_factory_props.test.d.ts b/view/tree2/to/dts/test/simple_factory_props.test.d.ts new file mode 100644 index 00000000000..0eedb71cc2b --- /dev/null +++ b/view/tree2/to/dts/test/simple_factory_props.test.d.ts @@ -0,0 +1,21 @@ +declare namespace $ { + + type $mol_object__some_J9JJ7XNV = $mol_type_enforce< + boolean, + ReturnType< $mol_object["some"] > + > + type $mol_object__loc_GCXJJQS2 = $mol_type_enforce< + string, + ReturnType< $mol_object["loc"] > + > + type $mol_object__sub_R3YVNCK5 = $mol_type_enforce< + readonly unknown[], + ReturnType< $mol_object["sub"] > + > + export class Foo extends $mol_object { + button( ): $mol_object + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctbutton%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctsome%20true%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctloc%20%40%20%5C%5Cv1%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctsub%20%2F%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct1%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAAGM%3BAAAA%2CAAAA%2CEAAK%2COADC%3BAACN%2CEADM%2CyBACN%2CIADM%3BAAAA%3BAAEN%3BAAAA%2CAAAA%2CEAAO%2CMAFD%3BAAEN%2CEAFM%2CyBAEN%2CGAFM%3BAAAA%3BAAGN%3BAAAA%2CAAAA%2CEAAI%2CkBAHE%3BAAGN%2CEAHM%2CyBAGN%2CGAHM%3BAAAA%3BAADR%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CaAAO%3BAADR%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/simple_mutable_and_read_only_channels.test.d.ts b/view/tree2/to/dts/test/simple_mutable_and_read_only_channels.test.d.ts new file mode 100644 index 00000000000..e9587f10905 --- /dev/null +++ b/view/tree2/to/dts/test/simple_mutable_and_read_only_channels.test.d.ts @@ -0,0 +1,10 @@ +declare namespace $ { + + export class Foo extends $mol_object { + readonly( ): any + mutable( next?: any ): any + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctreadonly%20null%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctmutable%3F%20null%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CeAAS%3BAACT%2CAAAA%2CkBAAS%2CGAAT%2CIAAS%3BAAFV%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/simple_string_channel.test.d.ts b/view/tree2/to/dts/test/simple_string_channel.test.d.ts new file mode 100644 index 00000000000..b9ab349f860 --- /dev/null +++ b/view/tree2/to/dts/test/simple_string_channel.test.d.ts @@ -0,0 +1,10 @@ +declare namespace $ { + + export class Foo extends $mol_object { + hardcoded( ): string + localized( ): string + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Cthardcoded%20%5C%5C%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5C%5CFirst%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5C%5CSecond%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctlocalized%20%40%20%5C%5C%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CgBAAW%3BAAGX%2CAAAA%2CgBAAa%3BAAJd%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/simple_two_classes.test.d.ts b/view/tree2/to/dts/test/simple_two_classes.test.d.ts new file mode 100644 index 00000000000..255923aa046 --- /dev/null +++ b/view/tree2/to/dts/test/simple_two_classes.test.d.ts @@ -0,0 +1,13 @@ +declare namespace $ { + + export class A2 extends $mol_object { + str( ): string + } + + export class B2 extends A2 { + str( ): string + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtA2%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctstr%20%5C%5Csome%5Cn%5Ct%5Ct%5Ct%5Ct%5Cn%5Ct%5Ct%5Ct%5CtB2%20A2%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctstr%20%5C%5Csome2%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CgBAAG%2CoBAAH%3BAACC%2CAAAA%2CUAAK%3BAADN%3BAADJ%3BAAII%2CgBAAG%2CWAAH%3BAACC%2CAAAA%2CUAAK%3BAADN%3BAAJJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/structural_channel.test.d.ts b/view/tree2/to/dts/test/structural_channel.test.d.ts new file mode 100644 index 00000000000..f6138490874 --- /dev/null +++ b/view/tree2/to/dts/test/structural_channel.test.d.ts @@ -0,0 +1,15 @@ +declare namespace $ { + + export class Foo extends $mol_object { + bar( ): ({ + 'alpha': number, + 'beta': ({ + }), + 'xxx': ReturnType< Foo["lol"] >, + }) + lol( ): number + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctbar%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctalpha%201%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctbeta%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctxxx%20%3C%3D%20lol%202%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%3BAAAA%2CAACH%2CYAAM%2CMAAN%3BAACA%2CWAAK%3BAAAA%3BAAAA%2CEAAL%3BAACA%2CUAAI%2CYAJN%2CGAIM%2CEAAG%2CGAAH%2CIAAJ%3BAAHG%3BAAGI%2CAAAA%2CUAAI%3BAAJb%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/structural_channel_localized_prop_value.test.d.ts b/view/tree2/to/dts/test/structural_channel_localized_prop_value.test.d.ts new file mode 100644 index 00000000000..53ac94ce665 --- /dev/null +++ b/view/tree2/to/dts/test/structural_channel_localized_prop_value.test.d.ts @@ -0,0 +1,14 @@ +declare namespace $ { + + export class Foo extends $mol_object { + bar( ): ({ + 'loc': string, + 'baz': ({ + 'loc2': string, + }), + }) + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctbar%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctloc%20%40%20%5C%5Cv1%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctbaz%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctloc2%20%40%20%5C%5Cv2%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%3BAAAA%2CAACH%2CUAAO%2CMAAP%3BAACA%2CUAAI%3BAAAA%2CAACH%2CYAAQ%2CMAAR%3BAADG%2CEAAJ%3BAAFG%3BAADL%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/structural_channel_quoted_props.test.d.ts b/view/tree2/to/dts/test/structural_channel_quoted_props.test.d.ts new file mode 100644 index 00000000000..113c19b1c8f --- /dev/null +++ b/view/tree2/to/dts/test/structural_channel_quoted_props.test.d.ts @@ -0,0 +1,13 @@ +declare namespace $ { + + export class Foo extends $mol_object { + bar( ): ({ + '$a': number, + 'b-t': ({ + }), + }) + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctbar%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%24a%201%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctb-t%20*%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CUAAI%3BAAAA%2CAACH%2CSAAG%2CMAAH%3BAACA%2CUAAI%3BAAAA%3BAAAA%2CEAAJ%3BAAFG%3BAADL%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/structural_channel_spread_other_channel.test.d.ts b/view/tree2/to/dts/test/structural_channel_spread_other_channel.test.d.ts new file mode 100644 index 00000000000..2998089696b --- /dev/null +++ b/view/tree2/to/dts/test/structural_channel_spread_other_channel.test.d.ts @@ -0,0 +1,14 @@ +declare namespace $ { + + export class Bar extends $mol_object { + test( ): ({ + 'aaa': number, + }) + field( ): ReturnType< $mol_object["field"] > & ({ + 'bbb': number, + }) + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtBar%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Cttest%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctaaa%20123%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctfield%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctbbb%20321%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5E%20test%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CWAAK%3BAAAA%2CAACJ%2CUAAI%2CMAAJ%3BAADI%3BAAEL%2CAAAA%2CYAEC%2CYALE%2CWAKF%2CEAFD%2CKAEC%2COAFK%3BAAAA%2CAACL%2CUAAI%2CMAAJ%3BAADK%3BAAHP%3BAADJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/dts/test/structural_channel_with_inheritance.test.d.ts b/view/tree2/to/dts/test/structural_channel_with_inheritance.test.d.ts new file mode 100644 index 00000000000..fc35d85dc5e --- /dev/null +++ b/view/tree2/to/dts/test/structural_channel_with_inheritance.test.d.ts @@ -0,0 +1,18 @@ +declare namespace $ { + + export class Foo extends $mol_object { + field( ): ({ + 'xxx': number, + }) + } + + export class Bar extends Foo { + field( ): ReturnType< Foo["field"] > & ({ + 'yyy': number, + 'zzz': number, + }) + } + +} + +//# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%22%3F%22%5D%2C%22sourcesContent%22%3A%5B%22%5Cn%5Ct%5Ct%5Ct%5CtFoo%20%24mol_object%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctfield%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctxxx%20123%5Cn%5Ct%5Ct%5Ct%5CtBar%20Foo%5Cn%5Ct%5Ct%5Ct%5Ct%5Ctfield%20*%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctyyy%20234%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ct%5E%5Cn%5Ct%5Ct%5Ct%5Ct%5Ct%5Ctzzz%20345%5Cn%5Ct%5Ct%5Ct%22%5D%2C%22mappings%22%3A%22%3B%3BAAAA%3BAAAA%3BAAAA%2CAACI%2CiBAAI%2CoBAAJ%3BAACC%2CAAAA%2CYAAM%3BAAAA%2CAACL%2CUAAI%2CMAAJ%3BAADK%3BAADP%3BAADJ%3BAAII%2CiBAAI%2CYAAJ%3BAACC%2CAAAA%2CYAEC%2CYAHE%2CGAGF%2CEAFD%2CKAEC%2COAFK%3BAAAA%2CAACL%2CUAAI%2CMAAJ%3BAAEA%2CUAAI%2CMAAJ%3BAAHK%3BAADP%3BAAJJ%3BAAAA%3B%22%7D \ No newline at end of file diff --git a/view/tree2/to/js/js.simple.test.ts b/view/tree2/to/js/js.simple.test.ts index ca2786a91f8..894dc818a8c 100644 --- a/view/tree2/to/js/js.simple.test.ts +++ b/view/tree2/to/js/js.simple.test.ts @@ -4,7 +4,7 @@ namespace $ { $mol_test({ - 'Empty class'( $ ) { + 'simple empty class'( $ ) { const { Foo } = run(` Foo $mol_object @@ -14,7 +14,7 @@ namespace $ { }, - 'Mutable and read only channels'( $ ) { + 'simple mutable and read only channels'( $ ) { const { Foo } = run(` Foo $mol_object @@ -44,7 +44,7 @@ namespace $ { }, - 'String channel'( $ ) { + 'simple string channel'( $ ) { const { Foo } = run(` Foo $mol_object @@ -66,7 +66,7 @@ namespace $ { }, - 'Default indexed channel'( $ ) { + 'simple default indexed channel'( $ ) { const { Foo } = run(` Foo $mol_object @@ -83,7 +83,7 @@ namespace $ { }, - 'empty legacy indexed channel throws error'( $ ) { + 'simple empty legacy indexed channel throws error'( $ ) { $mol_assert_fail(() => { run(` Foo $mol_object @@ -99,7 +99,7 @@ namespace $ { }) }, - 'two classes'( $ ) { + 'simple two classes'( $ ) { const { A2, B2 } = run(` A2 $mol_object str \\some @@ -117,7 +117,7 @@ namespace $ { $mol_assert_like( b.str(), 'some2') }, - 'commented node'( $ ) { + 'simple commented node'( $ ) { const { A2, B2 } = run(` A2 $mol_object str \\some @@ -130,7 +130,7 @@ namespace $ { $mol_assert_ok(B2 === undefined) }, - 'factory props'( $ ) { + 'simple factory props'( $ ) { const { Foo } = run(` Foo $mol_object button $mol_object diff --git a/view/tree2/to/js/js.dict.test.ts b/view/tree2/to/js/js.structural.test.ts similarity index 100% rename from view/tree2/to/js/js.dict.test.ts rename to view/tree2/to/js/js.structural.test.ts diff --git a/view/tree2/to/js/test/run.ts b/view/tree2/to/js/test/run.ts index b3cc99f7acf..33e1faebb5e 100644 --- a/view/tree2/to/js/test/run.ts +++ b/view/tree2/to/js/test/run.ts @@ -10,6 +10,12 @@ namespace $ { $mol_tree2_text_to_string_mapped_js, ).bind( $ ) + const make_types = $mol_data_pipe( + $mol_tree2_from_string, + $mol_view_tree2_to_dts, + $mol_tree2_text_to_string_mapped_js, + ).bind( $ ) + export function $mol_view_tree2_to_js_test_run( tree: string ): any { class $mol_object3 extends $mol_object { } @@ -17,10 +23,21 @@ namespace $ { ;( $mol_object3 as any )[$mol_ambient_ref] = $ const js_node = compile( tree ) const js = compile2( js_node ) + + const types = make_types(tree) + + const name = new Error('').stack + ?.split('\n').at(2)?.match(/ at (.*) \(/) + ?.[1].toLowerCase().replace(/[ .]/g, '_') ?? '' + + $mol_view_tree2_to_js_test_saver(`mol/view/tree2/to/dts/test/${name}.test.d.ts`, types) + eval( js ) + $.js = js $.js_node = js_node + return $ } } diff --git a/view/tree2/to/js/test/saver.node.ts b/view/tree2/to/js/test/saver.node.ts new file mode 100644 index 00000000000..033e76e38a7 --- /dev/null +++ b/view/tree2/to/js/test/saver.node.ts @@ -0,0 +1,7 @@ +namespace $ { + export function $mol_view_tree2_to_js_test_saver_node(path: string, data: string) { + $mol_file.relative(path).text(data) + } + + $.$mol_view_tree2_to_js_test_saver = $.$mol_view_tree2_to_js_test_saver_node +} diff --git a/view/tree2/to/js/test/saver.ts b/view/tree2/to/js/test/saver.ts new file mode 100644 index 00000000000..087f7ed449a --- /dev/null +++ b/view/tree2/to/js/test/saver.ts @@ -0,0 +1,3 @@ +namespace $ { + export function $mol_view_tree2_to_js_test_saver(path: string, data: string) {} +}