metano-runtime 2.10.1 → 3.0.1
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/README.md +11 -1
- package/dist/system/argument-guards.d.ts +63 -0
- package/dist/system/argument-guards.js +155 -0
- package/dist/system/array-length.d.ts +6 -0
- package/dist/system/array-length.js +17 -0
- package/dist/system/big-integer.d.ts +50 -0
- package/dist/system/big-integer.js +108 -0
- package/dist/system/boolean-format.d.ts +6 -0
- package/dist/system/boolean-format.js +11 -0
- package/dist/system/collections/builder-iterator.d.ts +14 -0
- package/dist/system/collections/builder-iterator.js +15 -0
- package/dist/system/collections/checks.d.ts +17 -0
- package/dist/system/collections/checks.js +0 -0
- package/dist/system/collections/close-collection.d.ts +33 -0
- package/dist/system/collections/close-collection.js +68 -0
- package/dist/system/collections/collection-type-name.d.ts +11 -0
- package/dist/system/collections/collection-type-name.js +19 -0
- package/dist/system/collections/concurrent-dictionary.d.ts +80 -0
- package/dist/system/collections/concurrent-dictionary.js +261 -0
- package/dist/system/collections/copy-to.d.ts +8 -0
- package/dist/system/collections/copy-to.js +37 -0
- package/dist/system/collections/default-comparer.d.ts +64 -0
- package/dist/system/collections/default-comparer.js +231 -0
- package/dist/system/collections/descriptors.d.ts +58 -0
- package/dist/system/collections/descriptors.js +181 -0
- package/dist/system/collections/dictionary-helpers.d.ts +3 -28
- package/dist/system/collections/dictionary-helpers.js +3 -38
- package/dist/system/collections/dictionary-views.d.ts +39 -0
- package/dist/system/collections/dictionary-views.js +153 -0
- package/dist/system/collections/dictionary.d.ts +68 -0
- package/dist/system/collections/dictionary.js +165 -0
- package/dist/system/collections/hash-core.d.ts +51 -0
- package/dist/system/collections/hash-core.js +160 -0
- package/dist/system/collections/hash-set.d.ts +51 -24
- package/dist/system/collections/hash-set.js +165 -137
- package/dist/system/collections/helpers.d.ts +29 -0
- package/dist/system/collections/helpers.js +73 -0
- package/dist/system/collections/immutable-array-builder.d.ts +37 -0
- package/dist/system/collections/immutable-array-builder.js +117 -0
- package/dist/system/collections/immutable-array.d.ts +74 -0
- package/dist/system/collections/immutable-array.js +243 -0
- package/dist/system/collections/immutable-dictionary-builder.d.ts +58 -0
- package/dist/system/collections/immutable-dictionary-builder.js +126 -0
- package/dist/system/collections/immutable-dictionary.d.ts +80 -0
- package/dist/system/collections/immutable-dictionary.js +284 -0
- package/dist/system/collections/immutable-hash-set-builder.d.ts +58 -0
- package/dist/system/collections/immutable-hash-set-builder.js +125 -0
- package/dist/system/collections/immutable-hash-set.d.ts +71 -0
- package/dist/system/collections/immutable-hash-set.js +242 -0
- package/dist/system/collections/immutable-interfaces.d.ts +51 -0
- package/dist/system/collections/immutable-interfaces.js +0 -0
- package/dist/system/collections/immutable-list-builder-core.d.ts +58 -0
- package/dist/system/collections/immutable-list-builder-core.js +136 -0
- package/dist/system/collections/immutable-list-builder.d.ts +35 -0
- package/dist/system/collections/immutable-list-builder.js +73 -0
- package/dist/system/collections/immutable-list-core.d.ts +98 -0
- package/dist/system/collections/immutable-list-core.js +268 -0
- package/dist/system/collections/immutable-list.d.ts +49 -0
- package/dist/system/collections/immutable-list.js +176 -0
- package/dist/system/collections/immutable-storage.d.ts +50 -0
- package/dist/system/collections/immutable-storage.js +83 -0
- package/dist/system/collections/index.d.ts +25 -2
- package/dist/system/collections/index.js +22 -2
- package/dist/system/collections/interfaces.d.ts +76 -0
- package/dist/system/collections/interfaces.js +0 -0
- package/dist/system/collections/list.d.ts +96 -0
- package/dist/system/collections/list.js +335 -0
- package/dist/system/collections/queue.d.ts +44 -0
- package/dist/system/collections/queue.js +115 -0
- package/dist/system/collections/read-only-list.d.ts +45 -0
- package/dist/system/collections/read-only-list.js +152 -0
- package/dist/system/collections/red-black-tree.d.ts +64 -0
- package/dist/system/collections/red-black-tree.js +361 -0
- package/dist/system/collections/set-algebra.d.ts +15 -0
- package/dist/system/collections/set-algebra.js +58 -0
- package/dist/system/collections/sorted-array.d.ts +14 -0
- package/dist/system/collections/sorted-array.js +31 -0
- package/dist/system/collections/sorted-dictionary.d.ts +64 -0
- package/dist/system/collections/sorted-dictionary.js +163 -0
- package/dist/system/collections/sorted-list.d.ts +131 -0
- package/dist/system/collections/sorted-list.js +301 -0
- package/dist/system/collections/sorted-set.d.ts +98 -0
- package/dist/system/collections/sorted-set.js +255 -0
- package/dist/system/collections/stack.d.ts +39 -0
- package/dist/system/collections/stack.js +106 -0
- package/dist/system/collections/throw-helpers.d.ts +77 -0
- package/dist/system/collections/throw-helpers.js +158 -0
- package/dist/system/date-time-offset.d.ts +23 -0
- package/dist/system/date-time-offset.js +61 -0
- package/dist/system/decimal-parsing.d.ts +18 -0
- package/dist/system/decimal-parsing.js +74 -0
- package/dist/system/decimal.d.ts +20 -0
- package/dist/system/decimal.js +30 -0
- package/dist/system/default-text.d.ts +11 -0
- package/dist/system/default-text.js +52 -0
- package/dist/system/delegates.js +1 -1
- package/dist/system/double-format.d.ts +20 -0
- package/dist/system/double-format.js +171 -0
- package/dist/system/dynamic-conversion.d.ts +37 -0
- package/dist/system/dynamic-conversion.js +229 -0
- package/dist/system/equality.d.ts +23 -3
- package/dist/system/equality.js +135 -3
- package/dist/system/exceptions/argument-exception.d.ts +17 -0
- package/dist/system/exceptions/argument-exception.js +44 -0
- package/dist/system/exceptions/argument-null-exception.d.ts +16 -0
- package/dist/system/exceptions/argument-null-exception.js +35 -0
- package/dist/system/exceptions/argument-out-of-range-exception.d.ts +18 -0
- package/dist/system/exceptions/argument-out-of-range-exception.js +51 -0
- package/dist/system/exceptions/arithmetic-exception.d.ts +12 -0
- package/dist/system/exceptions/arithmetic-exception.js +31 -0
- package/dist/system/exceptions/divide-by-zero-exception.d.ts +12 -0
- package/dist/system/exceptions/divide-by-zero-exception.js +31 -0
- package/dist/system/exceptions/exception.d.ts +38 -0
- package/dist/system/exceptions/exception.js +77 -0
- package/dist/system/exceptions/format-exception.d.ts +12 -0
- package/dist/system/exceptions/format-exception.js +31 -0
- package/dist/system/exceptions/index-out-of-range-exception.d.ts +12 -0
- package/dist/system/exceptions/index-out-of-range-exception.js +31 -0
- package/dist/system/exceptions/index.d.ts +26 -0
- package/dist/system/exceptions/index.js +26 -0
- package/dist/system/exceptions/invalid-cast-exception.d.ts +12 -0
- package/dist/system/exceptions/invalid-cast-exception.js +31 -0
- package/dist/system/exceptions/invalid-operation-exception.d.ts +12 -0
- package/dist/system/exceptions/invalid-operation-exception.js +31 -0
- package/dist/system/exceptions/json-exception.d.ts +18 -0
- package/dist/system/exceptions/json-exception.js +39 -0
- package/dist/system/exceptions/key-not-found-exception.d.ts +13 -0
- package/dist/system/exceptions/key-not-found-exception.js +34 -0
- package/dist/system/exceptions/message-value.d.ts +7 -0
- package/dist/system/exceptions/message-value.js +9 -0
- package/dist/system/exceptions/missing-method-exception.d.ts +19 -0
- package/dist/system/exceptions/missing-method-exception.js +38 -0
- package/dist/system/exceptions/named-exception.d.ts +7 -0
- package/dist/system/exceptions/named-exception.js +29 -0
- package/dist/system/exceptions/not-implemented-exception.d.ts +12 -0
- package/dist/system/exceptions/not-implemented-exception.js +31 -0
- package/dist/system/exceptions/not-supported-exception.d.ts +12 -0
- package/dist/system/exceptions/not-supported-exception.js +31 -0
- package/dist/system/exceptions/null-reference-exception.d.ts +12 -0
- package/dist/system/exceptions/null-reference-exception.js +31 -0
- package/dist/system/exceptions/object-disposed-exception.d.ts +18 -0
- package/dist/system/exceptions/object-disposed-exception.js +41 -0
- package/dist/system/exceptions/operation-canceled-exception.d.ts +12 -0
- package/dist/system/exceptions/operation-canceled-exception.js +31 -0
- package/dist/system/exceptions/overflow-exception.d.ts +15 -0
- package/dist/system/exceptions/overflow-exception.js +34 -0
- package/dist/system/exceptions/switch-expression-exception.d.ts +21 -0
- package/dist/system/exceptions/switch-expression-exception.js +49 -0
- package/dist/system/exceptions/system-exception.d.ts +12 -0
- package/dist/system/exceptions/system-exception.js +31 -0
- package/dist/system/exceptions/task-canceled-exception.d.ts +13 -0
- package/dist/system/exceptions/task-canceled-exception.js +34 -0
- package/dist/system/exceptions/timeout-exception.d.ts +12 -0
- package/dist/system/exceptions/timeout-exception.js +31 -0
- package/dist/system/exceptions/to-exception.d.ts +25 -0
- package/dist/system/exceptions/to-exception.js +53 -0
- package/dist/system/exceptions/type-initialization-exception.d.ts +19 -0
- package/dist/system/exceptions/type-initialization-exception.js +36 -0
- package/dist/system/hash-code.d.ts +0 -7
- package/dist/system/hash-code.js +3 -1
- package/dist/system/identity-memo.d.ts +7 -0
- package/dist/system/identity-memo.js +14 -0
- package/dist/system/index.d.ts +21 -0
- package/dist/system/index.js +21 -0
- package/dist/system/int64-convert.d.ts +59 -0
- package/dist/system/int64-convert.js +226 -0
- package/dist/system/int64-format.d.ts +13 -0
- package/dist/system/int64-format.js +28 -0
- package/dist/system/int64-math.d.ts +56 -0
- package/dist/system/int64-math.js +109 -0
- package/dist/system/int64-parsing.d.ts +45 -0
- package/dist/system/int64-parsing.js +153 -0
- package/dist/system/int64.d.ts +134 -0
- package/dist/system/int64.js +298 -0
- package/dist/system/integer-division.d.ts +1 -1
- package/dist/system/integer-division.js +2 -3
- package/dist/system/integer-format.d.ts +12 -0
- package/dist/system/integer-format.js +22 -0
- package/dist/system/integer-standard-format.d.ts +9 -0
- package/dist/system/integer-standard-format.js +66 -0
- package/dist/system/json/byte-array-converter.d.ts +19 -0
- package/dist/system/json/byte-array-converter.js +106 -0
- package/dist/system/json/container-depth.d.ts +10 -0
- package/dist/system/json/container-depth.js +43 -16
- package/dist/system/json/contract-name.d.ts +8 -3
- package/dist/system/json/contract-name.js +22 -2
- package/dist/system/json/converter-set-cache.d.ts +17 -0
- package/dist/system/json/converter-set-cache.js +26 -0
- package/dist/system/json/converters.d.ts +27 -12
- package/dist/system/json/converters.js +498 -169
- package/dist/system/json/decimal-text.d.ts +9 -0
- package/dist/system/json/decimal-text.js +125 -0
- package/dist/system/json/dictionary-keys.d.ts +31 -0
- package/dist/system/json/dictionary-keys.js +195 -0
- package/dist/system/json/errors.d.ts +9 -11
- package/dist/system/json/errors.js +9 -11
- package/dist/system/json/exact-json-number.d.ts +103 -0
- package/dist/system/json/exact-json-number.js +155 -0
- package/dist/system/json/exact-number-reads.d.ts +21 -0
- package/dist/system/json/exact-number-reads.js +104 -0
- package/dist/system/json/index.d.ts +1 -2
- package/dist/system/json/index.js +0 -1
- package/dist/system/json/json-serializer.d.ts +64 -9
- package/dist/system/json/json-serializer.js +52 -12
- package/dist/system/json/json-text-reader.d.ts +33 -0
- package/dist/system/json/json-text-reader.js +608 -0
- package/dist/system/json/null-reads.d.ts +22 -0
- package/dist/system/json/null-reads.js +43 -0
- package/dist/system/json/number-from-string.d.ts +44 -0
- package/dist/system/json/number-from-string.js +248 -0
- package/dist/system/json/numeric-converters.d.ts +65 -0
- package/dist/system/json/numeric-converters.js +361 -0
- package/dist/system/json/numeric-enum-members.d.ts +18 -0
- package/dist/system/json/numeric-enum-members.js +18 -0
- package/dist/system/json/ordinal-ignore-case.d.ts +14 -0
- package/dist/system/json/ordinal-ignore-case.js +60 -0
- package/dist/system/json/polymorphism.d.ts +2 -0
- package/dist/system/json/polymorphism.js +101 -20
- package/dist/system/json/property-lookup.d.ts +17 -0
- package/dist/system/json/property-lookup.js +32 -0
- package/dist/system/json/property-naming-policy.d.ts +5 -5
- package/dist/system/json/property-naming-policy.js +163 -73
- package/dist/system/json/serializer-context.d.ts +19 -4
- package/dist/system/json/serializer-context.js +33 -7
- package/dist/system/json/spec-kind.d.ts +3 -0
- package/dist/system/json/spec-kind.js +4 -0
- package/dist/system/json/temporal-reads.d.ts +15 -0
- package/dist/system/json/temporal-reads.js +423 -0
- package/dist/system/json/temporal-text.d.ts +16 -0
- package/dist/system/json/temporal-text.js +32 -0
- package/dist/system/json/types.d.ts +190 -24
- package/dist/system/json/types.js +0 -1
- package/dist/system/json/value-converter.d.ts +5 -0
- package/dist/system/json/value-converter.js +0 -0
- package/dist/system/lazy-value.d.ts +9 -0
- package/dist/system/lazy-value.js +19 -0
- package/dist/system/linq/compare-keys.js +4 -0
- package/dist/system/linq/decimal-terminals.d.ts +24 -0
- package/dist/system/linq/decimal-terminals.js +67 -0
- package/dist/system/linq/expr-tree-visitor.d.ts +2 -27
- package/dist/system/linq/expr-tree-visitor.js +62 -0
- package/dist/system/linq/expr-tree.d.ts +11 -1
- package/dist/system/linq/index.d.ts +7 -4
- package/dist/system/linq/index.js +4 -2
- package/dist/system/linq/int64-terminals.d.ts +33 -0
- package/dist/system/linq/int64-terminals.js +131 -0
- package/dist/system/linq/operators.d.ts +7 -1
- package/dist/system/linq/operators.js +60 -2
- package/dist/system/linq/terminals.d.ts +85 -7
- package/dist/system/linq/terminals.js +220 -67
- package/dist/system/linq/types.d.ts +101 -20
- package/dist/system/math.d.ts +6 -5
- package/dist/system/math.js +26 -14
- package/dist/system/number-parsing.d.ts +43 -17
- package/dist/system/number-parsing.js +121 -37
- package/dist/system/record-copy.js +11 -0
- package/dist/system/reflection/box.d.ts +19 -0
- package/dist/system/reflection/box.js +32 -0
- package/dist/system/reflection/boxed-text.d.ts +8 -0
- package/dist/system/reflection/boxed-text.js +31 -0
- package/dist/system/reflection/cast-to.d.ts +15 -0
- package/dist/system/reflection/cast-to.js +32 -0
- package/dist/system/reflection/constructor-descriptor.d.ts +11 -0
- package/dist/system/reflection/constructor-descriptor.js +22 -0
- package/dist/system/reflection/create-instance.d.ts +6 -0
- package/dist/system/reflection/create-instance.js +11 -0
- package/dist/system/reflection/decimal-type-defaults.d.ts +7 -0
- package/dist/system/reflection/decimal-type-defaults.js +17 -0
- package/dist/system/reflection/enum-from-raw.d.ts +14 -0
- package/dist/system/reflection/enum-from-raw.js +89 -0
- package/dist/system/reflection/enum-is-defined.d.ts +7 -0
- package/dist/system/reflection/enum-is-defined.js +14 -0
- package/dist/system/reflection/get-number-type.d.ts +7 -0
- package/dist/system/reflection/get-number-type.js +10 -0
- package/dist/system/reflection/get-runtime-type-from-type.d.ts +6 -0
- package/dist/system/reflection/get-runtime-type-from-type.js +22 -0
- package/dist/system/reflection/get-runtime-type.d.ts +3 -0
- package/dist/system/reflection/get-runtime-type.js +105 -0
- package/dist/system/reflection/implements-interface.d.ts +10 -0
- package/dist/system/reflection/implements-interface.js +26 -0
- package/dist/system/reflection/index.d.ts +27 -0
- package/dist/system/reflection/index.js +26 -0
- package/dist/system/reflection/invalid-cast.d.ts +8 -0
- package/dist/system/reflection/invalid-cast.js +33 -0
- package/dist/system/reflection/is-assignable-from.d.ts +13 -0
- package/dist/system/reflection/is-assignable-from.js +121 -0
- package/dist/system/reflection/is-box-of.d.ts +3 -0
- package/dist/system/reflection/is-box-of.js +5 -0
- package/dist/system/reflection/is-boxed.d.ts +7 -0
- package/dist/system/reflection/is-boxed.js +9 -0
- package/dist/system/reflection/is-type.d.ts +12 -0
- package/dist/system/reflection/is-type.js +20 -0
- package/dist/system/reflection/nullable-type.d.ts +3 -0
- package/dist/system/reflection/nullable-type.js +19 -0
- package/dist/system/reflection/opaque-type.d.ts +6 -0
- package/dist/system/reflection/opaque-type.js +22 -0
- package/dist/system/reflection/primitive-types.d.ts +20 -0
- package/dist/system/reflection/primitive-types.js +160 -0
- package/dist/system/reflection/runtime-type.d.ts +131 -0
- package/dist/system/reflection/runtime-type.js +5 -0
- package/dist/system/reflection/specialize-collection.d.ts +11 -0
- package/dist/system/reflection/specialize-collection.js +93 -0
- package/dist/system/reflection/specialize.d.ts +7 -0
- package/dist/system/reflection/specialize.js +33 -0
- package/dist/system/reflection/temporal-type-defaults.d.ts +11 -0
- package/dist/system/reflection/temporal-type-defaults.js +61 -0
- package/dist/system/reflection/temporal-types.d.ts +7 -0
- package/dist/system/reflection/temporal-types.js +44 -0
- package/dist/system/reflection/to-string-tag.d.ts +6 -0
- package/dist/system/reflection/to-string-tag.js +8 -0
- package/dist/system/reflection/tuple-type.d.ts +6 -0
- package/dist/system/reflection/tuple-type.js +23 -0
- package/dist/system/reflection/unbox-for-cast.d.ts +10 -0
- package/dist/system/reflection/unbox-for-cast.js +28 -0
- package/dist/system/reflection/unbox-for.d.ts +9 -0
- package/dist/system/reflection/unbox-for.js +15 -0
- package/dist/system/reflection/unbox.d.ts +5 -0
- package/dist/system/reflection/unbox.js +8 -0
- package/dist/system/reflection/unsupported-type.d.ts +7 -0
- package/dist/system/reflection/unsupported-type.js +27 -0
- package/dist/system/reflection/well-known-types.d.ts +13 -0
- package/dist/system/reflection/well-known-types.js +32 -0
- package/dist/system/reflection/with-implementers.d.ts +8 -0
- package/dist/system/reflection/with-implementers.js +23 -0
- package/dist/system/standard-numeric-format.d.ts +67 -0
- package/dist/system/standard-numeric-format.js +213 -0
- package/dist/system/string-members.d.ts +170 -0
- package/dist/system/string-members.js +445 -0
- package/dist/system/strings.d.ts +13 -9
- package/dist/system/strings.js +17 -18
- package/dist/system/temporal-helpers.d.ts +33 -0
- package/dist/system/temporal-helpers.js +117 -2
- package/dist/system/time-span-format.d.ts +3 -0
- package/dist/system/time-span-format.js +17 -0
- package/dist/system/time-span.d.ts +33 -0
- package/dist/system/time-span.js +90 -0
- package/dist/system/type-initializer.d.ts +14 -0
- package/dist/system/type-initializer.js +36 -0
- package/dist/system/uuid.d.ts +54 -38
- package/dist/system/uuid.js +120 -79
- package/dist/type-checking/primitive-type-checks.d.ts +17 -5
- package/dist/type-checking/primitive-type-checks.js +22 -15
- package/dist-unchecked/index.d.ts +2 -0
- package/dist-unchecked/index.js +2 -0
- package/dist-unchecked/system/argument-guards.d.ts +63 -0
- package/dist-unchecked/system/argument-guards.js +155 -0
- package/dist-unchecked/system/array-length.d.ts +6 -0
- package/dist-unchecked/system/array-length.js +17 -0
- package/dist-unchecked/system/big-integer.d.ts +50 -0
- package/dist-unchecked/system/big-integer.js +108 -0
- package/dist-unchecked/system/bind-receiver.d.ts +26 -0
- package/dist-unchecked/system/bind-receiver.js +30 -0
- package/dist-unchecked/system/boolean-format.d.ts +6 -0
- package/dist-unchecked/system/boolean-format.js +11 -0
- package/dist-unchecked/system/collections/builder-iterator.d.ts +14 -0
- package/dist-unchecked/system/collections/builder-iterator.js +15 -0
- package/dist-unchecked/system/collections/checks.d.ts +17 -0
- package/dist-unchecked/system/collections/checks.js +0 -0
- package/dist-unchecked/system/collections/close-collection.d.ts +33 -0
- package/dist-unchecked/system/collections/close-collection.js +68 -0
- package/dist-unchecked/system/collections/collection-type-name.d.ts +11 -0
- package/dist-unchecked/system/collections/collection-type-name.js +19 -0
- package/dist-unchecked/system/collections/concurrent-dictionary.d.ts +80 -0
- package/dist-unchecked/system/collections/concurrent-dictionary.js +261 -0
- package/dist-unchecked/system/collections/copy-to.d.ts +8 -0
- package/dist-unchecked/system/collections/copy-to.js +37 -0
- package/dist-unchecked/system/collections/default-comparer.d.ts +64 -0
- package/dist-unchecked/system/collections/default-comparer.js +231 -0
- package/dist-unchecked/system/collections/descriptors.d.ts +58 -0
- package/dist-unchecked/system/collections/descriptors.js +181 -0
- package/dist-unchecked/system/collections/dictionary-helpers.d.ts +15 -0
- package/dist-unchecked/system/collections/dictionary-helpers.js +17 -0
- package/dist-unchecked/system/collections/dictionary-views.d.ts +39 -0
- package/dist-unchecked/system/collections/dictionary-views.js +153 -0
- package/dist-unchecked/system/collections/dictionary.d.ts +68 -0
- package/dist-unchecked/system/collections/dictionary.js +164 -0
- package/dist-unchecked/system/collections/hash-core.d.ts +51 -0
- package/dist-unchecked/system/collections/hash-core.js +160 -0
- package/dist-unchecked/system/collections/hash-set.d.ts +56 -0
- package/dist-unchecked/system/collections/hash-set.js +165 -0
- package/dist-unchecked/system/collections/helpers.d.ts +29 -0
- package/dist-unchecked/system/collections/helpers.js +73 -0
- package/dist-unchecked/system/collections/immutable-array-builder.d.ts +37 -0
- package/dist-unchecked/system/collections/immutable-array-builder.js +117 -0
- package/dist-unchecked/system/collections/immutable-array.d.ts +74 -0
- package/dist-unchecked/system/collections/immutable-array.js +243 -0
- package/dist-unchecked/system/collections/immutable-dictionary-builder.d.ts +58 -0
- package/dist-unchecked/system/collections/immutable-dictionary-builder.js +125 -0
- package/dist-unchecked/system/collections/immutable-dictionary.d.ts +80 -0
- package/dist-unchecked/system/collections/immutable-dictionary.js +284 -0
- package/dist-unchecked/system/collections/immutable-hash-set-builder.d.ts +58 -0
- package/dist-unchecked/system/collections/immutable-hash-set-builder.js +124 -0
- package/dist-unchecked/system/collections/immutable-hash-set.d.ts +71 -0
- package/dist-unchecked/system/collections/immutable-hash-set.js +242 -0
- package/dist-unchecked/system/collections/immutable-interfaces.d.ts +51 -0
- package/dist-unchecked/system/collections/immutable-interfaces.js +0 -0
- package/dist-unchecked/system/collections/immutable-list-builder-core.d.ts +58 -0
- package/dist-unchecked/system/collections/immutable-list-builder-core.js +136 -0
- package/dist-unchecked/system/collections/immutable-list-builder.d.ts +35 -0
- package/dist-unchecked/system/collections/immutable-list-builder.js +72 -0
- package/dist-unchecked/system/collections/immutable-list-core.d.ts +98 -0
- package/dist-unchecked/system/collections/immutable-list-core.js +268 -0
- package/dist-unchecked/system/collections/immutable-list.d.ts +49 -0
- package/dist-unchecked/system/collections/immutable-list.js +176 -0
- package/dist-unchecked/system/collections/immutable-storage.d.ts +50 -0
- package/dist-unchecked/system/collections/immutable-storage.js +83 -0
- package/dist-unchecked/system/collections/index.d.ts +27 -0
- package/dist-unchecked/system/collections/index.js +24 -0
- package/dist-unchecked/system/collections/interfaces.d.ts +76 -0
- package/dist-unchecked/system/collections/interfaces.js +0 -0
- package/dist-unchecked/system/collections/list.d.ts +96 -0
- package/dist-unchecked/system/collections/list.js +332 -0
- package/dist-unchecked/system/collections/queue.d.ts +44 -0
- package/dist-unchecked/system/collections/queue.js +114 -0
- package/dist-unchecked/system/collections/read-only-list.d.ts +45 -0
- package/dist-unchecked/system/collections/read-only-list.js +152 -0
- package/dist-unchecked/system/collections/red-black-tree.d.ts +64 -0
- package/dist-unchecked/system/collections/red-black-tree.js +361 -0
- package/dist-unchecked/system/collections/set-algebra.d.ts +15 -0
- package/dist-unchecked/system/collections/set-algebra.js +58 -0
- package/dist-unchecked/system/collections/sorted-array.d.ts +14 -0
- package/dist-unchecked/system/collections/sorted-array.js +31 -0
- package/dist-unchecked/system/collections/sorted-dictionary.d.ts +64 -0
- package/dist-unchecked/system/collections/sorted-dictionary.js +161 -0
- package/dist-unchecked/system/collections/sorted-list.d.ts +131 -0
- package/dist-unchecked/system/collections/sorted-list.js +300 -0
- package/dist-unchecked/system/collections/sorted-set.d.ts +98 -0
- package/dist-unchecked/system/collections/sorted-set.js +253 -0
- package/dist-unchecked/system/collections/stack.d.ts +39 -0
- package/dist-unchecked/system/collections/stack.js +105 -0
- package/dist-unchecked/system/collections/throw-helpers.d.ts +77 -0
- package/dist-unchecked/system/collections/throw-helpers.js +158 -0
- package/dist-unchecked/system/date-time-offset.d.ts +23 -0
- package/dist-unchecked/system/date-time-offset.js +61 -0
- package/dist-unchecked/system/decimal-parsing.d.ts +18 -0
- package/dist-unchecked/system/decimal-parsing.js +74 -0
- package/dist-unchecked/system/decimal.d.ts +20 -0
- package/dist-unchecked/system/decimal.js +30 -0
- package/dist-unchecked/system/default-text.d.ts +11 -0
- package/dist-unchecked/system/default-text.js +52 -0
- package/dist-unchecked/system/delegates.d.ts +40 -0
- package/dist-unchecked/system/delegates.js +74 -0
- package/dist-unchecked/system/double-format.d.ts +20 -0
- package/dist-unchecked/system/double-format.js +171 -0
- package/dist-unchecked/system/dynamic-conversion.d.ts +37 -0
- package/dist-unchecked/system/dynamic-conversion.js +229 -0
- package/dist-unchecked/system/equality.d.ts +111 -0
- package/dist-unchecked/system/equality.js +392 -0
- package/dist-unchecked/system/exceptions/argument-exception.d.ts +17 -0
- package/dist-unchecked/system/exceptions/argument-exception.js +44 -0
- package/dist-unchecked/system/exceptions/argument-null-exception.d.ts +16 -0
- package/dist-unchecked/system/exceptions/argument-null-exception.js +35 -0
- package/dist-unchecked/system/exceptions/argument-out-of-range-exception.d.ts +18 -0
- package/dist-unchecked/system/exceptions/argument-out-of-range-exception.js +51 -0
- package/dist-unchecked/system/exceptions/arithmetic-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/arithmetic-exception.js +31 -0
- package/dist-unchecked/system/exceptions/divide-by-zero-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/divide-by-zero-exception.js +31 -0
- package/dist-unchecked/system/exceptions/exception.d.ts +38 -0
- package/dist-unchecked/system/exceptions/exception.js +77 -0
- package/dist-unchecked/system/exceptions/format-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/format-exception.js +31 -0
- package/dist-unchecked/system/exceptions/index-out-of-range-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/index-out-of-range-exception.js +31 -0
- package/dist-unchecked/system/exceptions/index.d.ts +26 -0
- package/dist-unchecked/system/exceptions/index.js +26 -0
- package/dist-unchecked/system/exceptions/invalid-cast-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/invalid-cast-exception.js +31 -0
- package/dist-unchecked/system/exceptions/invalid-operation-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/invalid-operation-exception.js +31 -0
- package/dist-unchecked/system/exceptions/json-exception.d.ts +18 -0
- package/dist-unchecked/system/exceptions/json-exception.js +39 -0
- package/dist-unchecked/system/exceptions/key-not-found-exception.d.ts +13 -0
- package/dist-unchecked/system/exceptions/key-not-found-exception.js +34 -0
- package/dist-unchecked/system/exceptions/message-value.d.ts +7 -0
- package/dist-unchecked/system/exceptions/message-value.js +9 -0
- package/dist-unchecked/system/exceptions/missing-method-exception.d.ts +19 -0
- package/dist-unchecked/system/exceptions/missing-method-exception.js +38 -0
- package/dist-unchecked/system/exceptions/named-exception.d.ts +7 -0
- package/dist-unchecked/system/exceptions/named-exception.js +29 -0
- package/dist-unchecked/system/exceptions/not-implemented-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/not-implemented-exception.js +31 -0
- package/dist-unchecked/system/exceptions/not-supported-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/not-supported-exception.js +31 -0
- package/dist-unchecked/system/exceptions/null-reference-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/null-reference-exception.js +31 -0
- package/dist-unchecked/system/exceptions/object-disposed-exception.d.ts +18 -0
- package/dist-unchecked/system/exceptions/object-disposed-exception.js +41 -0
- package/dist-unchecked/system/exceptions/operation-canceled-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/operation-canceled-exception.js +31 -0
- package/dist-unchecked/system/exceptions/overflow-exception.d.ts +15 -0
- package/dist-unchecked/system/exceptions/overflow-exception.js +34 -0
- package/dist-unchecked/system/exceptions/switch-expression-exception.d.ts +21 -0
- package/dist-unchecked/system/exceptions/switch-expression-exception.js +49 -0
- package/dist-unchecked/system/exceptions/system-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/system-exception.js +31 -0
- package/dist-unchecked/system/exceptions/task-canceled-exception.d.ts +13 -0
- package/dist-unchecked/system/exceptions/task-canceled-exception.js +34 -0
- package/dist-unchecked/system/exceptions/timeout-exception.d.ts +12 -0
- package/dist-unchecked/system/exceptions/timeout-exception.js +31 -0
- package/dist-unchecked/system/exceptions/to-exception.d.ts +25 -0
- package/dist-unchecked/system/exceptions/to-exception.js +53 -0
- package/dist-unchecked/system/exceptions/type-initialization-exception.d.ts +19 -0
- package/dist-unchecked/system/exceptions/type-initialization-exception.js +36 -0
- package/dist-unchecked/system/hash-code.d.ts +28 -0
- package/dist-unchecked/system/hash-code.js +179 -0
- package/dist-unchecked/system/identity-memo.d.ts +7 -0
- package/dist-unchecked/system/identity-memo.js +14 -0
- package/dist-unchecked/system/index.d.ts +35 -0
- package/dist-unchecked/system/index.js +35 -0
- package/dist-unchecked/system/int64-convert.d.ts +59 -0
- package/dist-unchecked/system/int64-convert.js +226 -0
- package/dist-unchecked/system/int64-format.d.ts +13 -0
- package/dist-unchecked/system/int64-format.js +28 -0
- package/dist-unchecked/system/int64-math.d.ts +56 -0
- package/dist-unchecked/system/int64-math.js +109 -0
- package/dist-unchecked/system/int64-parsing.d.ts +45 -0
- package/dist-unchecked/system/int64-parsing.js +153 -0
- package/dist-unchecked/system/int64.d.ts +134 -0
- package/dist-unchecked/system/int64.js +298 -0
- package/dist-unchecked/system/integer-division.d.ts +20 -0
- package/dist-unchecked/system/integer-division.js +17 -0
- package/dist-unchecked/system/integer-format.d.ts +12 -0
- package/dist-unchecked/system/integer-format.js +22 -0
- package/dist-unchecked/system/integer-standard-format.d.ts +9 -0
- package/dist-unchecked/system/integer-standard-format.js +66 -0
- package/dist-unchecked/system/json/byte-array-converter.d.ts +19 -0
- package/dist-unchecked/system/json/byte-array-converter.js +106 -0
- package/dist-unchecked/system/json/container-depth.d.ts +30 -0
- package/dist-unchecked/system/json/container-depth.js +84 -0
- package/dist-unchecked/system/json/contract-name.d.ts +15 -0
- package/dist-unchecked/system/json/contract-name.js +33 -0
- package/dist-unchecked/system/json/converter-set-cache.d.ts +17 -0
- package/dist-unchecked/system/json/converter-set-cache.js +26 -0
- package/dist-unchecked/system/json/converters.d.ts +52 -0
- package/dist-unchecked/system/json/converters.js +677 -0
- package/dist-unchecked/system/json/decimal-text.d.ts +9 -0
- package/dist-unchecked/system/json/decimal-text.js +125 -0
- package/dist-unchecked/system/json/dictionary-keys.d.ts +31 -0
- package/dist-unchecked/system/json/dictionary-keys.js +195 -0
- package/dist-unchecked/system/json/errors.d.ts +18 -0
- package/dist-unchecked/system/json/errors.js +18 -0
- package/dist-unchecked/system/json/exact-json-number.d.ts +103 -0
- package/dist-unchecked/system/json/exact-json-number.js +155 -0
- package/dist-unchecked/system/json/exact-number-reads.d.ts +21 -0
- package/dist-unchecked/system/json/exact-number-reads.js +104 -0
- package/dist-unchecked/system/json/index.d.ts +7 -0
- package/dist-unchecked/system/json/index.js +6 -0
- package/dist-unchecked/system/json/json-serializer.d.ts +102 -0
- package/dist-unchecked/system/json/json-serializer.js +114 -0
- package/dist-unchecked/system/json/json-text-reader.d.ts +33 -0
- package/dist-unchecked/system/json/json-text-reader.js +608 -0
- package/dist-unchecked/system/json/null-reads.d.ts +22 -0
- package/dist-unchecked/system/json/null-reads.js +43 -0
- package/dist-unchecked/system/json/number-from-string.d.ts +44 -0
- package/dist-unchecked/system/json/number-from-string.js +248 -0
- package/dist-unchecked/system/json/numeric-converters.d.ts +65 -0
- package/dist-unchecked/system/json/numeric-converters.js +361 -0
- package/dist-unchecked/system/json/numeric-enum-members.d.ts +18 -0
- package/dist-unchecked/system/json/numeric-enum-members.js +18 -0
- package/dist-unchecked/system/json/ordinal-ignore-case.d.ts +14 -0
- package/dist-unchecked/system/json/ordinal-ignore-case.js +60 -0
- package/dist-unchecked/system/json/polymorphism.d.ts +26 -0
- package/dist-unchecked/system/json/polymorphism.js +430 -0
- package/dist-unchecked/system/json/property-lookup.d.ts +17 -0
- package/dist-unchecked/system/json/property-lookup.js +32 -0
- package/dist-unchecked/system/json/property-naming-policy.d.ts +14 -0
- package/dist-unchecked/system/json/property-naming-policy.js +206 -0
- package/dist-unchecked/system/json/public-json-shape.d.ts +13 -0
- package/dist-unchecked/system/json/public-json-shape.js +38 -0
- package/dist-unchecked/system/json/serializer-context.d.ts +59 -0
- package/dist-unchecked/system/json/serializer-context.js +85 -0
- package/dist-unchecked/system/json/spec-kind.d.ts +3 -0
- package/dist-unchecked/system/json/spec-kind.js +4 -0
- package/dist-unchecked/system/json/temporal-reads.d.ts +15 -0
- package/dist-unchecked/system/json/temporal-reads.js +423 -0
- package/dist-unchecked/system/json/temporal-text.d.ts +16 -0
- package/dist-unchecked/system/json/temporal-text.js +32 -0
- package/dist-unchecked/system/json/types.d.ts +347 -0
- package/dist-unchecked/system/json/types.js +0 -0
- package/dist-unchecked/system/json/value-converter.d.ts +5 -0
- package/dist-unchecked/system/json/value-converter.js +0 -0
- package/dist-unchecked/system/lazy-value.d.ts +9 -0
- package/dist-unchecked/system/lazy-value.js +19 -0
- package/dist-unchecked/system/linq/compare-keys.d.ts +8 -0
- package/dist-unchecked/system/linq/compare-keys.js +37 -0
- package/dist-unchecked/system/linq/decimal-terminals.d.ts +24 -0
- package/dist-unchecked/system/linq/decimal-terminals.js +67 -0
- package/dist-unchecked/system/linq/expr-tree-visitor.d.ts +148 -0
- package/dist-unchecked/system/linq/expr-tree-visitor.js +479 -0
- package/dist-unchecked/system/linq/expr-tree.d.ts +166 -0
- package/dist-unchecked/system/linq/expr-tree.js +18 -0
- package/dist-unchecked/system/linq/index.d.ts +32 -0
- package/dist-unchecked/system/linq/index.js +27 -0
- package/dist-unchecked/system/linq/int64-terminals.d.ts +33 -0
- package/dist-unchecked/system/linq/int64-terminals.js +131 -0
- package/dist-unchecked/system/linq/linq.d.ts +107 -0
- package/dist-unchecked/system/linq/linq.js +46 -0
- package/dist-unchecked/system/linq/operators.d.ts +40 -0
- package/dist-unchecked/system/linq/operators.js +410 -0
- package/dist-unchecked/system/linq/terminals.d.ts +100 -0
- package/dist-unchecked/system/linq/terminals.js +467 -0
- package/dist-unchecked/system/linq/types.d.ts +330 -0
- package/dist-unchecked/system/linq/types.js +0 -0
- package/dist-unchecked/system/math.d.ts +55 -0
- package/dist-unchecked/system/math.js +141 -0
- package/dist-unchecked/system/number-parsing.d.ts +58 -0
- package/dist-unchecked/system/number-parsing.js +174 -0
- package/dist-unchecked/system/record-copy.d.ts +26 -0
- package/dist-unchecked/system/record-copy.js +72 -0
- package/dist-unchecked/system/reflection/box.d.ts +19 -0
- package/dist-unchecked/system/reflection/box.js +32 -0
- package/dist-unchecked/system/reflection/boxed-text.d.ts +8 -0
- package/dist-unchecked/system/reflection/boxed-text.js +31 -0
- package/dist-unchecked/system/reflection/cast-to.d.ts +15 -0
- package/dist-unchecked/system/reflection/cast-to.js +32 -0
- package/dist-unchecked/system/reflection/constructor-descriptor.d.ts +11 -0
- package/dist-unchecked/system/reflection/constructor-descriptor.js +22 -0
- package/dist-unchecked/system/reflection/create-instance.d.ts +6 -0
- package/dist-unchecked/system/reflection/create-instance.js +11 -0
- package/dist-unchecked/system/reflection/decimal-type-defaults.d.ts +7 -0
- package/dist-unchecked/system/reflection/decimal-type-defaults.js +17 -0
- package/dist-unchecked/system/reflection/enum-from-raw.d.ts +14 -0
- package/dist-unchecked/system/reflection/enum-from-raw.js +89 -0
- package/dist-unchecked/system/reflection/enum-is-defined.d.ts +7 -0
- package/dist-unchecked/system/reflection/enum-is-defined.js +14 -0
- package/dist-unchecked/system/reflection/get-number-type.d.ts +7 -0
- package/dist-unchecked/system/reflection/get-number-type.js +10 -0
- package/dist-unchecked/system/reflection/get-runtime-type-from-type.d.ts +6 -0
- package/dist-unchecked/system/reflection/get-runtime-type-from-type.js +22 -0
- package/dist-unchecked/system/reflection/get-runtime-type.d.ts +3 -0
- package/dist-unchecked/system/reflection/get-runtime-type.js +105 -0
- package/dist-unchecked/system/reflection/implements-interface.d.ts +10 -0
- package/dist-unchecked/system/reflection/implements-interface.js +26 -0
- package/dist-unchecked/system/reflection/index.d.ts +27 -0
- package/dist-unchecked/system/reflection/index.js +26 -0
- package/dist-unchecked/system/reflection/invalid-cast.d.ts +8 -0
- package/dist-unchecked/system/reflection/invalid-cast.js +33 -0
- package/dist-unchecked/system/reflection/is-assignable-from.d.ts +13 -0
- package/dist-unchecked/system/reflection/is-assignable-from.js +121 -0
- package/dist-unchecked/system/reflection/is-box-of.d.ts +3 -0
- package/dist-unchecked/system/reflection/is-box-of.js +5 -0
- package/dist-unchecked/system/reflection/is-boxed.d.ts +7 -0
- package/dist-unchecked/system/reflection/is-boxed.js +9 -0
- package/dist-unchecked/system/reflection/is-type.d.ts +12 -0
- package/dist-unchecked/system/reflection/is-type.js +20 -0
- package/dist-unchecked/system/reflection/nullable-type.d.ts +3 -0
- package/dist-unchecked/system/reflection/nullable-type.js +19 -0
- package/dist-unchecked/system/reflection/opaque-type.d.ts +6 -0
- package/dist-unchecked/system/reflection/opaque-type.js +22 -0
- package/dist-unchecked/system/reflection/primitive-types.d.ts +20 -0
- package/dist-unchecked/system/reflection/primitive-types.js +160 -0
- package/dist-unchecked/system/reflection/runtime-type.d.ts +131 -0
- package/dist-unchecked/system/reflection/runtime-type.js +5 -0
- package/dist-unchecked/system/reflection/specialize-collection.d.ts +11 -0
- package/dist-unchecked/system/reflection/specialize-collection.js +93 -0
- package/dist-unchecked/system/reflection/specialize.d.ts +7 -0
- package/dist-unchecked/system/reflection/specialize.js +33 -0
- package/dist-unchecked/system/reflection/temporal-type-defaults.d.ts +11 -0
- package/dist-unchecked/system/reflection/temporal-type-defaults.js +61 -0
- package/dist-unchecked/system/reflection/temporal-types.d.ts +7 -0
- package/dist-unchecked/system/reflection/temporal-types.js +44 -0
- package/dist-unchecked/system/reflection/to-string-tag.d.ts +6 -0
- package/dist-unchecked/system/reflection/to-string-tag.js +8 -0
- package/dist-unchecked/system/reflection/tuple-type.d.ts +6 -0
- package/dist-unchecked/system/reflection/tuple-type.js +23 -0
- package/dist-unchecked/system/reflection/unbox-for-cast.d.ts +10 -0
- package/dist-unchecked/system/reflection/unbox-for-cast.js +28 -0
- package/dist-unchecked/system/reflection/unbox-for.d.ts +9 -0
- package/dist-unchecked/system/reflection/unbox-for.js +15 -0
- package/dist-unchecked/system/reflection/unbox.d.ts +5 -0
- package/dist-unchecked/system/reflection/unbox.js +8 -0
- package/dist-unchecked/system/reflection/unsupported-type.d.ts +7 -0
- package/dist-unchecked/system/reflection/unsupported-type.js +27 -0
- package/dist-unchecked/system/reflection/well-known-types.d.ts +13 -0
- package/dist-unchecked/system/reflection/well-known-types.js +32 -0
- package/dist-unchecked/system/reflection/with-implementers.d.ts +8 -0
- package/dist-unchecked/system/reflection/with-implementers.js +23 -0
- package/dist-unchecked/system/standard-numeric-format.d.ts +67 -0
- package/dist-unchecked/system/standard-numeric-format.js +213 -0
- package/dist-unchecked/system/string-members.d.ts +170 -0
- package/dist-unchecked/system/string-members.js +445 -0
- package/dist-unchecked/system/strings.d.ts +42 -0
- package/dist-unchecked/system/strings.js +66 -0
- package/dist-unchecked/system/temporal-helpers.d.ts +43 -0
- package/dist-unchecked/system/temporal-helpers.js +127 -0
- package/dist-unchecked/system/time-span-format.d.ts +3 -0
- package/dist-unchecked/system/time-span-format.js +17 -0
- package/dist-unchecked/system/time-span.d.ts +33 -0
- package/dist-unchecked/system/time-span.js +90 -0
- package/dist-unchecked/system/type-initializer.d.ts +14 -0
- package/dist-unchecked/system/type-initializer.js +36 -0
- package/dist-unchecked/system/uuid.d.ts +68 -0
- package/dist-unchecked/system/uuid.js +124 -0
- package/dist-unchecked/type-checking/index.d.ts +1 -0
- package/dist-unchecked/type-checking/index.js +1 -0
- package/dist-unchecked/type-checking/primitive-type-checks.d.ts +45 -0
- package/dist-unchecked/type-checking/primitive-type-checks.js +81 -0
- package/package.json +88 -10
- package/src/index.ts +2 -0
- package/src/system/argument-guards.ts +253 -0
- package/src/system/array-length.ts +19 -0
- package/src/system/big-integer.ts +135 -0
- package/src/system/bind-receiver.ts +32 -0
- package/src/system/boolean-format.ts +13 -0
- package/src/system/collections/builder-iterator.ts +30 -0
- package/src/system/collections/checks.ts +18 -0
- package/src/system/collections/close-collection.ts +127 -0
- package/src/system/collections/collection-type-name.ts +37 -0
- package/src/system/collections/concurrent-dictionary.ts +396 -0
- package/src/system/collections/copy-to.ts +52 -0
- package/src/system/collections/default-comparer.ts +334 -0
- package/src/system/collections/descriptors.ts +310 -0
- package/src/system/collections/dictionary-helpers.ts +18 -0
- package/src/system/collections/dictionary-views.ts +231 -0
- package/src/system/collections/dictionary.ts +325 -0
- package/src/system/collections/hash-core.ts +232 -0
- package/src/system/collections/hash-set.ts +302 -0
- package/src/system/collections/helpers.ts +92 -0
- package/src/system/collections/immutable-array-builder.ts +160 -0
- package/src/system/collections/immutable-array.ts +352 -0
- package/src/system/collections/immutable-dictionary-builder.ts +238 -0
- package/src/system/collections/immutable-dictionary.ts +493 -0
- package/src/system/collections/immutable-hash-set-builder.ts +218 -0
- package/src/system/collections/immutable-hash-set.ts +362 -0
- package/src/system/collections/immutable-interfaces.ts +58 -0
- package/src/system/collections/immutable-list-builder-core.ts +204 -0
- package/src/system/collections/immutable-list-builder.ts +146 -0
- package/src/system/collections/immutable-list-core.ts +419 -0
- package/src/system/collections/immutable-list.ts +257 -0
- package/src/system/collections/immutable-storage.ts +107 -0
- package/src/system/collections/index.ts +27 -0
- package/src/system/collections/interfaces.ts +84 -0
- package/src/system/collections/list.ts +680 -0
- package/src/system/collections/queue.ts +240 -0
- package/src/system/collections/read-only-list.ts +210 -0
- package/src/system/collections/red-black-tree.ts +485 -0
- package/src/system/collections/set-algebra.ts +89 -0
- package/src/system/collections/sorted-array.ts +43 -0
- package/src/system/collections/sorted-dictionary.ts +322 -0
- package/src/system/collections/sorted-list.ts +566 -0
- package/src/system/collections/sorted-set.ts +483 -0
- package/src/system/collections/stack.ts +201 -0
- package/src/system/collections/throw-helpers.ts +240 -0
- package/src/system/date-time-offset.ts +102 -0
- package/src/system/decimal-parsing.ts +102 -0
- package/src/system/decimal.ts +36 -0
- package/src/system/default-text.ts +73 -0
- package/src/system/delegates.ts +83 -0
- package/src/system/double-format.ts +234 -0
- package/src/system/dynamic-conversion.ts +337 -0
- package/src/system/equality.ts +448 -0
- package/src/system/exceptions/argument-exception.ts +51 -0
- package/src/system/exceptions/argument-null-exception.ts +42 -0
- package/src/system/exceptions/argument-out-of-range-exception.ts +65 -0
- package/src/system/exceptions/arithmetic-exception.ts +37 -0
- package/src/system/exceptions/divide-by-zero-exception.ts +38 -0
- package/src/system/exceptions/exception.ts +91 -0
- package/src/system/exceptions/format-exception.ts +37 -0
- package/src/system/exceptions/index-out-of-range-exception.ts +38 -0
- package/src/system/exceptions/index.ts +26 -0
- package/src/system/exceptions/invalid-cast-exception.ts +38 -0
- package/src/system/exceptions/invalid-operation-exception.ts +39 -0
- package/src/system/exceptions/json-exception.ts +46 -0
- package/src/system/exceptions/key-not-found-exception.ts +42 -0
- package/src/system/exceptions/message-value.ts +9 -0
- package/src/system/exceptions/missing-method-exception.ts +45 -0
- package/src/system/exceptions/named-exception.ts +43 -0
- package/src/system/exceptions/not-implemented-exception.ts +38 -0
- package/src/system/exceptions/not-supported-exception.ts +38 -0
- package/src/system/exceptions/null-reference-exception.ts +38 -0
- package/src/system/exceptions/object-disposed-exception.ts +49 -0
- package/src/system/exceptions/operation-canceled-exception.ts +38 -0
- package/src/system/exceptions/overflow-exception.ts +40 -0
- package/src/system/exceptions/switch-expression-exception.ts +62 -0
- package/src/system/exceptions/system-exception.ts +37 -0
- package/src/system/exceptions/task-canceled-exception.ts +42 -0
- package/src/system/exceptions/timeout-exception.ts +37 -0
- package/src/system/exceptions/to-exception.ts +70 -0
- package/src/system/exceptions/type-initialization-exception.ts +42 -0
- package/src/system/hash-code.ts +202 -0
- package/src/system/identity-memo.ts +25 -0
- package/src/system/index.ts +35 -0
- package/src/system/int64-convert.ts +326 -0
- package/src/system/int64-format.ts +37 -0
- package/src/system/int64-math.ts +137 -0
- package/src/system/int64-parsing.ts +243 -0
- package/src/system/int64.ts +446 -0
- package/src/system/integer-division.ts +41 -0
- package/src/system/integer-format.ts +34 -0
- package/src/system/integer-standard-format.ts +103 -0
- package/src/system/json/byte-array-converter.ts +148 -0
- package/src/system/json/container-depth.ts +101 -0
- package/src/system/json/contract-name.ts +39 -0
- package/src/system/json/converter-set-cache.ts +55 -0
- package/src/system/json/converters.ts +1040 -0
- package/src/system/json/decimal-text.ts +174 -0
- package/src/system/json/dictionary-keys.ts +293 -0
- package/src/system/json/errors.ts +19 -0
- package/src/system/json/exact-json-number.ts +196 -0
- package/src/system/json/exact-number-reads.ts +136 -0
- package/src/system/json/index.ts +35 -0
- package/src/system/json/json-serializer.ts +259 -0
- package/src/system/json/json-text-reader.ts +799 -0
- package/src/system/json/null-reads.ts +47 -0
- package/src/system/json/number-from-string.ts +372 -0
- package/src/system/json/numeric-converters.ts +495 -0
- package/src/system/json/numeric-enum-members.ts +35 -0
- package/src/system/json/ordinal-ignore-case.ts +74 -0
- package/src/system/json/polymorphism.ts +650 -0
- package/src/system/json/property-lookup.ts +63 -0
- package/src/system/json/property-naming-policy.ts +258 -0
- package/src/system/json/public-json-shape.ts +43 -0
- package/src/system/json/serializer-context.ts +105 -0
- package/src/system/json/spec-kind.ts +6 -0
- package/src/system/json/temporal-reads.ts +606 -0
- package/src/system/json/temporal-text.ts +48 -0
- package/src/system/json/types.ts +433 -0
- package/src/system/json/value-converter.ts +5 -0
- package/src/system/lazy-value.ts +21 -0
- package/src/system/linq/compare-keys.ts +38 -0
- package/src/system/linq/decimal-terminals.ts +122 -0
- package/src/system/linq/expr-tree-visitor.ts +568 -0
- package/src/system/linq/expr-tree.ts +213 -0
- package/src/system/linq/index.ts +181 -0
- package/src/system/linq/int64-terminals.ts +199 -0
- package/src/system/linq/linq.ts +1816 -0
- package/src/system/linq/operators.ts +491 -0
- package/src/system/linq/terminals.ts +672 -0
- package/src/system/linq/types.ts +484 -0
- package/src/system/math.ts +182 -0
- package/src/system/number-parsing.ts +242 -0
- package/src/system/record-copy.ts +89 -0
- package/src/system/reflection/box.ts +38 -0
- package/src/system/reflection/boxed-text.ts +42 -0
- package/src/system/reflection/cast-to.ts +43 -0
- package/src/system/reflection/constructor-descriptor.ts +28 -0
- package/src/system/reflection/create-instance.ts +14 -0
- package/src/system/reflection/decimal-type-defaults.ts +20 -0
- package/src/system/reflection/enum-from-raw.ts +131 -0
- package/src/system/reflection/enum-is-defined.ts +18 -0
- package/src/system/reflection/get-number-type.ts +12 -0
- package/src/system/reflection/get-runtime-type-from-type.ts +33 -0
- package/src/system/reflection/get-runtime-type.ts +145 -0
- package/src/system/reflection/implements-interface.ts +40 -0
- package/src/system/reflection/index.ts +44 -0
- package/src/system/reflection/invalid-cast.ts +46 -0
- package/src/system/reflection/is-assignable-from.ts +161 -0
- package/src/system/reflection/is-box-of.ts +7 -0
- package/src/system/reflection/is-boxed.ts +17 -0
- package/src/system/reflection/is-type.ts +25 -0
- package/src/system/reflection/nullable-type.ts +27 -0
- package/src/system/reflection/opaque-type.ts +30 -0
- package/src/system/reflection/primitive-types.ts +197 -0
- package/src/system/reflection/runtime-type.ts +220 -0
- package/src/system/reflection/specialize-collection.ts +161 -0
- package/src/system/reflection/specialize.ts +52 -0
- package/src/system/reflection/temporal-type-defaults.ts +78 -0
- package/src/system/reflection/temporal-types.ts +57 -0
- package/src/system/reflection/to-string-tag.ts +8 -0
- package/src/system/reflection/tuple-type.ts +32 -0
- package/src/system/reflection/unbox-for-cast.ts +31 -0
- package/src/system/reflection/unbox-for.ts +19 -0
- package/src/system/reflection/unbox.ts +9 -0
- package/src/system/reflection/unsupported-type.ts +35 -0
- package/src/system/reflection/well-known-types.ts +50 -0
- package/src/system/reflection/with-implementers.ts +33 -0
- package/src/system/standard-numeric-format.ts +334 -0
- package/src/system/string-members.ts +641 -0
- package/src/system/strings.ts +83 -0
- package/src/system/temporal-helpers.ts +183 -0
- package/src/system/time-span-format.ts +21 -0
- package/src/system/time-span.ts +126 -0
- package/src/system/type-initializer.ts +41 -0
- package/src/system/uuid.ts +163 -0
- package/src/type-checking/index.ts +1 -0
- package/src/type-checking/primitive-type-checks.ts +113 -0
- package/dist/system/collections/immutable-collection.d.ts +0 -31
- package/dist/system/collections/immutable-collection.js +0 -58
- package/dist/system/collections/list-helpers.d.ts +0 -43
- package/dist/system/collections/list-helpers.js +0 -58
- package/dist/system/json/union-guard-registry.d.ts +0 -30
- package/dist/system/json/union-guard-registry.js +0 -34
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
let memo;
|
|
2
|
+
/**
|
|
3
|
+
* A memoized nominal descriptor for concrete types without a descriptor (#711):
|
|
4
|
+
* equal only to itself, never a wildcard, and never matches a runtime value directly.
|
|
5
|
+
*/
|
|
6
|
+
export function opaqueType(fullName) {
|
|
7
|
+
memo ??= new Map();
|
|
8
|
+
const known = memo.get(fullName);
|
|
9
|
+
if (known !== undefined) {
|
|
10
|
+
return known;
|
|
11
|
+
}
|
|
12
|
+
const lastDot = fullName.lastIndexOf(".");
|
|
13
|
+
const created = {
|
|
14
|
+
kind: "opaque",
|
|
15
|
+
name: lastDot >= 0 ? fullName.slice(lastDot + 1) : fullName,
|
|
16
|
+
fullName,
|
|
17
|
+
namespace: lastDot >= 0 ? fullName.slice(0, lastDot) : "",
|
|
18
|
+
test: (_value) => false,
|
|
19
|
+
};
|
|
20
|
+
memo.set(fullName, created);
|
|
21
|
+
return created;
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PrimitiveType } from "./runtime-type.ts";
|
|
2
|
+
import type { Decimal } from "../decimal.ts";
|
|
3
|
+
import type { UUID } from "../uuid.ts";
|
|
4
|
+
export declare const BooleanType: PrimitiveType<boolean>;
|
|
5
|
+
export declare const ByteType: PrimitiveType<number>;
|
|
6
|
+
export declare const SByteType: PrimitiveType<number>;
|
|
7
|
+
export declare const Int16Type: PrimitiveType<number>;
|
|
8
|
+
export declare const UInt16Type: PrimitiveType<number>;
|
|
9
|
+
export declare const Int32Type: PrimitiveType<number>;
|
|
10
|
+
export declare const UInt32Type: PrimitiveType<number>;
|
|
11
|
+
export declare const Int64Type: PrimitiveType<bigint>;
|
|
12
|
+
export declare const UInt64Type: PrimitiveType<bigint>;
|
|
13
|
+
export declare const SingleType: PrimitiveType<number>;
|
|
14
|
+
export declare const DoubleType: PrimitiveType<number>;
|
|
15
|
+
export declare const BigIntegerType: PrimitiveType<bigint>;
|
|
16
|
+
export declare const CharType: PrimitiveType<string>;
|
|
17
|
+
export declare const StringType: PrimitiveType<string>;
|
|
18
|
+
export declare const GuidType: PrimitiveType<UUID>;
|
|
19
|
+
/** `decimal`: recognized by the decimal.js `Symbol.toStringTag`; its `default`/`create` factories live in `decimal-type-defaults.ts`. */
|
|
20
|
+
export declare const DecimalType: PrimitiveType<Decimal>;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { isBigInt, isBool, isByte, isChar, isDecimal, isFloat32, isFloat64, isGuid, isInt16, isInt32, isInt64, isSByte, isString, isUInt16, isUInt32, isUInt64, } from "../../type-checking/index.js";
|
|
2
|
+
// Plain data literals: they reference the validating checks, never call them at load time.
|
|
3
|
+
// C# `long`, `ulong` and `BigInteger` are JS `bigint` (spec 012), so their checks take a bigint.
|
|
4
|
+
export const BooleanType = {
|
|
5
|
+
kind: "primitive",
|
|
6
|
+
name: "Boolean",
|
|
7
|
+
fullName: "System.Boolean",
|
|
8
|
+
namespace: "System",
|
|
9
|
+
primitive: "Boolean",
|
|
10
|
+
test: isBool,
|
|
11
|
+
default: () => false,
|
|
12
|
+
create: () => false,
|
|
13
|
+
};
|
|
14
|
+
export const ByteType = {
|
|
15
|
+
kind: "primitive",
|
|
16
|
+
name: "Byte",
|
|
17
|
+
fullName: "System.Byte",
|
|
18
|
+
namespace: "System",
|
|
19
|
+
primitive: "Byte",
|
|
20
|
+
test: isByte,
|
|
21
|
+
default: () => 0,
|
|
22
|
+
create: () => 0,
|
|
23
|
+
};
|
|
24
|
+
export const SByteType = {
|
|
25
|
+
kind: "primitive",
|
|
26
|
+
name: "SByte",
|
|
27
|
+
fullName: "System.SByte",
|
|
28
|
+
namespace: "System",
|
|
29
|
+
primitive: "SByte",
|
|
30
|
+
test: isSByte,
|
|
31
|
+
default: () => 0,
|
|
32
|
+
create: () => 0,
|
|
33
|
+
};
|
|
34
|
+
export const Int16Type = {
|
|
35
|
+
kind: "primitive",
|
|
36
|
+
name: "Int16",
|
|
37
|
+
fullName: "System.Int16",
|
|
38
|
+
namespace: "System",
|
|
39
|
+
primitive: "Int16",
|
|
40
|
+
test: isInt16,
|
|
41
|
+
default: () => 0,
|
|
42
|
+
create: () => 0,
|
|
43
|
+
};
|
|
44
|
+
export const UInt16Type = {
|
|
45
|
+
kind: "primitive",
|
|
46
|
+
name: "UInt16",
|
|
47
|
+
fullName: "System.UInt16",
|
|
48
|
+
namespace: "System",
|
|
49
|
+
primitive: "UInt16",
|
|
50
|
+
test: isUInt16,
|
|
51
|
+
default: () => 0,
|
|
52
|
+
create: () => 0,
|
|
53
|
+
};
|
|
54
|
+
export const Int32Type = {
|
|
55
|
+
kind: "primitive",
|
|
56
|
+
name: "Int32",
|
|
57
|
+
fullName: "System.Int32",
|
|
58
|
+
namespace: "System",
|
|
59
|
+
primitive: "Int32",
|
|
60
|
+
test: isInt32,
|
|
61
|
+
default: () => 0,
|
|
62
|
+
create: () => 0,
|
|
63
|
+
};
|
|
64
|
+
export const UInt32Type = {
|
|
65
|
+
kind: "primitive",
|
|
66
|
+
name: "UInt32",
|
|
67
|
+
fullName: "System.UInt32",
|
|
68
|
+
namespace: "System",
|
|
69
|
+
primitive: "UInt32",
|
|
70
|
+
test: isUInt32,
|
|
71
|
+
default: () => 0,
|
|
72
|
+
create: () => 0,
|
|
73
|
+
};
|
|
74
|
+
export const Int64Type = {
|
|
75
|
+
kind: "primitive",
|
|
76
|
+
name: "Int64",
|
|
77
|
+
fullName: "System.Int64",
|
|
78
|
+
namespace: "System",
|
|
79
|
+
primitive: "Int64",
|
|
80
|
+
test: isInt64,
|
|
81
|
+
default: () => 0n,
|
|
82
|
+
create: () => 0n,
|
|
83
|
+
};
|
|
84
|
+
export const UInt64Type = {
|
|
85
|
+
kind: "primitive",
|
|
86
|
+
name: "UInt64",
|
|
87
|
+
fullName: "System.UInt64",
|
|
88
|
+
namespace: "System",
|
|
89
|
+
primitive: "UInt64",
|
|
90
|
+
test: isUInt64,
|
|
91
|
+
default: () => 0n,
|
|
92
|
+
create: () => 0n,
|
|
93
|
+
};
|
|
94
|
+
export const SingleType = {
|
|
95
|
+
kind: "primitive",
|
|
96
|
+
name: "Single",
|
|
97
|
+
fullName: "System.Single",
|
|
98
|
+
namespace: "System",
|
|
99
|
+
primitive: "Single",
|
|
100
|
+
test: isFloat32,
|
|
101
|
+
default: () => 0,
|
|
102
|
+
create: () => 0,
|
|
103
|
+
};
|
|
104
|
+
export const DoubleType = {
|
|
105
|
+
kind: "primitive",
|
|
106
|
+
name: "Double",
|
|
107
|
+
fullName: "System.Double",
|
|
108
|
+
namespace: "System",
|
|
109
|
+
primitive: "Double",
|
|
110
|
+
test: isFloat64,
|
|
111
|
+
default: () => 0,
|
|
112
|
+
create: () => 0,
|
|
113
|
+
};
|
|
114
|
+
export const BigIntegerType = {
|
|
115
|
+
kind: "primitive",
|
|
116
|
+
name: "BigInteger",
|
|
117
|
+
fullName: "System.BigInteger",
|
|
118
|
+
namespace: "System",
|
|
119
|
+
primitive: "BigInteger",
|
|
120
|
+
test: isBigInt,
|
|
121
|
+
default: () => 0n,
|
|
122
|
+
create: () => 0n,
|
|
123
|
+
};
|
|
124
|
+
export const CharType = {
|
|
125
|
+
kind: "primitive",
|
|
126
|
+
name: "Char",
|
|
127
|
+
fullName: "System.Char",
|
|
128
|
+
namespace: "System",
|
|
129
|
+
primitive: "Char",
|
|
130
|
+
test: isChar,
|
|
131
|
+
default: () => "\0",
|
|
132
|
+
create: () => "\0",
|
|
133
|
+
};
|
|
134
|
+
export const StringType = {
|
|
135
|
+
kind: "primitive",
|
|
136
|
+
name: "String",
|
|
137
|
+
fullName: "System.String",
|
|
138
|
+
namespace: "System",
|
|
139
|
+
primitive: "String",
|
|
140
|
+
test: isString,
|
|
141
|
+
};
|
|
142
|
+
export const GuidType = {
|
|
143
|
+
kind: "primitive",
|
|
144
|
+
name: "Guid",
|
|
145
|
+
fullName: "System.Guid",
|
|
146
|
+
namespace: "System",
|
|
147
|
+
primitive: "Guid",
|
|
148
|
+
test: isGuid,
|
|
149
|
+
default: () => "00000000-0000-0000-0000-000000000000",
|
|
150
|
+
create: () => "00000000-0000-0000-0000-000000000000",
|
|
151
|
+
};
|
|
152
|
+
/** `decimal`: recognized by the decimal.js `Symbol.toStringTag`; its `default`/`create` factories live in `decimal-type-defaults.ts`. */
|
|
153
|
+
export const DecimalType = {
|
|
154
|
+
kind: "primitive",
|
|
155
|
+
name: "Decimal",
|
|
156
|
+
fullName: "System.Decimal",
|
|
157
|
+
namespace: "System",
|
|
158
|
+
primitive: "Decimal",
|
|
159
|
+
test: isDecimal,
|
|
160
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shapes of the runtime type descriptors (spec 011, `contracts/runtime-types.md`).
|
|
3
|
+
* Types only: a descriptor is a data literal the compiler (or a runtime class) writes
|
|
4
|
+
* out, so declaring one imports no code from this module.
|
|
5
|
+
*/
|
|
6
|
+
/** The .NET primitive a {@link PrimitiveType} describes. */
|
|
7
|
+
export type PrimitiveName = "Boolean" | "Byte" | "SByte" | "Int16" | "UInt16" | "Int32" | "UInt32" | "Int64" | "UInt64" | "Single" | "Double" | "Decimal" | "BigInteger" | "Char" | "String" | "Guid" | "DateTime" | "DateTimeOffset" | "DateOnly" | "TimeOnly" | "TimeSpan";
|
|
8
|
+
/** The discriminant of every {@link RuntimeType}. */
|
|
9
|
+
export type RuntimeTypeKind = RuntimeType["kind"];
|
|
10
|
+
/** The members every descriptor has. Assignability is `isAssignableFrom`, not a method. */
|
|
11
|
+
export interface RuntimeTypeBase<T> {
|
|
12
|
+
readonly kind: string;
|
|
13
|
+
/** The C# simple name; a specialization renders `List<String>`. */
|
|
14
|
+
readonly name: string;
|
|
15
|
+
/** The C# full name with its namespace. */
|
|
16
|
+
readonly fullName: string;
|
|
17
|
+
readonly namespace: string;
|
|
18
|
+
/** A self-contained test of a value against the type. */
|
|
19
|
+
test(value: unknown): value is T;
|
|
20
|
+
/** The type's default value; absent means `null`. */
|
|
21
|
+
default?: (typeArguments?: ReadonlyArray<RuntimeType>) => T;
|
|
22
|
+
/** The public parameterless constructor (`new T()`); absent means `MissingMethodException`. */
|
|
23
|
+
readonly create?: (typeArguments?: ReadonlyArray<RuntimeType>) => T;
|
|
24
|
+
}
|
|
25
|
+
/** A class, record or struct lowered to a class, or a runtime exception class. */
|
|
26
|
+
export interface ClassType<T> extends RuntimeTypeBase<T> {
|
|
27
|
+
readonly kind: "class";
|
|
28
|
+
readonly ctor: abstract new (...args: never[]) => T;
|
|
29
|
+
readonly base?: () => ClassType<unknown>;
|
|
30
|
+
/** Direct and inherited interfaces, deduplicated, in declaration order. */
|
|
31
|
+
readonly interfaces: ReadonlyArray<() => InterfaceType<unknown>>;
|
|
32
|
+
/** The open definition's type parameters. */
|
|
33
|
+
readonly typeParameters: ReadonlyArray<string>;
|
|
34
|
+
/** The type arguments of a specialization. */
|
|
35
|
+
readonly typeArguments?: ReadonlyArray<RuntimeType>;
|
|
36
|
+
/** The `$typeArguments$<Class>` slot key when the class defines a slot. */
|
|
37
|
+
readonly slot?: string;
|
|
38
|
+
readonly isAbstract: boolean;
|
|
39
|
+
/** A C# struct lowered to a class. */
|
|
40
|
+
readonly isValueType: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface InterfaceType<T> extends RuntimeTypeBase<T> {
|
|
43
|
+
readonly kind: "interface";
|
|
44
|
+
readonly baseInterfaces: ReadonlyArray<() => InterfaceType<unknown>>;
|
|
45
|
+
/** The `[PlainObject]` implementers, in a deterministic order. */
|
|
46
|
+
readonly plainImplementers: ReadonlyArray<() => PlainObjectType<unknown>>;
|
|
47
|
+
}
|
|
48
|
+
export interface PlainObjectType<T> extends RuntimeTypeBase<T> {
|
|
49
|
+
readonly kind: "plainObject";
|
|
50
|
+
readonly guard: (value: unknown) => value is T;
|
|
51
|
+
}
|
|
52
|
+
export interface PrimitiveType<T> extends RuntimeTypeBase<T> {
|
|
53
|
+
readonly kind: "primitive";
|
|
54
|
+
readonly primitive: PrimitiveName;
|
|
55
|
+
}
|
|
56
|
+
export interface EnumType<T> extends RuntimeTypeBase<T> {
|
|
57
|
+
readonly kind: "enum" | "stringEnum";
|
|
58
|
+
readonly values: ReadonlyArray<T>;
|
|
59
|
+
/** Parallel to {@link values}. */
|
|
60
|
+
readonly names: ReadonlyArray<string>;
|
|
61
|
+
readonly isFlags: boolean;
|
|
62
|
+
/** The C# underlying type; absent for `Int32`. `Enum.Parse` / `ToObject` work in its width. */
|
|
63
|
+
readonly underlying?: PrimitiveName;
|
|
64
|
+
/**
|
|
65
|
+
* A `[StringEnum]`'s members' C# values, parallel to {@link values}; absent when they are
|
|
66
|
+
* their positions (0, 1, …).
|
|
67
|
+
*/
|
|
68
|
+
readonly ordinals?: ReadonlyArray<number>;
|
|
69
|
+
}
|
|
70
|
+
/** A native array; the element type is erased. */
|
|
71
|
+
export interface ArrayType extends RuntimeTypeBase<unknown[]> {
|
|
72
|
+
readonly kind: "array";
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* An interface a collection class implements, by kind, with its type arguments as
|
|
76
|
+
* indices into the instance's `$typeArguments$<Class>` slot (`null`: a wildcard, as
|
|
77
|
+
* `Dictionary` tested as `IReadOnlyCollection<KeyValuePair<K, V>>`). Data, so a class's
|
|
78
|
+
* descriptor literal imports nothing (spec 011 D30).
|
|
79
|
+
*/
|
|
80
|
+
export interface CollectionInterfaceEntry {
|
|
81
|
+
readonly collection: CollectionKindName;
|
|
82
|
+
readonly arguments: ReadonlyArray<number> | null;
|
|
83
|
+
}
|
|
84
|
+
export interface CollectionType<T> extends RuntimeTypeBase<T> {
|
|
85
|
+
readonly kind: "collection";
|
|
86
|
+
readonly collection: CollectionKindName;
|
|
87
|
+
/** Class kinds: the collection interfaces the class implements (nominal interface tests). */
|
|
88
|
+
readonly interfaces?: ReadonlyArray<CollectionInterfaceEntry>;
|
|
89
|
+
/**
|
|
90
|
+
* Class kinds: this descriptor closed over the type arguments an instance (or any object
|
|
91
|
+
* with the class's `$typeArguments$<Class>` slot) carries, memoized; the open descriptor
|
|
92
|
+
* when the slot is absent. `getRuntimeType` closes an instance's descriptor through it
|
|
93
|
+
* without importing `system/collections` (D30).
|
|
94
|
+
*/
|
|
95
|
+
readonly closeFor?: (instance: object) => CollectionType<T>;
|
|
96
|
+
/** Classes only. */
|
|
97
|
+
readonly ctor?: abstract new (...args: never[]) => T;
|
|
98
|
+
/** `UnknownType` is the wildcard. */
|
|
99
|
+
readonly typeArguments: ReadonlyArray<RuntimeType>;
|
|
100
|
+
readonly variance: ReadonlyArray<"invariant" | "covariant">;
|
|
101
|
+
}
|
|
102
|
+
/** The collection a {@link CollectionType} describes. */
|
|
103
|
+
export type CollectionKindName = "List" | "Dictionary" | "HashSet" | "Queue" | "Stack" | "ImmutableList" | "ImmutableArray" | "ImmutableListBuilder" | "ImmutableArrayBuilder" | "ImmutableHashSetBuilder" | "ImmutableDictionaryBuilder" | "SortedListView" | "ReadOnlyList" | "ImmutableHashSet" | "ImmutableDictionary" | "SortedSet" | "SortedDictionary" | "SortedList" | "ConcurrentDictionary" | "IImmutableList" | "IImmutableSet" | "IImmutableDictionary" | "IList" | "ICollection" | "IReadOnlyList" | "IReadOnlyCollection" | "IDictionary" | "IReadOnlyDictionary" | "ISet" | "IReadOnlySet" | "KeyCollection" | "ValueCollection";
|
|
104
|
+
export interface TupleType<T = unknown[]> extends RuntimeTypeBase<T> {
|
|
105
|
+
readonly kind: "tuple";
|
|
106
|
+
readonly elements: ReadonlyArray<RuntimeType>;
|
|
107
|
+
}
|
|
108
|
+
export interface NullableType<T> extends RuntimeTypeBase<T | null> {
|
|
109
|
+
readonly kind: "nullable";
|
|
110
|
+
readonly inner: () => RuntimeType<T>;
|
|
111
|
+
}
|
|
112
|
+
export interface UnionType<T> extends RuntimeTypeBase<T> {
|
|
113
|
+
readonly kind: "union";
|
|
114
|
+
readonly cases: ReadonlyArray<() => RuntimeType>;
|
|
115
|
+
}
|
|
116
|
+
export interface DelegateType extends RuntimeTypeBase<(...args: never[]) => unknown> {
|
|
117
|
+
readonly kind: "delegate";
|
|
118
|
+
}
|
|
119
|
+
/** The wildcard: its test always passes. */
|
|
120
|
+
export interface UnknownType extends RuntimeTypeBase<unknown> {
|
|
121
|
+
readonly kind: "unknown";
|
|
122
|
+
}
|
|
123
|
+
/** `System.Object`: its test is `value != null`. */
|
|
124
|
+
export interface ObjectType extends RuntimeTypeBase<object> {
|
|
125
|
+
readonly kind: "object";
|
|
126
|
+
}
|
|
127
|
+
/** A memoized nominal descriptor for concrete types without a emitted descriptor (#711). */
|
|
128
|
+
export interface OpaqueType extends RuntimeTypeBase<never> {
|
|
129
|
+
readonly kind: "opaque";
|
|
130
|
+
}
|
|
131
|
+
export type RuntimeType<T = unknown> = ClassType<T> | InterfaceType<T> | PlainObjectType<T> | PrimitiveType<T> | EnumType<T> | ArrayType | CollectionType<T> | TupleType<T> | NullableType<unknown> | UnionType<T> | DelegateType | UnknownType | ObjectType | OpaqueType;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CollectionType, RuntimeType } from "./runtime-type.ts";
|
|
2
|
+
/**
|
|
3
|
+
* A closed collection descriptor (`List<String>`) from an open one (a class's
|
|
4
|
+
* `$runtimeType` literal or an interface literal), memoized on the identity of the
|
|
5
|
+
* open descriptor and of each argument, so `listType(StringType) === listType(StringType)`
|
|
6
|
+
* and `getRuntimeType` answers the same object (spec 011 FR-008, D30). A class kind
|
|
7
|
+
* closes through its own `closeFor` (the memo `getRuntimeType` shares); an
|
|
8
|
+
* interface kind tests nominally through the class literals' `interfaces`, with
|
|
9
|
+
* assignability for a covariant parameter.
|
|
10
|
+
*/
|
|
11
|
+
export declare function specializeCollection<T>(open: CollectionType<T>, typeArguments: ReadonlyArray<RuntimeType>): CollectionType<T>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { memoNodeFor } from "../identity-memo.js";
|
|
2
|
+
import { isAssignableFrom, isReferenceType } from "./is-assignable-from.js";
|
|
3
|
+
let memo;
|
|
4
|
+
/**
|
|
5
|
+
* A closed collection descriptor (`List<String>`) from an open one (a class's
|
|
6
|
+
* `$runtimeType` literal or an interface literal), memoized on the identity of the
|
|
7
|
+
* open descriptor and of each argument, so `listType(StringType) === listType(StringType)`
|
|
8
|
+
* and `getRuntimeType` answers the same object (spec 011 FR-008, D30). A class kind
|
|
9
|
+
* closes through its own `closeFor` (the memo `getRuntimeType` shares); an
|
|
10
|
+
* interface kind tests nominally through the class literals' `interfaces`, with
|
|
11
|
+
* assignability for a covariant parameter.
|
|
12
|
+
*/
|
|
13
|
+
export function specializeCollection(open, typeArguments) {
|
|
14
|
+
if (open.closeFor !== undefined) {
|
|
15
|
+
// A class kind closes through its own memo (the one getRuntimeType reaches), given a
|
|
16
|
+
// carrier object holding the slot its instances carry.
|
|
17
|
+
return open.closeFor({ [`$typeArguments$${open.collection}`]: typeArguments });
|
|
18
|
+
}
|
|
19
|
+
memo ??= {};
|
|
20
|
+
const node = memoNodeFor(memo, [open, ...typeArguments]);
|
|
21
|
+
node.value ??= {
|
|
22
|
+
...open,
|
|
23
|
+
name: `${open.name}<${typeArguments.map((argument) => argument.name).join(",")}>`,
|
|
24
|
+
fullName: `${open.fullName}<${typeArguments.map((argument) => argument.fullName).join(",")}>`,
|
|
25
|
+
typeArguments,
|
|
26
|
+
test: (value) => matchesCollection(value, open, typeArguments),
|
|
27
|
+
};
|
|
28
|
+
return node.value;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* An interface kind: nominal through the nearest own collection descriptor's
|
|
32
|
+
* `interfaces` entries, then the slot mapped to the interface's arguments.
|
|
33
|
+
*/
|
|
34
|
+
function matchesCollection(value, open, typeArguments) {
|
|
35
|
+
const found = implementedEntry(value, open.collection);
|
|
36
|
+
return (found !== undefined &&
|
|
37
|
+
argumentsMatch(slotOf(value, found.owner), found.entry.arguments, open, typeArguments));
|
|
38
|
+
}
|
|
39
|
+
function slotOf(value, collection) {
|
|
40
|
+
const direct = value[`$typeArguments$${collection}`];
|
|
41
|
+
if (direct !== undefined ||
|
|
42
|
+
(collection !== "KeyCollection" && collection !== "ValueCollection")) {
|
|
43
|
+
return direct;
|
|
44
|
+
}
|
|
45
|
+
const source = value._source;
|
|
46
|
+
if (source === undefined) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
const sourceDescriptor = source.constructor?.$runtimeType;
|
|
50
|
+
const sourceCollection = sourceDescriptor?.kind === "collection" ? sourceDescriptor.collection : "Dictionary";
|
|
51
|
+
const sourceSlot = (source[`$typeArguments$${sourceCollection}`] ??
|
|
52
|
+
source.$typeArguments$Dictionary);
|
|
53
|
+
if (sourceSlot === undefined) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
const element = sourceSlot[collection === "KeyCollection" ? 0 : 1];
|
|
57
|
+
return element === undefined ? undefined : [element];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Each tested argument against the slot entry the mapping names: identity for an
|
|
61
|
+
* invariant parameter, assignability for a covariant one; an absent slot, a `null`
|
|
62
|
+
* mapping or `UnknownType` on either side matches anything (FR-008's wildcard).
|
|
63
|
+
*/
|
|
64
|
+
function argumentsMatch(slot, mapping, open, typeArguments) {
|
|
65
|
+
if (slot === undefined || mapping === null) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
return typeArguments.every((expected, position) => {
|
|
69
|
+
const actual = slot[mapping[position] ?? -1];
|
|
70
|
+
if (actual === undefined || actual.kind === "unknown" || expected.kind === "unknown") {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
return open.variance[position] === "covariant"
|
|
74
|
+
? actual === expected || (isReferenceType(actual) && isAssignableFrom(expected, actual))
|
|
75
|
+
: actual === expected;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/** The `interfaces` entry naming `collection` on the nearest own collection descriptor. */
|
|
79
|
+
function implementedEntry(value, collection) {
|
|
80
|
+
if (value === null || typeof value !== "object") {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
for (let current = value.constructor; typeof current === "function"; current = Object.getPrototypeOf(current)) {
|
|
84
|
+
const descriptor = Object.hasOwn(current, "$runtimeType")
|
|
85
|
+
? current.$runtimeType
|
|
86
|
+
: undefined;
|
|
87
|
+
if (descriptor?.kind === "collection") {
|
|
88
|
+
const entry = descriptor.interfaces?.find((candidate) => candidate.collection === collection);
|
|
89
|
+
return entry === undefined ? undefined : { owner: descriptor.collection, entry };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ClassType, RuntimeType } from "./runtime-type.ts";
|
|
2
|
+
/**
|
|
3
|
+
* A closed specialization of an open generic class descriptor (`Box<Int32>`). Memoized on the
|
|
4
|
+
* identity of the open type and of each argument. Checks the instance's `open.slot` when
|
|
5
|
+
* declared and forwards `args` to `open.create` when present.
|
|
6
|
+
*/
|
|
7
|
+
export declare function specialize<T>(open: ClassType<T>, args: ReadonlyArray<RuntimeType>): ClassType<T>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { memoNodeFor } from "../identity-memo.js";
|
|
2
|
+
let memo;
|
|
3
|
+
/**
|
|
4
|
+
* A closed specialization of an open generic class descriptor (`Box<Int32>`). Memoized on the
|
|
5
|
+
* identity of the open type and of each argument. Checks the instance's `open.slot` when
|
|
6
|
+
* declared and forwards `args` to `open.create` when present.
|
|
7
|
+
*/
|
|
8
|
+
export function specialize(open, args) {
|
|
9
|
+
memo ??= {};
|
|
10
|
+
const node = memoNodeFor(memo, [open, ...args]);
|
|
11
|
+
node.value ??= {
|
|
12
|
+
...open,
|
|
13
|
+
name: `${open.name}<${args.map((arg) => arg.name).join(",")}>`,
|
|
14
|
+
fullName: `${open.fullName}<${args.map((arg) => arg.fullName).join(",")}>`,
|
|
15
|
+
typeArguments: args,
|
|
16
|
+
...(open.default !== undefined ? { default: () => open.default(args) } : {}),
|
|
17
|
+
...(open.create !== undefined ? { create: () => open.create(args) } : {}),
|
|
18
|
+
test: (value) => open.test(value) &&
|
|
19
|
+
(open.slot === undefined ||
|
|
20
|
+
slotMatches(value[open.slot], args)),
|
|
21
|
+
};
|
|
22
|
+
return node.value;
|
|
23
|
+
}
|
|
24
|
+
function slotMatches(slot, args) {
|
|
25
|
+
return (slot === undefined ||
|
|
26
|
+
args.every((expected, index) => {
|
|
27
|
+
const actual = slot[index];
|
|
28
|
+
return (actual === undefined ||
|
|
29
|
+
actual === expected ||
|
|
30
|
+
actual.kind === "unknown" ||
|
|
31
|
+
expected.kind === "unknown");
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import type { PrimitiveType } from "./runtime-type.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Temporal descriptors with `default` and `create` factories, kept in their own
|
|
5
|
+
* module so `castTo`, `isType`, and `getRuntimeType` do not import `@js-temporal/polyfill`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DateTimeDefaultType: PrimitiveType<Temporal.PlainDateTime>;
|
|
8
|
+
export declare const DateTimeOffsetDefaultType: PrimitiveType<Temporal.ZonedDateTime>;
|
|
9
|
+
export declare const DateOnlyDefaultType: PrimitiveType<Temporal.PlainDate>;
|
|
10
|
+
export declare const TimeOnlyDefaultType: PrimitiveType<Temporal.PlainTime>;
|
|
11
|
+
export declare const TimeSpanDefaultType: PrimitiveType<Temporal.Duration>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import { toStringTag } from "./to-string-tag.js";
|
|
3
|
+
const dateTimeZero = () => new Temporal.PlainDateTime(1, 1, 1);
|
|
4
|
+
const dateTimeOffsetZero = () => Temporal.ZonedDateTime.from("0001-01-01T00:00:00+00:00[+00:00]");
|
|
5
|
+
const dateOnlyZero = () => new Temporal.PlainDate(1, 1, 1);
|
|
6
|
+
const timeOnlyZero = () => new Temporal.PlainTime(0, 0, 0);
|
|
7
|
+
const timeSpanZero = () => new Temporal.Duration();
|
|
8
|
+
/**
|
|
9
|
+
* Temporal descriptors with `default` and `create` factories, kept in their own
|
|
10
|
+
* module so `castTo`, `isType`, and `getRuntimeType` do not import `@js-temporal/polyfill`.
|
|
11
|
+
*/
|
|
12
|
+
export const DateTimeDefaultType = {
|
|
13
|
+
kind: "primitive",
|
|
14
|
+
name: "DateTime",
|
|
15
|
+
fullName: "System.DateTime",
|
|
16
|
+
namespace: "System",
|
|
17
|
+
primitive: "DateTime",
|
|
18
|
+
test: (value) => toStringTag(value) === "[object Temporal.PlainDateTime]",
|
|
19
|
+
default: dateTimeZero,
|
|
20
|
+
create: dateTimeZero,
|
|
21
|
+
};
|
|
22
|
+
export const DateTimeOffsetDefaultType = {
|
|
23
|
+
kind: "primitive",
|
|
24
|
+
name: "DateTimeOffset",
|
|
25
|
+
fullName: "System.DateTimeOffset",
|
|
26
|
+
namespace: "System",
|
|
27
|
+
primitive: "DateTimeOffset",
|
|
28
|
+
test: (value) => toStringTag(value) === "[object Temporal.ZonedDateTime]",
|
|
29
|
+
default: dateTimeOffsetZero,
|
|
30
|
+
create: dateTimeOffsetZero,
|
|
31
|
+
};
|
|
32
|
+
export const DateOnlyDefaultType = {
|
|
33
|
+
kind: "primitive",
|
|
34
|
+
name: "DateOnly",
|
|
35
|
+
fullName: "System.DateOnly",
|
|
36
|
+
namespace: "System",
|
|
37
|
+
primitive: "DateOnly",
|
|
38
|
+
test: (value) => toStringTag(value) === "[object Temporal.PlainDate]",
|
|
39
|
+
default: dateOnlyZero,
|
|
40
|
+
create: dateOnlyZero,
|
|
41
|
+
};
|
|
42
|
+
export const TimeOnlyDefaultType = {
|
|
43
|
+
kind: "primitive",
|
|
44
|
+
name: "TimeOnly",
|
|
45
|
+
fullName: "System.TimeOnly",
|
|
46
|
+
namespace: "System",
|
|
47
|
+
primitive: "TimeOnly",
|
|
48
|
+
test: (value) => toStringTag(value) === "[object Temporal.PlainTime]",
|
|
49
|
+
default: timeOnlyZero,
|
|
50
|
+
create: timeOnlyZero,
|
|
51
|
+
};
|
|
52
|
+
export const TimeSpanDefaultType = {
|
|
53
|
+
kind: "primitive",
|
|
54
|
+
name: "TimeSpan",
|
|
55
|
+
fullName: "System.TimeSpan",
|
|
56
|
+
namespace: "System",
|
|
57
|
+
primitive: "TimeSpan",
|
|
58
|
+
test: (value) => toStringTag(value) === "[object Temporal.Duration]",
|
|
59
|
+
default: timeSpanZero,
|
|
60
|
+
create: timeSpanZero,
|
|
61
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Temporal } from "@js-temporal/polyfill";
|
|
2
|
+
import type { PrimitiveType } from "./runtime-type.ts";
|
|
3
|
+
export declare const DateTimeType: PrimitiveType<Temporal.PlainDateTime>;
|
|
4
|
+
export declare const DateTimeOffsetType: PrimitiveType<Temporal.ZonedDateTime>;
|
|
5
|
+
export declare const DateOnlyType: PrimitiveType<Temporal.PlainDate>;
|
|
6
|
+
export declare const TimeOnlyType: PrimitiveType<Temporal.PlainTime>;
|
|
7
|
+
export declare const TimeSpanType: PrimitiveType<Temporal.Duration>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { toStringTag } from "./to-string-tag.js";
|
|
2
|
+
// Each type is recognized by the `Symbol.toStringTag` of its Temporal class (the one the
|
|
3
|
+
// polyfill and the native API both expose). `default`/`create` factories live in
|
|
4
|
+
// `temporal-type-defaults.ts` so `castTo`/`getRuntimeType` do not import the polyfill.
|
|
5
|
+
export const DateTimeType = {
|
|
6
|
+
kind: "primitive",
|
|
7
|
+
name: "DateTime",
|
|
8
|
+
fullName: "System.DateTime",
|
|
9
|
+
namespace: "System",
|
|
10
|
+
primitive: "DateTime",
|
|
11
|
+
test: (value) => toStringTag(value) === "[object Temporal.PlainDateTime]",
|
|
12
|
+
};
|
|
13
|
+
export const DateTimeOffsetType = {
|
|
14
|
+
kind: "primitive",
|
|
15
|
+
name: "DateTimeOffset",
|
|
16
|
+
fullName: "System.DateTimeOffset",
|
|
17
|
+
namespace: "System",
|
|
18
|
+
primitive: "DateTimeOffset",
|
|
19
|
+
test: (value) => toStringTag(value) === "[object Temporal.ZonedDateTime]",
|
|
20
|
+
};
|
|
21
|
+
export const DateOnlyType = {
|
|
22
|
+
kind: "primitive",
|
|
23
|
+
name: "DateOnly",
|
|
24
|
+
fullName: "System.DateOnly",
|
|
25
|
+
namespace: "System",
|
|
26
|
+
primitive: "DateOnly",
|
|
27
|
+
test: (value) => toStringTag(value) === "[object Temporal.PlainDate]",
|
|
28
|
+
};
|
|
29
|
+
export const TimeOnlyType = {
|
|
30
|
+
kind: "primitive",
|
|
31
|
+
name: "TimeOnly",
|
|
32
|
+
fullName: "System.TimeOnly",
|
|
33
|
+
namespace: "System",
|
|
34
|
+
primitive: "TimeOnly",
|
|
35
|
+
test: (value) => toStringTag(value) === "[object Temporal.PlainTime]",
|
|
36
|
+
};
|
|
37
|
+
export const TimeSpanType = {
|
|
38
|
+
kind: "primitive",
|
|
39
|
+
name: "TimeSpan",
|
|
40
|
+
fullName: "System.TimeSpan",
|
|
41
|
+
namespace: "System",
|
|
42
|
+
primitive: "TimeSpan",
|
|
43
|
+
test: (value) => toStringTag(value) === "[object Temporal.Duration]",
|
|
44
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `Object.prototype.toString` tag of a value (`[object Decimal]`,
|
|
3
|
+
* `[object Temporal.PlainDate]`): how the runtime recognizes decimal.js and Temporal values
|
|
4
|
+
* without `instanceof`, so neither library is ever imported by reflection.
|
|
5
|
+
*/
|
|
6
|
+
export declare function toStringTag(value: unknown): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `Object.prototype.toString` tag of a value (`[object Decimal]`,
|
|
3
|
+
* `[object Temporal.PlainDate]`): how the runtime recognizes decimal.js and Temporal values
|
|
4
|
+
* without `instanceof`, so neither library is ever imported by reflection.
|
|
5
|
+
*/
|
|
6
|
+
export function toStringTag(value) {
|
|
7
|
+
return Object.prototype.toString.call(value);
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RuntimeType, TupleType } from "./runtime-type.ts";
|
|
2
|
+
/**
|
|
3
|
+
* A closed `System.ValueTuple<...>` descriptor, memoized on element identities.
|
|
4
|
+
* Value types are invariant in covariant collection type tests (#711).
|
|
5
|
+
*/
|
|
6
|
+
export declare function tupleType<T extends readonly unknown[] = unknown[]>(elements: ReadonlyArray<RuntimeType>): TupleType<T>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { memoNodeFor } from "../identity-memo.js";
|
|
2
|
+
let memo;
|
|
3
|
+
/**
|
|
4
|
+
* A closed `System.ValueTuple<...>` descriptor, memoized on element identities.
|
|
5
|
+
* Value types are invariant in covariant collection type tests (#711).
|
|
6
|
+
*/
|
|
7
|
+
export function tupleType(elements) {
|
|
8
|
+
memo ??= {};
|
|
9
|
+
const node = memoNodeFor(memo, elements);
|
|
10
|
+
node.value ??= {
|
|
11
|
+
kind: "tuple",
|
|
12
|
+
name: `ValueTuple<${elements.map((element) => element.name).join(",")}>`,
|
|
13
|
+
fullName: `System.ValueTuple<${elements.map((element) => element.fullName).join(",")}>`,
|
|
14
|
+
namespace: "System",
|
|
15
|
+
elements,
|
|
16
|
+
default: () => elements.map((element) => element.default?.() ?? null),
|
|
17
|
+
create: () => elements.map((element) => element.default?.() ?? null),
|
|
18
|
+
test: (value) => Array.isArray(value) &&
|
|
19
|
+
value.length === elements.length &&
|
|
20
|
+
elements.every((element, index) => element.test(value[index])),
|
|
21
|
+
};
|
|
22
|
+
return node.value;
|
|
23
|
+
}
|