From 11bfb4b698cc384c663b5c9a334cc548991385cc Mon Sep 17 00:00:00 2001 From: electricessence Date: Tue, 17 May 2016 14:23:46 -0700 Subject: [PATCH] Updated gulp task to output declaration files for all modules. This increases typing compatibility when consuming specific module types. --- bower.json | 2 +- dist/amd/System.Linq/Linq.d.ts | 196 ++++++++++++ dist/amd/System/Char.d.ts | 10 + .../amd/System/Collections/Array/Compare.d.ts | 13 + .../System/Collections/Array/Dispatch.d.ts | 13 + dist/amd/System/Collections/Array/Dispatch.js | 6 + .../System/Collections/Array/Dispatch.js.map | 1 + .../System/Collections/Array/Procedure.d.ts | 10 + .../amd/System/Collections/Array/Procedure.js | 6 + .../System/Collections/Array/Procedure.js.map | 1 + .../Array/ReadOnlyArrayWrapper.d.ts | 9 + .../Collections/Array/ReadOnlyArrayWrapper.js | 6 + .../Array/ReadOnlyArrayWrapper.js.map | 1 + dist/amd/System/Collections/Array/Sort.d.ts | 9 + dist/amd/System/Collections/Array/Sort.js | 6 + dist/amd/System/Collections/Array/Sort.js.map | 1 + .../amd/System/Collections/Array/Utility.d.ts | 26 ++ .../System/Collections/CollectionBase.d.ts | 40 +++ .../Collections/Dictionaries/Dictionary.d.ts | 26 ++ .../Dictionaries/DictionaryBase.d.ts | 31 ++ .../OrderedStringKeyDictionary.d.ts | 17 + .../OrderedStringKeyDictionary.js | 6 + .../OrderedStringKeyDictionary.js.map | 1 + .../Dictionaries/StringKeyDictionary.d.ts | 20 ++ .../Dictionaries/StringKeyDictionary.js | 6 + .../Dictionaries/StringKeyDictionary.js.map | 1 + .../Enumeration/ArrayEnumerator.d.ts | 10 + .../Collections/Enumeration/Enumerator.d.ts | 19 ++ .../Enumeration/EnumeratorBase.d.ts | 26 ++ .../Enumeration/IndexEnumerator.d.ts | 15 + .../UnsupportedEnumerableException.d.ts | 10 + dist/amd/System/Collections/LinkedList.d.ts | 37 +++ .../System/Collections/LinkedNodeList.d.ts | 31 ++ dist/amd/System/Collections/List.d.ts | 24 ++ dist/amd/System/Collections/Queue.d.ts | 35 +++ .../Collections/ReadOnlyCollectionBase.d.ts | 18 ++ .../ReadOnlyCollectionWrapper.d.ts | 8 + dist/amd/System/Collections/Set.d.ts | 17 + dist/amd/System/Collections/SetBase.d.ts | 36 +++ .../Collections/Sorting/KeySortedContext.d.ts | 16 + .../Collections/Sorting/SortContext.d.ts | 17 + dist/amd/System/Compare.d.ts | 11 + dist/amd/System/Diagnostics/Stopwatch.d.ts | 24 ++ .../amd/System/Disposable/DisposableBase.d.ts | 16 + .../Disposable/ObjectDisposedException.d.ts | 15 + dist/amd/System/Disposable/ObjectPool.d.ts | 30 ++ dist/amd/System/Disposable/dispose.d.ts | 17 + .../System/Events/EventDispatcherBase.d.ts | 33 ++ .../System/Events/EventDispatcherEntry.d.ts | 16 + dist/amd/System/Events/EventSimple.d.ts | 13 + dist/amd/System/Exception.d.ts | 18 ++ dist/amd/System/ExceptionType.d.ts | 11 + .../System/Exceptions/ArgumentException.d.ts | 11 + .../Exceptions/ArgumentNullException.d.ts | 10 + .../ArgumentOutOfRangeException.d.ts | 12 + .../Exceptions/InvalidOperationException.d.ts | 9 + .../Exceptions/NotImplementedException.d.ts | 9 + .../Exceptions/NullReferenceException.d.ts | 9 + .../System/Exceptions/SystemException.d.ts | 9 + dist/amd/System/Functions.d.ts | 17 + dist/amd/System/Integer.d.ts | 25 ++ dist/amd/System/KeyValueExtract.d.ts | 9 + dist/amd/System/Lazy.d.ts | 21 ++ dist/amd/System/Net/Http/HttpMethod.d.ts | 7 + dist/amd/System/Net/Http/HttpMethod.js | 7 + dist/amd/System/Net/Http/HttpMethod.js.map | 1 + .../System/Net/Http/HttpRequestFactory.d.ts | 21 ++ .../amd/System/Net/Http/HttpRequestFactory.js | 6 + .../System/Net/Http/HttpRequestFactory.js.map | 1 + .../amd/System/Observable/ObservableBase.d.ts | 15 + .../System/Observable/ObservableNodeBase.d.ts | 14 + .../System/Observable/SubscribableBase.d.ts | 19 ++ dist/amd/System/Observable/Subscription.d.ts | 17 + dist/amd/System/Serialization/Utility.d.ts | 9 + dist/amd/System/Tasks/TaskHandler.d.ts | 12 + dist/amd/System/Tasks/TaskHandlerBase.d.ts | 17 + dist/amd/System/Tasks/defer.d.ts | 7 + dist/amd/System/Tasks/deferImmediate.d.ts | 8 + .../amd/System/Text/RegexMatchEnumerator.d.ts | 14 + dist/amd/System/Text/RegularExpressions.d.ts | 62 ++++ dist/amd/System/Text/StringBuilder.d.ts | 21 ++ dist/amd/System/Text/Utility.d.ts | 17 + dist/amd/System/Time/ClockTime.d.ts | 22 ++ dist/amd/System/Time/DateTime.d.ts | 57 ++++ dist/amd/System/Time/DateTime.js | 7 + dist/amd/System/Time/DateTime.js.map | 1 + dist/amd/System/Time/HowMany.d.ts | 41 +++ dist/amd/System/Time/TimeQuantity.d.ts | 20 ++ dist/amd/System/Time/TimeSpan.d.ts | 34 ++ dist/amd/System/Time/TimeStamp.d.ts | 21 ++ dist/amd/System/Time/TimeStamp.js | 6 + dist/amd/System/Time/TimeStamp.js.map | 1 + dist/amd/System/Time/TimeUnit.d.ts | 22 ++ dist/amd/System/Time/TimeUnitValue.d.ts | 19 ++ dist/amd/System/Time/TimeUnitValue.js | 6 + dist/amd/System/Time/TimeUnitValue.js.map | 1 + dist/amd/System/Timers/Timer.d.ts | 24 ++ dist/amd/System/Types.d.ts | 46 +++ dist/amd/System/Uri/HostNameType.d.ts | 13 + dist/amd/System/Uri/HostNameType.js | 7 + dist/amd/System/Uri/HostNameType.js.map | 1 + dist/amd/System/Uri/QueryBuilder.d.ts | 17 + dist/amd/System/Uri/QueryBuilder.js | 6 + dist/amd/System/Uri/QueryBuilder.js.map | 1 + dist/amd/System/Uri/QueryParams.d.ts | 17 + dist/amd/System/Uri/QueryParams.js | 6 + dist/amd/System/Uri/QueryParams.js.map | 1 + dist/amd/System/Uri/Scheme.d.ts | 21 ++ dist/amd/System/Uri/Scheme.js | 7 + dist/amd/System/Uri/Scheme.js.map | 1 + dist/amd/System/Uri/Uri.d.ts | 48 +++ dist/amd/System/Uri/Uri.js | 7 + dist/amd/System/Uri/Uri.js.map | 1 + dist/amd/System/Utility/applyMixins.d.ts | 5 + dist/amd/System/Utility/applyMixins.js | 6 + dist/amd/System/Utility/applyMixins.js.map | 1 + dist/amd/System/Utility/clone.d.ts | 5 + dist/amd/System/Utility/clone.js | 6 + dist/amd/System/Utility/clone.js.map | 1 + dist/amd/System/Utility/shallowCopy.d.ts | 5 + .../System/Validation/ValidationResult.d.ts | 15 + .../amd/System/Validation/ValidationResult.js | 6 + .../System/Validation/ValidationResult.js.map | 1 + dist/amd/extends.d.ts | 5 + dist/commonjs/System.Linq/Linq.d.ts | 196 ++++++++++++ dist/commonjs/System/Char.d.ts | 10 + .../System/Collections/Array/Compare.d.ts | 13 + .../System/Collections/Array/Dispatch.d.ts | 13 + .../System/Collections/Array/Dispatch.js | 47 +++ .../System/Collections/Array/Dispatch.js.map | 1 + .../System/Collections/Array/Procedure.d.ts | 10 + .../System/Collections/Array/Procedure.js | 140 +++++++++ .../System/Collections/Array/Procedure.js.map | 1 + .../Array/ReadOnlyArrayWrapper.d.ts | 9 + .../Collections/Array/ReadOnlyArrayWrapper.js | 44 +++ .../Array/ReadOnlyArrayWrapper.js.map | 1 + .../System/Collections/Array/Sort.d.ts | 9 + .../commonjs/System/Collections/Array/Sort.js | 39 +++ .../System/Collections/Array/Sort.js.map | 1 + .../System/Collections/Array/Utility.d.ts | 26 ++ .../System/Collections/CollectionBase.d.ts | 40 +++ .../Collections/Dictionaries/Dictionary.d.ts | 26 ++ .../Dictionaries/DictionaryBase.d.ts | 31 ++ .../OrderedStringKeyDictionary.d.ts | 17 + .../Dictionaries/StringKeyDictionary.d.ts | 20 ++ .../Enumeration/ArrayEnumerator.d.ts | 10 + .../Collections/Enumeration/Enumerator.d.ts | 19 ++ .../Enumeration/EnumeratorBase.d.ts | 26 ++ .../Enumeration/IndexEnumerator.d.ts | 15 + .../UnsupportedEnumerableException.d.ts | 10 + .../System/Collections/LinkedList.d.ts | 37 +++ .../System/Collections/LinkedNodeList.d.ts | 31 ++ dist/commonjs/System/Collections/List.d.ts | 24 ++ dist/commonjs/System/Collections/Queue.d.ts | 35 +++ .../Collections/ReadOnlyCollectionBase.d.ts | 18 ++ .../ReadOnlyCollectionWrapper.d.ts | 8 + dist/commonjs/System/Collections/Set.d.ts | 17 + dist/commonjs/System/Collections/SetBase.d.ts | 36 +++ .../Collections/Sorting/KeySortedContext.d.ts | 16 + .../Collections/Sorting/SortContext.d.ts | 17 + dist/commonjs/System/Compare.d.ts | 11 + .../System/Diagnostics/Stopwatch.d.ts | 24 ++ .../System/Disposable/DisposableBase.d.ts | 16 + .../Disposable/ObjectDisposedException.d.ts | 15 + .../System/Disposable/ObjectPool.d.ts | 30 ++ dist/commonjs/System/Disposable/dispose.d.ts | 17 + .../System/Events/EventDispatcherBase.d.ts | 33 ++ .../System/Events/EventDispatcherEntry.d.ts | 16 + dist/commonjs/System/Events/EventSimple.d.ts | 13 + dist/commonjs/System/Exception.d.ts | 18 ++ dist/commonjs/System/ExceptionType.d.ts | 11 + .../System/Exceptions/ArgumentException.d.ts | 11 + .../Exceptions/ArgumentNullException.d.ts | 10 + .../ArgumentOutOfRangeException.d.ts | 12 + .../Exceptions/InvalidOperationException.d.ts | 9 + .../Exceptions/NotImplementedException.d.ts | 9 + .../Exceptions/NullReferenceException.d.ts | 9 + .../System/Exceptions/SystemException.d.ts | 9 + dist/commonjs/System/Functions.d.ts | 17 + dist/commonjs/System/Integer.d.ts | 25 ++ dist/commonjs/System/KeyValueExtract.d.ts | 9 + dist/commonjs/System/Lazy.d.ts | 21 ++ dist/commonjs/System/Net/Http/HttpMethod.d.ts | 7 + dist/commonjs/System/Net/Http/HttpMethod.js | 9 + .../System/Net/Http/HttpMethod.js.map | 1 + .../System/Net/Http/HttpRequestFactory.d.ts | 21 ++ .../System/Net/Http/HttpRequestFactory.js | 94 ++++++ .../System/Net/Http/HttpRequestFactory.js.map | 1 + .../System/Observable/ObservableBase.d.ts | 15 + .../System/Observable/ObservableNodeBase.d.ts | 14 + .../System/Observable/SubscribableBase.d.ts | 19 ++ .../System/Observable/Subscription.d.ts | 17 + .../System/Serialization/Utility.d.ts | 9 + dist/commonjs/System/Tasks/TaskHandler.d.ts | 12 + .../System/Tasks/TaskHandlerBase.d.ts | 17 + dist/commonjs/System/Tasks/defer.d.ts | 7 + .../commonjs/System/Tasks/deferImmediate.d.ts | 8 + .../System/Text/RegexMatchEnumerator.d.ts | 14 + .../System/Text/RegularExpressions.d.ts | 62 ++++ dist/commonjs/System/Text/StringBuilder.d.ts | 21 ++ dist/commonjs/System/Text/Utility.d.ts | 17 + dist/commonjs/System/Time/ClockTime.d.ts | 22 ++ dist/commonjs/System/Time/DateTime.d.ts | 57 ++++ dist/commonjs/System/Time/HowMany.d.ts | 41 +++ dist/commonjs/System/Time/TimeQuantity.d.ts | 20 ++ dist/commonjs/System/Time/TimeSpan.d.ts | 34 ++ dist/commonjs/System/Time/TimeStamp.d.ts | 21 ++ dist/commonjs/System/Time/TimeUnit.d.ts | 22 ++ dist/commonjs/System/Time/TimeUnitValue.d.ts | 19 ++ dist/commonjs/System/Timers/Timer.d.ts | 24 ++ dist/commonjs/System/Types.d.ts | 46 +++ dist/commonjs/System/Uri/HostNameType.d.ts | 13 + dist/commonjs/System/Uri/QueryBuilder.d.ts | 17 + dist/commonjs/System/Uri/QueryBuilder.js | 87 ++++++ dist/commonjs/System/Uri/QueryParams.d.ts | 17 + dist/commonjs/System/Uri/Scheme.d.ts | 21 ++ dist/commonjs/System/Uri/Scheme.js | 33 ++ dist/commonjs/System/Uri/Scheme.js.map | 1 + dist/commonjs/System/Uri/Uri.d.ts | 48 +++ dist/commonjs/System/Uri/Uri.js | 270 ++++++++++++++++ dist/commonjs/System/Uri/Uri.js.map | 1 + dist/commonjs/System/Utility/applyMixins.d.ts | 5 + dist/commonjs/System/Utility/applyMixins.js | 16 + .../System/Utility/applyMixins.js.map | 1 + dist/commonjs/System/Utility/clone.d.ts | 5 + dist/commonjs/System/Utility/clone.js | 31 ++ dist/commonjs/System/Utility/clone.js.map | 1 + dist/commonjs/System/Utility/shallowCopy.d.ts | 5 + .../System/Validation/ValidationResult.d.ts | 15 + .../System/Validation/ValidationResult.js | 52 ++++ .../System/Validation/ValidationResult.js.map | 1 + dist/commonjs/extends.d.ts | 5 + dist/es6/System/Time/ClockTime.d.ts | 2 +- dist/es6/System/Time/DateTime.d.ts | 2 +- dist/es6/System/Time/TimeQuantity.d.ts | 2 +- dist/es6/System/Time/TimeSpan.d.ts | 2 +- dist/es6/System/Time/TimeStamp.d.ts | 2 +- dist/es6/System/Time/TimeUnit.d.ts | 2 +- dist/system/System.Linq/Linq.d.ts | 196 ++++++++++++ dist/system/System/Char.d.ts | 10 + .../System/Collections/Array/Compare.d.ts | 13 + .../System/Collections/Array/Compare.js | 88 ++++++ .../System/Collections/Array/Compare.js.map | 1 + .../System/Collections/Array/Dispatch.d.ts | 13 + .../System/Collections/Array/Dispatch.js | 71 +++++ .../System/Collections/Array/Dispatch.js.map | 1 + .../System/Collections/Array/Procedure.d.ts | 10 + .../System/Collections/Array/Procedure.js | 157 ++++++++++ .../System/Collections/Array/Procedure.js.map | 1 + .../Array/ReadOnlyArrayWrapper.d.ts | 9 + .../Collections/Array/ReadOnlyArrayWrapper.js | 44 +++ .../Array/ReadOnlyArrayWrapper.js.map | 1 + .../system/System/Collections/Array/Sort.d.ts | 9 + dist/system/System/Collections/Array/Sort.js | 55 ++++ .../System/Collections/Array/Sort.js.map | 1 + .../System/Collections/Array/Utility.d.ts | 26 ++ .../System/Collections/Array/Utility.js | 292 ++++++++++++++++++ .../System/Collections/Array/Utility.js.map | 1 + .../System/Collections/CollectionBase.d.ts | 40 +++ .../Collections/Dictionaries/Dictionary.d.ts | 26 ++ .../Collections/Dictionaries/Dictionary.js | 196 ++++++++++++ .../Dictionaries/Dictionary.js.map | 1 + .../Dictionaries/DictionaryBase.d.ts | 31 ++ .../Dictionaries/DictionaryBase.js | 178 +++++++++++ .../Dictionaries/DictionaryBase.js.map | 1 + .../OrderedStringKeyDictionary.d.ts | 17 + .../OrderedStringKeyDictionary.js | 89 ++++++ .../OrderedStringKeyDictionary.js.map | 1 + .../Dictionaries/StringKeyDictionary.d.ts | 20 ++ .../Dictionaries/StringKeyDictionary.js | 123 ++++++++ .../Dictionaries/StringKeyDictionary.js.map | 1 + .../Enumeration/ArrayEnumerator.d.ts | 10 + .../Enumeration/ArrayEnumerator.js | 40 +++ .../Enumeration/ArrayEnumerator.js.map | 1 + .../Collections/Enumeration/Enumerator.d.ts | 19 ++ .../Collections/Enumeration/Enumerator.js | 167 ++++++++++ .../Collections/Enumeration/Enumerator.js.map | 1 + .../Enumeration/EnumeratorBase.d.ts | 26 ++ .../Collections/Enumeration/EnumeratorBase.js | 164 ++++++++++ .../Enumeration/EnumeratorBase.js.map | 1 + .../Enumeration/IndexEnumerator.d.ts | 15 + .../Enumeration/IndexEnumerator.js | 70 +++++ .../Enumeration/IndexEnumerator.js.map | 1 + .../UnsupportedEnumerableException.d.ts | 10 + .../UnsupportedEnumerableException.js | 37 +++ .../UnsupportedEnumerableException.js.map | 1 + .../system/System/Collections/LinkedList.d.ts | 37 +++ .../System/Collections/LinkedNodeList.d.ts | 31 ++ dist/system/System/Collections/List.d.ts | 24 ++ dist/system/System/Collections/Queue.d.ts | 35 +++ .../Collections/ReadOnlyCollectionBase.d.ts | 18 ++ .../ReadOnlyCollectionWrapper.d.ts | 8 + dist/system/System/Collections/Set.d.ts | 17 + dist/system/System/Collections/SetBase.d.ts | 36 +++ .../Collections/Sorting/KeySortedContext.d.ts | 16 + .../Collections/Sorting/KeySortedContext.js | 50 +++ .../Sorting/KeySortedContext.js.map | 1 + .../Collections/Sorting/SortContext.d.ts | 17 + .../System/Collections/Sorting/SortContext.js | 50 +++ .../Collections/Sorting/SortContext.js.map | 1 + dist/system/System/Compare.d.ts | 11 + dist/system/System/Diagnostics/Stopwatch.d.ts | 24 ++ .../System/Disposable/DisposableBase.d.ts | 16 + .../Disposable/ObjectDisposedException.d.ts | 15 + dist/system/System/Disposable/ObjectPool.d.ts | 30 ++ dist/system/System/Disposable/dispose.d.ts | 17 + .../System/Events/EventDispatcherBase.d.ts | 33 ++ .../System/Events/EventDispatcherEntry.d.ts | 16 + dist/system/System/Events/EventSimple.d.ts | 13 + dist/system/System/Events/EventSimple.js.map | 1 + dist/system/System/Exception.d.ts | 18 ++ dist/system/System/ExceptionType.d.ts | 11 + .../System/Exceptions/ArgumentException.d.ts | 11 + .../System/Exceptions/ArgumentException.js | 47 +++ .../Exceptions/ArgumentException.js.map | 1 + .../Exceptions/ArgumentNullException.d.ts | 10 + .../Exceptions/ArgumentNullException.js | 39 +++ .../Exceptions/ArgumentNullException.js.map | 1 + .../ArgumentOutOfRangeException.d.ts | 12 + .../Exceptions/ArgumentOutOfRangeException.js | 42 +++ .../ArgumentOutOfRangeException.js.map | 1 + .../Exceptions/InvalidOperationException.d.ts | 9 + .../Exceptions/InvalidOperationException.js | 37 +++ .../InvalidOperationException.js.map | 1 + .../Exceptions/NotImplementedException.d.ts | 9 + .../Exceptions/NotImplementedException.js | 37 +++ .../Exceptions/NotImplementedException.js.map | 1 + .../Exceptions/NullReferenceException.d.ts | 9 + .../Exceptions/NullReferenceException.js | 37 +++ .../Exceptions/NullReferenceException.js.map | 1 + .../System/Exceptions/SystemException.d.ts | 9 + .../System/Exceptions/SystemException.js | 37 +++ .../System/Exceptions/SystemException.js.map | 1 + dist/system/System/Functions.d.ts | 17 + dist/system/System/Integer.d.ts | 25 ++ dist/system/System/KeyValueExtract.d.ts | 9 + dist/system/System/Lazy.d.ts | 21 ++ dist/system/System/Net/Http/HttpMethod.d.ts | 7 + dist/system/System/Net/Http/HttpMethod.js | 17 + dist/system/System/Net/Http/HttpMethod.js.map | 1 + .../System/Net/Http/HttpRequestFactory.d.ts | 21 ++ .../System/Net/Http/HttpRequestFactory.js | 84 +++++ .../System/Net/Http/HttpRequestFactory.js.map | 1 + .../System/Observable/ObservableBase.d.ts | 15 + .../System/Observable/ObservableBase.js | 67 ++++ .../System/Observable/ObservableBase.js.map | 1 + .../System/Observable/ObservableNodeBase.d.ts | 14 + .../System/Observable/ObservableNodeBase.js | 43 +++ .../Observable/ObservableNodeBase.js.map | 1 + .../System/Observable/SubscribableBase.d.ts | 19 ++ .../System/Observable/SubscribableBase.js | 78 +++++ .../System/Observable/SubscribableBase.js.map | 1 + .../System/Observable/Subscription.d.ts | 17 + dist/system/System/Observable/Subscription.js | 50 +++ .../System/Observable/Subscription.js.map | 1 + dist/system/System/Serialization/Utility.d.ts | 9 + dist/system/System/Serialization/Utility.js | 85 +++++ .../System/Serialization/Utility.js.map | 1 + dist/system/System/Tasks/TaskHandler.d.ts | 12 + dist/system/System/Tasks/TaskHandler.js | 45 +++ dist/system/System/Tasks/TaskHandler.js.map | 1 + dist/system/System/Tasks/TaskHandlerBase.d.ts | 17 + dist/system/System/Tasks/TaskHandlerBase.js | 65 ++++ .../System/Tasks/TaskHandlerBase.js.map | 1 + dist/system/System/Tasks/defer.d.ts | 7 + dist/system/System/Tasks/defer.js | 88 ++++++ dist/system/System/Tasks/defer.js.map | 1 + dist/system/System/Tasks/deferImmediate.d.ts | 8 + dist/system/System/Tasks/deferImmediate.js | 134 ++++++++ .../system/System/Tasks/deferImmediate.js.map | 1 + .../System/Text/RegexMatchEnumerator.d.ts | 14 + .../System/Text/RegexMatchEnumerator.js | 57 ++++ .../System/Text/RegexMatchEnumerator.js.map | 1 + .../System/Text/RegularExpressions.d.ts | 62 ++++ dist/system/System/Text/RegularExpressions.js | 226 ++++++++++++++ .../System/Text/RegularExpressions.js.map | 1 + dist/system/System/Text/StringBuilder.d.ts | 21 ++ dist/system/System/Text/StringBuilder.js | 102 ++++++ dist/system/System/Text/StringBuilder.js.map | 1 + dist/system/System/Text/Utility.d.ts | 17 + dist/system/System/Text/Utility.js | 122 ++++++++ dist/system/System/Text/Utility.js.map | 1 + dist/system/System/Time/ClockTime.d.ts | 22 ++ dist/system/System/Time/ClockTime.js | 84 +++++ dist/system/System/Time/ClockTime.js.map | 1 + dist/system/System/Time/DateTime.d.ts | 57 ++++ dist/system/System/Time/DateTime.js | 194 ++++++++++++ dist/system/System/Time/DateTime.js.map | 1 + dist/system/System/Time/HowMany.d.ts | 41 +++ dist/system/System/Time/HowMany.js | 5 + dist/system/System/Time/HowMany.js.map | 1 + dist/system/System/Time/TimeQuantity.d.ts | 20 ++ dist/system/System/Time/TimeQuantity.js | 68 ++++ dist/system/System/Time/TimeQuantity.js.map | 1 + dist/system/System/Time/TimeSpan.d.ts | 34 ++ dist/system/System/Time/TimeSpan.js | 106 +++++++ dist/system/System/Time/TimeSpan.js.map | 1 + dist/system/System/Time/TimeStamp.d.ts | 21 ++ dist/system/System/Time/TimeStamp.js | 54 ++++ dist/system/System/Time/TimeStamp.js.map | 1 + dist/system/System/Time/TimeUnit.d.ts | 22 ++ dist/system/System/Time/TimeUnit.js | 77 +++++ dist/system/System/Time/TimeUnit.js.map | 1 + dist/system/System/Time/TimeUnitValue.d.ts | 19 ++ dist/system/System/Time/TimeUnitValue.js | 71 +++++ dist/system/System/Time/TimeUnitValue.js.map | 1 + dist/system/System/Timers/Timer.d.ts | 24 ++ dist/system/System/Timers/Timer.js | 115 +++++++ dist/system/System/Timers/Timer.js.map | 1 + dist/system/System/Types.d.ts | 46 +++ dist/system/System/Uri/HostNameType.d.ts | 13 + dist/system/System/Uri/HostNameType.js | 25 ++ dist/system/System/Uri/HostNameType.js.map | 1 + dist/system/System/Uri/QueryBuilder.d.ts | 17 + dist/system/System/Uri/QueryBuilder.js | 83 +++++ dist/system/System/Uri/QueryBuilder.js.map | 1 + dist/system/System/Uri/QueryParams.d.ts | 17 + dist/system/System/Uri/QueryParams.js | 125 ++++++++ dist/system/System/Uri/QueryParams.js.map | 1 + dist/system/System/Uri/Scheme.d.ts | 21 ++ dist/system/System/Uri/Scheme.js | 39 +++ dist/system/System/Uri/Scheme.js.map | 1 + dist/system/System/Uri/Uri.d.ts | 48 +++ dist/system/System/Uri/Uri.js | 272 ++++++++++++++++ dist/system/System/Uri/Uri.js.map | 1 + dist/system/System/Utility/applyMixins.d.ts | 5 + dist/system/System/Utility/applyMixins.js | 23 ++ dist/system/System/Utility/applyMixins.js.map | 1 + dist/system/System/Utility/clone.d.ts | 5 + dist/system/System/Utility/clone.js | 43 +++ dist/system/System/Utility/clone.js.map | 1 + dist/system/System/Utility/shallowCopy.d.ts | 5 + dist/system/System/Utility/shallowCopy.js | 24 ++ dist/system/System/Utility/shallowCopy.js.map | 1 + .../System/Validation/ValidationResult.d.ts | 15 + .../System/Validation/ValidationResult.js | 46 +++ .../System/Validation/ValidationResult.js.map | 1 + dist/system/extends.d.ts | 5 + dist/umd.min/System.Linq/Linq.d.ts | 196 ++++++++++++ dist/umd.min/System/Char.d.ts | 10 + .../System/Collections/Array/Compare.d.ts | 13 + .../System/Collections/Array/Dispatch.d.ts | 13 + .../System/Collections/Array/Dispatch.js | 6 + .../System/Collections/Array/Dispatch.js.map | 1 + .../System/Collections/Array/Procedure.d.ts | 10 + .../System/Collections/Array/Procedure.js | 6 + .../System/Collections/Array/Procedure.js.map | 1 + .../Array/ReadOnlyArrayWrapper.d.ts | 9 + .../Collections/Array/ReadOnlyArrayWrapper.js | 6 + .../Array/ReadOnlyArrayWrapper.js.map | 1 + .../System/Collections/Array/Sort.d.ts | 9 + dist/umd.min/System/Collections/Array/Sort.js | 6 + .../System/Collections/Array/Sort.js.map | 1 + .../System/Collections/Array/Utility.d.ts | 26 ++ .../System/Collections/CollectionBase.d.ts | 40 +++ .../Collections/Dictionaries/Dictionary.d.ts | 26 ++ .../Dictionaries/DictionaryBase.d.ts | 31 ++ .../OrderedStringKeyDictionary.d.ts | 17 + .../Dictionaries/StringKeyDictionary.d.ts | 20 ++ .../Enumeration/ArrayEnumerator.d.ts | 10 + .../Collections/Enumeration/Enumerator.d.ts | 19 ++ .../Enumeration/EnumeratorBase.d.ts | 26 ++ .../Enumeration/IndexEnumerator.d.ts | 15 + .../UnsupportedEnumerableException.d.ts | 10 + .../System/Collections/LinkedList.d.ts | 37 +++ .../System/Collections/LinkedNodeList.d.ts | 31 ++ dist/umd.min/System/Collections/List.d.ts | 24 ++ dist/umd.min/System/Collections/Queue.d.ts | 35 +++ .../Collections/ReadOnlyCollectionBase.d.ts | 18 ++ .../ReadOnlyCollectionWrapper.d.ts | 8 + dist/umd.min/System/Collections/Set.d.ts | 17 + dist/umd.min/System/Collections/SetBase.d.ts | 36 +++ .../Collections/Sorting/KeySortedContext.d.ts | 16 + .../Collections/Sorting/SortContext.d.ts | 17 + dist/umd.min/System/Compare.d.ts | 11 + .../umd.min/System/Diagnostics/Stopwatch.d.ts | 24 ++ .../System/Disposable/DisposableBase.d.ts | 16 + .../Disposable/ObjectDisposedException.d.ts | 15 + .../umd.min/System/Disposable/ObjectPool.d.ts | 30 ++ dist/umd.min/System/Disposable/dispose.d.ts | 17 + .../System/Events/EventDispatcherBase.d.ts | 33 ++ .../System/Events/EventDispatcherEntry.d.ts | 16 + dist/umd.min/System/Events/EventSimple.d.ts | 13 + dist/umd.min/System/Exception.d.ts | 18 ++ dist/umd.min/System/ExceptionType.d.ts | 11 + .../System/Exceptions/ArgumentException.d.ts | 11 + .../Exceptions/ArgumentNullException.d.ts | 10 + .../ArgumentOutOfRangeException.d.ts | 12 + .../Exceptions/InvalidOperationException.d.ts | 9 + .../Exceptions/NotImplementedException.d.ts | 9 + .../Exceptions/NullReferenceException.d.ts | 9 + .../System/Exceptions/SystemException.d.ts | 9 + dist/umd.min/System/Functions.d.ts | 17 + dist/umd.min/System/Integer.d.ts | 25 ++ dist/umd.min/System/KeyValueExtract.d.ts | 9 + dist/umd.min/System/Lazy.d.ts | 21 ++ dist/umd.min/System/Net/Http/HttpMethod.d.ts | 7 + dist/umd.min/System/Net/Http/HttpMethod.js | 7 + .../umd.min/System/Net/Http/HttpMethod.js.map | 1 + .../System/Net/Http/HttpRequestFactory.d.ts | 21 ++ .../System/Net/Http/HttpRequestFactory.js | 6 + .../System/Net/Http/HttpRequestFactory.js.map | 1 + .../System/Observable/ObservableBase.d.ts | 15 + .../System/Observable/ObservableNodeBase.d.ts | 14 + .../System/Observable/SubscribableBase.d.ts | 19 ++ .../System/Observable/Subscription.d.ts | 17 + .../umd.min/System/Serialization/Utility.d.ts | 9 + dist/umd.min/System/Tasks/TaskHandler.d.ts | 12 + .../umd.min/System/Tasks/TaskHandlerBase.d.ts | 17 + dist/umd.min/System/Tasks/defer.d.ts | 7 + dist/umd.min/System/Tasks/deferImmediate.d.ts | 8 + .../System/Text/RegexMatchEnumerator.d.ts | 14 + .../System/Text/RegularExpressions.d.ts | 62 ++++ dist/umd.min/System/Text/StringBuilder.d.ts | 21 ++ dist/umd.min/System/Text/Utility.d.ts | 17 + dist/umd.min/System/Time/ClockTime.d.ts | 22 ++ dist/umd.min/System/Time/DateTime.d.ts | 57 ++++ dist/umd.min/System/Time/HowMany.d.ts | 41 +++ dist/umd.min/System/Time/TimeQuantity.d.ts | 20 ++ dist/umd.min/System/Time/TimeSpan.d.ts | 34 ++ dist/umd.min/System/Time/TimeStamp.d.ts | 21 ++ dist/umd.min/System/Time/TimeUnit.d.ts | 22 ++ dist/umd.min/System/Time/TimeUnitValue.d.ts | 19 ++ dist/umd.min/System/Timers/Timer.d.ts | 24 ++ dist/umd.min/System/Types.d.ts | 46 +++ dist/umd.min/System/Uri/HostNameType.d.ts | 13 + dist/umd.min/System/Uri/QueryBuilder.d.ts | 17 + dist/umd.min/System/Uri/QueryBuilder.js | 6 + dist/umd.min/System/Uri/QueryParams.d.ts | 17 + dist/umd.min/System/Uri/Scheme.d.ts | 21 ++ dist/umd.min/System/Uri/Scheme.js | 7 + dist/umd.min/System/Uri/Scheme.js.map | 1 + dist/umd.min/System/Uri/Uri.d.ts | 48 +++ dist/umd.min/System/Uri/Uri.js | 7 + dist/umd.min/System/Uri/Uri.js.map | 1 + dist/umd.min/System/Utility/applyMixins.d.ts | 5 + dist/umd.min/System/Utility/applyMixins.js | 6 + .../umd.min/System/Utility/applyMixins.js.map | 1 + dist/umd.min/System/Utility/clone.d.ts | 5 + dist/umd.min/System/Utility/clone.js | 6 + dist/umd.min/System/Utility/clone.js.map | 1 + dist/umd.min/System/Utility/shallowCopy.d.ts | 5 + .../System/Validation/ValidationResult.d.ts | 15 + .../System/Validation/ValidationResult.js | 6 + .../System/Validation/ValidationResult.js.map | 1 + dist/umd.min/extends.d.ts | 5 + gulpfile.js | 84 +++-- package.json | 5 +- tests/mocha/System.Linq/Enumerable.js | 3 +- tests/mocha/System.Linq/Enumerable.js.map | 2 +- tests/mocha/System.Linq/InfiniteEnumerable.js | 3 +- .../System.Linq/InfiniteEnumerable.js.map | 2 +- .../System/Collections/Arrays/Compare.js | 3 +- .../System/Collections/Arrays/Compare.js.map | 2 +- .../System/Collections/Arrays/Dispatch.js | 3 +- .../System/Collections/Arrays/Dispatch.js.map | 2 +- .../System/Collections/Arrays/Procedure.js | 3 +- .../Collections/Arrays/Procedure.js.map | 2 +- .../System/Collections/Arrays/Utility.js | 3 +- .../System/Collections/Arrays/Utility.js.map | 2 +- .../Enumeration/ArrayEnumerator.js | 3 +- .../Enumeration/ArrayEnumerator.js.map | 2 +- .../Collections/Enumeration/Enumerator.js | 3 +- .../Collections/Enumeration/Enumerator.js.map | 2 +- .../Enumeration/IndexEnumerator.js | 3 +- .../Enumeration/IndexEnumerator.js.map | 2 +- tests/mocha/System/Collections/ICollection.js | 3 +- .../System/Collections/ICollection.js.map | 2 +- tests/mocha/System/Collections/LinkedList.js | 3 +- .../System/Collections/LinkedList.js.map | 2 +- tests/mocha/System/Collections/List.js | 3 +- tests/mocha/System/Collections/List.js.map | 2 +- .../Collections/OrderedStringKeyDictionary.js | 3 +- .../OrderedStringKeyDictionary.js.map | 2 +- tests/mocha/System/Collections/Queue.js | 3 +- tests/mocha/System/Collections/Queue.js.map | 2 +- tests/mocha/System/Collections/Set.js | 3 +- tests/mocha/System/Collections/Set.js.map | 2 +- tests/mocha/System/Diagnostics/Stopwatch.js | 3 +- .../mocha/System/Diagnostics/Stopwatch.js.map | 2 +- tests/mocha/System/Disposable/ObjectPool.js | 3 +- .../mocha/System/Disposable/ObjectPool.js.map | 2 +- tests/mocha/System/Integer.js | 3 +- tests/mocha/System/Integer.js.map | 2 +- tests/mocha/System/Tasks/TaskHandler.js | 3 +- tests/mocha/System/Tasks/TaskHandler.js.map | 2 +- tests/mocha/System/Text/RegularExpressions.js | 3 +- .../System/Text/RegularExpressions.js.map | 2 +- tests/mocha/System/Text/Utility.js | 3 +- tests/mocha/System/Text/Utility.js.map | 2 +- tests/mocha/System/Time/ClockTime.js | 3 +- tests/mocha/System/Time/ClockTime.js.map | 2 +- tests/mocha/System/Time/DateTime.js | 3 +- tests/mocha/System/Time/DateTime.js.map | 2 +- tests/mocha/System/Uri/Uri.js | 3 +- tests/mocha/System/Uri/Uri.js.map | 2 +- tests/mocha/import-tests.js | 3 +- tests/mocha/import-tests.js.map | 2 +- 598 files changed, 13361 insertions(+), 90 deletions(-) create mode 100644 dist/amd/System.Linq/Linq.d.ts create mode 100644 dist/amd/System/Char.d.ts create mode 100644 dist/amd/System/Collections/Array/Compare.d.ts create mode 100644 dist/amd/System/Collections/Array/Dispatch.d.ts create mode 100644 dist/amd/System/Collections/Array/Dispatch.js create mode 100644 dist/amd/System/Collections/Array/Dispatch.js.map create mode 100644 dist/amd/System/Collections/Array/Procedure.d.ts create mode 100644 dist/amd/System/Collections/Array/Procedure.js create mode 100644 dist/amd/System/Collections/Array/Procedure.js.map create mode 100644 dist/amd/System/Collections/Array/ReadOnlyArrayWrapper.d.ts create mode 100644 dist/amd/System/Collections/Array/ReadOnlyArrayWrapper.js create mode 100644 dist/amd/System/Collections/Array/ReadOnlyArrayWrapper.js.map create mode 100644 dist/amd/System/Collections/Array/Sort.d.ts create mode 100644 dist/amd/System/Collections/Array/Sort.js create mode 100644 dist/amd/System/Collections/Array/Sort.js.map create mode 100644 dist/amd/System/Collections/Array/Utility.d.ts create mode 100644 dist/amd/System/Collections/CollectionBase.d.ts create mode 100644 dist/amd/System/Collections/Dictionaries/Dictionary.d.ts create mode 100644 dist/amd/System/Collections/Dictionaries/DictionaryBase.d.ts create mode 100644 dist/amd/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts create mode 100644 dist/amd/System/Collections/Dictionaries/OrderedStringKeyDictionary.js create mode 100644 dist/amd/System/Collections/Dictionaries/OrderedStringKeyDictionary.js.map create mode 100644 dist/amd/System/Collections/Dictionaries/StringKeyDictionary.d.ts create mode 100644 dist/amd/System/Collections/Dictionaries/StringKeyDictionary.js create mode 100644 dist/amd/System/Collections/Dictionaries/StringKeyDictionary.js.map create mode 100644 dist/amd/System/Collections/Enumeration/ArrayEnumerator.d.ts create mode 100644 dist/amd/System/Collections/Enumeration/Enumerator.d.ts create mode 100644 dist/amd/System/Collections/Enumeration/EnumeratorBase.d.ts create mode 100644 dist/amd/System/Collections/Enumeration/IndexEnumerator.d.ts create mode 100644 dist/amd/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts create mode 100644 dist/amd/System/Collections/LinkedList.d.ts create mode 100644 dist/amd/System/Collections/LinkedNodeList.d.ts create mode 100644 dist/amd/System/Collections/List.d.ts create mode 100644 dist/amd/System/Collections/Queue.d.ts create mode 100644 dist/amd/System/Collections/ReadOnlyCollectionBase.d.ts create mode 100644 dist/amd/System/Collections/ReadOnlyCollectionWrapper.d.ts create mode 100644 dist/amd/System/Collections/Set.d.ts create mode 100644 dist/amd/System/Collections/SetBase.d.ts create mode 100644 dist/amd/System/Collections/Sorting/KeySortedContext.d.ts create mode 100644 dist/amd/System/Collections/Sorting/SortContext.d.ts create mode 100644 dist/amd/System/Compare.d.ts create mode 100644 dist/amd/System/Diagnostics/Stopwatch.d.ts create mode 100644 dist/amd/System/Disposable/DisposableBase.d.ts create mode 100644 dist/amd/System/Disposable/ObjectDisposedException.d.ts create mode 100644 dist/amd/System/Disposable/ObjectPool.d.ts create mode 100644 dist/amd/System/Disposable/dispose.d.ts create mode 100644 dist/amd/System/Events/EventDispatcherBase.d.ts create mode 100644 dist/amd/System/Events/EventDispatcherEntry.d.ts create mode 100644 dist/amd/System/Events/EventSimple.d.ts create mode 100644 dist/amd/System/Exception.d.ts create mode 100644 dist/amd/System/ExceptionType.d.ts create mode 100644 dist/amd/System/Exceptions/ArgumentException.d.ts create mode 100644 dist/amd/System/Exceptions/ArgumentNullException.d.ts create mode 100644 dist/amd/System/Exceptions/ArgumentOutOfRangeException.d.ts create mode 100644 dist/amd/System/Exceptions/InvalidOperationException.d.ts create mode 100644 dist/amd/System/Exceptions/NotImplementedException.d.ts create mode 100644 dist/amd/System/Exceptions/NullReferenceException.d.ts create mode 100644 dist/amd/System/Exceptions/SystemException.d.ts create mode 100644 dist/amd/System/Functions.d.ts create mode 100644 dist/amd/System/Integer.d.ts create mode 100644 dist/amd/System/KeyValueExtract.d.ts create mode 100644 dist/amd/System/Lazy.d.ts create mode 100644 dist/amd/System/Net/Http/HttpMethod.d.ts create mode 100644 dist/amd/System/Net/Http/HttpMethod.js create mode 100644 dist/amd/System/Net/Http/HttpMethod.js.map create mode 100644 dist/amd/System/Net/Http/HttpRequestFactory.d.ts create mode 100644 dist/amd/System/Net/Http/HttpRequestFactory.js create mode 100644 dist/amd/System/Net/Http/HttpRequestFactory.js.map create mode 100644 dist/amd/System/Observable/ObservableBase.d.ts create mode 100644 dist/amd/System/Observable/ObservableNodeBase.d.ts create mode 100644 dist/amd/System/Observable/SubscribableBase.d.ts create mode 100644 dist/amd/System/Observable/Subscription.d.ts create mode 100644 dist/amd/System/Serialization/Utility.d.ts create mode 100644 dist/amd/System/Tasks/TaskHandler.d.ts create mode 100644 dist/amd/System/Tasks/TaskHandlerBase.d.ts create mode 100644 dist/amd/System/Tasks/defer.d.ts create mode 100644 dist/amd/System/Tasks/deferImmediate.d.ts create mode 100644 dist/amd/System/Text/RegexMatchEnumerator.d.ts create mode 100644 dist/amd/System/Text/RegularExpressions.d.ts create mode 100644 dist/amd/System/Text/StringBuilder.d.ts create mode 100644 dist/amd/System/Text/Utility.d.ts create mode 100644 dist/amd/System/Time/ClockTime.d.ts create mode 100644 dist/amd/System/Time/DateTime.d.ts create mode 100644 dist/amd/System/Time/DateTime.js create mode 100644 dist/amd/System/Time/DateTime.js.map create mode 100644 dist/amd/System/Time/HowMany.d.ts create mode 100644 dist/amd/System/Time/TimeQuantity.d.ts create mode 100644 dist/amd/System/Time/TimeSpan.d.ts create mode 100644 dist/amd/System/Time/TimeStamp.d.ts create mode 100644 dist/amd/System/Time/TimeStamp.js create mode 100644 dist/amd/System/Time/TimeStamp.js.map create mode 100644 dist/amd/System/Time/TimeUnit.d.ts create mode 100644 dist/amd/System/Time/TimeUnitValue.d.ts create mode 100644 dist/amd/System/Time/TimeUnitValue.js create mode 100644 dist/amd/System/Time/TimeUnitValue.js.map create mode 100644 dist/amd/System/Timers/Timer.d.ts create mode 100644 dist/amd/System/Types.d.ts create mode 100644 dist/amd/System/Uri/HostNameType.d.ts create mode 100644 dist/amd/System/Uri/HostNameType.js create mode 100644 dist/amd/System/Uri/HostNameType.js.map create mode 100644 dist/amd/System/Uri/QueryBuilder.d.ts create mode 100644 dist/amd/System/Uri/QueryBuilder.js create mode 100644 dist/amd/System/Uri/QueryBuilder.js.map create mode 100644 dist/amd/System/Uri/QueryParams.d.ts create mode 100644 dist/amd/System/Uri/QueryParams.js create mode 100644 dist/amd/System/Uri/QueryParams.js.map create mode 100644 dist/amd/System/Uri/Scheme.d.ts create mode 100644 dist/amd/System/Uri/Scheme.js create mode 100644 dist/amd/System/Uri/Scheme.js.map create mode 100644 dist/amd/System/Uri/Uri.d.ts create mode 100644 dist/amd/System/Uri/Uri.js create mode 100644 dist/amd/System/Uri/Uri.js.map create mode 100644 dist/amd/System/Utility/applyMixins.d.ts create mode 100644 dist/amd/System/Utility/applyMixins.js create mode 100644 dist/amd/System/Utility/applyMixins.js.map create mode 100644 dist/amd/System/Utility/clone.d.ts create mode 100644 dist/amd/System/Utility/clone.js create mode 100644 dist/amd/System/Utility/clone.js.map create mode 100644 dist/amd/System/Utility/shallowCopy.d.ts create mode 100644 dist/amd/System/Validation/ValidationResult.d.ts create mode 100644 dist/amd/System/Validation/ValidationResult.js create mode 100644 dist/amd/System/Validation/ValidationResult.js.map create mode 100644 dist/amd/extends.d.ts create mode 100644 dist/commonjs/System.Linq/Linq.d.ts create mode 100644 dist/commonjs/System/Char.d.ts create mode 100644 dist/commonjs/System/Collections/Array/Compare.d.ts create mode 100644 dist/commonjs/System/Collections/Array/Dispatch.d.ts create mode 100644 dist/commonjs/System/Collections/Array/Dispatch.js create mode 100644 dist/commonjs/System/Collections/Array/Dispatch.js.map create mode 100644 dist/commonjs/System/Collections/Array/Procedure.d.ts create mode 100644 dist/commonjs/System/Collections/Array/Procedure.js create mode 100644 dist/commonjs/System/Collections/Array/Procedure.js.map create mode 100644 dist/commonjs/System/Collections/Array/ReadOnlyArrayWrapper.d.ts create mode 100644 dist/commonjs/System/Collections/Array/ReadOnlyArrayWrapper.js create mode 100644 dist/commonjs/System/Collections/Array/ReadOnlyArrayWrapper.js.map create mode 100644 dist/commonjs/System/Collections/Array/Sort.d.ts create mode 100644 dist/commonjs/System/Collections/Array/Sort.js create mode 100644 dist/commonjs/System/Collections/Array/Sort.js.map create mode 100644 dist/commonjs/System/Collections/Array/Utility.d.ts create mode 100644 dist/commonjs/System/Collections/CollectionBase.d.ts create mode 100644 dist/commonjs/System/Collections/Dictionaries/Dictionary.d.ts create mode 100644 dist/commonjs/System/Collections/Dictionaries/DictionaryBase.d.ts create mode 100644 dist/commonjs/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts create mode 100644 dist/commonjs/System/Collections/Dictionaries/StringKeyDictionary.d.ts create mode 100644 dist/commonjs/System/Collections/Enumeration/ArrayEnumerator.d.ts create mode 100644 dist/commonjs/System/Collections/Enumeration/Enumerator.d.ts create mode 100644 dist/commonjs/System/Collections/Enumeration/EnumeratorBase.d.ts create mode 100644 dist/commonjs/System/Collections/Enumeration/IndexEnumerator.d.ts create mode 100644 dist/commonjs/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts create mode 100644 dist/commonjs/System/Collections/LinkedList.d.ts create mode 100644 dist/commonjs/System/Collections/LinkedNodeList.d.ts create mode 100644 dist/commonjs/System/Collections/List.d.ts create mode 100644 dist/commonjs/System/Collections/Queue.d.ts create mode 100644 dist/commonjs/System/Collections/ReadOnlyCollectionBase.d.ts create mode 100644 dist/commonjs/System/Collections/ReadOnlyCollectionWrapper.d.ts create mode 100644 dist/commonjs/System/Collections/Set.d.ts create mode 100644 dist/commonjs/System/Collections/SetBase.d.ts create mode 100644 dist/commonjs/System/Collections/Sorting/KeySortedContext.d.ts create mode 100644 dist/commonjs/System/Collections/Sorting/SortContext.d.ts create mode 100644 dist/commonjs/System/Compare.d.ts create mode 100644 dist/commonjs/System/Diagnostics/Stopwatch.d.ts create mode 100644 dist/commonjs/System/Disposable/DisposableBase.d.ts create mode 100644 dist/commonjs/System/Disposable/ObjectDisposedException.d.ts create mode 100644 dist/commonjs/System/Disposable/ObjectPool.d.ts create mode 100644 dist/commonjs/System/Disposable/dispose.d.ts create mode 100644 dist/commonjs/System/Events/EventDispatcherBase.d.ts create mode 100644 dist/commonjs/System/Events/EventDispatcherEntry.d.ts create mode 100644 dist/commonjs/System/Events/EventSimple.d.ts create mode 100644 dist/commonjs/System/Exception.d.ts create mode 100644 dist/commonjs/System/ExceptionType.d.ts create mode 100644 dist/commonjs/System/Exceptions/ArgumentException.d.ts create mode 100644 dist/commonjs/System/Exceptions/ArgumentNullException.d.ts create mode 100644 dist/commonjs/System/Exceptions/ArgumentOutOfRangeException.d.ts create mode 100644 dist/commonjs/System/Exceptions/InvalidOperationException.d.ts create mode 100644 dist/commonjs/System/Exceptions/NotImplementedException.d.ts create mode 100644 dist/commonjs/System/Exceptions/NullReferenceException.d.ts create mode 100644 dist/commonjs/System/Exceptions/SystemException.d.ts create mode 100644 dist/commonjs/System/Functions.d.ts create mode 100644 dist/commonjs/System/Integer.d.ts create mode 100644 dist/commonjs/System/KeyValueExtract.d.ts create mode 100644 dist/commonjs/System/Lazy.d.ts create mode 100644 dist/commonjs/System/Net/Http/HttpMethod.d.ts create mode 100644 dist/commonjs/System/Net/Http/HttpMethod.js create mode 100644 dist/commonjs/System/Net/Http/HttpMethod.js.map create mode 100644 dist/commonjs/System/Net/Http/HttpRequestFactory.d.ts create mode 100644 dist/commonjs/System/Net/Http/HttpRequestFactory.js create mode 100644 dist/commonjs/System/Net/Http/HttpRequestFactory.js.map create mode 100644 dist/commonjs/System/Observable/ObservableBase.d.ts create mode 100644 dist/commonjs/System/Observable/ObservableNodeBase.d.ts create mode 100644 dist/commonjs/System/Observable/SubscribableBase.d.ts create mode 100644 dist/commonjs/System/Observable/Subscription.d.ts create mode 100644 dist/commonjs/System/Serialization/Utility.d.ts create mode 100644 dist/commonjs/System/Tasks/TaskHandler.d.ts create mode 100644 dist/commonjs/System/Tasks/TaskHandlerBase.d.ts create mode 100644 dist/commonjs/System/Tasks/defer.d.ts create mode 100644 dist/commonjs/System/Tasks/deferImmediate.d.ts create mode 100644 dist/commonjs/System/Text/RegexMatchEnumerator.d.ts create mode 100644 dist/commonjs/System/Text/RegularExpressions.d.ts create mode 100644 dist/commonjs/System/Text/StringBuilder.d.ts create mode 100644 dist/commonjs/System/Text/Utility.d.ts create mode 100644 dist/commonjs/System/Time/ClockTime.d.ts create mode 100644 dist/commonjs/System/Time/DateTime.d.ts create mode 100644 dist/commonjs/System/Time/HowMany.d.ts create mode 100644 dist/commonjs/System/Time/TimeQuantity.d.ts create mode 100644 dist/commonjs/System/Time/TimeSpan.d.ts create mode 100644 dist/commonjs/System/Time/TimeStamp.d.ts create mode 100644 dist/commonjs/System/Time/TimeUnit.d.ts create mode 100644 dist/commonjs/System/Time/TimeUnitValue.d.ts create mode 100644 dist/commonjs/System/Timers/Timer.d.ts create mode 100644 dist/commonjs/System/Types.d.ts create mode 100644 dist/commonjs/System/Uri/HostNameType.d.ts create mode 100644 dist/commonjs/System/Uri/QueryBuilder.d.ts create mode 100644 dist/commonjs/System/Uri/QueryBuilder.js create mode 100644 dist/commonjs/System/Uri/QueryParams.d.ts create mode 100644 dist/commonjs/System/Uri/Scheme.d.ts create mode 100644 dist/commonjs/System/Uri/Scheme.js create mode 100644 dist/commonjs/System/Uri/Scheme.js.map create mode 100644 dist/commonjs/System/Uri/Uri.d.ts create mode 100644 dist/commonjs/System/Uri/Uri.js create mode 100644 dist/commonjs/System/Uri/Uri.js.map create mode 100644 dist/commonjs/System/Utility/applyMixins.d.ts create mode 100644 dist/commonjs/System/Utility/applyMixins.js create mode 100644 dist/commonjs/System/Utility/applyMixins.js.map create mode 100644 dist/commonjs/System/Utility/clone.d.ts create mode 100644 dist/commonjs/System/Utility/clone.js create mode 100644 dist/commonjs/System/Utility/clone.js.map create mode 100644 dist/commonjs/System/Utility/shallowCopy.d.ts create mode 100644 dist/commonjs/System/Validation/ValidationResult.d.ts create mode 100644 dist/commonjs/System/Validation/ValidationResult.js create mode 100644 dist/commonjs/System/Validation/ValidationResult.js.map create mode 100644 dist/commonjs/extends.d.ts create mode 100644 dist/system/System.Linq/Linq.d.ts create mode 100644 dist/system/System/Char.d.ts create mode 100644 dist/system/System/Collections/Array/Compare.d.ts create mode 100644 dist/system/System/Collections/Array/Compare.js create mode 100644 dist/system/System/Collections/Array/Compare.js.map create mode 100644 dist/system/System/Collections/Array/Dispatch.d.ts create mode 100644 dist/system/System/Collections/Array/Dispatch.js create mode 100644 dist/system/System/Collections/Array/Dispatch.js.map create mode 100644 dist/system/System/Collections/Array/Procedure.d.ts create mode 100644 dist/system/System/Collections/Array/Procedure.js create mode 100644 dist/system/System/Collections/Array/Procedure.js.map create mode 100644 dist/system/System/Collections/Array/ReadOnlyArrayWrapper.d.ts create mode 100644 dist/system/System/Collections/Array/ReadOnlyArrayWrapper.js create mode 100644 dist/system/System/Collections/Array/ReadOnlyArrayWrapper.js.map create mode 100644 dist/system/System/Collections/Array/Sort.d.ts create mode 100644 dist/system/System/Collections/Array/Sort.js create mode 100644 dist/system/System/Collections/Array/Sort.js.map create mode 100644 dist/system/System/Collections/Array/Utility.d.ts create mode 100644 dist/system/System/Collections/Array/Utility.js create mode 100644 dist/system/System/Collections/Array/Utility.js.map create mode 100644 dist/system/System/Collections/CollectionBase.d.ts create mode 100644 dist/system/System/Collections/Dictionaries/Dictionary.d.ts create mode 100644 dist/system/System/Collections/Dictionaries/Dictionary.js create mode 100644 dist/system/System/Collections/Dictionaries/Dictionary.js.map create mode 100644 dist/system/System/Collections/Dictionaries/DictionaryBase.d.ts create mode 100644 dist/system/System/Collections/Dictionaries/DictionaryBase.js create mode 100644 dist/system/System/Collections/Dictionaries/DictionaryBase.js.map create mode 100644 dist/system/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts create mode 100644 dist/system/System/Collections/Dictionaries/OrderedStringKeyDictionary.js create mode 100644 dist/system/System/Collections/Dictionaries/OrderedStringKeyDictionary.js.map create mode 100644 dist/system/System/Collections/Dictionaries/StringKeyDictionary.d.ts create mode 100644 dist/system/System/Collections/Dictionaries/StringKeyDictionary.js create mode 100644 dist/system/System/Collections/Dictionaries/StringKeyDictionary.js.map create mode 100644 dist/system/System/Collections/Enumeration/ArrayEnumerator.d.ts create mode 100644 dist/system/System/Collections/Enumeration/ArrayEnumerator.js create mode 100644 dist/system/System/Collections/Enumeration/ArrayEnumerator.js.map create mode 100644 dist/system/System/Collections/Enumeration/Enumerator.d.ts create mode 100644 dist/system/System/Collections/Enumeration/Enumerator.js create mode 100644 dist/system/System/Collections/Enumeration/Enumerator.js.map create mode 100644 dist/system/System/Collections/Enumeration/EnumeratorBase.d.ts create mode 100644 dist/system/System/Collections/Enumeration/EnumeratorBase.js create mode 100644 dist/system/System/Collections/Enumeration/EnumeratorBase.js.map create mode 100644 dist/system/System/Collections/Enumeration/IndexEnumerator.d.ts create mode 100644 dist/system/System/Collections/Enumeration/IndexEnumerator.js create mode 100644 dist/system/System/Collections/Enumeration/IndexEnumerator.js.map create mode 100644 dist/system/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts create mode 100644 dist/system/System/Collections/Enumeration/UnsupportedEnumerableException.js create mode 100644 dist/system/System/Collections/Enumeration/UnsupportedEnumerableException.js.map create mode 100644 dist/system/System/Collections/LinkedList.d.ts create mode 100644 dist/system/System/Collections/LinkedNodeList.d.ts create mode 100644 dist/system/System/Collections/List.d.ts create mode 100644 dist/system/System/Collections/Queue.d.ts create mode 100644 dist/system/System/Collections/ReadOnlyCollectionBase.d.ts create mode 100644 dist/system/System/Collections/ReadOnlyCollectionWrapper.d.ts create mode 100644 dist/system/System/Collections/Set.d.ts create mode 100644 dist/system/System/Collections/SetBase.d.ts create mode 100644 dist/system/System/Collections/Sorting/KeySortedContext.d.ts create mode 100644 dist/system/System/Collections/Sorting/KeySortedContext.js create mode 100644 dist/system/System/Collections/Sorting/KeySortedContext.js.map create mode 100644 dist/system/System/Collections/Sorting/SortContext.d.ts create mode 100644 dist/system/System/Collections/Sorting/SortContext.js create mode 100644 dist/system/System/Collections/Sorting/SortContext.js.map create mode 100644 dist/system/System/Compare.d.ts create mode 100644 dist/system/System/Diagnostics/Stopwatch.d.ts create mode 100644 dist/system/System/Disposable/DisposableBase.d.ts create mode 100644 dist/system/System/Disposable/ObjectDisposedException.d.ts create mode 100644 dist/system/System/Disposable/ObjectPool.d.ts create mode 100644 dist/system/System/Disposable/dispose.d.ts create mode 100644 dist/system/System/Events/EventDispatcherBase.d.ts create mode 100644 dist/system/System/Events/EventDispatcherEntry.d.ts create mode 100644 dist/system/System/Events/EventSimple.d.ts create mode 100644 dist/system/System/Events/EventSimple.js.map create mode 100644 dist/system/System/Exception.d.ts create mode 100644 dist/system/System/ExceptionType.d.ts create mode 100644 dist/system/System/Exceptions/ArgumentException.d.ts create mode 100644 dist/system/System/Exceptions/ArgumentException.js create mode 100644 dist/system/System/Exceptions/ArgumentException.js.map create mode 100644 dist/system/System/Exceptions/ArgumentNullException.d.ts create mode 100644 dist/system/System/Exceptions/ArgumentNullException.js create mode 100644 dist/system/System/Exceptions/ArgumentNullException.js.map create mode 100644 dist/system/System/Exceptions/ArgumentOutOfRangeException.d.ts create mode 100644 dist/system/System/Exceptions/ArgumentOutOfRangeException.js create mode 100644 dist/system/System/Exceptions/ArgumentOutOfRangeException.js.map create mode 100644 dist/system/System/Exceptions/InvalidOperationException.d.ts create mode 100644 dist/system/System/Exceptions/InvalidOperationException.js create mode 100644 dist/system/System/Exceptions/InvalidOperationException.js.map create mode 100644 dist/system/System/Exceptions/NotImplementedException.d.ts create mode 100644 dist/system/System/Exceptions/NotImplementedException.js create mode 100644 dist/system/System/Exceptions/NotImplementedException.js.map create mode 100644 dist/system/System/Exceptions/NullReferenceException.d.ts create mode 100644 dist/system/System/Exceptions/NullReferenceException.js create mode 100644 dist/system/System/Exceptions/NullReferenceException.js.map create mode 100644 dist/system/System/Exceptions/SystemException.d.ts create mode 100644 dist/system/System/Exceptions/SystemException.js create mode 100644 dist/system/System/Exceptions/SystemException.js.map create mode 100644 dist/system/System/Functions.d.ts create mode 100644 dist/system/System/Integer.d.ts create mode 100644 dist/system/System/KeyValueExtract.d.ts create mode 100644 dist/system/System/Lazy.d.ts create mode 100644 dist/system/System/Net/Http/HttpMethod.d.ts create mode 100644 dist/system/System/Net/Http/HttpMethod.js create mode 100644 dist/system/System/Net/Http/HttpMethod.js.map create mode 100644 dist/system/System/Net/Http/HttpRequestFactory.d.ts create mode 100644 dist/system/System/Net/Http/HttpRequestFactory.js create mode 100644 dist/system/System/Net/Http/HttpRequestFactory.js.map create mode 100644 dist/system/System/Observable/ObservableBase.d.ts create mode 100644 dist/system/System/Observable/ObservableBase.js create mode 100644 dist/system/System/Observable/ObservableBase.js.map create mode 100644 dist/system/System/Observable/ObservableNodeBase.d.ts create mode 100644 dist/system/System/Observable/ObservableNodeBase.js create mode 100644 dist/system/System/Observable/ObservableNodeBase.js.map create mode 100644 dist/system/System/Observable/SubscribableBase.d.ts create mode 100644 dist/system/System/Observable/SubscribableBase.js create mode 100644 dist/system/System/Observable/SubscribableBase.js.map create mode 100644 dist/system/System/Observable/Subscription.d.ts create mode 100644 dist/system/System/Observable/Subscription.js create mode 100644 dist/system/System/Observable/Subscription.js.map create mode 100644 dist/system/System/Serialization/Utility.d.ts create mode 100644 dist/system/System/Serialization/Utility.js create mode 100644 dist/system/System/Serialization/Utility.js.map create mode 100644 dist/system/System/Tasks/TaskHandler.d.ts create mode 100644 dist/system/System/Tasks/TaskHandler.js create mode 100644 dist/system/System/Tasks/TaskHandler.js.map create mode 100644 dist/system/System/Tasks/TaskHandlerBase.d.ts create mode 100644 dist/system/System/Tasks/TaskHandlerBase.js create mode 100644 dist/system/System/Tasks/TaskHandlerBase.js.map create mode 100644 dist/system/System/Tasks/defer.d.ts create mode 100644 dist/system/System/Tasks/defer.js create mode 100644 dist/system/System/Tasks/defer.js.map create mode 100644 dist/system/System/Tasks/deferImmediate.d.ts create mode 100644 dist/system/System/Tasks/deferImmediate.js create mode 100644 dist/system/System/Tasks/deferImmediate.js.map create mode 100644 dist/system/System/Text/RegexMatchEnumerator.d.ts create mode 100644 dist/system/System/Text/RegexMatchEnumerator.js create mode 100644 dist/system/System/Text/RegexMatchEnumerator.js.map create mode 100644 dist/system/System/Text/RegularExpressions.d.ts create mode 100644 dist/system/System/Text/RegularExpressions.js create mode 100644 dist/system/System/Text/RegularExpressions.js.map create mode 100644 dist/system/System/Text/StringBuilder.d.ts create mode 100644 dist/system/System/Text/StringBuilder.js create mode 100644 dist/system/System/Text/StringBuilder.js.map create mode 100644 dist/system/System/Text/Utility.d.ts create mode 100644 dist/system/System/Text/Utility.js create mode 100644 dist/system/System/Text/Utility.js.map create mode 100644 dist/system/System/Time/ClockTime.d.ts create mode 100644 dist/system/System/Time/ClockTime.js create mode 100644 dist/system/System/Time/ClockTime.js.map create mode 100644 dist/system/System/Time/DateTime.d.ts create mode 100644 dist/system/System/Time/DateTime.js create mode 100644 dist/system/System/Time/DateTime.js.map create mode 100644 dist/system/System/Time/HowMany.d.ts create mode 100644 dist/system/System/Time/HowMany.js create mode 100644 dist/system/System/Time/HowMany.js.map create mode 100644 dist/system/System/Time/TimeQuantity.d.ts create mode 100644 dist/system/System/Time/TimeQuantity.js create mode 100644 dist/system/System/Time/TimeQuantity.js.map create mode 100644 dist/system/System/Time/TimeSpan.d.ts create mode 100644 dist/system/System/Time/TimeSpan.js create mode 100644 dist/system/System/Time/TimeSpan.js.map create mode 100644 dist/system/System/Time/TimeStamp.d.ts create mode 100644 dist/system/System/Time/TimeStamp.js create mode 100644 dist/system/System/Time/TimeStamp.js.map create mode 100644 dist/system/System/Time/TimeUnit.d.ts create mode 100644 dist/system/System/Time/TimeUnit.js create mode 100644 dist/system/System/Time/TimeUnit.js.map create mode 100644 dist/system/System/Time/TimeUnitValue.d.ts create mode 100644 dist/system/System/Time/TimeUnitValue.js create mode 100644 dist/system/System/Time/TimeUnitValue.js.map create mode 100644 dist/system/System/Timers/Timer.d.ts create mode 100644 dist/system/System/Timers/Timer.js create mode 100644 dist/system/System/Timers/Timer.js.map create mode 100644 dist/system/System/Types.d.ts create mode 100644 dist/system/System/Uri/HostNameType.d.ts create mode 100644 dist/system/System/Uri/HostNameType.js create mode 100644 dist/system/System/Uri/HostNameType.js.map create mode 100644 dist/system/System/Uri/QueryBuilder.d.ts create mode 100644 dist/system/System/Uri/QueryBuilder.js create mode 100644 dist/system/System/Uri/QueryBuilder.js.map create mode 100644 dist/system/System/Uri/QueryParams.d.ts create mode 100644 dist/system/System/Uri/QueryParams.js create mode 100644 dist/system/System/Uri/QueryParams.js.map create mode 100644 dist/system/System/Uri/Scheme.d.ts create mode 100644 dist/system/System/Uri/Scheme.js create mode 100644 dist/system/System/Uri/Scheme.js.map create mode 100644 dist/system/System/Uri/Uri.d.ts create mode 100644 dist/system/System/Uri/Uri.js create mode 100644 dist/system/System/Uri/Uri.js.map create mode 100644 dist/system/System/Utility/applyMixins.d.ts create mode 100644 dist/system/System/Utility/applyMixins.js create mode 100644 dist/system/System/Utility/applyMixins.js.map create mode 100644 dist/system/System/Utility/clone.d.ts create mode 100644 dist/system/System/Utility/clone.js create mode 100644 dist/system/System/Utility/clone.js.map create mode 100644 dist/system/System/Utility/shallowCopy.d.ts create mode 100644 dist/system/System/Utility/shallowCopy.js create mode 100644 dist/system/System/Utility/shallowCopy.js.map create mode 100644 dist/system/System/Validation/ValidationResult.d.ts create mode 100644 dist/system/System/Validation/ValidationResult.js create mode 100644 dist/system/System/Validation/ValidationResult.js.map create mode 100644 dist/system/extends.d.ts create mode 100644 dist/umd.min/System.Linq/Linq.d.ts create mode 100644 dist/umd.min/System/Char.d.ts create mode 100644 dist/umd.min/System/Collections/Array/Compare.d.ts create mode 100644 dist/umd.min/System/Collections/Array/Dispatch.d.ts create mode 100644 dist/umd.min/System/Collections/Array/Dispatch.js create mode 100644 dist/umd.min/System/Collections/Array/Dispatch.js.map create mode 100644 dist/umd.min/System/Collections/Array/Procedure.d.ts create mode 100644 dist/umd.min/System/Collections/Array/Procedure.js create mode 100644 dist/umd.min/System/Collections/Array/Procedure.js.map create mode 100644 dist/umd.min/System/Collections/Array/ReadOnlyArrayWrapper.d.ts create mode 100644 dist/umd.min/System/Collections/Array/ReadOnlyArrayWrapper.js create mode 100644 dist/umd.min/System/Collections/Array/ReadOnlyArrayWrapper.js.map create mode 100644 dist/umd.min/System/Collections/Array/Sort.d.ts create mode 100644 dist/umd.min/System/Collections/Array/Sort.js create mode 100644 dist/umd.min/System/Collections/Array/Sort.js.map create mode 100644 dist/umd.min/System/Collections/Array/Utility.d.ts create mode 100644 dist/umd.min/System/Collections/CollectionBase.d.ts create mode 100644 dist/umd.min/System/Collections/Dictionaries/Dictionary.d.ts create mode 100644 dist/umd.min/System/Collections/Dictionaries/DictionaryBase.d.ts create mode 100644 dist/umd.min/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts create mode 100644 dist/umd.min/System/Collections/Dictionaries/StringKeyDictionary.d.ts create mode 100644 dist/umd.min/System/Collections/Enumeration/ArrayEnumerator.d.ts create mode 100644 dist/umd.min/System/Collections/Enumeration/Enumerator.d.ts create mode 100644 dist/umd.min/System/Collections/Enumeration/EnumeratorBase.d.ts create mode 100644 dist/umd.min/System/Collections/Enumeration/IndexEnumerator.d.ts create mode 100644 dist/umd.min/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts create mode 100644 dist/umd.min/System/Collections/LinkedList.d.ts create mode 100644 dist/umd.min/System/Collections/LinkedNodeList.d.ts create mode 100644 dist/umd.min/System/Collections/List.d.ts create mode 100644 dist/umd.min/System/Collections/Queue.d.ts create mode 100644 dist/umd.min/System/Collections/ReadOnlyCollectionBase.d.ts create mode 100644 dist/umd.min/System/Collections/ReadOnlyCollectionWrapper.d.ts create mode 100644 dist/umd.min/System/Collections/Set.d.ts create mode 100644 dist/umd.min/System/Collections/SetBase.d.ts create mode 100644 dist/umd.min/System/Collections/Sorting/KeySortedContext.d.ts create mode 100644 dist/umd.min/System/Collections/Sorting/SortContext.d.ts create mode 100644 dist/umd.min/System/Compare.d.ts create mode 100644 dist/umd.min/System/Diagnostics/Stopwatch.d.ts create mode 100644 dist/umd.min/System/Disposable/DisposableBase.d.ts create mode 100644 dist/umd.min/System/Disposable/ObjectDisposedException.d.ts create mode 100644 dist/umd.min/System/Disposable/ObjectPool.d.ts create mode 100644 dist/umd.min/System/Disposable/dispose.d.ts create mode 100644 dist/umd.min/System/Events/EventDispatcherBase.d.ts create mode 100644 dist/umd.min/System/Events/EventDispatcherEntry.d.ts create mode 100644 dist/umd.min/System/Events/EventSimple.d.ts create mode 100644 dist/umd.min/System/Exception.d.ts create mode 100644 dist/umd.min/System/ExceptionType.d.ts create mode 100644 dist/umd.min/System/Exceptions/ArgumentException.d.ts create mode 100644 dist/umd.min/System/Exceptions/ArgumentNullException.d.ts create mode 100644 dist/umd.min/System/Exceptions/ArgumentOutOfRangeException.d.ts create mode 100644 dist/umd.min/System/Exceptions/InvalidOperationException.d.ts create mode 100644 dist/umd.min/System/Exceptions/NotImplementedException.d.ts create mode 100644 dist/umd.min/System/Exceptions/NullReferenceException.d.ts create mode 100644 dist/umd.min/System/Exceptions/SystemException.d.ts create mode 100644 dist/umd.min/System/Functions.d.ts create mode 100644 dist/umd.min/System/Integer.d.ts create mode 100644 dist/umd.min/System/KeyValueExtract.d.ts create mode 100644 dist/umd.min/System/Lazy.d.ts create mode 100644 dist/umd.min/System/Net/Http/HttpMethod.d.ts create mode 100644 dist/umd.min/System/Net/Http/HttpMethod.js create mode 100644 dist/umd.min/System/Net/Http/HttpMethod.js.map create mode 100644 dist/umd.min/System/Net/Http/HttpRequestFactory.d.ts create mode 100644 dist/umd.min/System/Net/Http/HttpRequestFactory.js create mode 100644 dist/umd.min/System/Net/Http/HttpRequestFactory.js.map create mode 100644 dist/umd.min/System/Observable/ObservableBase.d.ts create mode 100644 dist/umd.min/System/Observable/ObservableNodeBase.d.ts create mode 100644 dist/umd.min/System/Observable/SubscribableBase.d.ts create mode 100644 dist/umd.min/System/Observable/Subscription.d.ts create mode 100644 dist/umd.min/System/Serialization/Utility.d.ts create mode 100644 dist/umd.min/System/Tasks/TaskHandler.d.ts create mode 100644 dist/umd.min/System/Tasks/TaskHandlerBase.d.ts create mode 100644 dist/umd.min/System/Tasks/defer.d.ts create mode 100644 dist/umd.min/System/Tasks/deferImmediate.d.ts create mode 100644 dist/umd.min/System/Text/RegexMatchEnumerator.d.ts create mode 100644 dist/umd.min/System/Text/RegularExpressions.d.ts create mode 100644 dist/umd.min/System/Text/StringBuilder.d.ts create mode 100644 dist/umd.min/System/Text/Utility.d.ts create mode 100644 dist/umd.min/System/Time/ClockTime.d.ts create mode 100644 dist/umd.min/System/Time/DateTime.d.ts create mode 100644 dist/umd.min/System/Time/HowMany.d.ts create mode 100644 dist/umd.min/System/Time/TimeQuantity.d.ts create mode 100644 dist/umd.min/System/Time/TimeSpan.d.ts create mode 100644 dist/umd.min/System/Time/TimeStamp.d.ts create mode 100644 dist/umd.min/System/Time/TimeUnit.d.ts create mode 100644 dist/umd.min/System/Time/TimeUnitValue.d.ts create mode 100644 dist/umd.min/System/Timers/Timer.d.ts create mode 100644 dist/umd.min/System/Types.d.ts create mode 100644 dist/umd.min/System/Uri/HostNameType.d.ts create mode 100644 dist/umd.min/System/Uri/QueryBuilder.d.ts create mode 100644 dist/umd.min/System/Uri/QueryBuilder.js create mode 100644 dist/umd.min/System/Uri/QueryParams.d.ts create mode 100644 dist/umd.min/System/Uri/Scheme.d.ts create mode 100644 dist/umd.min/System/Uri/Scheme.js create mode 100644 dist/umd.min/System/Uri/Scheme.js.map create mode 100644 dist/umd.min/System/Uri/Uri.d.ts create mode 100644 dist/umd.min/System/Uri/Uri.js create mode 100644 dist/umd.min/System/Uri/Uri.js.map create mode 100644 dist/umd.min/System/Utility/applyMixins.d.ts create mode 100644 dist/umd.min/System/Utility/applyMixins.js create mode 100644 dist/umd.min/System/Utility/applyMixins.js.map create mode 100644 dist/umd.min/System/Utility/clone.d.ts create mode 100644 dist/umd.min/System/Utility/clone.js create mode 100644 dist/umd.min/System/Utility/clone.js.map create mode 100644 dist/umd.min/System/Utility/shallowCopy.d.ts create mode 100644 dist/umd.min/System/Validation/ValidationResult.d.ts create mode 100644 dist/umd.min/System/Validation/ValidationResult.js create mode 100644 dist/umd.min/System/Validation/ValidationResult.js.map create mode 100644 dist/umd.min/extends.d.ts diff --git a/bower.json b/bower.json index c6f693e2..8f1d4ae1 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "typescript-dotnet", - "version": "2.11.7", + "version": "2.12.0", "ignore": [ ".bowercc", ".gitignore", diff --git a/dist/amd/System.Linq/Linq.d.ts b/dist/amd/System.Linq/Linq.d.ts new file mode 100644 index 00000000..fabea935 --- /dev/null +++ b/dist/amd/System.Linq/Linq.d.ts @@ -0,0 +1,196 @@ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Original: http://linqjs.codeplex.com/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import Dictionary from "../System/Collections/Dictionaries/Dictionary"; +import DisposableBase from "../System/Disposable/DisposableBase"; +export declare const enum EnumerableAction { + Break = 0, + Return = 1, + Skip = 2, +} +export declare class InfiniteEnumerable extends DisposableBase implements IEnumerable { + protected _enumeratorFactory: () => IEnumerator; + constructor(_enumeratorFactory: () => IEnumerator, finalizer?: () => void); + protected _isEndless: boolean; + isEndless: boolean; + getEnumerator(): IEnumerator; + protected _onDispose(): void; + asEnumerable(): InfiniteEnumerable; + doAction(action: Action | Predicate | Selector | Selector, initializer?: () => void, isEndless?: boolean): InfiniteEnumerable; + force(): void; + skip(count: number): InfiniteEnumerable; + take(count: number): FiniteEnumerable; + elementAt(index: number): T; + elementAtOrDefault(index: number, defaultValue?: T): T; + first(): T; + firstOrDefault(defaultValue?: T): T; + single(): T; + singleOrDefault(defaultValue?: T): T; + any(): boolean; + isEmpty(): boolean; + traverseBreadthFirst(childrenSelector: (element: T) => IEnumerableOrArray): Enumerable; + traverseBreadthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray): Enumerable; + traverseBreadthFirst(childrenSelector: (element: T) => IEnumerableOrArray, resultSelector?: (element: T, nestLevel?: number) => TResult): Enumerable; + traverseBreadthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray, resultSelector?: (element: TNode, nestLevel?: number) => TResult): Enumerable; + traverseDepthFirst(childrenSelector: (element: T) => IEnumerableOrArray): Enumerable; + traverseDepthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray): Enumerable; + traverseDepthFirst(childrenSelector: (element: T) => IEnumerableOrArray, resultSelector?: (element: T, nestLevel?: number) => TResult): Enumerable; + traverseDepthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray, resultSelector?: (element: TNode, nestLevel?: number) => TResult): Enumerable; + flatten(): Enumerable; + pairwise(selector: (prev: T, current: T) => TSelect): Enumerable; + scan(func: (a: T, b: T) => T, seed?: T): Enumerable; + select(selector: Selector): InfiniteEnumerable; + protected _selectMany(collectionSelector: Selector>, resultSelector?: (collection: T, element: TElement) => TResult): Enumerable; + selectMany(collectionSelector: Selector>): InfiniteEnumerable; + selectMany(collectionSelector: Selector>, resultSelector: (collection: T, element: TElement) => TResult): InfiniteEnumerable; + protected _choose(selector: Selector): Enumerable; + choose(): InfiniteEnumerable; + choose(selector?: Selector): InfiniteEnumerable; + where(predicate: Predicate): InfiniteEnumerable; + ofType(type: { + new (...params: any[]): TType; + }): InfiniteEnumerable; + except(second: IEnumerableOrArray, compareSelector?: Selector): InfiniteEnumerable; + distinct(compareSelector?: (value: T) => T): InfiniteEnumerable; + distinctUntilChanged(compareSelector?: Selector): InfiniteEnumerable; + defaultIfEmpty(defaultValue?: T): Enumerable; + zip(second: IEnumerableOrArray, resultSelector: (first: T, second: TSecond, index?: number) => TResult): Enumerable; + zipMultiple(second: IArray>, resultSelector: (first: T, second: TSecond, index?: number) => TResult): Enumerable; + join(inner: IEnumerableOrArray, outerKeySelector: Selector, innerKeySelector: Selector, resultSelector: (outer: T, inner: TInner) => TResult, compareSelector?: Selector): Enumerable; + groupJoin(inner: IEnumerableOrArray, outerKeySelector: Selector, innerKeySelector: Selector, resultSelector: (outer: T, inner: TInner[]) => TResult, compareSelector?: Selector): Enumerable; + merge(enumerables: IArray>): InfiniteEnumerable; + concat(...enumerables: Array>): InfiniteEnumerable; + union(second: IEnumerableOrArray, compareSelector?: Selector): Enumerable; + insertAt(index: number, other: IEnumerableOrArray): Enumerable; + alternateMultiple(sequence: IEnumerableOrArray): Enumerable; + alternateSingle(value: T): Enumerable; + alternate(...sequence: T[]): Enumerable; + catchError(handler: (e: any) => void): InfiniteEnumerable; + finallyAction(action: () => void): InfiniteEnumerable; + buffer(size: number): InfiniteEnumerable; + share(): InfiniteEnumerable; +} +export declare class Enumerable extends InfiniteEnumerable { + constructor(enumeratorFactory: () => IEnumerator, finalizer?: () => void, isEndless?: boolean); + static from(source: IEnumerableOrArray): Enumerable; + static fromAny(source: IEnumerableOrArray): Enumerable; + static fromAny(source: any): Enumerable; + static fromOrEmpty(source: IEnumerableOrArray): Enumerable; + static toArray(source: IEnumerableOrArray): T[]; + static choice(values: IArray): InfiniteEnumerable; + static chooseFrom(...args: T[]): InfiniteEnumerable; + static cycle(values: IArray): InfiniteEnumerable; + static cycleThrough(...args: T[]): InfiniteEnumerable; + static empty(): FiniteEnumerable; + static repeat(element: T): InfiniteEnumerable; + static repeat(element: T, count: number): FiniteEnumerable; + static repeatWithFinalize(initializer: () => T, finalizer: (element: T) => void): InfiniteEnumerable; + static make(element: T): FiniteEnumerable; + static range(start: number, count: number, step?: number): FiniteEnumerable; + static rangeDown(start: number, count: number, step?: number): FiniteEnumerable; + static toInfinity(start?: number, step?: number): InfiniteEnumerable; + static toNegativeInfinity(start?: number, step?: number): InfiniteEnumerable; + static rangeTo(start: number, to: number, step?: number): FiniteEnumerable; + static matches(input: string, pattern: any, flags?: string): FiniteEnumerable; + static generate(factory: (index?: number) => T): InfiniteEnumerable; + static generate(factory: (index?: number) => T, count: number): FiniteEnumerable; + static unfold(seed: T, valueFactory: Selector, skipSeed?: Boolean): InfiniteEnumerable; + static forEach(enumerable: IEnumerableOrArray, action: (element: T, index?: number) => any): void; + static map(enumerable: IEnumerableOrArray, selector: Selector): TResult[]; + static max(values: FiniteEnumerable): number; + static min(values: FiniteEnumerable): number; + static weave(enumerables: IEnumerableOrArray>): Enumerable; + doAction(action: Action | Predicate | Selector | Selector, initializer?: () => void, isEndless?: boolean): Enumerable; + skip(count: number): Enumerable; + skipWhile(predicate: Predicate): Enumerable; + takeWhile(predicate: Predicate): Enumerable; + takeUntil(predicate: Predicate, includeUntilValue?: boolean): Enumerable; + forEach(action: Predicate | Action): void; + toArray(predicate?: Predicate): T[]; + copyTo(target: T[], index?: number): T[]; + toLookup(keySelector: Selector, elementSelector?: Selector, compareSelector?: Selector): ILookup; + toMap(keySelector: Selector, elementSelector: Selector): IMap; + toDictionary(keySelector: Selector, elementSelector: Selector, compareSelector?: Selector): Dictionary; + toJoinedString(separator?: string, selector?: Selector): string; + takeExceptLast(count?: number): Enumerable; + skipToLast(count: number): Enumerable; + where(predicate: Predicate): Enumerable; + select(selector: Selector): Enumerable; + selectMany(collectionSelector: Selector>): Enumerable; + selectMany(collectionSelector: Selector>, resultSelector: (collection: T, element: TElement) => TResult): Enumerable; + choose(): Enumerable; + choose(selector?: Selector): Enumerable; + reverse(): Enumerable; + shuffle(): Enumerable; + count(predicate?: Predicate): number; + all(predicate: Predicate): boolean; + every(predicate: Predicate): boolean; + any(predicate?: Predicate): boolean; + some(predicate: Predicate): boolean; + contains(value: T, compareSelector?: Selector): boolean; + indexOf(value: T, compareSelector?: Selector): number; + lastIndexOf(value: T, compareSelector?: Selector): number; + merge(enumerables: IArray>): Enumerable; + concat(...enumerables: Array>): Enumerable; + intersect(second: IEnumerableOrArray, compareSelector?: Selector): Enumerable; + sequenceEqual(second: IEnumerableOrArray, equalityComparer?: EqualityComparison): boolean; + ofType(type: { + new (...params: any[]): TType; + }): Enumerable; + except(second: IEnumerableOrArray, compareSelector?: Selector): Enumerable; + distinct(compareSelector?: (value: T) => T): Enumerable; + distinctUntilChanged(compareSelector?: Selector): Enumerable; + orderBy(keySelector?: Selector): IOrderedEnumerable; + orderUsing(comparison: Comparison): IOrderedEnumerable; + orderUsingReversed(comparison: Comparison): IOrderedEnumerable; + orderByDescending(keySelector?: Selector): IOrderedEnumerable; + buffer(size: number): Enumerable; + groupBy(keySelector: Selector): Enumerable>; + groupBy(keySelector: Selector, elementSelector?: Selector, compareSelector?: Selector): Enumerable>; + partitionBy(keySelector: Selector): Enumerable>; + partitionBy(keySelector: Selector, elementSelector: Selector, resultSelector?: (key: TKey, element: TElement[]) => IGrouping, compareSelector?: Selector): Enumerable>; + aggregate(func: (a: T, b: T) => T, seed?: T): T; + average(selector?: Selector): number; + max(): T; + min(): T; + maxBy(keySelector?: Selector): T; + minBy(keySelector?: Selector): T; + sum(selector?: Selector): number; + product(selector?: Selector): number; + quotient(selector?: Selector): number; + last(): T; + lastOrDefault(defaultValue?: T): T; + share(): Enumerable; + catchError(handler: (e: any) => void): Enumerable; + finallyAction(action: () => void): Enumerable; + memoize(): Enumerable; +} +export declare class FiniteEnumerable extends Enumerable { + constructor(enumeratorFactory: () => IEnumerator, finalizer?: () => void); +} +export interface IGrouping extends Enumerable { + key: TKey; +} +export interface ILookup extends IEnumerable> { + count: number; + get(key: TKey): TElement[]; + contains(key: TKey): boolean; +} +export interface IOrderedEnumerable extends FiniteEnumerable { + thenBy(keySelector: (value: T) => any): IOrderedEnumerable; + thenByDescending(keySelector: (value: T) => any): IOrderedEnumerable; + thenUsing(comparison: Comparison): IOrderedEnumerable; + thenUsingReversed(comparison: Comparison): IOrderedEnumerable; +} +export default Enumerable; diff --git a/dist/amd/System/Char.d.ts b/dist/amd/System/Char.d.ts new file mode 100644 index 00000000..fa6b5cef --- /dev/null +++ b/dist/amd/System/Char.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * From Netjs mscorlib.ts + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function isWhiteSpace(ch: number): boolean; +export declare function isLetter(ch: number): boolean; +export declare function isLetterOrDigit(ch: number): boolean; +export declare function isDigit(ch: number): boolean; +export declare function isDigit(str: string, index: number): boolean; diff --git a/dist/amd/System/Collections/Array/Compare.d.ts b/dist/amd/System/Collections/Array/Compare.d.ts new file mode 100644 index 00000000..2ce82c2d --- /dev/null +++ b/dist/amd/System/Collections/Array/Compare.d.ts @@ -0,0 +1,13 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function areAllEqual(arrays: any[][], strict?: boolean, equalityComparer?: EqualityComparison): boolean; +export declare function areEqual(a: IArray, b: IArray, strict?: boolean, equalityComparer?: EqualityComparison): boolean; +export declare function areEquivalent(a: IArray, b: IArray): boolean; +export declare function areEquivalent(a: IArray>, b: IArray>): boolean; +export declare function areEquivalent(a: IArray, b: IArray, comparer: Comparison): boolean; diff --git a/dist/amd/System/Collections/Array/Dispatch.d.ts b/dist/amd/System/Collections/Array/Dispatch.d.ts new file mode 100644 index 00000000..d9d28acc --- /dev/null +++ b/dist/amd/System/Collections/Array/Dispatch.d.ts @@ -0,0 +1,13 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export interface DispatchErrorHandler { + (ex?: any, i?: number): void; +} +export declare function unsafe(listeners: IArray<(payload: T) => any>, payload: T, trap?: boolean | DispatchErrorHandler): void; +export declare function mapped(listeners: IArray<(payload: T) => TResult>, payload: T, trap?: boolean | DispatchErrorHandler): TResult[]; +export declare function dispatch(listeners: IArray<(payload: T) => any>, payload: T, trap?: boolean | DispatchErrorHandler): void; +export default dispatch; diff --git a/dist/amd/System/Collections/Array/Dispatch.js b/dist/amd/System/Collections/Array/Dispatch.js new file mode 100644 index 00000000..4d01a8db --- /dev/null +++ b/dist/amd/System/Collections/Array/Dispatch.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +define(["require","exports","../../Types","./Utility"],function(t,e,i,n){"use strict";function r(t,e,n){if(t&&t.length)for(var r=0,f=t.length;f>r;r++){var u=t[r];if(u)try{u(e)}catch(o){if(!n)throw o;i["default"].isFunction(n)&&n(o,r)}}}function f(t,e,r){if(!t)return null;var f=n.copy(t);if(t.length)for(var u=0,a=f.length;a>u;u++){var c=f[u];try{f[u]=c?c(e):o}catch(l){if(f[u]=o,!r)throw l;i["default"].isFunction(r)&&r(l,u)}}return f}function u(t,e,i){r(n.copy(t),e,i)}var o=void 0;e.unsafe=r,e.mapped=f,e.dispatch=u,Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=u}); +//# sourceMappingURL=Dispatch.js.map diff --git a/dist/amd/System/Collections/Array/Dispatch.js.map b/dist/amd/System/Collections/Array/Dispatch.js.map new file mode 100644 index 00000000..d1aa2d94 --- /dev/null +++ b/dist/amd/System/Collections/Array/Dispatch.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Collections/Array/Dispatch.js","System/Collections/Array/Dispatch.ts"],"names":["define","require","exports","Types_1","Utility_1","unsafe","listeners","payload","trap","length","i","len","fn","ex","isFunction","mapped","result","copy","VOID0","dispatch","Object","defineProperty","value"],"mappings":";;;;AAIAA,QAAQ,UAAW,UAAW,cAAe,aAAc,SAAUC,EAASC,EAASC,EAASC,GAC5F,YCiCJ,SAAAC,GACCC,EACAC,EAAWC,GAEX,GAAGF,GAAaA,EAAUG,OAEzB,IAAI,GAAIC,GAAI,EAAGC,EAAML,EAAUG,OAAUE,EAAFD,EAAOA,IAC9C,CACC,GAAIE,GAAcN,EAAUI,EAC5B,IAAIE,EACJ,IAECA,EAAGL,GAEJ,MAAMM,GAEL,IAAIL,EACH,KAAMK,EACCV,GAAAA,WAAKW,WAAWN,IACvBA,EAAKK,EAAIH,KAed,QAAAK,GACCT,EACAC,EAAWC,GAGX,IAAIF,EAAW,MAAO,KAEtB,IAAIU,GAAeZ,EAAAa,KAAKX,EACxB,IAAGA,EAAUG,OAGZ,IAAI,GAAIC,GAAI,EAAGC,EAAMK,EAAOP,OAAUE,EAAFD,EAAOA,IAC3C,CACC,GAAIE,GAAcI,EAAON,EACzB,KAECM,EAAON,GAAKE,EACTA,EAAGL,GACHW,EAEJ,MAAML,GAGL,GADAG,EAAON,GAAKQ,GACRV,EACH,KAAMK,EACCV,GAAAA,WAAKW,WAAWN,IACvBA,EAAKK,EAAIH,IAKb,MAAOM,GAYR,QAAAG,GACCb,EACAC,EAAWC,GAEXH,EAAOD,EAAAa,KAAKX,GAAYC,EAASC,GA7GlC,GAAMU,GAAY,MA4BFhB,GAAAG,OAAMA,EAkCNH,EAAAa,OAAMA,EA2CNb,EAAAiB,SAAQA,EAOxBC,OAAAC,eAAAnB,EAAA,cAAAoB,OAAA,IDnEIpB,EAAAA,WCmEWiB","file":"System/Collections/Array/Dispatch.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\ndefine([\"require\", \"exports\", \"../../Types\", \"./Utility\"], function (require, exports, Types_1, Utility_1) {\n \"use strict\";\n var VOID0 = void (0);\n function unsafe(listeners, payload, trap) {\n if (listeners && listeners.length) {\n for (var i = 0, len = listeners.length; i < len; i++) {\n var fn = listeners[i];\n if (!fn)\n continue;\n try {\n fn(payload);\n }\n catch (ex) {\n if (!trap)\n throw ex;\n else if (Types_1.default.isFunction(trap))\n trap(ex, i);\n }\n }\n }\n }\n exports.unsafe = unsafe;\n function mapped(listeners, payload, trap) {\n if (!listeners)\n return null;\n var result = Utility_1.copy(listeners);\n if (listeners.length) {\n for (var i = 0, len = result.length; i < len; i++) {\n var fn = result[i];\n try {\n result[i] = fn\n ? fn(payload)\n : VOID0;\n }\n catch (ex) {\n result[i] = VOID0;\n if (!trap)\n throw ex;\n else if (Types_1.default.isFunction(trap))\n trap(ex, i);\n }\n }\n }\n return result;\n }\n exports.mapped = mapped;\n function dispatch(listeners, payload, trap) {\n unsafe(Utility_1.copy(listeners), payload, trap);\n }\n exports.dispatch = dispatch;\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = dispatch;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n///\r\n///\r\nimport Type from \"../../Types\";\r\nimport {copy} from \"./Utility\";\r\n\r\nconst VOID0:any = void(0);\r\n\r\nexport interface DispatchErrorHandler\r\n{\r\n\t(ex?:any, i?:number):void;\r\n}\r\n\r\n/**\r\n * Simply takes a payload and passes it to all the listeners.\r\n *\r\n * While dispatching:\r\n * * This is an unsafe method if by chance any of the listeners modify the array.\r\n * * It cannot prevent changes to the payload.\r\n *\r\n * Improving safety:\r\n * * Only use a local array that isn't exposed to the listeners.\r\n * * Use the dispatch method instead as it makes a copy of the listeners array.\r\n * * Freeze the listeners array so it can't be modified.\r\n * * Freeze the payload.\r\n *\r\n * Specifying trap will catch any errors and pass them along if trap is a function.\r\n * A payload is used instead of arguments for easy typing.\r\n *\r\n *\r\n * @param listeners\r\n * @param payload\r\n * @param trap\r\n */\r\nexport function unsafe(\r\n\tlisteners:IArray<(payload:T)=>any>,\r\n\tpayload:T, trap?:boolean|DispatchErrorHandler):void\r\n{\r\n\tif(listeners && listeners.length)\r\n\t{\r\n\t\tfor(let i = 0, len = listeners.length; i(\r\n\tlisteners:IArray<(payload:T)=>TResult>,\r\n\tpayload:T, trap?:boolean|DispatchErrorHandler):TResult[]\r\n{\r\n\r\n\tif(!listeners) return null;\r\n\t// Reuse the copy as the array result.\r\n\tvar result:any[] = copy(listeners);\r\n\tif(listeners.length)\r\n\t{\r\n\r\n\t\tfor(let i = 0, len = result.length; i(\r\n\tlisteners:IArray<(payload:T)=>any>,\r\n\tpayload:T, trap?:boolean|DispatchErrorHandler):void\r\n{\r\n\tunsafe(copy(listeners), payload, trap);\r\n}\r\n\r\nexport default dispatch;"]} \ No newline at end of file diff --git a/dist/amd/System/Collections/Array/Procedure.d.ts b/dist/amd/System/Collections/Array/Procedure.d.ts new file mode 100644 index 00000000..227353e3 --- /dev/null +++ b/dist/amd/System/Collections/Array/Procedure.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function sum(source: number[], ignoreNaN?: boolean): number; +export declare function average(source: number[], ignoreNaN?: boolean): number; +export declare function product(source: number[], ignoreNaN?: boolean): number; +export declare function quotient(source: number[], ignoreNaN?: boolean): number; +export declare function min(source: number[], ignoreNaN?: boolean): number; +export declare function max(source: number[], ignoreNaN?: boolean): number; diff --git a/dist/amd/System/Collections/Array/Procedure.js b/dist/amd/System/Collections/Array/Procedure.js new file mode 100644 index 00000000..071b5d80 --- /dev/null +++ b/dist/amd/System/Collections/Array/Procedure.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +define(["require","exports"],function(n,r){"use strict";function e(n,r){if(void 0===r&&(r=!1),!n||!n.length)return 0;var e=0;return r?n.forEach(function(n){isNaN(n)||(e+=n)}):n.every(function(n){return e+=n,!isNaN(e)}),e}function t(n,r){if(void 0===r&&(r=!1),!n||!n.length)return NaN;var e,t=0;return r?(e=0,n.forEach(function(n){isNaN(n)||(t+=n,e++)})):(e=n.length,n.every(function(n){return t+=n,!isNaN(t)})),!e||isNaN(t)?NaN:t/e}function i(n,r){if(void 0===r&&(r=!1),!n||!n.length)return NaN;var e=1;if(r){var t=!1;n.forEach(function(n){isNaN(n)||(e*=n,t||(t=!0))}),t||(e=NaN)}else n.every(function(n){return isNaN(n)?(e=NaN,!1):(e*=n,!0)});return e}function u(n,r){if(void 0===r&&(r=!1),!n||n.length<2)return NaN;var e=n[0],t=!1;return n.every(function(n,i){if(i){if(0===n)return e=NaN,!1;if(isNaN(n)){if(!r)return e=NaN,!1}else e/=n,t||(t=!0)}return!0}),t||(e=NaN),e}function N(n,r,e,t){if(!n||!n.length)return NaN;var i=r;if(e){var u=!1;n.forEach(function(n){isNaN(n)||(t(n,i)&&(i=n),u||(u=!0))}),u||(i=NaN)}else n.every(function(n){return isNaN(n)?(i=NaN,!1):(t(n,i)&&(i=n),!0)});return i}function a(n,r){return void 0===r&&(r=!1),N(n,+(1/0),r,function(n,r){return r>n})}function f(n,r){return void 0===r&&(r=!1),N(n,-(1/0),r,function(n,r){return n>r})}r.sum=e,r.average=t,r.product=i,r.quotient=u,r.min=a,r.max=f}); +//# sourceMappingURL=Procedure.js.map diff --git a/dist/amd/System/Collections/Array/Procedure.js.map b/dist/amd/System/Collections/Array/Procedure.js.map new file mode 100644 index 00000000..984150ff --- /dev/null +++ b/dist/amd/System/Collections/Array/Procedure.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Collections/Array/Procedure.js","System/Collections/Array/Procedure.ts"],"names":["define","require","exports","sum","source","ignoreNaN","length","result","forEach","n","isNaN","every","average","NaN","count","product","found","quotient","i","ifSet","start","predicate","min","Infinity","max"],"mappings":";;;;AAIAA,QAAQ,UAAW,WAAY,SAAUC,EAASC,GAC9C,YCCJ,SAAAC,GAAoBC,EAAiBC,GAEpC,GAFoC,SAAAA,IAAAA,GAAA,IAEhCD,IAAWA,EAAOE,OACrB,MAAO,EAER,IAAIC,GAAS,CAab,OAZGF,GACFD,EAAOI,QAAQ,SAAAC,GAEVC,MAAMD,KAAIF,GAAUE,KAGzBL,EAAOO,MAAM,SAAAF,GAGZ,MADAF,IAAUE,GACFC,MAAMH,KAGTA,EAGR,QAAAK,GAAwBR,EAAiBC,GAExC,GAFwC,SAAAA,IAAAA,GAAA,IAEpCD,IAAWA,EAAOE,OACrB,MAAOO,IAER,IAAgBC,GAAZP,EAAS,CAyBb,OAxBGF,IAEFS,EAAQ,EACRV,EAAOI,QAAQ,SAAAC,GAEVC,MAAMD,KAETF,GAAUE,EACVK,SAOFA,EAAQV,EAAOE,OACfF,EAAOO,MAAM,SAAAF,GAGZ,MADAF,IAAUE,GACFC,MAAMH,OAKPO,GAASJ,MAAMH,GAAWM,IAAON,EAAOO,EAGlD,QAAAC,GAAwBX,EAAiBC,GAExC,GAFwC,SAAAA,IAAAA,GAAA,IAEpCD,IAAWA,EAAOE,OACrB,MAAOO,IAER,IAAIN,GAAS,CACb,IAAGF,EACH,CACC,GAAIW,IAAQ,CACZZ,GAAOI,QAAQ,SAAAC,GAEVC,MAAMD,KAETF,GAAUE,EACNO,IAAOA,GAAQ,MAIjBA,IACHT,EAASM,SAIVT,GAAOO,MAAM,SAAAF,GAEZ,MA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B,EAAAsB,IAAGA","file":"System/Collections/Array/Procedure.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\ndefine([\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n function sum(source, ignoreNaN) {\n if (ignoreNaN === void 0) { ignoreNaN = false; }\n if (!source || !source.length)\n return 0;\n var result = 0;\n if (ignoreNaN)\n source.forEach(function (n) {\n if (!isNaN(n))\n result += n;\n });\n else\n source.every(function (n) {\n result += n;\n return !isNaN(result);\n });\n return result;\n }\n exports.sum = sum;\n function average(source, ignoreNaN) {\n if (ignoreNaN === void 0) { ignoreNaN = false; }\n if (!source || !source.length)\n return NaN;\n var result = 0, count;\n if (ignoreNaN) {\n count = 0;\n source.forEach(function (n) {\n if (!isNaN(n)) {\n result += n;\n count++;\n }\n });\n }\n else {\n count = source.length;\n source.every(function (n) {\n result += n;\n return !isNaN(result);\n });\n }\n return (!count || isNaN(result)) ? NaN : (result / count);\n }\n exports.average = average;\n function product(source, ignoreNaN) {\n if (ignoreNaN === void 0) { ignoreNaN = false; }\n if (!source || !source.length)\n return NaN;\n var result = 1;\n if (ignoreNaN) {\n var found = false;\n source.forEach(function (n) {\n if (!isNaN(n)) {\n result *= n;\n if (!found)\n found = true;\n }\n });\n if (!found)\n result = NaN;\n }\n else {\n source.every(function (n) {\n if (isNaN(n)) {\n result = NaN;\n return false;\n }\n result *= n;\n return true;\n });\n }\n return result;\n }\n exports.product = product;\n function quotient(source, ignoreNaN) {\n if (ignoreNaN === void 0) { ignoreNaN = false; }\n if (!source || source.length < 2)\n return NaN;\n var result = source[0];\n var found = false;\n source.every(function (n, i) {\n if (i) {\n if (n === 0) {\n result = NaN;\n return false;\n }\n if (isNaN(n)) {\n if (!ignoreNaN) {\n result = NaN;\n return false;\n }\n }\n else {\n result /= n;\n if (!found)\n found = true;\n }\n }\n return true;\n });\n if (!found)\n result = NaN;\n return result;\n }\n exports.quotient = quotient;\n function ifSet(source, start, ignoreNaN, predicate) {\n if (!source || !source.length)\n return NaN;\n var result = start;\n if (ignoreNaN) {\n var found = false;\n source.forEach(function (n) {\n if (!isNaN(n)) {\n if (predicate(n, result))\n result = n;\n if (!found)\n found = true;\n }\n });\n if (!found)\n result = NaN;\n }\n else {\n source.every(function (n) {\n if (isNaN(n)) {\n result = NaN;\n return false;\n }\n if (predicate(n, result))\n result = n;\n return true;\n });\n }\n return result;\n }\n function min(source, ignoreNaN) {\n if (ignoreNaN === void 0) { ignoreNaN = false; }\n return ifSet(source, +Infinity, ignoreNaN, function (n, result) { return n < result; });\n }\n exports.min = min;\n function max(source, ignoreNaN) {\n if (ignoreNaN === void 0) { ignoreNaN = false; }\n return ifSet(source, -Infinity, ignoreNaN, function (n, result) { return n > result; });\n }\n exports.max = max;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n\r\nexport function sum(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\tif(!source || !source.length)\r\n\t\treturn 0;\r\n\r\n\tvar result = 0;\r\n\tif(ignoreNaN)\r\n\t\tsource.forEach(n =>\r\n\t\t{\r\n\t\t\tif(!isNaN(n)) result += n;\r\n\t\t});\r\n\telse\r\n\t\tsource.every(n =>\r\n\t\t{\r\n\t\t\tresult += n;\r\n\t\t\treturn !isNaN(result);\r\n\t\t});\r\n\r\n\treturn result;\r\n}\r\n\r\nexport function average(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\tif(!source || !source.length)\r\n\t\treturn NaN;\r\n\r\n\tvar result = 0, count:number;\r\n\tif(ignoreNaN)\r\n\t{\r\n\t\tcount = 0;\r\n\t\tsource.forEach(n =>\r\n\t\t{\r\n\t\t\tif(!isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tresult += n;\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}\r\n\telse\r\n\t{\r\n\t\tcount = source.length;\r\n\t\tsource.every(n =>\r\n\t\t{\r\n\t\t\tresult += n;\r\n\t\t\treturn !isNaN(result);\r\n\t\t});\r\n\r\n\t}\r\n\r\n\treturn (!count || isNaN(result)) ? NaN : (result/count);\r\n}\r\n\r\nexport function product(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\tif(!source || !source.length)\r\n\t\treturn NaN;\r\n\r\n\tvar result = 1;\r\n\tif(ignoreNaN)\r\n\t{\r\n\t\tvar found = false;\r\n\t\tsource.forEach(n =>\r\n\t\t{\r\n\t\t\tif(!isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tresult *= n;\r\n\t\t\t\tif(!found) found = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(!found)\r\n\t\t\tresult = NaN;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tsource.every(n =>\r\n\t\t{\r\n\t\t\tif(isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tresult = NaN;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tresult *= n;\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\n/**\r\n * Takes the first number and divides it by all following.\r\n * @param source\r\n * @param ignoreNaN Will cause this skip any NaN values.\r\n * @returns {number}\r\n */\r\nexport function quotient(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\tif(!source || source.length<2)\r\n\t\treturn NaN;\r\n\r\n\tvar result = source[0];\r\n\r\n\tvar found = false;\r\n\tsource.every((n,i) =>\r\n\t{\r\n\t\tif(i) {\r\n\t\t\tif(n===0)\r\n\t\t\t{\r\n\t\t\t\tresult = NaN;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif(isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tif(!ignoreNaN)\r\n\t\t\t\t{\r\n\t\t\t\t\tresult = NaN;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tresult /= n;\r\n\t\t\t\tif(!found) found = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tif(!found)\r\n\t\tresult = NaN;\r\n\r\n\treturn result;\r\n}\r\n\r\n\r\nfunction ifSet(\r\n\tsource:number[],\r\n\tstart:number,\r\n\tignoreNaN:boolean,\r\n\tpredicate:(n:number, result:number) => boolean)\r\n{\r\n\tif(!source || !source.length)\r\n\t\treturn NaN;\r\n\r\n\tvar result = start;\r\n\tif(ignoreNaN)\r\n\t{\r\n\t\tvar found = false;\r\n\t\tsource.forEach(n =>\r\n\t\t{\r\n\t\t\tif(!isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tif(predicate(n, result))\r\n\t\t\t\t\tresult = n;\r\n\t\t\t\tif(!found) found = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(!found)\r\n\t\t\tresult = NaN;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tsource.every(n =>\r\n\t\t{\r\n\t\t\tif(isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tresult = NaN;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif(predicate(n, result))\r\n\t\t\t\tresult = n;\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\t}\r\n\treturn result;\r\n\r\n}\r\n\r\nexport function min(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\treturn ifSet(source, +Infinity, ignoreNaN, (n, result) => n n>result);\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Collections/Array/ReadOnlyArrayWrapper.d.ts b/dist/amd/System/Collections/Array/ReadOnlyArrayWrapper.d.ts new file mode 100644 index 00000000..88e74cbc --- /dev/null +++ b/dist/amd/System/Collections/Array/ReadOnlyArrayWrapper.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ReadOnlyCollectionBase from "../ReadOnlyCollectionBase"; +export default class ReadOnlyArrayWrapper extends ReadOnlyCollectionBase { + constructor(array: IArray); + getValueAt: (index: number) => T; +} diff --git a/dist/amd/System/Collections/Array/ReadOnlyArrayWrapper.js b/dist/amd/System/Collections/Array/ReadOnlyArrayWrapper.js new file mode 100644 index 00000000..d6ee7842 --- /dev/null +++ b/dist/amd/System/Collections/Array/ReadOnlyArrayWrapper.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +var __extends=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)};define(["require","exports","../../Exceptions/ArgumentNullException","../Enumeration/Enumerator","../ReadOnlyCollectionBase"],function(t,e,n,r,o){"use strict";var u=function(t){function e(e){if(t.call(this),!e)throw new n["default"]("array");var o=this;o._getCount=function(){return e.length},o.getEnumerator=function(){return r.from(e)},o.getValueAt=function(t){return e[t]}}return __extends(e,t),e}(o["default"]);Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=u}); +//# sourceMappingURL=ReadOnlyArrayWrapper.js.map diff --git a/dist/amd/System/Collections/Array/ReadOnlyArrayWrapper.js.map b/dist/amd/System/Collections/Array/ReadOnlyArrayWrapper.js.map new file mode 100644 index 00000000..579d3834 --- /dev/null +++ b/dist/amd/System/Collections/Array/ReadOnlyArrayWrapper.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Collections/Array/ReadOnlyArrayWrapper.js","System/Collections/Array/ReadOnlyArrayWrapper.ts"],"names":["__extends","this","d","b","__","constructor","p","hasOwnProperty","prototype","Object","create","define","require","exports","ArgumentNullException_1","Enumerator_1","ReadOnlyCollectionBase_1","ReadOnlyArrayWrapper","_super","array","call","_","_getCount","length","getEnumerator","from","getValueAt","i","defineProperty","value"],"mappings":";;;;AAIA,GAAIA,WAAaC,MAAQA,KAAKD,WAAc,SAAUE,EAAGC,GAErD,QAASC,KAAOH,KAAKI,YAAcH,EADnC,IAAK,GAAII,KAAKH,GAAOA,EAAEI,eAAeD,KAAIJ,EAAEI,GAAKH,EAAEG,GAEnDJ,GAAEM,UAAkB,OAANL,EAAaM,OAAOC,OAAOP,IAAMC,EAAGI,UAAYL,EAAEK,UAAW,GAAIJ,IAEnFO,SAAQ,UAAW,UAAW,yCAA0C,4BAA6B,6BAA8B,SAAUC,EAASC,EAASC,EAAyBC,EAAcC,GAClM,YCDJ,IAAAC,GAAA,SAAAC,GAGC,QAAAD,GAAYE,GAGX,GADAD,EAAAE,KAAAnB,OACIkB,EACH,KAAM,IAAIL,GAAAA,WAAsB,QAEjC,IAAIO,GAAIpB,IACRoB,GAAEC,UAAY,WAAM,MAAAH,GAAMI,QAC1BF,EAAEG,cAAgB,WAAM,MAAAT,GAAAU,KAAeN,IACvCE,EAAEK,WAAa,SAAAC,GAAK,MAAAR,GAAMQ,IAI5B,MAhBqD3B,WAAAiB,EAAAC,GAgBrDD,GAhBqDD,EAAAA,WAArDP,QAAAmB,eAAAf,EAAA,cAAAgB,OAAA,IDgBIhB,EAAAA,WAAkBI","file":"System/Collections/Array/ReadOnlyArrayWrapper.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\ndefine([\"require\", \"exports\", \"../../Exceptions/ArgumentNullException\", \"../Enumeration/Enumerator\", \"../ReadOnlyCollectionBase\"], function (require, exports, ArgumentNullException_1, Enumerator_1, ReadOnlyCollectionBase_1) {\n \"use strict\";\n var ReadOnlyArrayWrapper = (function (_super) {\n __extends(ReadOnlyArrayWrapper, _super);\n function ReadOnlyArrayWrapper(array) {\n _super.call(this);\n if (!array)\n throw new ArgumentNullException_1.default('array');\n var _ = this;\n _._getCount = function () { return array.length; };\n _.getEnumerator = function () { return Enumerator_1.from(array); };\n _.getValueAt = function (i) { return array[i]; };\n }\n return ReadOnlyArrayWrapper;\n }(ReadOnlyCollectionBase_1.default));\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = ReadOnlyArrayWrapper;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\nimport ArgumentNullException from \"../../Exceptions/ArgumentNullException\";\r\nimport {from as enumeratorFrom} from \"../Enumeration/Enumerator\";\r\nimport ReadOnlyCollectionBase from \"../ReadOnlyCollectionBase\";\r\n\r\nexport default class ReadOnlyArrayWrapper extends ReadOnlyCollectionBase\r\n{\r\n\r\n\tconstructor(array:IArray)\r\n\t{\r\n\t\tsuper();\r\n\t\tif(!array)\r\n\t\t\tthrow new ArgumentNullException('array');\r\n\r\n\t\tvar _ = this;\r\n\t\t_._getCount = () => array.length;\r\n\t\t_.getEnumerator = () => enumeratorFrom(array);\r\n\t\t_.getValueAt = i => array[i];\r\n\t}\r\n\r\n\tgetValueAt:(index:number)=>T;\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Collections/Array/Sort.d.ts b/dist/amd/System/Collections/Array/Sort.d.ts new file mode 100644 index 00000000..5524bcb8 --- /dev/null +++ b/dist/amd/System/Collections/Array/Sort.d.ts @@ -0,0 +1,9 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function createComparer(selector: Selector, order?: Order | Order[], equivalentToNaN?: any): Comparison; +export { createComparer as default, createComparer as by }; diff --git a/dist/amd/System/Collections/Array/Sort.js b/dist/amd/System/Collections/Array/Sort.js new file mode 100644 index 00000000..5ebf17cb --- /dev/null +++ b/dist/amd/System/Collections/Array/Sort.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +define(["require","exports","../../Types","../../Compare"],function(r,e,a,t){"use strict";function n(r){return Array.isArray(r)?r:[r]}function u(r,e,u){void 0===e&&(e=1),void 0===u&&(u=NaN);var i=!a["default"].isTrueNaN(u);return function(f,o){for(var l=n(r(f)),s=n(r(o)),N=Math.min(l.length,s.length),c=Array.isArray(e)?e:null,d=0;N>d;d++){var v=l[d],y=s[d],p=c?d\r\n///\r\n///\r\n\r\nimport Type from '../../Types';\r\nimport {compare} from '../../Compare';\r\n\r\nfunction ensureArray(value:T|T[]):T[]\r\n{\r\n\treturn Array.isArray(value)\r\n\t\t? value\r\n\t\t: [value];\r\n}\r\n\r\n/**\r\n * A factory function that creates a comparer to be used in multi-dimensional sorting.\r\n *\r\n *

Example

\r\n * ```typescript\r\n * var myArray = [{a:1:b:2},{a:3,b:4},{a:1,b:3}];\r\n *\r\n * // First sort by a, then by b.\r\n * myArray.sort(\r\n * createComparer(\r\n * (e)=> [e.a, e.b],\r\n * [Order.Ascending, Order.Descending]\r\n * )\r\n * );\r\n *\r\n * // result: [{a:1,b:3},{a:1:b:2},{a:3,b:4}]\r\n * ```\r\n *\r\n * @param selector\r\n * @param order\r\n * @param equivalentToNaN\r\n * @returns {function((TSource|TSource[]), (TSource|TSource[])): CompareResult}\r\n */\r\nexport function createComparer(\r\n\tselector:Selector,\r\n\torder:Order | Order[] = Order.Ascending,\r\n\tequivalentToNaN:any = NaN):Comparison\r\n{\r\n\tvar nanHasEquivalent = !Type.isTrueNaN(equivalentToNaN);\r\n\r\n\treturn (a:TSource|TSource[], b:TSource|TSource[]):CompareResult=>\r\n\t{\r\n\t\t// Use an array always to ensure a single code path.\r\n\t\tvar aValue = ensureArray(selector(a));\r\n\t\tvar bValue = ensureArray(selector(b));\r\n\t\tvar len = Math.min(aValue.length, bValue.length);\r\n\r\n\t\tvar oArray:Order[] = Array.isArray(order) ? order : null;\r\n\t\tfor(let i = 0; iorder;\r\n\r\n\t\t\tif(nanHasEquivalent)\r\n\t\t\t{\r\n\t\t\t\tif(Type.isTrueNaN(vA))\r\n\t\t\t\t\tvA = equivalentToNaN;\r\n\t\t\t\tif(Type.isTrueNaN(vB))\r\n\t\t\t\t\tvB = equivalentToNaN;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar r = compare(vA, vB);\r\n\t\t\tif(r!==CompareResult.Equal)\r\n\t\t\t\treturn o*r;\r\n\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t};\r\n}\r\n\r\nexport {\r\n\tcreateComparer as default, // Allow for default import.\r\n\tcreateComparer as by // Alias for Sort.by(...) instead of Sort.createComparer\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Collections/Array/Utility.d.ts b/dist/amd/System/Collections/Array/Utility.d.ts new file mode 100644 index 00000000..2314ac04 --- /dev/null +++ b/dist/amd/System/Collections/Array/Utility.d.ts @@ -0,0 +1,26 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function initialize(length: number): T[]; +export declare function copy(source: IArray, sourceIndex?: number, length?: number): T[]; +export declare function copyTo>(source: IArray, destination: TDestination, sourceIndex?: number, destinationIndex?: number, length?: number): TDestination; +export declare function indexOf(array: IArray, item: T, equalityComparer?: EqualityComparison): number; +export declare function contains(array: IArray, item: T, equalityComparer?: EqualityComparison): boolean; +export declare function replace(array: IArray, old: T, newValue: T, max?: number): number; +export declare function updateRange(array: IArray, value: T, start?: number, stop?: number): void; +export declare function clear(array: IArray, start?: number, stop?: number): void; +export declare function register(array: IArray, item: T, equalityComparer?: EqualityComparison): boolean; +export declare function findIndex(array: IArray, predicate: Predicate): number; +export declare function forEach(source: IArray, action: Predicate | Action): void; +export declare function applyTo(target: IArray, fn: (a: T) => T): void; +export declare function removeIndex(array: T[], index: number): boolean; +export declare function remove(array: T[], value: T, max?: number, equalityComparer?: EqualityComparison): number; +export declare function repeat(element: T, count: number): T[]; +export declare function range(first: number, count: number, step?: number): number[]; +export declare function rangeUntil(first: number, until: number, step?: number): number[]; +export declare function distinct(source: string[]): string[]; +export declare function distinct(source: number[]): number[]; +export declare function flatten(a: any[], recurseDepth?: number): any[]; diff --git a/dist/amd/System/Collections/CollectionBase.d.ts b/dist/amd/System/Collections/CollectionBase.d.ts new file mode 100644 index 00000000..d3ff773a --- /dev/null +++ b/dist/amd/System/Collections/CollectionBase.d.ts @@ -0,0 +1,40 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +declare abstract class CollectionBase extends DisposableBase implements ICollection, IEnumerateEach { + protected _equalityComparer: EqualityComparison; + constructor(source?: IEnumerableOrArray, _equalityComparer?: EqualityComparison); + protected abstract getCount(): number; + count: number; + protected getIsReadOnly(): boolean; + isReadOnly: boolean; + protected assertModifiable(): void; + protected _version: number; + assertVersion(version: number): void; + private _modifiedCount; + private _updateRecursion; + protected _onModified(): void; + protected _signalModification(increment?: boolean): boolean; + protected _incrementModified(): void; + isUpdating: boolean; + handleUpdate(closure?: () => boolean): boolean; + protected abstract _addInternal(entry: T): boolean; + add(entry: T): void; + protected abstract _removeInternal(entry: T, max?: number): number; + remove(entry: T, max?: number): number; + protected abstract _clearInternal(): number; + clear(): number; + protected _onDispose(): void; + protected _importEntries(entries: IEnumerableOrArray): number; + importEntries(entries: IEnumerableOrArray): number; + abstract getEnumerator(): IEnumerator; + contains(entry: T): boolean; + forEach(action: Predicate | Action, useCopy?: boolean): void; + copyTo>(target: TTarget, index?: number): TTarget; + toArray(): T[]; +} +export default CollectionBase; diff --git a/dist/amd/System/Collections/Dictionaries/Dictionary.d.ts b/dist/amd/System/Collections/Dictionaries/Dictionary.d.ts new file mode 100644 index 00000000..8ce9d526 --- /dev/null +++ b/dist/amd/System/Collections/Dictionaries/Dictionary.d.ts @@ -0,0 +1,26 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Original: http://linqjs.codeplex.com/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DictionaryBase from "./DictionaryBase"; +export interface IHashEntry extends ILinkedNode>, IKeyValuePair { +} +export default class Dictionary extends DictionaryBase { + private _keyComparer; + private _entries; + private _buckets; + constructor(_keyComparer?: Selector); + protected getCount(): number; + private _getBucket(hash, createIfMissing?); + private _getBucketEntry(key, hash?, bucket?); + protected _getEntry(key: TKey): IHashEntry; + getValue(key: TKey): TValue; + protected _setValueInternal(key: TKey, value: TValue): boolean; + protected _clearInternal(): number; + getEnumerator(): IEnumerator>; + protected getKeys(): TKey[]; + protected getValues(): TValue[]; +} diff --git a/dist/amd/System/Collections/Dictionaries/DictionaryBase.d.ts b/dist/amd/System/Collections/Dictionaries/DictionaryBase.d.ts new file mode 100644 index 00000000..f931e1a7 --- /dev/null +++ b/dist/amd/System/Collections/Dictionaries/DictionaryBase.d.ts @@ -0,0 +1,31 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "../CollectionBase"; +declare abstract class DictionaryBase extends CollectionBase> implements IDictionary { + constructor(source?: IEnumerableOrArray>); + protected _onValueModified(key: TKey, value: TValue, old: TValue): void; + protected _addInternal(item: KeyValuePair): boolean; + protected _clearInternal(): number; + contains(item: KeyValuePair): boolean; + protected _removeInternal(item: IKeyValuePair | [TKey, TValue]): number; + protected abstract getKeys(): TKey[]; + keys: TKey[]; + protected abstract getValues(): TValue[]; + values: TValue[]; + addByKeyValue(key: TKey, value: TValue): boolean; + protected abstract _getEntry(key: TKey): IKeyValuePair; + abstract getValue(key: TKey): TValue; + protected abstract _setValueInternal(key: TKey, value: TValue): boolean; + setValue(key: TKey, value: TValue): boolean; + containsKey(key: TKey): boolean; + containsValue(value: TValue): boolean; + removeByKey(key: TKey): boolean; + removeByValue(value: TValue): number; + importEntries(pairs: IEnumerableOrArray>): number; + protected _importEntries(pairs: IEnumerableOrArray>): number; + getEnumerator(): IEnumerator>; +} +export default DictionaryBase; diff --git a/dist/amd/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts b/dist/amd/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts new file mode 100644 index 00000000..159e833b --- /dev/null +++ b/dist/amd/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts @@ -0,0 +1,17 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import StringKeyDictionary from "./StringKeyDictionary"; +export default class OrderedStringKeyDictionary extends StringKeyDictionary implements IOrderedDictionary { + private _order; + constructor(); + indexOfKey(key: string): number; + getValueByIndex(index: number): TValue; + setValue(key: string, value: TValue, keepIndex?: boolean): boolean; + setByIndex(index: number, value: TValue): boolean; + importValues(values: TValue[]): boolean; + setValues(...values: TValue[]): boolean; + removeByIndex(index: number): boolean; + protected getKeys(): string[]; +} diff --git a/dist/amd/System/Collections/Dictionaries/OrderedStringKeyDictionary.js b/dist/amd/System/Collections/Dictionaries/OrderedStringKeyDictionary.js new file mode 100644 index 00000000..3890d12b --- /dev/null +++ b/dist/amd/System/Collections/Dictionaries/OrderedStringKeyDictionary.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +var __extends=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};define(["require","exports","../Array/Utility","./StringKeyDictionary","../../Exceptions/ArgumentOutOfRangeException"],function(t,e,r,n,o){"use strict";var i=void 0,u=function(t){function e(){t.call(this),this._order=[]}return __extends(e,t),e.prototype.indexOfKey=function(t){var e=this._order;return e.length?e.indexOf(t,0):-1},e.prototype.getValueByIndex=function(t){var e=this._order;return tt)throw new o["default"]("index",t,"Is less than zero.");if(t>=n.length)throw new o["default"]("index",t,"Is greater than the count.");return r.setValue(n[t],e)},e.prototype.importValues=function(t){var e=this;return e.handleUpdate(function(){for(var r=!1,n=0;n= order.length)\n throw new ArgumentOutOfRangeException_1.default('index', index, 'Is greater than the count.');\n return _.setValue(order[index], value);\n };\n OrderedStringKeyDictionary.prototype.importValues = function (values) {\n var _ = this;\n return _.handleUpdate(function () {\n var changed = false;\n for (var i = 0; i < values.length; i++) {\n if (_.setByIndex(i, values[i]))\n changed = true;\n }\n return changed;\n });\n };\n OrderedStringKeyDictionary.prototype.setValues = function () {\n var values = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n values[_i - 0] = arguments[_i];\n }\n return this.importValues(values);\n };\n OrderedStringKeyDictionary.prototype.removeByIndex = function (index) {\n return this.setByIndex(index, VOID0);\n };\n OrderedStringKeyDictionary.prototype.getKeys = function () {\n var _ = this, o = _._order;\n return o.length && o.filter(function (key) { return _.containsKey(key); }) || [];\n };\n return OrderedStringKeyDictionary;\n }(StringKeyDictionary_1.default));\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = OrderedStringKeyDictionary;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nimport * as ArrayUtility from \"../Array/Utility\";\r\nimport StringKeyDictionary from \"./StringKeyDictionary\";\r\nimport ArgumentOutOfRangeException from \"../../Exceptions/ArgumentOutOfRangeException\";\r\n\r\nconst VOID0:any = void 0;\r\n\r\nexport default\r\nclass OrderedStringKeyDictionary\r\nextends StringKeyDictionary implements IOrderedDictionary\r\n{\r\n\r\n\t// noinspection JSMismatchedCollectionQueryUpdate\r\n\tprivate _order:string[] = []; // Maintains indexes.\r\n\r\n\tconstructor()\r\n\t{\r\n\t\tsuper();\r\n\t}\r\n\r\n\tindexOfKey(key:string):number\r\n\t{\r\n\t\tvar o = this._order;\r\n\t\treturn o.length ? o.indexOf(key, 0) : -1;\r\n\t}\r\n\r\n\tgetValueByIndex(index:number):TValue\r\n\t{\r\n\t\tvar o = this._order;\r\n\t\treturn index=order.length)\r\n\t\t\tthrow new ArgumentOutOfRangeException('index', index, 'Is greater than the count.');\r\n\t\treturn _.setValue(order[index], value);\r\n\t}\r\n\r\n\t// importValues([x,y,z]);\r\n\timportValues(values:TValue[]):boolean\r\n\t{\r\n\t\tvar _ = this;\r\n\t\treturn _.handleUpdate(\r\n\t\t\t() =>\r\n\t\t\t{\r\n\t\t\t\tvar changed:boolean = false;\r\n\t\t\t\tfor(let i = 0; i _.containsKey(key)) || [];\r\n\t}\r\n\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Collections/Dictionaries/StringKeyDictionary.d.ts b/dist/amd/System/Collections/Dictionaries/StringKeyDictionary.d.ts new file mode 100644 index 00000000..15152615 --- /dev/null +++ b/dist/amd/System/Collections/Dictionaries/StringKeyDictionary.d.ts @@ -0,0 +1,20 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DictionaryBase from "./DictionaryBase"; +export default class StringKeyDictionary extends DictionaryBase implements IStringKeyDictionary { + private _count; + private _map; + protected _getEntry(key: string): IKeyValuePair; + containsKey(key: string): boolean; + containsValue(value: TValue): boolean; + getValue(key: string): TValue; + protected _setValueInternal(key: string, value: TValue): boolean; + importMap(values: IMap): boolean; + toMap(selector?: (key: string, value: TValue) => TValue): IMap; + protected getKeys(): string[]; + protected getValues(): TValue[]; + protected getCount(): number; +} diff --git a/dist/amd/System/Collections/Dictionaries/StringKeyDictionary.js b/dist/amd/System/Collections/Dictionaries/StringKeyDictionary.js new file mode 100644 index 00000000..8d6e0703 --- /dev/null +++ b/dist/amd/System/Collections/Dictionaries/StringKeyDictionary.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +var __extends=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)};define(["require","exports","../../Compare","./DictionaryBase"],function(t,e,n,r){"use strict";var o=void 0,i=function(t){function e(){t.apply(this,arguments),this._count=0,this._map={}}return __extends(e,t),e.prototype._getEntry=function(t){return this.containsKey(t)?{key:t,value:this.getValue(t)}:null},e.prototype.containsKey=function(t){return null!==t&&t!==o&&this._count?t in this._map:!1},e.prototype.containsValue=function(t){if(!this._count)return!1;var e=this._map,r=n.areEqual;for(var o in e)if(e.hasOwnProperty(o)&&r(e[o],t))return!0;return!1},e.prototype.getValue=function(t){return null!==t&&t!==o&&this._count?this._map[t]:o},e.prototype._setValueInternal=function(t,e){var n=this,r=n._map,i=r[t];return i!==e?(e===o?t in r&&(delete r[t],n._count--):(r.hasOwnProperty(t)||n._count++,r[t]=e),!0):!1},e.prototype.importMap=function(t){var e=this;return e.handleUpdate(function(){var n=!1;for(var r in t)t.hasOwnProperty(r)&&e.setValue(r,t[r])&&(n=!0);return n})},e.prototype.toMap=function(t){var e=this,n={};if(e._count)for(var r in e._map)if(e._map.hasOwnProperty(r)){var i=e._map[r];t&&(i=t(r,i)),i!==o&&(n[r]=i)}return n},e.prototype.getKeys=function(){return Object.keys(this._map)},e.prototype.getValues=function(){if(!this._count)return[];for(var t=Object.keys(this._map),e=0,n=t.length;n>e;e++)t[e]=this._map[t[e]];return t},e.prototype.getCount=function(){return this._count},e}(r["default"]);Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i}); +//# sourceMappingURL=StringKeyDictionary.js.map diff --git a/dist/amd/System/Collections/Dictionaries/StringKeyDictionary.js.map b/dist/amd/System/Collections/Dictionaries/StringKeyDictionary.js.map new file mode 100644 index 00000000..4c32cc3c --- /dev/null +++ b/dist/amd/System/Collections/Dictionaries/StringKeyDictionary.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Collections/Dictionaries/StringKeyDictionary.js","System/Collections/Dictionaries/StringKeyDictionary.ts"],"names":["__extends","this","d","b","__","constructor","p","hasOwnProperty","prototype","Object","create","define","require","exports","Compare_1","DictionaryBase_1","VOID0","StringKeyDictionary","_super","apply","arguments","_count","_map","_getEntry","key","containsKey","value","getValue","containsValue","map","equal","areEqual","_setValueInternal","_","old","importMap","values","handleUpdate","changed","setValue","toMap","selector","result","getKeys","keys","getValues","i","len","length","getCount","defineProperty"],"mappings":";;;;AAIA,GAAIA,WAAaC,MAAQA,KAAKD,WAAc,SAAUE,EAAGC,GAErD,QAASC,KAAOH,KAAKI,YAAcH,EADnC,IAAK,GAAII,KAAKH,GAAOA,EAAEI,eAAeD,KAAIJ,EAAEI,GAAKH,EAAEG,GAEnDJ,GAAEM,UAAkB,OAANL,EAAaM,OAAOC,OAAOP,IAAMC,EAAGI,UAAYL,EAAEK,UAAW,GAAIJ,IAEnFO,SAAQ,UAAW,UAAW,gBAAiB,oBAAqB,SAAUC,EAASC,EAASC,EAAWC,GCH3G,YAKA,IAAMC,GAAY,OAElBC,EAAA,SAAAC,GAAA,QAAAD,KAEQC,EAAAC,MAAAlB,KAAAmB,WAGCnB,KAAAoB,OAAgB,EAChBpB,KAAAqB,QAwHT,MA5HQtB,WAAAiB,EAAAC,GAMGD,EAAAT,UAAAe,UAAV,SAAoBC,GAEnB,MAAQvB,MAAKwB,YAAYD,IAExBA,IAAKA,EACLE,MAAOzB,KAAK0B,SAASH,IAFnB,MAMJP,EAAAT,UAAAiB,YAAA,SAAYD,GAEX,MAAS,QAANA,GAAcA,IAAMR,GAAUf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,EAAAT,UAAAqC,UAAV,WAEC,IAAI5C,KAAKoB,OAAQ,QAEjB,KAAI,GADAqB,GAAejC,OAAOmC,KAAK3C,KAAKqB,MAC5BwB,EAAI,EAAGC,EAAML,EAAOM,OAAUD,EAAFD,EAAOA,IAE1CJ,EAAOI,GAAK7C,KAAKqB,KAAKoB,EAAOI,GAG9B,OAAOJ,IAGEzB,EAAAT,UAAAyC,SAAV,WAEC,MAAOhD,MAAKoB,QAIdJ,GA5HQF,EAAAA,WAFRN,QAAAyC,eAAArC,EAAA,cAAAa,OAAA,ID8FIb,EAAAA,WAAkBI","file":"System/Collections/Dictionaries/StringKeyDictionary.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\ndefine([\"require\", \"exports\", \"../../Compare\", \"./DictionaryBase\"], function (require, exports, Compare_1, DictionaryBase_1) {\n 'use strict';\n var VOID0 = void 0;\n var StringKeyDictionary = (function (_super) {\n __extends(StringKeyDictionary, _super);\n function StringKeyDictionary() {\n _super.apply(this, arguments);\n this._count = 0;\n this._map = {};\n }\n StringKeyDictionary.prototype._getEntry = function (key) {\n return !this.containsKey(key)\n ? null : {\n key: key,\n value: this.getValue(key)\n };\n };\n StringKeyDictionary.prototype.containsKey = function (key) {\n if (key === null || key === VOID0 || !this._count)\n return false;\n return (key) in (this._map);\n };\n StringKeyDictionary.prototype.containsValue = function (value) {\n if (!this._count)\n return false;\n var map = this._map, equal = Compare_1.areEqual;\n for (var key in map) {\n if (map.hasOwnProperty(key) && equal(map[key], value))\n return true;\n }\n return false;\n };\n StringKeyDictionary.prototype.getValue = function (key) {\n if (key === null || key === VOID0 || !this._count)\n return VOID0;\n return this._map[key];\n };\n StringKeyDictionary.prototype._setValueInternal = function (key, value) {\n var _ = this, map = _._map, old = map[key];\n if (old !== value) {\n if (value === VOID0) {\n if ((key) in (map)) {\n delete map[key];\n _._count--;\n }\n }\n else {\n if (!map.hasOwnProperty(key))\n _._count++;\n map[key] = value;\n }\n return true;\n }\n return false;\n };\n StringKeyDictionary.prototype.importMap = function (values) {\n var _ = this;\n return _.handleUpdate(function () {\n var changed = false;\n for (var key in values) {\n if (values.hasOwnProperty(key) && _.setValue(key, values[key]))\n changed = true;\n }\n return changed;\n });\n };\n StringKeyDictionary.prototype.toMap = function (selector) {\n var _ = this, result = {};\n if (_._count)\n for (var key in _._map) {\n if (_._map.hasOwnProperty(key)) {\n var value = _._map[key];\n if (selector)\n value = selector(key, value);\n if (value !== VOID0)\n result[key] = value;\n }\n }\n return result;\n };\n StringKeyDictionary.prototype.getKeys = function () {\n return Object.keys(this._map);\n };\n StringKeyDictionary.prototype.getValues = function () {\n if (!this._count)\n return [];\n var result = Object.keys(this._map);\n for (var i = 0, len = result.length; i < len; i++) {\n result[i] = this._map[result[i]];\n }\n return result;\n };\n StringKeyDictionary.prototype.getCount = function () {\n return this._count;\n };\n return StringKeyDictionary;\n }(DictionaryBase_1.default));\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = StringKeyDictionary;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nimport {areEqual} from \"../../Compare\";\r\nimport DictionaryBase from \"./DictionaryBase\";\r\n\r\nconst VOID0:any = void 0;\r\n\r\nexport default\r\nclass StringKeyDictionary\r\nextends DictionaryBase implements IStringKeyDictionary\r\n{\r\n\r\n\tprivate _count:number = 0;\r\n\tprivate _map:IMap = {};\r\n\r\n\tprotected _getEntry(key:string):IKeyValuePair\r\n\t{\r\n\t\treturn !this.containsKey(key)\r\n\t\t\t? null : {\r\n\t\t\tkey: key,\r\n\t\t\tvalue: this.getValue(key)\r\n\t\t}\r\n\t}\r\n\r\n\tcontainsKey(key:string):boolean\r\n\t{\r\n\t\tif(key===null || key===VOID0 || !this._count) return false;\r\n\t\treturn (key) in (this._map);\r\n\t}\r\n\r\n\tcontainsValue(value:TValue):boolean\r\n\t{\r\n\t\tif(!this._count) return false;\r\n\t\tvar map = this._map, equal:(a:any, b:any, strict?:boolean) => boolean = areEqual;\r\n\t\tfor(let key in map)\r\n\t\t{\r\n\t\t\tif(map.hasOwnProperty(key) && equal(map[key], value))\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\r\n\tgetValue(key:string):TValue\r\n\t{\r\n\t\tif(key===null || key===VOID0 || !this._count) return VOID0;\r\n\t\treturn this._map[key];\r\n\t}\r\n\r\n\tprotected _setValueInternal(key:string, value:TValue):boolean\r\n\t{\r\n\t\tvar _ = this, map = _._map, old = map[key];\r\n\t\tif(old!==value)\r\n\t\t{\r\n\r\n\t\t\tif(value===VOID0)\r\n\t\t\t{\r\n\t\t\t\tif((key) in (map))\r\n\t\t\t\t{\r\n\t\t\t\t\tdelete map[key];\r\n\t\t\t\t\t_._count--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(!map.hasOwnProperty(key))\r\n\t\t\t\t\t_._count++;\r\n\t\t\t\tmap[key] = value;\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// Returns true if any value is updated...\r\n\timportMap(values:IMap):boolean\r\n\t{\r\n\t\tvar _ = this;\r\n\t\treturn _.handleUpdate(\r\n\t\t\t() =>\r\n\t\t\t{\r\n\t\t\t\tvar changed:boolean = false;\r\n\t\t\t\tfor(let key in values)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(values.hasOwnProperty(key) && _.setValue(key, values[key]))\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t\treturn changed;\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n\r\n\ttoMap(selector?:(key:string, value:TValue) => TValue):IMap\r\n\t{\r\n\t\tvar _ = this, result:IMap = {};\r\n\t\tif(_._count) for(let key in _._map)\r\n\t\t{\r\n\t\t\tif(_._map.hasOwnProperty(key)) // This simply satisfies inspection.\r\n\t\t\t{\r\n\t\t\t\tvar value = _._map[key];\r\n\t\t\t\tif(selector)\r\n\t\t\t\t\tvalue = selector(key, value);\r\n\t\t\t\tif(value!==VOID0)\r\n\t\t\t\t\tresult[key] = value;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tprotected getKeys():string[]\r\n\t{\r\n\t\treturn Object.keys(this._map);\r\n\t}\r\n\r\n\tprotected getValues():TValue[]\r\n\t{\r\n\t\tif(!this._count) return [];\r\n\t\tvar result:any[] = Object.keys(this._map);\r\n\t\tfor(let i = 0, len = result.length; i +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import IndexEnumerator from "./IndexEnumerator"; +export default class ArrayEnumerator extends IndexEnumerator { + constructor(arrayFactory: () => IArray, start?: number, step?: number); + constructor(array: IArray, start?: number, step?: number); +} diff --git a/dist/amd/System/Collections/Enumeration/Enumerator.d.ts b/dist/amd/System/Collections/Enumeration/Enumerator.d.ts new file mode 100644 index 00000000..4001711b --- /dev/null +++ b/dist/amd/System/Collections/Enumeration/Enumerator.d.ts @@ -0,0 +1,19 @@ +/// +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function throwIfEndless(isEndless: boolean): void; +export declare const empty: IEnumerator; +export declare function from(source: IEnumerableOrArray): IEnumerator; +export declare function isEnumerable(instance: any): instance is IEnumerable; +export declare function isEnumerableOrArrayLike(instance: any): instance is IEnumerableOrArray; +export declare function isEnumerator(instance: any): instance is IEnumerator; +export declare function forEach(e: IEnumerableOrArray | IEnumerator, action: (element: T, index?: number) => any): boolean | void; +export declare function toArray(source: IEnumerableOrArray | IEnumerator): T[]; +export declare function map(source: IEnumerableOrArray | IEnumerator, selector: Selector): TResult[]; diff --git a/dist/amd/System/Collections/Enumeration/EnumeratorBase.d.ts b/dist/amd/System/Collections/Enumeration/EnumeratorBase.d.ts new file mode 100644 index 00000000..8ed548b8 --- /dev/null +++ b/dist/amd/System/Collections/Enumeration/EnumeratorBase.d.ts @@ -0,0 +1,26 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../../Disposable/DisposableBase"; +export default class EnumeratorBase extends DisposableBase implements IEnumerator { + private _initializer; + private _tryGetNext; + private _yielder; + private _state; + private _disposer; + current: T; + constructor(initializer: () => void, tryGetNext: (yielder: IYield) => boolean, isEndless?: boolean); + constructor(initializer: () => void, tryGetNext: (yielder: IYield) => boolean, disposer?: () => void, isEndless?: boolean); + protected _isEndless: boolean; + isEndless: boolean; + reset(): void; + moveNext(): boolean; + nextValue(): T; + next(): IIteratorResult; + protected _onDispose(): void; +} diff --git a/dist/amd/System/Collections/Enumeration/IndexEnumerator.d.ts b/dist/amd/System/Collections/Enumeration/IndexEnumerator.d.ts new file mode 100644 index 00000000..e85a88be --- /dev/null +++ b/dist/amd/System/Collections/Enumeration/IndexEnumerator.d.ts @@ -0,0 +1,15 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import EnumeratorBase from "./EnumeratorBase"; +export default class IndexEnumerator extends EnumeratorBase { + constructor(sourceFactory: () => { + source: { + [index: number]: T; + }; + pointer?: number; + length: number; + step?: number; + }); +} diff --git a/dist/amd/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts b/dist/amd/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts new file mode 100644 index 00000000..b966255b --- /dev/null +++ b/dist/amd/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from "../../Exceptions/SystemException"; +export default class UnsupportedEnumerableException extends SystemException { + constructor(message?: string); + protected getName(): string; +} diff --git a/dist/amd/System/Collections/LinkedList.d.ts b/dist/amd/System/Collections/LinkedList.d.ts new file mode 100644 index 00000000..6de7a80e --- /dev/null +++ b/dist/amd/System/Collections/LinkedList.d.ts @@ -0,0 +1,37 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based Upon: http://msdn.microsoft.com/en-us/library/he2s3bh7%28v=vs.110%29.aspx + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +export default class LinkedList extends CollectionBase implements ILinkedList { + private _listInternal; + constructor(source?: IEnumerableOrArray, equalityComparer?: EqualityComparison); + protected getCount(): number; + protected _addInternal(entry: T): boolean; + protected _removeInternal(entry: T, max?: number): number; + protected _clearInternal(): number; + forEach(action: Predicate | Action, useCopy?: boolean): void; + getEnumerator(): IEnumerator; + private _findFirst(entry); + private _findLast(entry); + removeOnce(entry: T): boolean; + first: ILinkedListNode; + last: ILinkedListNode; + getValueAt(index: number): T; + getNodeAt(index: number): ILinkedListNode; + find(entry: T): ILinkedListNode; + findLast(entry: T): ILinkedListNode; + addFirst(entry: T): void; + addLast(entry: T): void; + removeFirst(): void; + removeLast(): void; + removeNode(node: ILinkedListNode): boolean; + addBefore(before: ILinkedListNode, entry: T): void; + addAfter(after: ILinkedListNode, entry: T): void; + addNodeBefore(node: ILinkedListNode, before: ILinkedListNode): void; + addNodeAfter(node: ILinkedListNode, after: ILinkedListNode): void; +} diff --git a/dist/amd/System/Collections/LinkedNodeList.d.ts b/dist/amd/System/Collections/LinkedNodeList.d.ts new file mode 100644 index 00000000..2f91455d --- /dev/null +++ b/dist/amd/System/Collections/LinkedNodeList.d.ts @@ -0,0 +1,31 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class LinkedNodeList> implements ILinkedNodeList, IEnumerateEach, IDisposable { + private _first; + private _last; + unsafeCount: number; + constructor(); + first: TNode; + last: TNode; + count: number; + forEach(action: Predicate | Action): void; + map(selector: Selector): T[]; + clear(): number; + dispose(): void; + contains(node: TNode): boolean; + getNodeAt(index: number): TNode; + find(condition: Predicate): TNode; + indexOf(node: TNode): number; + removeFirst(): boolean; + removeLast(): boolean; + removeNode(node: TNode): boolean; + addNode(node: TNode): void; + addNodeBefore(node: TNode, before?: TNode): void; + addNodeAfter(node: TNode, after?: TNode): void; + replace(node: TNode, replacement: TNode): void; + static valueEnumeratorFrom(list: LinkedNodeList>): IEnumerator; + static copyValues>(list: LinkedNodeList>, array: TDestination, index?: number): TDestination; +} diff --git a/dist/amd/System/Collections/List.d.ts b/dist/amd/System/Collections/List.d.ts new file mode 100644 index 00000000..39f8549b --- /dev/null +++ b/dist/amd/System/Collections/List.d.ts @@ -0,0 +1,24 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +export default class List extends CollectionBase implements IList, IEnumerateEach { + protected _source: T[]; + constructor(source?: IEnumerableOrArray, equalityComparer?: EqualityComparison); + protected getCount(): number; + protected _addInternal(entry: T): boolean; + protected _removeInternal(entry: T, max?: number): number; + protected _clearInternal(): number; + protected _importEntries(entries: IEnumerableOrArray): number; + get(index: number): T; + set(index: number, value: T): boolean; + indexOf(item: T): number; + insert(index: number, value: T): void; + removeAt(index: number): boolean; + contains(item: T): boolean; + copyTo>(target: TTarget, index?: number): TTarget; + getEnumerator(): IEnumerator; + forEach(action: Predicate | Action, useCopy?: boolean): void; +} diff --git a/dist/amd/System/Collections/Queue.d.ts b/dist/amd/System/Collections/Queue.d.ts new file mode 100644 index 00000000..e634439d --- /dev/null +++ b/dist/amd/System/Collections/Queue.d.ts @@ -0,0 +1,35 @@ +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based Upon: http://referencesource.microsoft.com/#System/CompMod/system/collections/generic/queue.cs + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +export default class Queue extends CollectionBase { + private _array; + private _head; + private _tail; + private _size; + private _capacity; + constructor(source?: IEnumerableOrArray | number, equalityComparer?: EqualityComparison); + protected getCount(): number; + protected _addInternal(item: T): boolean; + protected _removeInternal(item: T, max?: number): number; + protected _clearInternal(): number; + protected _onDispose(): void; + dump(max?: number): T[]; + forEach(action: Predicate | Action): void; + setCapacity(capacity: number): void; + enqueue(item: T): void; + protected _dequeueInternal(throwIfEmpty?: boolean): T; + dequeue(throwIfEmpty?: boolean): T; + tryDequeue(out: (value: T) => void): boolean; + private _getElement(index); + peek(): T; + trimExcess(threshold?: number): void; + getEnumerator(): IEnumerator; +} diff --git a/dist/amd/System/Collections/ReadOnlyCollectionBase.d.ts b/dist/amd/System/Collections/ReadOnlyCollectionBase.d.ts new file mode 100644 index 00000000..5633231c --- /dev/null +++ b/dist/amd/System/Collections/ReadOnlyCollectionBase.d.ts @@ -0,0 +1,18 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +declare abstract class ReadOnlyCollectionBase extends CollectionBase { + protected _getCount: () => number; + protected getCount(): number; + protected getIsReadOnly(): boolean; + protected _addInternal(entry: T): boolean; + protected _removeInternal(entry: T, max?: number): number; + protected _clearInternal(): number; + protected _getEnumerator: () => IEnumerator; + getEnumerator(): IEnumerator; +} +export default ReadOnlyCollectionBase; diff --git a/dist/amd/System/Collections/ReadOnlyCollectionWrapper.d.ts b/dist/amd/System/Collections/ReadOnlyCollectionWrapper.d.ts new file mode 100644 index 00000000..4b2dbde9 --- /dev/null +++ b/dist/amd/System/Collections/ReadOnlyCollectionWrapper.d.ts @@ -0,0 +1,8 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ReadOnlyCollection from "./ReadOnlyCollectionBase"; +export default class ReadOnlyCollectionWrapper extends ReadOnlyCollection { + constructor(c: ICollection); +} diff --git a/dist/amd/System/Collections/Set.d.ts b/dist/amd/System/Collections/Set.d.ts new file mode 100644 index 00000000..b44c6c2d --- /dev/null +++ b/dist/amd/System/Collections/Set.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import SetBase from "./SetBase"; +export default class Set extends SetBase { + protected newUsing(source?: IEnumerableOrArray): Set; + private _registry; + protected _addInternal(item: T): boolean; + protected _clearInternal(): number; + protected _onDispose(): void; + protected _getNode(item: T): ILinkedNodeWithValue; + protected _removeInternal(item: T, max?: number): number; +} diff --git a/dist/amd/System/Collections/SetBase.d.ts b/dist/amd/System/Collections/SetBase.d.ts new file mode 100644 index 00000000..1b129395 --- /dev/null +++ b/dist/amd/System/Collections/SetBase.d.ts @@ -0,0 +1,36 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import LinkedNodeList from "./LinkedNodeList"; +import CollectionBase from "./CollectionBase"; +declare abstract class SetBase extends CollectionBase implements ISet, IDisposable { + constructor(source?: IEnumerableOrArray); + protected abstract newUsing(source?: IEnumerableOrArray): SetBase; + protected _set: LinkedNodeList>; + protected _getSet(): LinkedNodeList>; + protected getCount(): number; + exceptWith(other: IEnumerableOrArray): void; + intersectWith(other: IEnumerableOrArray): void; + isProperSubsetOf(other: IEnumerableOrArray): boolean; + isProperSupersetOf(other: IEnumerableOrArray): boolean; + isSubsetOf(other: IEnumerableOrArray): boolean; + isSupersetOf(other: IEnumerableOrArray): boolean; + overlaps(other: IEnumerableOrArray): boolean; + setEquals(other: IEnumerableOrArray): boolean; + symmetricExceptWith(other: IEnumerableOrArray): void; + unionWith(other: IEnumerableOrArray): void; + protected _clearInternal(): number; + protected _onDispose(): void; + protected abstract _getNode(item: T): ILinkedNodeWithValue; + contains(item: T): boolean; + getEnumerator(): IEnumerator; + forEach(action: Predicate | Action, useCopy?: boolean): void; + protected _removeNode(node: ILinkedNodeWithValue): boolean; + removeFirst(): boolean; + removeLast(): boolean; +} +export default SetBase; diff --git a/dist/amd/System/Collections/Sorting/KeySortedContext.d.ts b/dist/amd/System/Collections/Sorting/KeySortedContext.d.ts new file mode 100644 index 00000000..36822f6a --- /dev/null +++ b/dist/amd/System/Collections/Sorting/KeySortedContext.d.ts @@ -0,0 +1,16 @@ +/// +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import SortContext from "./SortContext"; +export default class KeySortedContext extends SortContext { + protected _keySelector: Selector; + constructor(next: IComparer, _keySelector: Selector, order?: Order, comparer?: Comparison); + compare(a: T, b: T): number; +} diff --git a/dist/amd/System/Collections/Sorting/SortContext.d.ts b/dist/amd/System/Collections/Sorting/SortContext.d.ts new file mode 100644 index 00000000..b459e302 --- /dev/null +++ b/dist/amd/System/Collections/Sorting/SortContext.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class SortContext implements IComparer { + protected _next: IComparer; + protected _comparer: Comparison; + protected _order: Order; + order: Order; + constructor(_next: IComparer, _comparer?: Comparison, _order?: Order); + generateSortedIndexes(source: T[]): number[]; + compare(a: T, b: T): number; +} diff --git a/dist/amd/System/Compare.d.ts b/dist/amd/System/Compare.d.ts new file mode 100644 index 00000000..1d12a4b3 --- /dev/null +++ b/dist/amd/System/Compare.d.ts @@ -0,0 +1,11 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function areEqual(a: any, b: any, strict?: boolean): boolean; +export declare function compare(a: IComparable, b: IComparable): number; +export declare function compare(a: T, b: T, strict?: boolean): CompareResult; +export declare function areEquivalent(a: any, b: any, nullEquivalency?: boolean, extraDepth?: number): boolean; diff --git a/dist/amd/System/Diagnostics/Stopwatch.d.ts b/dist/amd/System/Diagnostics/Stopwatch.d.ts new file mode 100644 index 00000000..b0bd97a1 --- /dev/null +++ b/dist/amd/System/Diagnostics/Stopwatch.d.ts @@ -0,0 +1,24 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeSpan from "../Time/TimeSpan"; +export default class Stopwatch implements ITimer { + static getTimestampMilliseconds(): number; + private _elapsed; + private _startTimeStamp; + private _isRunning; + isRunning: boolean; + constructor(); + static startNew(): Stopwatch; + static measure(closure: () => void): TimeSpan; + start(): void; + stop(): void; + reset(): void; + lap(): TimeSpan; + currentLapMilliseconds: number; + currentLap: TimeSpan; + elapsedMilliseconds: number; + elapsed: TimeSpan; +} diff --git a/dist/amd/System/Disposable/DisposableBase.d.ts b/dist/amd/System/Disposable/DisposableBase.d.ts new file mode 100644 index 00000000..1acd883f --- /dev/null +++ b/dist/amd/System/Disposable/DisposableBase.d.ts @@ -0,0 +1,16 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare abstract class DisposableBase implements IDisposableAware { + private _finalizer; + constructor(_finalizer?: () => void); + private _wasDisposed; + wasDisposed: boolean; + protected _disposableObjectName: string; + protected throwIfDisposed(message?: string, objectName?: string): boolean; + dispose(): void; + protected _onDispose(): void; +} +export default DisposableBase; diff --git a/dist/amd/System/Disposable/ObjectDisposedException.d.ts b/dist/amd/System/Disposable/ObjectDisposedException.d.ts new file mode 100644 index 00000000..66e40831 --- /dev/null +++ b/dist/amd/System/Disposable/ObjectDisposedException.d.ts @@ -0,0 +1,15 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import Exception from '../Exception'; +import InvalidOperationException from '../Exceptions/InvalidOperationException'; +export default class ObjectDisposedException extends InvalidOperationException { + objectName: string; + constructor(objectName: string, message?: string, innerException?: Exception); + protected getName(): string; + toString(): string; + static throwIfDisposed(disposable: IDisposableAware, objectName?: string, message?: string): void; +} diff --git a/dist/amd/System/Disposable/ObjectPool.d.ts b/dist/amd/System/Disposable/ObjectPool.d.ts new file mode 100644 index 00000000..af854543 --- /dev/null +++ b/dist/amd/System/Disposable/ObjectPool.d.ts @@ -0,0 +1,30 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon ObjectPool from Parallel Extension Extras and other ObjectPool implementations. + * Uses .add(T) and .take():T + */ +import DisposableBase from "./DisposableBase"; +export default class ObjectPool extends DisposableBase { + private _maxSize; + private _generator; + private _pool; + private _trimmer; + private _flusher; + private _autoFlusher; + private _localAbsMaxSize; + autoClearTimeout: number; + constructor(_maxSize: number, _generator: () => T); + maxSize: number; + count: number; + protected _trim(): void; + trim(defer?: number): void; + protected _clear(): void; + clear(defer?: number): void; + toArrayAndClear(): T[]; + dump(): T[]; + protected _onDispose(): void; + extendAutoClear(): void; + add(o: T): void; + take(): T; +} diff --git a/dist/amd/System/Disposable/dispose.d.ts b/dist/amd/System/Disposable/dispose.d.ts new file mode 100644 index 00000000..ea01844c --- /dev/null +++ b/dist/amd/System/Disposable/dispose.d.ts @@ -0,0 +1,17 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function dispose(...disposables: IDisposable[]): void; +export declare module dispose { + function deferred(...disposables: IDisposable[]): void; + function withoutException(...disposables: IDisposable[]): any[]; + function these(disposables: IDisposable[], trapExceptions?: boolean): any[]; + module these { + function deferred(disposables: IDisposable[], delay?: number): void; + } +} +export declare function using(disposable: TDisposable, closure: (disposable: TDisposable) => TReturn): TReturn; +export default dispose; diff --git a/dist/amd/System/Events/EventDispatcherBase.d.ts b/dist/amd/System/Events/EventDispatcherBase.d.ts new file mode 100644 index 00000000..e8e78469 --- /dev/null +++ b/dist/amd/System/Events/EventDispatcherBase.d.ts @@ -0,0 +1,33 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +import EventDispatcherEntry from "./EventDispatcherEntry"; +export interface IEventBase { + type: string; + target: TTarget; +} +export interface IEvent extends IEventBase { +} +export interface IEntryParams { + priority: number; + dispatcher: EventDispatcherBase; +} +export default class EventDispatcherBase extends DisposableBase implements IEventDispatcher { + protected _entries: EventDispatcherEntry[]; + addEventListener(type: string, listener: IEventListener, priority?: number): void; + removeEntry(entry: EventDispatcherEntry): boolean; + registerEventListener(type: string, listener: IEventListener, priority?: number): void; + hasEventListener(type: string, listener?: IEventListener): boolean; + removeEventListener(type: string, listener: IEventListener): void; + dispatchEvent(type: string, params?: any): boolean; + dispatchEvent(event: IEvent): boolean; + static DISPOSING: string; + static DISPOSED: string; + private _isDisposing; + isDisposing: boolean; + dispose(): void; +} diff --git a/dist/amd/System/Events/EventDispatcherEntry.d.ts b/dist/amd/System/Events/EventDispatcherEntry.d.ts new file mode 100644 index 00000000..73b2f602 --- /dev/null +++ b/dist/amd/System/Events/EventDispatcherEntry.d.ts @@ -0,0 +1,16 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +export default class EventDispatcherEntry extends DisposableBase implements IEquatable> { + type: string; + listener: IEventListener; + params: TParams; + constructor(type: string, listener: IEventListener, params?: TParams, finalizer?: () => void); + protected _onDispose(): void; + dispatch(e: Event): boolean; + matches(type: string, listener: IEventListener): boolean; + equals(other: EventDispatcherEntry): boolean; +} diff --git a/dist/amd/System/Events/EventSimple.d.ts b/dist/amd/System/Events/EventSimple.d.ts new file mode 100644 index 00000000..f4fd3db2 --- /dev/null +++ b/dist/amd/System/Events/EventSimple.d.ts @@ -0,0 +1,13 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Based on Netjs mscorlib.ts + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class EventSimple implements IDisposable { + private _listeners; + add(listener: T): void; + remove(listener: T): void; + dispatch(...params: any[]): void; + toMulticastFunction(): Function; + dispose(): void; +} diff --git a/dist/amd/System/Exception.d.ts b/dist/amd/System/Exception.d.ts new file mode 100644 index 00000000..dce52d48 --- /dev/null +++ b/dist/amd/System/Exception.d.ts @@ -0,0 +1,18 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +export default class Exception implements Error, IDisposable { + message: string; + name: string; + constructor(message?: string, innerException?: Error, beforeSealing?: (ex: any) => void); + stack: string; + data: IMap; + protected getName(): string; + toString(): string; + protected toStringWithoutBrackets(): string; + dispose(): void; +} diff --git a/dist/amd/System/ExceptionType.d.ts b/dist/amd/System/ExceptionType.d.ts new file mode 100644 index 00000000..5cd2e52a --- /dev/null +++ b/dist/amd/System/ExceptionType.d.ts @@ -0,0 +1,11 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare const Error: string; +export declare const EvalError: string; +export declare const RangeError: string; +export declare const ReferenceError: string; +export declare const SyntaxError: string; +export declare const TypeError: string; +export declare const URIError: string; diff --git a/dist/amd/System/Exceptions/ArgumentException.d.ts b/dist/amd/System/Exceptions/ArgumentException.d.ts new file mode 100644 index 00000000..eac4232c --- /dev/null +++ b/dist/amd/System/Exceptions/ArgumentException.d.ts @@ -0,0 +1,11 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from "./SystemException"; +export default class ArgumentException extends SystemException { + paramName: string; + constructor(paramName: string, message?: string, innerException?: Error, beforeSealing?: (ex: any) => void); + protected getName(): string; +} diff --git a/dist/amd/System/Exceptions/ArgumentNullException.d.ts b/dist/amd/System/Exceptions/ArgumentNullException.d.ts new file mode 100644 index 00000000..5cc13038 --- /dev/null +++ b/dist/amd/System/Exceptions/ArgumentNullException.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import ArgumentException from './ArgumentException'; +export default class ArgumentNullException extends ArgumentException { + constructor(paramName: string, message?: string, innerException?: Error); + protected getName(): string; +} diff --git a/dist/amd/System/Exceptions/ArgumentOutOfRangeException.d.ts b/dist/amd/System/Exceptions/ArgumentOutOfRangeException.d.ts new file mode 100644 index 00000000..4fd62443 --- /dev/null +++ b/dist/amd/System/Exceptions/ArgumentOutOfRangeException.d.ts @@ -0,0 +1,12 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import Exception from "../Exception"; +import ArgumentException from "./ArgumentException"; +export default class ArgumentOutOfRangeException extends ArgumentException { + actualValue: string | number | boolean; + constructor(paramName: string, actualValue: string | number | boolean, message?: string, innerException?: Exception); + protected getName(): string; +} diff --git a/dist/amd/System/Exceptions/InvalidOperationException.d.ts b/dist/amd/System/Exceptions/InvalidOperationException.d.ts new file mode 100644 index 00000000..4f422d04 --- /dev/null +++ b/dist/amd/System/Exceptions/InvalidOperationException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from './SystemException'; +export default class InvalidOperationException extends SystemException { + protected getName(): string; +} diff --git a/dist/amd/System/Exceptions/NotImplementedException.d.ts b/dist/amd/System/Exceptions/NotImplementedException.d.ts new file mode 100644 index 00000000..0225eeb8 --- /dev/null +++ b/dist/amd/System/Exceptions/NotImplementedException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from './SystemException'; +export default class NotImplementedException extends SystemException { + protected getName(): string; +} diff --git a/dist/amd/System/Exceptions/NullReferenceException.d.ts b/dist/amd/System/Exceptions/NullReferenceException.d.ts new file mode 100644 index 00000000..780b64a6 --- /dev/null +++ b/dist/amd/System/Exceptions/NullReferenceException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from './SystemException'; +export default class NullReferenceException extends SystemException { + protected getName(): string; +} diff --git a/dist/amd/System/Exceptions/SystemException.d.ts b/dist/amd/System/Exceptions/SystemException.d.ts new file mode 100644 index 00000000..239bfbef --- /dev/null +++ b/dist/amd/System/Exceptions/SystemException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/system.systemexception%28v=vs.110%29.aspx + */ +import Exception from '../Exception'; +export default class SystemException extends Exception { + protected getName(): string; +} diff --git a/dist/amd/System/Functions.d.ts b/dist/amd/System/Functions.d.ts new file mode 100644 index 00000000..0262bc62 --- /dev/null +++ b/dist/amd/System/Functions.d.ts @@ -0,0 +1,17 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare class Functions { + Identity(x: T): T; + True(): boolean; + False(): boolean; + Blank(): void; +} +declare module Functions { + var Identity: (x: T) => T; + var True: () => boolean; + var False: () => boolean; + var Blank: () => void; +} +export default Functions; diff --git a/dist/amd/System/Integer.d.ts b/dist/amd/System/Integer.d.ts new file mode 100644 index 00000000..04881834 --- /dev/null +++ b/dist/amd/System/Integer.d.ts @@ -0,0 +1,25 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function Integer(n: number): number; +export declare module Integer { + const MAX_32_BIT: number; + function random(maxExclusive: number): number; + module random { + function next(boundary: number, inclusive?: boolean): number; + function nextInRange(min: number, max: number, inclusive?: boolean): number; + function select(source: IArray): T; + module select { + function one(source: IArray): T; + } + } + function as32Bit(n: number): number; + function is(n: number): boolean; + function is32Bit(n: number): boolean; + function assert(n: number, argumentName?: string): boolean; + function assertZeroOrGreater(n: number, argumentName?: string): boolean; + function assertPositive(n: number, argumentName?: string): boolean; +} +export default Integer; diff --git a/dist/amd/System/KeyValueExtract.d.ts b/dist/amd/System/KeyValueExtract.d.ts new file mode 100644 index 00000000..cfe473b9 --- /dev/null +++ b/dist/amd/System/KeyValueExtract.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function isKeyValuePair(kvp: any): kvp is IKeyValuePair; +export declare function assertKey(key: TKey, name?: string): TKey; +export declare function assertTuple(tuple: IArray, name?: string): void; +export declare function assertNotUndefined(value: T, name: string): T; +export default function extractKeyValue(item: KeyValuePair, to: (key: TKey, value: TValue) => TResult): TResult; diff --git a/dist/amd/System/Lazy.d.ts b/dist/amd/System/Lazy.d.ts new file mode 100644 index 00000000..de32b287 --- /dev/null +++ b/dist/amd/System/Lazy.d.ts @@ -0,0 +1,21 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from './Disposable/DisposableBase'; +export default class Lazy extends DisposableBase implements ILazy { + private _closure; + private _isValueCreated; + private _value; + constructor(_closure: Func); + isValueCreated: boolean; + canReset: boolean; + reset(throwIfCannotReset?: boolean): boolean; + value: T; + getValue(clearClosureReference?: boolean): T; + protected _onDispose(): void; + equals(other: Lazy): boolean; + valueEquals(other: Lazy): boolean; +} diff --git a/dist/amd/System/Net/Http/HttpMethod.d.ts b/dist/amd/System/Net/Http/HttpMethod.d.ts new file mode 100644 index 00000000..d70dbbd8 --- /dev/null +++ b/dist/amd/System/Net/Http/HttpMethod.d.ts @@ -0,0 +1,7 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + */ +export declare const OPTIONS: HttpMethodValue, HEAD: HttpMethodValue, GET: HttpMethodValue, PUT: HttpMethodValue, POST: HttpMethodValue, DELETE: HttpMethodValue, TRACE: HttpMethodValue, CONNECT: HttpMethodValue; diff --git a/dist/amd/System/Net/Http/HttpMethod.js b/dist/amd/System/Net/Http/HttpMethod.js new file mode 100644 index 00000000..2f21c8dd --- /dev/null +++ b/dist/amd/System/Net/Http/HttpMethod.js @@ -0,0 +1,7 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + */ +define(["require","exports"],function(E,T){"use strict";T.OPTIONS="OPTIONS",T.HEAD="HEAD",T.GET="GET",T.PUT="PUT",T.POST="POST",T.DELETE="DELETE",T.TRACE="TRACE",T.CONNECT="CONNECT"}); +//# sourceMappingURL=HttpMethod.js.map diff --git a/dist/amd/System/Net/Http/HttpMethod.js.map b/dist/amd/System/Net/Http/HttpMethod.js.map new file mode 100644 index 00000000..faef35a1 --- /dev/null +++ b/dist/amd/System/Net/Http/HttpMethod.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Net/Http/HttpMethod.js","System/Net/Http/HttpMethod.ts"],"names":["define","require","exports","OPTIONS","HEAD","GET","PUT","POST","DELETE","TRACE","CONNECT"],"mappings":";;;;;AAKAA,QAAQ,UAAW,WAAY,SAAUC,EAASC,GAC9C,YCGHA,GAAAC,QAA0B,UAC1BD,EAAAE,KAA0B,OAC1BF,EAAAG,IAA0B,MAC1BH,EAAAI,IAA0B,MAC1BJ,EAAAK,KAA0B,OAC1BL,EAAAM,OAA0B,SAC1BN,EAAAO,MAA0B,QAC1BP,EAAAQ,QAA0B","file":"System/Net/Http/HttpMethod.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html\n */\ndefine([\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n exports.OPTIONS = 'OPTIONS', exports.HEAD = 'HEAD', exports.GET = 'GET', exports.PUT = 'PUT', exports.POST = 'POST', exports.DELETE = 'DELETE', exports.TRACE = 'TRACE', exports.CONNECT = 'CONNECT';\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html\r\n */\r\n\r\n///\r\n\r\nexport const\r\n\tOPTIONS:HttpMethodValue = 'OPTIONS',\r\n\tHEAD:HttpMethodValue = 'HEAD',\r\n\tGET:HttpMethodValue = 'GET',\r\n\tPUT:HttpMethodValue = 'PUT',\r\n\tPOST:HttpMethodValue = 'POST',\r\n\tDELETE:HttpMethodValue = 'DELETE',\r\n\tTRACE:HttpMethodValue = 'TRACE',\r\n\tCONNECT:HttpMethodValue = 'CONNECT';\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Net/Http/HttpRequestFactory.d.ts b/dist/amd/System/Net/Http/HttpRequestFactory.d.ts new file mode 100644 index 00000000..1342a0e0 --- /dev/null +++ b/dist/amd/System/Net/Http/HttpRequestFactory.d.ts @@ -0,0 +1,21 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import Uri from "../../Uri/Uri"; +import DisposableBase from "../../Disposable/DisposableBase"; +export default class HttpRequestFactory extends DisposableBase { + private _http; + protected _uriDefaults: Uri; + constructor(_http: IHttpRequestAdapter, uriDefaults?: string | IUri); + protected _onDispose(): void; + uri(uri: string | IUri): HttpRequestFactory; + params(params: QueryParamsConvertible): HttpRequestFactory; + request(method: HttpMethodValue, data?: any): IPromise; + get(): IPromise; + put(): IPromise; + post(data: any): IPromise; + 'delete'(): IPromise; +} diff --git a/dist/amd/System/Net/Http/HttpRequestFactory.js b/dist/amd/System/Net/Http/HttpRequestFactory.js new file mode 100644 index 00000000..5f0d03c4 --- /dev/null +++ b/dist/amd/System/Net/Http/HttpRequestFactory.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +var __extends=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};define(["require","exports","../../Exceptions/ArgumentNullException","../../Uri/Uri","../../Disposable/DisposableBase","./HttpMethod"],function(t,e,r,o,u,s){"use strict";var i=function(t){function e(e,u){if(t.call(this),this._http=e,this._disposableObjectName="HttpRequestFactory",!e)throw new r["default"]("_http");this._uriDefaults=o["default"].from(u)}return __extends(e,t),e.prototype._onDispose=function(){this._http=null,this._uriDefaults=null},e.prototype.uri=function(t){var r=this;r.throwIfDisposed();var u=o["default"].from(t,r._uriDefaults);return r._uriDefaults.equals(u)?r:new e(r._http,u)},e.prototype.params=function(t){var e=this;return e.throwIfDisposed(),e.uri(e._uriDefaults.updateQuery(t))},e.prototype.request=function(t,e){var r=this;return r.throwIfDisposed(),r._http.request({method:t,uri:r._uriDefaults,data:e})},e.prototype.get=function(){return this.request(s.GET)},e.prototype.put=function(){return this.request(s.PUT)},e.prototype.post=function(t){return this.request(s.POST,t)},e.prototype["delete"]=function(){return this.request(s.DELETE)},e}(u["default"]);Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i}); +//# sourceMappingURL=HttpRequestFactory.js.map diff --git a/dist/amd/System/Net/Http/HttpRequestFactory.js.map b/dist/amd/System/Net/Http/HttpRequestFactory.js.map new file mode 100644 index 00000000..b4cf2118 --- /dev/null +++ b/dist/amd/System/Net/Http/HttpRequestFactory.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Net/Http/HttpRequestFactory.js","System/Net/Http/HttpRequestFactory.ts"],"names":["__extends","this","d","b","__","constructor","p","hasOwnProperty","prototype","Object","create","define","require","exports","ArgumentNullException_1","Uri_1","DisposableBase_1","HttpMethod_1","HttpRequestFactory","_super","_http","uriDefaults","call","_disposableObjectName","_uriDefaults","from","_onDispose","uri","_","throwIfDisposed","u","equals","params","updateQuery","request","method","data","get","GET","put","PUT","post","POST","DELETE","defineProperty","value"],"mappings":";;;;AAIA,GAAIA,WAAaC,MAAQA,KAAKD,WAAc,SAAUE,EAAGC,GAErD,QAASC,KAAOH,KAAKI,YAAcH,EADnC,IAAK,GAAII,KAAKH,GAAOA,EAAEI,eAAeD,KAAIJ,EAAEI,GAAKH,EAAEG,GAEnDJ,GAAEM,UAAkB,OAANL,EAAaM,OAAOC,OAAOP,IAAMC,EAAGI,UAAYL,EAAEK,UAAW,GAAIJ,IAEnFO,SAAQ,UAAW,UAAW,yCAA0C,gBAAiB,kCAAmC,gBAAiB,SAAUC,EAASC,EAASC,EAAyBC,EAAOC,EAAkBC,GCF3N,YAWA,IAAAC,GAAA,SAAAC,GAKC,QAAAD,GACSE,EACRC,GAMA,GAJAF,EAAAG,KAAArB,MAHQA,KAAAmB,MAAAA,EAKRnB,KAAKsB,sBAAwB,sBAEzBH,EACH,KAAM,IAAIN,GAAAA,WAAsB,QAEjCb,MAAKuB,aAAeT,EAAAA,WAAIU,KAAKJ,GA2D/B,MA3EgDrB,WAAAkB,EAAAC,GAmBrCD,EAAAV,UAAAkB,WAAV,WAECzB,KAAKmB,MAAQ,KACbnB,KAAKuB,aAAe,MAGrBN,EAAAV,UAAAmB,IAAA,SAAIA,GAGH,GAAIC,GAAI3B,IACR2B,GAAEC,iBACF,IAAIC,GAAIf,EAAAA,WAAIU,KAAKE,EAAKC,EAAEJ,aACxB,OAAOI,GAAEJ,aAAaO,OAAOD,GAC1BF,EACA,GAAIV,GAAmBU,EAAER,MAAOU,IAGpCZ,EAAAV,UAAAwB,OAAA,SAAOA,GAEN,GAAIJ,GAAI3B,IAER,OADA2B,GAAEC,kBACKD,EAAED,IAAIC,EAAEJ,aAAaS,YAAYD,KAGzCd,EAAAV,UAAA0B,QAAA,SAAiBC,EAAwBC,GAExC,GAAIR,GAAI3B,IAER,OADA2B,GAAEC,kBACKD,EAAER,MAAMc,SACdC,OAAQA,EACRR,IAAKC,EAAEJ,aACPY,KAAMA,KAKRlB,EAAAV,UAAA6B,IAAA,WAEC,MAAOpC,MAAKiC,QAAiBjB,EAAAqB,MAG9BpB,EAAAV,UAAA+B,IAAA,WAEC,MAAOtC,MAAKiC,QAAiBjB,EAAAuB,MAG9BtB,EAAAV,UAAAiC,KAAA,SAAcL,GAEb,MAAOnC,MAAKiC,QAAiBjB,EAAAyB,KAAMN,IAGpClB,EAAAV,UAAA,UAAA,WAEC,MAAOP,MAAKiC,QAAiBjB,EAAA0B,SAG/BzB,GA3EgDF,EAAAA,WAAhDP,QAAAmC,eAAA/B,EAAA,cAAAgC,OAAA,ID4CIhC,EAAAA,WAAkBK","file":"System/Net/Http/HttpRequestFactory.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\ndefine([\"require\", \"exports\", \"../../Exceptions/ArgumentNullException\", \"../../Uri/Uri\", \"../../Disposable/DisposableBase\", \"./HttpMethod\"], function (require, exports, ArgumentNullException_1, Uri_1, DisposableBase_1, HttpMethod_1) {\n 'use strict';\n var HttpRequestFactory = (function (_super) {\n __extends(HttpRequestFactory, _super);\n function HttpRequestFactory(_http, uriDefaults) {\n _super.call(this);\n this._http = _http;\n this._disposableObjectName = 'HttpRequestFactory';\n if (!_http)\n throw new ArgumentNullException_1.default('_http');\n this._uriDefaults = Uri_1.default.from(uriDefaults);\n }\n HttpRequestFactory.prototype._onDispose = function () {\n this._http = null;\n this._uriDefaults = null;\n };\n HttpRequestFactory.prototype.uri = function (uri) {\n var _ = this;\n _.throwIfDisposed();\n var u = Uri_1.default.from(uri, _._uriDefaults);\n return _._uriDefaults.equals(u)\n ? _\n : new HttpRequestFactory(_._http, u);\n };\n HttpRequestFactory.prototype.params = function (params) {\n var _ = this;\n _.throwIfDisposed();\n return _.uri(_._uriDefaults.updateQuery(params));\n };\n HttpRequestFactory.prototype.request = function (method, data) {\n var _ = this;\n _.throwIfDisposed();\n return _._http.request({\n method: method,\n uri: _._uriDefaults,\n data: data\n });\n };\n HttpRequestFactory.prototype.get = function () {\n return this.request(HttpMethod_1.GET);\n };\n HttpRequestFactory.prototype.put = function () {\n return this.request(HttpMethod_1.PUT);\n };\n HttpRequestFactory.prototype.post = function (data) {\n return this.request(HttpMethod_1.POST, data);\n };\n HttpRequestFactory.prototype['delete'] = function () {\n return this.request(HttpMethod_1.DELETE);\n };\n return HttpRequestFactory;\n }(DisposableBase_1.default));\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = HttpRequestFactory;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n///\r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nimport ArgumentNullException from \"../../Exceptions/ArgumentNullException\";\r\nimport Uri from \"../../Uri/Uri\";\r\nimport DisposableBase from \"../../Disposable/DisposableBase\";\r\nimport QueryBuilder from \"../../Uri/QueryBuilder\";\r\nimport {GET, PUT, POST, DELETE} from \"./HttpMethod\";\r\n\r\n/**\r\n * This class exposes a factory for making requests to prepared uri and params.\r\n */\r\nexport default class HttpRequestFactory extends DisposableBase\r\n{\r\n\r\n\tprotected _uriDefaults:Uri;\r\n\r\n\tconstructor(\r\n\t\tprivate _http:IHttpRequestAdapter,\r\n\t\turiDefaults?:string|IUri)\r\n\t{\r\n\t\tsuper();\r\n\r\n\t\tthis._disposableObjectName = 'HttpRequestFactory';\r\n\r\n\t\tif(!_http)\r\n\t\t\tthrow new ArgumentNullException('_http');\r\n\r\n\t\tthis._uriDefaults = Uri.from(uriDefaults);\r\n\t}\r\n\r\n\tprotected _onDispose() {\r\n\t\t// super._onDispose(); // Not required for first level inheritance.\r\n\t\tthis._http = null;\r\n\t\tthis._uriDefaults = null;\r\n\t}\r\n\r\n\turi(uri:string|IUri):HttpRequestFactory\r\n\t{\r\n\r\n\t\tvar _ = this;\r\n\t\t_.throwIfDisposed();\r\n\t\tvar u = Uri.from(uri, _._uriDefaults);\r\n\t\treturn _._uriDefaults.equals(u)\r\n\t\t\t? _\r\n\t\t\t: new HttpRequestFactory(_._http, u);\r\n\t}\r\n\r\n\tparams(params:QueryParamsConvertible):HttpRequestFactory\r\n\t{\r\n\t\tvar _ = this;\r\n\t\t_.throwIfDisposed();\r\n\t\treturn _.uri(_._uriDefaults.updateQuery(params));\r\n\t}\r\n\r\n\trequest(method:HttpMethodValue, data?:any):IPromise\r\n\t{\r\n\t\tvar _ = this;\r\n\t\t_.throwIfDisposed();\r\n\t\treturn _._http.request({\r\n\t\t\tmethod: method,\r\n\t\t\turi: _._uriDefaults,\r\n\t\t\tdata: data\r\n\t\t});\r\n\t}\r\n\r\n\r\n\tget():IPromise\r\n\t{\r\n\t\treturn this.request(GET);\r\n\t}\r\n\r\n\tput():IPromise\r\n\t{\r\n\t\treturn this.request(PUT);\r\n\t}\r\n\r\n\tpost(data:any):IPromise\r\n\t{\r\n\t\treturn this.request(POST, data);\r\n\t}\r\n\r\n\t'delete'():IPromise\r\n\t{\r\n\t\treturn this.request(DELETE);\r\n\t}\r\n\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Observable/ObservableBase.d.ts b/dist/amd/System/Observable/ObservableBase.d.ts new file mode 100644 index 00000000..050d9f79 --- /dev/null +++ b/dist/amd/System/Observable/ObservableBase.d.ts @@ -0,0 +1,15 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +import SubscribableBase from "./SubscribableBase"; +declare abstract class ObservableBase extends SubscribableBase> implements IObservable { + protected _onNext(value: T): void; + protected _onError(error: Error): void; + protected _onCompleted(): void; +} +export default ObservableBase; diff --git a/dist/amd/System/Observable/ObservableNodeBase.d.ts b/dist/amd/System/Observable/ObservableNodeBase.d.ts new file mode 100644 index 00000000..420a0dbc --- /dev/null +++ b/dist/amd/System/Observable/ObservableNodeBase.d.ts @@ -0,0 +1,14 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +import ObservableBase from "./ObservableBase"; +export default class ObservableNodeBase extends ObservableBase implements IObserver { + onNext(value: T): void; + onError(error: Error): void; + onCompleted(): void; +} diff --git a/dist/amd/System/Observable/SubscribableBase.d.ts b/dist/amd/System/Observable/SubscribableBase.d.ts new file mode 100644 index 00000000..5de54bfc --- /dev/null +++ b/dist/amd/System/Observable/SubscribableBase.d.ts @@ -0,0 +1,19 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +export default class SubscribableBase implements IDisposable { + private __subscriptions; + protected _getSubscribers(): TSubscriber[]; + constructor(); + private _findEntryNode(subscriber); + subscribe(subscriber: TSubscriber): IDisposable; + unsubscribe(subscriber: TSubscriber): void; + protected _unsubscribeAll(returnSubscribers?: boolean): TSubscriber[]; + unsubscribeAll(): void; + dispose(): void; +} diff --git a/dist/amd/System/Observable/Subscription.d.ts b/dist/amd/System/Observable/Subscription.d.ts new file mode 100644 index 00000000..ad70893a --- /dev/null +++ b/dist/amd/System/Observable/Subscription.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +export default class Subscription implements IDisposableAware { + private _subscribable; + private _subscriber; + constructor(_subscribable: ISubscribable, _subscriber: T); + subscriber: T; + wasDisposed: boolean; + dispose(): void; +} diff --git a/dist/amd/System/Serialization/Utility.d.ts b/dist/amd/System/Serialization/Utility.d.ts new file mode 100644 index 00000000..f53d368c --- /dev/null +++ b/dist/amd/System/Serialization/Utility.d.ts @@ -0,0 +1,9 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function toString(value: Primitive | ISerializable, defaultForUnknown?: string): string; +export declare function isSerializable(instance: any): instance is ISerializable; +export declare function toPrimitive(value: string, caseInsensitive?: boolean, unknownHandler?: (v: string) => string): Primitive; diff --git a/dist/amd/System/Tasks/TaskHandler.d.ts b/dist/amd/System/Tasks/TaskHandler.d.ts new file mode 100644 index 00000000..750d1dd3 --- /dev/null +++ b/dist/amd/System/Tasks/TaskHandler.d.ts @@ -0,0 +1,12 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TaskHandlerBase from "./TaskHandlerBase"; +export default class TaskHandler extends TaskHandlerBase { + private _action; + constructor(_action: Closure); + protected _onExecute(): void; + protected _onDispose(): void; +} diff --git a/dist/amd/System/Tasks/TaskHandlerBase.d.ts b/dist/amd/System/Tasks/TaskHandlerBase.d.ts new file mode 100644 index 00000000..c3945286 --- /dev/null +++ b/dist/amd/System/Tasks/TaskHandlerBase.d.ts @@ -0,0 +1,17 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +declare abstract class TaskHandlerBase extends DisposableBase implements ICancellable { + constructor(); + protected _id: any; + isScheduled: boolean; + execute(defer?: number): void; + private static _handler(d); + protected abstract _onExecute(): void; + protected _onDispose(): void; + cancel(): boolean; +} +export default TaskHandlerBase; diff --git a/dist/amd/System/Tasks/defer.d.ts b/dist/amd/System/Tasks/defer.d.ts new file mode 100644 index 00000000..2b37b77f --- /dev/null +++ b/dist/amd/System/Tasks/defer.d.ts @@ -0,0 +1,7 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function defer(task: Closure, delay?: number): ICancellable; +export declare function interval(task: Function, interval: number, count?: number): ICancellable; diff --git a/dist/amd/System/Tasks/deferImmediate.d.ts b/dist/amd/System/Tasks/deferImmediate.d.ts new file mode 100644 index 00000000..9c479d18 --- /dev/null +++ b/dist/amd/System/Tasks/deferImmediate.d.ts @@ -0,0 +1,8 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on code from: https://github.com/kriskowal/q + */ +export default function deferImmediate(task: Closure): ICancellable; +export declare function runAfterDeferred(task: Closure): void; diff --git a/dist/amd/System/Text/RegexMatchEnumerator.d.ts b/dist/amd/System/Text/RegexMatchEnumerator.d.ts new file mode 100644 index 00000000..90c0d0d9 --- /dev/null +++ b/dist/amd/System/Text/RegexMatchEnumerator.d.ts @@ -0,0 +1,14 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import { Regex, Match } from "./RegularExpressions"; +export declare class RegexMatchEnumerator { + private _pattern; + constructor(pattern: string | RegExp | Regex); + matches(input: string): IEnumerator; + static matches(input: string, pattern: string | RegExp | Regex): IEnumerator; +} +declare var _default: typeof RegexMatchEnumerator.matches; +export default _default; diff --git a/dist/amd/System/Text/RegularExpressions.d.ts b/dist/amd/System/Text/RegularExpressions.d.ts new file mode 100644 index 00000000..af3b1fbd --- /dev/null +++ b/dist/amd/System/Text/RegularExpressions.d.ts @@ -0,0 +1,62 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Named groups based on: http://trentrichardson.com/2011/08/02/javascript-regexp-match-named-captures/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare module RegexOptions { + const IGNORE_CASE: string; + const I: string; + const GLOBAL: string; + const G: string; + const MULTI_LINE: string; + const M: string; + const UNICODE: string; + const U: string; + const STICKY: string; + const Y: string; + const IGNORE_PATTERN_WHITESPACE: string; + const W: string; + type Global = 'g'; + type IgnoreCase = 'i'; + type MultiLine = 'm'; + type Unicode = 'u'; + type Sticky = 'y'; + type IgnorePatternWhitespace = "w"; + type Literal = Global | IgnoreCase | MultiLine | Unicode | Sticky | IgnorePatternWhitespace; +} +export interface MatchEvaluator extends Selector { +} +export declare class Regex { + private _re; + private _keys; + constructor(pattern: string | RegExp, options?: RegexOptions.Literal | RegexOptions.Literal[], ...extra: RegexOptions.Literal[]); + match(input: string, startIndex?: number): Match; + matches(input: string): Match[]; + replace(input: string, replacement: Primitive, count?: number): string; + replace(input: string, evaluator: MatchEvaluator, count?: number): string; + isMatch(input: string): boolean; + static isMatch(input: string, pattern: string, options?: RegexOptions.Literal[]): boolean; + static replace(input: string, pattern: string, replacement: string, options?: RegexOptions.Literal[]): string; + static replace(input: string, pattern: string, evaluator: MatchEvaluator, options?: RegexOptions.Literal[]): string; +} +export declare class Capture { + value: string; + index: number; + length: number; + constructor(value?: string, index?: number); + freeze(): void; +} +export declare class Group extends Capture { + success: boolean; + constructor(value?: string, index?: number); + static Empty: Group; +} +export declare class Match extends Group { + groups: Group[]; + namedGroups: IMap; + constructor(value?: string, index?: number, groups?: Group[], namedGroups?: IMap); + freeze(): void; + static Empty: Match; +} +export default Regex; diff --git a/dist/amd/System/Text/StringBuilder.d.ts b/dist/amd/System/Text/StringBuilder.d.ts new file mode 100644 index 00000000..72f52b4c --- /dev/null +++ b/dist/amd/System/Text/StringBuilder.d.ts @@ -0,0 +1,21 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * .NET Reference: http://referencesource.microsoft.com/#mscorlib/system/text/StringBuilder.cs + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class StringBuilder implements IDisposable { + private _partArray; + private _latest; + constructor(...initial: any[]); + private appendSingle(item); + appendThese(items: any[]): StringBuilder; + append(...items: any[]): StringBuilder; + appendLine(...items: any[]): StringBuilder; + appendLines(items: any[]): StringBuilder; + isEmpty: boolean; + toString(): string; + join(delimiter: string): string; + clear(): void; + dispose(): void; +} diff --git a/dist/amd/System/Text/Utility.d.ts b/dist/amd/System/Text/Utility.d.ts new file mode 100644 index 00000000..324fdfb2 --- /dev/null +++ b/dist/amd/System/Text/Utility.d.ts @@ -0,0 +1,17 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare const EMPTY: string; +export declare function getHashCode(source: string): number; +export declare function repeat(source: string, count: number): string; +export declare function fromChars(ch: number, count: number): string; +export declare function fromChars(chars: number[]): string; +export declare function escapeRegExp(source: string): string; +export declare function trim(source: string, chars?: string | string[], ignoreCase?: boolean): string; +export declare function format(source: string, ...args: any[]): string; +export declare function supplant(source: string, params: { + [key: string]: any; +} | any[]): string; +export declare function startsWith(source: string, pattern: string): boolean; +export declare function endsWith(source: string, pattern: string): boolean; diff --git a/dist/amd/System/Time/ClockTime.d.ts b/dist/amd/System/Time/ClockTime.d.ts new file mode 100644 index 00000000..6b784e0f --- /dev/null +++ b/dist/amd/System/Time/ClockTime.d.ts @@ -0,0 +1,22 @@ +/// +/// +/// +/// +/// +/// +/// +/// +import TimeQuantity from './TimeQuantity'; +export default class ClockTime extends TimeQuantity implements IClockTime { + days: number; + hour: number; + minute: number; + second: number; + millisecond: number; + tick: number; + constructor(milliseconds: number); + constructor(hours: number, minutes: number, seconds?: number, milliseconds?: number); + static from(hours: number, minutes: number, seconds?: number, milliseconds?: number): ClockTime; + static millisecondsFromTime(hours: number, minutes: number, seconds?: number, milliseconds?: number): number; + toString(): string; +} diff --git a/dist/amd/System/Time/DateTime.d.ts b/dist/amd/System/Time/DateTime.d.ts new file mode 100644 index 00000000..1938ac1e --- /dev/null +++ b/dist/amd/System/Time/DateTime.d.ts @@ -0,0 +1,57 @@ +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based on .NET DateTime's interface. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ClockTime from './ClockTime'; +import TimeSpan from './TimeSpan'; +declare class DateTime implements ICalendarDate, IDateTime { + private _value; + toJsDate(): Date; + private _setJsDate(value); + constructor(); + constructor(dateString: string, kind?: DateTime.Kind); + constructor(milliseconds: number, kind?: DateTime.Kind); + constructor(source: Date, kind?: DateTime.Kind); + constructor(source: DateTime, kind?: DateTime.Kind); + private _kind; + kind: DateTime.Kind; + year: number; + month: Gregorian.Month; + day: number; + dayOfWeek: Gregorian.DayOfWeek; + addMilliseconds(ms: number): DateTime; + addSeconds(seconds: number): DateTime; + addMinutes(minutes: number): DateTime; + addHours(hours: number): DateTime; + addDays(days: number): DateTime; + addMonths(months: number): DateTime; + addYears(years: number): DateTime; + add(time: ITimeQuantity): DateTime; + subtract(time: ITimeQuantity): DateTime; + timePassedSince(previous: Date | DateTime): TimeSpan; + date: DateTime; + private _time; + timeOfDay: ClockTime; + toTimeStamp(): ITimeStamp; + static now: DateTime; + toUniversalTime: DateTime; + static today: DateTime; + static tomorrow: DateTime; + static between(first: Date | DateTime, last: Date | DateTime): TimeSpan; + static isLeapYear(year: number): boolean; + static daysInMonth(year: number, month: Gregorian.Month): number; +} +declare module DateTime { + const enum Kind { + Unspecified = 0, + Local = 1, + Utc = 2, + } +} +export default DateTime; diff --git a/dist/amd/System/Time/DateTime.js b/dist/amd/System/Time/DateTime.js new file mode 100644 index 00000000..922bd8a8 --- /dev/null +++ b/dist/amd/System/Time/DateTime.js @@ -0,0 +1,7 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Based on .NET DateTime's interface. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +define(["require","exports","./ClockTime","./TimeSpan","./TimeStamp"],function(e,t,n,r,o){"use strict";var i=function(){function e(t,n){void 0===t&&(t=new Date),void 0===n&&(n=1);var r=this;r._kind=n,t instanceof e?r._value=t.toJsDate():t instanceof Date?r._setJsDate(t):r._value=void 0===t?new Date:new Date(t)}return e.prototype.toJsDate=function(){return new Date(this._value.getTime())},e.prototype._setJsDate=function(e){this._time=null,this._value=new Date(e.getTime())},Object.defineProperty(e.prototype,"kind",{get:function(){return this._kind},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"year",{get:function(){return this._value.getFullYear()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"month",{get:function(){return this._value.getMonth()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"day",{get:function(){return this._value.getDate()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dayOfWeek",{get:function(){return this._value.getDay()},enumerable:!0,configurable:!0}),e.prototype.addMilliseconds=function(t){return t=t||0,new e(this._value.getTime()+t,this._kind)},e.prototype.addSeconds=function(e){return e=e||0,this.addMilliseconds(1e3*e)},e.prototype.addMinutes=function(e){return e=e||0,this.addMilliseconds(6e4*e)},e.prototype.addHours=function(e){return e=e||0,this.addMilliseconds(36e5*e)},e.prototype.addDays=function(e){return e=e||0,this.addMilliseconds(864e5*e)},e.prototype.addMonths=function(t){t=t||0;var n=this.toJsDate();return n.setMonth(n.getMonth()+t),new e(n,this._kind)},e.prototype.addYears=function(t){t=t||0;var n=this.toJsDate();return n.setFullYear(n.getFullYear()+t),new e(n,this._kind)},e.prototype.add=function(e){return this.addMilliseconds(e.getTotalMilliseconds())},e.prototype.subtract=function(e){return this.addMilliseconds(-e.getTotalMilliseconds())},e.prototype.timePassedSince=function(t){return e.between(t,this)},Object.defineProperty(e.prototype,"date",{get:function(){var t=this;return new e(new Date(t.year,t.month,t.day),t._kind)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"timeOfDay",{get:function(){var e=this,t=e._time;if(!t){var r=this._value;e._time=t=new n["default"](r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds())}return t},enumerable:!0,configurable:!0}),e.prototype.toTimeStamp=function(){return o["default"].from(this)},Object.defineProperty(e,"now",{get:function(){return new e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"toUniversalTime",{get:function(){var t=this;if(1!=t._kind)return new e(t,t._kind);var n=t._value;return new e(new Date(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds()),2)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"today",{get:function(){return e.now.date},enumerable:!0,configurable:!0}),Object.defineProperty(e,"tomorrow",{get:function(){var t=e.today;return t.addDays(1)},enumerable:!0,configurable:!0}),e.between=function(t,n){var o=t instanceof e?t._value:t,i=n instanceof e?n._value:n;return new r["default"](o.getTime()-i.getTime())},e.isLeapYear=function(e){return e%4==0&&e%100!=0||e%400==0},e.daysInMonth=function(e,t){return new Date(e,t+1,0).getDate()},e}();Object.freeze(i),Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=i}); +//# sourceMappingURL=DateTime.js.map diff --git a/dist/amd/System/Time/DateTime.js.map b/dist/amd/System/Time/DateTime.js.map new file mode 100644 index 00000000..4136558a --- /dev/null +++ b/dist/amd/System/Time/DateTime.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Time/DateTime.js","System/Time/DateTime.ts"],"names":["define","require","exports","ClockTime_1","TimeSpan_1","TimeStamp_1","DateTime","value","kind","Date","_","this","_kind","_value","toJsDate","_setJsDate","prototype","getTime","_time","Object","defineProperty","get","enumerable","configurable","getFullYear","getMonth","getDate","getDay","addMilliseconds","ms","addSeconds","seconds","addMinutes","minutes","addHours","hours","addDays","days","addMonths","months","d","setMonth","addYears","years","setFullYear","add","time","getTotalMilliseconds","subtract","timePassedSince","previous","between","year","month","day","t","getHours","getMinutes","getSeconds","getMilliseconds","toTimeStamp","from","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","now","date","today","first","last","f","l","isLeapYear","daysInMonth","freeze"],"mappings":";;;;;AAKAA,QAAQ,UAAW,UAAW,cAAe,aAAc,eAAgB,SAAUC,EAASC,EAASC,EAAaC,EAAYC,GCMhI,YAQA,IAAAC,GAAA,WAoBC,QAAAA,GAAYC,EAAwBC,GAAxB,SAAAD,IAAAA,EAAA,GAAgBE,OAAQ,SAAAD,IAAAA,EAAA,EAEnC,IAAIE,GAAIC,IACRD,GAAEE,MAAQJ,EACPD,YAAiBD,GACnBI,EAAEG,OAASN,EAAMO,WACVP,YAAiBE,MACxBC,EAAEK,WAAWR,GAEbG,EAAEG,OAAiB,SAARN,EACR,GAAIE,MACJ,GAAIA,MAAKF,GAuPf,MAlRCD,GAAAU,UAAAF,SAAA,WAEC,MAAO,IAAIL,MAAKE,KAAKE,OAAOI,YAGrBX,EAAAU,UAAAD,WAAR,SAAmBR,GAElBI,KAAKO,MAAQ,KACbP,KAAKE,OAAS,GAAIJ,MAAKF,EAAMU,YAuB9BE,OAAAC,eAAId,EAAAU,UAAA,QDxBOK,ICwBX,WAEC,MAAOV,MAAKC,ODvBFU,YAAY,EACZC,cAAc,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IDhGS9C,YAAY,EACZC,cAAc,ICuGzBJ,OAAAC,eAAWd,EAAA,SDpGAe,ICoGX,WAEC,MAAOf,GAAS+D,IAAIC,MDnGVhD,YAAY,EACZC,cAAc,ICyGzBJ,OAAAC,eAAWd,EAAA,YDtGAe,ICsGX,WAEC,GAAIkD,GAAiBjE,EAASiE,KAC9B,OAAOA,GAAMnC,QAAQ,IDrGXd,YAAY,EACZC,cAAc,IC4GlBjB,EAAA6C,QAAP,SAAeqB,EAAqBC,GAEnC,GAAIC,GAASF,YAAiBlE,GAAWkE,EAAM3D,OAAe2D,EAC1DG,EAASF,YAAgBnE,GAAWmE,EAAK5D,OAAe4D,CAE5D,OAAO,IAAIrE,GAAAA,WAASsE,EAAEzD,UAAY0D,EAAE1D,YAS9BX,EAAAsE,WAAP,SAAkBxB,GACjB,MAASA,GAAO,GAAK,GAAOA,EAAO,KAAO,GAAQA,EAAO,KAAO,GAS1D9C,EAAAuE,YAAP,SAAmBzB,EAAaC,GAE/B,MAAO,IAAK5C,MAAK2C,EAAKC,EAAM,EAAE,GAAI3B,WAIpCpB,IAYAa,QAAO2D,OAAOxE,GAEda,OAAAC,eAAAlB,EAAA,cAAAK,OAAA,IDxIIL,EAAAA,WCwIWI","file":"System/Time/DateTime.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Based on .NET DateTime's interface.\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\ndefine([\"require\", \"exports\", './ClockTime', './TimeSpan', './TimeStamp'], function (require, exports, ClockTime_1, TimeSpan_1, TimeStamp_1) {\n 'use strict';\n var DateTime = (function () {\n function DateTime(value, kind) {\n if (value === void 0) { value = new Date(); }\n if (kind === void 0) { kind = 1; }\n var _ = this;\n _._kind = kind;\n if (value instanceof DateTime)\n _._value = value.toJsDate();\n else if (value instanceof Date)\n _._setJsDate(value);\n else\n _._value = value === void (0)\n ? new Date()\n : new Date(value);\n }\n DateTime.prototype.toJsDate = function () {\n return new Date(this._value.getTime());\n };\n DateTime.prototype._setJsDate = function (value) {\n this._time = null;\n this._value = new Date(value.getTime());\n };\n Object.defineProperty(DateTime.prototype, \"kind\", {\n get: function () {\n return this._kind;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTime.prototype, \"year\", {\n get: function () {\n return this._value.getFullYear();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTime.prototype, \"month\", {\n get: function () {\n return this._value.getMonth();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTime.prototype, \"day\", {\n get: function () {\n return this._value.getDate();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTime.prototype, \"dayOfWeek\", {\n get: function () {\n return this._value.getDay();\n },\n enumerable: true,\n configurable: true\n });\n DateTime.prototype.addMilliseconds = function (ms) {\n ms = ms || 0;\n return new DateTime(this._value.getTime() + ms, this._kind);\n };\n DateTime.prototype.addSeconds = function (seconds) {\n seconds = seconds || 0;\n return this.addMilliseconds(seconds * 1000);\n };\n DateTime.prototype.addMinutes = function (minutes) {\n minutes = minutes || 0;\n return this.addMilliseconds(minutes * 60000);\n };\n DateTime.prototype.addHours = function (hours) {\n hours = hours || 0;\n return this.addMilliseconds(hours * 3600000);\n };\n DateTime.prototype.addDays = function (days) {\n days = days || 0;\n return this.addMilliseconds(days * 86400000);\n };\n DateTime.prototype.addMonths = function (months) {\n months = months || 0;\n var d = this.toJsDate();\n d.setMonth(d.getMonth() + months);\n return new DateTime(d, this._kind);\n };\n DateTime.prototype.addYears = function (years) {\n years = years || 0;\n var d = this.toJsDate();\n d.setFullYear(d.getFullYear() + years);\n return new DateTime(d, this._kind);\n };\n DateTime.prototype.add = function (time) {\n return this.addMilliseconds(time.getTotalMilliseconds());\n };\n DateTime.prototype.subtract = function (time) {\n return this.addMilliseconds(-time.getTotalMilliseconds());\n };\n DateTime.prototype.timePassedSince = function (previous) {\n return DateTime.between(previous, this);\n };\n Object.defineProperty(DateTime.prototype, \"date\", {\n get: function () {\n var _ = this;\n return new DateTime(new Date(_.year, _.month, _.day), _._kind);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTime.prototype, \"timeOfDay\", {\n get: function () {\n var _ = this, t = _._time;\n if (!t) {\n var d = this._value;\n _._time = t = new ClockTime_1.default(d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());\n }\n return t;\n },\n enumerable: true,\n configurable: true\n });\n DateTime.prototype.toTimeStamp = function () {\n return TimeStamp_1.default.from(this);\n };\n Object.defineProperty(DateTime, \"now\", {\n get: function () {\n return new DateTime();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTime.prototype, \"toUniversalTime\", {\n get: function () {\n var _ = this;\n if (_._kind != 1)\n return new DateTime(_, _._kind);\n var d = _._value;\n return new DateTime(new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds()), 2);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTime, \"today\", {\n get: function () {\n return DateTime.now.date;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DateTime, \"tomorrow\", {\n get: function () {\n var today = DateTime.today;\n return today.addDays(1);\n },\n enumerable: true,\n configurable: true\n });\n DateTime.between = function (first, last) {\n var f = first instanceof DateTime ? first._value : first, l = last instanceof DateTime ? last._value : last;\n return new TimeSpan_1.default(f.getTime() - l.getTime());\n };\n DateTime.isLeapYear = function (year) {\n return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);\n };\n DateTime.daysInMonth = function (year, month) {\n return (new Date(year, month + 1, 0)).getDate();\n };\n return DateTime;\n }());\n Object.freeze(DateTime);\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = DateTime;\n});\n","///\r\n///\r\n///\r\n///\r\n///\r\n/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Based on .NET DateTime's interface.\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nimport Type from '../Types';\r\nimport ClockTime from './ClockTime';\r\nimport TimeSpan from './TimeSpan';\r\nimport TimeStamp from './TimeStamp';\r\n\r\n\r\nclass DateTime implements ICalendarDate, IDateTime\r\n{\r\n\tprivate _value:Date;\r\n\r\n\ttoJsDate():Date\r\n\t{\r\n\t\treturn new Date(this._value.getTime()); // return a clone.\r\n\t}\r\n\r\n\tprivate _setJsDate(value:Date)\r\n\t{\r\n\t\tthis._time = null;\r\n\t\tthis._value = new Date(value.getTime());\r\n\t}\r\n\r\n\tconstructor();\r\n\tconstructor(dateString:string, kind?:DateTime.Kind);\r\n\tconstructor(milliseconds:number, kind?:DateTime.Kind);\r\n\tconstructor(source:Date, kind?:DateTime.Kind);\r\n\tconstructor(source:DateTime, kind?:DateTime.Kind);\r\n\tconstructor(value:any = new Date(), kind:DateTime.Kind = DateTime.Kind.Local)\r\n\t{\r\n\t\tvar _ = this;\r\n\t\t_._kind = kind;\r\n\t\tif(value instanceof DateTime)\r\n\t\t\t_._value = value.toJsDate();\r\n\t\telse if(value instanceof Date)\r\n\t\t\t_._setJsDate(value);\r\n\t\telse\r\n\t\t\t_._value = value===void(0)\r\n\t\t\t\t? new Date()\r\n\t\t\t\t: new Date(value);\r\n\t}\r\n\r\n\tprivate _kind:DateTime.Kind;\r\n\tget kind():DateTime.Kind\r\n\t{\r\n\t\treturn this._kind;\r\n\t}\r\n\r\n\tget year():number\r\n\t{\r\n\t\treturn this._value.getFullYear();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the Gregorian Month (zero indexed).\r\n\t * @returns {number}\r\n\t */\r\n\tget month():Gregorian.Month\r\n\t{\r\n\t\treturn this._value.getMonth();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the day of the month. An integer between 1 and 31.\r\n\t * @returns {number}\r\n\t */\r\n\tget day():number\r\n\t{\r\n\t\treturn this._value.getDate();\r\n\t}\r\n\r\n\tget dayOfWeek():Gregorian.DayOfWeek\r\n\t{\r\n\t\treturn this._value.getDay();\r\n\t}\r\n\r\n\r\n\taddMilliseconds(ms:number):DateTime\r\n\t{\r\n\t\tms = ms || 0;\r\n\t\treturn new DateTime(this._value.getTime() + ms, this._kind);\r\n\t}\r\n\r\n\taddSeconds(seconds:number):DateTime\r\n\t{\r\n\t\tseconds = seconds || 0;\r\n\t\treturn this.addMilliseconds(seconds*HowMany.Milliseconds.Per.Second);\r\n\t}\r\n\r\n\taddMinutes(minutes:number):DateTime\r\n\t{\r\n\t\tminutes = minutes || 0;\r\n\t\treturn this.addMilliseconds(minutes*HowMany.Milliseconds.Per.Minute);\r\n\t}\r\n\r\n\taddHours(hours:number):DateTime\r\n\t{\r\n\t\thours = hours || 0;\r\n\t\treturn this.addMilliseconds(hours*HowMany.Milliseconds.Per.Hour);\r\n\t}\r\n\r\n\taddDays(days:number):DateTime\r\n\t{\r\n\t\tdays = days || 0;\r\n\t\treturn this.addMilliseconds(days*HowMany.Milliseconds.Per.Day);\r\n\t}\r\n\r\n\taddMonths(months:number):DateTime\r\n\t{\r\n\t\tmonths = months || 0;\r\n\t\tvar d = this.toJsDate();\r\n\t\td.setMonth(d.getMonth()+months);\r\n\t\treturn new DateTime(d, this._kind);\r\n\t}\r\n\r\n\taddYears(years:number):DateTime\r\n\t{\r\n\t\tyears = years || 0;\r\n\t\tvar d = this.toJsDate();\r\n\t\td.setFullYear(d.getFullYear()+years);\r\n\t\treturn new DateTime(d, this._kind);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Receives an ITimeQuantity value and adds based on the total milliseconds.\r\n\t * @param {ITimeQuantity} time\r\n\t * @returns {DateTime}\r\n\t */\r\n\tadd(time:ITimeQuantity):DateTime\r\n\t{\r\n\t\treturn this.addMilliseconds(time.getTotalMilliseconds());\r\n\t}\r\n\r\n\t/**\r\n\t * Receives an ITimeQuantity value and subtracts based on the total milliseconds.\r\n\t * @param {ITimeQuantity} time\r\n\t * @returns {DateTime}\r\n\t */\r\n\tsubtract(time:ITimeQuantity):DateTime\r\n\t{\r\n\t\treturn this.addMilliseconds(-time.getTotalMilliseconds());\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a TimeSpan representing the amount of time between two dates.\r\n\t * @param previous\r\n\t * @returns {TimeSpan}\r\n\t */\r\n\ttimePassedSince(previous:Date|DateTime):TimeSpan\r\n\t{\r\n\t\treturn DateTime.between(previous, this);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a DateTime object for 00:00 of this date.\r\n\t */\r\n\tget date():DateTime\r\n\t{\r\n\t\tvar _ = this;\r\n\t\treturn new DateTime(\r\n\t\t\tnew Date(\r\n\t\t\t\t_.year,\r\n\t\t\t\t_.month,\r\n\t\t\t\t_.day\r\n\t\t\t)\r\n\t\t\t, _._kind\r\n\t\t);\r\n\t}\r\n\r\n\tprivate _time:ClockTime;\r\n\r\n\t/**\r\n\t * Returns the time of day represented by a ClockTime object.\r\n\t * @returns {ClockTime}\r\n\t */\r\n\tget timeOfDay():ClockTime\r\n\t{\r\n\t\tvar _ = this, t = _._time;\r\n\t\tif(!t)\r\n\t\t{\r\n\t\t\tvar d = this._value;\r\n\t\t\t_._time = t = new ClockTime(\r\n\t\t\t\td.getHours(),\r\n\t\t\t\td.getMinutes(),\r\n\t\t\t\td.getSeconds(),\r\n\t\t\t\td.getMilliseconds());\r\n\t\t}\r\n\t\treturn t;\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a readonly object which contains all the date and time components.\r\n\t */\r\n\ttoTimeStamp():ITimeStamp {\r\n\t\treturn TimeStamp.from(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the now local time.\r\n\t * @returns {DateTime}\r\n\t */\r\n\tstatic get now():DateTime\r\n\t{\r\n\t\treturn new DateTime();\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a UTC version of this date if its kind is local.\r\n\t * @returns {DateTime}\r\n\t */\r\n\tget toUniversalTime():DateTime\r\n\t{\r\n\t\tvar _ = this;\r\n\t\tif(_._kind!=DateTime.Kind.Local)\r\n\t\t\treturn new DateTime(_, _._kind);\r\n\r\n\t\tvar d = _._value;\r\n\t\treturn new DateTime(\r\n\t\t\tnew Date(\r\n\t\t\t\td.getUTCFullYear(),\r\n\t\t\t\td.getUTCMonth(),\r\n\t\t\t\td.getUTCDate(),\r\n\t\t\t\td.getUTCHours(),\r\n\t\t\t\td.getUTCMinutes(),\r\n\t\t\t\td.getUTCSeconds(),\r\n\t\t\t\td.getUTCMilliseconds()\r\n\t\t\t),\r\n\t\t\tDateTime.Kind.Utc\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * The date component for now.\r\n\t * @returns {DateTime}\r\n\t */\r\n\tstatic get today():DateTime\r\n\t{\r\n\t\treturn DateTime.now.date;\r\n\t}\r\n\r\n\t/**\r\n\t * Midnight tomorrow.\r\n\t * @returns {DateTime}\r\n\t */\r\n\tstatic get tomorrow():DateTime\r\n\t{\r\n\t\tvar today:DateTime = DateTime.today;\r\n\t\treturn today.addDays(1);\r\n\t}\r\n\r\n\t/**\r\n\t * Measures the difference between two dates as a TimeSpan.\r\n\t * @param first\r\n\t * @param last\r\n\t */\r\n\tstatic between(first:Date|DateTime, last:Date|DateTime):TimeSpan\r\n\t{\r\n\t\tvar f:Date = first instanceof DateTime ? first._value : first,\r\n\t\t l:Date = last instanceof DateTime ? last._value : last;\r\n\r\n\t\treturn new TimeSpan(f.getTime() - l.getTime());\r\n\t}\r\n\r\n\t/**\r\n\t * Calculates if the given year is a leap year using the formula:\r\n\t * ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)\r\n\t * @param year\r\n\t * @returns {boolean}\r\n\t */\r\n\tstatic isLeapYear(year:number):boolean {\r\n\t\treturn ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the number of days for the specific year and month.\r\n\t * @param year\r\n\t * @param month\r\n\t * @returns {any}\r\n\t */\r\n\tstatic daysInMonth(year:number, month:Gregorian.Month):number {\r\n\t\t// Basically, add 1 month, subtract a day... What's the date?\r\n\t\treturn (new Date(year,month+1,0)).getDate();\r\n\t}\r\n\r\n\r\n}\r\n\r\n// Extend DateTime's usefulness.\r\nmodule DateTime\r\n{\r\n\texport const enum Kind {\r\n\t\tUnspecified,\r\n\t\tLocal,\r\n\t\tUtc,\r\n\t}\r\n}\r\n\r\nObject.freeze(DateTime);\r\n\r\nexport default DateTime;\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Time/HowMany.d.ts b/dist/amd/System/Time/HowMany.d.ts new file mode 100644 index 00000000..314a22e2 --- /dev/null +++ b/dist/amd/System/Time/HowMany.d.ts @@ -0,0 +1,41 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare module HowMany { + module Hours { + const enum Per { + Day = 24, + } + } + module Minutes { + const enum Per { + Hour = 60, + Day = 1440, + } + } + module Seconds { + const enum Per { + Minute = 60, + Hour = 3600, + Day = 86400, + } + } + module Milliseconds { + const enum Per { + Second = 1000, + Minute = 60000, + Hour = 3600000, + Day = 86400000, + } + } + module Ticks { + const enum Per { + Millisecond = 10000, + Second = 10000000, + Minute = 600000000, + Hour = 36000000000, + Day = 864000000000, + } + } +} diff --git a/dist/amd/System/Time/TimeQuantity.d.ts b/dist/amd/System/Time/TimeQuantity.d.ts new file mode 100644 index 00000000..72165b97 --- /dev/null +++ b/dist/amd/System/Time/TimeQuantity.d.ts @@ -0,0 +1,20 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeUnit from './TimeUnit'; +export default class TimeQuantity implements IEquatable, IComparable, ITimeQuantity { + protected _quantity: number; + constructor(_quantity?: number); + getTotalMilliseconds(): number; + direction: number; + equals(other: ITimeQuantity): boolean; + compareTo(other: ITimeQuantity): number; + protected _total: ITimeMeasurement; + total: ITimeMeasurement; + getTotal(units: TimeUnit): number; +} diff --git a/dist/amd/System/Time/TimeSpan.d.ts b/dist/amd/System/Time/TimeSpan.d.ts new file mode 100644 index 00000000..6a5c122a --- /dev/null +++ b/dist/amd/System/Time/TimeSpan.d.ts @@ -0,0 +1,34 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Originally based upon .NET source but with many additions and improvements. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeUnit from './TimeUnit'; +import ClockTime from './ClockTime'; +import TimeQuantity from './TimeQuantity'; +export default class TimeSpan extends TimeQuantity implements ITimeMeasurement { + ticks: number; + milliseconds: number; + seconds: number; + minutes: number; + hours: number; + days: number; + constructor(value: number, units?: TimeUnit); + total: TimeSpan; + private _time; + time: ClockTime; + add(other: ITimeQuantity): TimeSpan; + addUnit(value: number, units?: TimeUnit): TimeSpan; + static from(value: number, units: TimeUnit): TimeSpan; + static fromDays(value: number): TimeSpan; + static fromHours(value: number): TimeSpan; + static fromMinutes(value: number): TimeSpan; + static fromSeconds(value: number): TimeSpan; + static fromMilliseconds(value: number): TimeSpan; + static fromTicks(value: number): TimeSpan; + static zero: TimeSpan; +} diff --git a/dist/amd/System/Time/TimeStamp.d.ts b/dist/amd/System/Time/TimeStamp.d.ts new file mode 100644 index 00000000..7973cce8 --- /dev/null +++ b/dist/amd/System/Time/TimeStamp.d.ts @@ -0,0 +1,21 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class TimeStamp implements ITimeStamp, IDateTime { + year: number; + month: Gregorian.Month; + day: number; + hour: number; + minute: number; + second: number; + millisecond: number; + tick: number; + constructor(year: number, month: Gregorian.Month, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, tick?: number); + toJsDate(): Date; + static from(d: Date | IDateTime): TimeStamp; +} diff --git a/dist/amd/System/Time/TimeStamp.js b/dist/amd/System/Time/TimeStamp.js new file mode 100644 index 00000000..33ffdedb --- /dev/null +++ b/dist/amd/System/Time/TimeStamp.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +define(["require","exports","../Types"],function(e,t,i){"use strict";var o=function(){function e(e,t,i,o,n,s,r,a){void 0===i&&(i=1),void 0===o&&(o=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=0),void 0===a&&(a=0),this.year=e,this.month=t,this.day=i,this.hour=o,this.minute=n,this.second=s,this.millisecond=r,this.tick=a,Object.freeze(this)}return e.prototype.toJsDate=function(){var e=this;return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond+e.tick/1e4)},e.from=function(t){if(t instanceof Date||!i["default"].hasMember(t,"toJsDate")||(t=t.toJsDate()),t instanceof Date)return new e(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());throw Error("Invalid date type.")},e}();Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o}); +//# sourceMappingURL=TimeStamp.js.map diff --git a/dist/amd/System/Time/TimeStamp.js.map b/dist/amd/System/Time/TimeStamp.js.map new file mode 100644 index 00000000..b48e32f0 --- /dev/null +++ b/dist/amd/System/Time/TimeStamp.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Time/TimeStamp.js","System/Time/TimeStamp.ts"],"names":["define","require","exports","Types_1","TimeStamp","year","month","day","hour","minute","second","millisecond","tick","this","Object","freeze","prototype","toJsDate","_","Date","from","d","hasMember","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","Error","defineProperty","value"],"mappings":";;;;AAIAA,QAAQ,UAAW,UAAW,YAAa,SAAUC,EAASC,EAASC,GCKvE,YAOA,IAAAC,GAAA,WAIC,QAAAA,GACQC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GALP,SAAAL,IAAAA,EAAA,GACA,SAAAC,IAAAA,EAAA,GACA,SAAAC,IAAAA,EAAA,GACA,SAAAC,IAAAA,EAAA,GACA,SAAAC,IAAAA,EAAA,GACA,SAAAC,IAAAA,EAAA,GAPOC,KAAAR,KAAAA,EACAQ,KAAAP,MAAAA,EACAO,KAAAN,IAAAA,EACAM,KAAAL,KAAAA,EACAK,KAAAJ,OAAAA,EACAI,KAAAH,OAAAA,EACAG,KAAAF,YAAAA,EACAE,KAAAD,KAAAA,EAKPE,OAAOC,OAAOF,MA8BhB,MA3BCT,GAAAY,UAAAC,SAAA,WAEC,GAAIC,GAAIL,IACR,OAAO,IAAIM,MAAKD,EAAEb,KAAMa,EAAEZ,MAAOY,EAAEX,IAAKW,EAAEV,KAAMU,EAAET,OAAQS,EAAER,OAAQQ,EAAEP,YAAcO,EAAEN,KAAK,MAGrFR,EAAAgB,KAAP,SAAYC,GAIX,GAFMA,YAAaF,QAAShB,EAAAA,WAAKmB,UAAUD,EAAE,cAC5CA,EAAgBA,EAAGJ,YACjBI,YAAaF,MAEf,MAAO,IAAIf,GACViB,EAAEE,cACFF,EAAEG,WACFH,EAAEI,UACFJ,EAAEK,WACFL,EAAEM,aACFN,EAAEO,aACFP,EAAEQ,kBAKH,MAAMC,OAAM,uBAGf1B,IA/CAU,QAAAiB,eAAA7B,EAAA,cAAA8B,OAAA,IDyBI9B,EAAAA,WAAkBE","file":"System/Time/TimeStamp.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\ndefine([\"require\", \"exports\", '../Types'], function (require, exports, Types_1) {\n 'use strict';\n var TimeStamp = (function () {\n function TimeStamp(year, month, day, hour, minute, second, millisecond, tick) {\n if (day === void 0) { day = 1; }\n if (hour === void 0) { hour = 0; }\n if (minute === void 0) { minute = 0; }\n if (second === void 0) { second = 0; }\n if (millisecond === void 0) { millisecond = 0; }\n if (tick === void 0) { tick = 0; }\n this.year = year;\n this.month = month;\n this.day = day;\n this.hour = hour;\n this.minute = minute;\n this.second = second;\n this.millisecond = millisecond;\n this.tick = tick;\n Object.freeze(this);\n }\n TimeStamp.prototype.toJsDate = function () {\n var _ = this;\n return new Date(_.year, _.month, _.day, _.hour, _.minute, _.second, _.millisecond + _.tick / 10000);\n };\n TimeStamp.from = function (d) {\n if (!(d instanceof Date) && Types_1.default.hasMember(d, 'toJsDate'))\n d = d.toJsDate();\n if (d instanceof Date) {\n return new TimeStamp(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds());\n }\n else {\n throw Error('Invalid date type.');\n }\n };\n return TimeStamp;\n }());\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = TimeStamp;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n///\r\n///\r\n///\r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nimport Type from '../Types';\r\n\r\n/**\r\n * An alternative to Date or DateTime. Is a model representing the exact date and time.\r\n */\r\nexport default\r\nclass TimeStamp implements ITimeStamp, IDateTime\r\n{\r\n\r\n\tconstructor(\r\n\t\tpublic year:number,\r\n\t\tpublic month:Gregorian.Month,\r\n\t\tpublic day:number = 1,\r\n\t\tpublic hour:number = 0,\r\n\t\tpublic minute:number = 0,\r\n\t\tpublic second:number = 0,\r\n\t\tpublic millisecond:number = 0,\r\n\t\tpublic tick:number = 0)\r\n\t{\r\n\r\n\t\t// TODO: Add validation or properly carry out of range values...\r\n\r\n\t\tObject.freeze(this);\r\n\t}\r\n\r\n\ttoJsDate():Date\r\n\t{\r\n\t\tvar _ = this;\r\n\t\treturn new Date(_.year, _.month, _.day, _.hour, _.minute, _.second, _.millisecond + _.tick/HowMany.Ticks.Per.Millisecond);\r\n\t}\r\n\r\n\tstatic from(d:Date|IDateTime):TimeStamp\r\n\t{\r\n\t\tif (!(d instanceof Date) && Type.hasMember(d,'toJsDate'))\r\n\t\t\td = (d).toJsDate();\r\n\t\tif(d instanceof Date)\r\n\t\t{\r\n\t\t\treturn new TimeStamp(\r\n\t\t\t\td.getFullYear(),\r\n\t\t\t\td.getMonth(),\r\n\t\t\t\td.getDate(),\r\n\t\t\t\td.getHours(),\r\n\t\t\t\td.getMinutes(),\r\n\t\t\t\td.getSeconds(),\r\n\t\t\t\td.getMilliseconds()\r\n\t\t\t);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow Error('Invalid date type.');\r\n\t\t}\r\n\t}\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Time/TimeUnit.d.ts b/dist/amd/System/Time/TimeUnit.d.ts new file mode 100644 index 00000000..54fed424 --- /dev/null +++ b/dist/amd/System/Time/TimeUnit.d.ts @@ -0,0 +1,22 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Originally based upon .NET source but with many additions and improvements. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare enum TimeUnit { + Ticks = 0, + Milliseconds = 1, + Seconds = 2, + Minutes = 3, + Hours = 4, + Days = 5, +} +declare module TimeUnit { + function toMilliseconds(value: number, units?: TimeUnit): number; + function fromMilliseconds(ms: number, units: TimeUnit): number; + function from(quantity: ITimeQuantity, unit: TimeUnit): number; + function assertValid(unit: TimeUnit): boolean; +} +export default TimeUnit; diff --git a/dist/amd/System/Time/TimeUnitValue.d.ts b/dist/amd/System/Time/TimeUnitValue.d.ts new file mode 100644 index 00000000..782f6cd6 --- /dev/null +++ b/dist/amd/System/Time/TimeUnitValue.d.ts @@ -0,0 +1,19 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeUnit from './TimeUnit'; +import TimeQuantity from './TimeQuantity'; +export default class TimeUnitValue extends TimeQuantity { + private _units; + constructor(value: number | ITimeQuantity, _units: TimeUnit); + value: number; + getTotalMilliseconds(): number; + units: TimeUnit; + to(units?: TimeUnit): TimeUnitValue; + static from(value: number | ITimeQuantity, units?: TimeUnit): TimeUnitValue; +} diff --git a/dist/amd/System/Time/TimeUnitValue.js b/dist/amd/System/Time/TimeUnitValue.js new file mode 100644 index 00000000..2bda37c4 --- /dev/null +++ b/dist/amd/System/Time/TimeUnitValue.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +var __extends=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)};define(["require","exports","./TimeUnit","./TimeQuantity"],function(t,e,n,i){"use strict";function o(t,e){return n["default"].fromMilliseconds(t.getTotalMilliseconds(),e)}var r=function(t){function e(e,i){t.call(this,"number"==typeof e?e:o(e,i)),this._units=i,n["default"].assertValid(i)}return __extends(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this._quantity},set:function(t){this._total=null,this._quantity=t},enumerable:!0,configurable:!0}),e.prototype.getTotalMilliseconds=function(){return n["default"].toMilliseconds(this._quantity,this._units)},Object.defineProperty(e.prototype,"units",{get:function(){return this._units},enumerable:!0,configurable:!0}),e.prototype.to=function(t){return void 0===t&&(t=this.units),e.from(this,t)},e.from=function(t,i){return void 0===i&&(i=n["default"].Milliseconds),new e(t,i)},e}(i["default"]);Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=r}); +//# sourceMappingURL=TimeUnitValue.js.map diff --git a/dist/amd/System/Time/TimeUnitValue.js.map b/dist/amd/System/Time/TimeUnitValue.js.map new file mode 100644 index 00000000..f9b93b5d --- /dev/null +++ b/dist/amd/System/Time/TimeUnitValue.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Time/TimeUnitValue.js","System/Time/TimeUnitValue.ts"],"names":["__extends","this","d","b","__","constructor","p","hasOwnProperty","prototype","Object","create","define","require","exports","TimeUnit_1","TimeQuantity_1","getUnitQuantityFrom","q","units","fromMilliseconds","getTotalMilliseconds","TimeUnitValue","_super","value","_units","call","assertValid","defineProperty","get","_quantity","set","v","_total","enumerable","configurable","toMilliseconds","to","from","Milliseconds"],"mappings":";;;;AAIA,GAAIA,WAAaC,MAAQA,KAAKD,WAAc,SAAUE,EAAGC,GAErD,QAASC,KAAOH,KAAKI,YAAcH,EADnC,IAAK,GAAII,KAAKH,GAAOA,EAAEI,eAAeD,KAAIJ,EAAEI,GAAKH,EAAEG,GAEnDJ,GAAEM,UAAkB,OAANL,EAAaM,OAAOC,OAAOP,IAAMC,EAAGI,UAAYL,EAAEK,UAAW,GAAIJ,IAEnFO,SAAQ,UAAW,UAAW,aAAc,kBAAmB,SAAUC,EAASC,EAASC,EAAYC,GCAvG,YAuDA,SAAAC,GAA6BC,EAAiBC,GAE7C,MAAOJ,GAAAA,WAASK,iBAAiBF,EAAEG,uBAAwBF,GAhD5D,GAAAG,GAAA,SAAAC,GAIC,QAAAD,GAAYE,EAAoCC,GAE/CF,EAAAG,KAAAxB,KAAqB,gBAAT,GACDsB,EACRP,EAAmCO,EAAOC,IAJEvB,KAAAuB,OAAAA,EAK/CV,EAAAA,WAASY,YAAYF,GAmCvB,MA3C4BxB,WAAAqB,EAAAC,GAW3Bb,OAAAkB,eAAIN,EAAAb,UAAA,SDTOoB,ICSX,WAEC,MAAO3B,MAAK4B,WDRFC,ICWX,SAAUC,GAET9B,KAAK+B,OAAS,KACd/B,KAAK4B,UAAYE,GDVPE,YAAY,EACZC,cAAc,ICYzBb,EAAAb,UAAAY,qBAAA,WAEC,MAAON,GAAAA,WAASqB,eAAelC,KAAK4B,UAAW5B,KAAKuB,SAIrDf,OAAAkB,eAAIN,EAAAb,UAAA,SDZOoB,ICYX,WAEC,MAAO3B,MAAKuB,QDXFS,YAAY,EACZC,cAAc,ICazBb,EAAAb,UAAA4B,GAAA,SAAGlB,GAEF,MAFE,UAAAA,IAAAA,EAAiBjB,KAAKiB,OAEjBG,EAAcgB,KAAKpC,KAAKiB,IAGzBG,EAAAgB,KAAP,SAAYd,EAA4BL,GAEvC,MAFuC,UAAAA,IAAAA,EAAiBJ,EAAAA,WAASwB,cAE1D,GAAIjB,GAAcE,EAAOL,IAGlCG,GA3C4BN,EAAAA,WAD5BN,QAAAkB,eAAAd,EAAA,cAAAU,OAAA,IDkCIV,EAAAA,WAAkBQ","file":"System/Time/TimeUnitValue.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\ndefine([\"require\", \"exports\", './TimeUnit', './TimeQuantity'], function (require, exports, TimeUnit_1, TimeQuantity_1) {\n 'use strict';\n var TimeUnitValue = (function (_super) {\n __extends(TimeUnitValue, _super);\n function TimeUnitValue(value, _units) {\n _super.call(this, typeof (value) == 'number'\n ? value\n : getUnitQuantityFrom(value, _units));\n this._units = _units;\n TimeUnit_1.default.assertValid(_units);\n }\n Object.defineProperty(TimeUnitValue.prototype, \"value\", {\n get: function () {\n return this._quantity;\n },\n set: function (v) {\n this._total = null;\n this._quantity = v;\n },\n enumerable: true,\n configurable: true\n });\n TimeUnitValue.prototype.getTotalMilliseconds = function () {\n return TimeUnit_1.default.toMilliseconds(this._quantity, this._units);\n };\n Object.defineProperty(TimeUnitValue.prototype, \"units\", {\n get: function () {\n return this._units;\n },\n enumerable: true,\n configurable: true\n });\n TimeUnitValue.prototype.to = function (units) {\n if (units === void 0) { units = this.units; }\n return TimeUnitValue.from(this, units);\n };\n TimeUnitValue.from = function (value, units) {\n if (units === void 0) { units = TimeUnit_1.default.Milliseconds; }\n return new TimeUnitValue(value, units);\n };\n return TimeUnitValue;\n }(TimeQuantity_1.default));\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = TimeUnitValue;\n function getUnitQuantityFrom(q, units) {\n return TimeUnit_1.default.fromMilliseconds(q.getTotalMilliseconds(), units);\n }\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n///\r\n///\r\n///\r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nimport {areEqual, compare} from '../Compare';\r\nimport TimeUnit from './TimeUnit';\r\nimport TimeQuantity from './TimeQuantity';\r\n\r\n/**\r\n * TimeUnitValue allows for passing around a reference to a changeable measure of time coerced by its unit type.\r\n */\r\nexport default\r\nclass TimeUnitValue extends TimeQuantity\r\n{\r\n\r\n\tconstructor(value:number|ITimeQuantity, private _units:TimeUnit)\r\n\t{\r\n\t\tsuper(typeof(value)=='number'\r\n\t\t\t? value\r\n\t\t\t: getUnitQuantityFrom(value, _units));\r\n\t\tTimeUnit.assertValid(_units);\r\n\t}\r\n\r\n\tget value():number\r\n\t{\r\n\t\treturn this._quantity;\r\n\t}\r\n\r\n\tset value(v:number)\r\n\t{\r\n\t\tthis._total = null;\r\n\t\tthis._quantity = v;\r\n\t}\r\n\r\n\tgetTotalMilliseconds():number\r\n\t{\r\n\t\treturn TimeUnit.toMilliseconds(this._quantity, this._units);\r\n\t}\r\n\r\n\t// To avoid confusion, the unit type can only be set once at construction.\r\n\tget units():TimeUnit\r\n\t{\r\n\t\treturn this._units;\r\n\t}\r\n\r\n\tto(units:TimeUnit = this.units):TimeUnitValue\r\n\t{\r\n\t\treturn TimeUnitValue.from(this,units);\r\n\t}\r\n\r\n\tstatic from(value:number|ITimeQuantity, units:TimeUnit = TimeUnit.Milliseconds):TimeUnitValue\r\n\t{\r\n\t\treturn new TimeUnitValue(value, units);\r\n\t}\r\n\r\n}\r\n\r\nfunction getUnitQuantityFrom(q:ITimeQuantity, units:TimeUnit)\r\n{\r\n\treturn TimeUnit.fromMilliseconds(q.getTotalMilliseconds(), units);\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Timers/Timer.d.ts b/dist/amd/System/Timers/Timer.d.ts new file mode 100644 index 00000000..00797473 --- /dev/null +++ b/dist/amd/System/Timers/Timer.d.ts @@ -0,0 +1,24 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ObservableBase from "./../Observable/ObservableBase"; +export default class Timer extends ObservableBase implements ITimer, ICancellable { + private _interval; + private _maxCount; + private _initialDelay; + private _cancel; + private _count; + constructor(_interval: number, _maxCount?: number, _initialDelay?: number); + static startNew(millisecondInterval: number, maxCount?: number, initialDelay?: number): Timer; + isRunning: boolean; + count: number; + start(): void; + stop(): void; + reset(): void; + cancel(): boolean; + dispose(): void; + private static _onTick(timer, reInitTimer?); +} diff --git a/dist/amd/System/Types.d.ts b/dist/amd/System/Types.d.ts new file mode 100644 index 00000000..cddf07c8 --- /dev/null +++ b/dist/amd/System/Types.d.ts @@ -0,0 +1,46 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare class TypeInfo { + private target; + type: string; + isBoolean: boolean; + isNumber: boolean; + isFinite: boolean; + isValidNumber: boolean; + isString: boolean; + isTrueNaN: boolean; + isObject: boolean; + isFunction: boolean; + isUndefined: boolean; + isNull: boolean; + isNullOrUndefined: boolean; + isPrimitive: boolean; + constructor(target: any); + member(name: string): TypeInfo; + static getFor(target: any): TypeInfo; +} +export declare module Type { + const BOOLEAN: string; + const NUMBER: string; + const STRING: string; + const OBJECT: string; + const UNDEFINED: string; + const FUNCTION: string; + function isBoolean(value: any): value is boolean; + function isNumber(value: any, allowNaN?: boolean): value is number; + function isTrueNaN(value: any): value is number; + function isString(value: any): value is string; + function isPrimitive(value: any): value is Primitive; + function isFunction(value: any): value is Function; + function isObject(value: any, allowNull?: boolean): boolean; + function numberOrNaN(value: any): number; + function of(target: any): TypeInfo; + function hasMember(value: any, property: string): boolean; + function hasMemberOfType(instance: any, property: string, type: string): instance is T; + function isArrayLike(instance: any): instance is IArray; +} +export default Type; diff --git a/dist/amd/System/Uri/HostNameType.d.ts b/dist/amd/System/Uri/HostNameType.d.ts new file mode 100644 index 00000000..b4e74073 --- /dev/null +++ b/dist/amd/System/Uri/HostNameType.d.ts @@ -0,0 +1,13 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.UriHostNameType%28v=vs.110%29.aspx + */ +declare enum UriHostNameType { + Basic = 0, + DNS = 1, + IPv4 = 2, + IPv6 = 3, + Unknown = 4, +} +export default UriHostNameType; diff --git a/dist/amd/System/Uri/HostNameType.js b/dist/amd/System/Uri/HostNameType.js new file mode 100644 index 00000000..8d09086b --- /dev/null +++ b/dist/amd/System/Uri/HostNameType.js @@ -0,0 +1,7 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.UriHostNameType%28v=vs.110%29.aspx + */ +define(["require","exports"],function(e,n){"use strict";var t;!function(e){e[e.Basic=0]="Basic",e[e.DNS=1]="DNS",e[e.IPv4=2]="IPv4",e[e.IPv6=3]="IPv6",e[e.Unknown=4]="Unknown"}(t||(t={})),Object.freeze(t),Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=t}); +//# sourceMappingURL=HostNameType.js.map diff --git a/dist/amd/System/Uri/HostNameType.js.map b/dist/amd/System/Uri/HostNameType.js.map new file mode 100644 index 00000000..45e8dec0 --- /dev/null +++ b/dist/amd/System/Uri/HostNameType.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Uri/HostNameType.js","System/Uri/HostNameType.ts"],"names":["define","require","exports","UriHostNameType","Object","freeze","defineProperty","value"],"mappings":";;;;;AAKAA,QAAQ,UAAW,WAAY,SAAUC,EAASC,GAC9C,YCCJ,IAAKC,IAAL,SAAKA,GAIJA,EAAAA,EAAA,MAAA,GAAA,QAKAA,EAAAA,EAAA,IAAA,GAAA,MAKAA,EAAAA,EAAA,KAAA,GAAA,OAKAA,EAAAA,EAAA,KAAA,GAAA,OAKAA,EAAAA,EAAA,QAAA,GAAA,WAxBIA,IAAAA,OA2BLC,OAAOC,OAAOF,GAEdC,OAAAE,eAAAJ,EAAA,cAAAK,OAAA,IDnBIL,EAAAA,WCmBWC","file":"System/Uri/HostNameType.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n * Based on: https://msdn.microsoft.com/en-us/library/system.UriHostNameType%28v=vs.110%29.aspx\n */\ndefine([\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n var UriHostNameType;\n (function (UriHostNameType) {\n UriHostNameType[UriHostNameType[\"Basic\"] = 0] = \"Basic\";\n UriHostNameType[UriHostNameType[\"DNS\"] = 1] = \"DNS\";\n UriHostNameType[UriHostNameType[\"IPv4\"] = 2] = \"IPv4\";\n UriHostNameType[UriHostNameType[\"IPv6\"] = 3] = \"IPv6\";\n UriHostNameType[UriHostNameType[\"Unknown\"] = 4] = \"Unknown\";\n })(UriHostNameType || (UriHostNameType = {}));\n Object.freeze(UriHostNameType);\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = UriHostNameType;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n * Based on: https://msdn.microsoft.com/en-us/library/system.UriHostNameType%28v=vs.110%29.aspx\r\n */\r\n\r\n\r\nenum UriHostNameType {\r\n\t/**\r\n\t * The host is set, but the type cannot be determined.\r\n\t */\r\n\tBasic,\r\n\r\n\t/**\r\n\t * The host name is a domain name system (DNS) style host name.\r\n\t */\r\n\tDNS,\r\n\r\n\t/**\r\n\t * The host name is an Internet Protocol (IP) version 4 host address.\r\n\t */\r\n\tIPv4,\r\n\r\n\t/**\r\n\t * The host name is an Internet Protocol (IP) version 6 host address.\r\n\t */\r\n\tIPv6,\r\n\r\n\t/**\r\n\t * The type of the host name is not supplied.\r\n\t */\r\n\tUnknown\r\n}\r\n\r\nObject.freeze(UriHostNameType);\r\n\r\nexport default UriHostNameType;\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Uri/QueryBuilder.d.ts b/dist/amd/System/Uri/QueryBuilder.d.ts new file mode 100644 index 00000000..891db685 --- /dev/null +++ b/dist/amd/System/Uri/QueryBuilder.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import OrderedStringKeyDictionary from "../Collections/Dictionaries/OrderedStringKeyDictionary"; +export default class QueryBuilder extends OrderedStringKeyDictionary { + constructor(query: QueryParamsConvertible, decodeValues?: boolean); + static init(query: QueryParamsConvertible, decodeValues?: boolean): QueryBuilder; + importQuery(query: QueryParamsConvertible, decodeValues?: boolean): QueryBuilder; + importFromString(values: string, deserialize?: boolean, decodeValues?: boolean): QueryBuilder; + encode(prefixIfNotEmpty?: boolean): string; + toString(): string; +} diff --git a/dist/amd/System/Uri/QueryBuilder.js b/dist/amd/System/Uri/QueryBuilder.js new file mode 100644 index 00000000..9b2be777 --- /dev/null +++ b/dist/amd/System/Uri/QueryBuilder.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +var __extends=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};define(["require","exports","../Types","./QueryParams","../Collections/Dictionaries/OrderedStringKeyDictionary","../Collections/Enumeration/Enumerator"],function(t,e,r,i,n,o){"use strict";var s=function(t){function e(e,r){void 0===r&&(r=!0),t.call(this),this.importQuery(e,r)}return __extends(e,t),e.init=function(t,r){return void 0===r&&(r=!0),new e(t,r)},e.prototype.importQuery=function(t,e){return void 0===e&&(e=!0),r["default"].isString(t)?this.importFromString(t,e):o.isEnumerableOrArrayLike(t)?this.importEntries(t):this.importMap(t),this},e.prototype.importFromString=function(t,e,r){void 0===e&&(e=!0),void 0===r&&(r=!0);var n=this;return i.parse(t,function(t,e){if(n.containsKey(t)){var r=n.getValue(t);Array.isArray(r)?r.push(e):n.setValue(t,[r,e])}else n.setValue(t,e)},e,r),this},e.prototype.encode=function(t){return i.encode(this,t)},e.prototype.toString=function(){return this.encode()},e}(n["default"]);Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=s}); +//# sourceMappingURL=QueryBuilder.js.map diff --git a/dist/amd/System/Uri/QueryBuilder.js.map b/dist/amd/System/Uri/QueryBuilder.js.map new file mode 100644 index 00000000..9aa2834b --- /dev/null +++ b/dist/amd/System/Uri/QueryBuilder.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Uri/QueryBuilder.js","System/Uri/QueryBuilder.ts"],"names":["__extends","this","d","b","__","constructor","p","hasOwnProperty","prototype","Object","create","define","require","exports","Types_1","QueryParams","OrderedStringKeyDictionary_1","Enumerator_1","QueryBuilder","_super","query","decodeValues","call","importQuery","init","isString","importFromString","isEnumerableOrArrayLike","importEntries","importMap","values","deserialize","_","parse","key","value","containsKey","prev","getValue","Array","isArray","push","setValue","encode","prefixIfNotEmpty","toString","defineProperty"],"mappings":";;;;AAIA,GAAIA,WAAaC,MAAQA,KAAKD,WAAc,SAAUE,EAAGC,GAErD,QAASC,KAAOH,KAAKI,YAAcH,EADnC,IAAK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,MAAO5C,MAAK0C,UAEdzB,GAvF2BF,EAAAA,WAD3BP,QAAAqC,eAAAjC,EAAA,cAAAsB,OAAA,IDuCItB,EAAAA,WAAkBK","file":"System/Uri/QueryBuilder.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\ndefine([\"require\", \"exports\", \"../Types\", \"./QueryParams\", \"../Collections/Dictionaries/OrderedStringKeyDictionary\", \"../Collections/Enumeration/Enumerator\"], function (require, exports, Types_1, QueryParams, OrderedStringKeyDictionary_1, Enumerator_1) {\n 'use strict';\n var QueryBuilder = (function (_super) {\n __extends(QueryBuilder, _super);\n function QueryBuilder(query, decodeValues) {\n if (decodeValues === void 0) { decodeValues = true; }\n _super.call(this);\n this.importQuery(query, decodeValues);\n }\n QueryBuilder.init = function (query, decodeValues) {\n if (decodeValues === void 0) { decodeValues = true; }\n return new QueryBuilder(query, decodeValues);\n };\n QueryBuilder.prototype.importQuery = function (query, decodeValues) {\n if (decodeValues === void 0) { decodeValues = true; }\n if (Types_1.default.isString(query)) {\n this.importFromString(query, decodeValues);\n }\n else if (Enumerator_1.isEnumerableOrArrayLike(query)) {\n this.importEntries(query);\n }\n else {\n this.importMap(query);\n }\n return this;\n };\n QueryBuilder.prototype.importFromString = function (values, deserialize, decodeValues) {\n if (deserialize === void 0) { deserialize = true; }\n if (decodeValues === void 0) { decodeValues = true; }\n var _ = this;\n QueryParams.parse(values, function (key, value) {\n if (_.containsKey(key)) {\n var prev = _.getValue(key);\n if (Array.isArray(prev))\n prev.push(value);\n else\n _.setValue(key, [prev, value]);\n }\n else\n _.setValue(key, value);\n }, deserialize, decodeValues);\n return this;\n };\n QueryBuilder.prototype.encode = function (prefixIfNotEmpty) {\n return QueryParams.encode(this, prefixIfNotEmpty);\n };\n QueryBuilder.prototype.toString = function () {\n return this.encode();\n };\n return QueryBuilder;\n }(OrderedStringKeyDictionary_1.default));\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = QueryBuilder;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n///\r\n///\r\n///\r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nimport Type from \"../Types\";\r\nimport * as QueryParams from \"./QueryParams\";\r\nimport OrderedStringKeyDictionary from \"../Collections/Dictionaries/OrderedStringKeyDictionary\";\r\nimport {isEnumerableOrArrayLike} from \"../Collections/Enumeration/Enumerator\";\r\n\r\n\r\n/**\r\n * Provides a means for parsing and building a set of parameters.\r\n *\r\n * In other languages, dictionaries are not reliable for retaining the order of stored values. So for certainty and flexibility we use an ordered dictionary as a base class.\r\n */\r\nexport default\r\nclass QueryBuilder extends OrderedStringKeyDictionary\r\n{\r\n\r\n\tconstructor(\r\n\t\tquery:QueryParamsConvertible,\r\n\t\tdecodeValues:boolean = true)\r\n\t{\r\n\t\tsuper();\r\n\r\n\t\tthis.importQuery(query,decodeValues);\r\n\t}\r\n\r\n\r\n\tstatic init(\r\n\t\tquery:QueryParamsConvertible,\r\n\t\tdecodeValues:boolean = true):QueryBuilder\r\n\t{\r\n\t\treturn new QueryBuilder(query, decodeValues);\r\n\t}\r\n\r\n\timportQuery(\r\n\t\tquery:QueryParamsConvertible,\r\n\t\tdecodeValues:boolean = true):QueryBuilder {\r\n\r\n\t\tif(Type.isString(query))\r\n\t\t{\r\n\t\t\tthis.importFromString(query, decodeValues);\r\n\t\t}\r\n\t\telse if(isEnumerableOrArrayLike(query))\r\n\t\t{\r\n\t\t\tthis.importEntries(query);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis.importMap(query);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t}\r\n\r\n\t/**\r\n\t * Property parses the components of an URI into their values or array of values.\r\n\t * @param values\r\n\t * @param deserialize\r\n\t * @param decodeValues\r\n\t * @returns {QueryBuilder}\r\n\t */\r\n\timportFromString(\r\n\t\tvalues:string,\r\n\t\tdeserialize:boolean = true,\r\n\t\tdecodeValues:boolean = true):QueryBuilder\r\n\t{\r\n\t\tvar _ = this;\r\n\t\tQueryParams.parse(values,\r\n\t\t\t(key, value)=>\r\n\t\t\t{\r\n\t\t\t\tif(_.containsKey(key))\r\n\t\t\t\t{\r\n\t\t\t\t\tvar prev = _.getValue(key);\r\n\t\t\t\t\tif(Array.isArray(prev))\r\n\t\t\t\t\t\tprev.push(value);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t_.setValue(key, [prev, value]);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t_.setValue(key, value);\r\n\t\t\t},\r\n\t\t\tdeserialize,\r\n\t\t\tdecodeValues);\r\n\r\n\t\treturn this;\r\n\t}\r\n\r\n\r\n\r\n\t/**\r\n\t * Returns the encoded URI string\r\n\t */\r\n\tencode(prefixIfNotEmpty?:boolean):string\r\n\t{\r\n\t\treturn QueryParams.encode(this, prefixIfNotEmpty);\r\n\t}\r\n\r\n\ttoString():string\r\n\t{\r\n\t\treturn this.encode();\r\n\t}\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Uri/QueryParams.d.ts b/dist/amd/System/Uri/QueryParams.d.ts new file mode 100644 index 00000000..6bedb350 --- /dev/null +++ b/dist/amd/System/Uri/QueryParams.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function encode(values: IUriComponentMap | QueryParamEnumerableOrArray, prefixIfNotEmpty?: boolean): string; +export declare function encodeValue(value: UriComponentValue): string; +export declare function isUriComponentFormattable(instance: any): instance is IUriComponentFormattable; +export declare function parse(query: string, entryHandler: (key: string, value: Primitive) => void, deserialize?: boolean, decodeValues?: boolean): void; +export declare function parseToMap(query: string, deserialize?: boolean, decodeValues?: boolean): IMap; +export declare function parseToArray(query: string, deserialize?: boolean, decodeValues?: boolean): IStringKeyValuePair[]; +export declare module Separator { + const Entry: string; + const KeyValue: string; +} diff --git a/dist/amd/System/Uri/QueryParams.js b/dist/amd/System/Uri/QueryParams.js new file mode 100644 index 00000000..22b22c1f --- /dev/null +++ b/dist/amd/System/Uri/QueryParams.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +define(["require","exports","../Types","../Serialization/Utility","../KeyValueExtract","../Collections/Enumeration/Enumerator"],function(e,n,r,t,o,i){"use strict";function u(e,n){if(!e)return"";var r=[];return i.isEnumerableOrArrayLike(e)?i.forEach(e,function(e){return o["default"](e,function(e,n){return f(r,e,n)})}):Object.keys(e).forEach(function(n){return f(r,n,e[n])}),(r.length&&n?"?":"")+r.join(v)}function a(e,n,r){e.push(n+m+c(r))}function f(e,n,r){i.isEnumerableOrArrayLike(r)?i.forEach(r,function(r){return a(e,n,r)}):a(e,n,r)}function c(e){var n=null;if(s(e)){if(n=e.toUriComponent(),n&&1!=n.indexOf("&"))throw".toUriComponent() did not encode the value."}else n=encodeURIComponent(t.toString(n));return n}function s(e){return r["default"].hasMemberOfType(e,"toUriComponent",r["default"].FUNCTION)}function l(e,n,r,o){if(void 0===r&&(r=!0),void 0===o&&(o=!0),e&&(e=e.replace(/^\s*\?+/,"")))for(var i=e.split(v),u=0,a=i;u\r\n///\r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nimport Type from \"../Types\";\r\nimport * as Serialization from \"../Serialization/Utility\";\r\nimport extractKeyValue from \"../KeyValueExtract\";\r\nimport {forEach, isEnumerableOrArrayLike} from \"../Collections/Enumeration/Enumerator\";\r\n\r\n/*\r\n * This module is provided as a lighter weight utility for acquiring query params.\r\n * If more detailed operations are necessary, consider importing QueryBuilder.\r\n */\r\n\r\nconst\r\n\tENTRY_SEPARATOR = \"&\",\r\n\tKEY_VALUE_SEPARATOR = \"=\";\r\n\r\n\r\n/**\r\n * Returns the encoded URI string\r\n * @param values\r\n * @param prefixIfNotEmpty\r\n * @returns {string}\r\n */\r\nexport function encode(\r\n\tvalues:IUriComponentMap | QueryParamEnumerableOrArray,\r\n\tprefixIfNotEmpty?:boolean):string\r\n{\r\n\tif(!values) return '';\r\n\tvar entries:string[] = [];\r\n\r\n\tif(isEnumerableOrArrayLike(values))\r\n\t{\r\n\t\tforEach(values, entry=>\r\n\t\t\textractKeyValue(entry,\r\n\t\t\t\t(key, value)=> appendKeyValue(entries, key, value))\r\n\t\t);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tObject.keys(values).forEach(\r\n\t\t\tkey=> appendKeyValue(entries, key, values[key])\r\n\t\t);\r\n\t}\r\n\r\n\treturn (entries.length && prefixIfNotEmpty ? '?' : '')\r\n\t\t+ entries.join(ENTRY_SEPARATOR);\r\n}\r\n\r\nfunction appendKeyValueSingle(\r\n\tentries:string[],\r\n\tkey:string,\r\n\tvalue:UriComponentValue):void\r\n{\r\n\tentries.push(key + KEY_VALUE_SEPARATOR + encodeValue(value));\r\n}\r\n\r\n// According to spec, if there is an array of values with the same key, then each value is replicated with that key.\r\nfunction appendKeyValue(\r\n\tentries:string[],\r\n\tkey:string,\r\n\tvalue:UriComponentValue|IEnumerableOrArray):void\r\n{\r\n\tif(isEnumerableOrArrayLike(value))\r\n\t{\r\n\t\tforEach(value, v=> appendKeyValueSingle(entries, key, v));\r\n\t}\r\n\telse\r\n\t{\r\n\t\tappendKeyValueSingle(entries, key, value)\r\n\t}\r\n}\r\n\r\n/**\r\n * Converts any primitive, serializable or uri-component object to an encoded string.\r\n * @param value\r\n * @returns {string}\r\n */\r\nexport function encodeValue(value:UriComponentValue):string\r\n{\r\n\tvar v:string = null;\r\n\tif(isUriComponentFormattable(value))\r\n\t{\r\n\t\tv = value.toUriComponent();\r\n\t\tif(v && v.indexOf('&')!=1)\r\n\t\t\tthrow '.toUriComponent() did not encode the value.';\r\n\t}\r\n\telse\r\n\t{\r\n\t\tv = encodeURIComponent(Serialization.toString(v));\r\n\t}\r\n\treturn v;\r\n}\r\n\r\n/**\r\n * A shortcut for identifying an IUriComponentFormattable object.\r\n * @param instance\r\n * @returns {boolean}\r\n */\r\nexport function isUriComponentFormattable(instance:any):instance is IUriComponentFormattable\r\n{\r\n\treturn Type.hasMemberOfType(instance, \"toUriComponent\", Type.FUNCTION);\r\n}\r\n\r\n/**\r\n * Parses a string for valid query param entries and pipes them through a handler.\r\n * @param query\r\n * @param entryHandler\r\n * @param deserialize Default is true.\r\n * @param decodeValues Default is true.\r\n */\r\nexport function parse(\r\n\tquery:string,\r\n\tentryHandler:(key:string, value:Primitive)=>void,\r\n\tdeserialize:boolean = true,\r\n\tdecodeValues:boolean = true):void\r\n{\r\n\tif(query && (query = query.replace(/^\\s*\\?+/, '')))\r\n\t{\r\n\t\tvar entries = query.split(ENTRY_SEPARATOR);\r\n\t\tfor(let entry of entries)\r\n\t\t{\r\n\t\t\t/*\r\n\t\t\t * Since it is technically possible to have multiple '=' we need to identify the first one.\r\n\t\t\t * And if there is no '=' then the entry is ignored.\r\n\t\t\t */\r\n\t\t\tvar si = entry.indexOf(KEY_VALUE_SEPARATOR);\r\n\t\t\tif(si!= -1)\r\n\t\t\t{\r\n\t\t\t\tvar key = entry.substring(0, si);\r\n\t\t\t\tvar value = entry.substring(si + 1);\r\n\t\t\t\tif(decodeValues) value = decodeURIComponent(value);\r\n\t\t\t\tif(deserialize) value = Serialization.toPrimitive(value);\r\n\t\t\t\tentryHandler(key, value);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Parses a string for valid query params and returns a key-value map of the entries.\r\n * @param query\r\n * @param deserialize Default is true.\r\n * @param decodeValues Default is true.\r\n * @returns {IMap}\r\n */\r\nexport function parseToMap(\r\n\tquery:string,\r\n\tdeserialize:boolean = true,\r\n\tdecodeValues:boolean = true):IMap\r\n{\r\n\tvar result:IMap = {};\r\n\tparse(query,\r\n\t\t(key, value)=>\r\n\t\t{\r\n\t\t\tif((key) in (result))\r\n\t\t\t{\r\n\t\t\t\tvar prev:any = result[key];\r\n\t\t\t\tif(!(Array.isArray(prev)))\r\n\t\t\t\t\tresult[key] = prev = [prev];\r\n\t\t\t\tprev.push(value);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tresult[key] = value;\r\n\t\t},\r\n\t\tdeserialize,\r\n\t\tdecodeValues);\r\n\treturn result;\r\n}\r\n\r\n/**\r\n * Parses a string for valid query params and returns a key-value pair array of the entries.\r\n * @param query\r\n * @param deserialize Default is true.\r\n * @param decodeValues Default is true.\r\n * @returns {IKeyValuePair[]}\r\n */\r\nexport function parseToArray(\r\n\tquery:string,\r\n\tdeserialize:boolean = true,\r\n\tdecodeValues:boolean = true):IStringKeyValuePair[]\r\n{\r\n\tvar result:IStringKeyValuePair[] = [];\r\n\tparse(query,\r\n\t\t(key, value)=> {result.push({key: key, value: value});},\r\n\t\tdeserialize,\r\n\t\tdecodeValues\r\n\t);\r\n\treturn result;\r\n}\r\n\r\n\r\nexport module Separator\r\n{\r\n\texport const Entry:string = ENTRY_SEPARATOR;\r\n\texport const KeyValue:string = KEY_VALUE_SEPARATOR;\r\n}\r\nObject.freeze(Separator);\r\n\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Uri/Scheme.d.ts b/dist/amd/System/Uri/Scheme.d.ts new file mode 100644 index 00000000..5e625ec8 --- /dev/null +++ b/dist/amd/System/Uri/Scheme.d.ts @@ -0,0 +1,21 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx + */ +declare enum Scheme { + file = 0, + ftp = 1, + gopher = 2, + http = 3, + https = 4, + ldap = 5, + mailto = 6, + pipe = 7, + tcp = 8, + news = 9, + nntp = 10, + telnet = 11, + uuid = 12, +} +export default Scheme; diff --git a/dist/amd/System/Uri/Scheme.js b/dist/amd/System/Uri/Scheme.js new file mode 100644 index 00000000..2485a72b --- /dev/null +++ b/dist/amd/System/Uri/Scheme.js @@ -0,0 +1,7 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx + */ +define(["require","exports"],function(e,t){"use strict";var p;!function(e){e[e.file=0]="file",e[e.ftp=1]="ftp",e[e.gopher=2]="gopher",e[e.http=3]="http",e[e.https=4]="https",e[e.ldap=5]="ldap",e[e.mailto=6]="mailto",e[e.pipe=7]="pipe",e[e.tcp=8]="tcp",e[e.news=9]="news",e[e.nntp=10]="nntp",e[e.telnet=11]="telnet",e[e.uuid=12]="uuid"}(p||(p={}));var i="net.pipe",n="net.tcp";p[p.pipe]=i,p[p.tcp]=n,p[i]=p.pipe,p[n]=p.tcp,Object.freeze(p),Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=p}); +//# sourceMappingURL=Scheme.js.map diff --git a/dist/amd/System/Uri/Scheme.js.map b/dist/amd/System/Uri/Scheme.js.map new file mode 100644 index 00000000..82038dd2 --- /dev/null +++ b/dist/amd/System/Uri/Scheme.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Uri/Scheme.js","System/Uri/Scheme.ts"],"names":["define","require","exports","Scheme","PIPE","TCP","pipe","tcp","Object","freeze","defineProperty","value"],"mappings":";;;;;AAKAA,QAAQ,UAAW,WAAY,SAAUC,EAASC,GAC9C,YCCJ,IAAKC,IAAL,SAAKA,GAIJA,EAAAA,EAAA,KAAA,GAAA,OAMAA,EAAAA,EAAA,IAAA,GAAA,MAMAA,EAAAA,EAAA,OAAA,GAAA,SAMAA,EAAAA,EAAA,KAAA,GAAA,OAMAA,EAAAA,EAAA,MAAA,GAAA,QAMAA,EAAAA,EAAA,KAAA,GAAA,OAMAA,EAAAA,EAAA,OAAA,GAAA,SAMAA,EAAAA,EAAA,KAAA,GAAA,OAMAA,EAAAA,EAAA,IAAA,GAAA,MAMAA,EAAAA,EAAA,KAAA,GAAA,OAMAA,EAAAA,EAAA,KAAA,IAAA,OAMAA,EAAAA,EAAA,OAAA,IAAA,SAKAA,EAAAA,EAAA,KAAA,IAAA,QA3EIA,IAAAA,MA+EL,IAAMC,GAAO,WACPC,EAAM,SAEZF,GAAOA,EAAOG,MAAQF,EACtBD,EAAOA,EAAOI,KAAOF,EAEfF,EAAQC,GAAQD,EAAOG,KACvBH,EAAQE,GAAOF,EAAOI,IAE5BC,OAAOC,OAAON,GAEdK,OAAAE,eAAAR,EAAA,cAAAS,OAAA,IDlEIT,EAAAA,WCkEWC","file":"System/Uri/Scheme.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx\n */\ndefine([\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n var Scheme;\n (function (Scheme) {\n Scheme[Scheme[\"file\"] = 0] = \"file\";\n Scheme[Scheme[\"ftp\"] = 1] = \"ftp\";\n Scheme[Scheme[\"gopher\"] = 2] = \"gopher\";\n Scheme[Scheme[\"http\"] = 3] = \"http\";\n Scheme[Scheme[\"https\"] = 4] = \"https\";\n Scheme[Scheme[\"ldap\"] = 5] = \"ldap\";\n Scheme[Scheme[\"mailto\"] = 6] = \"mailto\";\n Scheme[Scheme[\"pipe\"] = 7] = \"pipe\";\n Scheme[Scheme[\"tcp\"] = 8] = \"tcp\";\n Scheme[Scheme[\"news\"] = 9] = \"news\";\n Scheme[Scheme[\"nntp\"] = 10] = \"nntp\";\n Scheme[Scheme[\"telnet\"] = 11] = \"telnet\";\n Scheme[Scheme[\"uuid\"] = 12] = \"uuid\";\n })(Scheme || (Scheme = {}));\n var PIPE = 'net.pipe';\n var TCP = 'net.tcp';\n Scheme[Scheme.pipe] = PIPE;\n Scheme[Scheme.tcp] = TCP;\n Scheme[PIPE] = Scheme.pipe;\n Scheme[TCP] = Scheme.tcp;\n Object.freeze(Scheme);\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = Scheme;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx\r\n */\r\n\r\n// TODO: Possibly use string literals instead.\r\nenum Scheme {\r\n\t/**\r\n\t * The resource is a file on the local computer.\r\n\t */\r\n\tfile,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through FTP.\r\n\t */\r\n\tftp,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the Gopher protocol.\r\n\t */\r\n\tgopher,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through HTTP.\r\n\t */\r\n\thttp,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through SSL-encrypted HTTP.\r\n\t */\r\n\thttps,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the LDAP protocol.\r\n\t */\r\n\tldap,\r\n\r\n\r\n\t/**\r\n\t * The resource is an e-mail address and accessed through the SMTP protocol.\r\n\t */\r\n\tmailto,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through a named pipe.\r\n\t */\r\n\tpipe,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed from TCP endpoint.\r\n\t */\r\n\ttcp,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the NNTP protocol.\r\n\t */\r\n\tnews,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the NNTP protocol.\r\n\t */\r\n\tnntp,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the TELNET protocol.\r\n\t */\r\n\ttelnet,\r\n\r\n\t/**\r\n\t * The resource is accessed through a unique UUID endpoint name for communicating with a service.\r\n\t */\r\n\tuuid\r\n}\r\n\r\n// Extend the usefulness of the enum.\r\nconst PIPE = 'net.pipe';\r\nconst TCP = 'net.tcp';\r\n\r\nScheme[Scheme.pipe] = PIPE;\r\nScheme[Scheme.tcp] = TCP;\r\n\r\n(Scheme)[PIPE] = Scheme.pipe;\r\n(Scheme)[TCP] = Scheme.tcp;\r\n\r\nObject.freeze(Scheme);\r\n\r\nexport default Scheme;\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Uri/Uri.d.ts b/dist/amd/System/Uri/Uri.d.ts new file mode 100644 index 00000000..731d150d --- /dev/null +++ b/dist/amd/System/Uri/Uri.d.ts @@ -0,0 +1,48 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier + */ +import UriScheme from "../Uri/Scheme"; +export default class Uri implements IUri, IEquatable { + scheme: SchemeValue; + userInfo: string; + host: string; + port: number; + path: string; + query: string; + fragment: string; + queryParams: IMap; + constructor(scheme: UriScheme | SchemeValue, userInfo: string, host: string, port: number, path: string, query?: QueryParamsConvertible, fragment?: string); + equals(other: IUri): boolean; + static from(uri: string | IUri, defaults?: IUri): Uri; + static parse(url: string, throwIfInvalid?: boolean): IUri; + static tryParse(url: string, out: (result: IUri) => void): boolean; + static copyOf(map: IUri): IUri; + copyTo(map: IUri): IUri; + updateQuery(query: QueryParamsConvertible): Uri; + protected getAbsoluteUri(): string; + protected getAuthority(): string; + protected getPathAndQuery(): string; + absoluteUri: string; + authority: string; + pathAndQuery: string; + baseUri: string; + pathSegments: string[]; + toMap(): IUri; + toString(): string; + static toString(uri: IUri): string; + static getAuthority(uri: IUri): string; +} +export declare enum Fields { + scheme = 0, + userInfo = 1, + host = 2, + port = 3, + path = 4, + query = 5, + fragment = 6, +} diff --git a/dist/amd/System/Uri/Uri.js b/dist/amd/System/Uri/Uri.js new file mode 100644 index 00000000..9397353c --- /dev/null +++ b/dist/amd/System/Uri/Uri.js @@ -0,0 +1,7 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier + */ +define(["require","exports","../Types","../Uri/QueryParams","../Text/Utility","../Uri/Scheme","../Exceptions/ArgumentException","../Exceptions/ArgumentOutOfRangeException"],function(t,e,r,n,u,i,o,s){"use strict";function a(t,e){var r,n=0;for(e||(e={});r=v[n++];){var u=t[r];u&&(e[r]=u)}return e}function f(t){var e=t;if(r["default"].isString(e)){if(!e)return y;if(e=i["default"][u.trim(e).toLowerCase().replace(/[^a-z0-9+.-]+$/g,q)],isNaN(e))throw new s["default"]("scheme",t,"Invalid scheme.")}if(r["default"].isNumber(e,!1)){if(e=i["default"][e],!e)throw new s["default"]("scheme",t,"Invalid scheme.");return e}return y}function l(t){if(0===t)return t;if(!t)return null;var e;if(r["default"].isNumber(t,!0)){if(e=t,e>=0&&isFinite(e))return e}else if(r["default"].isString(t)&&(e=parseInt(t))&&!isNaN(e))return l(e);throw new o["default"]("port","invalid value")}function h(t){if(!t.host){if(t.userInfo)throw new o["default"]("host","Cannot include user info when there is no host.");if(r["default"].isNumber(t.port,!1))throw new o["default"]("host","Cannot include a port when there is no host.")}var e=t.host||q;return e&&(t.userInfo&&(e=t.userInfo+I+e),isNaN(t.port)||(e+=":"+t.port),e=O+e),e}function c(t){return t&&(0!==t.indexOf(x)?x:q)+t}function p(t){return t&&(0!==t.indexOf(N)?N:q)+t}function d(t){var e=t.path,r=t.query;return q+(e||q)+(c(r)||q)}function g(t){var e=f(t.scheme),r=h(t),n=d(t),u=p(t.fragment),i=q+(e&&e+":"||q)+(r||q),s=q+(n||q)+(u||q);if(i&&s&&e&&!r)throw new o["default"]("authority","Cannot format schemed Uri with missing authority.");return i&&n&&0!==n.indexOf(w)&&(s=w+s),i+s}function m(t,e){if(!t)return new o["default"]("url","Nothing to parse.");var r,n={};if(r=t.indexOf(N),-1!=r&&(n.fragment=t.substring(r+1)||y,t=t.substring(0,r)),r=t.indexOf(x),-1!=r&&(n.query=t.substring(r+1)||y,t=t.substring(0,r)),r=t.indexOf(O),-1!=r){var i=u.trim(t.substring(0,r)),s=/:$/;if(!s.test(i))return new o["default"]("url","Scheme was improperly formatted");i=u.trim(i.replace(s,q));try{n.scheme=f(i)||y}catch(l){return l}t=t.substring(r+2)}if(r=t.indexOf(w),-1!=r&&(n.path=t.substring(r),t=t.substring(0,r)),r=t.indexOf(I),-1!=r&&(n.userInfo=t.substring(0,r)||y,t=t.substring(r+1)),r=t.indexOf(":"),-1!=r){var h=parseInt(u.trim(t.substring(r+1)));if(isNaN(h))return new o["default"]("url","Port was invalid.");n.port=h,t=t.substring(0,r)}return t=u.trim(t),t&&(n.host=t),e(a(n)),null}var y=void 0,b=function(){function t(t,e,u,i,o,s,a){var h=this;h.scheme=f(t)||null,h.userInfo=e||null,h.host=u||null,h.port=l(i),h.authority=h.getAuthority()||null,h.path=o||null,r["default"].isString(s)||(s=n.encode(s)),h.query=c(s)||null,Object.freeze(h.queryParams=h.query?n.parseToMap(h.query):{}),h.pathAndQuery=h.getPathAndQuery()||null,h.fragment=p(a)||null,h.absoluteUri=h.getAbsoluteUri(),h.baseUri=h.absoluteUri.replace(/[?#].*/,""),Object.freeze(h)}return t.prototype.equals=function(e){return this===e||this.absoluteUri==t.toString(e)},t.from=function(e,n){var u=!e||r["default"].isString(e)?t.parse(e):e;return new t(u.scheme||n&&n.scheme,u.userInfo||n&&n.userInfo,u.host||n&&n.host,isNaN(u.port)?n&&n.port:u.port,u.path||n&&n.path,u.query||n&&n.query,u.fragment||n&&n.fragment)},t.parse=function(t,e){void 0===e&&(e=!0);var r=null,n=m(t,function(t){r=t});if(e&&n)throw n;return r},t.tryParse=function(t,e){return!m(t,e)},t.copyOf=function(t){return a(t)},t.prototype.copyTo=function(t){return a(this,t)},t.prototype.updateQuery=function(e){var r=this.toMap();return r.query=e,t.from(r)},t.prototype.getAbsoluteUri=function(){return g(this)},t.prototype.getAuthority=function(){return h(this)},t.prototype.getPathAndQuery=function(){return d(this)},Object.defineProperty(t.prototype,"pathSegments",{get:function(){return this.path.match(/^[\/]|[^\/]*[\/]|[^\/]+$/g)},enumerable:!0,configurable:!0}),t.prototype.toMap=function(){return this.copyTo({})},t.prototype.toString=function(){return this.absoluteUri},t.toString=function(e){return e instanceof t?e.absoluteUri:g(e)},t.getAuthority=function(t){return h(t)},t}();Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=b,function(t){t[t.scheme=0]="scheme",t[t.userInfo=1]="userInfo",t[t.host=2]="host",t[t.port=3]="port",t[t.path=4]="path",t[t.query=5]="query",t[t.fragment=6]="fragment"}(e.Fields||(e.Fields={}));var v=e.Fields;Object.freeze(v);var w="/",O="//",x="?",N="#",q="",I="@"}); +//# sourceMappingURL=Uri.js.map diff --git a/dist/amd/System/Uri/Uri.js.map b/dist/amd/System/Uri/Uri.js.map new file mode 100644 index 00000000..e7e7a3ac --- /dev/null +++ b/dist/amd/System/Uri/Uri.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Uri/Uri.js","System/Uri/Uri.ts"],"names":["define","require","exports","Types_1","QueryParams","Utility_1","Scheme_1","ArgumentException_1","ArgumentOutOfRangeException_1","copyUri","from","to","field","i","Fields","value","getScheme","scheme","s","isString","VOID0","trim","toLowerCase","replace","EMPTY","isNaN","isNumber","getPort","port","p","isFinite","parseInt","getAuthority","uri","host","userInfo","result","AT","SLASH2","formatQuery","query","indexOf","QM","formatFragment","fragment","HASH","getPathAndQuery","path","uriToString","authority","pathAndQuery","part1","part2","SLASH","tryParse","url","out","substring","c","test","ex","Uri","_","this","encode","Object","freeze","queryParams","parseToMap","absoluteUri","getAbsoluteUri","baseUri","prototype","equals","other","toString","defaults","u","parse","throwIfInvalid","copyOf","map","copyTo","updateQuery","toMap","defineProperty","get","match","enumerable","configurable"],"mappings":";;;;;AAKAA,QAAQ,UAAW,UAAW,WAAY,qBAAsB,kBAAmB,gBAAiB,kCAAmC,6CAA8C,SAAUC,EAASC,EAASC,EAASC,EAAaC,EAAWC,EAAUC,EAAqBC,GCIjR,YA8QA,SAAAC,GAAiBC,EAAWC,GAE3B,GAAWC,GAAPC,EAAI,CAER,KADIF,IAAIA,MACFC,EAAQE,EAAOD,MACrB,CACC,GAAIE,GAAcL,EAAME,EACrBG,KAAaJ,EAAIC,GAASG,GAE9B,MAAOJ,GAKR,QAAAK,GAAmBC,GAElB,GAAIC,GAAQD,CACZ,IAAGd,EAAAA,WAAKgB,SAASD,GACjB,CACC,IAAIA,EAAG,MAAOE,EAId,IAFAF,EAAIZ,EAAAA,WAAeD,EAAAgB,KAAKH,GAAGI,cAAcC,QAAQ,kBAAmBC,IAEjEC,MAAMP,GACR,KAAM,IAAIV,GAAAA,WAA4B,SAAUS,EAAQ,mBAG1D,GAAGd,EAAAA,WAAKuB,SAASR,GAAG,GACpB,CAEC,GADAA,EAAIZ,EAAAA,WAAkBY,IAClBA,EACH,KAAM,IAAIV,GAAAA,WAA4B,SAAUS,EAAQ,kBAEzD,OAAOC,GAGR,MAAOE,GAGR,QAAAO,GAAiBC,GAEhB,GAAU,IAAPA,EAAU,MAAeA,EAC5B,KAAIA,EAAM,MAAO,KACjB,IAAIC,EAEJ,IAAG1B,EAAAA,WAAKuB,SAASE,GAAM,IAGtB,GADAC,EAAYD,EACTC,GAAG,GAAKC,SAASD,GACnB,MAAOA,OAEJ,IAAG1B,EAAAA,WAAKgB,SAASS,KAAUC,EAAIE,SAAiBH,MAAWH,MAAMI,GAErE,MAAOF,GAAQE,EAGhB,MAAM,IAAItB,GAAAA,WAAkB,OAAQ,iBAGrC,QAAAyB,GAAsBC,GAGrB,IAAIA,EAAIC,KACR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A,EAAAA,EAAA,SAAA,GAAA,YAPWZ,EAAAY,SAAAZ,EAAAY,WAAZ,IAAYA,GAAAZ,EAAAY,MASZmD,QAAOC,OAAOpD,EAcd,IAAMuC,GAAQ,IAAKf,EAAS,KAAMI,EAAK,IAAKG,EAAO,IAAKrB,EAAQ,GAAIa,EAAK","file":"System/Uri/Uri.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier\n */\ndefine([\"require\", \"exports\", \"../Types\", \"../Uri/QueryParams\", \"../Text/Utility\", \"../Uri/Scheme\", \"../Exceptions/ArgumentException\", \"../Exceptions/ArgumentOutOfRangeException\"], function (require, exports, Types_1, QueryParams, Utility_1, Scheme_1, ArgumentException_1, ArgumentOutOfRangeException_1) {\n 'use strict';\n var VOID0 = void (0);\n var Uri = (function () {\n function Uri(scheme, userInfo, host, port, path, query, fragment) {\n var _ = this;\n _.scheme = getScheme(scheme) || null;\n _.userInfo = userInfo || null;\n _.host = host || null;\n _.port = getPort(port);\n _.authority = _.getAuthority() || null;\n _.path = path || null;\n if (!Types_1.default.isString(query))\n query = QueryParams.encode(query);\n _.query = formatQuery(query) || null;\n Object.freeze(_.queryParams\n = _.query\n ? QueryParams.parseToMap(_.query)\n : {});\n _.pathAndQuery = _.getPathAndQuery() || null;\n _.fragment = formatFragment(fragment) || null;\n _.absoluteUri = _.getAbsoluteUri();\n _.baseUri = _.absoluteUri.replace(/[?#].*/, '');\n Object.freeze(_);\n }\n Uri.prototype.equals = function (other) {\n return this === other || this.absoluteUri == Uri.toString(other);\n };\n Uri.from = function (uri, defaults) {\n var u = (!uri || Types_1.default.isString(uri))\n ? Uri.parse(uri) : uri;\n return new Uri(u.scheme || defaults && defaults.scheme, u.userInfo || defaults && defaults.userInfo, u.host || defaults && defaults.host, isNaN(u.port) ? defaults && defaults.port : u.port, u.path || defaults && defaults.path, u.query || defaults && defaults.query, u.fragment || defaults && defaults.fragment);\n };\n Uri.parse = function (url, throwIfInvalid) {\n if (throwIfInvalid === void 0) { throwIfInvalid = true; }\n var result = null;\n var ex = tryParse(url, function (out) { result = out; });\n if (throwIfInvalid && ex)\n throw ex;\n return result;\n };\n Uri.tryParse = function (url, out) {\n return !tryParse(url, out);\n };\n Uri.copyOf = function (map) {\n return copyUri(map);\n };\n Uri.prototype.copyTo = function (map) {\n return copyUri(this, map);\n };\n Uri.prototype.updateQuery = function (query) {\n var map = this.toMap();\n map.query = query;\n return Uri.from(map);\n };\n Uri.prototype.getAbsoluteUri = function () {\n return uriToString(this);\n };\n Uri.prototype.getAuthority = function () {\n return getAuthority(this);\n };\n Uri.prototype.getPathAndQuery = function () {\n return getPathAndQuery(this);\n };\n Object.defineProperty(Uri.prototype, \"pathSegments\", {\n get: function () {\n return this.path.match(/^[/]|[^/]*[/]|[^/]+$/g);\n },\n enumerable: true,\n configurable: true\n });\n Uri.prototype.toMap = function () {\n return this.copyTo({});\n };\n Uri.prototype.toString = function () {\n return this.absoluteUri;\n };\n Uri.toString = function (uri) {\n return uri instanceof Uri\n ? uri.absoluteUri\n : uriToString(uri);\n };\n Uri.getAuthority = function (uri) {\n return getAuthority(uri);\n };\n return Uri;\n }());\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = Uri;\n (function (Fields) {\n Fields[Fields[\"scheme\"] = 0] = \"scheme\";\n Fields[Fields[\"userInfo\"] = 1] = \"userInfo\";\n Fields[Fields[\"host\"] = 2] = \"host\";\n Fields[Fields[\"port\"] = 3] = \"port\";\n Fields[Fields[\"path\"] = 4] = \"path\";\n Fields[Fields[\"query\"] = 5] = \"query\";\n Fields[Fields[\"fragment\"] = 6] = \"fragment\";\n })(exports.Fields || (exports.Fields = {}));\n var Fields = exports.Fields;\n Object.freeze(Fields);\n function copyUri(from, to) {\n var i = 0, field;\n if (!to)\n to = {};\n while (field = Fields[i++]) {\n var value = from[field];\n if (value)\n to[field] = value;\n }\n return to;\n }\n var SLASH = '/', SLASH2 = '//', QM = '?', HASH = '#', EMPTY = '', AT = '@';\n function getScheme(scheme) {\n var s = scheme;\n if (Types_1.default.isString(s)) {\n if (!s)\n return VOID0;\n s = Scheme_1.default[Utility_1.trim(s).toLowerCase().replace(/[^a-z0-9+.-]+$/g, EMPTY)];\n if (isNaN(s))\n throw new ArgumentOutOfRangeException_1.default('scheme', scheme, 'Invalid scheme.');\n }\n if (Types_1.default.isNumber(s, false)) {\n s = Scheme_1.default[s];\n if (!s)\n throw new ArgumentOutOfRangeException_1.default('scheme', scheme, 'Invalid scheme.');\n return s;\n }\n return VOID0;\n }\n function getPort(port) {\n if (port === 0)\n return port;\n if (!port)\n return null;\n var p;\n if (Types_1.default.isNumber(port, true)) {\n p = port;\n if (p >= 0 && isFinite(p))\n return p;\n }\n else if (Types_1.default.isString(port) && (p = parseInt(port)) && !isNaN(p)) {\n return getPort(p);\n }\n throw new ArgumentException_1.default(\"port\", \"invalid value\");\n }\n function getAuthority(uri) {\n if (!uri.host) {\n if (uri.userInfo)\n throw new ArgumentException_1.default('host', 'Cannot include user info when there is no host.');\n if (Types_1.default.isNumber(uri.port, false))\n throw new ArgumentException_1.default('host', 'Cannot include a port when there is no host.');\n }\n var result = uri.host || EMPTY;\n if (result) {\n if (uri.userInfo)\n result = uri.userInfo + AT + result;\n if (!isNaN(uri.port))\n result += ':' + uri.port;\n result = SLASH2 + result;\n }\n return result;\n }\n function formatQuery(query) {\n return query && ((query.indexOf(QM) !== 0 ? QM : EMPTY) + query);\n }\n function formatFragment(fragment) {\n return fragment && ((fragment.indexOf(HASH) !== 0 ? HASH : EMPTY) + fragment);\n }\n function getPathAndQuery(uri) {\n var path = uri.path, query = uri.query;\n return EMPTY\n + (path || EMPTY)\n + (formatQuery(query) || EMPTY);\n }\n function uriToString(uri) {\n var scheme = getScheme(uri.scheme), authority = getAuthority(uri), pathAndQuery = getPathAndQuery(uri), fragment = formatFragment(uri.fragment);\n var part1 = EMPTY\n + ((scheme && (scheme + ':')) || EMPTY)\n + (authority || EMPTY);\n var part2 = EMPTY\n + (pathAndQuery || EMPTY)\n + (fragment || EMPTY);\n if (part1 && part2 && scheme && !authority)\n throw new ArgumentException_1.default('authority', \"Cannot format schemed Uri with missing authority.\");\n if (part1 && pathAndQuery && pathAndQuery.indexOf(SLASH) !== 0)\n part2 = SLASH + part2;\n return part1 + part2;\n }\n function tryParse(url, out) {\n if (!url)\n return new ArgumentException_1.default('url', 'Nothing to parse.');\n var i, result = {};\n i = url.indexOf(HASH);\n if (i != -1) {\n result.fragment = url.substring(i + 1) || VOID0;\n url = url.substring(0, i);\n }\n i = url.indexOf(QM);\n if (i != -1) {\n result.query = url.substring(i + 1) || VOID0;\n url = url.substring(0, i);\n }\n i = url.indexOf(SLASH2);\n if (i != -1) {\n var scheme = Utility_1.trim(url.substring(0, i)), c = /:$/;\n if (!c.test(scheme))\n return new ArgumentException_1.default('url', 'Scheme was improperly formatted');\n scheme = Utility_1.trim(scheme.replace(c, EMPTY));\n try {\n result.scheme = getScheme(scheme) || VOID0;\n }\n catch (ex) {\n return ex;\n }\n url = url.substring(i + 2);\n }\n i = url.indexOf(SLASH);\n if (i != -1) {\n result.path = url.substring(i);\n url = url.substring(0, i);\n }\n i = url.indexOf(AT);\n if (i != -1) {\n result.userInfo = url.substring(0, i) || VOID0;\n url = url.substring(i + 1);\n }\n i = url.indexOf(':');\n if (i != -1) {\n var port = parseInt(Utility_1.trim(url.substring(i + 1)));\n if (isNaN(port))\n return new ArgumentException_1.default('url', 'Port was invalid.');\n result.port = port;\n url = url.substring(0, i);\n }\n url = Utility_1.trim(url);\n if (url)\n result.host = url;\n out(copyUri(result));\n return null;\n }\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier\r\n */\r\n\r\n///\r\n///\r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nimport Type from \"../Types\";\r\nimport * as QueryParams from \"../Uri/QueryParams\";\r\nimport {trim} from \"../Text/Utility\";\r\nimport UriScheme from \"../Uri/Scheme\";\r\nimport Exception from \"../Exception\";\r\nimport ArgumentException from \"../Exceptions/ArgumentException\";\r\nimport ArgumentOutOfRangeException from \"../Exceptions/ArgumentOutOfRangeException\";\r\n\r\nconst VOID0:any = void(0);\r\n\r\n/**\r\n * Provides an read-only model representation of a uniform resource identifier (URI) and easy access to the parts of the URI.\r\n *\r\n * The read-only model (frozen) is easier for debugging than exposing accessors for each property.\r\n * ICloneable<Uri> is not used to prevent unnecessary copying of values that won't change.\r\n */\r\nexport default class Uri implements IUri, IEquatable\r\n{\r\n\r\n\tscheme:SchemeValue;\r\n\tuserInfo:string;\r\n\thost:string;\r\n\tport:number;\r\n\tpath:string;\r\n\tquery:string;\r\n\tfragment:string;\r\n\r\n\tqueryParams:IMap;\r\n\r\n\t/**\r\n\t * @param scheme The user name, password, or other user-specific information associated with the specified URI.\r\n\t * @param userInfo The host component of this instance.\r\n\t * @param host The port number of this URI.\r\n\t * @param port The absolute path of the URI.\r\n\t * @param path The absolute path of the URI.\r\n\t * @param query Any query information included in the specified URI.\r\n\t * @param fragment The escaped URI fragment.\r\n\t */\r\n\tconstructor(\r\n\t\tscheme:UriScheme|SchemeValue,\r\n\t\tuserInfo:string,\r\n\t\thost:string,\r\n\t\tport:number,\r\n\t\tpath:string,\r\n\t\tquery?:QueryParamsConvertible,\r\n\t\tfragment?:string)\r\n\t{\r\n\t\tvar _ = this;\r\n\t\t_.scheme = getScheme(scheme) || null;\r\n\t\t_.userInfo = userInfo || null;\r\n\t\t_.host = host || null;\r\n\r\n\t\t_.port = getPort(port);\r\n\r\n\t\t_.authority = _.getAuthority() || null;\r\n\r\n\t\t_.path = path || null;\r\n\r\n\r\n\t\tif(!Type.isString(query))\r\n\t\t\tquery = QueryParams.encode([]>query);\r\n\r\n\t\t_.query = formatQuery(query) || null;\r\n\t\tObject.freeze(_.queryParams\r\n\t\t\t= _.query\r\n\t\t\t? QueryParams.parseToMap(_.query)\r\n\t\t\t: {});\r\n\r\n\t\t_.pathAndQuery = _.getPathAndQuery() || null;\r\n\r\n\t\t_.fragment = formatFragment(fragment) || null;\r\n\r\n\t\t// This should validate the uri...\r\n\t\t_.absoluteUri = _.getAbsoluteUri();\r\n\r\n\t\t_.baseUri = _.absoluteUri.replace(/[?#].*/, '');\r\n\r\n\t\t// Intended to be read-only. Call .toMap() to get a writable copy.\r\n\t\tObject.freeze(_);\r\n\t}\r\n\r\n\t/**\r\n\t * Compares the values of another IUri via toString comparison.\r\n\t * @param other\r\n\t * @returns {boolean}\r\n\t */\r\n\tequals(other:IUri):boolean\r\n\t{\r\n\t\treturn this===other || this.absoluteUri==Uri.toString(other);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Parses or clones values from existing Uri values.\r\n\t * @param uri\r\n\t * @param defaults\r\n\t * @returns {Uri}\r\n\t */\r\n\tstatic from(uri:string|IUri, defaults?:IUri):Uri\r\n\t{\r\n\t\tvar u = (!uri || Type.isString(uri))\r\n\t\t\t? Uri.parse(uri) : uri;\r\n\r\n\t\treturn new Uri(\r\n\t\t\tu.scheme || defaults && defaults.scheme,\r\n\t\t\tu.userInfo || defaults && defaults.userInfo,\r\n\t\t\tu.host || defaults && defaults.host,\r\n\t\t\tisNaN(u.port) ? defaults && defaults.port : u.port,\r\n\t\t\tu.path || defaults && defaults.path,\r\n\t\t\tu.query || defaults && defaults.query,\r\n\t\t\tu.fragment || defaults && defaults.fragment\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Parses a URL into it's components.\r\n\t * @param url The url to parse.\r\n\t * @param throwIfInvalid Defaults to true.\r\n\t * @returns {IUri} Returns a map of the values or *null* if invalid and *throwIfInvalid* is false.\r\n\t */\r\n\tstatic parse(url:string, throwIfInvalid:boolean = true):IUri\r\n\t{\r\n\t\tvar result:IUri = null;\r\n\t\tvar ex = tryParse(url, (out)=> {result = out;});\r\n\t\tif(throwIfInvalid && ex) throw ex;\r\n\t\treturn result;\r\n\t}\r\n\r\n\t/**\r\n\t * Parses a URL into it's components.\r\n\t * @param url The url to parse.\r\n\t * @param out A delegate to capture the value.\r\n\t * @returns {boolean} True if valid. False if invalid.\r\n\t */\r\n\tstatic tryParse(url:string, out:(result:IUri)=>void):boolean\r\n\t{\r\n\t\treturn !tryParse(url, out); // return type is Exception.\r\n\t}\r\n\r\n\tstatic copyOf(map:IUri):IUri\r\n\t{\r\n\t\treturn copyUri(map);\r\n\t}\r\n\r\n\tcopyTo(map:IUri):IUri\r\n\t{\r\n\t\treturn copyUri(this, map);\r\n\t}\r\n\r\n\tupdateQuery(query:QueryParamsConvertible):Uri\r\n\t{\r\n\t\tvar map = this.toMap();\r\n\t\tmap.query = query;\r\n\t\treturn Uri.from(map);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Is provided for sub classes to override this value.\r\n\t */\r\n\tprotected getAbsoluteUri():string\r\n\t{\r\n\t\treturn uriToString(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Is provided for sub classes to override this value.\r\n\t */\r\n\tprotected getAuthority():string\r\n\t{\r\n\t\treturn getAuthority(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Is provided for sub classes to override this value.\r\n\t */\r\n\tprotected getPathAndQuery():string\r\n\t{\r\n\t\treturn getPathAndQuery(this);\r\n\t}\r\n\r\n\t/**\r\n\t * The absolute URI.\r\n\t */\r\n\tabsoluteUri:string;\r\n\r\n\t/**\r\n\t * Gets the Domain Name System (DNS) host name or IP address and the port number for a server.\r\n\t */\r\n\tauthority:string;\r\n\r\n\t/**\r\n\t * Gets the path and Query properties separated by a question mark (?).\r\n\t */\r\n\tpathAndQuery:string;\r\n\r\n\t/**\r\n\t * Gets the full path without the query or fragment.\r\n\t */\r\n\tbaseUri:string;\r\n\r\n\t/**\r\n\t * The segments that represent a path.
\r\n\t * https://msdn.microsoft.com/en-us/library/system.uri.segments%28v=vs.110%29.aspx\r\n\t *\r\n\t *
Example:
\r\n\t * If the path value equals: ```/tree/node/index.html```
\r\n\t * The result will be: ```['/','tree/','node/','index.html']```\r\n\t * @returns {string[]}\r\n\t */\r\n\tget pathSegments():string[]\r\n\t{\r\n\t\treturn this.path.match(/^[/]|[^/]*[/]|[^/]+$/g);\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a writable copy.\r\n\t * @returns {IUri}\r\n\t */\r\n\ttoMap():IUri\r\n\t{\r\n\t\treturn this.copyTo({});\r\n\t}\r\n\r\n\t/**\r\n\t * @returns {string} The full absolute uri.\r\n\t */\r\n\ttoString():string\r\n\t{\r\n\t\treturn this.absoluteUri;\r\n\t}\r\n\r\n\t/**\r\n\t * Properly converts an existing URI to a string.\r\n\t * @param uri\r\n\t * @returns {string}\r\n\t */\r\n\tstatic toString(uri:IUri):string\r\n\t{\r\n\t\treturn uri instanceof Uri\r\n\t\t\t? (uri).absoluteUri\r\n\t\t\t: uriToString(uri);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the authority segment of an URI.\r\n\t * @param uri\r\n\t * @returns {string}\r\n\t */\r\n\tstatic getAuthority(uri:IUri):string\r\n\t{\r\n\t\treturn getAuthority(uri);\r\n\t}\r\n\r\n\r\n}\r\n\r\nexport enum Fields {\r\n\tscheme,\r\n\tuserInfo,\r\n\thost,\r\n\tport,\r\n\tpath,\r\n\tquery,\r\n\tfragment\r\n}\r\nObject.freeze(Fields);\r\n\r\nfunction copyUri(from:IUri, to?:IUri)\r\n{\r\n\tvar i = 0, field:string;\r\n\tif(!to) to = {};\r\n\twhile(field = Fields[i++])\r\n\t{\r\n\t\tvar value = (from)[field];\r\n\t\tif(value) (to)[field] = value;\r\n\t}\r\n\treturn to;\r\n}\r\n\r\nconst SLASH = '/', SLASH2 = '//', QM = '?', HASH = '#', EMPTY = '', AT = '@';\r\n\r\nfunction getScheme(scheme:UriScheme|string):SchemeValue\r\n{\r\n\tvar s:any = scheme;\r\n\tif(Type.isString(s))\r\n\t{\r\n\t\tif(!s) return VOID0;\r\n\r\n\t\ts = UriScheme[trim(s).toLowerCase().replace(/[^a-z0-9+.-]+$/g, EMPTY)];\r\n\r\n\t\tif(isNaN(s))\r\n\t\t\tthrow new ArgumentOutOfRangeException('scheme', scheme, 'Invalid scheme.');\r\n\t}\r\n\r\n\tif(Type.isNumber(s, false))\r\n\t{\r\n\t\ts = UriScheme[s];\r\n\t\tif(!s)\r\n\t\t\tthrow new ArgumentOutOfRangeException('scheme', scheme, 'Invalid scheme.');\r\n\r\n\t\treturn s;\r\n\t}\r\n\r\n\treturn VOID0;\r\n}\r\n\r\nfunction getPort(port:number|string):number\r\n{\r\n\tif(port===0) return port;\r\n\tif(!port) return null;\r\n\tvar p:number;\r\n\r\n\tif(Type.isNumber(port, true))\r\n\t{\r\n\t\tp = port;\r\n\t\tif(p>=0 && isFinite(p))\r\n\t\t\treturn p;\r\n\t}\r\n\telse if(Type.isString(port) && (p = parseInt(port)) && !isNaN(p))\r\n\t{\r\n\t\treturn getPort(p);\r\n\t}\r\n\r\n\tthrow new ArgumentException(\"port\", \"invalid value\");\r\n}\r\n\r\nfunction getAuthority(uri:IUri):string\r\n{\r\n\r\n\tif(!uri.host)\r\n\t{\r\n\t\tif(uri.userInfo)\r\n\t\t\tthrow new ArgumentException('host', 'Cannot include user info when there is no host.');\r\n\r\n\t\tif(Type.isNumber(uri.port, false))\r\n\t\t\tthrow new ArgumentException('host', 'Cannot include a port when there is no host.');\r\n\t}\r\n\r\n\t/*\r\n\t * [//[user:password@]host[:port]]\r\n\t */\r\n\r\n\tvar result = uri.host || EMPTY;\r\n\r\n\tif(result)\r\n\t{\r\n\t\tif(uri.userInfo) result = uri.userInfo + AT + result;\r\n\t\tif(!isNaN(uri.port)) result += ':' + uri.port;\r\n\t\tresult = SLASH2 + result;\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\nfunction formatQuery(query:string):string\r\n{\r\n\treturn query && ((query.indexOf(QM)!==0 ? QM : EMPTY) + query);\r\n}\r\n\r\nfunction formatFragment(fragment:string):string\r\n{\r\n\treturn fragment && ((fragment.indexOf(HASH)!==0 ? HASH : EMPTY) + fragment);\r\n}\r\n\r\nfunction getPathAndQuery(uri:IUri):string\r\n{\r\n\r\n\tvar path = uri.path,\r\n\t query = uri.query;\r\n\r\n\treturn EMPTY\r\n\t\t+ (path || EMPTY)\r\n\t\t+ (formatQuery(query) || EMPTY);\r\n\r\n}\r\n\r\nfunction uriToString(uri:IUri):string\r\n{\r\n\t// scheme:[//[user:password@]domain[:port]][/]path[?query][#fragment]\r\n\t// {scheme}{authority}{path}{query}{fragment}\r\n\r\n\tvar scheme = getScheme(uri.scheme),\r\n\t authority = getAuthority(uri),\r\n\t pathAndQuery = getPathAndQuery(uri),\r\n\t fragment = formatFragment(uri.fragment);\r\n\r\n\tvar part1 = EMPTY\r\n\t\t+ ((scheme && (scheme + ':')) || EMPTY)\r\n\t\t+ (authority || EMPTY);\r\n\r\n\tvar part2 = EMPTY\r\n\t\t+ (pathAndQuery || EMPTY)\r\n\t\t+ (fragment || EMPTY);\r\n\r\n\tif(part1 && part2 && scheme && !authority)\r\n\t\tthrow new ArgumentException('authority', \"Cannot format schemed Uri with missing authority.\");\r\n\r\n\tif(part1 && pathAndQuery && pathAndQuery.indexOf(SLASH)!==0)\r\n\t\tpart2 = SLASH + part2;\r\n\r\n\treturn part1 + part2;\r\n\r\n}\r\n\r\n\r\nfunction tryParse(url:string, out:(result:IUri)=>void):Exception\r\n{\r\n\tif(!url)\r\n\t\treturn new ArgumentException('url', 'Nothing to parse.');\r\n\r\n\r\n\t// Could use a regex here, but well follow some rules instead.\r\n\t// The intention is to 'gather' the pieces. This isn't validation (yet).\r\n\r\n\t// scheme:[//[user:password@]domain[:port]][/]path[?query][#fragment]\r\n\tvar i:number, result:IUri = {};\r\n\r\n\t// Anything after the first # is the fragment.\r\n\ti = url.indexOf(HASH);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tresult.fragment = url.substring(i + 1) || VOID0;\r\n\t\turl = url.substring(0, i);\r\n\t}\r\n\r\n\t// Anything after the first ? is the query.\r\n\ti = url.indexOf(QM);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tresult.query = url.substring(i + 1) || VOID0;\r\n\t\turl = url.substring(0, i);\r\n\t}\r\n\r\n\t// Guarantees a separation.\r\n\ti = url.indexOf(SLASH2);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tvar scheme = trim(url.substring(0, i)), c = /:$/;\r\n\t\tif(!c.test(scheme))\r\n\t\t\treturn new ArgumentException('url', 'Scheme was improperly formatted');\r\n\r\n\t\tscheme = trim(scheme.replace(c, EMPTY));\r\n\t\ttry\r\n\t\t{\r\n\t\t\tresult.scheme = getScheme(scheme) || VOID0;\r\n\t\t}\r\n\t\tcatch(ex)\r\n\t\t{\r\n\t\t\treturn ex;\r\n\t\t}\r\n\r\n\t\turl = url.substring(i + 2);\r\n\t}\r\n\r\n\t// Find any path information.\r\n\ti = url.indexOf(SLASH);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tresult.path = url.substring(i);\r\n\t\turl = url.substring(0, i);\r\n\t}\r\n\r\n\t// Separate user info.\r\n\ti = url.indexOf(AT);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tresult.userInfo = url.substring(0, i) || VOID0;\r\n\t\turl = url.substring(i + 1);\r\n\t}\r\n\r\n\t// Remaining is host and port.\r\n\ti = url.indexOf(':');\r\n\tif(i!= -1)\r\n\t{\r\n\t\tvar port = parseInt(trim(url.substring(i + 1)));\r\n\t\tif(isNaN(port))\r\n\t\t\treturn new ArgumentException('url', 'Port was invalid.');\r\n\r\n\t\tresult.port = port;\r\n\t\turl = url.substring(0, i);\r\n\t}\r\n\r\n\turl = trim(url);\r\n\tif(url)\r\n\t\tresult.host = url;\r\n\r\n\tout(copyUri(result));\r\n\r\n\t// null is good! (here)\r\n\treturn null;\r\n\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Utility/applyMixins.d.ts b/dist/amd/System/Utility/applyMixins.d.ts new file mode 100644 index 00000000..89e245e2 --- /dev/null +++ b/dist/amd/System/Utility/applyMixins.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function applyMixins(derivedConstructor: any, baseConstructors: any[]): void; diff --git a/dist/amd/System/Utility/applyMixins.js b/dist/amd/System/Utility/applyMixins.js new file mode 100644 index 00000000..76c9f7a6 --- /dev/null +++ b/dist/amd/System/Utility/applyMixins.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +define(["require","exports"],function(e,t){"use strict";function o(e,t){t.forEach(function(t){Object.getOwnPropertyNames(t.prototype).forEach(function(o){e.prototype[o]=t.prototype[o]})})}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=o}); +//# sourceMappingURL=applyMixins.js.map diff --git a/dist/amd/System/Utility/applyMixins.js.map b/dist/amd/System/Utility/applyMixins.js.map new file mode 100644 index 00000000..ffbea800 --- /dev/null +++ b/dist/amd/System/Utility/applyMixins.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Utility/applyMixins.js","System/Utility/applyMixins.ts"],"names":["define","require","exports","applyMixins","derivedConstructor","baseConstructors","forEach","bc","Object","getOwnPropertyNames","prototype","name","defineProperty","value"],"mappings":";;;;AAIAA,QAAQ,UAAW,WAAY,SAAUC,EAASC,GAC9C,YCAJ,SAAAC,GAAoCC,EAAwBC,GAE3DA,EACEC,QAAQ,SAAAC,GAERC,OAAOC,oBAAoBF,EAAGG,WAAWJ,QACvC,SAAAK,GAEAP,EAAmBM,UAAUC,GAAQJ,EAAGG,UAAUC,OARvDH,OAAAI,eAAAV,EAAA,cAAAW,OAAA,IDUIX,EAAAA,WAAkBC","file":"System/Utility/applyMixins.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\ndefine([\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n function applyMixins(derivedConstructor, baseConstructors) {\n baseConstructors\n .forEach(function (bc) {\n Object.getOwnPropertyNames(bc.prototype).forEach(function (name) {\n derivedConstructor.prototype[name] = bc.prototype[name];\n });\n });\n }\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = applyMixins;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\nexport default function applyMixins(derivedConstructor:any, baseConstructors:any[]):void\r\n{\r\n\tbaseConstructors\r\n\t\t.forEach(bc =>\r\n\t\t{\r\n\t\t\tObject.getOwnPropertyNames(bc.prototype).forEach(\r\n\t\t\t\t\tname =>\r\n\t\t\t\t{\r\n\t\t\t\t\tderivedConstructor.prototype[name] = bc.prototype[name];\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t);\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Utility/clone.d.ts b/dist/amd/System/Utility/clone.d.ts new file mode 100644 index 00000000..3c3527fd --- /dev/null +++ b/dist/amd/System/Utility/clone.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function clone(source: any, depth?: number): any; diff --git a/dist/amd/System/Utility/clone.js b/dist/amd/System/Utility/clone.js new file mode 100644 index 00000000..c54da9a4 --- /dev/null +++ b/dist/amd/System/Utility/clone.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +define(["require","exports","../Types"],function(e,r,i){"use strict";function t(e,r){if(void 0===r&&(r=0),0>r)return e;if(!i["default"].isObject(e))return e;var f;if(Array.isArray(e)){if(f=e.slice(),r>0)for(var n=0;n0)for(var u in e)f[u]=t(e[u],r-1);return f}Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=t}); +//# sourceMappingURL=clone.js.map diff --git a/dist/amd/System/Utility/clone.js.map b/dist/amd/System/Utility/clone.js.map new file mode 100644 index 00000000..3f793b72 --- /dev/null +++ b/dist/amd/System/Utility/clone.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Utility/clone.js","System/Utility/clone.ts"],"names":["define","require","exports","Types_1","clone","source","depth","isObject","result","Array","isArray","slice","i","length","k","Object","defineProperty","value"],"mappings":";;;;AAIAA,QAAQ,UAAW,UAAW,YAAa,SAAUC,EAASC,EAASC,GACnE,YCEJ,SAAAC,GAA8BC,EAAYC,GAEzC,GAFyC,SAAAA,IAAAA,EAAA,GAEhC,EAANA,EACF,MAAOD,EAGR,KAAIF,EAAAA,WAAKI,SAASF,GAAS,MAAOA,EAElC,IAAIG,EACJ,IAAGC,MAAMC,QAAQL,IAGhB,GADAG,EAAeH,EAAQM,QACpBL,EAAM,EAER,IAAI,GAAIM,GAAI,EAAGA,EAAEJ,EAAOK,OAAQD,IAE/BJ,EAAOI,GAAKR,EAAMI,EAAOI,GAAIN,EAAQ,OAOvC,IADAE,KACGF,EAAM,EAAG,IAAI,GAAIQ,KAAKT,GAGxBG,EAAOM,GAAKV,EAAMC,EAAOS,GAAIR,EAAQ,EAIvC,OAAOE,GA9BRO,OAAAC,eAAAd,EAAA,cAAAe,OAAA,IDwBIf,EAAAA,WAAkBE","file":"System/Utility/clone.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\ndefine([\"require\", \"exports\", '../Types'], function (require, exports, Types_1) {\n \"use strict\";\n function clone(source, depth) {\n if (depth === void 0) { depth = 0; }\n if (depth < 0)\n return source;\n if (!Types_1.default.isObject(source))\n return source;\n var result;\n if (Array.isArray(source)) {\n result = source.slice();\n if (depth > 0) {\n for (var i = 0; i < result.length; i++) {\n result[i] = clone(result[i], depth - 1);\n }\n }\n }\n else {\n result = {};\n if (depth > 0)\n for (var k in source) {\n result[k] = clone(source[k], depth - 1);\n }\n }\n return result;\n }\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = clone;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\nimport Type from '../Types';\r\n\r\nexport default function clone(source:any, depth:number = 0):any\r\n{\r\n\tif(depth<0)\r\n\t\treturn source;\r\n\r\n\t// return primitives as is.\r\n\tif(!Type.isObject(source)) return source;\r\n\r\n\tvar result:any;\r\n\tif(Array.isArray(source))\r\n\t{\r\n\t\tresult = (source).slice();\r\n\t\tif(depth>0)\r\n\t\t{\r\n\t\t\tfor(let i = 0; i0) for(let k in source)\r\n\t\t{\r\n\t\t\t//noinspection JSUnfilteredForInLoop\r\n\t\t\tresult[k] = clone(source[k], depth - 1);\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/amd/System/Utility/shallowCopy.d.ts b/dist/amd/System/Utility/shallowCopy.d.ts new file mode 100644 index 00000000..df935e23 --- /dev/null +++ b/dist/amd/System/Utility/shallowCopy.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function shallowCopy(source: any, target?: any): any; diff --git a/dist/amd/System/Validation/ValidationResult.d.ts b/dist/amd/System/Validation/ValidationResult.d.ts new file mode 100644 index 00000000..8fdffed8 --- /dev/null +++ b/dist/amd/System/Validation/ValidationResult.d.ts @@ -0,0 +1,15 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class ValidationResult implements IValidationResult, IEquatable { + isValid: boolean; + message: string; + data: any; + constructor(isValid?: boolean, message?: string, data?: any); + equals(other: IValidationResult): boolean; + static valid: IValidationResult; + static invalid(message: string, data?: any): IValidationResult; +} diff --git a/dist/amd/System/Validation/ValidationResult.js b/dist/amd/System/Validation/ValidationResult.js new file mode 100644 index 00000000..d4421f1a --- /dev/null +++ b/dist/amd/System/Validation/ValidationResult.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +define(["require","exports"],function(e,i){"use strict";var t=new n(!0),n=function(){function e(e,i,t){void 0===e&&(e=!1),void 0===i&&(i=null),void 0===t&&(t=null),this.isValid=e,this.message=i,this.data=t,Object.freeze(this)}return e.prototype.equals=function(e){var i=this;return i.isValid===e.isValid&&i.message==i.message&&i.data==i.data},Object.defineProperty(e,"valid",{get:function(){return t},enumerable:!0,configurable:!0}),e.invalid=function(i,t){return void 0===t&&(t=null),new e(!1,i,t)},e}();Object.defineProperty(i,"__esModule",{value:!0}),i["default"]=n}); +//# sourceMappingURL=ValidationResult.js.map diff --git a/dist/amd/System/Validation/ValidationResult.js.map b/dist/amd/System/Validation/ValidationResult.js.map new file mode 100644 index 00000000..1325209e --- /dev/null +++ b/dist/amd/System/Validation/ValidationResult.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Validation/ValidationResult.js","System/Validation/ValidationResult.ts"],"names":["define","require","exports","valid","ValidationResult","isValid","message","data","this","Object","freeze","prototype","equals","other","_","defineProperty","get","enumerable","configurable","invalid","value"],"mappings":";;;;AAIAA,QAAQ,UAAW,WAAY,SAAUC,EAASC,GCGlD,YAEA,IAAMC,GAAQ,GAAIC,IAAiB,GAKnCA,EAAA,WAOC,QAAAA,GACQC,EACAC,EACAC,GAFP,SAAAF,IAAAA,GAAA,GACA,SAAAC,IAAAA,EAAA,MACA,SAAAC,IAAAA,EAAA,MAFOC,KAAAH,QAAAA,EACAG,KAAAF,QAAAA,EACAE,KAAAD,KAAAA,EAIPE,OAAOC,OAAOF,MAgChB,MA1BCJ,GAAAO,UAAAC,OAAA,SAAOC,GAEN,GAAIC,GAAIN,IACR,OAAOM,GAAET,UAAUQ,EAAMR,SACrBS,EAAER,SAASQ,EAAER,SACbQ,EAAEP,MAAMO,EAAEP,MAQfE,OAAAM,eAAWX,EAAA,SDvBAY,ICuBX,WACC,MAAOb,IDrBGc,YAAY,EACZC,cAAc,IC0BlBd,EAAAe,QAAP,SACCb,EACAC,GAEA,MAFA,UAAAA,IAAAA,EAAA,MAEO,GAAIH,IAAiB,EAAOE,EAASC,IAE9CH,IA9CAK,QAAAM,eAAAb,EAAA,cAAAkB,OAAA,IDuBIlB,EAAAA,WAAkBE","file":"System/Validation/ValidationResult.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\ndefine([\"require\", \"exports\"], function (require, exports) {\n 'use strict';\n var valid = new ValidationResult(true);\n var ValidationResult = (function () {\n function ValidationResult(isValid, message, data) {\n if (isValid === void 0) { isValid = false; }\n if (message === void 0) { message = null; }\n if (data === void 0) { data = null; }\n this.isValid = isValid;\n this.message = message;\n this.data = data;\n Object.freeze(this);\n }\n ValidationResult.prototype.equals = function (other) {\n var _ = this;\n return _.isValid === other.isValid\n && _.message == _.message\n && _.data == _.data;\n };\n Object.defineProperty(ValidationResult, \"valid\", {\n get: function () {\n return valid;\n },\n enumerable: true,\n configurable: true\n });\n ValidationResult.invalid = function (message, data) {\n if (data === void 0) { data = null; }\n return new ValidationResult(false, message, data);\n };\n return ValidationResult;\n }());\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = ValidationResult;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n/// \r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nconst valid = new ValidationResult(true);\r\n\r\n/**\r\n * A class for generating responses to validation.\r\n */\r\nexport default\r\nclass ValidationResult\r\nimplements IValidationResult, IEquatable\r\n{\r\n\t/**\r\n\t * Allows for rare cases that ValidationResult.valid and ValidationResult.invalid() don't cover.\r\n\t */\r\n\tconstructor(\r\n\t\tpublic isValid:boolean = false,\r\n\t\tpublic message:string = null,\r\n\t\tpublic data:any = null)\r\n\t{\r\n\r\n\t\t// Readonly...\r\n\t\tObject.freeze(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Allows for comparing another IValidationResult to see if they are equal.\r\n\t */\r\n\tequals(other:IValidationResult):boolean\r\n\t{\r\n\t\tvar _ = this;\r\n\t\treturn _.isValid===other.isValid\r\n\t\t\t&& _.message==_.message\r\n\t\t\t&& _.data==_.data;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Represents a single/shared instance of a valid result.\r\n\t * Allows for returning this instance like you would return 'true'.\r\n\t */\r\n\tstatic get valid():IValidationResult {\r\n\t\treturn valid;\r\n\t}\r\n\r\n\t/**\r\n\t * Factory method for easily creating an invalid result.\r\n\t */\r\n\tstatic invalid(\r\n\t\tmessage:string,\r\n\t\tdata:any = null):IValidationResult\r\n\t{\r\n\t\treturn new ValidationResult(false, message, data);\r\n\t}\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/amd/extends.d.ts b/dist/amd/extends.d.ts new file mode 100644 index 00000000..6a21de64 --- /dev/null +++ b/dist/amd/extends.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function (d: any, b: any): void; diff --git a/dist/commonjs/System.Linq/Linq.d.ts b/dist/commonjs/System.Linq/Linq.d.ts new file mode 100644 index 00000000..fabea935 --- /dev/null +++ b/dist/commonjs/System.Linq/Linq.d.ts @@ -0,0 +1,196 @@ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Original: http://linqjs.codeplex.com/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import Dictionary from "../System/Collections/Dictionaries/Dictionary"; +import DisposableBase from "../System/Disposable/DisposableBase"; +export declare const enum EnumerableAction { + Break = 0, + Return = 1, + Skip = 2, +} +export declare class InfiniteEnumerable extends DisposableBase implements IEnumerable { + protected _enumeratorFactory: () => IEnumerator; + constructor(_enumeratorFactory: () => IEnumerator, finalizer?: () => void); + protected _isEndless: boolean; + isEndless: boolean; + getEnumerator(): IEnumerator; + protected _onDispose(): void; + asEnumerable(): InfiniteEnumerable; + doAction(action: Action | Predicate | Selector | Selector, initializer?: () => void, isEndless?: boolean): InfiniteEnumerable; + force(): void; + skip(count: number): InfiniteEnumerable; + take(count: number): FiniteEnumerable; + elementAt(index: number): T; + elementAtOrDefault(index: number, defaultValue?: T): T; + first(): T; + firstOrDefault(defaultValue?: T): T; + single(): T; + singleOrDefault(defaultValue?: T): T; + any(): boolean; + isEmpty(): boolean; + traverseBreadthFirst(childrenSelector: (element: T) => IEnumerableOrArray): Enumerable; + traverseBreadthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray): Enumerable; + traverseBreadthFirst(childrenSelector: (element: T) => IEnumerableOrArray, resultSelector?: (element: T, nestLevel?: number) => TResult): Enumerable; + traverseBreadthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray, resultSelector?: (element: TNode, nestLevel?: number) => TResult): Enumerable; + traverseDepthFirst(childrenSelector: (element: T) => IEnumerableOrArray): Enumerable; + traverseDepthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray): Enumerable; + traverseDepthFirst(childrenSelector: (element: T) => IEnumerableOrArray, resultSelector?: (element: T, nestLevel?: number) => TResult): Enumerable; + traverseDepthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray, resultSelector?: (element: TNode, nestLevel?: number) => TResult): Enumerable; + flatten(): Enumerable; + pairwise(selector: (prev: T, current: T) => TSelect): Enumerable; + scan(func: (a: T, b: T) => T, seed?: T): Enumerable; + select(selector: Selector): InfiniteEnumerable; + protected _selectMany(collectionSelector: Selector>, resultSelector?: (collection: T, element: TElement) => TResult): Enumerable; + selectMany(collectionSelector: Selector>): InfiniteEnumerable; + selectMany(collectionSelector: Selector>, resultSelector: (collection: T, element: TElement) => TResult): InfiniteEnumerable; + protected _choose(selector: Selector): Enumerable; + choose(): InfiniteEnumerable; + choose(selector?: Selector): InfiniteEnumerable; + where(predicate: Predicate): InfiniteEnumerable; + ofType(type: { + new (...params: any[]): TType; + }): InfiniteEnumerable; + except(second: IEnumerableOrArray, compareSelector?: Selector): InfiniteEnumerable; + distinct(compareSelector?: (value: T) => T): InfiniteEnumerable; + distinctUntilChanged(compareSelector?: Selector): InfiniteEnumerable; + defaultIfEmpty(defaultValue?: T): Enumerable; + zip(second: IEnumerableOrArray, resultSelector: (first: T, second: TSecond, index?: number) => TResult): Enumerable; + zipMultiple(second: IArray>, resultSelector: (first: T, second: TSecond, index?: number) => TResult): Enumerable; + join(inner: IEnumerableOrArray, outerKeySelector: Selector, innerKeySelector: Selector, resultSelector: (outer: T, inner: TInner) => TResult, compareSelector?: Selector): Enumerable; + groupJoin(inner: IEnumerableOrArray, outerKeySelector: Selector, innerKeySelector: Selector, resultSelector: (outer: T, inner: TInner[]) => TResult, compareSelector?: Selector): Enumerable; + merge(enumerables: IArray>): InfiniteEnumerable; + concat(...enumerables: Array>): InfiniteEnumerable; + union(second: IEnumerableOrArray, compareSelector?: Selector): Enumerable; + insertAt(index: number, other: IEnumerableOrArray): Enumerable; + alternateMultiple(sequence: IEnumerableOrArray): Enumerable; + alternateSingle(value: T): Enumerable; + alternate(...sequence: T[]): Enumerable; + catchError(handler: (e: any) => void): InfiniteEnumerable; + finallyAction(action: () => void): InfiniteEnumerable; + buffer(size: number): InfiniteEnumerable; + share(): InfiniteEnumerable; +} +export declare class Enumerable extends InfiniteEnumerable { + constructor(enumeratorFactory: () => IEnumerator, finalizer?: () => void, isEndless?: boolean); + static from(source: IEnumerableOrArray): Enumerable; + static fromAny(source: IEnumerableOrArray): Enumerable; + static fromAny(source: any): Enumerable; + static fromOrEmpty(source: IEnumerableOrArray): Enumerable; + static toArray(source: IEnumerableOrArray): T[]; + static choice(values: IArray): InfiniteEnumerable; + static chooseFrom(...args: T[]): InfiniteEnumerable; + static cycle(values: IArray): InfiniteEnumerable; + static cycleThrough(...args: T[]): InfiniteEnumerable; + static empty(): FiniteEnumerable; + static repeat(element: T): InfiniteEnumerable; + static repeat(element: T, count: number): FiniteEnumerable; + static repeatWithFinalize(initializer: () => T, finalizer: (element: T) => void): InfiniteEnumerable; + static make(element: T): FiniteEnumerable; + static range(start: number, count: number, step?: number): FiniteEnumerable; + static rangeDown(start: number, count: number, step?: number): FiniteEnumerable; + static toInfinity(start?: number, step?: number): InfiniteEnumerable; + static toNegativeInfinity(start?: number, step?: number): InfiniteEnumerable; + static rangeTo(start: number, to: number, step?: number): FiniteEnumerable; + static matches(input: string, pattern: any, flags?: string): FiniteEnumerable; + static generate(factory: (index?: number) => T): InfiniteEnumerable; + static generate(factory: (index?: number) => T, count: number): FiniteEnumerable; + static unfold(seed: T, valueFactory: Selector, skipSeed?: Boolean): InfiniteEnumerable; + static forEach(enumerable: IEnumerableOrArray, action: (element: T, index?: number) => any): void; + static map(enumerable: IEnumerableOrArray, selector: Selector): TResult[]; + static max(values: FiniteEnumerable): number; + static min(values: FiniteEnumerable): number; + static weave(enumerables: IEnumerableOrArray>): Enumerable; + doAction(action: Action | Predicate | Selector | Selector, initializer?: () => void, isEndless?: boolean): Enumerable; + skip(count: number): Enumerable; + skipWhile(predicate: Predicate): Enumerable; + takeWhile(predicate: Predicate): Enumerable; + takeUntil(predicate: Predicate, includeUntilValue?: boolean): Enumerable; + forEach(action: Predicate | Action): void; + toArray(predicate?: Predicate): T[]; + copyTo(target: T[], index?: number): T[]; + toLookup(keySelector: Selector, elementSelector?: Selector, compareSelector?: Selector): ILookup; + toMap(keySelector: Selector, elementSelector: Selector): IMap; + toDictionary(keySelector: Selector, elementSelector: Selector, compareSelector?: Selector): Dictionary; + toJoinedString(separator?: string, selector?: Selector): string; + takeExceptLast(count?: number): Enumerable; + skipToLast(count: number): Enumerable; + where(predicate: Predicate): Enumerable; + select(selector: Selector): Enumerable; + selectMany(collectionSelector: Selector>): Enumerable; + selectMany(collectionSelector: Selector>, resultSelector: (collection: T, element: TElement) => TResult): Enumerable; + choose(): Enumerable; + choose(selector?: Selector): Enumerable; + reverse(): Enumerable; + shuffle(): Enumerable; + count(predicate?: Predicate): number; + all(predicate: Predicate): boolean; + every(predicate: Predicate): boolean; + any(predicate?: Predicate): boolean; + some(predicate: Predicate): boolean; + contains(value: T, compareSelector?: Selector): boolean; + indexOf(value: T, compareSelector?: Selector): number; + lastIndexOf(value: T, compareSelector?: Selector): number; + merge(enumerables: IArray>): Enumerable; + concat(...enumerables: Array>): Enumerable; + intersect(second: IEnumerableOrArray, compareSelector?: Selector): Enumerable; + sequenceEqual(second: IEnumerableOrArray, equalityComparer?: EqualityComparison): boolean; + ofType(type: { + new (...params: any[]): TType; + }): Enumerable; + except(second: IEnumerableOrArray, compareSelector?: Selector): Enumerable; + distinct(compareSelector?: (value: T) => T): Enumerable; + distinctUntilChanged(compareSelector?: Selector): Enumerable; + orderBy(keySelector?: Selector): IOrderedEnumerable; + orderUsing(comparison: Comparison): IOrderedEnumerable; + orderUsingReversed(comparison: Comparison): IOrderedEnumerable; + orderByDescending(keySelector?: Selector): IOrderedEnumerable; + buffer(size: number): Enumerable; + groupBy(keySelector: Selector): Enumerable>; + groupBy(keySelector: Selector, elementSelector?: Selector, compareSelector?: Selector): Enumerable>; + partitionBy(keySelector: Selector): Enumerable>; + partitionBy(keySelector: Selector, elementSelector: Selector, resultSelector?: (key: TKey, element: TElement[]) => IGrouping, compareSelector?: Selector): Enumerable>; + aggregate(func: (a: T, b: T) => T, seed?: T): T; + average(selector?: Selector): number; + max(): T; + min(): T; + maxBy(keySelector?: Selector): T; + minBy(keySelector?: Selector): T; + sum(selector?: Selector): number; + product(selector?: Selector): number; + quotient(selector?: Selector): number; + last(): T; + lastOrDefault(defaultValue?: T): T; + share(): Enumerable; + catchError(handler: (e: any) => void): Enumerable; + finallyAction(action: () => void): Enumerable; + memoize(): Enumerable; +} +export declare class FiniteEnumerable extends Enumerable { + constructor(enumeratorFactory: () => IEnumerator, finalizer?: () => void); +} +export interface IGrouping extends Enumerable { + key: TKey; +} +export interface ILookup extends IEnumerable> { + count: number; + get(key: TKey): TElement[]; + contains(key: TKey): boolean; +} +export interface IOrderedEnumerable extends FiniteEnumerable { + thenBy(keySelector: (value: T) => any): IOrderedEnumerable; + thenByDescending(keySelector: (value: T) => any): IOrderedEnumerable; + thenUsing(comparison: Comparison): IOrderedEnumerable; + thenUsingReversed(comparison: Comparison): IOrderedEnumerable; +} +export default Enumerable; diff --git a/dist/commonjs/System/Char.d.ts b/dist/commonjs/System/Char.d.ts new file mode 100644 index 00000000..fa6b5cef --- /dev/null +++ b/dist/commonjs/System/Char.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * From Netjs mscorlib.ts + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function isWhiteSpace(ch: number): boolean; +export declare function isLetter(ch: number): boolean; +export declare function isLetterOrDigit(ch: number): boolean; +export declare function isDigit(ch: number): boolean; +export declare function isDigit(str: string, index: number): boolean; diff --git a/dist/commonjs/System/Collections/Array/Compare.d.ts b/dist/commonjs/System/Collections/Array/Compare.d.ts new file mode 100644 index 00000000..2ce82c2d --- /dev/null +++ b/dist/commonjs/System/Collections/Array/Compare.d.ts @@ -0,0 +1,13 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function areAllEqual(arrays: any[][], strict?: boolean, equalityComparer?: EqualityComparison): boolean; +export declare function areEqual(a: IArray, b: IArray, strict?: boolean, equalityComparer?: EqualityComparison): boolean; +export declare function areEquivalent(a: IArray, b: IArray): boolean; +export declare function areEquivalent(a: IArray>, b: IArray>): boolean; +export declare function areEquivalent(a: IArray, b: IArray, comparer: Comparison): boolean; diff --git a/dist/commonjs/System/Collections/Array/Dispatch.d.ts b/dist/commonjs/System/Collections/Array/Dispatch.d.ts new file mode 100644 index 00000000..d9d28acc --- /dev/null +++ b/dist/commonjs/System/Collections/Array/Dispatch.d.ts @@ -0,0 +1,13 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export interface DispatchErrorHandler { + (ex?: any, i?: number): void; +} +export declare function unsafe(listeners: IArray<(payload: T) => any>, payload: T, trap?: boolean | DispatchErrorHandler): void; +export declare function mapped(listeners: IArray<(payload: T) => TResult>, payload: T, trap?: boolean | DispatchErrorHandler): TResult[]; +export declare function dispatch(listeners: IArray<(payload: T) => any>, payload: T, trap?: boolean | DispatchErrorHandler): void; +export default dispatch; diff --git a/dist/commonjs/System/Collections/Array/Dispatch.js b/dist/commonjs/System/Collections/Array/Dispatch.js new file mode 100644 index 00000000..a383d26f --- /dev/null +++ b/dist/commonjs/System/Collections/Array/Dispatch.js @@ -0,0 +1,47 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +"use strict"; + +var Types_1 = require("../../Types"); +var Utility_1 = require("./Utility"); +var VOID0 = void 0; +function unsafe(listeners, payload, trap) { + if (listeners && listeners.length) { + for (var i = 0, len = listeners.length; i < len; i++) { + var fn = listeners[i]; + if (!fn) continue; + try { + fn(payload); + } catch (ex) { + if (!trap) throw ex;else if (Types_1.default.isFunction(trap)) trap(ex, i); + } + } + } +} +exports.unsafe = unsafe; +function mapped(listeners, payload, trap) { + if (!listeners) return null; + var result = Utility_1.copy(listeners); + if (listeners.length) { + for (var i = 0, len = result.length; i < len; i++) { + var fn = result[i]; + try { + result[i] = fn ? fn(payload) : VOID0; + } catch (ex) { + result[i] = VOID0; + if (!trap) throw ex;else if (Types_1.default.isFunction(trap)) trap(ex, i); + } + } + } + return result; +} +exports.mapped = mapped; +function dispatch(listeners, payload, trap) { + unsafe(Utility_1.copy(listeners), payload, trap); +} +exports.dispatch = dispatch; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = dispatch; +//# sourceMappingURL=Dispatch.js.map diff --git a/dist/commonjs/System/Collections/Array/Dispatch.js.map b/dist/commonjs/System/Collections/Array/Dispatch.js.map new file mode 100644 index 00000000..3f34d48d --- /dev/null +++ b/dist/commonjs/System/Collections/Array/Dispatch.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Collections/Array/Dispatch.js","System/Collections/Array/Dispatch.ts"],"names":[],"mappings":";;;;AAIA;;ACGA,IAAA,UAAA,QAAiB,aAAjB,CAAA;AACA,IAAA,YAAA,QAAmB,WAAnB,CAAA;AAEA,IAAM,QAAY,KAAK,CAAL;AA4BlB,SAAA,MAAA,CACC,SADD,EAEC,OAFD,EAEY,IAFZ,EAE8C;AAE7C,QAAG,aAAa,UAAU,MAAV,EAChB;AACC,aAAI,IAAI,IAAI,CAAJ,EAAO,MAAM,UAAU,MAAV,EAAkB,IAAE,GAAF,EAAO,GAA9C,EACA;AACC,gBAAI,KAAc,UAAU,CAAV,CAAd,CADL;AAEC,gBAAG,CAAC,EAAD,EAAK,SAAR;AACA,gBACA;AACC,mBAAG,OAAH,EADD;aADA,CAIA,OAAM,EAAN,EACA;AACC,oBAAG,CAAC,IAAD,EACF,MAAM,EAAN,CADD,KAEK,IAAG,QAAA,OAAA,CAAK,UAAL,CAAgB,IAAhB,CAAH,EACJ,KAAK,EAAL,EAAS,CAAT,EADI;aAJN;SARD;KAFD;CAJD;AAAgB,QAAA,MAAA,GAAM,MAAN;AAkChB,SAAA,MAAA,CACC,SADD,EAEC,OAFD,EAEY,IAFZ,EAE8C;AAG7C,QAAG,CAAC,SAAD,EAAY,OAAO,IAAP,CAAf;AAEA,QAAI,SAAe,UAAA,IAAA,CAAK,SAAL,CAAf,CALyC;AAM7C,QAAG,UAAU,MAAV,EACH;AAEC,aAAI,IAAI,IAAI,CAAJ,EAAO,MAAM,OAAO,MAAP,EAAe,IAAE,GAAF,EAAO,GAA3C,EACA;AACC,gBAAI,KAAc,OAAO,CAAP,CAAd,CADL;AAEC,gBACA;AACC,uBAAO,CAAP,IAAY,KACT,GAAG,OAAH,CADS,GAET,KAFS,CADb;aADA,CAMA,OAAM,EAAN,EACA;AACC,uBAAO,CAAP,IAAY,KAAZ,CADD;AAEC,oBAAG,CAAC,IAAD,EACF,MAAM,EAAN,CADD,KAEK,IAAG,QAAA,OAAA,CAAK,UAAL,CAAgB,IAAhB,CAAH,EACJ,KAAK,EAAL,EAAS,CAAT,EADI;aALN;SATD;KAHD;AAuBA,WAAO,MAAP,CA7B6C;CAF9C;AAAgB,QAAA,MAAA,GAAM,MAAN;AA2ChB,SAAA,QAAA,CACC,SADD,EAEC,OAFD,EAEY,IAFZ,EAE8C;AAE7C,WAAO,UAAA,IAAA,CAAK,SAAL,CAAP,EAAwB,OAAxB,EAAiC,IAAjC,EAF6C;CAF9C;AAAgB,QAAA,QAAA,GAAQ,QAAR;AAOhB,OAAA,cAAA,CAAA,OAAA,EAAA,YAAA,EAAA,EAAA,OAAA,IAAA,EAAA;ADlEA,QAAQ,OAAR,GCkEe,QDlEf","file":"System/Collections/Array/Dispatch.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\n\"use strict\";\nconst Types_1 = require(\"../../Types\");\nconst Utility_1 = require(\"./Utility\");\nconst VOID0 = void (0);\nfunction unsafe(listeners, payload, trap) {\n if (listeners && listeners.length) {\n for (let i = 0, len = listeners.length; i < len; i++) {\n let fn = listeners[i];\n if (!fn)\n continue;\n try {\n fn(payload);\n }\n catch (ex) {\n if (!trap)\n throw ex;\n else if (Types_1.default.isFunction(trap))\n trap(ex, i);\n }\n }\n }\n}\nexports.unsafe = unsafe;\nfunction mapped(listeners, payload, trap) {\n if (!listeners)\n return null;\n var result = Utility_1.copy(listeners);\n if (listeners.length) {\n for (let i = 0, len = result.length; i < len; i++) {\n let fn = result[i];\n try {\n result[i] = fn\n ? fn(payload)\n : VOID0;\n }\n catch (ex) {\n result[i] = VOID0;\n if (!trap)\n throw ex;\n else if (Types_1.default.isFunction(trap))\n trap(ex, i);\n }\n }\n }\n return result;\n}\nexports.mapped = mapped;\nfunction dispatch(listeners, payload, trap) {\n unsafe(Utility_1.copy(listeners), payload, trap);\n}\nexports.dispatch = dispatch;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = dispatch;\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n///\r\n///\r\nimport Type from \"../../Types\";\r\nimport {copy} from \"./Utility\";\r\n\r\nconst VOID0:any = void(0);\r\n\r\nexport interface DispatchErrorHandler\r\n{\r\n\t(ex?:any, i?:number):void;\r\n}\r\n\r\n/**\r\n * Simply takes a payload and passes it to all the listeners.\r\n *\r\n * While dispatching:\r\n * * This is an unsafe method if by chance any of the listeners modify the array.\r\n * * It cannot prevent changes to the payload.\r\n *\r\n * Improving safety:\r\n * * Only use a local array that isn't exposed to the listeners.\r\n * * Use the dispatch method instead as it makes a copy of the listeners array.\r\n * * Freeze the listeners array so it can't be modified.\r\n * * Freeze the payload.\r\n *\r\n * Specifying trap will catch any errors and pass them along if trap is a function.\r\n * A payload is used instead of arguments for easy typing.\r\n *\r\n *\r\n * @param listeners\r\n * @param payload\r\n * @param trap\r\n */\r\nexport function unsafe(\r\n\tlisteners:IArray<(payload:T)=>any>,\r\n\tpayload:T, trap?:boolean|DispatchErrorHandler):void\r\n{\r\n\tif(listeners && listeners.length)\r\n\t{\r\n\t\tfor(let i = 0, len = listeners.length; i(\r\n\tlisteners:IArray<(payload:T)=>TResult>,\r\n\tpayload:T, trap?:boolean|DispatchErrorHandler):TResult[]\r\n{\r\n\r\n\tif(!listeners) return null;\r\n\t// Reuse the copy as the array result.\r\n\tvar result:any[] = copy(listeners);\r\n\tif(listeners.length)\r\n\t{\r\n\r\n\t\tfor(let i = 0, len = result.length; i(\r\n\tlisteners:IArray<(payload:T)=>any>,\r\n\tpayload:T, trap?:boolean|DispatchErrorHandler):void\r\n{\r\n\tunsafe(copy(listeners), payload, trap);\r\n}\r\n\r\nexport default dispatch;"]} \ No newline at end of file diff --git a/dist/commonjs/System/Collections/Array/Procedure.d.ts b/dist/commonjs/System/Collections/Array/Procedure.d.ts new file mode 100644 index 00000000..227353e3 --- /dev/null +++ b/dist/commonjs/System/Collections/Array/Procedure.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function sum(source: number[], ignoreNaN?: boolean): number; +export declare function average(source: number[], ignoreNaN?: boolean): number; +export declare function product(source: number[], ignoreNaN?: boolean): number; +export declare function quotient(source: number[], ignoreNaN?: boolean): number; +export declare function min(source: number[], ignoreNaN?: boolean): number; +export declare function max(source: number[], ignoreNaN?: boolean): number; diff --git a/dist/commonjs/System/Collections/Array/Procedure.js b/dist/commonjs/System/Collections/Array/Procedure.js new file mode 100644 index 00000000..c74dbfe2 --- /dev/null +++ b/dist/commonjs/System/Collections/Array/Procedure.js @@ -0,0 +1,140 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +"use strict"; + +function sum(source) { + var ignoreNaN = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + + if (!source || !source.length) return 0; + var result = 0; + if (ignoreNaN) source.forEach(function (n) { + if (!isNaN(n)) result += n; + });else source.every(function (n) { + result += n; + return !isNaN(result); + }); + return result; +} +exports.sum = sum; +function average(source) { + var ignoreNaN = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + + if (!source || !source.length) return NaN; + var result = 0, + count; + if (ignoreNaN) { + count = 0; + source.forEach(function (n) { + if (!isNaN(n)) { + result += n; + count++; + } + }); + } else { + count = source.length; + source.every(function (n) { + result += n; + return !isNaN(result); + }); + } + return !count || isNaN(result) ? NaN : result / count; +} +exports.average = average; +function product(source) { + var ignoreNaN = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + + if (!source || !source.length) return NaN; + var result = 1; + if (ignoreNaN) { + var found = false; + source.forEach(function (n) { + if (!isNaN(n)) { + result *= n; + if (!found) found = true; + } + }); + if (!found) result = NaN; + } else { + source.every(function (n) { + if (isNaN(n)) { + result = NaN; + return false; + } + result *= n; + return true; + }); + } + return result; +} +exports.product = product; +function quotient(source) { + var ignoreNaN = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + + if (!source || source.length < 2) return NaN; + var result = source[0]; + var found = false; + source.every(function (n, i) { + if (i) { + if (n === 0) { + result = NaN; + return false; + } + if (isNaN(n)) { + if (!ignoreNaN) { + result = NaN; + return false; + } + } else { + result /= n; + if (!found) found = true; + } + } + return true; + }); + if (!found) result = NaN; + return result; +} +exports.quotient = quotient; +function ifSet(source, start, ignoreNaN, predicate) { + if (!source || !source.length) return NaN; + var result = start; + if (ignoreNaN) { + var found = false; + source.forEach(function (n) { + if (!isNaN(n)) { + if (predicate(n, result)) result = n; + if (!found) found = true; + } + }); + if (!found) result = NaN; + } else { + source.every(function (n) { + if (isNaN(n)) { + result = NaN; + return false; + } + if (predicate(n, result)) result = n; + return true; + }); + } + return result; +} +function min(source) { + var ignoreNaN = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + + return ifSet(source, +Infinity, ignoreNaN, function (n, result) { + return n < result; + }); +} +exports.min = min; +function max(source) { + var ignoreNaN = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1]; + + return ifSet(source, -Infinity, ignoreNaN, function (n, result) { + return n > result; + }); +} +exports.max = max; +//# sourceMappingURL=Procedure.js.map diff --git a/dist/commonjs/System/Collections/Array/Procedure.js.map b/dist/commonjs/System/Collections/Array/Procedure.js.map new file mode 100644 index 00000000..3d582e2d --- /dev/null +++ b/dist/commonjs/System/Collections/Array/Procedure.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Collections/Array/Procedure.js","System/Collections/Array/Procedure.ts"],"names":[],"mappings":";;;;AAIA;;ACEA,SAAA,GAAA,CAAoB,MAApB,EAA8D;QAAzB,kEAAoB,qBAAK;;AAE7D,QAAG,CAAC,MAAD,IAAW,CAAC,OAAO,MAAP,EACd,OAAO,CAAP,CADD;AAGA,QAAI,SAAS,CAAT,CALyD;AAM7D,QAAG,SAAH,EACC,OAAO,OAAP,CAAe,aAAC;AAEf,YAAG,CAAC,MAAM,CAAN,CAAD,EAAW,UAAU,CAAV,CAAd;KAFc,CAAf,CADD,KAMC,OAAO,KAAP,CAAa,aAAC;AAEb,kBAAU,CAAV,CAFa;AAGb,eAAO,CAAC,MAAM,MAAN,CAAD,CAHM;KAAD,CAAb,CAND;AAYA,WAAO,MAAP,CAlB6D;CAA9D;AAAgB,QAAA,GAAA,GAAG,GAAH;AAqBhB,SAAA,OAAA,CAAwB,MAAxB,EAAkE;QAAzB,kEAAoB,qBAAK;;AAEjE,QAAG,CAAC,MAAD,IAAW,CAAC,OAAO,MAAP,EACd,OAAO,GAAP,CADD;AAGA,QAAI,SAAS,CAAT;QAAY,KAAhB,CALiE;AAMjE,QAAG,SAAH,EACA;AACC,gBAAQ,CAAR,CADD;AAEC,eAAO,OAAP,CAAe,aAAC;AAEf,gBAAG,CAAC,MAAM,CAAN,CAAD,EACH;AACC,0BAAU,CAAV,CADD;AAEC,wBAFD;aADA;SAFc,CAAf,CAFD;KADA,MAcA;AACC,gBAAQ,OAAO,MAAP,CADT;AAEC,eAAO,KAAP,CAA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CA,SAAA,GAAA,CAAoB,MAApB,EAA8D;QAAzB,kEAAoB,qBAAK;;AAE7D,WAAO,MAAM,MAAN,EAAc,CAAC,QAAD,EAAW,SAAzB,EAAoC,UAAC,CAAD,EAAI,MAAJ;eAAe,IAAE,MAAF;KAAf,CAA3C,CAF6D;CAA9D;AAAgB,QAAA,GAAA,GAAG,GAAH;AAKhB,SAAA,GAAA,CAAoB,MAApB,EAA8D;QAAzB,kEAAoB,qBAAK;;AAE7D,WAAO,MAAM,MAAN,EAAc,CAAC,QAAD,EAAW,SAAzB,EAAoC,UAAC,CAAD,EAAI,MAAJ;eAAe,IAAE,MAAF;KAAf,CAA3C,CAF6D;CAA9D;AAAgB,QAAA,GAAA,GAAG,GAAH","file":"System/Collections/Array/Procedure.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\n\"use strict\";\nfunction sum(source, ignoreNaN = false) {\n if (!source || !source.length)\n return 0;\n var result = 0;\n if (ignoreNaN)\n source.forEach(n => {\n if (!isNaN(n))\n result += n;\n });\n else\n source.every(n => {\n result += n;\n return !isNaN(result);\n });\n return result;\n}\nexports.sum = sum;\nfunction average(source, ignoreNaN = false) {\n if (!source || !source.length)\n return NaN;\n var result = 0, count;\n if (ignoreNaN) {\n count = 0;\n source.forEach(n => {\n if (!isNaN(n)) {\n result += n;\n count++;\n }\n });\n }\n else {\n count = source.length;\n source.every(n => {\n result += n;\n return !isNaN(result);\n });\n }\n return (!count || isNaN(result)) ? NaN : (result / count);\n}\nexports.average = average;\nfunction product(source, ignoreNaN = false) {\n if (!source || !source.length)\n return NaN;\n var result = 1;\n if (ignoreNaN) {\n var found = false;\n source.forEach(n => {\n if (!isNaN(n)) {\n result *= n;\n if (!found)\n found = true;\n }\n });\n if (!found)\n result = NaN;\n }\n else {\n source.every(n => {\n if (isNaN(n)) {\n result = NaN;\n return false;\n }\n result *= n;\n return true;\n });\n }\n return result;\n}\nexports.product = product;\nfunction quotient(source, ignoreNaN = false) {\n if (!source || source.length < 2)\n return NaN;\n var result = source[0];\n var found = false;\n source.every((n, i) => {\n if (i) {\n if (n === 0) {\n result = NaN;\n return false;\n }\n if (isNaN(n)) {\n if (!ignoreNaN) {\n result = NaN;\n return false;\n }\n }\n else {\n result /= n;\n if (!found)\n found = true;\n }\n }\n return true;\n });\n if (!found)\n result = NaN;\n return result;\n}\nexports.quotient = quotient;\nfunction ifSet(source, start, ignoreNaN, predicate) {\n if (!source || !source.length)\n return NaN;\n var result = start;\n if (ignoreNaN) {\n var found = false;\n source.forEach(n => {\n if (!isNaN(n)) {\n if (predicate(n, result))\n result = n;\n if (!found)\n found = true;\n }\n });\n if (!found)\n result = NaN;\n }\n else {\n source.every(n => {\n if (isNaN(n)) {\n result = NaN;\n return false;\n }\n if (predicate(n, result))\n result = n;\n return true;\n });\n }\n return result;\n}\nfunction min(source, ignoreNaN = false) {\n return ifSet(source, +Infinity, ignoreNaN, (n, result) => n < result);\n}\nexports.min = min;\nfunction max(source, ignoreNaN = false) {\n return ifSet(source, -Infinity, ignoreNaN, (n, result) => n > result);\n}\nexports.max = max;\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n\r\nexport function sum(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\tif(!source || !source.length)\r\n\t\treturn 0;\r\n\r\n\tvar result = 0;\r\n\tif(ignoreNaN)\r\n\t\tsource.forEach(n =>\r\n\t\t{\r\n\t\t\tif(!isNaN(n)) result += n;\r\n\t\t});\r\n\telse\r\n\t\tsource.every(n =>\r\n\t\t{\r\n\t\t\tresult += n;\r\n\t\t\treturn !isNaN(result);\r\n\t\t});\r\n\r\n\treturn result;\r\n}\r\n\r\nexport function average(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\tif(!source || !source.length)\r\n\t\treturn NaN;\r\n\r\n\tvar result = 0, count:number;\r\n\tif(ignoreNaN)\r\n\t{\r\n\t\tcount = 0;\r\n\t\tsource.forEach(n =>\r\n\t\t{\r\n\t\t\tif(!isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tresult += n;\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}\r\n\telse\r\n\t{\r\n\t\tcount = source.length;\r\n\t\tsource.every(n =>\r\n\t\t{\r\n\t\t\tresult += n;\r\n\t\t\treturn !isNaN(result);\r\n\t\t});\r\n\r\n\t}\r\n\r\n\treturn (!count || isNaN(result)) ? NaN : (result/count);\r\n}\r\n\r\nexport function product(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\tif(!source || !source.length)\r\n\t\treturn NaN;\r\n\r\n\tvar result = 1;\r\n\tif(ignoreNaN)\r\n\t{\r\n\t\tvar found = false;\r\n\t\tsource.forEach(n =>\r\n\t\t{\r\n\t\t\tif(!isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tresult *= n;\r\n\t\t\t\tif(!found) found = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(!found)\r\n\t\t\tresult = NaN;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tsource.every(n =>\r\n\t\t{\r\n\t\t\tif(isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tresult = NaN;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tresult *= n;\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\n/**\r\n * Takes the first number and divides it by all following.\r\n * @param source\r\n * @param ignoreNaN Will cause this skip any NaN values.\r\n * @returns {number}\r\n */\r\nexport function quotient(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\tif(!source || source.length<2)\r\n\t\treturn NaN;\r\n\r\n\tvar result = source[0];\r\n\r\n\tvar found = false;\r\n\tsource.every((n,i) =>\r\n\t{\r\n\t\tif(i) {\r\n\t\t\tif(n===0)\r\n\t\t\t{\r\n\t\t\t\tresult = NaN;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif(isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tif(!ignoreNaN)\r\n\t\t\t\t{\r\n\t\t\t\t\tresult = NaN;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tresult /= n;\r\n\t\t\t\tif(!found) found = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tif(!found)\r\n\t\tresult = NaN;\r\n\r\n\treturn result;\r\n}\r\n\r\n\r\nfunction ifSet(\r\n\tsource:number[],\r\n\tstart:number,\r\n\tignoreNaN:boolean,\r\n\tpredicate:(n:number, result:number) => boolean)\r\n{\r\n\tif(!source || !source.length)\r\n\t\treturn NaN;\r\n\r\n\tvar result = start;\r\n\tif(ignoreNaN)\r\n\t{\r\n\t\tvar found = false;\r\n\t\tsource.forEach(n =>\r\n\t\t{\r\n\t\t\tif(!isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tif(predicate(n, result))\r\n\t\t\t\t\tresult = n;\r\n\t\t\t\tif(!found) found = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(!found)\r\n\t\t\tresult = NaN;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tsource.every(n =>\r\n\t\t{\r\n\t\t\tif(isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tresult = NaN;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif(predicate(n, result))\r\n\t\t\t\tresult = n;\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\t}\r\n\treturn result;\r\n\r\n}\r\n\r\nexport function min(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\treturn ifSet(source, +Infinity, ignoreNaN, (n, result) => n n>result);\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/commonjs/System/Collections/Array/ReadOnlyArrayWrapper.d.ts b/dist/commonjs/System/Collections/Array/ReadOnlyArrayWrapper.d.ts new file mode 100644 index 00000000..88e74cbc --- /dev/null +++ b/dist/commonjs/System/Collections/Array/ReadOnlyArrayWrapper.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ReadOnlyCollectionBase from "../ReadOnlyCollectionBase"; +export default class ReadOnlyArrayWrapper extends ReadOnlyCollectionBase { + constructor(array: IArray); + getValueAt: (index: number) => T; +} diff --git a/dist/commonjs/System/Collections/Array/ReadOnlyArrayWrapper.js b/dist/commonjs/System/Collections/Array/ReadOnlyArrayWrapper.js new file mode 100644 index 00000000..76b2149f --- /dev/null +++ b/dist/commonjs/System/Collections/Array/ReadOnlyArrayWrapper.js @@ -0,0 +1,44 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +"use strict"; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ArgumentNullException_1 = require("../../Exceptions/ArgumentNullException"); +var Enumerator_1 = require("../Enumeration/Enumerator"); +var ReadOnlyCollectionBase_1 = require("../ReadOnlyCollectionBase"); + +var ReadOnlyArrayWrapper = function (_ReadOnlyCollectionBa) { + _inherits(ReadOnlyArrayWrapper, _ReadOnlyCollectionBa); + + function ReadOnlyArrayWrapper(array) { + _classCallCheck(this, ReadOnlyArrayWrapper); + + var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(ReadOnlyArrayWrapper).call(this)); + + if (!array) throw new ArgumentNullException_1.default('array'); + var _ = _this; + _._getCount = function () { + return array.length; + }; + _.getEnumerator = function () { + return Enumerator_1.from(array); + }; + _.getValueAt = function (i) { + return array[i]; + }; + return _this; + } + + return ReadOnlyArrayWrapper; +}(ReadOnlyCollectionBase_1.default); + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = ReadOnlyArrayWrapper; +//# sourceMappingURL=ReadOnlyArrayWrapper.js.map diff --git a/dist/commonjs/System/Collections/Array/ReadOnlyArrayWrapper.js.map b/dist/commonjs/System/Collections/Array/ReadOnlyArrayWrapper.js.map new file mode 100644 index 00000000..aa606694 --- /dev/null +++ b/dist/commonjs/System/Collections/Array/ReadOnlyArrayWrapper.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Collections/Array/ReadOnlyArrayWrapper.js","System/Collections/Array/ReadOnlyArrayWrapper.ts"],"names":[],"mappings":";;;;AAIA;;;;;;;;ACCA,IAAA,0BAAA,QAAkC,wCAAlC,CAAA;AACA,IAAA,eAAA,QAAqC,2BAArC,CAAA;AACA,IAAA,2BAAA,QAAmC,2BAAnC,CAAA;;IAEA;;;AAGC,aAHD,oBAGC,CAAY,KAAZ,EAA2B;8BAH5B,sBAG4B;;2EAH5B,kCAG4B;;AAG1B,YAAG,CAAC,KAAD,EACF,MAAM,IAAI,wBAAA,OAAA,CAAsB,OAA1B,CAAN,CADD;AAGA,YAAI,SAAJ,CAN0B;AAO1B,UAAE,SAAF,GAAc;mBAAM,MAAM,MAAN;SAAN,CAPY;AAQ1B,UAAE,aAAF,GAAkB;mBAAM,aAAA,IAAA,CAAe,KAAf;SAAN,CARQ;AAS1B,UAAE,UAAF,GAAe;mBAAK,MAAM,CAAN;SAAL,CATW;;KAA3B;;WAHD;EAAqD,yBAAA,OAAA;;AAArD,OAAA,cAAA,CAAA,OAAA,EAAA,YAAA,EAAA,EAAA,OAAA,IAAA,EAAA;ADWA,QAAQ,OAAR,GAAkB,oBAAlB","file":"System/Collections/Array/ReadOnlyArrayWrapper.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\n\"use strict\";\nconst ArgumentNullException_1 = require(\"../../Exceptions/ArgumentNullException\");\nconst Enumerator_1 = require(\"../Enumeration/Enumerator\");\nconst ReadOnlyCollectionBase_1 = require(\"../ReadOnlyCollectionBase\");\nclass ReadOnlyArrayWrapper extends ReadOnlyCollectionBase_1.default {\n constructor(array) {\n super();\n if (!array)\n throw new ArgumentNullException_1.default('array');\n var _ = this;\n _._getCount = () => array.length;\n _.getEnumerator = () => Enumerator_1.from(array);\n _.getValueAt = i => array[i];\n }\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = ReadOnlyArrayWrapper;\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\nimport ArgumentNullException from \"../../Exceptions/ArgumentNullException\";\r\nimport {from as enumeratorFrom} from \"../Enumeration/Enumerator\";\r\nimport ReadOnlyCollectionBase from \"../ReadOnlyCollectionBase\";\r\n\r\nexport default class ReadOnlyArrayWrapper extends ReadOnlyCollectionBase\r\n{\r\n\r\n\tconstructor(array:IArray)\r\n\t{\r\n\t\tsuper();\r\n\t\tif(!array)\r\n\t\t\tthrow new ArgumentNullException('array');\r\n\r\n\t\tvar _ = this;\r\n\t\t_._getCount = () => array.length;\r\n\t\t_.getEnumerator = () => enumeratorFrom(array);\r\n\t\t_.getValueAt = i => array[i];\r\n\t}\r\n\r\n\tgetValueAt:(index:number)=>T;\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/commonjs/System/Collections/Array/Sort.d.ts b/dist/commonjs/System/Collections/Array/Sort.d.ts new file mode 100644 index 00000000..5524bcb8 --- /dev/null +++ b/dist/commonjs/System/Collections/Array/Sort.d.ts @@ -0,0 +1,9 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function createComparer(selector: Selector, order?: Order | Order[], equivalentToNaN?: any): Comparison; +export { createComparer as default, createComparer as by }; diff --git a/dist/commonjs/System/Collections/Array/Sort.js b/dist/commonjs/System/Collections/Array/Sort.js new file mode 100644 index 00000000..4a098b6c --- /dev/null +++ b/dist/commonjs/System/Collections/Array/Sort.js @@ -0,0 +1,39 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +"use strict"; + +var Types_1 = require('../../Types'); +var Compare_1 = require('../../Compare'); +function ensureArray(value) { + return Array.isArray(value) ? value : [value]; +} +function createComparer(selector) { + var order = arguments.length <= 1 || arguments[1] === undefined ? 1 : arguments[1]; + var equivalentToNaN = arguments.length <= 2 || arguments[2] === undefined ? NaN : arguments[2]; + + var nanHasEquivalent = !Types_1.default.isTrueNaN(equivalentToNaN); + return function (a, b) { + var aValue = ensureArray(selector(a)); + var bValue = ensureArray(selector(b)); + var len = Math.min(aValue.length, bValue.length); + var oArray = Array.isArray(order) ? order : null; + for (var i = 0; i < len; i++) { + var vA = aValue[i], + vB = bValue[i], + o = oArray ? i < oArray.length ? oArray[i] : 1 : order; + if (nanHasEquivalent) { + if (Types_1.default.isTrueNaN(vA)) vA = equivalentToNaN; + if (Types_1.default.isTrueNaN(vB)) vB = equivalentToNaN; + } + var r = Compare_1.compare(vA, vB); + if (r !== 0) return o * r; + } + return 0; + }; +} +exports.createComparer = createComparer; +exports.default = createComparer; +exports.by = createComparer; +//# sourceMappingURL=Sort.js.map diff --git a/dist/commonjs/System/Collections/Array/Sort.js.map b/dist/commonjs/System/Collections/Array/Sort.js.map new file mode 100644 index 00000000..18ecd076 --- /dev/null +++ b/dist/commonjs/System/Collections/Array/Sort.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Collections/Array/Sort.js","System/Collections/Array/Sort.ts"],"names":[],"mappings":";;;;AAIA;;ACKA,IAAA,UAAA,QAAiB,aAAjB,CAAA;AACA,IAAA,YAAA,QAAsB,eAAtB,CAAA;AAEA,SAAA,WAAA,CAAwB,KAAxB,EAAmC;AAElC,WAAO,MAAM,OAAN,CAAc,KAAd,IACC,KADD,GAEJ,CAAI,KAAJ,CAFI,CAF2B;CAAnC;AA8BA,SAAA,cAAA,CACC,QADD,EAG0B;QADzB,8DAAwB,iBACC;QAAzB,wEAAsB,mBAAG;;AAEzB,QAAI,mBAAmB,CAAC,QAAA,OAAA,CAAK,SAAL,CAAe,eAAf,CAAD,CAFE;AAIzB,WAAO,UAAC,CAAD,EAAsB,CAAtB,EAAyC;AAG/C,YAAI,SAAS,YAAY,SAAS,CAAT,CAAZ,CAAT,CAH2C;AAI/C,YAAI,SAAS,YAAY,SAAS,CAAT,CAAZ,CAAT,CAJ2C;AAK/C,YAAI,MAAM,KAAK,GAAL,CAAS,OAAO,MAAP,EAAe,OAAO,MAAP,CAA9B,CAL2C;AAO/C,YAAI,SAAiB,MAAM,OAAN,CAAc,KAAd,IAAuB,KAAvB,GAA+B,IAA/B,CAP0B;AAQ/C,aAAI,IAAI,IAAI,CAAJ,EAAO,IAAE,GAAF,EAAO,GAAtB,EACA;AACC,gBAAI,KAAK,OAAO,CAAP,CAAL;gBAAgB,KAAK,OAAO,CAAP,CAAL;gBAChB,IAAK,SACD,IAAE,OAAO,MAAP,GAAgB,OAAO,CAAP,CAAlB,GAA8B,CAA9B,GACM,KAFL,CAFV;AAMC,gBAAG,gBAAH,EACA;AACC,oBAAG,QAAA,OAAA,CAAK,SAAL,CAAe,EAAf,CAAH,EACC,KAAK,eAAL,CADD;AAEA,oBAAG,QAAA,OAAA,CAAK,SAAL,CAAe,EAAf,CAAH,EACC,KAAK,eAAL,CADD;aAJD;AASA,gBAAI,IAAI,UAAA,OAAA,CAAQ,EAAR,EAAY,EAAZ,CAAJ,CAfL;AAgBC,gBAAG,MAAI,CAAJ,EACF,OAAO,IAAE,CAAF,CADR;SAjBD;AAsBA,eAAO,CAAP,CA9B+C;KAAzC,CAJkB;CAH1B;AAAgB,QAAA,cAAA,GAAc,cAAd;AA0CG,QAAA,OAAA,GAAO,cAAP;AACA,QAAA,EAAA,GAAE,cAAF","file":"System/Collections/Array/Sort.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\n\"use strict\";\nconst Types_1 = require('../../Types');\nconst Compare_1 = require('../../Compare');\nfunction ensureArray(value) {\n return Array.isArray(value)\n ? value\n : [value];\n}\nfunction createComparer(selector, order = 1, equivalentToNaN = NaN) {\n var nanHasEquivalent = !Types_1.default.isTrueNaN(equivalentToNaN);\n return (a, b) => {\n var aValue = ensureArray(selector(a));\n var bValue = ensureArray(selector(b));\n var len = Math.min(aValue.length, bValue.length);\n var oArray = Array.isArray(order) ? order : null;\n for (let i = 0; i < len; i++) {\n var vA = aValue[i], vB = bValue[i], o = oArray\n ? (i < oArray.length ? oArray[i] : 1)\n : order;\n if (nanHasEquivalent) {\n if (Types_1.default.isTrueNaN(vA))\n vA = equivalentToNaN;\n if (Types_1.default.isTrueNaN(vB))\n vB = equivalentToNaN;\n }\n var r = Compare_1.compare(vA, vB);\n if (r !== 0)\n return o * r;\n }\n return 0;\n };\n}\nexports.createComparer = createComparer;\nexports.default = createComparer;\nexports.by = createComparer;\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n///\r\n///\r\n///\r\n\r\nimport Type from '../../Types';\r\nimport {compare} from '../../Compare';\r\n\r\nfunction ensureArray(value:T|T[]):T[]\r\n{\r\n\treturn Array.isArray(value)\r\n\t\t? value\r\n\t\t: [value];\r\n}\r\n\r\n/**\r\n * A factory function that creates a comparer to be used in multi-dimensional sorting.\r\n *\r\n *

Example

\r\n * ```typescript\r\n * var myArray = [{a:1:b:2},{a:3,b:4},{a:1,b:3}];\r\n *\r\n * // First sort by a, then by b.\r\n * myArray.sort(\r\n * createComparer(\r\n * (e)=> [e.a, e.b],\r\n * [Order.Ascending, Order.Descending]\r\n * )\r\n * );\r\n *\r\n * // result: [{a:1,b:3},{a:1:b:2},{a:3,b:4}]\r\n * ```\r\n *\r\n * @param selector\r\n * @param order\r\n * @param equivalentToNaN\r\n * @returns {function((TSource|TSource[]), (TSource|TSource[])): CompareResult}\r\n */\r\nexport function createComparer(\r\n\tselector:Selector,\r\n\torder:Order | Order[] = Order.Ascending,\r\n\tequivalentToNaN:any = NaN):Comparison\r\n{\r\n\tvar nanHasEquivalent = !Type.isTrueNaN(equivalentToNaN);\r\n\r\n\treturn (a:TSource|TSource[], b:TSource|TSource[]):CompareResult=>\r\n\t{\r\n\t\t// Use an array always to ensure a single code path.\r\n\t\tvar aValue = ensureArray(selector(a));\r\n\t\tvar bValue = ensureArray(selector(b));\r\n\t\tvar len = Math.min(aValue.length, bValue.length);\r\n\r\n\t\tvar oArray:Order[] = Array.isArray(order) ? order : null;\r\n\t\tfor(let i = 0; iorder;\r\n\r\n\t\t\tif(nanHasEquivalent)\r\n\t\t\t{\r\n\t\t\t\tif(Type.isTrueNaN(vA))\r\n\t\t\t\t\tvA = equivalentToNaN;\r\n\t\t\t\tif(Type.isTrueNaN(vB))\r\n\t\t\t\t\tvB = equivalentToNaN;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar r = compare(vA, vB);\r\n\t\t\tif(r!==CompareResult.Equal)\r\n\t\t\t\treturn o*r;\r\n\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t};\r\n}\r\n\r\nexport {\r\n\tcreateComparer as default, // Allow for default import.\r\n\tcreateComparer as by // Alias for Sort.by(...) instead of Sort.createComparer\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/commonjs/System/Collections/Array/Utility.d.ts b/dist/commonjs/System/Collections/Array/Utility.d.ts new file mode 100644 index 00000000..2314ac04 --- /dev/null +++ b/dist/commonjs/System/Collections/Array/Utility.d.ts @@ -0,0 +1,26 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function initialize(length: number): T[]; +export declare function copy(source: IArray, sourceIndex?: number, length?: number): T[]; +export declare function copyTo>(source: IArray, destination: TDestination, sourceIndex?: number, destinationIndex?: number, length?: number): TDestination; +export declare function indexOf(array: IArray, item: T, equalityComparer?: EqualityComparison): number; +export declare function contains(array: IArray, item: T, equalityComparer?: EqualityComparison): boolean; +export declare function replace(array: IArray, old: T, newValue: T, max?: number): number; +export declare function updateRange(array: IArray, value: T, start?: number, stop?: number): void; +export declare function clear(array: IArray, start?: number, stop?: number): void; +export declare function register(array: IArray, item: T, equalityComparer?: EqualityComparison): boolean; +export declare function findIndex(array: IArray, predicate: Predicate): number; +export declare function forEach(source: IArray, action: Predicate | Action): void; +export declare function applyTo(target: IArray, fn: (a: T) => T): void; +export declare function removeIndex(array: T[], index: number): boolean; +export declare function remove(array: T[], value: T, max?: number, equalityComparer?: EqualityComparison): number; +export declare function repeat(element: T, count: number): T[]; +export declare function range(first: number, count: number, step?: number): number[]; +export declare function rangeUntil(first: number, until: number, step?: number): number[]; +export declare function distinct(source: string[]): string[]; +export declare function distinct(source: number[]): number[]; +export declare function flatten(a: any[], recurseDepth?: number): any[]; diff --git a/dist/commonjs/System/Collections/CollectionBase.d.ts b/dist/commonjs/System/Collections/CollectionBase.d.ts new file mode 100644 index 00000000..d3ff773a --- /dev/null +++ b/dist/commonjs/System/Collections/CollectionBase.d.ts @@ -0,0 +1,40 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +declare abstract class CollectionBase extends DisposableBase implements ICollection, IEnumerateEach { + protected _equalityComparer: EqualityComparison; + constructor(source?: IEnumerableOrArray, _equalityComparer?: EqualityComparison); + protected abstract getCount(): number; + count: number; + protected getIsReadOnly(): boolean; + isReadOnly: boolean; + protected assertModifiable(): void; + protected _version: number; + assertVersion(version: number): void; + private _modifiedCount; + private _updateRecursion; + protected _onModified(): void; + protected _signalModification(increment?: boolean): boolean; + protected _incrementModified(): void; + isUpdating: boolean; + handleUpdate(closure?: () => boolean): boolean; + protected abstract _addInternal(entry: T): boolean; + add(entry: T): void; + protected abstract _removeInternal(entry: T, max?: number): number; + remove(entry: T, max?: number): number; + protected abstract _clearInternal(): number; + clear(): number; + protected _onDispose(): void; + protected _importEntries(entries: IEnumerableOrArray): number; + importEntries(entries: IEnumerableOrArray): number; + abstract getEnumerator(): IEnumerator; + contains(entry: T): boolean; + forEach(action: Predicate | Action, useCopy?: boolean): void; + copyTo>(target: TTarget, index?: number): TTarget; + toArray(): T[]; +} +export default CollectionBase; diff --git a/dist/commonjs/System/Collections/Dictionaries/Dictionary.d.ts b/dist/commonjs/System/Collections/Dictionaries/Dictionary.d.ts new file mode 100644 index 00000000..8ce9d526 --- /dev/null +++ b/dist/commonjs/System/Collections/Dictionaries/Dictionary.d.ts @@ -0,0 +1,26 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Original: http://linqjs.codeplex.com/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DictionaryBase from "./DictionaryBase"; +export interface IHashEntry extends ILinkedNode>, IKeyValuePair { +} +export default class Dictionary extends DictionaryBase { + private _keyComparer; + private _entries; + private _buckets; + constructor(_keyComparer?: Selector); + protected getCount(): number; + private _getBucket(hash, createIfMissing?); + private _getBucketEntry(key, hash?, bucket?); + protected _getEntry(key: TKey): IHashEntry; + getValue(key: TKey): TValue; + protected _setValueInternal(key: TKey, value: TValue): boolean; + protected _clearInternal(): number; + getEnumerator(): IEnumerator>; + protected getKeys(): TKey[]; + protected getValues(): TValue[]; +} diff --git a/dist/commonjs/System/Collections/Dictionaries/DictionaryBase.d.ts b/dist/commonjs/System/Collections/Dictionaries/DictionaryBase.d.ts new file mode 100644 index 00000000..f931e1a7 --- /dev/null +++ b/dist/commonjs/System/Collections/Dictionaries/DictionaryBase.d.ts @@ -0,0 +1,31 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "../CollectionBase"; +declare abstract class DictionaryBase extends CollectionBase> implements IDictionary { + constructor(source?: IEnumerableOrArray>); + protected _onValueModified(key: TKey, value: TValue, old: TValue): void; + protected _addInternal(item: KeyValuePair): boolean; + protected _clearInternal(): number; + contains(item: KeyValuePair): boolean; + protected _removeInternal(item: IKeyValuePair | [TKey, TValue]): number; + protected abstract getKeys(): TKey[]; + keys: TKey[]; + protected abstract getValues(): TValue[]; + values: TValue[]; + addByKeyValue(key: TKey, value: TValue): boolean; + protected abstract _getEntry(key: TKey): IKeyValuePair; + abstract getValue(key: TKey): TValue; + protected abstract _setValueInternal(key: TKey, value: TValue): boolean; + setValue(key: TKey, value: TValue): boolean; + containsKey(key: TKey): boolean; + containsValue(value: TValue): boolean; + removeByKey(key: TKey): boolean; + removeByValue(value: TValue): number; + importEntries(pairs: IEnumerableOrArray>): number; + protected _importEntries(pairs: IEnumerableOrArray>): number; + getEnumerator(): IEnumerator>; +} +export default DictionaryBase; diff --git a/dist/commonjs/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts b/dist/commonjs/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts new file mode 100644 index 00000000..159e833b --- /dev/null +++ b/dist/commonjs/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts @@ -0,0 +1,17 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import StringKeyDictionary from "./StringKeyDictionary"; +export default class OrderedStringKeyDictionary extends StringKeyDictionary implements IOrderedDictionary { + private _order; + constructor(); + indexOfKey(key: string): number; + getValueByIndex(index: number): TValue; + setValue(key: string, value: TValue, keepIndex?: boolean): boolean; + setByIndex(index: number, value: TValue): boolean; + importValues(values: TValue[]): boolean; + setValues(...values: TValue[]): boolean; + removeByIndex(index: number): boolean; + protected getKeys(): string[]; +} diff --git a/dist/commonjs/System/Collections/Dictionaries/StringKeyDictionary.d.ts b/dist/commonjs/System/Collections/Dictionaries/StringKeyDictionary.d.ts new file mode 100644 index 00000000..15152615 --- /dev/null +++ b/dist/commonjs/System/Collections/Dictionaries/StringKeyDictionary.d.ts @@ -0,0 +1,20 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DictionaryBase from "./DictionaryBase"; +export default class StringKeyDictionary extends DictionaryBase implements IStringKeyDictionary { + private _count; + private _map; + protected _getEntry(key: string): IKeyValuePair; + containsKey(key: string): boolean; + containsValue(value: TValue): boolean; + getValue(key: string): TValue; + protected _setValueInternal(key: string, value: TValue): boolean; + importMap(values: IMap): boolean; + toMap(selector?: (key: string, value: TValue) => TValue): IMap; + protected getKeys(): string[]; + protected getValues(): TValue[]; + protected getCount(): number; +} diff --git a/dist/commonjs/System/Collections/Enumeration/ArrayEnumerator.d.ts b/dist/commonjs/System/Collections/Enumeration/ArrayEnumerator.d.ts new file mode 100644 index 00000000..a54be9a0 --- /dev/null +++ b/dist/commonjs/System/Collections/Enumeration/ArrayEnumerator.d.ts @@ -0,0 +1,10 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import IndexEnumerator from "./IndexEnumerator"; +export default class ArrayEnumerator extends IndexEnumerator { + constructor(arrayFactory: () => IArray, start?: number, step?: number); + constructor(array: IArray, start?: number, step?: number); +} diff --git a/dist/commonjs/System/Collections/Enumeration/Enumerator.d.ts b/dist/commonjs/System/Collections/Enumeration/Enumerator.d.ts new file mode 100644 index 00000000..4001711b --- /dev/null +++ b/dist/commonjs/System/Collections/Enumeration/Enumerator.d.ts @@ -0,0 +1,19 @@ +/// +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function throwIfEndless(isEndless: boolean): void; +export declare const empty: IEnumerator; +export declare function from(source: IEnumerableOrArray): IEnumerator; +export declare function isEnumerable(instance: any): instance is IEnumerable; +export declare function isEnumerableOrArrayLike(instance: any): instance is IEnumerableOrArray; +export declare function isEnumerator(instance: any): instance is IEnumerator; +export declare function forEach(e: IEnumerableOrArray | IEnumerator, action: (element: T, index?: number) => any): boolean | void; +export declare function toArray(source: IEnumerableOrArray | IEnumerator): T[]; +export declare function map(source: IEnumerableOrArray | IEnumerator, selector: Selector): TResult[]; diff --git a/dist/commonjs/System/Collections/Enumeration/EnumeratorBase.d.ts b/dist/commonjs/System/Collections/Enumeration/EnumeratorBase.d.ts new file mode 100644 index 00000000..8ed548b8 --- /dev/null +++ b/dist/commonjs/System/Collections/Enumeration/EnumeratorBase.d.ts @@ -0,0 +1,26 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../../Disposable/DisposableBase"; +export default class EnumeratorBase extends DisposableBase implements IEnumerator { + private _initializer; + private _tryGetNext; + private _yielder; + private _state; + private _disposer; + current: T; + constructor(initializer: () => void, tryGetNext: (yielder: IYield) => boolean, isEndless?: boolean); + constructor(initializer: () => void, tryGetNext: (yielder: IYield) => boolean, disposer?: () => void, isEndless?: boolean); + protected _isEndless: boolean; + isEndless: boolean; + reset(): void; + moveNext(): boolean; + nextValue(): T; + next(): IIteratorResult; + protected _onDispose(): void; +} diff --git a/dist/commonjs/System/Collections/Enumeration/IndexEnumerator.d.ts b/dist/commonjs/System/Collections/Enumeration/IndexEnumerator.d.ts new file mode 100644 index 00000000..e85a88be --- /dev/null +++ b/dist/commonjs/System/Collections/Enumeration/IndexEnumerator.d.ts @@ -0,0 +1,15 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import EnumeratorBase from "./EnumeratorBase"; +export default class IndexEnumerator extends EnumeratorBase { + constructor(sourceFactory: () => { + source: { + [index: number]: T; + }; + pointer?: number; + length: number; + step?: number; + }); +} diff --git a/dist/commonjs/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts b/dist/commonjs/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts new file mode 100644 index 00000000..b966255b --- /dev/null +++ b/dist/commonjs/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from "../../Exceptions/SystemException"; +export default class UnsupportedEnumerableException extends SystemException { + constructor(message?: string); + protected getName(): string; +} diff --git a/dist/commonjs/System/Collections/LinkedList.d.ts b/dist/commonjs/System/Collections/LinkedList.d.ts new file mode 100644 index 00000000..6de7a80e --- /dev/null +++ b/dist/commonjs/System/Collections/LinkedList.d.ts @@ -0,0 +1,37 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based Upon: http://msdn.microsoft.com/en-us/library/he2s3bh7%28v=vs.110%29.aspx + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +export default class LinkedList extends CollectionBase implements ILinkedList { + private _listInternal; + constructor(source?: IEnumerableOrArray, equalityComparer?: EqualityComparison); + protected getCount(): number; + protected _addInternal(entry: T): boolean; + protected _removeInternal(entry: T, max?: number): number; + protected _clearInternal(): number; + forEach(action: Predicate | Action, useCopy?: boolean): void; + getEnumerator(): IEnumerator; + private _findFirst(entry); + private _findLast(entry); + removeOnce(entry: T): boolean; + first: ILinkedListNode; + last: ILinkedListNode; + getValueAt(index: number): T; + getNodeAt(index: number): ILinkedListNode; + find(entry: T): ILinkedListNode; + findLast(entry: T): ILinkedListNode; + addFirst(entry: T): void; + addLast(entry: T): void; + removeFirst(): void; + removeLast(): void; + removeNode(node: ILinkedListNode): boolean; + addBefore(before: ILinkedListNode, entry: T): void; + addAfter(after: ILinkedListNode, entry: T): void; + addNodeBefore(node: ILinkedListNode, before: ILinkedListNode): void; + addNodeAfter(node: ILinkedListNode, after: ILinkedListNode): void; +} diff --git a/dist/commonjs/System/Collections/LinkedNodeList.d.ts b/dist/commonjs/System/Collections/LinkedNodeList.d.ts new file mode 100644 index 00000000..2f91455d --- /dev/null +++ b/dist/commonjs/System/Collections/LinkedNodeList.d.ts @@ -0,0 +1,31 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class LinkedNodeList> implements ILinkedNodeList, IEnumerateEach, IDisposable { + private _first; + private _last; + unsafeCount: number; + constructor(); + first: TNode; + last: TNode; + count: number; + forEach(action: Predicate | Action): void; + map(selector: Selector): T[]; + clear(): number; + dispose(): void; + contains(node: TNode): boolean; + getNodeAt(index: number): TNode; + find(condition: Predicate): TNode; + indexOf(node: TNode): number; + removeFirst(): boolean; + removeLast(): boolean; + removeNode(node: TNode): boolean; + addNode(node: TNode): void; + addNodeBefore(node: TNode, before?: TNode): void; + addNodeAfter(node: TNode, after?: TNode): void; + replace(node: TNode, replacement: TNode): void; + static valueEnumeratorFrom(list: LinkedNodeList>): IEnumerator; + static copyValues>(list: LinkedNodeList>, array: TDestination, index?: number): TDestination; +} diff --git a/dist/commonjs/System/Collections/List.d.ts b/dist/commonjs/System/Collections/List.d.ts new file mode 100644 index 00000000..39f8549b --- /dev/null +++ b/dist/commonjs/System/Collections/List.d.ts @@ -0,0 +1,24 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +export default class List extends CollectionBase implements IList, IEnumerateEach { + protected _source: T[]; + constructor(source?: IEnumerableOrArray, equalityComparer?: EqualityComparison); + protected getCount(): number; + protected _addInternal(entry: T): boolean; + protected _removeInternal(entry: T, max?: number): number; + protected _clearInternal(): number; + protected _importEntries(entries: IEnumerableOrArray): number; + get(index: number): T; + set(index: number, value: T): boolean; + indexOf(item: T): number; + insert(index: number, value: T): void; + removeAt(index: number): boolean; + contains(item: T): boolean; + copyTo>(target: TTarget, index?: number): TTarget; + getEnumerator(): IEnumerator; + forEach(action: Predicate | Action, useCopy?: boolean): void; +} diff --git a/dist/commonjs/System/Collections/Queue.d.ts b/dist/commonjs/System/Collections/Queue.d.ts new file mode 100644 index 00000000..e634439d --- /dev/null +++ b/dist/commonjs/System/Collections/Queue.d.ts @@ -0,0 +1,35 @@ +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based Upon: http://referencesource.microsoft.com/#System/CompMod/system/collections/generic/queue.cs + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +export default class Queue extends CollectionBase { + private _array; + private _head; + private _tail; + private _size; + private _capacity; + constructor(source?: IEnumerableOrArray | number, equalityComparer?: EqualityComparison); + protected getCount(): number; + protected _addInternal(item: T): boolean; + protected _removeInternal(item: T, max?: number): number; + protected _clearInternal(): number; + protected _onDispose(): void; + dump(max?: number): T[]; + forEach(action: Predicate | Action): void; + setCapacity(capacity: number): void; + enqueue(item: T): void; + protected _dequeueInternal(throwIfEmpty?: boolean): T; + dequeue(throwIfEmpty?: boolean): T; + tryDequeue(out: (value: T) => void): boolean; + private _getElement(index); + peek(): T; + trimExcess(threshold?: number): void; + getEnumerator(): IEnumerator; +} diff --git a/dist/commonjs/System/Collections/ReadOnlyCollectionBase.d.ts b/dist/commonjs/System/Collections/ReadOnlyCollectionBase.d.ts new file mode 100644 index 00000000..5633231c --- /dev/null +++ b/dist/commonjs/System/Collections/ReadOnlyCollectionBase.d.ts @@ -0,0 +1,18 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +declare abstract class ReadOnlyCollectionBase extends CollectionBase { + protected _getCount: () => number; + protected getCount(): number; + protected getIsReadOnly(): boolean; + protected _addInternal(entry: T): boolean; + protected _removeInternal(entry: T, max?: number): number; + protected _clearInternal(): number; + protected _getEnumerator: () => IEnumerator; + getEnumerator(): IEnumerator; +} +export default ReadOnlyCollectionBase; diff --git a/dist/commonjs/System/Collections/ReadOnlyCollectionWrapper.d.ts b/dist/commonjs/System/Collections/ReadOnlyCollectionWrapper.d.ts new file mode 100644 index 00000000..4b2dbde9 --- /dev/null +++ b/dist/commonjs/System/Collections/ReadOnlyCollectionWrapper.d.ts @@ -0,0 +1,8 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ReadOnlyCollection from "./ReadOnlyCollectionBase"; +export default class ReadOnlyCollectionWrapper extends ReadOnlyCollection { + constructor(c: ICollection); +} diff --git a/dist/commonjs/System/Collections/Set.d.ts b/dist/commonjs/System/Collections/Set.d.ts new file mode 100644 index 00000000..b44c6c2d --- /dev/null +++ b/dist/commonjs/System/Collections/Set.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import SetBase from "./SetBase"; +export default class Set extends SetBase { + protected newUsing(source?: IEnumerableOrArray): Set; + private _registry; + protected _addInternal(item: T): boolean; + protected _clearInternal(): number; + protected _onDispose(): void; + protected _getNode(item: T): ILinkedNodeWithValue; + protected _removeInternal(item: T, max?: number): number; +} diff --git a/dist/commonjs/System/Collections/SetBase.d.ts b/dist/commonjs/System/Collections/SetBase.d.ts new file mode 100644 index 00000000..1b129395 --- /dev/null +++ b/dist/commonjs/System/Collections/SetBase.d.ts @@ -0,0 +1,36 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import LinkedNodeList from "./LinkedNodeList"; +import CollectionBase from "./CollectionBase"; +declare abstract class SetBase extends CollectionBase implements ISet, IDisposable { + constructor(source?: IEnumerableOrArray); + protected abstract newUsing(source?: IEnumerableOrArray): SetBase; + protected _set: LinkedNodeList>; + protected _getSet(): LinkedNodeList>; + protected getCount(): number; + exceptWith(other: IEnumerableOrArray): void; + intersectWith(other: IEnumerableOrArray): void; + isProperSubsetOf(other: IEnumerableOrArray): boolean; + isProperSupersetOf(other: IEnumerableOrArray): boolean; + isSubsetOf(other: IEnumerableOrArray): boolean; + isSupersetOf(other: IEnumerableOrArray): boolean; + overlaps(other: IEnumerableOrArray): boolean; + setEquals(other: IEnumerableOrArray): boolean; + symmetricExceptWith(other: IEnumerableOrArray): void; + unionWith(other: IEnumerableOrArray): void; + protected _clearInternal(): number; + protected _onDispose(): void; + protected abstract _getNode(item: T): ILinkedNodeWithValue; + contains(item: T): boolean; + getEnumerator(): IEnumerator; + forEach(action: Predicate | Action, useCopy?: boolean): void; + protected _removeNode(node: ILinkedNodeWithValue): boolean; + removeFirst(): boolean; + removeLast(): boolean; +} +export default SetBase; diff --git a/dist/commonjs/System/Collections/Sorting/KeySortedContext.d.ts b/dist/commonjs/System/Collections/Sorting/KeySortedContext.d.ts new file mode 100644 index 00000000..36822f6a --- /dev/null +++ b/dist/commonjs/System/Collections/Sorting/KeySortedContext.d.ts @@ -0,0 +1,16 @@ +/// +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import SortContext from "./SortContext"; +export default class KeySortedContext extends SortContext { + protected _keySelector: Selector; + constructor(next: IComparer, _keySelector: Selector, order?: Order, comparer?: Comparison); + compare(a: T, b: T): number; +} diff --git a/dist/commonjs/System/Collections/Sorting/SortContext.d.ts b/dist/commonjs/System/Collections/Sorting/SortContext.d.ts new file mode 100644 index 00000000..b459e302 --- /dev/null +++ b/dist/commonjs/System/Collections/Sorting/SortContext.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class SortContext implements IComparer { + protected _next: IComparer; + protected _comparer: Comparison; + protected _order: Order; + order: Order; + constructor(_next: IComparer, _comparer?: Comparison, _order?: Order); + generateSortedIndexes(source: T[]): number[]; + compare(a: T, b: T): number; +} diff --git a/dist/commonjs/System/Compare.d.ts b/dist/commonjs/System/Compare.d.ts new file mode 100644 index 00000000..1d12a4b3 --- /dev/null +++ b/dist/commonjs/System/Compare.d.ts @@ -0,0 +1,11 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function areEqual(a: any, b: any, strict?: boolean): boolean; +export declare function compare(a: IComparable, b: IComparable): number; +export declare function compare(a: T, b: T, strict?: boolean): CompareResult; +export declare function areEquivalent(a: any, b: any, nullEquivalency?: boolean, extraDepth?: number): boolean; diff --git a/dist/commonjs/System/Diagnostics/Stopwatch.d.ts b/dist/commonjs/System/Diagnostics/Stopwatch.d.ts new file mode 100644 index 00000000..b0bd97a1 --- /dev/null +++ b/dist/commonjs/System/Diagnostics/Stopwatch.d.ts @@ -0,0 +1,24 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeSpan from "../Time/TimeSpan"; +export default class Stopwatch implements ITimer { + static getTimestampMilliseconds(): number; + private _elapsed; + private _startTimeStamp; + private _isRunning; + isRunning: boolean; + constructor(); + static startNew(): Stopwatch; + static measure(closure: () => void): TimeSpan; + start(): void; + stop(): void; + reset(): void; + lap(): TimeSpan; + currentLapMilliseconds: number; + currentLap: TimeSpan; + elapsedMilliseconds: number; + elapsed: TimeSpan; +} diff --git a/dist/commonjs/System/Disposable/DisposableBase.d.ts b/dist/commonjs/System/Disposable/DisposableBase.d.ts new file mode 100644 index 00000000..1acd883f --- /dev/null +++ b/dist/commonjs/System/Disposable/DisposableBase.d.ts @@ -0,0 +1,16 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare abstract class DisposableBase implements IDisposableAware { + private _finalizer; + constructor(_finalizer?: () => void); + private _wasDisposed; + wasDisposed: boolean; + protected _disposableObjectName: string; + protected throwIfDisposed(message?: string, objectName?: string): boolean; + dispose(): void; + protected _onDispose(): void; +} +export default DisposableBase; diff --git a/dist/commonjs/System/Disposable/ObjectDisposedException.d.ts b/dist/commonjs/System/Disposable/ObjectDisposedException.d.ts new file mode 100644 index 00000000..66e40831 --- /dev/null +++ b/dist/commonjs/System/Disposable/ObjectDisposedException.d.ts @@ -0,0 +1,15 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import Exception from '../Exception'; +import InvalidOperationException from '../Exceptions/InvalidOperationException'; +export default class ObjectDisposedException extends InvalidOperationException { + objectName: string; + constructor(objectName: string, message?: string, innerException?: Exception); + protected getName(): string; + toString(): string; + static throwIfDisposed(disposable: IDisposableAware, objectName?: string, message?: string): void; +} diff --git a/dist/commonjs/System/Disposable/ObjectPool.d.ts b/dist/commonjs/System/Disposable/ObjectPool.d.ts new file mode 100644 index 00000000..af854543 --- /dev/null +++ b/dist/commonjs/System/Disposable/ObjectPool.d.ts @@ -0,0 +1,30 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon ObjectPool from Parallel Extension Extras and other ObjectPool implementations. + * Uses .add(T) and .take():T + */ +import DisposableBase from "./DisposableBase"; +export default class ObjectPool extends DisposableBase { + private _maxSize; + private _generator; + private _pool; + private _trimmer; + private _flusher; + private _autoFlusher; + private _localAbsMaxSize; + autoClearTimeout: number; + constructor(_maxSize: number, _generator: () => T); + maxSize: number; + count: number; + protected _trim(): void; + trim(defer?: number): void; + protected _clear(): void; + clear(defer?: number): void; + toArrayAndClear(): T[]; + dump(): T[]; + protected _onDispose(): void; + extendAutoClear(): void; + add(o: T): void; + take(): T; +} diff --git a/dist/commonjs/System/Disposable/dispose.d.ts b/dist/commonjs/System/Disposable/dispose.d.ts new file mode 100644 index 00000000..ea01844c --- /dev/null +++ b/dist/commonjs/System/Disposable/dispose.d.ts @@ -0,0 +1,17 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function dispose(...disposables: IDisposable[]): void; +export declare module dispose { + function deferred(...disposables: IDisposable[]): void; + function withoutException(...disposables: IDisposable[]): any[]; + function these(disposables: IDisposable[], trapExceptions?: boolean): any[]; + module these { + function deferred(disposables: IDisposable[], delay?: number): void; + } +} +export declare function using(disposable: TDisposable, closure: (disposable: TDisposable) => TReturn): TReturn; +export default dispose; diff --git a/dist/commonjs/System/Events/EventDispatcherBase.d.ts b/dist/commonjs/System/Events/EventDispatcherBase.d.ts new file mode 100644 index 00000000..e8e78469 --- /dev/null +++ b/dist/commonjs/System/Events/EventDispatcherBase.d.ts @@ -0,0 +1,33 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +import EventDispatcherEntry from "./EventDispatcherEntry"; +export interface IEventBase { + type: string; + target: TTarget; +} +export interface IEvent extends IEventBase { +} +export interface IEntryParams { + priority: number; + dispatcher: EventDispatcherBase; +} +export default class EventDispatcherBase extends DisposableBase implements IEventDispatcher { + protected _entries: EventDispatcherEntry[]; + addEventListener(type: string, listener: IEventListener, priority?: number): void; + removeEntry(entry: EventDispatcherEntry): boolean; + registerEventListener(type: string, listener: IEventListener, priority?: number): void; + hasEventListener(type: string, listener?: IEventListener): boolean; + removeEventListener(type: string, listener: IEventListener): void; + dispatchEvent(type: string, params?: any): boolean; + dispatchEvent(event: IEvent): boolean; + static DISPOSING: string; + static DISPOSED: string; + private _isDisposing; + isDisposing: boolean; + dispose(): void; +} diff --git a/dist/commonjs/System/Events/EventDispatcherEntry.d.ts b/dist/commonjs/System/Events/EventDispatcherEntry.d.ts new file mode 100644 index 00000000..73b2f602 --- /dev/null +++ b/dist/commonjs/System/Events/EventDispatcherEntry.d.ts @@ -0,0 +1,16 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +export default class EventDispatcherEntry extends DisposableBase implements IEquatable> { + type: string; + listener: IEventListener; + params: TParams; + constructor(type: string, listener: IEventListener, params?: TParams, finalizer?: () => void); + protected _onDispose(): void; + dispatch(e: Event): boolean; + matches(type: string, listener: IEventListener): boolean; + equals(other: EventDispatcherEntry): boolean; +} diff --git a/dist/commonjs/System/Events/EventSimple.d.ts b/dist/commonjs/System/Events/EventSimple.d.ts new file mode 100644 index 00000000..f4fd3db2 --- /dev/null +++ b/dist/commonjs/System/Events/EventSimple.d.ts @@ -0,0 +1,13 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Based on Netjs mscorlib.ts + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class EventSimple implements IDisposable { + private _listeners; + add(listener: T): void; + remove(listener: T): void; + dispatch(...params: any[]): void; + toMulticastFunction(): Function; + dispose(): void; +} diff --git a/dist/commonjs/System/Exception.d.ts b/dist/commonjs/System/Exception.d.ts new file mode 100644 index 00000000..dce52d48 --- /dev/null +++ b/dist/commonjs/System/Exception.d.ts @@ -0,0 +1,18 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +export default class Exception implements Error, IDisposable { + message: string; + name: string; + constructor(message?: string, innerException?: Error, beforeSealing?: (ex: any) => void); + stack: string; + data: IMap; + protected getName(): string; + toString(): string; + protected toStringWithoutBrackets(): string; + dispose(): void; +} diff --git a/dist/commonjs/System/ExceptionType.d.ts b/dist/commonjs/System/ExceptionType.d.ts new file mode 100644 index 00000000..5cd2e52a --- /dev/null +++ b/dist/commonjs/System/ExceptionType.d.ts @@ -0,0 +1,11 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare const Error: string; +export declare const EvalError: string; +export declare const RangeError: string; +export declare const ReferenceError: string; +export declare const SyntaxError: string; +export declare const TypeError: string; +export declare const URIError: string; diff --git a/dist/commonjs/System/Exceptions/ArgumentException.d.ts b/dist/commonjs/System/Exceptions/ArgumentException.d.ts new file mode 100644 index 00000000..eac4232c --- /dev/null +++ b/dist/commonjs/System/Exceptions/ArgumentException.d.ts @@ -0,0 +1,11 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from "./SystemException"; +export default class ArgumentException extends SystemException { + paramName: string; + constructor(paramName: string, message?: string, innerException?: Error, beforeSealing?: (ex: any) => void); + protected getName(): string; +} diff --git a/dist/commonjs/System/Exceptions/ArgumentNullException.d.ts b/dist/commonjs/System/Exceptions/ArgumentNullException.d.ts new file mode 100644 index 00000000..5cc13038 --- /dev/null +++ b/dist/commonjs/System/Exceptions/ArgumentNullException.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import ArgumentException from './ArgumentException'; +export default class ArgumentNullException extends ArgumentException { + constructor(paramName: string, message?: string, innerException?: Error); + protected getName(): string; +} diff --git a/dist/commonjs/System/Exceptions/ArgumentOutOfRangeException.d.ts b/dist/commonjs/System/Exceptions/ArgumentOutOfRangeException.d.ts new file mode 100644 index 00000000..4fd62443 --- /dev/null +++ b/dist/commonjs/System/Exceptions/ArgumentOutOfRangeException.d.ts @@ -0,0 +1,12 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import Exception from "../Exception"; +import ArgumentException from "./ArgumentException"; +export default class ArgumentOutOfRangeException extends ArgumentException { + actualValue: string | number | boolean; + constructor(paramName: string, actualValue: string | number | boolean, message?: string, innerException?: Exception); + protected getName(): string; +} diff --git a/dist/commonjs/System/Exceptions/InvalidOperationException.d.ts b/dist/commonjs/System/Exceptions/InvalidOperationException.d.ts new file mode 100644 index 00000000..4f422d04 --- /dev/null +++ b/dist/commonjs/System/Exceptions/InvalidOperationException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from './SystemException'; +export default class InvalidOperationException extends SystemException { + protected getName(): string; +} diff --git a/dist/commonjs/System/Exceptions/NotImplementedException.d.ts b/dist/commonjs/System/Exceptions/NotImplementedException.d.ts new file mode 100644 index 00000000..0225eeb8 --- /dev/null +++ b/dist/commonjs/System/Exceptions/NotImplementedException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from './SystemException'; +export default class NotImplementedException extends SystemException { + protected getName(): string; +} diff --git a/dist/commonjs/System/Exceptions/NullReferenceException.d.ts b/dist/commonjs/System/Exceptions/NullReferenceException.d.ts new file mode 100644 index 00000000..780b64a6 --- /dev/null +++ b/dist/commonjs/System/Exceptions/NullReferenceException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from './SystemException'; +export default class NullReferenceException extends SystemException { + protected getName(): string; +} diff --git a/dist/commonjs/System/Exceptions/SystemException.d.ts b/dist/commonjs/System/Exceptions/SystemException.d.ts new file mode 100644 index 00000000..239bfbef --- /dev/null +++ b/dist/commonjs/System/Exceptions/SystemException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/system.systemexception%28v=vs.110%29.aspx + */ +import Exception from '../Exception'; +export default class SystemException extends Exception { + protected getName(): string; +} diff --git a/dist/commonjs/System/Functions.d.ts b/dist/commonjs/System/Functions.d.ts new file mode 100644 index 00000000..0262bc62 --- /dev/null +++ b/dist/commonjs/System/Functions.d.ts @@ -0,0 +1,17 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare class Functions { + Identity(x: T): T; + True(): boolean; + False(): boolean; + Blank(): void; +} +declare module Functions { + var Identity: (x: T) => T; + var True: () => boolean; + var False: () => boolean; + var Blank: () => void; +} +export default Functions; diff --git a/dist/commonjs/System/Integer.d.ts b/dist/commonjs/System/Integer.d.ts new file mode 100644 index 00000000..04881834 --- /dev/null +++ b/dist/commonjs/System/Integer.d.ts @@ -0,0 +1,25 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function Integer(n: number): number; +export declare module Integer { + const MAX_32_BIT: number; + function random(maxExclusive: number): number; + module random { + function next(boundary: number, inclusive?: boolean): number; + function nextInRange(min: number, max: number, inclusive?: boolean): number; + function select(source: IArray): T; + module select { + function one(source: IArray): T; + } + } + function as32Bit(n: number): number; + function is(n: number): boolean; + function is32Bit(n: number): boolean; + function assert(n: number, argumentName?: string): boolean; + function assertZeroOrGreater(n: number, argumentName?: string): boolean; + function assertPositive(n: number, argumentName?: string): boolean; +} +export default Integer; diff --git a/dist/commonjs/System/KeyValueExtract.d.ts b/dist/commonjs/System/KeyValueExtract.d.ts new file mode 100644 index 00000000..cfe473b9 --- /dev/null +++ b/dist/commonjs/System/KeyValueExtract.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function isKeyValuePair(kvp: any): kvp is IKeyValuePair; +export declare function assertKey(key: TKey, name?: string): TKey; +export declare function assertTuple(tuple: IArray, name?: string): void; +export declare function assertNotUndefined(value: T, name: string): T; +export default function extractKeyValue(item: KeyValuePair, to: (key: TKey, value: TValue) => TResult): TResult; diff --git a/dist/commonjs/System/Lazy.d.ts b/dist/commonjs/System/Lazy.d.ts new file mode 100644 index 00000000..de32b287 --- /dev/null +++ b/dist/commonjs/System/Lazy.d.ts @@ -0,0 +1,21 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from './Disposable/DisposableBase'; +export default class Lazy extends DisposableBase implements ILazy { + private _closure; + private _isValueCreated; + private _value; + constructor(_closure: Func); + isValueCreated: boolean; + canReset: boolean; + reset(throwIfCannotReset?: boolean): boolean; + value: T; + getValue(clearClosureReference?: boolean): T; + protected _onDispose(): void; + equals(other: Lazy): boolean; + valueEquals(other: Lazy): boolean; +} diff --git a/dist/commonjs/System/Net/Http/HttpMethod.d.ts b/dist/commonjs/System/Net/Http/HttpMethod.d.ts new file mode 100644 index 00000000..d70dbbd8 --- /dev/null +++ b/dist/commonjs/System/Net/Http/HttpMethod.d.ts @@ -0,0 +1,7 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + */ +export declare const OPTIONS: HttpMethodValue, HEAD: HttpMethodValue, GET: HttpMethodValue, PUT: HttpMethodValue, POST: HttpMethodValue, DELETE: HttpMethodValue, TRACE: HttpMethodValue, CONNECT: HttpMethodValue; diff --git a/dist/commonjs/System/Net/Http/HttpMethod.js b/dist/commonjs/System/Net/Http/HttpMethod.js new file mode 100644 index 00000000..d9114b25 --- /dev/null +++ b/dist/commonjs/System/Net/Http/HttpMethod.js @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + */ +"use strict"; + +exports.OPTIONS = 'OPTIONS', exports.HEAD = 'HEAD', exports.GET = 'GET', exports.PUT = 'PUT', exports.POST = 'POST', exports.DELETE = 'DELETE', exports.TRACE = 'TRACE', exports.CONNECT = 'CONNECT'; +//# sourceMappingURL=HttpMethod.js.map diff --git a/dist/commonjs/System/Net/Http/HttpMethod.js.map b/dist/commonjs/System/Net/Http/HttpMethod.js.map new file mode 100644 index 00000000..0f9aeee4 --- /dev/null +++ b/dist/commonjs/System/Net/Http/HttpMethod.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Net/Http/HttpMethod.js","System/Net/Http/HttpMethod.ts"],"names":[],"mappings":";;;;;AAKA;;ACIC,QAAA,OAAA,GAA0B,SAA1B,EACA,QAAA,IAAA,GAA0B,MAA1B,EACA,QAAA,GAAA,GAA0B,KAA1B,EACA,QAAA,GAAA,GAA0B,KAA1B,EACA,QAAA,IAAA,GAA0B,MAA1B,EACA,QAAA,MAAA,GAA0B,QAA1B,EACA,QAAA,KAAA,GAA0B,OAA1B,EACA,QAAA,OAAA,GAA0B,SAA1B","file":"System/Net/Http/HttpMethod.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html\n */\n\"use strict\";\nexports.OPTIONS = 'OPTIONS', exports.HEAD = 'HEAD', exports.GET = 'GET', exports.PUT = 'PUT', exports.POST = 'POST', exports.DELETE = 'DELETE', exports.TRACE = 'TRACE', exports.CONNECT = 'CONNECT';\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html\r\n */\r\n\r\n///\r\n\r\nexport const\r\n\tOPTIONS:HttpMethodValue = 'OPTIONS',\r\n\tHEAD:HttpMethodValue = 'HEAD',\r\n\tGET:HttpMethodValue = 'GET',\r\n\tPUT:HttpMethodValue = 'PUT',\r\n\tPOST:HttpMethodValue = 'POST',\r\n\tDELETE:HttpMethodValue = 'DELETE',\r\n\tTRACE:HttpMethodValue = 'TRACE',\r\n\tCONNECT:HttpMethodValue = 'CONNECT';\r\n"]} \ No newline at end of file diff --git a/dist/commonjs/System/Net/Http/HttpRequestFactory.d.ts b/dist/commonjs/System/Net/Http/HttpRequestFactory.d.ts new file mode 100644 index 00000000..1342a0e0 --- /dev/null +++ b/dist/commonjs/System/Net/Http/HttpRequestFactory.d.ts @@ -0,0 +1,21 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import Uri from "../../Uri/Uri"; +import DisposableBase from "../../Disposable/DisposableBase"; +export default class HttpRequestFactory extends DisposableBase { + private _http; + protected _uriDefaults: Uri; + constructor(_http: IHttpRequestAdapter, uriDefaults?: string | IUri); + protected _onDispose(): void; + uri(uri: string | IUri): HttpRequestFactory; + params(params: QueryParamsConvertible): HttpRequestFactory; + request(method: HttpMethodValue, data?: any): IPromise; + get(): IPromise; + put(): IPromise; + post(data: any): IPromise; + 'delete'(): IPromise; +} diff --git a/dist/commonjs/System/Net/Http/HttpRequestFactory.js b/dist/commonjs/System/Net/Http/HttpRequestFactory.js new file mode 100644 index 00000000..14355fb3 --- /dev/null +++ b/dist/commonjs/System/Net/Http/HttpRequestFactory.js @@ -0,0 +1,94 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ArgumentNullException_1 = require("../../Exceptions/ArgumentNullException"); +var Uri_1 = require("../../Uri/Uri"); +var DisposableBase_1 = require("../../Disposable/DisposableBase"); +var HttpMethod_1 = require("./HttpMethod"); + +var HttpRequestFactory = function (_DisposableBase_1$def) { + _inherits(HttpRequestFactory, _DisposableBase_1$def); + + function HttpRequestFactory(_http, uriDefaults) { + _classCallCheck(this, HttpRequestFactory); + + var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(HttpRequestFactory).call(this)); + + _this._http = _http; + _this._disposableObjectName = 'HttpRequestFactory'; + if (!_http) throw new ArgumentNullException_1.default('_http'); + _this._uriDefaults = Uri_1.default.from(uriDefaults); + return _this; + } + + _createClass(HttpRequestFactory, [{ + key: "_onDispose", + value: function _onDispose() { + this._http = null; + this._uriDefaults = null; + } + }, { + key: "uri", + value: function uri(_uri) { + var _ = this; + _.throwIfDisposed(); + var u = Uri_1.default.from(_uri, _._uriDefaults); + return _._uriDefaults.equals(u) ? _ : new HttpRequestFactory(_._http, u); + } + }, { + key: "params", + value: function params(_params) { + var _ = this; + _.throwIfDisposed(); + return _.uri(_._uriDefaults.updateQuery(_params)); + } + }, { + key: "request", + value: function request(method, data) { + var _ = this; + _.throwIfDisposed(); + return _._http.request({ + method: method, + uri: _._uriDefaults, + data: data + }); + } + }, { + key: "get", + value: function get() { + return this.request(HttpMethod_1.GET); + } + }, { + key: "put", + value: function put() { + return this.request(HttpMethod_1.PUT); + } + }, { + key: "post", + value: function post(data) { + return this.request(HttpMethod_1.POST, data); + } + }, { + key: 'delete', + value: function _delete() { + return this.request(HttpMethod_1.DELETE); + } + }]); + + return HttpRequestFactory; +}(DisposableBase_1.default); + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = HttpRequestFactory; +//# sourceMappingURL=HttpRequestFactory.js.map diff --git a/dist/commonjs/System/Net/Http/HttpRequestFactory.js.map b/dist/commonjs/System/Net/Http/HttpRequestFactory.js.map new file mode 100644 index 00000000..194e0acb --- /dev/null +++ b/dist/commonjs/System/Net/Http/HttpRequestFactory.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Net/Http/HttpRequestFactory.ts","System/Net/Http/HttpRequestFactory.js"],"names":[],"mappings":";;;;AAOA;;;;;;;;;;AAEA,IAAA,0BAAA,QAAkC,wCAAlC,CAAA;AACA,IAAA,QAAA,QAAgB,eAAhB,CAAA;AACA,IAAA,mBAAA,QAA2B,iCAA3B,CAAA;AAEA,IAAA,eAAA,QAAqC,cAArC,CAAA;;IAKA;;;AAKC,aALD,kBAKC,CACS,KADT,EAEC,WAFD,EAEyB;8BAP1B,oBAO0B;;2EAP1B,gCAO0B;;AADhB,cAAA,KAAA,GAAA,KAAA,CACgB;AAIxB,cAAK,qBAAL,GAA6B,oBAA7B,CAJwB;AAMxB,YAAG,CAAC,KAAD,EACF,MAAM,IAAI,wBAAA,OAAA,CAAsB,OAA1B,CAAN,CADD;AAGA,cAAK,YAAL,GAAoB,MAAA,OAAA,CAAI,IAAJ,CAAS,WAAT,CAApB,CATwB;;KAFzB;;iBALD;;qCAmBqB;AAEnB,iBAAK,KAAL,GAAa,IAAb,CAFmB;AAGnB,iBAAK,YAAL,GAAoB,IAApB,CAHmB;;;;4BAMhB,MAAe;AAGlB,gBAAI,IAAI,IAAJ,CAHc;AAIlB,cAAE,eAAF,GAJkB;AAKlB,gBAAI,IAAI,MAAA,OAAA,CAAI,IAAJ,CAAS,IAAT,EAAc,EAAE,YAAF,CAAlB,CALc;AAMlB,mBAAO,EAAE,YAAF,CAAe,MAAf,CAAsB,CAAtB,IACJ,CADI,GAEJ,IAAI,kBAAJ,CAAuB,EAAE,KAAF,EAAS,CAAhC,CAFI,CANW;;;;+BAWZ,SAA6B;AAEnC,gBAAI,IAAI,IAAJ,CAF+B;AAGnC,cAAE,eAAF,GAHmC;AAInC,mBAAO,EAAE,GAAF,CAAM,EAAE,YAAF,CAAe,WAAf,CAA2B,OAA3B,CAAN,CAAP,CAJmC;;;;gCAOnB,QAAwB,MAAS;AAEjD,gBAAI,IAAI,IAAJ,CAF6C;AAGjD,cAAE,eAAF,GAHiD;AAIjD,mBAAO,EAAE,KAAF,CAAQ,OAAR,CAAgB;AACtB,wBAAQ,MAAR;AACA,qBAAK,EAAE,YAAF;AACL,sBAAM,IAAN;aAHM,CAAP,CAJiD;;;;8BAY/C;AAEF,mBAAO,KAAK,OAAL,CAAsB,aAAA,GAAA,CAA7B,CAFE;;;;8BAKA;AAEF,mBAAO,KAAK,OAAL,CAAsB,aAAA,GAAA,CAA7B,CAFE;;;;6BAKW,MAAQ;AAErB,mBAAO,KAAK,OAAL,CAAsB,aAAA,IAAA,EAAM,IAA5B,CAAP,CAFqB;;;aAKtB;kCAAQ;AAEP,mBAAO,KAAK,OAAL,CAAsB,aAAA,MAAA,CAA7B,CAFO;;;;WAtET;EAAgD,iBAAA,OAAA;;AAAhD,OAAA,cAAA,CAAA,OAAA,EAAA,YAAA,EAAA,EAAA,OAAA,IAAA,EAAA;ACwCA,QAAQ,OAAR,GAAkB,kBAAlB","file":"System/Net/Http/HttpRequestFactory.js","sourcesContent":["/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n///\r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nimport ArgumentNullException from \"../../Exceptions/ArgumentNullException\";\r\nimport Uri from \"../../Uri/Uri\";\r\nimport DisposableBase from \"../../Disposable/DisposableBase\";\r\nimport QueryBuilder from \"../../Uri/QueryBuilder\";\r\nimport {GET, PUT, POST, DELETE} from \"./HttpMethod\";\r\n\r\n/**\r\n * This class exposes a factory for making requests to prepared uri and params.\r\n */\r\nexport default class HttpRequestFactory extends DisposableBase\r\n{\r\n\r\n\tprotected _uriDefaults:Uri;\r\n\r\n\tconstructor(\r\n\t\tprivate _http:IHttpRequestAdapter,\r\n\t\turiDefaults?:string|IUri)\r\n\t{\r\n\t\tsuper();\r\n\r\n\t\tthis._disposableObjectName = 'HttpRequestFactory';\r\n\r\n\t\tif(!_http)\r\n\t\t\tthrow new ArgumentNullException('_http');\r\n\r\n\t\tthis._uriDefaults = Uri.from(uriDefaults);\r\n\t}\r\n\r\n\tprotected _onDispose() {\r\n\t\t// super._onDispose(); // Not required for first level inheritance.\r\n\t\tthis._http = null;\r\n\t\tthis._uriDefaults = null;\r\n\t}\r\n\r\n\turi(uri:string|IUri):HttpRequestFactory\r\n\t{\r\n\r\n\t\tvar _ = this;\r\n\t\t_.throwIfDisposed();\r\n\t\tvar u = Uri.from(uri, _._uriDefaults);\r\n\t\treturn _._uriDefaults.equals(u)\r\n\t\t\t? _\r\n\t\t\t: new HttpRequestFactory(_._http, u);\r\n\t}\r\n\r\n\tparams(params:QueryParamsConvertible):HttpRequestFactory\r\n\t{\r\n\t\tvar _ = this;\r\n\t\t_.throwIfDisposed();\r\n\t\treturn _.uri(_._uriDefaults.updateQuery(params));\r\n\t}\r\n\r\n\trequest(method:HttpMethodValue, data?:any):IPromise\r\n\t{\r\n\t\tvar _ = this;\r\n\t\t_.throwIfDisposed();\r\n\t\treturn _._http.request({\r\n\t\t\tmethod: method,\r\n\t\t\turi: _._uriDefaults,\r\n\t\t\tdata: data\r\n\t\t});\r\n\t}\r\n\r\n\r\n\tget():IPromise\r\n\t{\r\n\t\treturn this.request(GET);\r\n\t}\r\n\r\n\tput():IPromise\r\n\t{\r\n\t\treturn this.request(PUT);\r\n\t}\r\n\r\n\tpost(data:any):IPromise\r\n\t{\r\n\t\treturn this.request(POST, data);\r\n\t}\r\n\r\n\t'delete'():IPromise\r\n\t{\r\n\t\treturn this.request(DELETE);\r\n\t}\r\n\r\n}\r\n","/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\n'use strict';\nconst ArgumentNullException_1 = require(\"../../Exceptions/ArgumentNullException\");\nconst Uri_1 = require(\"../../Uri/Uri\");\nconst DisposableBase_1 = require(\"../../Disposable/DisposableBase\");\nconst HttpMethod_1 = require(\"./HttpMethod\");\nclass HttpRequestFactory extends DisposableBase_1.default {\n constructor(_http, uriDefaults) {\n super();\n this._http = _http;\n this._disposableObjectName = 'HttpRequestFactory';\n if (!_http)\n throw new ArgumentNullException_1.default('_http');\n this._uriDefaults = Uri_1.default.from(uriDefaults);\n }\n _onDispose() {\n this._http = null;\n this._uriDefaults = null;\n }\n uri(uri) {\n var _ = this;\n _.throwIfDisposed();\n var u = Uri_1.default.from(uri, _._uriDefaults);\n return _._uriDefaults.equals(u)\n ? _\n : new HttpRequestFactory(_._http, u);\n }\n params(params) {\n var _ = this;\n _.throwIfDisposed();\n return _.uri(_._uriDefaults.updateQuery(params));\n }\n request(method, data) {\n var _ = this;\n _.throwIfDisposed();\n return _._http.request({\n method: method,\n uri: _._uriDefaults,\n data: data\n });\n }\n get() {\n return this.request(HttpMethod_1.GET);\n }\n put() {\n return this.request(HttpMethod_1.PUT);\n }\n post(data) {\n return this.request(HttpMethod_1.POST, data);\n }\n 'delete'() {\n return this.request(HttpMethod_1.DELETE);\n }\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = HttpRequestFactory;\n"]} \ No newline at end of file diff --git a/dist/commonjs/System/Observable/ObservableBase.d.ts b/dist/commonjs/System/Observable/ObservableBase.d.ts new file mode 100644 index 00000000..050d9f79 --- /dev/null +++ b/dist/commonjs/System/Observable/ObservableBase.d.ts @@ -0,0 +1,15 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +import SubscribableBase from "./SubscribableBase"; +declare abstract class ObservableBase extends SubscribableBase> implements IObservable { + protected _onNext(value: T): void; + protected _onError(error: Error): void; + protected _onCompleted(): void; +} +export default ObservableBase; diff --git a/dist/commonjs/System/Observable/ObservableNodeBase.d.ts b/dist/commonjs/System/Observable/ObservableNodeBase.d.ts new file mode 100644 index 00000000..420a0dbc --- /dev/null +++ b/dist/commonjs/System/Observable/ObservableNodeBase.d.ts @@ -0,0 +1,14 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +import ObservableBase from "./ObservableBase"; +export default class ObservableNodeBase extends ObservableBase implements IObserver { + onNext(value: T): void; + onError(error: Error): void; + onCompleted(): void; +} diff --git a/dist/commonjs/System/Observable/SubscribableBase.d.ts b/dist/commonjs/System/Observable/SubscribableBase.d.ts new file mode 100644 index 00000000..5de54bfc --- /dev/null +++ b/dist/commonjs/System/Observable/SubscribableBase.d.ts @@ -0,0 +1,19 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +export default class SubscribableBase implements IDisposable { + private __subscriptions; + protected _getSubscribers(): TSubscriber[]; + constructor(); + private _findEntryNode(subscriber); + subscribe(subscriber: TSubscriber): IDisposable; + unsubscribe(subscriber: TSubscriber): void; + protected _unsubscribeAll(returnSubscribers?: boolean): TSubscriber[]; + unsubscribeAll(): void; + dispose(): void; +} diff --git a/dist/commonjs/System/Observable/Subscription.d.ts b/dist/commonjs/System/Observable/Subscription.d.ts new file mode 100644 index 00000000..ad70893a --- /dev/null +++ b/dist/commonjs/System/Observable/Subscription.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +export default class Subscription implements IDisposableAware { + private _subscribable; + private _subscriber; + constructor(_subscribable: ISubscribable, _subscriber: T); + subscriber: T; + wasDisposed: boolean; + dispose(): void; +} diff --git a/dist/commonjs/System/Serialization/Utility.d.ts b/dist/commonjs/System/Serialization/Utility.d.ts new file mode 100644 index 00000000..f53d368c --- /dev/null +++ b/dist/commonjs/System/Serialization/Utility.d.ts @@ -0,0 +1,9 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function toString(value: Primitive | ISerializable, defaultForUnknown?: string): string; +export declare function isSerializable(instance: any): instance is ISerializable; +export declare function toPrimitive(value: string, caseInsensitive?: boolean, unknownHandler?: (v: string) => string): Primitive; diff --git a/dist/commonjs/System/Tasks/TaskHandler.d.ts b/dist/commonjs/System/Tasks/TaskHandler.d.ts new file mode 100644 index 00000000..750d1dd3 --- /dev/null +++ b/dist/commonjs/System/Tasks/TaskHandler.d.ts @@ -0,0 +1,12 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TaskHandlerBase from "./TaskHandlerBase"; +export default class TaskHandler extends TaskHandlerBase { + private _action; + constructor(_action: Closure); + protected _onExecute(): void; + protected _onDispose(): void; +} diff --git a/dist/commonjs/System/Tasks/TaskHandlerBase.d.ts b/dist/commonjs/System/Tasks/TaskHandlerBase.d.ts new file mode 100644 index 00000000..c3945286 --- /dev/null +++ b/dist/commonjs/System/Tasks/TaskHandlerBase.d.ts @@ -0,0 +1,17 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +declare abstract class TaskHandlerBase extends DisposableBase implements ICancellable { + constructor(); + protected _id: any; + isScheduled: boolean; + execute(defer?: number): void; + private static _handler(d); + protected abstract _onExecute(): void; + protected _onDispose(): void; + cancel(): boolean; +} +export default TaskHandlerBase; diff --git a/dist/commonjs/System/Tasks/defer.d.ts b/dist/commonjs/System/Tasks/defer.d.ts new file mode 100644 index 00000000..2b37b77f --- /dev/null +++ b/dist/commonjs/System/Tasks/defer.d.ts @@ -0,0 +1,7 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function defer(task: Closure, delay?: number): ICancellable; +export declare function interval(task: Function, interval: number, count?: number): ICancellable; diff --git a/dist/commonjs/System/Tasks/deferImmediate.d.ts b/dist/commonjs/System/Tasks/deferImmediate.d.ts new file mode 100644 index 00000000..9c479d18 --- /dev/null +++ b/dist/commonjs/System/Tasks/deferImmediate.d.ts @@ -0,0 +1,8 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on code from: https://github.com/kriskowal/q + */ +export default function deferImmediate(task: Closure): ICancellable; +export declare function runAfterDeferred(task: Closure): void; diff --git a/dist/commonjs/System/Text/RegexMatchEnumerator.d.ts b/dist/commonjs/System/Text/RegexMatchEnumerator.d.ts new file mode 100644 index 00000000..90c0d0d9 --- /dev/null +++ b/dist/commonjs/System/Text/RegexMatchEnumerator.d.ts @@ -0,0 +1,14 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import { Regex, Match } from "./RegularExpressions"; +export declare class RegexMatchEnumerator { + private _pattern; + constructor(pattern: string | RegExp | Regex); + matches(input: string): IEnumerator; + static matches(input: string, pattern: string | RegExp | Regex): IEnumerator; +} +declare var _default: typeof RegexMatchEnumerator.matches; +export default _default; diff --git a/dist/commonjs/System/Text/RegularExpressions.d.ts b/dist/commonjs/System/Text/RegularExpressions.d.ts new file mode 100644 index 00000000..af3b1fbd --- /dev/null +++ b/dist/commonjs/System/Text/RegularExpressions.d.ts @@ -0,0 +1,62 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Named groups based on: http://trentrichardson.com/2011/08/02/javascript-regexp-match-named-captures/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare module RegexOptions { + const IGNORE_CASE: string; + const I: string; + const GLOBAL: string; + const G: string; + const MULTI_LINE: string; + const M: string; + const UNICODE: string; + const U: string; + const STICKY: string; + const Y: string; + const IGNORE_PATTERN_WHITESPACE: string; + const W: string; + type Global = 'g'; + type IgnoreCase = 'i'; + type MultiLine = 'm'; + type Unicode = 'u'; + type Sticky = 'y'; + type IgnorePatternWhitespace = "w"; + type Literal = Global | IgnoreCase | MultiLine | Unicode | Sticky | IgnorePatternWhitespace; +} +export interface MatchEvaluator extends Selector { +} +export declare class Regex { + private _re; + private _keys; + constructor(pattern: string | RegExp, options?: RegexOptions.Literal | RegexOptions.Literal[], ...extra: RegexOptions.Literal[]); + match(input: string, startIndex?: number): Match; + matches(input: string): Match[]; + replace(input: string, replacement: Primitive, count?: number): string; + replace(input: string, evaluator: MatchEvaluator, count?: number): string; + isMatch(input: string): boolean; + static isMatch(input: string, pattern: string, options?: RegexOptions.Literal[]): boolean; + static replace(input: string, pattern: string, replacement: string, options?: RegexOptions.Literal[]): string; + static replace(input: string, pattern: string, evaluator: MatchEvaluator, options?: RegexOptions.Literal[]): string; +} +export declare class Capture { + value: string; + index: number; + length: number; + constructor(value?: string, index?: number); + freeze(): void; +} +export declare class Group extends Capture { + success: boolean; + constructor(value?: string, index?: number); + static Empty: Group; +} +export declare class Match extends Group { + groups: Group[]; + namedGroups: IMap; + constructor(value?: string, index?: number, groups?: Group[], namedGroups?: IMap); + freeze(): void; + static Empty: Match; +} +export default Regex; diff --git a/dist/commonjs/System/Text/StringBuilder.d.ts b/dist/commonjs/System/Text/StringBuilder.d.ts new file mode 100644 index 00000000..72f52b4c --- /dev/null +++ b/dist/commonjs/System/Text/StringBuilder.d.ts @@ -0,0 +1,21 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * .NET Reference: http://referencesource.microsoft.com/#mscorlib/system/text/StringBuilder.cs + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class StringBuilder implements IDisposable { + private _partArray; + private _latest; + constructor(...initial: any[]); + private appendSingle(item); + appendThese(items: any[]): StringBuilder; + append(...items: any[]): StringBuilder; + appendLine(...items: any[]): StringBuilder; + appendLines(items: any[]): StringBuilder; + isEmpty: boolean; + toString(): string; + join(delimiter: string): string; + clear(): void; + dispose(): void; +} diff --git a/dist/commonjs/System/Text/Utility.d.ts b/dist/commonjs/System/Text/Utility.d.ts new file mode 100644 index 00000000..324fdfb2 --- /dev/null +++ b/dist/commonjs/System/Text/Utility.d.ts @@ -0,0 +1,17 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare const EMPTY: string; +export declare function getHashCode(source: string): number; +export declare function repeat(source: string, count: number): string; +export declare function fromChars(ch: number, count: number): string; +export declare function fromChars(chars: number[]): string; +export declare function escapeRegExp(source: string): string; +export declare function trim(source: string, chars?: string | string[], ignoreCase?: boolean): string; +export declare function format(source: string, ...args: any[]): string; +export declare function supplant(source: string, params: { + [key: string]: any; +} | any[]): string; +export declare function startsWith(source: string, pattern: string): boolean; +export declare function endsWith(source: string, pattern: string): boolean; diff --git a/dist/commonjs/System/Time/ClockTime.d.ts b/dist/commonjs/System/Time/ClockTime.d.ts new file mode 100644 index 00000000..2ae5046e --- /dev/null +++ b/dist/commonjs/System/Time/ClockTime.d.ts @@ -0,0 +1,22 @@ +/// +/// +/// +/// +/// +/// +/// +/// +import TimeQuantity from './TimeQuantity'; +export default class ClockTime extends TimeQuantity implements IClockTime { + days: number; + hour: number; + minute: number; + second: number; + millisecond: number; + tick: number; + constructor(milliseconds: number); + constructor(hours: number, minutes: number, seconds?: number, milliseconds?: number); + static from(hours: number, minutes: number, seconds?: number, milliseconds?: number): ClockTime; + static millisecondsFromTime(hours: number, minutes: number, seconds?: number, milliseconds?: number): number; + toString(): string; +} diff --git a/dist/commonjs/System/Time/DateTime.d.ts b/dist/commonjs/System/Time/DateTime.d.ts new file mode 100644 index 00000000..3bd654c3 --- /dev/null +++ b/dist/commonjs/System/Time/DateTime.d.ts @@ -0,0 +1,57 @@ +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based on .NET DateTime's interface. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ClockTime from './ClockTime'; +import TimeSpan from './TimeSpan'; +declare class DateTime implements ICalendarDate, IDateTime { + private _value; + toJsDate(): Date; + private _setJsDate(value); + constructor(); + constructor(dateString: string, kind?: DateTime.Kind); + constructor(milliseconds: number, kind?: DateTime.Kind); + constructor(source: Date, kind?: DateTime.Kind); + constructor(source: DateTime, kind?: DateTime.Kind); + private _kind; + kind: DateTime.Kind; + year: number; + month: Gregorian.Month; + day: number; + dayOfWeek: Gregorian.DayOfWeek; + addMilliseconds(ms: number): DateTime; + addSeconds(seconds: number): DateTime; + addMinutes(minutes: number): DateTime; + addHours(hours: number): DateTime; + addDays(days: number): DateTime; + addMonths(months: number): DateTime; + addYears(years: number): DateTime; + add(time: ITimeQuantity): DateTime; + subtract(time: ITimeQuantity): DateTime; + timePassedSince(previous: Date | DateTime): TimeSpan; + date: DateTime; + private _time; + timeOfDay: ClockTime; + toTimeStamp(): ITimeStamp; + static now: DateTime; + toUniversalTime: DateTime; + static today: DateTime; + static tomorrow: DateTime; + static between(first: Date | DateTime, last: Date | DateTime): TimeSpan; + static isLeapYear(year: number): boolean; + static daysInMonth(year: number, month: Gregorian.Month): number; +} +declare module DateTime { + const enum Kind { + Unspecified = 0, + Local = 1, + Utc = 2, + } +} +export default DateTime; diff --git a/dist/commonjs/System/Time/HowMany.d.ts b/dist/commonjs/System/Time/HowMany.d.ts new file mode 100644 index 00000000..314a22e2 --- /dev/null +++ b/dist/commonjs/System/Time/HowMany.d.ts @@ -0,0 +1,41 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare module HowMany { + module Hours { + const enum Per { + Day = 24, + } + } + module Minutes { + const enum Per { + Hour = 60, + Day = 1440, + } + } + module Seconds { + const enum Per { + Minute = 60, + Hour = 3600, + Day = 86400, + } + } + module Milliseconds { + const enum Per { + Second = 1000, + Minute = 60000, + Hour = 3600000, + Day = 86400000, + } + } + module Ticks { + const enum Per { + Millisecond = 10000, + Second = 10000000, + Minute = 600000000, + Hour = 36000000000, + Day = 864000000000, + } + } +} diff --git a/dist/commonjs/System/Time/TimeQuantity.d.ts b/dist/commonjs/System/Time/TimeQuantity.d.ts new file mode 100644 index 00000000..52edb495 --- /dev/null +++ b/dist/commonjs/System/Time/TimeQuantity.d.ts @@ -0,0 +1,20 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeUnit from './TimeUnit'; +export default class TimeQuantity implements IEquatable, IComparable, ITimeQuantity { + protected _quantity: number; + constructor(_quantity?: number); + getTotalMilliseconds(): number; + direction: number; + equals(other: ITimeQuantity): boolean; + compareTo(other: ITimeQuantity): number; + protected _total: ITimeMeasurement; + total: ITimeMeasurement; + getTotal(units: TimeUnit): number; +} diff --git a/dist/commonjs/System/Time/TimeSpan.d.ts b/dist/commonjs/System/Time/TimeSpan.d.ts new file mode 100644 index 00000000..123ad876 --- /dev/null +++ b/dist/commonjs/System/Time/TimeSpan.d.ts @@ -0,0 +1,34 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Originally based upon .NET source but with many additions and improvements. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeUnit from './TimeUnit'; +import ClockTime from './ClockTime'; +import TimeQuantity from './TimeQuantity'; +export default class TimeSpan extends TimeQuantity implements ITimeMeasurement { + ticks: number; + milliseconds: number; + seconds: number; + minutes: number; + hours: number; + days: number; + constructor(value: number, units?: TimeUnit); + total: TimeSpan; + private _time; + time: ClockTime; + add(other: ITimeQuantity): TimeSpan; + addUnit(value: number, units?: TimeUnit): TimeSpan; + static from(value: number, units: TimeUnit): TimeSpan; + static fromDays(value: number): TimeSpan; + static fromHours(value: number): TimeSpan; + static fromMinutes(value: number): TimeSpan; + static fromSeconds(value: number): TimeSpan; + static fromMilliseconds(value: number): TimeSpan; + static fromTicks(value: number): TimeSpan; + static zero: TimeSpan; +} diff --git a/dist/commonjs/System/Time/TimeStamp.d.ts b/dist/commonjs/System/Time/TimeStamp.d.ts new file mode 100644 index 00000000..0e538ab3 --- /dev/null +++ b/dist/commonjs/System/Time/TimeStamp.d.ts @@ -0,0 +1,21 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class TimeStamp implements ITimeStamp, IDateTime { + year: number; + month: Gregorian.Month; + day: number; + hour: number; + minute: number; + second: number; + millisecond: number; + tick: number; + constructor(year: number, month: Gregorian.Month, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, tick?: number); + toJsDate(): Date; + static from(d: Date | IDateTime): TimeStamp; +} diff --git a/dist/commonjs/System/Time/TimeUnit.d.ts b/dist/commonjs/System/Time/TimeUnit.d.ts new file mode 100644 index 00000000..9de676d0 --- /dev/null +++ b/dist/commonjs/System/Time/TimeUnit.d.ts @@ -0,0 +1,22 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Originally based upon .NET source but with many additions and improvements. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare enum TimeUnit { + Ticks = 0, + Milliseconds = 1, + Seconds = 2, + Minutes = 3, + Hours = 4, + Days = 5, +} +declare module TimeUnit { + function toMilliseconds(value: number, units?: TimeUnit): number; + function fromMilliseconds(ms: number, units: TimeUnit): number; + function from(quantity: ITimeQuantity, unit: TimeUnit): number; + function assertValid(unit: TimeUnit): boolean; +} +export default TimeUnit; diff --git a/dist/commonjs/System/Time/TimeUnitValue.d.ts b/dist/commonjs/System/Time/TimeUnitValue.d.ts new file mode 100644 index 00000000..782f6cd6 --- /dev/null +++ b/dist/commonjs/System/Time/TimeUnitValue.d.ts @@ -0,0 +1,19 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeUnit from './TimeUnit'; +import TimeQuantity from './TimeQuantity'; +export default class TimeUnitValue extends TimeQuantity { + private _units; + constructor(value: number | ITimeQuantity, _units: TimeUnit); + value: number; + getTotalMilliseconds(): number; + units: TimeUnit; + to(units?: TimeUnit): TimeUnitValue; + static from(value: number | ITimeQuantity, units?: TimeUnit): TimeUnitValue; +} diff --git a/dist/commonjs/System/Timers/Timer.d.ts b/dist/commonjs/System/Timers/Timer.d.ts new file mode 100644 index 00000000..00797473 --- /dev/null +++ b/dist/commonjs/System/Timers/Timer.d.ts @@ -0,0 +1,24 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ObservableBase from "./../Observable/ObservableBase"; +export default class Timer extends ObservableBase implements ITimer, ICancellable { + private _interval; + private _maxCount; + private _initialDelay; + private _cancel; + private _count; + constructor(_interval: number, _maxCount?: number, _initialDelay?: number); + static startNew(millisecondInterval: number, maxCount?: number, initialDelay?: number): Timer; + isRunning: boolean; + count: number; + start(): void; + stop(): void; + reset(): void; + cancel(): boolean; + dispose(): void; + private static _onTick(timer, reInitTimer?); +} diff --git a/dist/commonjs/System/Types.d.ts b/dist/commonjs/System/Types.d.ts new file mode 100644 index 00000000..cddf07c8 --- /dev/null +++ b/dist/commonjs/System/Types.d.ts @@ -0,0 +1,46 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare class TypeInfo { + private target; + type: string; + isBoolean: boolean; + isNumber: boolean; + isFinite: boolean; + isValidNumber: boolean; + isString: boolean; + isTrueNaN: boolean; + isObject: boolean; + isFunction: boolean; + isUndefined: boolean; + isNull: boolean; + isNullOrUndefined: boolean; + isPrimitive: boolean; + constructor(target: any); + member(name: string): TypeInfo; + static getFor(target: any): TypeInfo; +} +export declare module Type { + const BOOLEAN: string; + const NUMBER: string; + const STRING: string; + const OBJECT: string; + const UNDEFINED: string; + const FUNCTION: string; + function isBoolean(value: any): value is boolean; + function isNumber(value: any, allowNaN?: boolean): value is number; + function isTrueNaN(value: any): value is number; + function isString(value: any): value is string; + function isPrimitive(value: any): value is Primitive; + function isFunction(value: any): value is Function; + function isObject(value: any, allowNull?: boolean): boolean; + function numberOrNaN(value: any): number; + function of(target: any): TypeInfo; + function hasMember(value: any, property: string): boolean; + function hasMemberOfType(instance: any, property: string, type: string): instance is T; + function isArrayLike(instance: any): instance is IArray; +} +export default Type; diff --git a/dist/commonjs/System/Uri/HostNameType.d.ts b/dist/commonjs/System/Uri/HostNameType.d.ts new file mode 100644 index 00000000..b4e74073 --- /dev/null +++ b/dist/commonjs/System/Uri/HostNameType.d.ts @@ -0,0 +1,13 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.UriHostNameType%28v=vs.110%29.aspx + */ +declare enum UriHostNameType { + Basic = 0, + DNS = 1, + IPv4 = 2, + IPv6 = 3, + Unknown = 4, +} +export default UriHostNameType; diff --git a/dist/commonjs/System/Uri/QueryBuilder.d.ts b/dist/commonjs/System/Uri/QueryBuilder.d.ts new file mode 100644 index 00000000..891db685 --- /dev/null +++ b/dist/commonjs/System/Uri/QueryBuilder.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import OrderedStringKeyDictionary from "../Collections/Dictionaries/OrderedStringKeyDictionary"; +export default class QueryBuilder extends OrderedStringKeyDictionary { + constructor(query: QueryParamsConvertible, decodeValues?: boolean); + static init(query: QueryParamsConvertible, decodeValues?: boolean): QueryBuilder; + importQuery(query: QueryParamsConvertible, decodeValues?: boolean): QueryBuilder; + importFromString(values: string, deserialize?: boolean, decodeValues?: boolean): QueryBuilder; + encode(prefixIfNotEmpty?: boolean): string; + toString(): string; +} diff --git a/dist/commonjs/System/Uri/QueryBuilder.js b/dist/commonjs/System/Uri/QueryBuilder.js new file mode 100644 index 00000000..4359f3ad --- /dev/null +++ b/dist/commonjs/System/Uri/QueryBuilder.js @@ -0,0 +1,87 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Types_1 = require("../Types"); +var QueryParams = require("./QueryParams"); +var OrderedStringKeyDictionary_1 = require("../Collections/Dictionaries/OrderedStringKeyDictionary"); +var Enumerator_1 = require("../Collections/Enumeration/Enumerator"); + +var QueryBuilder = function (_OrderedStringKeyDict) { + _inherits(QueryBuilder, _OrderedStringKeyDict); + + function QueryBuilder(query) { + var decodeValues = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1]; + + _classCallCheck(this, QueryBuilder); + + var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(QueryBuilder).call(this)); + + _this.importQuery(query, decodeValues); + return _this; + } + + _createClass(QueryBuilder, [{ + key: "importQuery", + value: function importQuery(query) { + var decodeValues = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1]; + + if (Types_1.default.isString(query)) { + this.importFromString(query, decodeValues); + } else if (Enumerator_1.isEnumerableOrArrayLike(query)) { + this.importEntries(query); + } else { + this.importMap(query); + } + return this; + } + }, { + key: "importFromString", + value: function importFromString(values) { + var deserialize = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1]; + var decodeValues = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; + + var _ = this; + QueryParams.parse(values, function (key, value) { + if (_.containsKey(key)) { + var prev = _.getValue(key); + if (Array.isArray(prev)) prev.push(value);else _.setValue(key, [prev, value]); + } else _.setValue(key, value); + }, deserialize, decodeValues); + return this; + } + }, { + key: "encode", + value: function encode(prefixIfNotEmpty) { + return QueryParams.encode(this, prefixIfNotEmpty); + } + }, { + key: "toString", + value: function toString() { + return this.encode(); + } + }], [{ + key: "init", + value: function init(query) { + var decodeValues = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1]; + + return new QueryBuilder(query, decodeValues); + } + }]); + + return QueryBuilder; +}(OrderedStringKeyDictionary_1.default); + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = QueryBuilder; +//# sourceMappingURL=QueryBuilder.js.map diff --git a/dist/commonjs/System/Uri/QueryParams.d.ts b/dist/commonjs/System/Uri/QueryParams.d.ts new file mode 100644 index 00000000..6bedb350 --- /dev/null +++ b/dist/commonjs/System/Uri/QueryParams.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function encode(values: IUriComponentMap | QueryParamEnumerableOrArray, prefixIfNotEmpty?: boolean): string; +export declare function encodeValue(value: UriComponentValue): string; +export declare function isUriComponentFormattable(instance: any): instance is IUriComponentFormattable; +export declare function parse(query: string, entryHandler: (key: string, value: Primitive) => void, deserialize?: boolean, decodeValues?: boolean): void; +export declare function parseToMap(query: string, deserialize?: boolean, decodeValues?: boolean): IMap; +export declare function parseToArray(query: string, deserialize?: boolean, decodeValues?: boolean): IStringKeyValuePair[]; +export declare module Separator { + const Entry: string; + const KeyValue: string; +} diff --git a/dist/commonjs/System/Uri/Scheme.d.ts b/dist/commonjs/System/Uri/Scheme.d.ts new file mode 100644 index 00000000..5e625ec8 --- /dev/null +++ b/dist/commonjs/System/Uri/Scheme.d.ts @@ -0,0 +1,21 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx + */ +declare enum Scheme { + file = 0, + ftp = 1, + gopher = 2, + http = 3, + https = 4, + ldap = 5, + mailto = 6, + pipe = 7, + tcp = 8, + news = 9, + nntp = 10, + telnet = 11, + uuid = 12, +} +export default Scheme; diff --git a/dist/commonjs/System/Uri/Scheme.js b/dist/commonjs/System/Uri/Scheme.js new file mode 100644 index 00000000..1e9c9c8b --- /dev/null +++ b/dist/commonjs/System/Uri/Scheme.js @@ -0,0 +1,33 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx + */ +"use strict"; + +var Scheme; +(function (Scheme) { + Scheme[Scheme["file"] = 0] = "file"; + Scheme[Scheme["ftp"] = 1] = "ftp"; + Scheme[Scheme["gopher"] = 2] = "gopher"; + Scheme[Scheme["http"] = 3] = "http"; + Scheme[Scheme["https"] = 4] = "https"; + Scheme[Scheme["ldap"] = 5] = "ldap"; + Scheme[Scheme["mailto"] = 6] = "mailto"; + Scheme[Scheme["pipe"] = 7] = "pipe"; + Scheme[Scheme["tcp"] = 8] = "tcp"; + Scheme[Scheme["news"] = 9] = "news"; + Scheme[Scheme["nntp"] = 10] = "nntp"; + Scheme[Scheme["telnet"] = 11] = "telnet"; + Scheme[Scheme["uuid"] = 12] = "uuid"; +})(Scheme || (Scheme = {})); +var PIPE = 'net.pipe'; +var TCP = 'net.tcp'; +Scheme[Scheme.pipe] = PIPE; +Scheme[Scheme.tcp] = TCP; +Scheme[PIPE] = Scheme.pipe; +Scheme[TCP] = Scheme.tcp; +Object.freeze(Scheme); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = Scheme; +//# sourceMappingURL=Scheme.js.map diff --git a/dist/commonjs/System/Uri/Scheme.js.map b/dist/commonjs/System/Uri/Scheme.js.map new file mode 100644 index 00000000..6cc69218 --- /dev/null +++ b/dist/commonjs/System/Uri/Scheme.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Uri/Scheme.js","System/Uri/Scheme.ts"],"names":[],"mappings":";;;;;AAKA;;ACEA,IAAK,MAAL;AAAA,CAAA,UAAK,MAAL,EAAW;AAIV,WAAA,OAAA,MAAA,IAAA,CAAA,CAAA,GAAA,MAAA,CAJU;AAUV,WAAA,OAAA,KAAA,IAAA,CAAA,CAAA,GAAA,KAAA,CAVU;AAgBV,WAAA,OAAA,QAAA,IAAA,CAAA,CAAA,GAAA,QAAA,CAhBU;AAsBV,WAAA,OAAA,MAAA,IAAA,CAAA,CAAA,GAAA,MAAA,CAtBU;AA4BV,WAAA,OAAA,OAAA,IAAA,CAAA,CAAA,GAAA,OAAA,CA5BU;AAkCV,WAAA,OAAA,MAAA,IAAA,CAAA,CAAA,GAAA,MAAA,CAlCU;AAwCV,WAAA,OAAA,QAAA,IAAA,CAAA,CAAA,GAAA,QAAA,CAxCU;AA8CV,WAAA,OAAA,MAAA,IAAA,CAAA,CAAA,GAAA,MAAA,CA9CU;AAoDV,WAAA,OAAA,KAAA,IAAA,CAAA,CAAA,GAAA,KAAA,CApDU;AA0DV,WAAA,OAAA,MAAA,IAAA,CAAA,CAAA,GAAA,MAAA,CA1DU;AAgEV,WAAA,OAAA,MAAA,IAAA,EAAA,CAAA,GAAA,MAAA,CAhEU;AAsEV,WAAA,OAAA,QAAA,IAAA,EAAA,CAAA,GAAA,QAAA,CAtEU;AA2EV,WAAA,OAAA,MAAA,IAAA,EAAA,CAAA,GAAA,MAAA,CA3EU;CAAX,CAAA,CAAK,WAAA,SAAM,EAAN,CAAA,CAAL;AA+EA,IAAM,OAAO,UAAP;AACN,IAAM,MAAM,SAAN;AAEN,OAAO,OAAO,IAAP,CAAP,GAAsB,IAAtB;AACA,OAAO,OAAO,GAAP,CAAP,GAAqB,GAArB;AAEM,OAAQ,IAAR,IAAgB,OAAO,IAAP;AAChB,OAAQ,GAAR,IAAe,OAAO,GAAP;AAErB,OAAO,MAAP,CAAc,MAAd;AAEA,OAAA,cAAA,CAAA,OAAA,EAAA,YAAA,EAAA,EAAA,OAAA,IAAA,EAAA;ADnEA,QAAQ,OAAR,GCmEe,MDnEf","file":"System/Uri/Scheme.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx\n */\n\"use strict\";\nvar Scheme;\n(function (Scheme) {\n Scheme[Scheme[\"file\"] = 0] = \"file\";\n Scheme[Scheme[\"ftp\"] = 1] = \"ftp\";\n Scheme[Scheme[\"gopher\"] = 2] = \"gopher\";\n Scheme[Scheme[\"http\"] = 3] = \"http\";\n Scheme[Scheme[\"https\"] = 4] = \"https\";\n Scheme[Scheme[\"ldap\"] = 5] = \"ldap\";\n Scheme[Scheme[\"mailto\"] = 6] = \"mailto\";\n Scheme[Scheme[\"pipe\"] = 7] = \"pipe\";\n Scheme[Scheme[\"tcp\"] = 8] = \"tcp\";\n Scheme[Scheme[\"news\"] = 9] = \"news\";\n Scheme[Scheme[\"nntp\"] = 10] = \"nntp\";\n Scheme[Scheme[\"telnet\"] = 11] = \"telnet\";\n Scheme[Scheme[\"uuid\"] = 12] = \"uuid\";\n})(Scheme || (Scheme = {}));\nconst PIPE = 'net.pipe';\nconst TCP = 'net.tcp';\nScheme[Scheme.pipe] = PIPE;\nScheme[Scheme.tcp] = TCP;\nScheme[PIPE] = Scheme.pipe;\nScheme[TCP] = Scheme.tcp;\nObject.freeze(Scheme);\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Scheme;\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx\r\n */\r\n\r\n// TODO: Possibly use string literals instead.\r\nenum Scheme {\r\n\t/**\r\n\t * The resource is a file on the local computer.\r\n\t */\r\n\tfile,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through FTP.\r\n\t */\r\n\tftp,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the Gopher protocol.\r\n\t */\r\n\tgopher,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through HTTP.\r\n\t */\r\n\thttp,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through SSL-encrypted HTTP.\r\n\t */\r\n\thttps,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the LDAP protocol.\r\n\t */\r\n\tldap,\r\n\r\n\r\n\t/**\r\n\t * The resource is an e-mail address and accessed through the SMTP protocol.\r\n\t */\r\n\tmailto,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through a named pipe.\r\n\t */\r\n\tpipe,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed from TCP endpoint.\r\n\t */\r\n\ttcp,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the NNTP protocol.\r\n\t */\r\n\tnews,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the NNTP protocol.\r\n\t */\r\n\tnntp,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the TELNET protocol.\r\n\t */\r\n\ttelnet,\r\n\r\n\t/**\r\n\t * The resource is accessed through a unique UUID endpoint name for communicating with a service.\r\n\t */\r\n\tuuid\r\n}\r\n\r\n// Extend the usefulness of the enum.\r\nconst PIPE = 'net.pipe';\r\nconst TCP = 'net.tcp';\r\n\r\nScheme[Scheme.pipe] = PIPE;\r\nScheme[Scheme.tcp] = TCP;\r\n\r\n(Scheme)[PIPE] = Scheme.pipe;\r\n(Scheme)[TCP] = Scheme.tcp;\r\n\r\nObject.freeze(Scheme);\r\n\r\nexport default Scheme;\r\n"]} \ No newline at end of file diff --git a/dist/commonjs/System/Uri/Uri.d.ts b/dist/commonjs/System/Uri/Uri.d.ts new file mode 100644 index 00000000..731d150d --- /dev/null +++ b/dist/commonjs/System/Uri/Uri.d.ts @@ -0,0 +1,48 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier + */ +import UriScheme from "../Uri/Scheme"; +export default class Uri implements IUri, IEquatable { + scheme: SchemeValue; + userInfo: string; + host: string; + port: number; + path: string; + query: string; + fragment: string; + queryParams: IMap; + constructor(scheme: UriScheme | SchemeValue, userInfo: string, host: string, port: number, path: string, query?: QueryParamsConvertible, fragment?: string); + equals(other: IUri): boolean; + static from(uri: string | IUri, defaults?: IUri): Uri; + static parse(url: string, throwIfInvalid?: boolean): IUri; + static tryParse(url: string, out: (result: IUri) => void): boolean; + static copyOf(map: IUri): IUri; + copyTo(map: IUri): IUri; + updateQuery(query: QueryParamsConvertible): Uri; + protected getAbsoluteUri(): string; + protected getAuthority(): string; + protected getPathAndQuery(): string; + absoluteUri: string; + authority: string; + pathAndQuery: string; + baseUri: string; + pathSegments: string[]; + toMap(): IUri; + toString(): string; + static toString(uri: IUri): string; + static getAuthority(uri: IUri): string; +} +export declare enum Fields { + scheme = 0, + userInfo = 1, + host = 2, + port = 3, + path = 4, + query = 5, + fragment = 6, +} diff --git a/dist/commonjs/System/Uri/Uri.js b/dist/commonjs/System/Uri/Uri.js new file mode 100644 index 00000000..96f75caf --- /dev/null +++ b/dist/commonjs/System/Uri/Uri.js @@ -0,0 +1,270 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier + */ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Types_1 = require("../Types"); +var QueryParams = require("../Uri/QueryParams"); +var Utility_1 = require("../Text/Utility"); +var Scheme_1 = require("../Uri/Scheme"); +var ArgumentException_1 = require("../Exceptions/ArgumentException"); +var ArgumentOutOfRangeException_1 = require("../Exceptions/ArgumentOutOfRangeException"); +var VOID0 = void 0; + +var Uri = function () { + function Uri(scheme, userInfo, host, port, path, query, fragment) { + _classCallCheck(this, Uri); + + var _ = this; + _.scheme = getScheme(scheme) || null; + _.userInfo = userInfo || null; + _.host = host || null; + _.port = getPort(port); + _.authority = _.getAuthority() || null; + _.path = path || null; + if (!Types_1.default.isString(query)) query = QueryParams.encode(query); + _.query = formatQuery(query) || null; + Object.freeze(_.queryParams = _.query ? QueryParams.parseToMap(_.query) : {}); + _.pathAndQuery = _.getPathAndQuery() || null; + _.fragment = formatFragment(fragment) || null; + _.absoluteUri = _.getAbsoluteUri(); + _.baseUri = _.absoluteUri.replace(/[?#].*/, ''); + Object.freeze(_); + } + + _createClass(Uri, [{ + key: "equals", + value: function equals(other) { + return this === other || this.absoluteUri == Uri.toString(other); + } + }, { + key: "copyTo", + value: function copyTo(map) { + return copyUri(this, map); + } + }, { + key: "updateQuery", + value: function updateQuery(query) { + var map = this.toMap(); + map.query = query; + return Uri.from(map); + } + }, { + key: "getAbsoluteUri", + value: function getAbsoluteUri() { + return uriToString(this); + } + }, { + key: "getAuthority", + value: function getAuthority() { + return _getAuthority(this); + } + }, { + key: "getPathAndQuery", + value: function getPathAndQuery() { + return _getPathAndQuery(this); + } + }, { + key: "toMap", + value: function toMap() { + return this.copyTo({}); + } + }, { + key: "toString", + value: function toString() { + return this.absoluteUri; + } + }, { + key: "pathSegments", + get: function get() { + return this.path.match(/^[/]|[^/]*[/]|[^/]+$/g); + } + }], [{ + key: "from", + value: function from(uri, defaults) { + var u = !uri || Types_1.default.isString(uri) ? Uri.parse(uri) : uri; + return new Uri(u.scheme || defaults && defaults.scheme, u.userInfo || defaults && defaults.userInfo, u.host || defaults && defaults.host, isNaN(u.port) ? defaults && defaults.port : u.port, u.path || defaults && defaults.path, u.query || defaults && defaults.query, u.fragment || defaults && defaults.fragment); + } + }, { + key: "parse", + value: function parse(url) { + var throwIfInvalid = arguments.length <= 1 || arguments[1] === undefined ? true : arguments[1]; + + var result = null; + var ex = _tryParse(url, function (out) { + result = out; + }); + if (throwIfInvalid && ex) throw ex; + return result; + } + }, { + key: "tryParse", + value: function tryParse(url, out) { + return !_tryParse(url, out); + } + }, { + key: "copyOf", + value: function copyOf(map) { + return copyUri(map); + } + }, { + key: "toString", + value: function toString(uri) { + return uri instanceof Uri ? uri.absoluteUri : uriToString(uri); + } + }, { + key: "getAuthority", + value: function getAuthority(uri) { + return _getAuthority(uri); + } + }]); + + return Uri; +}(); + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = Uri; +(function (Fields) { + Fields[Fields["scheme"] = 0] = "scheme"; + Fields[Fields["userInfo"] = 1] = "userInfo"; + Fields[Fields["host"] = 2] = "host"; + Fields[Fields["port"] = 3] = "port"; + Fields[Fields["path"] = 4] = "path"; + Fields[Fields["query"] = 5] = "query"; + Fields[Fields["fragment"] = 6] = "fragment"; +})(exports.Fields || (exports.Fields = {})); +var Fields = exports.Fields; +Object.freeze(Fields); +function copyUri(from, to) { + var i = 0, + field; + if (!to) to = {}; + while (field = Fields[i++]) { + var value = from[field]; + if (value) to[field] = value; + } + return to; +} +var SLASH = '/', + SLASH2 = '//', + QM = '?', + HASH = '#', + EMPTY = '', + AT = '@'; +function getScheme(scheme) { + var s = scheme; + if (Types_1.default.isString(s)) { + if (!s) return VOID0; + s = Scheme_1.default[Utility_1.trim(s).toLowerCase().replace(/[^a-z0-9+.-]+$/g, EMPTY)]; + if (isNaN(s)) throw new ArgumentOutOfRangeException_1.default('scheme', scheme, 'Invalid scheme.'); + } + if (Types_1.default.isNumber(s, false)) { + s = Scheme_1.default[s]; + if (!s) throw new ArgumentOutOfRangeException_1.default('scheme', scheme, 'Invalid scheme.'); + return s; + } + return VOID0; +} +function getPort(port) { + if (port === 0) return port; + if (!port) return null; + var p; + if (Types_1.default.isNumber(port, true)) { + p = port; + if (p >= 0 && isFinite(p)) return p; + } else if (Types_1.default.isString(port) && (p = parseInt(port)) && !isNaN(p)) { + return getPort(p); + } + throw new ArgumentException_1.default("port", "invalid value"); +} +function _getAuthority(uri) { + if (!uri.host) { + if (uri.userInfo) throw new ArgumentException_1.default('host', 'Cannot include user info when there is no host.'); + if (Types_1.default.isNumber(uri.port, false)) throw new ArgumentException_1.default('host', 'Cannot include a port when there is no host.'); + } + var result = uri.host || EMPTY; + if (result) { + if (uri.userInfo) result = uri.userInfo + AT + result; + if (!isNaN(uri.port)) result += ':' + uri.port; + result = SLASH2 + result; + } + return result; +} +function formatQuery(query) { + return query && (query.indexOf(QM) !== 0 ? QM : EMPTY) + query; +} +function formatFragment(fragment) { + return fragment && (fragment.indexOf(HASH) !== 0 ? HASH : EMPTY) + fragment; +} +function _getPathAndQuery(uri) { + var path = uri.path, + query = uri.query; + return EMPTY + (path || EMPTY) + (formatQuery(query) || EMPTY); +} +function uriToString(uri) { + var scheme = getScheme(uri.scheme), + authority = _getAuthority(uri), + pathAndQuery = _getPathAndQuery(uri), + fragment = formatFragment(uri.fragment); + var part1 = EMPTY + (scheme && scheme + ':' || EMPTY) + (authority || EMPTY); + var part2 = EMPTY + (pathAndQuery || EMPTY) + (fragment || EMPTY); + if (part1 && part2 && scheme && !authority) throw new ArgumentException_1.default('authority', "Cannot format schemed Uri with missing authority."); + if (part1 && pathAndQuery && pathAndQuery.indexOf(SLASH) !== 0) part2 = SLASH + part2; + return part1 + part2; +} +function _tryParse(url, out) { + if (!url) return new ArgumentException_1.default('url', 'Nothing to parse.'); + var i, + result = {}; + i = url.indexOf(HASH); + if (i != -1) { + result.fragment = url.substring(i + 1) || VOID0; + url = url.substring(0, i); + } + i = url.indexOf(QM); + if (i != -1) { + result.query = url.substring(i + 1) || VOID0; + url = url.substring(0, i); + } + i = url.indexOf(SLASH2); + if (i != -1) { + var scheme = Utility_1.trim(url.substring(0, i)), + c = /:$/; + if (!c.test(scheme)) return new ArgumentException_1.default('url', 'Scheme was improperly formatted'); + scheme = Utility_1.trim(scheme.replace(c, EMPTY)); + try { + result.scheme = getScheme(scheme) || VOID0; + } catch (ex) { + return ex; + } + url = url.substring(i + 2); + } + i = url.indexOf(SLASH); + if (i != -1) { + result.path = url.substring(i); + url = url.substring(0, i); + } + i = url.indexOf(AT); + if (i != -1) { + result.userInfo = url.substring(0, i) || VOID0; + url = url.substring(i + 1); + } + i = url.indexOf(':'); + if (i != -1) { + var port = parseInt(Utility_1.trim(url.substring(i + 1))); + if (isNaN(port)) return new ArgumentException_1.default('url', 'Port was invalid.'); + result.port = port; + url = url.substring(0, i); + } + url = Utility_1.trim(url); + if (url) result.host = url; + out(copyUri(result)); + return null; +} +//# sourceMappingURL=Uri.js.map diff --git a/dist/commonjs/System/Uri/Uri.js.map b/dist/commonjs/System/Uri/Uri.js.map new file mode 100644 index 00000000..df5d7128 --- /dev/null +++ b/dist/commonjs/System/Uri/Uri.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Uri/Uri.ts","System/Uri/Uri.js"],"names":[],"mappings":";;;;;AASA;;;;;;AAEA,IAAA,UAAA,QAAiB,UAAjB,CAAA;AACA,IAAY,cAAW,QAAM,oBAAN,CAAX;AACZ,IAAA,YAAA,QAAmB,iBAAnB,CAAA;AACA,IAAA,WAAA,QAAsB,eAAtB,CAAA;AAEA,IAAA,sBAAA,QAA8B,iCAA9B,CAAA;AACA,IAAA,gCAAA,QAAwC,2CAAxC,CAAA;AAEA,I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B,CAAjB,CAAN,CAFD;KADA;AAOA,QAAI,IAAI,OAAJ,CAAY,EAAZ,CAAJ,CA1DoD;AA2DpD,QAAG,KAAI,CAAC,CAAD,EACP;AACC,eAAO,QAAP,GAAkB,IAAI,SAAJ,CAAc,CAAd,EAAiB,CAAjB,KAAuB,KAAvB,CADnB;AAEC,cAAM,IAAI,SAAJ,CAAc,IAAI,CAAJ,CAApB,CAFD;KADA;AAOA,QAAI,IAAI,OAAJ,CAAY,GAAZ,CAAJ,CAlEoD;AAmEpD,QAAG,KAAI,CAAC,CAAD,EACP;AACC,YAAI,OAAO,SAAS,UAAA,IAAA,CAAK,IAAI,SAAJ,CAAc,IAAI,CAAJ,CAAnB,CAAT,CAAP,CADL;AAEC,YAAG,MAAM,IAAN,CAAH,EACC,OAAO,IAAI,oBAAA,OAAA,CAAkB,KAAtB,EAA6B,mBAA7B,CAAP,CADD;AAGA,eAAO,IAAP,GAAc,IAAd,CALD;AAMC,cAAM,IAAI,SAAJ,CAAc,CAAd,EAAiB,CAAjB,CAAN,CAND;KADA;AAUA,UAAM,UAAA,IAAA,CAAK,GAAL,CAAN,CA7EoD;AA8EpD,QAAG,GAAH,EACC,OAAO,IAAP,GAAc,GAAd,CADD;AAGA,QAAI,QAAQ,MAAR,CAAJ,EAjFoD;AAoFpD,WAAO,IAAP,CApFoD;CAArD","file":"System/Uri/Uri.js","sourcesContent":["/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier\r\n */\r\n\r\n///\r\n///\r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nimport Type from \"../Types\";\r\nimport * as QueryParams from \"../Uri/QueryParams\";\r\nimport {trim} from \"../Text/Utility\";\r\nimport UriScheme from \"../Uri/Scheme\";\r\nimport Exception from \"../Exception\";\r\nimport ArgumentException from \"../Exceptions/ArgumentException\";\r\nimport ArgumentOutOfRangeException from \"../Exceptions/ArgumentOutOfRangeException\";\r\n\r\nconst VOID0:any = void(0);\r\n\r\n/**\r\n * Provides an read-only model representation of a uniform resource identifier (URI) and easy access to the parts of the URI.\r\n *\r\n * The read-only model (frozen) is easier for debugging than exposing accessors for each property.\r\n * ICloneable<Uri> is not used to prevent unnecessary copying of values that won't change.\r\n */\r\nexport default class Uri implements IUri, IEquatable\r\n{\r\n\r\n\tscheme:SchemeValue;\r\n\tuserInfo:string;\r\n\thost:string;\r\n\tport:number;\r\n\tpath:string;\r\n\tquery:string;\r\n\tfragment:string;\r\n\r\n\tqueryParams:IMap;\r\n\r\n\t/**\r\n\t * @param scheme The user name, password, or other user-specific information associated with the specified URI.\r\n\t * @param userInfo The host component of this instance.\r\n\t * @param host The port number of this URI.\r\n\t * @param port The absolute path of the URI.\r\n\t * @param path The absolute path of the URI.\r\n\t * @param query Any query information included in the specified URI.\r\n\t * @param fragment The escaped URI fragment.\r\n\t */\r\n\tconstructor(\r\n\t\tscheme:UriScheme|SchemeValue,\r\n\t\tuserInfo:string,\r\n\t\thost:string,\r\n\t\tport:number,\r\n\t\tpath:string,\r\n\t\tquery?:QueryParamsConvertible,\r\n\t\tfragment?:string)\r\n\t{\r\n\t\tvar _ = this;\r\n\t\t_.scheme = getScheme(scheme) || null;\r\n\t\t_.userInfo = userInfo || null;\r\n\t\t_.host = host || null;\r\n\r\n\t\t_.port = getPort(port);\r\n\r\n\t\t_.authority = _.getAuthority() || null;\r\n\r\n\t\t_.path = path || null;\r\n\r\n\r\n\t\tif(!Type.isString(query))\r\n\t\t\tquery = QueryParams.encode([]>query);\r\n\r\n\t\t_.query = formatQuery(query) || null;\r\n\t\tObject.freeze(_.queryParams\r\n\t\t\t= _.query\r\n\t\t\t? QueryParams.parseToMap(_.query)\r\n\t\t\t: {});\r\n\r\n\t\t_.pathAndQuery = _.getPathAndQuery() || null;\r\n\r\n\t\t_.fragment = formatFragment(fragment) || null;\r\n\r\n\t\t// This should validate the uri...\r\n\t\t_.absoluteUri = _.getAbsoluteUri();\r\n\r\n\t\t_.baseUri = _.absoluteUri.replace(/[?#].*/, '');\r\n\r\n\t\t// Intended to be read-only. Call .toMap() to get a writable copy.\r\n\t\tObject.freeze(_);\r\n\t}\r\n\r\n\t/**\r\n\t * Compares the values of another IUri via toString comparison.\r\n\t * @param other\r\n\t * @returns {boolean}\r\n\t */\r\n\tequals(other:IUri):boolean\r\n\t{\r\n\t\treturn this===other || this.absoluteUri==Uri.toString(other);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Parses or clones values from existing Uri values.\r\n\t * @param uri\r\n\t * @param defaults\r\n\t * @returns {Uri}\r\n\t */\r\n\tstatic from(uri:string|IUri, defaults?:IUri):Uri\r\n\t{\r\n\t\tvar u = (!uri || Type.isString(uri))\r\n\t\t\t? Uri.parse(uri) : uri;\r\n\r\n\t\treturn new Uri(\r\n\t\t\tu.scheme || defaults && defaults.scheme,\r\n\t\t\tu.userInfo || defaults && defaults.userInfo,\r\n\t\t\tu.host || defaults && defaults.host,\r\n\t\t\tisNaN(u.port) ? defaults && defaults.port : u.port,\r\n\t\t\tu.path || defaults && defaults.path,\r\n\t\t\tu.query || defaults && defaults.query,\r\n\t\t\tu.fragment || defaults && defaults.fragment\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Parses a URL into it's components.\r\n\t * @param url The url to parse.\r\n\t * @param throwIfInvalid Defaults to true.\r\n\t * @returns {IUri} Returns a map of the values or *null* if invalid and *throwIfInvalid* is false.\r\n\t */\r\n\tstatic parse(url:string, throwIfInvalid:boolean = true):IUri\r\n\t{\r\n\t\tvar result:IUri = null;\r\n\t\tvar ex = tryParse(url, (out)=> {result = out;});\r\n\t\tif(throwIfInvalid && ex) throw ex;\r\n\t\treturn result;\r\n\t}\r\n\r\n\t/**\r\n\t * Parses a URL into it's components.\r\n\t * @param url The url to parse.\r\n\t * @param out A delegate to capture the value.\r\n\t * @returns {boolean} True if valid. False if invalid.\r\n\t */\r\n\tstatic tryParse(url:string, out:(result:IUri)=>void):boolean\r\n\t{\r\n\t\treturn !tryParse(url, out); // return type is Exception.\r\n\t}\r\n\r\n\tstatic copyOf(map:IUri):IUri\r\n\t{\r\n\t\treturn copyUri(map);\r\n\t}\r\n\r\n\tcopyTo(map:IUri):IUri\r\n\t{\r\n\t\treturn copyUri(this, map);\r\n\t}\r\n\r\n\tupdateQuery(query:QueryParamsConvertible):Uri\r\n\t{\r\n\t\tvar map = this.toMap();\r\n\t\tmap.query = query;\r\n\t\treturn Uri.from(map);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Is provided for sub classes to override this value.\r\n\t */\r\n\tprotected getAbsoluteUri():string\r\n\t{\r\n\t\treturn uriToString(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Is provided for sub classes to override this value.\r\n\t */\r\n\tprotected getAuthority():string\r\n\t{\r\n\t\treturn getAuthority(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Is provided for sub classes to override this value.\r\n\t */\r\n\tprotected getPathAndQuery():string\r\n\t{\r\n\t\treturn getPathAndQuery(this);\r\n\t}\r\n\r\n\t/**\r\n\t * The absolute URI.\r\n\t */\r\n\tabsoluteUri:string;\r\n\r\n\t/**\r\n\t * Gets the Domain Name System (DNS) host name or IP address and the port number for a server.\r\n\t */\r\n\tauthority:string;\r\n\r\n\t/**\r\n\t * Gets the path and Query properties separated by a question mark (?).\r\n\t */\r\n\tpathAndQuery:string;\r\n\r\n\t/**\r\n\t * Gets the full path without the query or fragment.\r\n\t */\r\n\tbaseUri:string;\r\n\r\n\t/**\r\n\t * The segments that represent a path.
\r\n\t * https://msdn.microsoft.com/en-us/library/system.uri.segments%28v=vs.110%29.aspx\r\n\t *\r\n\t *
Example:
\r\n\t * If the path value equals: ```/tree/node/index.html```
\r\n\t * The result will be: ```['/','tree/','node/','index.html']```\r\n\t * @returns {string[]}\r\n\t */\r\n\tget pathSegments():string[]\r\n\t{\r\n\t\treturn this.path.match(/^[/]|[^/]*[/]|[^/]+$/g);\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a writable copy.\r\n\t * @returns {IUri}\r\n\t */\r\n\ttoMap():IUri\r\n\t{\r\n\t\treturn this.copyTo({});\r\n\t}\r\n\r\n\t/**\r\n\t * @returns {string} The full absolute uri.\r\n\t */\r\n\ttoString():string\r\n\t{\r\n\t\treturn this.absoluteUri;\r\n\t}\r\n\r\n\t/**\r\n\t * Properly converts an existing URI to a string.\r\n\t * @param uri\r\n\t * @returns {string}\r\n\t */\r\n\tstatic toString(uri:IUri):string\r\n\t{\r\n\t\treturn uri instanceof Uri\r\n\t\t\t? (uri).absoluteUri\r\n\t\t\t: uriToString(uri);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the authority segment of an URI.\r\n\t * @param uri\r\n\t * @returns {string}\r\n\t */\r\n\tstatic getAuthority(uri:IUri):string\r\n\t{\r\n\t\treturn getAuthority(uri);\r\n\t}\r\n\r\n\r\n}\r\n\r\nexport enum Fields {\r\n\tscheme,\r\n\tuserInfo,\r\n\thost,\r\n\tport,\r\n\tpath,\r\n\tquery,\r\n\tfragment\r\n}\r\nObject.freeze(Fields);\r\n\r\nfunction copyUri(from:IUri, to?:IUri)\r\n{\r\n\tvar i = 0, field:string;\r\n\tif(!to) to = {};\r\n\twhile(field = Fields[i++])\r\n\t{\r\n\t\tvar value = (from)[field];\r\n\t\tif(value) (to)[field] = value;\r\n\t}\r\n\treturn to;\r\n}\r\n\r\nconst SLASH = '/', SLASH2 = '//', QM = '?', HASH = '#', EMPTY = '', AT = '@';\r\n\r\nfunction getScheme(scheme:UriScheme|string):SchemeValue\r\n{\r\n\tvar s:any = scheme;\r\n\tif(Type.isString(s))\r\n\t{\r\n\t\tif(!s) return VOID0;\r\n\r\n\t\ts = UriScheme[trim(s).toLowerCase().replace(/[^a-z0-9+.-]+$/g, EMPTY)];\r\n\r\n\t\tif(isNaN(s))\r\n\t\t\tthrow new ArgumentOutOfRangeException('scheme', scheme, 'Invalid scheme.');\r\n\t}\r\n\r\n\tif(Type.isNumber(s, false))\r\n\t{\r\n\t\ts = UriScheme[s];\r\n\t\tif(!s)\r\n\t\t\tthrow new ArgumentOutOfRangeException('scheme', scheme, 'Invalid scheme.');\r\n\r\n\t\treturn s;\r\n\t}\r\n\r\n\treturn VOID0;\r\n}\r\n\r\nfunction getPort(port:number|string):number\r\n{\r\n\tif(port===0) return port;\r\n\tif(!port) return null;\r\n\tvar p:number;\r\n\r\n\tif(Type.isNumber(port, true))\r\n\t{\r\n\t\tp = port;\r\n\t\tif(p>=0 && isFinite(p))\r\n\t\t\treturn p;\r\n\t}\r\n\telse if(Type.isString(port) && (p = parseInt(port)) && !isNaN(p))\r\n\t{\r\n\t\treturn getPort(p);\r\n\t}\r\n\r\n\tthrow new ArgumentException(\"port\", \"invalid value\");\r\n}\r\n\r\nfunction getAuthority(uri:IUri):string\r\n{\r\n\r\n\tif(!uri.host)\r\n\t{\r\n\t\tif(uri.userInfo)\r\n\t\t\tthrow new ArgumentException('host', 'Cannot include user info when there is no host.');\r\n\r\n\t\tif(Type.isNumber(uri.port, false))\r\n\t\t\tthrow new ArgumentException('host', 'Cannot include a port when there is no host.');\r\n\t}\r\n\r\n\t/*\r\n\t * [//[user:password@]host[:port]]\r\n\t */\r\n\r\n\tvar result = uri.host || EMPTY;\r\n\r\n\tif(result)\r\n\t{\r\n\t\tif(uri.userInfo) result = uri.userInfo + AT + result;\r\n\t\tif(!isNaN(uri.port)) result += ':' + uri.port;\r\n\t\tresult = SLASH2 + result;\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\nfunction formatQuery(query:string):string\r\n{\r\n\treturn query && ((query.indexOf(QM)!==0 ? QM : EMPTY) + query);\r\n}\r\n\r\nfunction formatFragment(fragment:string):string\r\n{\r\n\treturn fragment && ((fragment.indexOf(HASH)!==0 ? HASH : EMPTY) + fragment);\r\n}\r\n\r\nfunction getPathAndQuery(uri:IUri):string\r\n{\r\n\r\n\tvar path = uri.path,\r\n\t query = uri.query;\r\n\r\n\treturn EMPTY\r\n\t\t+ (path || EMPTY)\r\n\t\t+ (formatQuery(query) || EMPTY);\r\n\r\n}\r\n\r\nfunction uriToString(uri:IUri):string\r\n{\r\n\t// scheme:[//[user:password@]domain[:port]][/]path[?query][#fragment]\r\n\t// {scheme}{authority}{path}{query}{fragment}\r\n\r\n\tvar scheme = getScheme(uri.scheme),\r\n\t authority = getAuthority(uri),\r\n\t pathAndQuery = getPathAndQuery(uri),\r\n\t fragment = formatFragment(uri.fragment);\r\n\r\n\tvar part1 = EMPTY\r\n\t\t+ ((scheme && (scheme + ':')) || EMPTY)\r\n\t\t+ (authority || EMPTY);\r\n\r\n\tvar part2 = EMPTY\r\n\t\t+ (pathAndQuery || EMPTY)\r\n\t\t+ (fragment || EMPTY);\r\n\r\n\tif(part1 && part2 && scheme && !authority)\r\n\t\tthrow new ArgumentException('authority', \"Cannot format schemed Uri with missing authority.\");\r\n\r\n\tif(part1 && pathAndQuery && pathAndQuery.indexOf(SLASH)!==0)\r\n\t\tpart2 = SLASH + part2;\r\n\r\n\treturn part1 + part2;\r\n\r\n}\r\n\r\n\r\nfunction tryParse(url:string, out:(result:IUri)=>void):Exception\r\n{\r\n\tif(!url)\r\n\t\treturn new ArgumentException('url', 'Nothing to parse.');\r\n\r\n\r\n\t// Could use a regex here, but well follow some rules instead.\r\n\t// The intention is to 'gather' the pieces. This isn't validation (yet).\r\n\r\n\t// scheme:[//[user:password@]domain[:port]][/]path[?query][#fragment]\r\n\tvar i:number, result:IUri = {};\r\n\r\n\t// Anything after the first # is the fragment.\r\n\ti = url.indexOf(HASH);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tresult.fragment = url.substring(i + 1) || VOID0;\r\n\t\turl = url.substring(0, i);\r\n\t}\r\n\r\n\t// Anything after the first ? is the query.\r\n\ti = url.indexOf(QM);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tresult.query = url.substring(i + 1) || VOID0;\r\n\t\turl = url.substring(0, i);\r\n\t}\r\n\r\n\t// Guarantees a separation.\r\n\ti = url.indexOf(SLASH2);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tvar scheme = trim(url.substring(0, i)), c = /:$/;\r\n\t\tif(!c.test(scheme))\r\n\t\t\treturn new ArgumentException('url', 'Scheme was improperly formatted');\r\n\r\n\t\tscheme = trim(scheme.replace(c, EMPTY));\r\n\t\ttry\r\n\t\t{\r\n\t\t\tresult.scheme = getScheme(scheme) || VOID0;\r\n\t\t}\r\n\t\tcatch(ex)\r\n\t\t{\r\n\t\t\treturn ex;\r\n\t\t}\r\n\r\n\t\turl = url.substring(i + 2);\r\n\t}\r\n\r\n\t// Find any path information.\r\n\ti = url.indexOf(SLASH);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tresult.path = url.substring(i);\r\n\t\turl = url.substring(0, i);\r\n\t}\r\n\r\n\t// Separate user info.\r\n\ti = url.indexOf(AT);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tresult.userInfo = url.substring(0, i) || VOID0;\r\n\t\turl = url.substring(i + 1);\r\n\t}\r\n\r\n\t// Remaining is host and port.\r\n\ti = url.indexOf(':');\r\n\tif(i!= -1)\r\n\t{\r\n\t\tvar port = parseInt(trim(url.substring(i + 1)));\r\n\t\tif(isNaN(port))\r\n\t\t\treturn new ArgumentException('url', 'Port was invalid.');\r\n\r\n\t\tresult.port = port;\r\n\t\turl = url.substring(0, i);\r\n\t}\r\n\r\n\turl = trim(url);\r\n\tif(url)\r\n\t\tresult.host = url;\r\n\r\n\tout(copyUri(result));\r\n\r\n\t// null is good! (here)\r\n\treturn null;\r\n\r\n}\r\n","/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier\n */\n'use strict';\nconst Types_1 = require(\"../Types\");\nconst QueryParams = require(\"../Uri/QueryParams\");\nconst Utility_1 = require(\"../Text/Utility\");\nconst Scheme_1 = require(\"../Uri/Scheme\");\nconst ArgumentException_1 = require(\"../Exceptions/ArgumentException\");\nconst ArgumentOutOfRangeException_1 = require(\"../Exceptions/ArgumentOutOfRangeException\");\nconst VOID0 = void (0);\nclass Uri {\n constructor(scheme, userInfo, host, port, path, query, fragment) {\n var _ = this;\n _.scheme = getScheme(scheme) || null;\n _.userInfo = userInfo || null;\n _.host = host || null;\n _.port = getPort(port);\n _.authority = _.getAuthority() || null;\n _.path = path || null;\n if (!Types_1.default.isString(query))\n query = QueryParams.encode(query);\n _.query = formatQuery(query) || null;\n Object.freeze(_.queryParams\n = _.query\n ? QueryParams.parseToMap(_.query)\n : {});\n _.pathAndQuery = _.getPathAndQuery() || null;\n _.fragment = formatFragment(fragment) || null;\n _.absoluteUri = _.getAbsoluteUri();\n _.baseUri = _.absoluteUri.replace(/[?#].*/, '');\n Object.freeze(_);\n }\n equals(other) {\n return this === other || this.absoluteUri == Uri.toString(other);\n }\n static from(uri, defaults) {\n var u = (!uri || Types_1.default.isString(uri))\n ? Uri.parse(uri) : uri;\n return new Uri(u.scheme || defaults && defaults.scheme, u.userInfo || defaults && defaults.userInfo, u.host || defaults && defaults.host, isNaN(u.port) ? defaults && defaults.port : u.port, u.path || defaults && defaults.path, u.query || defaults && defaults.query, u.fragment || defaults && defaults.fragment);\n }\n static parse(url, throwIfInvalid = true) {\n var result = null;\n var ex = tryParse(url, (out) => { result = out; });\n if (throwIfInvalid && ex)\n throw ex;\n return result;\n }\n static tryParse(url, out) {\n return !tryParse(url, out);\n }\n static copyOf(map) {\n return copyUri(map);\n }\n copyTo(map) {\n return copyUri(this, map);\n }\n updateQuery(query) {\n var map = this.toMap();\n map.query = query;\n return Uri.from(map);\n }\n getAbsoluteUri() {\n return uriToString(this);\n }\n getAuthority() {\n return getAuthority(this);\n }\n getPathAndQuery() {\n return getPathAndQuery(this);\n }\n get pathSegments() {\n return this.path.match(/^[/]|[^/]*[/]|[^/]+$/g);\n }\n toMap() {\n return this.copyTo({});\n }\n toString() {\n return this.absoluteUri;\n }\n static toString(uri) {\n return uri instanceof Uri\n ? uri.absoluteUri\n : uriToString(uri);\n }\n static getAuthority(uri) {\n return getAuthority(uri);\n }\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Uri;\n(function (Fields) {\n Fields[Fields[\"scheme\"] = 0] = \"scheme\";\n Fields[Fields[\"userInfo\"] = 1] = \"userInfo\";\n Fields[Fields[\"host\"] = 2] = \"host\";\n Fields[Fields[\"port\"] = 3] = \"port\";\n Fields[Fields[\"path\"] = 4] = \"path\";\n Fields[Fields[\"query\"] = 5] = \"query\";\n Fields[Fields[\"fragment\"] = 6] = \"fragment\";\n})(exports.Fields || (exports.Fields = {}));\nvar Fields = exports.Fields;\nObject.freeze(Fields);\nfunction copyUri(from, to) {\n var i = 0, field;\n if (!to)\n to = {};\n while (field = Fields[i++]) {\n var value = from[field];\n if (value)\n to[field] = value;\n }\n return to;\n}\nconst SLASH = '/', SLASH2 = '//', QM = '?', HASH = '#', EMPTY = '', AT = '@';\nfunction getScheme(scheme) {\n var s = scheme;\n if (Types_1.default.isString(s)) {\n if (!s)\n return VOID0;\n s = Scheme_1.default[Utility_1.trim(s).toLowerCase().replace(/[^a-z0-9+.-]+$/g, EMPTY)];\n if (isNaN(s))\n throw new ArgumentOutOfRangeException_1.default('scheme', scheme, 'Invalid scheme.');\n }\n if (Types_1.default.isNumber(s, false)) {\n s = Scheme_1.default[s];\n if (!s)\n throw new ArgumentOutOfRangeException_1.default('scheme', scheme, 'Invalid scheme.');\n return s;\n }\n return VOID0;\n}\nfunction getPort(port) {\n if (port === 0)\n return port;\n if (!port)\n return null;\n var p;\n if (Types_1.default.isNumber(port, true)) {\n p = port;\n if (p >= 0 && isFinite(p))\n return p;\n }\n else if (Types_1.default.isString(port) && (p = parseInt(port)) && !isNaN(p)) {\n return getPort(p);\n }\n throw new ArgumentException_1.default(\"port\", \"invalid value\");\n}\nfunction getAuthority(uri) {\n if (!uri.host) {\n if (uri.userInfo)\n throw new ArgumentException_1.default('host', 'Cannot include user info when there is no host.');\n if (Types_1.default.isNumber(uri.port, false))\n throw new ArgumentException_1.default('host', 'Cannot include a port when there is no host.');\n }\n var result = uri.host || EMPTY;\n if (result) {\n if (uri.userInfo)\n result = uri.userInfo + AT + result;\n if (!isNaN(uri.port))\n result += ':' + uri.port;\n result = SLASH2 + result;\n }\n return result;\n}\nfunction formatQuery(query) {\n return query && ((query.indexOf(QM) !== 0 ? QM : EMPTY) + query);\n}\nfunction formatFragment(fragment) {\n return fragment && ((fragment.indexOf(HASH) !== 0 ? HASH : EMPTY) + fragment);\n}\nfunction getPathAndQuery(uri) {\n var path = uri.path, query = uri.query;\n return EMPTY\n + (path || EMPTY)\n + (formatQuery(query) || EMPTY);\n}\nfunction uriToString(uri) {\n var scheme = getScheme(uri.scheme), authority = getAuthority(uri), pathAndQuery = getPathAndQuery(uri), fragment = formatFragment(uri.fragment);\n var part1 = EMPTY\n + ((scheme && (scheme + ':')) || EMPTY)\n + (authority || EMPTY);\n var part2 = EMPTY\n + (pathAndQuery || EMPTY)\n + (fragment || EMPTY);\n if (part1 && part2 && scheme && !authority)\n throw new ArgumentException_1.default('authority', \"Cannot format schemed Uri with missing authority.\");\n if (part1 && pathAndQuery && pathAndQuery.indexOf(SLASH) !== 0)\n part2 = SLASH + part2;\n return part1 + part2;\n}\nfunction tryParse(url, out) {\n if (!url)\n return new ArgumentException_1.default('url', 'Nothing to parse.');\n var i, result = {};\n i = url.indexOf(HASH);\n if (i != -1) {\n result.fragment = url.substring(i + 1) || VOID0;\n url = url.substring(0, i);\n }\n i = url.indexOf(QM);\n if (i != -1) {\n result.query = url.substring(i + 1) || VOID0;\n url = url.substring(0, i);\n }\n i = url.indexOf(SLASH2);\n if (i != -1) {\n var scheme = Utility_1.trim(url.substring(0, i)), c = /:$/;\n if (!c.test(scheme))\n return new ArgumentException_1.default('url', 'Scheme was improperly formatted');\n scheme = Utility_1.trim(scheme.replace(c, EMPTY));\n try {\n result.scheme = getScheme(scheme) || VOID0;\n }\n catch (ex) {\n return ex;\n }\n url = url.substring(i + 2);\n }\n i = url.indexOf(SLASH);\n if (i != -1) {\n result.path = url.substring(i);\n url = url.substring(0, i);\n }\n i = url.indexOf(AT);\n if (i != -1) {\n result.userInfo = url.substring(0, i) || VOID0;\n url = url.substring(i + 1);\n }\n i = url.indexOf(':');\n if (i != -1) {\n var port = parseInt(Utility_1.trim(url.substring(i + 1)));\n if (isNaN(port))\n return new ArgumentException_1.default('url', 'Port was invalid.');\n result.port = port;\n url = url.substring(0, i);\n }\n url = Utility_1.trim(url);\n if (url)\n result.host = url;\n out(copyUri(result));\n return null;\n}\n"]} \ No newline at end of file diff --git a/dist/commonjs/System/Utility/applyMixins.d.ts b/dist/commonjs/System/Utility/applyMixins.d.ts new file mode 100644 index 00000000..89e245e2 --- /dev/null +++ b/dist/commonjs/System/Utility/applyMixins.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function applyMixins(derivedConstructor: any, baseConstructors: any[]): void; diff --git a/dist/commonjs/System/Utility/applyMixins.js b/dist/commonjs/System/Utility/applyMixins.js new file mode 100644 index 00000000..d8fc671c --- /dev/null +++ b/dist/commonjs/System/Utility/applyMixins.js @@ -0,0 +1,16 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +"use strict"; + +function applyMixins(derivedConstructor, baseConstructors) { + baseConstructors.forEach(function (bc) { + Object.getOwnPropertyNames(bc.prototype).forEach(function (name) { + derivedConstructor.prototype[name] = bc.prototype[name]; + }); + }); +} +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = applyMixins; +//# sourceMappingURL=applyMixins.js.map diff --git a/dist/commonjs/System/Utility/applyMixins.js.map b/dist/commonjs/System/Utility/applyMixins.js.map new file mode 100644 index 00000000..8cf5aa3e --- /dev/null +++ b/dist/commonjs/System/Utility/applyMixins.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Utility/applyMixins.js","System/Utility/applyMixins.ts"],"names":[],"mappings":";;;;AAIA;;ACCA,SAAA,WAAA,CAAoC,kBAApC,EAA4D,gBAA5D,EAAkF;AAEjF,qBACE,OADF,CACU,cAAE;AAEV,eAAO,mBAAP,CAA2B,GAAG,SAAH,CAA3B,CAAyC,OAAzC,CACE,gBAAI;AAEJ,+BAAmB,SAAnB,CAA6B,IAA7B,IAAqC,GAAG,SAAH,CAAa,IAAb,CAArC,CAFI;SAAJ,CADF,CAFU;KAAF,CADV,CAFiF;CAAlF;AAAA,OAAA,cAAA,CAAA,OAAA,EAAA,YAAA,EAAA,EAAA,OAAA,IAAA,EAAA;ADSA,QAAQ,OAAR,GAAkB,WAAlB","file":"System/Utility/applyMixins.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\n\"use strict\";\nfunction applyMixins(derivedConstructor, baseConstructors) {\n baseConstructors\n .forEach(bc => {\n Object.getOwnPropertyNames(bc.prototype).forEach(name => {\n derivedConstructor.prototype[name] = bc.prototype[name];\n });\n });\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = applyMixins;\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\nexport default function applyMixins(derivedConstructor:any, baseConstructors:any[]):void\r\n{\r\n\tbaseConstructors\r\n\t\t.forEach(bc =>\r\n\t\t{\r\n\t\t\tObject.getOwnPropertyNames(bc.prototype).forEach(\r\n\t\t\t\t\tname =>\r\n\t\t\t\t{\r\n\t\t\t\t\tderivedConstructor.prototype[name] = bc.prototype[name];\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t);\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/commonjs/System/Utility/clone.d.ts b/dist/commonjs/System/Utility/clone.d.ts new file mode 100644 index 00000000..3c3527fd --- /dev/null +++ b/dist/commonjs/System/Utility/clone.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function clone(source: any, depth?: number): any; diff --git a/dist/commonjs/System/Utility/clone.js b/dist/commonjs/System/Utility/clone.js new file mode 100644 index 00000000..e39a5933 --- /dev/null +++ b/dist/commonjs/System/Utility/clone.js @@ -0,0 +1,31 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +"use strict"; + +var Types_1 = require('../Types'); +function clone(source) { + var depth = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1]; + + if (depth < 0) return source; + if (!Types_1.default.isObject(source)) return source; + var result; + if (Array.isArray(source)) { + result = source.slice(); + if (depth > 0) { + for (var i = 0; i < result.length; i++) { + result[i] = clone(result[i], depth - 1); + } + } + } else { + result = {}; + if (depth > 0) for (var k in source) { + result[k] = clone(source[k], depth - 1); + } + } + return result; +} +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = clone; +//# sourceMappingURL=clone.js.map diff --git a/dist/commonjs/System/Utility/clone.js.map b/dist/commonjs/System/Utility/clone.js.map new file mode 100644 index 00000000..f022ef65 --- /dev/null +++ b/dist/commonjs/System/Utility/clone.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Utility/clone.js","System/Utility/clone.ts"],"names":[],"mappings":";;;;AAIA;;ACCA,IAAA,UAAA,QAAiB,UAAjB,CAAA;AAEA,SAAA,KAAA,CAA8B,MAA9B,EAA0D;QAAhB,8DAAe,iBAAC;;AAEzD,QAAG,QAAM,CAAN,EACF,OAAO,MAAP,CADD;AAIA,QAAG,CAAC,QAAA,OAAA,CAAK,QAAL,CAAc,MAAd,CAAD,EAAwB,OAAO,MAAP,CAA3B;AAEA,QAAI,MAAJ,CARyD;AASzD,QAAG,MAAM,OAAN,CAAc,MAAd,CAAH,EACA;AACC,iBAAe,OAAQ,KAAR,EAAf,CADD;AAEC,YAAG,QAAM,CAAN,EACH;AACC,iBAAI,IAAI,IAAI,CAAJ,EAAO,IAAE,OAAO,MAAP,EAAe,GAAhC,EACA;AACC,uBAAO,CAAP,IAAY,MAAM,OAAO,CAAP,CAAN,EAAiB,QAAQ,CAAR,CAA7B,CADD;aADA;SAFD;KAHD,MAYA;AACC,iBAAS,EAAT,CADD;AAEC,YAAG,QAAM,CAAN,EAAS,KAAI,IAAI,CAAJ,IAAS,MAAb,EACZ;AAEC,mBAAO,CAAP,IAAY,MAAM,OAAO,CAAP,CAAN,EAAiB,QAAQ,CAAR,CAA7B,CAFD;SADY;KAdb;AAqBA,WAAO,MAAP,CA9ByD;CAA1D;AAAA,OAAA,cAAA,CAAA,OAAA,EAAA,YAAA,EAAA,EAAA,OAAA,IAAA,EAAA;ADuBA,QAAQ,OAAR,GAAkB,KAAlB","file":"System/Utility/clone.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\n\"use strict\";\nconst Types_1 = require('../Types');\nfunction clone(source, depth = 0) {\n if (depth < 0)\n return source;\n if (!Types_1.default.isObject(source))\n return source;\n var result;\n if (Array.isArray(source)) {\n result = source.slice();\n if (depth > 0) {\n for (let i = 0; i < result.length; i++) {\n result[i] = clone(result[i], depth - 1);\n }\n }\n }\n else {\n result = {};\n if (depth > 0)\n for (let k in source) {\n result[k] = clone(source[k], depth - 1);\n }\n }\n return result;\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = clone;\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\nimport Type from '../Types';\r\n\r\nexport default function clone(source:any, depth:number = 0):any\r\n{\r\n\tif(depth<0)\r\n\t\treturn source;\r\n\r\n\t// return primitives as is.\r\n\tif(!Type.isObject(source)) return source;\r\n\r\n\tvar result:any;\r\n\tif(Array.isArray(source))\r\n\t{\r\n\t\tresult = (source).slice();\r\n\t\tif(depth>0)\r\n\t\t{\r\n\t\t\tfor(let i = 0; i0) for(let k in source)\r\n\t\t{\r\n\t\t\t//noinspection JSUnfilteredForInLoop\r\n\t\t\tresult[k] = clone(source[k], depth - 1);\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/commonjs/System/Utility/shallowCopy.d.ts b/dist/commonjs/System/Utility/shallowCopy.d.ts new file mode 100644 index 00000000..df935e23 --- /dev/null +++ b/dist/commonjs/System/Utility/shallowCopy.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function shallowCopy(source: any, target?: any): any; diff --git a/dist/commonjs/System/Validation/ValidationResult.d.ts b/dist/commonjs/System/Validation/ValidationResult.d.ts new file mode 100644 index 00000000..8fdffed8 --- /dev/null +++ b/dist/commonjs/System/Validation/ValidationResult.d.ts @@ -0,0 +1,15 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class ValidationResult implements IValidationResult, IEquatable { + isValid: boolean; + message: string; + data: any; + constructor(isValid?: boolean, message?: string, data?: any); + equals(other: IValidationResult): boolean; + static valid: IValidationResult; + static invalid(message: string, data?: any): IValidationResult; +} diff --git a/dist/commonjs/System/Validation/ValidationResult.js b/dist/commonjs/System/Validation/ValidationResult.js new file mode 100644 index 00000000..95f7d43a --- /dev/null +++ b/dist/commonjs/System/Validation/ValidationResult.js @@ -0,0 +1,52 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var valid = new ValidationResult(true); + +var ValidationResult = function () { + function ValidationResult() { + var isValid = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0]; + var message = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + var data = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; + + _classCallCheck(this, ValidationResult); + + this.isValid = isValid; + this.message = message; + this.data = data; + Object.freeze(this); + } + + _createClass(ValidationResult, [{ + key: "equals", + value: function equals(other) { + var _ = this; + return _.isValid === other.isValid && _.message == _.message && _.data == _.data; + } + }], [{ + key: "invalid", + value: function invalid(message) { + var data = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; + + return new ValidationResult(false, message, data); + } + }, { + key: "valid", + get: function get() { + return valid; + } + }]); + + return ValidationResult; +}(); + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = ValidationResult; +//# sourceMappingURL=ValidationResult.js.map diff --git a/dist/commonjs/System/Validation/ValidationResult.js.map b/dist/commonjs/System/Validation/ValidationResult.js.map new file mode 100644 index 00000000..730dc3a5 --- /dev/null +++ b/dist/commonjs/System/Validation/ValidationResult.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Validation/ValidationResult.ts","System/Validation/ValidationResult.js"],"names":[],"mappings":";;;;AAOA;;;;;;AAEA,IAAM,QAAQ,IAAI,gBAAJ,CAAqB,IAArB,CAAR;;IAKN;AAOC,aAPD,gBAOC,GAGuB;YAFf,gEAAkB,qBAEH;YADf,gEAAiB,oBACF;YAAf,6DAAW,oBAAI;;8BAVxB,kBAUwB;;AAFf,aAAA,OAAA,GAAA,OAAA,CAEe;AADf,aAAA,OAAA,GAAA,OAAA,CACe;AAAf,aAAA,IAAA,GAAA,IAAA,CAAe;AAItB,eAAO,MAAP,CAAc,IAAd,EAJsB;KAHvB;;iBAPD;;+BAoBQ,OAAuB;AAE7B,gBAAI,IAAI,IAAJ,CAFyB;AAG7B,mBAAO,EAAE,OAAF,KAAY,MAAM,OAAN,IACf,EAAE,OAAF,IAAW,EAAE,OAAF,IACX,EAAE,IAAF,IAAQ,EAAE,IAAF,CALiB;;;;gCAqB7B,SACe;gBAAf,6DAAW,oBAAI;;AAEf,mBAAO,IAAI,gBAAJ,CAAqB,KAArB,EAA4B,OAA5B,EAAqC,IAArC,CAAP,CAFe;;;;4BATA;AACf,mBAAO,KAAP,CADe;;;;WAjCjB;;;AAAA,OAAA,cAAA,CAAA,OAAA,EAAA,YAAA,EAAA,EAAA,OAAA,IAAA,EAAA;ACaA,QAAQ,OAAR,GAAkB,gBAAlB","file":"System/Validation/ValidationResult.js","sourcesContent":["/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n/// \r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nconst valid = new ValidationResult(true);\r\n\r\n/**\r\n * A class for generating responses to validation.\r\n */\r\nexport default\r\nclass ValidationResult\r\nimplements IValidationResult, IEquatable\r\n{\r\n\t/**\r\n\t * Allows for rare cases that ValidationResult.valid and ValidationResult.invalid() don't cover.\r\n\t */\r\n\tconstructor(\r\n\t\tpublic isValid:boolean = false,\r\n\t\tpublic message:string = null,\r\n\t\tpublic data:any = null)\r\n\t{\r\n\r\n\t\t// Readonly...\r\n\t\tObject.freeze(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Allows for comparing another IValidationResult to see if they are equal.\r\n\t */\r\n\tequals(other:IValidationResult):boolean\r\n\t{\r\n\t\tvar _ = this;\r\n\t\treturn _.isValid===other.isValid\r\n\t\t\t&& _.message==_.message\r\n\t\t\t&& _.data==_.data;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Represents a single/shared instance of a valid result.\r\n\t * Allows for returning this instance like you would return 'true'.\r\n\t */\r\n\tstatic get valid():IValidationResult {\r\n\t\treturn valid;\r\n\t}\r\n\r\n\t/**\r\n\t * Factory method for easily creating an invalid result.\r\n\t */\r\n\tstatic invalid(\r\n\t\tmessage:string,\r\n\t\tdata:any = null):IValidationResult\r\n\t{\r\n\t\treturn new ValidationResult(false, message, data);\r\n\t}\r\n}\r\n","/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\n'use strict';\nconst valid = new ValidationResult(true);\nclass ValidationResult {\n constructor(isValid = false, message = null, data = null) {\n this.isValid = isValid;\n this.message = message;\n this.data = data;\n Object.freeze(this);\n }\n equals(other) {\n var _ = this;\n return _.isValid === other.isValid\n && _.message == _.message\n && _.data == _.data;\n }\n static get valid() {\n return valid;\n }\n static invalid(message, data = null) {\n return new ValidationResult(false, message, data);\n }\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = ValidationResult;\n"]} \ No newline at end of file diff --git a/dist/commonjs/extends.d.ts b/dist/commonjs/extends.d.ts new file mode 100644 index 00000000..6a21de64 --- /dev/null +++ b/dist/commonjs/extends.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function (d: any, b: any): void; diff --git a/dist/es6/System/Time/ClockTime.d.ts b/dist/es6/System/Time/ClockTime.d.ts index 54d0ca97..0271ea4f 100644 --- a/dist/es6/System/Time/ClockTime.d.ts +++ b/dist/es6/System/Time/ClockTime.d.ts @@ -5,7 +5,7 @@ /// /// /// -/// +/// import TimeQuantity from './TimeQuantity'; export default class ClockTime extends TimeQuantity implements IClockTime { days: number; diff --git a/dist/es6/System/Time/DateTime.d.ts b/dist/es6/System/Time/DateTime.d.ts index 640b9da4..38b9773c 100644 --- a/dist/es6/System/Time/DateTime.d.ts +++ b/dist/es6/System/Time/DateTime.d.ts @@ -2,7 +2,7 @@ /// /// /// -/// +/// /*! * @author electricessence / https://github.com/electricessence/ * Based on .NET DateTime's interface. diff --git a/dist/es6/System/Time/TimeQuantity.d.ts b/dist/es6/System/Time/TimeQuantity.d.ts index d4b1fcd7..ab37de80 100644 --- a/dist/es6/System/Time/TimeQuantity.d.ts +++ b/dist/es6/System/Time/TimeQuantity.d.ts @@ -1,7 +1,7 @@ /// /// /// -/// +/// /*! * @author electricessence / https://github.com/electricessence/ * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md diff --git a/dist/es6/System/Time/TimeSpan.d.ts b/dist/es6/System/Time/TimeSpan.d.ts index fa593343..516b263d 100644 --- a/dist/es6/System/Time/TimeSpan.d.ts +++ b/dist/es6/System/Time/TimeSpan.d.ts @@ -1,7 +1,7 @@ /// /// /// -/// +/// /*! * @author electricessence / https://github.com/electricessence/ * Originally based upon .NET source but with many additions and improvements. diff --git a/dist/es6/System/Time/TimeStamp.d.ts b/dist/es6/System/Time/TimeStamp.d.ts index 8d6bedf8..9e485290 100644 --- a/dist/es6/System/Time/TimeStamp.d.ts +++ b/dist/es6/System/Time/TimeStamp.d.ts @@ -1,7 +1,7 @@ /// /// /// -/// +/// /*! * @author electricessence / https://github.com/electricessence/ * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md diff --git a/dist/es6/System/Time/TimeUnit.d.ts b/dist/es6/System/Time/TimeUnit.d.ts index 2ff5d9f8..f75065ef 100644 --- a/dist/es6/System/Time/TimeUnit.d.ts +++ b/dist/es6/System/Time/TimeUnit.d.ts @@ -1,5 +1,5 @@ /// -/// +/// /*! * @author electricessence / https://github.com/electricessence/ * Originally based upon .NET source but with many additions and improvements. diff --git a/dist/system/System.Linq/Linq.d.ts b/dist/system/System.Linq/Linq.d.ts new file mode 100644 index 00000000..fabea935 --- /dev/null +++ b/dist/system/System.Linq/Linq.d.ts @@ -0,0 +1,196 @@ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Original: http://linqjs.codeplex.com/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import Dictionary from "../System/Collections/Dictionaries/Dictionary"; +import DisposableBase from "../System/Disposable/DisposableBase"; +export declare const enum EnumerableAction { + Break = 0, + Return = 1, + Skip = 2, +} +export declare class InfiniteEnumerable extends DisposableBase implements IEnumerable { + protected _enumeratorFactory: () => IEnumerator; + constructor(_enumeratorFactory: () => IEnumerator, finalizer?: () => void); + protected _isEndless: boolean; + isEndless: boolean; + getEnumerator(): IEnumerator; + protected _onDispose(): void; + asEnumerable(): InfiniteEnumerable; + doAction(action: Action | Predicate | Selector | Selector, initializer?: () => void, isEndless?: boolean): InfiniteEnumerable; + force(): void; + skip(count: number): InfiniteEnumerable; + take(count: number): FiniteEnumerable; + elementAt(index: number): T; + elementAtOrDefault(index: number, defaultValue?: T): T; + first(): T; + firstOrDefault(defaultValue?: T): T; + single(): T; + singleOrDefault(defaultValue?: T): T; + any(): boolean; + isEmpty(): boolean; + traverseBreadthFirst(childrenSelector: (element: T) => IEnumerableOrArray): Enumerable; + traverseBreadthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray): Enumerable; + traverseBreadthFirst(childrenSelector: (element: T) => IEnumerableOrArray, resultSelector?: (element: T, nestLevel?: number) => TResult): Enumerable; + traverseBreadthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray, resultSelector?: (element: TNode, nestLevel?: number) => TResult): Enumerable; + traverseDepthFirst(childrenSelector: (element: T) => IEnumerableOrArray): Enumerable; + traverseDepthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray): Enumerable; + traverseDepthFirst(childrenSelector: (element: T) => IEnumerableOrArray, resultSelector?: (element: T, nestLevel?: number) => TResult): Enumerable; + traverseDepthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray, resultSelector?: (element: TNode, nestLevel?: number) => TResult): Enumerable; + flatten(): Enumerable; + pairwise(selector: (prev: T, current: T) => TSelect): Enumerable; + scan(func: (a: T, b: T) => T, seed?: T): Enumerable; + select(selector: Selector): InfiniteEnumerable; + protected _selectMany(collectionSelector: Selector>, resultSelector?: (collection: T, element: TElement) => TResult): Enumerable; + selectMany(collectionSelector: Selector>): InfiniteEnumerable; + selectMany(collectionSelector: Selector>, resultSelector: (collection: T, element: TElement) => TResult): InfiniteEnumerable; + protected _choose(selector: Selector): Enumerable; + choose(): InfiniteEnumerable; + choose(selector?: Selector): InfiniteEnumerable; + where(predicate: Predicate): InfiniteEnumerable; + ofType(type: { + new (...params: any[]): TType; + }): InfiniteEnumerable; + except(second: IEnumerableOrArray, compareSelector?: Selector): InfiniteEnumerable; + distinct(compareSelector?: (value: T) => T): InfiniteEnumerable; + distinctUntilChanged(compareSelector?: Selector): InfiniteEnumerable; + defaultIfEmpty(defaultValue?: T): Enumerable; + zip(second: IEnumerableOrArray, resultSelector: (first: T, second: TSecond, index?: number) => TResult): Enumerable; + zipMultiple(second: IArray>, resultSelector: (first: T, second: TSecond, index?: number) => TResult): Enumerable; + join(inner: IEnumerableOrArray, outerKeySelector: Selector, innerKeySelector: Selector, resultSelector: (outer: T, inner: TInner) => TResult, compareSelector?: Selector): Enumerable; + groupJoin(inner: IEnumerableOrArray, outerKeySelector: Selector, innerKeySelector: Selector, resultSelector: (outer: T, inner: TInner[]) => TResult, compareSelector?: Selector): Enumerable; + merge(enumerables: IArray>): InfiniteEnumerable; + concat(...enumerables: Array>): InfiniteEnumerable; + union(second: IEnumerableOrArray, compareSelector?: Selector): Enumerable; + insertAt(index: number, other: IEnumerableOrArray): Enumerable; + alternateMultiple(sequence: IEnumerableOrArray): Enumerable; + alternateSingle(value: T): Enumerable; + alternate(...sequence: T[]): Enumerable; + catchError(handler: (e: any) => void): InfiniteEnumerable; + finallyAction(action: () => void): InfiniteEnumerable; + buffer(size: number): InfiniteEnumerable; + share(): InfiniteEnumerable; +} +export declare class Enumerable extends InfiniteEnumerable { + constructor(enumeratorFactory: () => IEnumerator, finalizer?: () => void, isEndless?: boolean); + static from(source: IEnumerableOrArray): Enumerable; + static fromAny(source: IEnumerableOrArray): Enumerable; + static fromAny(source: any): Enumerable; + static fromOrEmpty(source: IEnumerableOrArray): Enumerable; + static toArray(source: IEnumerableOrArray): T[]; + static choice(values: IArray): InfiniteEnumerable; + static chooseFrom(...args: T[]): InfiniteEnumerable; + static cycle(values: IArray): InfiniteEnumerable; + static cycleThrough(...args: T[]): InfiniteEnumerable; + static empty(): FiniteEnumerable; + static repeat(element: T): InfiniteEnumerable; + static repeat(element: T, count: number): FiniteEnumerable; + static repeatWithFinalize(initializer: () => T, finalizer: (element: T) => void): InfiniteEnumerable; + static make(element: T): FiniteEnumerable; + static range(start: number, count: number, step?: number): FiniteEnumerable; + static rangeDown(start: number, count: number, step?: number): FiniteEnumerable; + static toInfinity(start?: number, step?: number): InfiniteEnumerable; + static toNegativeInfinity(start?: number, step?: number): InfiniteEnumerable; + static rangeTo(start: number, to: number, step?: number): FiniteEnumerable; + static matches(input: string, pattern: any, flags?: string): FiniteEnumerable; + static generate(factory: (index?: number) => T): InfiniteEnumerable; + static generate(factory: (index?: number) => T, count: number): FiniteEnumerable; + static unfold(seed: T, valueFactory: Selector, skipSeed?: Boolean): InfiniteEnumerable; + static forEach(enumerable: IEnumerableOrArray, action: (element: T, index?: number) => any): void; + static map(enumerable: IEnumerableOrArray, selector: Selector): TResult[]; + static max(values: FiniteEnumerable): number; + static min(values: FiniteEnumerable): number; + static weave(enumerables: IEnumerableOrArray>): Enumerable; + doAction(action: Action | Predicate | Selector | Selector, initializer?: () => void, isEndless?: boolean): Enumerable; + skip(count: number): Enumerable; + skipWhile(predicate: Predicate): Enumerable; + takeWhile(predicate: Predicate): Enumerable; + takeUntil(predicate: Predicate, includeUntilValue?: boolean): Enumerable; + forEach(action: Predicate | Action): void; + toArray(predicate?: Predicate): T[]; + copyTo(target: T[], index?: number): T[]; + toLookup(keySelector: Selector, elementSelector?: Selector, compareSelector?: Selector): ILookup; + toMap(keySelector: Selector, elementSelector: Selector): IMap; + toDictionary(keySelector: Selector, elementSelector: Selector, compareSelector?: Selector): Dictionary; + toJoinedString(separator?: string, selector?: Selector): string; + takeExceptLast(count?: number): Enumerable; + skipToLast(count: number): Enumerable; + where(predicate: Predicate): Enumerable; + select(selector: Selector): Enumerable; + selectMany(collectionSelector: Selector>): Enumerable; + selectMany(collectionSelector: Selector>, resultSelector: (collection: T, element: TElement) => TResult): Enumerable; + choose(): Enumerable; + choose(selector?: Selector): Enumerable; + reverse(): Enumerable; + shuffle(): Enumerable; + count(predicate?: Predicate): number; + all(predicate: Predicate): boolean; + every(predicate: Predicate): boolean; + any(predicate?: Predicate): boolean; + some(predicate: Predicate): boolean; + contains(value: T, compareSelector?: Selector): boolean; + indexOf(value: T, compareSelector?: Selector): number; + lastIndexOf(value: T, compareSelector?: Selector): number; + merge(enumerables: IArray>): Enumerable; + concat(...enumerables: Array>): Enumerable; + intersect(second: IEnumerableOrArray, compareSelector?: Selector): Enumerable; + sequenceEqual(second: IEnumerableOrArray, equalityComparer?: EqualityComparison): boolean; + ofType(type: { + new (...params: any[]): TType; + }): Enumerable; + except(second: IEnumerableOrArray, compareSelector?: Selector): Enumerable; + distinct(compareSelector?: (value: T) => T): Enumerable; + distinctUntilChanged(compareSelector?: Selector): Enumerable; + orderBy(keySelector?: Selector): IOrderedEnumerable; + orderUsing(comparison: Comparison): IOrderedEnumerable; + orderUsingReversed(comparison: Comparison): IOrderedEnumerable; + orderByDescending(keySelector?: Selector): IOrderedEnumerable; + buffer(size: number): Enumerable; + groupBy(keySelector: Selector): Enumerable>; + groupBy(keySelector: Selector, elementSelector?: Selector, compareSelector?: Selector): Enumerable>; + partitionBy(keySelector: Selector): Enumerable>; + partitionBy(keySelector: Selector, elementSelector: Selector, resultSelector?: (key: TKey, element: TElement[]) => IGrouping, compareSelector?: Selector): Enumerable>; + aggregate(func: (a: T, b: T) => T, seed?: T): T; + average(selector?: Selector): number; + max(): T; + min(): T; + maxBy(keySelector?: Selector): T; + minBy(keySelector?: Selector): T; + sum(selector?: Selector): number; + product(selector?: Selector): number; + quotient(selector?: Selector): number; + last(): T; + lastOrDefault(defaultValue?: T): T; + share(): Enumerable; + catchError(handler: (e: any) => void): Enumerable; + finallyAction(action: () => void): Enumerable; + memoize(): Enumerable; +} +export declare class FiniteEnumerable extends Enumerable { + constructor(enumeratorFactory: () => IEnumerator, finalizer?: () => void); +} +export interface IGrouping extends Enumerable { + key: TKey; +} +export interface ILookup extends IEnumerable> { + count: number; + get(key: TKey): TElement[]; + contains(key: TKey): boolean; +} +export interface IOrderedEnumerable extends FiniteEnumerable { + thenBy(keySelector: (value: T) => any): IOrderedEnumerable; + thenByDescending(keySelector: (value: T) => any): IOrderedEnumerable; + thenUsing(comparison: Comparison): IOrderedEnumerable; + thenUsingReversed(comparison: Comparison): IOrderedEnumerable; +} +export default Enumerable; diff --git a/dist/system/System/Char.d.ts b/dist/system/System/Char.d.ts new file mode 100644 index 00000000..fa6b5cef --- /dev/null +++ b/dist/system/System/Char.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * From Netjs mscorlib.ts + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function isWhiteSpace(ch: number): boolean; +export declare function isLetter(ch: number): boolean; +export declare function isLetterOrDigit(ch: number): boolean; +export declare function isDigit(ch: number): boolean; +export declare function isDigit(str: string, index: number): boolean; diff --git a/dist/system/System/Collections/Array/Compare.d.ts b/dist/system/System/Collections/Array/Compare.d.ts new file mode 100644 index 00000000..2ce82c2d --- /dev/null +++ b/dist/system/System/Collections/Array/Compare.d.ts @@ -0,0 +1,13 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function areAllEqual(arrays: any[][], strict?: boolean, equalityComparer?: EqualityComparison): boolean; +export declare function areEqual(a: IArray, b: IArray, strict?: boolean, equalityComparer?: EqualityComparison): boolean; +export declare function areEquivalent(a: IArray, b: IArray): boolean; +export declare function areEquivalent(a: IArray>, b: IArray>): boolean; +export declare function areEquivalent(a: IArray, b: IArray, comparer: Comparison): boolean; diff --git a/dist/system/System/Collections/Array/Compare.js b/dist/system/System/Collections/Array/Compare.js new file mode 100644 index 00000000..55f56770 --- /dev/null +++ b/dist/system/System/Collections/Array/Compare.js @@ -0,0 +1,88 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../../Compare", "../../Types"], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var Values, Types_1; + function validateSize(a, b) { + if (a && b && a === b || !a && !b) + return true; + if (!a || !b) + return false; + var len = a.length; + if (len !== b.length) + return false; + if (len === 0) + return true; + return len; + } + function areAllEqual(arrays, strict, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = Values.areEqual; } + if (!arrays) + throw new Error("ArgumentNullException: 'arrays' cannot be null."); + if (arrays.length < 2) + throw new Error("Cannot compare a set of arrays less than 2."); + var first = arrays[0]; + for (var i = 0, l = arrays.length; i < l; i++) { + if (!areEqual(first, arrays[i], strict, equalityComparer)) + return false; + } + return true; + } + exports_1("areAllEqual", areAllEqual); + function areEqual(a, b, strict, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = Values.areEqual; } + var len = validateSize(a, b); + if (Types_1.default.isBoolean(len)) + return len; + for (var i = 0; i < len; i++) { + if (!equalityComparer(a[i], b[i], strict)) + return false; + } + return true; + } + exports_1("areEqual", areEqual); + function sort(a, comparer) { + if (!a || a.length < 2) + return a; + var len = a.length, b; + if (len > 65536) + b = new Array(len); + else { + b = []; + b.length = len; + } + for (var i = 0; i < len; i++) + b[i] = a[i]; + b.sort(comparer); + return b; + } + function areEquivalent(a, b, comparer) { + if (comparer === void 0) { comparer = Values.compare; } + var len = validateSize(a, b); + if (Types_1.default.isBoolean(len)) + return len; + a = sort(a, comparer); + b = sort(b, comparer); + for (var i = 0; i < len; i++) { + if (comparer(a[i], b[i]) !== 0) + return false; + } + return true; + } + exports_1("areEquivalent", areEquivalent); + return { + setters:[ + function (Values_1) { + Values = Values_1; + }, + function (Types_1_1) { + Types_1 = Types_1_1; + }], + execute: function() { + } + } +}); +//# sourceMappingURL=Compare.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Array/Compare.js.map b/dist/system/System/Collections/Array/Compare.js.map new file mode 100644 index 00000000..c2dab257 --- /dev/null +++ b/dist/system/System/Collections/Array/Compare.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Compare.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Array/Compare.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;IAYH,sBAAsB,CAAa,EAAE,CAAa;QAGjD,EAAE,CAAA,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YAC9B,MAAM,CAAC,IAAI,CAAC;QAGb,EAAE,CAAA,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YACX,MAAM,CAAC,KAAK,CAAC;QAEd,IAAI,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC;QACnB,EAAE,CAAA,CAAC,GAAG,KAAG,CAAC,CAAC,MAAM,CAAC;YACjB,MAAM,CAAC,KAAK,CAAC;QAGd,EAAE,CAAA,CAAC,GAAG,KAAG,CAAC,CAAC;YACV,MAAM,CAAC,IAAI,CAAC;QAGb,MAAM,CAAC,GAAG,CAAC;IACZ,CAAC;IAED,qBACC,MAAc,E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,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAG,CAAC,CAAC;gBAC3B,MAAM,CAAC,KAAK,CAAC;QACf,CAAC;QAED,MAAM,CAAC,IAAI,CAAC;IAEb,CAAC;IApBD,yCAoBC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Collections/Array/Dispatch.d.ts b/dist/system/System/Collections/Array/Dispatch.d.ts new file mode 100644 index 00000000..d9d28acc --- /dev/null +++ b/dist/system/System/Collections/Array/Dispatch.d.ts @@ -0,0 +1,13 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export interface DispatchErrorHandler { + (ex?: any, i?: number): void; +} +export declare function unsafe(listeners: IArray<(payload: T) => any>, payload: T, trap?: boolean | DispatchErrorHandler): void; +export declare function mapped(listeners: IArray<(payload: T) => TResult>, payload: T, trap?: boolean | DispatchErrorHandler): TResult[]; +export declare function dispatch(listeners: IArray<(payload: T) => any>, payload: T, trap?: boolean | DispatchErrorHandler): void; +export default dispatch; diff --git a/dist/system/System/Collections/Array/Dispatch.js b/dist/system/System/Collections/Array/Dispatch.js new file mode 100644 index 00000000..7025ca8d --- /dev/null +++ b/dist/system/System/Collections/Array/Dispatch.js @@ -0,0 +1,71 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../../Types", "./Utility"], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var Types_1, Utility_1; + var VOID0; + function unsafe(listeners, payload, trap) { + if (listeners && listeners.length) { + for (var i = 0, len = listeners.length; i < len; i++) { + var fn = listeners[i]; + if (!fn) + continue; + try { + fn(payload); + } + catch (ex) { + if (!trap) + throw ex; + else if (Types_1.default.isFunction(trap)) + trap(ex, i); + } + } + } + } + exports_1("unsafe", unsafe); + function mapped(listeners, payload, trap) { + if (!listeners) + return null; + var result = Utility_1.copy(listeners); + if (listeners.length) { + for (var i = 0, len = result.length; i < len; i++) { + var fn = result[i]; + try { + result[i] = fn + ? fn(payload) + : VOID0; + } + catch (ex) { + result[i] = VOID0; + if (!trap) + throw ex; + else if (Types_1.default.isFunction(trap)) + trap(ex, i); + } + } + } + return result; + } + exports_1("mapped", mapped); + function dispatch(listeners, payload, trap) { + unsafe(Utility_1.copy(listeners), payload, trap); + } + exports_1("dispatch", dispatch); + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }, + function (Utility_1_1) { + Utility_1 = Utility_1_1; + }], + execute: function() { + VOID0 = void (0); + exports_1("default",dispatch); + } + } +}); +//# sourceMappingURL=Dispatch.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Array/Dispatch.js.map b/dist/system/System/Collections/Array/Dispatch.js.map new file mode 100644 index 00000000..a4828774 --- /dev/null +++ b/dist/system/System/Collections/Array/Dispatch.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Dispatch.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Array/Dispatch.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;QAOG,KAAK;IA4BX,gBACC,SAAkC,EAClC,OAAS,EAAE,IAAkC;QAE7C,EAAE,CAAA,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,CACjC,CAAC;YACA,GAAG,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAC,GAAG,EAAE,CAAC,EAAE,EACjD,CAAC;gBACA,IAAI,EAAE,GAAY,SAAS,CAAC,CAAC,CAAC,CAAC;gBAC/B,EAAE,CAAA,CAAC,CAAC,EAAE,CAAC;oBAAC,QAAQ,CAAC;gBACjB,IACA,CAAC;oBACA,EAAE,CAAC,OAAO,CAAC,CAAC;gBACb,CACA;gBAAA,KAAK,CAAA,CAAC,EAAE,CAAC,CACT,CAAC;oBACA,EAAE,CAAA,CAA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,CAAC,cAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;IALD,+BAKC,CAAA;;;;;;;;;;YA9GK,KAAK,GAAO,KAAI,CAAC,CAAC,CAAC,CAAC;YAgH1B,oBAAe,QAAQ,EAAC"} \ No newline at end of file diff --git a/dist/system/System/Collections/Array/Procedure.d.ts b/dist/system/System/Collections/Array/Procedure.d.ts new file mode 100644 index 00000000..227353e3 --- /dev/null +++ b/dist/system/System/Collections/Array/Procedure.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function sum(source: number[], ignoreNaN?: boolean): number; +export declare function average(source: number[], ignoreNaN?: boolean): number; +export declare function product(source: number[], ignoreNaN?: boolean): number; +export declare function quotient(source: number[], ignoreNaN?: boolean): number; +export declare function min(source: number[], ignoreNaN?: boolean): number; +export declare function max(source: number[], ignoreNaN?: boolean): number; diff --git a/dist/system/System/Collections/Array/Procedure.js b/dist/system/System/Collections/Array/Procedure.js new file mode 100644 index 00000000..eb2b73ed --- /dev/null +++ b/dist/system/System/Collections/Array/Procedure.js @@ -0,0 +1,157 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register([], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + function sum(source, ignoreNaN) { + if (ignoreNaN === void 0) { ignoreNaN = false; } + if (!source || !source.length) + return 0; + var result = 0; + if (ignoreNaN) + source.forEach(function (n) { + if (!isNaN(n)) + result += n; + }); + else + source.every(function (n) { + result += n; + return !isNaN(result); + }); + return result; + } + exports_1("sum", sum); + function average(source, ignoreNaN) { + if (ignoreNaN === void 0) { ignoreNaN = false; } + if (!source || !source.length) + return NaN; + var result = 0, count; + if (ignoreNaN) { + count = 0; + source.forEach(function (n) { + if (!isNaN(n)) { + result += n; + count++; + } + }); + } + else { + count = source.length; + source.every(function (n) { + result += n; + return !isNaN(result); + }); + } + return (!count || isNaN(result)) ? NaN : (result / count); + } + exports_1("average", average); + function product(source, ignoreNaN) { + if (ignoreNaN === void 0) { ignoreNaN = false; } + if (!source || !source.length) + return NaN; + var result = 1; + if (ignoreNaN) { + var found = false; + source.forEach(function (n) { + if (!isNaN(n)) { + result *= n; + if (!found) + found = true; + } + }); + if (!found) + result = NaN; + } + else { + source.every(function (n) { + if (isNaN(n)) { + result = NaN; + return false; + } + result *= n; + return true; + }); + } + return result; + } + exports_1("product", product); + function quotient(source, ignoreNaN) { + if (ignoreNaN === void 0) { ignoreNaN = false; } + if (!source || source.length < 2) + return NaN; + var result = source[0]; + var found = false; + source.every(function (n, i) { + if (i) { + if (n === 0) { + result = NaN; + return false; + } + if (isNaN(n)) { + if (!ignoreNaN) { + result = NaN; + return false; + } + } + else { + result /= n; + if (!found) + found = true; + } + } + return true; + }); + if (!found) + result = NaN; + return result; + } + exports_1("quotient", quotient); + function ifSet(source, start, ignoreNaN, predicate) { + if (!source || !source.length) + return NaN; + var result = start; + if (ignoreNaN) { + var found = false; + source.forEach(function (n) { + if (!isNaN(n)) { + if (predicate(n, result)) + result = n; + if (!found) + found = true; + } + }); + if (!found) + result = NaN; + } + else { + source.every(function (n) { + if (isNaN(n)) { + result = NaN; + return false; + } + if (predicate(n, result)) + result = n; + return true; + }); + } + return result; + } + function min(source, ignoreNaN) { + if (ignoreNaN === void 0) { ignoreNaN = false; } + return ifSet(source, +Infinity, ignoreNaN, function (n, result) { return n < result; }); + } + exports_1("min", min); + function max(source, ignoreNaN) { + if (ignoreNaN === void 0) { ignoreNaN = false; } + return ifSet(source, -Infinity, ignoreNaN, function (n, result) { return n > result; }); + } + exports_1("max", max); + return { + setters:[], + execute: function() { + } + } +}); +//# sourceMappingURL=Procedure.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Array/Procedure.js.map b/dist/system/System/Collections/Array/Procedure.js.map new file mode 100644 index 00000000..34c48cf2 --- /dev/null +++ b/dist/system/System/Collections/Array/Procedure.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Procedure.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Array/Procedure.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;IAGH,aAAoB,MAAe,EAAE,SAAyB;QAAzB,yBAAyB,GAAzB,iBAAyB;QAE7D,EAAE,CAAA,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;YAC5B,MAAM,CAAC,CAAC,CAAC;QAEV,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,EAAE,CAAA,CAAC,SAAS,CAAC;YACZ,MAAM,CAAC,OAAO,CAAC,UAAA,CAAC;gBAEf,EAAE,CAAA,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;oBAAC,MAAM,IAAI,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;QACJ,IAAI;YACH,MAAM,CAAC,KAAK,CAAC,UAAA,CAAC;gBAEb,MAAM,IAAI,CAAC,CAAC;gBACZ,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACvB,CAAC,CAAC,CAAC;QAEJ,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAnBD,qBAmBC,CAAA;IAED,iBAAwB,MAAe,EAAE,SAAyB;QAAzB,yBAAyB,GAAzB,iBAAyB;QAEjE,EAAE,CAAA,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;YAC5B,MAAM,CAAC,GAAG,CAAC;QAEZ,IAAI,MAAM,GAAG,CAAC,EAAE,KAAY,CAAC;QAC7B,EAAE,CAAA,CAAC,SAAS,CAAC,CACb,CAAC;YACA,KAAK,GAAG,CAAC,CAAC;YACV,MAAM,CAAC,OAAO,CAAC,UAAA,CAAC;gBAEf,EAAE,CAAA,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACb,CAAC;oBACA,MAAM,IAAI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EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAC,CAAC,EAAE,MAAM,IAAK,OAAA,CAAC,GAAC,MAAM,EAAR,CAAQ,CAAC,CAAC;IACrE,CAAC;IAHD,qBAGC,CAAA;IAED,aAAoB,MAAe,EAAE,SAAyB;QAAzB,yBAAyB,GAAzB,iBAAyB;QAE7D,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAC,CAAC,EAAE,MAAM,IAAK,OAAA,CAAC,GAAC,MAAM,EAAR,CAAQ,CAAC,CAAC;IACrE,CAAC;IAHD,qBAGC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Collections/Array/ReadOnlyArrayWrapper.d.ts b/dist/system/System/Collections/Array/ReadOnlyArrayWrapper.d.ts new file mode 100644 index 00000000..88e74cbc --- /dev/null +++ b/dist/system/System/Collections/Array/ReadOnlyArrayWrapper.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ReadOnlyCollectionBase from "../ReadOnlyCollectionBase"; +export default class ReadOnlyArrayWrapper extends ReadOnlyCollectionBase { + constructor(array: IArray); + getValueAt: (index: number) => T; +} diff --git a/dist/system/System/Collections/Array/ReadOnlyArrayWrapper.js b/dist/system/System/Collections/Array/ReadOnlyArrayWrapper.js new file mode 100644 index 00000000..028bca3f --- /dev/null +++ b/dist/system/System/Collections/Array/ReadOnlyArrayWrapper.js @@ -0,0 +1,44 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../../Exceptions/ArgumentNullException", "../Enumeration/Enumerator", "../ReadOnlyCollectionBase"], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ArgumentNullException_1, Enumerator_1, ReadOnlyCollectionBase_1; + var ReadOnlyArrayWrapper; + return { + setters:[ + function (ArgumentNullException_1_1) { + ArgumentNullException_1 = ArgumentNullException_1_1; + }, + function (Enumerator_1_1) { + Enumerator_1 = Enumerator_1_1; + }, + function (ReadOnlyCollectionBase_1_1) { + ReadOnlyCollectionBase_1 = ReadOnlyCollectionBase_1_1; + }], + execute: function() { + ReadOnlyArrayWrapper = (function (_super) { + __extends(ReadOnlyArrayWrapper, _super); + function ReadOnlyArrayWrapper(array) { + _super.call(this); + if (!array) + throw new ArgumentNullException_1.default('array'); + var _ = this; + _._getCount = function () { return array.length; }; + _.getEnumerator = function () { return Enumerator_1.from(array); }; + _.getValueAt = function (i) { return array[i]; }; + } + return ReadOnlyArrayWrapper; + }(ReadOnlyCollectionBase_1.default)); + exports_1("default", ReadOnlyArrayWrapper); + } + } +}); +//# sourceMappingURL=ReadOnlyArrayWrapper.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Array/ReadOnlyArrayWrapper.js.map b/dist/system/System/Collections/Array/ReadOnlyArrayWrapper.js.map new file mode 100644 index 00000000..aa512a09 --- /dev/null +++ b/dist/system/System/Collections/Array/ReadOnlyArrayWrapper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ReadOnlyArrayWrapper.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Array/ReadOnlyArrayWrapper.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;YAMH;gBAAqD,wCAAyB;gBAG7E,8BAAY,KAAe;oBAE1B,iBAAO,CAAC;oBACR,EAAE,CAAA,CAAC,CAAC,KAAK,CAAC;wBACT,MAAM,IAAI,+BAAqB,CAAC,OAAO,CAAC,CAAC;oBAE1C,IAAI,CAAC,GAAG,IAAI,CAAC;oBACb,CAAC,CAAC,SAAS,GAAG,cAAM,OAAA,KAAK,CAAC,MAAM,EAAZ,CAAY,CAAC;oBACjC,CAAC,CAAC,aAAa,GAAG,cAAM,OAAA,iBAAc,CAAC,KAAK,CAAC,EAArB,CAAqB,CAAC;oBAC9C,CAAC,CAAC,UAAU,GAAG,UAAA,CAAC,IAAI,OAAA,KAAK,CAAC,CAAC,CAAC,EAAR,CAAQ,CAAC;gBAC9B,CAAC;gBAGF,2BAAC;YAAD,CAAC,AAhBD,CAAqD,gCAAsB,GAgB1E;YAhBD,0CAgBC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Collections/Array/Sort.d.ts b/dist/system/System/Collections/Array/Sort.d.ts new file mode 100644 index 00000000..5524bcb8 --- /dev/null +++ b/dist/system/System/Collections/Array/Sort.d.ts @@ -0,0 +1,9 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function createComparer(selector: Selector, order?: Order | Order[], equivalentToNaN?: any): Comparison; +export { createComparer as default, createComparer as by }; diff --git a/dist/system/System/Collections/Array/Sort.js b/dist/system/System/Collections/Array/Sort.js new file mode 100644 index 00000000..2bceffd1 --- /dev/null +++ b/dist/system/System/Collections/Array/Sort.js @@ -0,0 +1,55 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(['../../Types', '../../Compare'], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var Types_1, Compare_1; + function ensureArray(value) { + return Array.isArray(value) + ? value + : [value]; + } + function createComparer(selector, order, equivalentToNaN) { + if (order === void 0) { order = 1; } + if (equivalentToNaN === void 0) { equivalentToNaN = NaN; } + var nanHasEquivalent = !Types_1.default.isTrueNaN(equivalentToNaN); + return function (a, b) { + var aValue = ensureArray(selector(a)); + var bValue = ensureArray(selector(b)); + var len = Math.min(aValue.length, bValue.length); + var oArray = Array.isArray(order) ? order : null; + for (var i = 0; i < len; i++) { + var vA = aValue[i], vB = bValue[i], o = oArray + ? (i < oArray.length ? oArray[i] : 1) + : order; + if (nanHasEquivalent) { + if (Types_1.default.isTrueNaN(vA)) + vA = equivalentToNaN; + if (Types_1.default.isTrueNaN(vB)) + vB = equivalentToNaN; + } + var r = Compare_1.compare(vA, vB); + if (r !== 0) + return o * r; + } + return 0; + }; + } + exports_1("createComparer", createComparer); + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }, + function (Compare_1_1) { + Compare_1 = Compare_1_1; + }], + execute: function() { + exports_1("default", createComparer); + exports_1("by", createComparer); + } + } +}); +//# sourceMappingURL=Sort.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Array/Sort.js.map b/dist/system/System/Collections/Array/Sort.js.map new file mode 100644 index 00000000..79d69b9d --- /dev/null +++ b/dist/system/System/Collections/Array/Sort.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Sort.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Array/Sort.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;IASH,qBAAwB,KAAW;QAElC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;cACnB,KAAK;cACV,CAAI,KAAK,CAAC,CAAC;IACf,CAAC;IAyBD,wBACC,QAA4C,EAC5C,KAAuC,EACvC,eAAyB;QADzB,qBAAuC,GAAvC,SAAuC;QACvC,+BAAyB,GAAzB,qBAAyB;QAEzB,IAAI,gBAAgB,GAAG,CAAC,eAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QAExD,MAAM,CAAC,UAAC,CAAmB,EAAE,CAAmB;YAG/C,IAAI,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACtC,IAAI,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACtC,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;YAEjD,IAAI,MAAM,GAAW,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC;YACzD,GAAG,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAC,GAAG,EAAE,CAAC,EAAE,EACzB,CAAC;gBACA,IAAI,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,EAC9B,CAAC,GAAI,MAAM;sBACR,CAAC,CAAC,GAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAe,CAAC;sBACxC,KAAK,CAAC;gBAEpB,EAAE,CAAA,CAAC,gBAAgB,CAAC,CACpB,CAAC;oBACA,EAAE,CAAA,CAAC,eAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;wBACrB,EAAE,GAAG,eAAe,CAAC;oBACtB,EAAE,CAAA,CAAC,eAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;wBACrB,EAAE,GAAG,eAAe,CAAC;gBAEvB,CAAC;gBAED,IAAI,CAAC,GAAG,iBAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;gBACxB,EAAE,CAAA,CAAC,CAAC,KAAG,CAAmB,CAAC;oBAC1B,MAAM,CAAC,CAAC,GAAC,CAAC,CAAC;YAEb,CAAC;YAED,MAAM,CAAC,CAAC,CAAC;QACV,CAAC,CAAC;IACH,CAAC;IAvCD,2CAuCC,CAAA;;;;;;;;;;YAGkB,oCAAO;YACP,+BAAE"} \ No newline at end of file diff --git a/dist/system/System/Collections/Array/Utility.d.ts b/dist/system/System/Collections/Array/Utility.d.ts new file mode 100644 index 00000000..2314ac04 --- /dev/null +++ b/dist/system/System/Collections/Array/Utility.d.ts @@ -0,0 +1,26 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function initialize(length: number): T[]; +export declare function copy(source: IArray, sourceIndex?: number, length?: number): T[]; +export declare function copyTo>(source: IArray, destination: TDestination, sourceIndex?: number, destinationIndex?: number, length?: number): TDestination; +export declare function indexOf(array: IArray, item: T, equalityComparer?: EqualityComparison): number; +export declare function contains(array: IArray, item: T, equalityComparer?: EqualityComparison): boolean; +export declare function replace(array: IArray, old: T, newValue: T, max?: number): number; +export declare function updateRange(array: IArray, value: T, start?: number, stop?: number): void; +export declare function clear(array: IArray, start?: number, stop?: number): void; +export declare function register(array: IArray, item: T, equalityComparer?: EqualityComparison): boolean; +export declare function findIndex(array: IArray, predicate: Predicate): number; +export declare function forEach(source: IArray, action: Predicate | Action): void; +export declare function applyTo(target: IArray, fn: (a: T) => T): void; +export declare function removeIndex(array: T[], index: number): boolean; +export declare function remove(array: T[], value: T, max?: number, equalityComparer?: EqualityComparison): number; +export declare function repeat(element: T, count: number): T[]; +export declare function range(first: number, count: number, step?: number): number[]; +export declare function rangeUntil(first: number, until: number, step?: number): number[]; +export declare function distinct(source: string[]): string[]; +export declare function distinct(source: number[]): number[]; +export declare function flatten(a: any[], recurseDepth?: number): any[]; diff --git a/dist/system/System/Collections/Array/Utility.js b/dist/system/System/Collections/Array/Utility.js new file mode 100644 index 00000000..5c70dac3 --- /dev/null +++ b/dist/system/System/Collections/Array/Utility.js @@ -0,0 +1,292 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../../Types", "../../Integer", "../../Compare", "../../Exceptions/ArgumentException", "../../Exceptions/ArgumentNullException", "../../Exceptions/ArgumentOutOfRangeException"], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var Types_1, Integer_1, Compare_1, ArgumentException_1, ArgumentNullException_1, ArgumentOutOfRangeException_1; + var CBN, CB0, CBL0, VFN; + function initialize(length) { + Integer_1.default.assert(length, 'length'); + var array; + if (length > 65536) + array = new Array(length); + else { + array = []; + array.length = length; + } + return array; + } + exports_1("initialize", initialize); + function copy(source, sourceIndex, length) { + if (sourceIndex === void 0) { sourceIndex = 0; } + if (length === void 0) { length = Infinity; } + if (!source) + return source; + return copyTo(source, initialize(Math.min(length, Math.max(source.length - sourceIndex, 0))), sourceIndex, 0, length); + } + exports_1("copy", copy); + function copyTo(source, destination, sourceIndex, destinationIndex, length) { + if (sourceIndex === void 0) { sourceIndex = 0; } + if (destinationIndex === void 0) { destinationIndex = 0; } + if (length === void 0) { length = Infinity; } + if (!source) + throw new ArgumentNullException_1.default('source', CBN); + if (!destination) + throw new ArgumentNullException_1.default('destination', CBN); + if (sourceIndex < 0) + throw new ArgumentOutOfRangeException_1.default('sourceIndex', sourceIndex, CBL0); + var sourceLength = source.length; + if (!sourceLength) + return destination; + if (sourceIndex >= sourceLength) + throw new ArgumentOutOfRangeException_1.default('sourceIndex', sourceIndex, 'Must be less than the length of the source array.'); + if (destination.length < 0) + throw new ArgumentOutOfRangeException_1.default('destinationIndex', destinationIndex, CBL0); + var maxLength = source.length - sourceIndex; + if (isFinite(length) && length > maxLength) + throw new ArgumentOutOfRangeException_1.default('sourceIndex', sourceIndex, 'Source index + length cannot exceed the length of the source array.'); + length = Math.min(length, maxLength); + var newLength = destinationIndex + length; + if (newLength > destination.length) + destination.length = newLength; + for (var i = 0; i < length; i++) { + destination[destinationIndex + i] = source[sourceIndex + i]; + } + return destination; + } + exports_1("copyTo", copyTo); + function indexOf(array, item, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = Compare_1.areEqual; } + var len = array && array.length; + if (len) { + if (Array.isArray(array) && !Types_1.default.isTrueNaN(item)) + return array.indexOf(item); + for (var i = 0; i < len; i++) { + if (equalityComparer(array[i], item)) + return i; + } + } + return -1; + } + exports_1("indexOf", indexOf); + function contains(array, item, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = Compare_1.areEqual; } + return indexOf(array, item, equalityComparer) != -1; + } + exports_1("contains", contains); + function replace(array, old, newValue, max) { + if (!array || !array.length || max === 0) + return 0; + if (max < 0) + throw new ArgumentOutOfRangeException_1.default('max', max, CBL0); + if (!max) + max = Infinity; + var count = 0; + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === old) { + array[i] = newValue; + ++count; + if (count == max) + break; + } + } + return count; + } + exports_1("replace", replace); + function updateRange(array, value, start, stop) { + if (start === void 0) { start = 0; } + if (!array) + return; + Integer_1.default.assertZeroOrGreater(start, 'start'); + if (!stop && stop !== 0) + stop = array.length; + Integer_1.default.assert(stop, 'stop'); + if (stop < start) + throw new ArgumentOutOfRangeException_1.default("stop", stop, "is less than start"); + for (var i = start; i < stop; i++) { + array[i] = value; + } + } + exports_1("updateRange", updateRange); + function clear(array, start, stop) { + if (start === void 0) { start = 0; } + updateRange(array, null, start, stop); + } + exports_1("clear", clear); + function register(array, item, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = Compare_1.areEqual; } + if (!array) + throw new ArgumentNullException_1.default('array', CBN); + var len = array.length; + var ok = !len || !contains(array, item, equalityComparer); + if (ok) + array[len] = item; + return ok; + } + exports_1("register", register); + function findIndex(array, predicate) { + if (!array) + throw new ArgumentNullException_1.default('array', CBN); + if (!Types_1.default.isFunction(predicate)) + throw new ArgumentException_1.default('predicate', 'Must be a function.'); + var len = array.length; + if (Array.isArray(array)) { + for (var i = 0; i < len; i++) { + if (predicate(array[i])) + return i; + } + } + else { + for (var i = 0; i < len; i++) { + if ((i) in (array) && predicate(array[i])) + return i; + } + } + return -1; + } + exports_1("findIndex", findIndex); + function forEach(source, action) { + if (source && action) { + for (var i = 0; i < source.length; i++) { + if (action(source[i], i) === false) + break; + } + } + } + exports_1("forEach", forEach); + function applyTo(target, fn) { + if (target && fn) { + for (var i = 0; i < target.length; i++) { + target[i] = fn(target[i]); + } + } + } + exports_1("applyTo", applyTo); + function removeIndex(array, index) { + if (!array) + throw new ArgumentNullException_1.default('array', CBN); + Integer_1.default.assert(index, 'index'); + if (index < 0) + throw new ArgumentOutOfRangeException_1.default('index', index, CBL0); + var exists = index < array.length; + if (exists) + array.splice(index, 1); + return exists; + } + exports_1("removeIndex", removeIndex); + function remove(array, value, max, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = Compare_1.areEqual; } + if (!array || !array.length || max === 0) + return 0; + if (max < 0) + throw new ArgumentOutOfRangeException_1.default('max', max, CBL0); + var count = 0; + if (!max || !isFinite(max)) { + for (var i = (array.length - 1); i >= 0; i--) { + if (equalityComparer(array[i], value)) { + array.splice(i, 1); + ++count; + } + } + } + else { + var found = []; + for (var i = 0, len = array.length; i < len; i++) { + if (equalityComparer(array[i], value)) { + found.push(i); + ++count; + if (count == max) + break; + } + } + for (var i = found.length - 1; i >= 0; i--) { + array.splice(found[i], 1); + } + } + return count; + } + exports_1("remove", remove); + function repeat(element, count) { + Integer_1.default.assert(count, 'count'); + if (count < 0) + throw new ArgumentOutOfRangeException_1.default('count', count, CBL0); + var result = initialize(count); + for (var i = 0; i < count; i++) { + result[i] = element; + } + return result; + } + exports_1("repeat", repeat); + function range(first, count, step) { + if (step === void 0) { step = 1; } + if (isNaN(first) || !isFinite(first)) + throw new ArgumentOutOfRangeException_1.default('first', first, VFN); + if (isNaN(count) || !isFinite(count)) + throw new ArgumentOutOfRangeException_1.default('count', count, VFN); + if (count < 0) + throw new ArgumentOutOfRangeException_1.default('count', count, CBL0); + var result = initialize(count); + for (var i = 0; i < count; i++) { + result[i] = first; + first += step; + } + return result; + } + exports_1("range", range); + function rangeUntil(first, until, step) { + if (step === void 0) { step = 1; } + if (step == 0) + throw new ArgumentOutOfRangeException_1.default('step', step, CB0); + return range(first, (until - first) / step, step); + } + exports_1("rangeUntil", rangeUntil); + function distinct(source) { + var seen = {}; + return source.filter(function (e) { return !(e in seen) && (seen[e] = true); }); + } + exports_1("distinct", distinct); + function flatten(a, recurseDepth) { + if (recurseDepth === void 0) { recurseDepth = 0; } + var result = []; + for (var i = 0; i < a.length; i++) { + var x = a[i]; + if (Array.isArray(x)) { + if (recurseDepth > 0) + x = flatten(x, recurseDepth - 1); + for (var n = 0; n < x.length; n++) + result.push(x[n]); + } + else + result.push(x); + } + return result; + } + exports_1("flatten", flatten); + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }, + function (Integer_1_1) { + Integer_1 = Integer_1_1; + }, + function (Compare_1_1) { + Compare_1 = Compare_1_1; + }, + function (ArgumentException_1_1) { + ArgumentException_1 = ArgumentException_1_1; + }, + function (ArgumentNullException_1_1) { + ArgumentNullException_1 = ArgumentNullException_1_1; + }, + function (ArgumentOutOfRangeException_1_1) { + ArgumentOutOfRangeException_1 = ArgumentOutOfRangeException_1_1; + }], + execute: function() { + CBN = 'Cannot be null.', CB0 = 'Cannot be zero.', CBL0 = 'Cannot be less than zero.', VFN = 'Must be a valid finite number'; + } + } +}); +//# sourceMappingURL=Utility.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Array/Utility.js.map b/dist/system/System/Collections/Array/Utility.js.map new file mode 100644 index 00000000..0c99b213 --- /dev/null +++ b/dist/system/System/Collections/Array/Utility.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Utility.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Array/Utility.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;QAoDF,GAAG,EACH,GAAG,EACH,IAAI,EACJ,GAAG;IAtCJ,oBAA8B,MAAa;QAE1C,iBAAO,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEjC,IAAI,KAAS,CAAC;QACd,EAAE,CAAA,CAAC,MAAM,GAAC,KAAK,CAAC;YACf,KAAK,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;QAC3B,IAAI,CACJ,CAAC;YACA,KAAK,GAAG,EAAE,CAAC;YACX,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QACvB,CAAC;QACD,MAAM,CAAC,KAAK,CAAC;IACd,CAAC;IAbD,mCAaC,CAAA;IASD,cACC,MAAgB,EAChB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C,CAAC,CAAC,CAAC,CAAC;YACb,EAAE,CAAA,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CACpB,CAAC;gBACA,EAAE,CAAA,CAAC,YAAY,GAAC,CAAC,CAAC;oBAAC,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,YAAY,GAAG,CAAC,CAAC,CAAC;gBACpD,GAAG,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE;oBAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACnD,CAAC;YACD,IAAI;gBAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;QACD,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAdD,6BAcC,CAAA;;;;;;;;;;;;;;;;;;;;;;YAhbA,GAAG,GAAI,iBAAiB,EACxB,GAAG,GAAI,iBAAiB,EACxB,IAAI,GAAG,2BAA2B,EAClC,GAAG,GAAI,+BAA+B,CAAC"} \ No newline at end of file diff --git a/dist/system/System/Collections/CollectionBase.d.ts b/dist/system/System/Collections/CollectionBase.d.ts new file mode 100644 index 00000000..d3ff773a --- /dev/null +++ b/dist/system/System/Collections/CollectionBase.d.ts @@ -0,0 +1,40 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +declare abstract class CollectionBase extends DisposableBase implements ICollection, IEnumerateEach { + protected _equalityComparer: EqualityComparison; + constructor(source?: IEnumerableOrArray, _equalityComparer?: EqualityComparison); + protected abstract getCount(): number; + count: number; + protected getIsReadOnly(): boolean; + isReadOnly: boolean; + protected assertModifiable(): void; + protected _version: number; + assertVersion(version: number): void; + private _modifiedCount; + private _updateRecursion; + protected _onModified(): void; + protected _signalModification(increment?: boolean): boolean; + protected _incrementModified(): void; + isUpdating: boolean; + handleUpdate(closure?: () => boolean): boolean; + protected abstract _addInternal(entry: T): boolean; + add(entry: T): void; + protected abstract _removeInternal(entry: T, max?: number): number; + remove(entry: T, max?: number): number; + protected abstract _clearInternal(): number; + clear(): number; + protected _onDispose(): void; + protected _importEntries(entries: IEnumerableOrArray): number; + importEntries(entries: IEnumerableOrArray): number; + abstract getEnumerator(): IEnumerator; + contains(entry: T): boolean; + forEach(action: Predicate | Action, useCopy?: boolean): void; + copyTo>(target: TTarget, index?: number): TTarget; + toArray(): T[]; +} +export default CollectionBase; diff --git a/dist/system/System/Collections/Dictionaries/Dictionary.d.ts b/dist/system/System/Collections/Dictionaries/Dictionary.d.ts new file mode 100644 index 00000000..8ce9d526 --- /dev/null +++ b/dist/system/System/Collections/Dictionaries/Dictionary.d.ts @@ -0,0 +1,26 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Original: http://linqjs.codeplex.com/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DictionaryBase from "./DictionaryBase"; +export interface IHashEntry extends ILinkedNode>, IKeyValuePair { +} +export default class Dictionary extends DictionaryBase { + private _keyComparer; + private _entries; + private _buckets; + constructor(_keyComparer?: Selector); + protected getCount(): number; + private _getBucket(hash, createIfMissing?); + private _getBucketEntry(key, hash?, bucket?); + protected _getEntry(key: TKey): IHashEntry; + getValue(key: TKey): TValue; + protected _setValueInternal(key: TKey, value: TValue): boolean; + protected _clearInternal(): number; + getEnumerator(): IEnumerator>; + protected getKeys(): TKey[]; + protected getValues(): TValue[]; +} diff --git a/dist/system/System/Collections/Dictionaries/Dictionary.js b/dist/system/System/Collections/Dictionaries/Dictionary.js new file mode 100644 index 00000000..9ce49502 --- /dev/null +++ b/dist/system/System/Collections/Dictionaries/Dictionary.js @@ -0,0 +1,196 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Original: http://linqjs.codeplex.com/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../../Compare", "../../Types", "../../Functions", "./DictionaryBase", "../Enumeration/EnumeratorBase", "../LinkedNodeList", "../../Disposable/ObjectPool"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Compare_1, Types_1, Functions_1, DictionaryBase_1, EnumeratorBase_1, LinkedNodeList_1, ObjectPool_1; + var VOID0, HashEntry, linkedListPool, NULL, GET_HASH_CODE, Dictionary; + function linkedNodeList(recycle) { + if (!linkedListPool) + linkedListPool + = new ObjectPool_1.default(20, function () { return new LinkedNodeList_1.default(); }); + if (!recycle) + return linkedListPool.take(); + recycle.clear(); + linkedListPool.add(recycle); + } + function callHasOwnProperty(target, key) { + return Object.prototype.hasOwnProperty.call(target, key); + } + function getHashString(obj) { + if (obj === null) + return NULL; + if (obj === VOID0) + return Types_1.default.UNDEFINED; + if (Types_1.default.hasMemberOfType(obj, GET_HASH_CODE, Types_1.default.FUNCTION)) { + return obj.getHashCode(); + } + return (typeof obj.toString == Types_1.default.FUNCTION) + ? obj.toString() + : Object.prototype.toString.call(obj); + } + return { + setters:[ + function (Compare_1_1) { + Compare_1 = Compare_1_1; + }, + function (Types_1_1) { + Types_1 = Types_1_1; + }, + function (Functions_1_1) { + Functions_1 = Functions_1_1; + }, + function (DictionaryBase_1_1) { + DictionaryBase_1 = DictionaryBase_1_1; + }, + function (EnumeratorBase_1_1) { + EnumeratorBase_1 = EnumeratorBase_1_1; + }, + function (LinkedNodeList_1_1) { + LinkedNodeList_1 = LinkedNodeList_1_1; + }, + function (ObjectPool_1_1) { + ObjectPool_1 = ObjectPool_1_1; + }], + execute: function() { + VOID0 = void 0; + HashEntry = (function () { + function HashEntry(key, value, previous, next) { + this.key = key; + this.value = value; + this.previous = previous; + this.next = next; + } + return HashEntry; + }()); + NULL = "null", GET_HASH_CODE = "getHashCode"; + Dictionary = (function (_super) { + __extends(Dictionary, _super); + function Dictionary(_keyComparer) { + if (_keyComparer === void 0) { _keyComparer = Functions_1.default.Identity; } + _super.call(this); + this._keyComparer = _keyComparer; + this._entries = linkedNodeList(); + this._buckets = {}; + } + Dictionary.prototype.getCount = function () { + return this._entries.unsafeCount; + }; + Dictionary.prototype._getBucket = function (hash, createIfMissing) { + if (hash === null || hash === VOID0 || !createIfMissing && !this.getCount()) + return null; + var buckets = this._buckets; + var bucket = callHasOwnProperty(buckets, hash) ? buckets[hash] : VOID0; + if (createIfMissing && !bucket) + buckets[hash] + = bucket + = linkedNodeList(); + return bucket; + }; + Dictionary.prototype._getBucketEntry = function (key, hash, bucket) { + if (key === null || key === VOID0 || !this.getCount()) + return null; + var _ = this, comparer = _._keyComparer, compareKey = comparer(key); + if (!bucket) + bucket = _._getBucket(hash || getHashString(compareKey)); + return bucket && bucket + .find(function (e) { return comparer(e.key) === compareKey; }); + }; + Dictionary.prototype._getEntry = function (key) { + var e = this._getBucketEntry(key); + return e && e.value; + }; + Dictionary.prototype.getValue = function (key) { + var e = this._getEntry(key); + return e ? e.value : VOID0; + }; + Dictionary.prototype._setValueInternal = function (key, value) { + var _ = this, buckets = _._buckets, entries = _._entries, comparer = _._keyComparer, compareKey = comparer(key), hash = getHashString(compareKey), bucket = _._getBucket(hash), bucketEntry = bucket && _._getBucketEntry(key, hash, bucket); + if (bucketEntry) { + if (value === VOID0) { + var x = bucket.removeNode(bucketEntry), y = entries.removeNode(bucketEntry.value); + if (x && !bucket.count) { + delete buckets[hash]; + linkedNodeList(bucket); + bucket = null; + } + if (x !== y) + throw "Entries and buckets are out of sync."; + if (x) + return true; + } + else { + var old = bucketEntry.value.value; + bucketEntry.value.value = value; + return !Compare_1.areEqual(value, old); + } + } + else if (value !== VOID0) { + if (!bucket) + bucket = _._getBucket(hash, true); + var entry = new HashEntry(key, value); + entries.addNode(entry); + bucket.addNode(new HashEntry(key, entry)); + return true; + } + return false; + }; + Dictionary.prototype._clearInternal = function () { + var _ = this, buckets = _._buckets; + for (var key in buckets) { + if (buckets.hasOwnProperty(key)) { + var bucket = buckets[key]; + delete buckets[key]; + linkedNodeList(bucket); + } + } + return _._entries.clear(); + }; + Dictionary.prototype.getEnumerator = function () { + var _ = this, ver, currentEntry; + return new EnumeratorBase_1.default(function () { + ver = _._version; + currentEntry = _._entries.first; + }, function (yielder) { + if (currentEntry != null) { + _.assertVersion(ver); + var result = { key: currentEntry.key, value: currentEntry.value }; + currentEntry = currentEntry.next; + return yielder.yieldReturn(result); + } + return yielder.yieldBreak(); + }); + }; + Dictionary.prototype.getKeys = function () { + var _ = this, result = []; + var e = _._entries.first; + while (e) { + result.push(e.key); + e = e.next; + } + return result; + }; + Dictionary.prototype.getValues = function () { + var _ = this, result = []; + var e = _._entries.first; + while (e) { + result.push(e.value); + e = e.next; + } + return result; + }; + return Dictionary; + }(DictionaryBase_1.default)); + exports_1("default", Dictionary); + } + } +}); +//# sourceMappingURL=Dictionary.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Dictionaries/Dictionary.js.map b/dist/system/System/Collections/Dictionaries/Dictionary.js.map new file mode 100644 index 00000000..3ae29ec9 --- /dev/null +++ b/dist/system/System/Collections/Dictionaries/Dictionary.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Dictionary.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Dictionaries/Dictionary.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;IAIH,YAAY,CAAC;;;;;;;;QAUP,KAAK,aAoBP,cAAc,EAkBZ,IAAI,EAAW,aAAa;IAflC,wBAAwB,OAA4B;QACnD,EAAE,CAAA,CAAC,CAAC,cAAc,CAAC;YAClB,cAAc;kBACX,IAAI,oBAAU,CAAsB,EAAE,EAAC,cAAI,OAAA,IAAI,wBAAc,EAAO,EAAzB,CAAyB,CAAC,CAAC;QAC1E,EAAE,CAAA,CAAC,CA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AAK,CAAC;oBACzB,OAAM,CAAC,EACP,CAAC;wBACA,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;wBACnB,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACZ,CAAC;oBACD,MAAM,CAAC,MAAM,CAAC;gBACf,CAAC;gBAES,8BAAS,GAAnB;oBAEC,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,GAAY,EAAE,CAAC;oBACnC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;oBACzB,OAAM,CAAC,EACP,CAAC;wBACA,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;wBACrB,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACZ,CAAC;oBACD,MAAM,CAAC,MAAM,CAAC;gBACf,CAAC;gBAEF,iBAAC;YAAD,CAAC,AA9LD,CACuC,wBAAc,GA6LpD;YA9LD,gCA8LC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Collections/Dictionaries/DictionaryBase.d.ts b/dist/system/System/Collections/Dictionaries/DictionaryBase.d.ts new file mode 100644 index 00000000..f931e1a7 --- /dev/null +++ b/dist/system/System/Collections/Dictionaries/DictionaryBase.d.ts @@ -0,0 +1,31 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "../CollectionBase"; +declare abstract class DictionaryBase extends CollectionBase> implements IDictionary { + constructor(source?: IEnumerableOrArray>); + protected _onValueModified(key: TKey, value: TValue, old: TValue): void; + protected _addInternal(item: KeyValuePair): boolean; + protected _clearInternal(): number; + contains(item: KeyValuePair): boolean; + protected _removeInternal(item: IKeyValuePair | [TKey, TValue]): number; + protected abstract getKeys(): TKey[]; + keys: TKey[]; + protected abstract getValues(): TValue[]; + values: TValue[]; + addByKeyValue(key: TKey, value: TValue): boolean; + protected abstract _getEntry(key: TKey): IKeyValuePair; + abstract getValue(key: TKey): TValue; + protected abstract _setValueInternal(key: TKey, value: TValue): boolean; + setValue(key: TKey, value: TValue): boolean; + containsKey(key: TKey): boolean; + containsValue(value: TValue): boolean; + removeByKey(key: TKey): boolean; + removeByValue(value: TValue): number; + importEntries(pairs: IEnumerableOrArray>): number; + protected _importEntries(pairs: IEnumerableOrArray>): number; + getEnumerator(): IEnumerator>; +} +export default DictionaryBase; diff --git a/dist/system/System/Collections/Dictionaries/DictionaryBase.js b/dist/system/System/Collections/Dictionaries/DictionaryBase.js new file mode 100644 index 00000000..c5decd80 --- /dev/null +++ b/dist/system/System/Collections/Dictionaries/DictionaryBase.js @@ -0,0 +1,178 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../../Compare", "../Enumeration/Enumerator", "../CollectionBase", "../Enumeration/EnumeratorBase", "../../Exceptions/ArgumentNullException", "../../Exceptions/InvalidOperationException", "../../KeyValueExtract"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Compare_1, Enumerator_1, CollectionBase_1, EnumeratorBase_1, ArgumentNullException_1, InvalidOperationException_1, KeyValueExtract_1; + var VOID0, DictionaryBase; + return { + setters:[ + function (Compare_1_1) { + Compare_1 = Compare_1_1; + }, + function (Enumerator_1_1) { + Enumerator_1 = Enumerator_1_1; + }, + function (CollectionBase_1_1) { + CollectionBase_1 = CollectionBase_1_1; + }, + function (EnumeratorBase_1_1) { + EnumeratorBase_1 = EnumeratorBase_1_1; + }, + function (ArgumentNullException_1_1) { + ArgumentNullException_1 = ArgumentNullException_1_1; + }, + function (InvalidOperationException_1_1) { + InvalidOperationException_1 = InvalidOperationException_1_1; + }, + function (KeyValueExtract_1_1) { + KeyValueExtract_1 = KeyValueExtract_1_1; + }], + execute: function() { + VOID0 = void (0); + DictionaryBase = (function (_super) { + __extends(DictionaryBase, _super); + function DictionaryBase(source) { + _super.call(this, source); + } + DictionaryBase.prototype._onValueModified = function (key, value, old) { + }; + DictionaryBase.prototype._addInternal = function (item) { + var _this = this; + if (!item) + throw new ArgumentNullException_1.default('item', 'Dictionaries must use a valid key/value pair. \'' + item + '\' is not allowed.'); + return KeyValueExtract_1.default(item, function (key, value) { return _this.addByKeyValue(key, value); }); + }; + DictionaryBase.prototype._clearInternal = function () { + var _ = this, count = 0; + for (var _i = 0, _a = _.keys; _i < _a.length; _i++) { + var key = _a[_i]; + if (_.removeByKey(key)) + count++; + } + return count; + }; + DictionaryBase.prototype.contains = function (item) { + var _this = this; + if (!item || !this.getCount()) + return false; + return KeyValueExtract_1.default(item, function (key, value) { + var v = _this.getValue(key); + return Compare_1.areEqual(value, v); + }); + }; + DictionaryBase.prototype._removeInternal = function (item) { + var _this = this; + if (!item) + return 0; + return KeyValueExtract_1.default(item, function (key, value) { + var v = _this.getValue(key); + return (Compare_1.areEqual(value, v) && _this.removeByKey(key)) + ? 1 : 0; + }); + }; + Object.defineProperty(DictionaryBase.prototype, "keys", { + get: function () { return this.getKeys(); }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DictionaryBase.prototype, "values", { + get: function () { return this.getValues(); }, + enumerable: true, + configurable: true + }); + DictionaryBase.prototype.addByKeyValue = function (key, value) { + if (value === VOID0) + throw new InvalidOperationException_1.default("Cannot add 'undefined' as a value."); + var _ = this; + if (_.containsKey(key)) { + var ex = new InvalidOperationException_1.default("Adding a key/value when the key already exists."); + ex.data['key'] = key; + ex.data['value'] = value; + throw ex; + } + return _.setValue(key, value); + }; + DictionaryBase.prototype.setValue = function (key, value) { + var _ = this; + _.assertModifiable(); + var changed = false, old = _.getValue(key); + if (!Compare_1.areEqual(value, old) && _._setValueInternal(key, value)) { + changed = true; + _._onValueModified(key, value, old); + } + _._signalModification(changed); + return changed; + }; + DictionaryBase.prototype.containsKey = function (key) { + return !!this._getEntry(key); + }; + DictionaryBase.prototype.containsValue = function (value) { + var e = this.getEnumerator(), equal = Compare_1.areEqual; + while (e.moveNext()) { + if (equal(e.current, value, true)) { + e.dispose(); + return true; + } + } + return false; + }; + DictionaryBase.prototype.removeByKey = function (key) { + return this.setValue(key, VOID0); + }; + DictionaryBase.prototype.removeByValue = function (value) { + var _ = this, count = 0, equal = Compare_1.areEqual; + for (var _i = 0, _a = _.getKeys(); _i < _a.length; _i++) { + var key = _a[_i]; + if (equal(_.getValue(key), value, true)) { + _.removeByKey(key); + count++; + } + } + return count; + }; + DictionaryBase.prototype.importEntries = function (pairs) { + return _super.prototype.importEntries.call(this, pairs); + }; + DictionaryBase.prototype._importEntries = function (pairs) { + var _ = this; + if (!pairs) + return 0; + var changed = 0; + Enumerator_1.forEach(pairs, function (pair) { return KeyValueExtract_1.default(pair, function (key, value) { + if (_._setValueInternal(key, value)) + changed++; + }); }); + return changed; + }; + DictionaryBase.prototype.getEnumerator = function () { + var _ = this; + var ver, keys, len, i = 0; + return new EnumeratorBase_1.default(function () { + ver = _._version; + keys = _.getKeys(); + len = keys.length; + }, function (yielder) { + _.assertVersion(ver); + while (i < len) { + var key = keys[i++], value = _.getValue(key); + if (value !== VOID0) + return yielder.yieldReturn({ key: key, value: value }); + } + return yielder.yieldBreak(); + }); + }; + return DictionaryBase; + }(CollectionBase_1.default)); + exports_1("default",DictionaryBase); + } + } +}); +//# sourceMappingURL=DictionaryBase.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Dictionaries/DictionaryBase.js.map b/dist/system/System/Collections/Dictionaries/DictionaryBase.js.map new file mode 100644 index 00000000..f847c368 --- /dev/null +++ b/dist/system/System/Collections/Dictionaries/DictionaryBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DictionaryBase.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Dictionaries/DictionaryBase.ts"],"names":[],"mappings":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AO,CAAC;gBAChB,CAAC;gBAED,sCAAa,GAAb;oBAEC,IAAI,CAAC,GAAG,IAAI,CAAC;oBACb,IAAI,GAAU,EAAE,IAAW,EAAE,GAAU,EAAE,CAAC,GAAG,CAAC,CAAC;oBAC/C,MAAM,CAAC,IAAI,wBAAc,CACxB;wBAEC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC;wBACjB,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;wBACnB,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;oBACnB,CAAC,EAED,UAAC,OAAO;wBAEP,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;wBAErB,OAAM,CAAC,GAAC,GAAG,EACX,CAAC;4BACA,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;4BAC7C,EAAE,CAAA,CAAC,KAAK,KAAG,KAAK,CAAC;gCAChB,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAC,CAAC,CAAC;wBACvD,CAAC;wBAED,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;oBAC7B,CAAC,CACD,CAAC;gBACH,CAAC;gBAGF,qBAAC;YAAD,CAAC,AA/MD,CACQ,wBAAc,GA8MrB;YAGD,oBAAe,cAAc,EAAC"} \ No newline at end of file diff --git a/dist/system/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts b/dist/system/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts new file mode 100644 index 00000000..159e833b --- /dev/null +++ b/dist/system/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts @@ -0,0 +1,17 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import StringKeyDictionary from "./StringKeyDictionary"; +export default class OrderedStringKeyDictionary extends StringKeyDictionary implements IOrderedDictionary { + private _order; + constructor(); + indexOfKey(key: string): number; + getValueByIndex(index: number): TValue; + setValue(key: string, value: TValue, keepIndex?: boolean): boolean; + setByIndex(index: number, value: TValue): boolean; + importValues(values: TValue[]): boolean; + setValues(...values: TValue[]): boolean; + removeByIndex(index: number): boolean; + protected getKeys(): string[]; +} diff --git a/dist/system/System/Collections/Dictionaries/OrderedStringKeyDictionary.js b/dist/system/System/Collections/Dictionaries/OrderedStringKeyDictionary.js new file mode 100644 index 00000000..aa23d99d --- /dev/null +++ b/dist/system/System/Collections/Dictionaries/OrderedStringKeyDictionary.js @@ -0,0 +1,89 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../Array/Utility", "./StringKeyDictionary", "../../Exceptions/ArgumentOutOfRangeException"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ArrayUtility, StringKeyDictionary_1, ArgumentOutOfRangeException_1; + var VOID0, OrderedStringKeyDictionary; + return { + setters:[ + function (ArrayUtility_1) { + ArrayUtility = ArrayUtility_1; + }, + function (StringKeyDictionary_1_1) { + StringKeyDictionary_1 = StringKeyDictionary_1_1; + }, + function (ArgumentOutOfRangeException_1_1) { + ArgumentOutOfRangeException_1 = ArgumentOutOfRangeException_1_1; + }], + execute: function() { + VOID0 = void 0; + OrderedStringKeyDictionary = (function (_super) { + __extends(OrderedStringKeyDictionary, _super); + function OrderedStringKeyDictionary() { + _super.call(this); + this._order = []; + } + OrderedStringKeyDictionary.prototype.indexOfKey = function (key) { + var o = this._order; + return o.length ? o.indexOf(key, 0) : -1; + }; + OrderedStringKeyDictionary.prototype.getValueByIndex = function (index) { + var o = this._order; + return index < o.length ? this.getValue(o[index]) : VOID0; + }; + OrderedStringKeyDictionary.prototype.setValue = function (key, value, keepIndex) { + var _ = this, exists = _.indexOfKey(key) != -1; + if (!exists && (value !== VOID0 || keepIndex)) + _._order.push(key); + else if (exists && value === VOID0 && !keepIndex) + ArrayUtility.remove(_._order, key); + return _super.prototype.setValue.call(this, key, value); + }; + OrderedStringKeyDictionary.prototype.setByIndex = function (index, value) { + var _ = this, order = _._order; + if (index < 0) + throw new ArgumentOutOfRangeException_1.default('index', index, 'Is less than zero.'); + if (index >= order.length) + throw new ArgumentOutOfRangeException_1.default('index', index, 'Is greater than the count.'); + return _.setValue(order[index], value); + }; + OrderedStringKeyDictionary.prototype.importValues = function (values) { + var _ = this; + return _.handleUpdate(function () { + var changed = false; + for (var i = 0; i < values.length; i++) { + if (_.setByIndex(i, values[i])) + changed = true; + } + return changed; + }); + }; + OrderedStringKeyDictionary.prototype.setValues = function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i - 0] = arguments[_i]; + } + return this.importValues(values); + }; + OrderedStringKeyDictionary.prototype.removeByIndex = function (index) { + return this.setByIndex(index, VOID0); + }; + OrderedStringKeyDictionary.prototype.getKeys = function () { + var _ = this, o = _._order; + return o.length && o.filter(function (key) { return _.containsKey(key); }) || []; + }; + return OrderedStringKeyDictionary; + }(StringKeyDictionary_1.default)); + exports_1("default", OrderedStringKeyDictionary); + } + } +}); +//# sourceMappingURL=OrderedStringKeyDictionary.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Dictionaries/OrderedStringKeyDictionary.js.map b/dist/system/System/Collections/Dictionaries/OrderedStringKeyDictionary.js.map new file mode 100644 index 00000000..7e1b1c97 --- /dev/null +++ b/dist/system/System/Collections/Dictionaries/OrderedStringKeyDictionary.js.map @@ -0,0 +1 @@ +{"version":3,"file":"OrderedStringKeyDictionary.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Dictionaries/OrderedStringKeyDictionary.ts"],"names":[],"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K,CAAC,CAAC;gBACtC,CAAC;gBAES,4CAAO,GAAjB;oBAEC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;oBAC3B,MAAM,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,UAAA,GAAG,IAAG,OAAA,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,EAAlB,CAAkB,CAAC,IAAI,EAAE,CAAC;gBAC7D,CAAC;gBAEF,iCAAC;YAAD,CAAC,AApFD,CAEQ,6BAAmB,GAkF1B;YApFD,gDAoFC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Collections/Dictionaries/StringKeyDictionary.d.ts b/dist/system/System/Collections/Dictionaries/StringKeyDictionary.d.ts new file mode 100644 index 00000000..15152615 --- /dev/null +++ b/dist/system/System/Collections/Dictionaries/StringKeyDictionary.d.ts @@ -0,0 +1,20 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DictionaryBase from "./DictionaryBase"; +export default class StringKeyDictionary extends DictionaryBase implements IStringKeyDictionary { + private _count; + private _map; + protected _getEntry(key: string): IKeyValuePair; + containsKey(key: string): boolean; + containsValue(value: TValue): boolean; + getValue(key: string): TValue; + protected _setValueInternal(key: string, value: TValue): boolean; + importMap(values: IMap): boolean; + toMap(selector?: (key: string, value: TValue) => TValue): IMap; + protected getKeys(): string[]; + protected getValues(): TValue[]; + protected getCount(): number; +} diff --git a/dist/system/System/Collections/Dictionaries/StringKeyDictionary.js b/dist/system/System/Collections/Dictionaries/StringKeyDictionary.js new file mode 100644 index 00000000..3cb51317 --- /dev/null +++ b/dist/system/System/Collections/Dictionaries/StringKeyDictionary.js @@ -0,0 +1,123 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../../Compare", "./DictionaryBase"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Compare_1, DictionaryBase_1; + var VOID0, StringKeyDictionary; + return { + setters:[ + function (Compare_1_1) { + Compare_1 = Compare_1_1; + }, + function (DictionaryBase_1_1) { + DictionaryBase_1 = DictionaryBase_1_1; + }], + execute: function() { + VOID0 = void 0; + StringKeyDictionary = (function (_super) { + __extends(StringKeyDictionary, _super); + function StringKeyDictionary() { + _super.apply(this, arguments); + this._count = 0; + this._map = {}; + } + StringKeyDictionary.prototype._getEntry = function (key) { + return !this.containsKey(key) + ? null : { + key: key, + value: this.getValue(key) + }; + }; + StringKeyDictionary.prototype.containsKey = function (key) { + if (key === null || key === VOID0 || !this._count) + return false; + return (key) in (this._map); + }; + StringKeyDictionary.prototype.containsValue = function (value) { + if (!this._count) + return false; + var map = this._map, equal = Compare_1.areEqual; + for (var key in map) { + if (map.hasOwnProperty(key) && equal(map[key], value)) + return true; + } + return false; + }; + StringKeyDictionary.prototype.getValue = function (key) { + if (key === null || key === VOID0 || !this._count) + return VOID0; + return this._map[key]; + }; + StringKeyDictionary.prototype._setValueInternal = function (key, value) { + var _ = this, map = _._map, old = map[key]; + if (old !== value) { + if (value === VOID0) { + if ((key) in (map)) { + delete map[key]; + _._count--; + } + } + else { + if (!map.hasOwnProperty(key)) + _._count++; + map[key] = value; + } + return true; + } + return false; + }; + StringKeyDictionary.prototype.importMap = function (values) { + var _ = this; + return _.handleUpdate(function () { + var changed = false; + for (var key in values) { + if (values.hasOwnProperty(key) && _.setValue(key, values[key])) + changed = true; + } + return changed; + }); + }; + StringKeyDictionary.prototype.toMap = function (selector) { + var _ = this, result = {}; + if (_._count) + for (var key in _._map) { + if (_._map.hasOwnProperty(key)) { + var value = _._map[key]; + if (selector) + value = selector(key, value); + if (value !== VOID0) + result[key] = value; + } + } + return result; + }; + StringKeyDictionary.prototype.getKeys = function () { + return Object.keys(this._map); + }; + StringKeyDictionary.prototype.getValues = function () { + if (!this._count) + return []; + var result = Object.keys(this._map); + for (var i = 0, len = result.length; i < len; i++) { + result[i] = this._map[result[i]]; + } + return result; + }; + StringKeyDictionary.prototype.getCount = function () { + return this._count; + }; + return StringKeyDictionary; + }(DictionaryBase_1.default)); + exports_1("default", StringKeyDictionary); + } + } +}); +//# sourceMappingURL=StringKeyDictionary.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Dictionaries/StringKeyDictionary.js.map b/dist/system/System/Collections/Dictionaries/StringKeyDictionary.js.map new file mode 100644 index 00000000..1cb85929 --- /dev/null +++ b/dist/system/System/Collections/Dictionaries/StringKeyDictionary.js.map @@ -0,0 +1 @@ +{"version":3,"file":"StringKeyDictionary.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Dictionaries/StringKeyDictionary.ts"],"names":[],"mappings":"AAAA;;;GAGG;;IAGH,YAAY,CAAC;;;;;;;;QAKP,KAAK;;;;;;;;;;YAAL,KAAK,GAAO,KAAK,CAAC,CAAC;YAEzB;gBAEQ,uCAA8B;gBAFtC;oBAEQ,8BAA8B;oBAG7B,WAAM,GAAU,CAAC,CAAC;oBAClB,SAAI,GAAgB,EAAE,CAAC;gBAwHhC,CAAC;gBAtHU,uCAAS,GAAnB,UAAoB,GAAU;oBAE7B,MAAM,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC;0BAC1B,IAAI,GAAG;wBACT,GAAG,EAAE,GAAG;wBACR,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;qBACzB,CAAA;gBACF,CAAC;gBAED,yCAAW,GAAX,UAAY,GAAU;oBAErB,EAAE,CAAA,CAAC,GAAG,KAAG,IAAI,IAAI,GAAG,KAAG,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;wBAAC,MAAM,CAAC,KAAK,C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CAAC;oCACX,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gCAC9B,EAAE,CAAA,CAAC,KAAK,KAAG,KAAK,CAAC;oCAChB,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;4BACtB,CAAC;wBACF,CAAC;oBACD,MAAM,CAAC,MAAM,CAAC;gBACf,CAAC;gBAES,qCAAO,GAAjB;oBAEC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC/B,CAAC;gBAES,uCAAS,GAAnB;oBAEC,EAAE,CAAA,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;wBAAC,MAAM,CAAC,EAAE,CAAC;oBAC3B,IAAI,MAAM,GAAS,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC1C,GAAG,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAC,GAAG,EAAE,CAAC,EAAE,EAC9C,CAAC;wBACA,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;oBAClC,CAAC;oBAED,MAAM,CAAC,MAAM,CAAC;gBACf,CAAC;gBAES,sCAAQ,GAAlB;oBAEC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;gBACpB,CAAC;gBAGF,0BAAC;YAAD,CAAC,AA9HD,CAEQ,wBAAc,GA4HrB;YA9HD,yCA8HC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Collections/Enumeration/ArrayEnumerator.d.ts b/dist/system/System/Collections/Enumeration/ArrayEnumerator.d.ts new file mode 100644 index 00000000..a54be9a0 --- /dev/null +++ b/dist/system/System/Collections/Enumeration/ArrayEnumerator.d.ts @@ -0,0 +1,10 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import IndexEnumerator from "./IndexEnumerator"; +export default class ArrayEnumerator extends IndexEnumerator { + constructor(arrayFactory: () => IArray, start?: number, step?: number); + constructor(array: IArray, start?: number, step?: number); +} diff --git a/dist/system/System/Collections/Enumeration/ArrayEnumerator.js b/dist/system/System/Collections/Enumeration/ArrayEnumerator.js new file mode 100644 index 00000000..abe01da3 --- /dev/null +++ b/dist/system/System/Collections/Enumeration/ArrayEnumerator.js @@ -0,0 +1,40 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["./IndexEnumerator", "../../Types"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var IndexEnumerator_1, Types_1; + var ArrayEnumerator; + return { + setters:[ + function (IndexEnumerator_1_1) { + IndexEnumerator_1 = IndexEnumerator_1_1; + }, + function (Types_1_1) { + Types_1 = Types_1_1; + }], + execute: function() { + ArrayEnumerator = (function (_super) { + __extends(ArrayEnumerator, _super); + function ArrayEnumerator(arrayOrFactory, start, step) { + if (start === void 0) { start = 0; } + if (step === void 0) { step = 1; } + _super.call(this, function () { + var array = Types_1.default.isFunction(arrayOrFactory) ? arrayOrFactory() : arrayOrFactory; + return { source: array, pointer: start, length: array ? array.length : 0, step: step }; + }); + } + return ArrayEnumerator; + }(IndexEnumerator_1.default)); + exports_1("default", ArrayEnumerator); + } + } +}); +//# sourceMappingURL=ArrayEnumerator.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Enumeration/ArrayEnumerator.js.map b/dist/system/System/Collections/Enumeration/ArrayEnumerator.js.map new file mode 100644 index 00000000..23835ba3 --- /dev/null +++ b/dist/system/System/Collections/Enumeration/ArrayEnumerator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ArrayEnumerator.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Enumeration/ArrayEnumerator.ts"],"names":[],"mappings":"AAAA;;;GAGG;;IAGH,YAAY,CAAC;;;;;;;;;;;;;;;;;;YAKb;gBACiC,mCAAkB;gBAIlD,yBAAY,cAAkB,EAAE,KAAgB,EAAE,IAAe;oBAAjC,qBAAgB,GAAhB,SAAgB;oBAAE,oBAAe,GAAf,QAAe;oBAEhE,kBACC;wBAEC,IAAI,KAAK,GAAG,eAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,cAAc,EAAE,GAAG,cAAc,CAAC;wBAChF,MAAM,CAAC,EAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;oBACtF,CAAC,CACD,CAAC;gBACH,CAAC;gBACF,sBAAC;YAAD,CAAC,AAfD,CACiC,yBAAe,GAc/C;YAfD,qCAeC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Collections/Enumeration/Enumerator.d.ts b/dist/system/System/Collections/Enumeration/Enumerator.d.ts new file mode 100644 index 00000000..4001711b --- /dev/null +++ b/dist/system/System/Collections/Enumeration/Enumerator.d.ts @@ -0,0 +1,19 @@ +/// +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function throwIfEndless(isEndless: boolean): void; +export declare const empty: IEnumerator; +export declare function from(source: IEnumerableOrArray): IEnumerator; +export declare function isEnumerable(instance: any): instance is IEnumerable; +export declare function isEnumerableOrArrayLike(instance: any): instance is IEnumerableOrArray; +export declare function isEnumerator(instance: any): instance is IEnumerator; +export declare function forEach(e: IEnumerableOrArray | IEnumerator, action: (element: T, index?: number) => any): boolean | void; +export declare function toArray(source: IEnumerableOrArray | IEnumerator): T[]; +export declare function map(source: IEnumerableOrArray | IEnumerator, selector: Selector): TResult[]; diff --git a/dist/system/System/Collections/Enumeration/Enumerator.js b/dist/system/System/Collections/Enumeration/Enumerator.js new file mode 100644 index 00000000..ec150bc1 --- /dev/null +++ b/dist/system/System/Collections/Enumeration/Enumerator.js @@ -0,0 +1,167 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../../Disposable/dispose", "../../Types", "./ArrayEnumerator", "./IndexEnumerator", "./UnsupportedEnumerableException"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var dispose_1, Types_1, ArrayEnumerator_1, IndexEnumerator_1, UnsupportedEnumerableException_1; + var VOID0, STRING_EMPTY, ENDLESS_EXCEPTION_MESSAGE, EmptyEnumerator, Empty, empty; + function throwIfEndless(isEndless) { + if (isEndless) + throw new UnsupportedEnumerableException_1.default(ENDLESS_EXCEPTION_MESSAGE); + } + exports_1("throwIfEndless", throwIfEndless); + function initArrayFrom(source) { + if (Array.isArray(source) || Types_1.default.isString(source)) { + var len = source.length; + if (isFinite(len)) { + if (len > 65535) + return new Array(len); + var result = []; + result.length = len; + return result; + } + } + return []; + } + function from(source) { + if (!source) + return Empty; + if (Array.isArray(source)) + return new ArrayEnumerator_1.default(source); + if (Types_1.default.isArrayLike(source)) { + return new IndexEnumerator_1.default(function () { + return { + source: source, + length: source.length, + pointer: 0, + step: 1 + }; + }); + } + if (!Types_1.default.isPrimitive(source)) { + if (isEnumerable(source)) + return source.getEnumerator(); + } + throw new Error("Unknown enumerable."); + } + exports_1("from", from); + function isEnumerable(instance) { + return Types_1.default.hasMemberOfType(instance, "getEnumerator", Types_1.default.FUNCTION); + } + exports_1("isEnumerable", isEnumerable); + function isEnumerableOrArrayLike(instance) { + return Types_1.default.isArrayLike(instance) || isEnumerable(instance); + } + exports_1("isEnumerableOrArrayLike", isEnumerableOrArrayLike); + function isEnumerator(instance) { + return Types_1.default.hasMemberOfType(instance, "moveNext", Types_1.default.FUNCTION); + } + exports_1("isEnumerator", isEnumerator); + function forEach(e, action) { + if (e !== VOID0 && e !== null) { + if (Types_1.default.isArrayLike(e)) { + throwIfEndless(!isFinite(e.length)); + for (var i = 0; i < e.length; i++) { + if (action(e[i], i) === false) + break; + } + return true; + } + if (isEnumerator(e)) { + throwIfEndless(e.isEndless); + var index = 0; + while (e.moveNext()) { + if (action(e.current, index++) === false) + break; + } + return true; + } + if (isEnumerable(e)) { + throwIfEndless(e.isEndless); + dispose_1.using(e.getEnumerator(), function (f) { return forEach(f, action); }); + return true; + } + return false; + } + } + exports_1("forEach", forEach); + function toArray(source) { + if (source === STRING_EMPTY) + return []; + if (Array.isArray(source)) + return source.slice(); + var result = initArrayFrom(source); + if (!forEach(source, function (e, i) { result[i] = e; })) + throw new UnsupportedEnumerableException_1.default(); + return result; + } + exports_1("toArray", toArray); + function map(source, selector) { + var result = initArrayFrom(source); + if (!forEach(source, function (e, i) { result[i] = selector(e); })) + throw new UnsupportedEnumerableException_1.default(); + return result; + } + exports_1("map", map); + return { + setters:[ + function (dispose_1_1) { + dispose_1 = dispose_1_1; + }, + function (Types_1_1) { + Types_1 = Types_1_1; + }, + function (ArrayEnumerator_1_1) { + ArrayEnumerator_1 = ArrayEnumerator_1_1; + }, + function (IndexEnumerator_1_1) { + IndexEnumerator_1 = IndexEnumerator_1_1; + }, + function (UnsupportedEnumerableException_1_1) { + UnsupportedEnumerableException_1 = UnsupportedEnumerableException_1_1; + }], + execute: function() { + VOID0 = void (0), STRING_EMPTY = "", ENDLESS_EXCEPTION_MESSAGE = 'Cannot call forEach on an endless enumerable. ' + + 'Would result in an infinite loop that could hang the current process.'; + EmptyEnumerator = (function () { + function EmptyEnumerator() { + } + Object.defineProperty(EmptyEnumerator.prototype, "current", { + get: function () { + return VOID0; + }, + enumerable: true, + configurable: true + }); + EmptyEnumerator.prototype.moveNext = function () { + return false; + }; + EmptyEnumerator.prototype.nextValue = function () { + return VOID0; + }; + EmptyEnumerator.prototype.next = function () { + return { + value: VOID0, + done: true + }; + }; + EmptyEnumerator.prototype.reset = function () { }; + EmptyEnumerator.prototype.dispose = function () { }; + Object.defineProperty(EmptyEnumerator.prototype, "isEndless", { + get: function () { + return false; + }, + enumerable: true, + configurable: true + }); + return EmptyEnumerator; + }()); + Empty = new EmptyEnumerator(); + Object.freeze(Empty); + exports_1("empty", empty = Empty); + } + } +}); +//# sourceMappingURL=Enumerator.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Enumeration/Enumerator.js.map b/dist/system/System/Collections/Enumeration/Enumerator.js.map new file mode 100644 index 00000000..904186cb --- /dev/null +++ b/dist/system/System/Collections/Enumeration/Enumerator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Enumerator.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Enumeration/Enumerator.ts"],"names":[],"mappings":"AAAA;;;GAGG;;IAQH,YAAY,CAAC;;;QASZ,KAAK,EACL,YAAY,EACZ,yBAAyB,mBAwDpB,KAAK,EAGE,KAAK;IAvDlB,wBAA+B,SAAiB;QAC/C,EAAE,CAAA,CAAC,SAAS,CAAC;YAAC,MAAM,IAAI,wCAA8B,CAAC,yBAAyB,CAAC,CAAC;IACnF,CAAC;IAFD,2CAEC,CAAA;IAED,uBAAuB,MAA+C;QACrE,EAAE,CAAA,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,eAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACnD,IAAI,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;YACxB,EAAE,CAAA,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CACjB,CAAC;gBACA,EAAE,CAAA,CAAC,GAAG,GAAC,KAAK,CAAC;oBAAC,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;gBACpC,IAAI,MAAM,GAAS,EAAE,CAAC;gBACtB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CA,CAAC;gBA9BA,sBAAI,oCAAO;yBAAX;wBAEC,MAAM,CAAC,KAAK,CAAC;oBACd,CAAC;;;mBAAA;gBAED,kCAAQ,GAAR;oBAEC,MAAM,CAAC,KAAK,CAAC;gBACd,CAAC;gBAED,mCAAS,GAAT;oBAEC,MAAM,CAAC,KAAK,CAAC;gBACd,CAAC;gBAED,8BAAI,GAAJ;oBAEC,MAAM,CAAC;wBACN,KAAK,EAAE,KAAK;wBACZ,IAAI,EAAE,IAAI;qBACV,CAAA;gBACF,CAAC;gBAED,+BAAK,GAAL,cAAe,CAAC;gBAEhB,iCAAO,GAAP,cAAiB,CAAC;gBAElB,sBAAI,sCAAS;yBAAb;wBACC,MAAM,CAAC,KAAK,CAAC;oBACd,CAAC;;;mBAAA;gBACF,sBAAC;YAAD,CAAC,AAhCD,IAgCC;YAEK,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;YACpC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAER,mBAAA,KAAK,GAAoB,KAAK,CAAA,CAAC"} \ No newline at end of file diff --git a/dist/system/System/Collections/Enumeration/EnumeratorBase.d.ts b/dist/system/System/Collections/Enumeration/EnumeratorBase.d.ts new file mode 100644 index 00000000..8ed548b8 --- /dev/null +++ b/dist/system/System/Collections/Enumeration/EnumeratorBase.d.ts @@ -0,0 +1,26 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../../Disposable/DisposableBase"; +export default class EnumeratorBase extends DisposableBase implements IEnumerator { + private _initializer; + private _tryGetNext; + private _yielder; + private _state; + private _disposer; + current: T; + constructor(initializer: () => void, tryGetNext: (yielder: IYield) => boolean, isEndless?: boolean); + constructor(initializer: () => void, tryGetNext: (yielder: IYield) => boolean, disposer?: () => void, isEndless?: boolean); + protected _isEndless: boolean; + isEndless: boolean; + reset(): void; + moveNext(): boolean; + nextValue(): T; + next(): IIteratorResult; + protected _onDispose(): void; +} diff --git a/dist/system/System/Collections/Enumeration/EnumeratorBase.js b/dist/system/System/Collections/Enumeration/EnumeratorBase.js new file mode 100644 index 00000000..348d42cc --- /dev/null +++ b/dist/system/System/Collections/Enumeration/EnumeratorBase.js @@ -0,0 +1,164 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../../Types", "../../Disposable/DisposableBase", "../../Disposable/ObjectPool"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Types_1, DisposableBase_1, ObjectPool_1; + var VOID0, yielderPool, Yielder, EnumeratorState, EnumeratorBase; + function yielder(recycle) { + if (!yielderPool) + yielderPool + = new ObjectPool_1.default(40, function () { return new Yielder(); }); + if (!recycle) + return yielderPool.take(); + recycle.yieldBreak(); + yielderPool.add(recycle); + } + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }, + function (DisposableBase_1_1) { + DisposableBase_1 = DisposableBase_1_1; + }, + function (ObjectPool_1_1) { + ObjectPool_1 = ObjectPool_1_1; + }], + execute: function() { + VOID0 = void (0); + Yielder = (function () { + function Yielder() { + this._current = VOID0; + } + Object.defineProperty(Yielder.prototype, "current", { + get: function () { return this._current; }, + enumerable: true, + configurable: true + }); + Yielder.prototype.yieldReturn = function (value) { + this._current = value; + return true; + }; + Yielder.prototype.yieldBreak = function () { + this._current = VOID0; + return false; + }; + Yielder.prototype.dispose = function () { + this.yieldBreak(); + }; + return Yielder; + }()); + (function (EnumeratorState) { + EnumeratorState[EnumeratorState["Before"] = 0] = "Before"; + EnumeratorState[EnumeratorState["Running"] = 1] = "Running"; + EnumeratorState[EnumeratorState["After"] = 2] = "After"; + })(EnumeratorState || (EnumeratorState = {})); + EnumeratorBase = (function (_super) { + __extends(EnumeratorBase, _super); + function EnumeratorBase(_initializer, _tryGetNext, disposer, isEndless) { + _super.call(this); + this._initializer = _initializer; + this._tryGetNext = _tryGetNext; + this.reset(); + if (Types_1.default.isBoolean(isEndless)) + this._isEndless = isEndless; + else if (Types_1.default.isBoolean(disposer)) + this._isEndless = disposer; + if (Types_1.default.isFunction(disposer)) + this._disposer = disposer; + } + Object.defineProperty(EnumeratorBase.prototype, "current", { + get: function () { + return this._yielder.current; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EnumeratorBase.prototype, "isEndless", { + get: function () { + return this._isEndless; + }, + enumerable: true, + configurable: true + }); + EnumeratorBase.prototype.reset = function () { + var _ = this; + _.throwIfDisposed(); + var y = _._yielder; + if (y) + y.yieldBreak(); + else + _._yielder = yielder(); + _._state = EnumeratorState.Before; + }; + EnumeratorBase.prototype.moveNext = function () { + var _ = this; + try { + switch (_._state) { + case EnumeratorState.Before: + _._state = EnumeratorState.Running; + var initializer = _._initializer; + if (initializer) + initializer(); + case EnumeratorState.Running: + if (_._tryGetNext(_._yielder)) { + return true; + } + else { + this.dispose(); + return false; + } + case EnumeratorState.After: + return false; + } + } + catch (e) { + this.dispose(); + throw e; + } + }; + EnumeratorBase.prototype.nextValue = function () { + return this.moveNext() + ? this._yielder.current + : VOID0; + }; + EnumeratorBase.prototype.next = function () { + return this.moveNext() ? + { + value: this._yielder.current, + done: false + } : { + value: VOID0, + done: true + }; + }; + EnumeratorBase.prototype._onDispose = function () { + var _ = this, disposer = _._disposer; + _._initializer = null; + _._disposer = null; + var y = _._yielder; + _._yielder = null; + yielder(y); + try { + if (disposer) + disposer(); + } + finally { + this._state = EnumeratorState.After; + } + }; + return EnumeratorBase; + }(DisposableBase_1.default)); + exports_1("default", EnumeratorBase); + } + } +}); +//# sourceMappingURL=EnumeratorBase.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Enumeration/EnumeratorBase.js.map b/dist/system/System/Collections/Enumeration/EnumeratorBase.js.map new file mode 100644 index 00000000..64f086db --- /dev/null +++ b/dist/system/System/Collections/Enumeration/EnumeratorBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"EnumeratorBase.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Enumeration/EnumeratorBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;;IAMH,YAAY,CAAC;;;;;;;;QAMP,KAAK,EAEP,WAAW;IAGf,iBAAiB,OAAqB;QAErC,EAAE,CAAA,CAAC,CAAC,WAAW,CAAC;YACf,WAAW;kBACR,IAAI,oBAAU,CAAe,EAAE,EAAE,cAAI,OAAA,IAAI,OAAO,EAAO,EAAlB,CAAkB,CAAC,CAAC;QAC7D,EAAE,CAAA,CAAC,CAAC,OAAO,CAAC;YAAC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QACvC,OAAO,CAAC,UAAU,EAAE,CAAC;QACrB,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;;;;;;;;;;;;;YAbK,KAAK,GAAO,KAAI,CAAC,CAAC,CAAC,CAAC;YAe1B;gBAAA;oBAES,aAAQ,GAAK,KAAK,CAAC;gBAmB5B,CAAC;gBAlBA,sBAAI,4BAAO;yBAAX,cAAkB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;;;mBAAA;gBAEzC,6BAAW,GAAX,UAAY,KAAO;oBAElB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;oBACtB,MAAM,CAAC,IAAI,CAAC;gBACb,CAAC;gBAED,4BAAU,GAAV;oBAEC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;oBACtB,MAAM,CAAC,KAAK,CAAC;gBACd,CAAC;gBAED,yBAAO,GAAP;oBAEC,IAAI,CAAC,UAAU,EAAE,CAAC;gBACnB,CAAC;gBACF,cAAC;YAAD,CAAC,AArBD,IAqBC;YAKD,WAAK,eAAe;gBAAG,yDAAM,CA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AAE,QAAQ,GAAG,CAAC,CAAC,SAAS,CAAC;oBAErC,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC;oBACtB,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;oBAGnB,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;oBACnB,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;oBAClB,OAAO,CAAC,CAAC,CAAC,CAAC;oBAEX,IACA,CAAC;wBACA,EAAE,CAAA,CAAC,QAAQ,CAAC;4BACX,QAAQ,EAAE,CAAC;oBACb,CAAC;4BAED,CAAC;wBAEA,IAAI,CAAC,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC;oBACrC,CAAC;gBACF,CAAC;gBAEF,qBAAC;YAAD,CAAC,AA5ID,CACgC,wBAAc,GA2I7C;YA5ID,oCA4IC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Collections/Enumeration/IndexEnumerator.d.ts b/dist/system/System/Collections/Enumeration/IndexEnumerator.d.ts new file mode 100644 index 00000000..e85a88be --- /dev/null +++ b/dist/system/System/Collections/Enumeration/IndexEnumerator.d.ts @@ -0,0 +1,15 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import EnumeratorBase from "./EnumeratorBase"; +export default class IndexEnumerator extends EnumeratorBase { + constructor(sourceFactory: () => { + source: { + [index: number]: T; + }; + pointer?: number; + length: number; + step?: number; + }); +} diff --git a/dist/system/System/Collections/Enumeration/IndexEnumerator.js b/dist/system/System/Collections/Enumeration/IndexEnumerator.js new file mode 100644 index 00000000..5473df22 --- /dev/null +++ b/dist/system/System/Collections/Enumeration/IndexEnumerator.js @@ -0,0 +1,70 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["./EnumeratorBase"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var EnumeratorBase_1; + var IndexEnumerator; + return { + setters:[ + function (EnumeratorBase_1_1) { + EnumeratorBase_1 = EnumeratorBase_1_1; + }], + execute: function() { + IndexEnumerator = (function (_super) { + __extends(IndexEnumerator, _super); + function IndexEnumerator(sourceFactory) { + var source; + _super.call(this, function () { + source = sourceFactory(); + if (source && source.source) { + var len = source.length; + if (len < 0) + throw new Error("length must be zero or greater"); + if (!isFinite(len)) + throw new Error("length must finite number"); + if (len && source.step === 0) + throw new Error("Invalid IndexEnumerator step value (0)."); + var pointer = source.pointer; + if (!pointer) + pointer = 0; + else if (pointer != Math.floor(pointer)) + throw new Error("Invalid IndexEnumerator pointer value (" + pointer + ") has decimal."); + source.pointer = pointer; + var step = source.step; + if (!step) + step = 1; + else if (step != Math.floor(step)) + throw new Error("Invalid IndexEnumerator step value (" + step + ") has decimal."); + source.step = step; + } + }, function (yielder) { + var len = (source && source.source) ? source.length : 0; + if (!len || isNaN(len)) + return yielder.yieldBreak(); + var current = source.pointer; + source.pointer += source.step; + return (current < len && current >= 0) + ? yielder.yieldReturn(source.source[current]) + : yielder.yieldBreak(); + }, function () { + if (source) { + source.source = null; + } + }); + this._isEndless = false; + } + return IndexEnumerator; + }(EnumeratorBase_1.default)); + exports_1("default", IndexEnumerator); + } + } +}); +//# sourceMappingURL=IndexEnumerator.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Enumeration/IndexEnumerator.js.map b/dist/system/System/Collections/Enumeration/IndexEnumerator.js.map new file mode 100644 index 00000000..f98a5594 --- /dev/null +++ b/dist/system/System/Collections/Enumeration/IndexEnumerator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IndexEnumerator.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Enumeration/IndexEnumerator.ts"],"names":[],"mappings":"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AG,IAAI,GAAG,gBAAgB,CAAC,CAAC;4BACnF,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;wBACpB,CAAC;oBACF,CAAC,EAED,UAAC,OAAO;wBAEP,IAAI,GAAG,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;wBACxD,EAAE,CAAA,CAAC,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;4BACrB,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;wBAC7B,IAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;wBAC7B,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC;wBAC9B,MAAM,CAAC,CAAC,OAAO,GAAC,GAAG,IAAI,OAAO,IAAE,CAAC,CAAC;8BAC/B,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;8BAC3C,OAAO,CAAC,UAAU,EAAE,CAAC;oBACzB,CAAC,EAED;wBAEC,EAAE,CAAA,CAAC,MAAM,CAAC,CACV,CAAC;4BACA,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;wBACtB,CAAC;oBACF,CAAC,CACD,CAAC;oBACF,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;gBACzB,CAAC;gBACF,sBAAC;YAAD,CAAC,AA9DD,CACiC,wBAAc,GA6D9C;YA9DD,qCA8DC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts b/dist/system/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts new file mode 100644 index 00000000..b966255b --- /dev/null +++ b/dist/system/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from "../../Exceptions/SystemException"; +export default class UnsupportedEnumerableException extends SystemException { + constructor(message?: string); + protected getName(): string; +} diff --git a/dist/system/System/Collections/Enumeration/UnsupportedEnumerableException.js b/dist/system/System/Collections/Enumeration/UnsupportedEnumerableException.js new file mode 100644 index 00000000..dbe536be --- /dev/null +++ b/dist/system/System/Collections/Enumeration/UnsupportedEnumerableException.js @@ -0,0 +1,37 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +System.register(["../../Exceptions/SystemException"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var SystemException_1; + var NAME, UnsupportedEnumerableException; + return { + setters:[ + function (SystemException_1_1) { + SystemException_1 = SystemException_1_1; + }], + execute: function() { + NAME = 'UnsupportedEnumerableException'; + UnsupportedEnumerableException = (function (_super) { + __extends(UnsupportedEnumerableException, _super); + function UnsupportedEnumerableException(message) { + _super.call(this, message || "Unsupported enumerable."); + } + UnsupportedEnumerableException.prototype.getName = function () { + return NAME; + }; + return UnsupportedEnumerableException; + }(SystemException_1.default)); + exports_1("default", UnsupportedEnumerableException); + } + } +}); +//# sourceMappingURL=UnsupportedEnumerableException.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Enumeration/UnsupportedEnumerableException.js.map b/dist/system/System/Collections/Enumeration/UnsupportedEnumerableException.js.map new file mode 100644 index 00000000..eed744b6 --- /dev/null +++ b/dist/system/System/Collections/Enumeration/UnsupportedEnumerableException.js.map @@ -0,0 +1 @@ +{"version":3,"file":"UnsupportedEnumerableException.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Enumeration/UnsupportedEnumerableException.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;IAEH,YAAY,CAAC;;;;;;;;QAIP,IAAI;;;;;;;YAAJ,IAAI,GAAU,gCAAgC,CAAC;YAErD;gBAC6C,kDAAe;gBAE3D,wCAAY,OAAe;oBAC1B,kBAAM,OAAO,IAAI,yBAAyB,CAAC,CAAC;gBAC7C,CAAC;gBAES,gDAAO,GAAjB;oBAEC,MAAM,CAAC,IAAI,CAAC;gBACb,CAAC;gBACF,qCAAC;YAAD,CAAC,AAXD,CAC6C,yBAAe,GAU3D;YAXD,oDAWC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Collections/LinkedList.d.ts b/dist/system/System/Collections/LinkedList.d.ts new file mode 100644 index 00000000..6de7a80e --- /dev/null +++ b/dist/system/System/Collections/LinkedList.d.ts @@ -0,0 +1,37 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based Upon: http://msdn.microsoft.com/en-us/library/he2s3bh7%28v=vs.110%29.aspx + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +export default class LinkedList extends CollectionBase implements ILinkedList { + private _listInternal; + constructor(source?: IEnumerableOrArray, equalityComparer?: EqualityComparison); + protected getCount(): number; + protected _addInternal(entry: T): boolean; + protected _removeInternal(entry: T, max?: number): number; + protected _clearInternal(): number; + forEach(action: Predicate | Action, useCopy?: boolean): void; + getEnumerator(): IEnumerator; + private _findFirst(entry); + private _findLast(entry); + removeOnce(entry: T): boolean; + first: ILinkedListNode; + last: ILinkedListNode; + getValueAt(index: number): T; + getNodeAt(index: number): ILinkedListNode; + find(entry: T): ILinkedListNode; + findLast(entry: T): ILinkedListNode; + addFirst(entry: T): void; + addLast(entry: T): void; + removeFirst(): void; + removeLast(): void; + removeNode(node: ILinkedListNode): boolean; + addBefore(before: ILinkedListNode, entry: T): void; + addAfter(after: ILinkedListNode, entry: T): void; + addNodeBefore(node: ILinkedListNode, before: ILinkedListNode): void; + addNodeAfter(node: ILinkedListNode, after: ILinkedListNode): void; +} diff --git a/dist/system/System/Collections/LinkedNodeList.d.ts b/dist/system/System/Collections/LinkedNodeList.d.ts new file mode 100644 index 00000000..2f91455d --- /dev/null +++ b/dist/system/System/Collections/LinkedNodeList.d.ts @@ -0,0 +1,31 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class LinkedNodeList> implements ILinkedNodeList, IEnumerateEach, IDisposable { + private _first; + private _last; + unsafeCount: number; + constructor(); + first: TNode; + last: TNode; + count: number; + forEach(action: Predicate | Action): void; + map(selector: Selector): T[]; + clear(): number; + dispose(): void; + contains(node: TNode): boolean; + getNodeAt(index: number): TNode; + find(condition: Predicate): TNode; + indexOf(node: TNode): number; + removeFirst(): boolean; + removeLast(): boolean; + removeNode(node: TNode): boolean; + addNode(node: TNode): void; + addNodeBefore(node: TNode, before?: TNode): void; + addNodeAfter(node: TNode, after?: TNode): void; + replace(node: TNode, replacement: TNode): void; + static valueEnumeratorFrom(list: LinkedNodeList>): IEnumerator; + static copyValues>(list: LinkedNodeList>, array: TDestination, index?: number): TDestination; +} diff --git a/dist/system/System/Collections/List.d.ts b/dist/system/System/Collections/List.d.ts new file mode 100644 index 00000000..39f8549b --- /dev/null +++ b/dist/system/System/Collections/List.d.ts @@ -0,0 +1,24 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +export default class List extends CollectionBase implements IList, IEnumerateEach { + protected _source: T[]; + constructor(source?: IEnumerableOrArray, equalityComparer?: EqualityComparison); + protected getCount(): number; + protected _addInternal(entry: T): boolean; + protected _removeInternal(entry: T, max?: number): number; + protected _clearInternal(): number; + protected _importEntries(entries: IEnumerableOrArray): number; + get(index: number): T; + set(index: number, value: T): boolean; + indexOf(item: T): number; + insert(index: number, value: T): void; + removeAt(index: number): boolean; + contains(item: T): boolean; + copyTo>(target: TTarget, index?: number): TTarget; + getEnumerator(): IEnumerator; + forEach(action: Predicate | Action, useCopy?: boolean): void; +} diff --git a/dist/system/System/Collections/Queue.d.ts b/dist/system/System/Collections/Queue.d.ts new file mode 100644 index 00000000..e634439d --- /dev/null +++ b/dist/system/System/Collections/Queue.d.ts @@ -0,0 +1,35 @@ +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based Upon: http://referencesource.microsoft.com/#System/CompMod/system/collections/generic/queue.cs + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +export default class Queue extends CollectionBase { + private _array; + private _head; + private _tail; + private _size; + private _capacity; + constructor(source?: IEnumerableOrArray | number, equalityComparer?: EqualityComparison); + protected getCount(): number; + protected _addInternal(item: T): boolean; + protected _removeInternal(item: T, max?: number): number; + protected _clearInternal(): number; + protected _onDispose(): void; + dump(max?: number): T[]; + forEach(action: Predicate | Action): void; + setCapacity(capacity: number): void; + enqueue(item: T): void; + protected _dequeueInternal(throwIfEmpty?: boolean): T; + dequeue(throwIfEmpty?: boolean): T; + tryDequeue(out: (value: T) => void): boolean; + private _getElement(index); + peek(): T; + trimExcess(threshold?: number): void; + getEnumerator(): IEnumerator; +} diff --git a/dist/system/System/Collections/ReadOnlyCollectionBase.d.ts b/dist/system/System/Collections/ReadOnlyCollectionBase.d.ts new file mode 100644 index 00000000..5633231c --- /dev/null +++ b/dist/system/System/Collections/ReadOnlyCollectionBase.d.ts @@ -0,0 +1,18 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +declare abstract class ReadOnlyCollectionBase extends CollectionBase { + protected _getCount: () => number; + protected getCount(): number; + protected getIsReadOnly(): boolean; + protected _addInternal(entry: T): boolean; + protected _removeInternal(entry: T, max?: number): number; + protected _clearInternal(): number; + protected _getEnumerator: () => IEnumerator; + getEnumerator(): IEnumerator; +} +export default ReadOnlyCollectionBase; diff --git a/dist/system/System/Collections/ReadOnlyCollectionWrapper.d.ts b/dist/system/System/Collections/ReadOnlyCollectionWrapper.d.ts new file mode 100644 index 00000000..4b2dbde9 --- /dev/null +++ b/dist/system/System/Collections/ReadOnlyCollectionWrapper.d.ts @@ -0,0 +1,8 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ReadOnlyCollection from "./ReadOnlyCollectionBase"; +export default class ReadOnlyCollectionWrapper extends ReadOnlyCollection { + constructor(c: ICollection); +} diff --git a/dist/system/System/Collections/Set.d.ts b/dist/system/System/Collections/Set.d.ts new file mode 100644 index 00000000..b44c6c2d --- /dev/null +++ b/dist/system/System/Collections/Set.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import SetBase from "./SetBase"; +export default class Set extends SetBase { + protected newUsing(source?: IEnumerableOrArray): Set; + private _registry; + protected _addInternal(item: T): boolean; + protected _clearInternal(): number; + protected _onDispose(): void; + protected _getNode(item: T): ILinkedNodeWithValue; + protected _removeInternal(item: T, max?: number): number; +} diff --git a/dist/system/System/Collections/SetBase.d.ts b/dist/system/System/Collections/SetBase.d.ts new file mode 100644 index 00000000..1b129395 --- /dev/null +++ b/dist/system/System/Collections/SetBase.d.ts @@ -0,0 +1,36 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import LinkedNodeList from "./LinkedNodeList"; +import CollectionBase from "./CollectionBase"; +declare abstract class SetBase extends CollectionBase implements ISet, IDisposable { + constructor(source?: IEnumerableOrArray); + protected abstract newUsing(source?: IEnumerableOrArray): SetBase; + protected _set: LinkedNodeList>; + protected _getSet(): LinkedNodeList>; + protected getCount(): number; + exceptWith(other: IEnumerableOrArray): void; + intersectWith(other: IEnumerableOrArray): void; + isProperSubsetOf(other: IEnumerableOrArray): boolean; + isProperSupersetOf(other: IEnumerableOrArray): boolean; + isSubsetOf(other: IEnumerableOrArray): boolean; + isSupersetOf(other: IEnumerableOrArray): boolean; + overlaps(other: IEnumerableOrArray): boolean; + setEquals(other: IEnumerableOrArray): boolean; + symmetricExceptWith(other: IEnumerableOrArray): void; + unionWith(other: IEnumerableOrArray): void; + protected _clearInternal(): number; + protected _onDispose(): void; + protected abstract _getNode(item: T): ILinkedNodeWithValue; + contains(item: T): boolean; + getEnumerator(): IEnumerator; + forEach(action: Predicate | Action, useCopy?: boolean): void; + protected _removeNode(node: ILinkedNodeWithValue): boolean; + removeFirst(): boolean; + removeLast(): boolean; +} +export default SetBase; diff --git a/dist/system/System/Collections/Sorting/KeySortedContext.d.ts b/dist/system/System/Collections/Sorting/KeySortedContext.d.ts new file mode 100644 index 00000000..36822f6a --- /dev/null +++ b/dist/system/System/Collections/Sorting/KeySortedContext.d.ts @@ -0,0 +1,16 @@ +/// +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import SortContext from "./SortContext"; +export default class KeySortedContext extends SortContext { + protected _keySelector: Selector; + constructor(next: IComparer, _keySelector: Selector, order?: Order, comparer?: Comparison); + compare(a: T, b: T): number; +} diff --git a/dist/system/System/Collections/Sorting/KeySortedContext.js b/dist/system/System/Collections/Sorting/KeySortedContext.js new file mode 100644 index 00000000..09d9e383 --- /dev/null +++ b/dist/system/System/Collections/Sorting/KeySortedContext.js @@ -0,0 +1,50 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../../Compare", "./SortContext", "../../Functions"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Values, SortContext_1, Functions_1; + var KeySortedContext; + return { + setters:[ + function (Values_1) { + Values = Values_1; + }, + function (SortContext_1_1) { + SortContext_1 = SortContext_1_1; + }, + function (Functions_1_1) { + Functions_1 = Functions_1_1; + }], + execute: function() { + KeySortedContext = (function (_super) { + __extends(KeySortedContext, _super); + function KeySortedContext(next, _keySelector, order, comparer) { + if (order === void 0) { order = 1; } + if (comparer === void 0) { comparer = Values.compare; } + _super.call(this, next, comparer, order); + this._keySelector = _keySelector; + } + KeySortedContext.prototype.compare = function (a, b) { + var _ = this, ks = _._keySelector; + if (!ks || ks == Functions_1.default.Identity) + return _super.prototype.compare.call(this, a, b); + var d = Values.compare(ks(a), ks(b)); + if (d == 0 && _._next) + return _._next.compare(a, b); + return _._order * d; + }; + return KeySortedContext; + }(SortContext_1.default)); + exports_1("default", KeySortedContext); + } + } +}); +//# sourceMappingURL=KeySortedContext.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Sorting/KeySortedContext.js.map b/dist/system/System/Collections/Sorting/KeySortedContext.js.map new file mode 100644 index 00000000..640415f4 --- /dev/null +++ b/dist/system/System/Collections/Sorting/KeySortedContext.js.map @@ -0,0 +1 @@ +{"version":3,"file":"KeySortedContext.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Sorting/KeySortedContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;;IAQH,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;YAMb;gBAC2D,oCAAc;gBAExE,0BACC,IAAiB,EACP,YAA6B,EACvC,KAA6B,EAC7B,QAAuC;oBADvC,qBAA6B,GAA7B,SAA6B;oBAC7B,wBAAuC,GAAvC,WAAyB,MAAM,CAAC,OAAO;oBAEvC,kBAAM,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;oBAJnB,iBAAY,GAAZ,YAAY,CAAiB;gBAKxC,CAAC;gBAED,kCAAO,GAAP,UAAQ,CAAG,EAAE,CAAG;oBAEf,IAAI,CAAC,GAAG,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC,YAAY,CAAC;oBAClC,EAAE,CAAA,CAAC,CAAC,EAAE,IAAI,EAAE,IAAE,mBAAS,CAAC,QAAQ,CAAC;wBAAC,MAAM,CAAC,gBAAK,CAAC,OAAO,YAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBAE7D,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,CAAM,EAAE,CAAC,CAAC,CAAC,EAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC/C,EAAE,CAAA,CAAC,CAAC,IAAE,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;wBAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBACjD,MAAM,CAAC,CAAC,CAAC,MAAM,GAAC,CAAC,CAAC;gBACnB,CAAC;gBACF,uBAAC;YAAD,CAAC,AArBD,CAC2D,qBAAW,GAoBrE;YArBD,sCAqBC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Collections/Sorting/SortContext.d.ts b/dist/system/System/Collections/Sorting/SortContext.d.ts new file mode 100644 index 00000000..b459e302 --- /dev/null +++ b/dist/system/System/Collections/Sorting/SortContext.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class SortContext implements IComparer { + protected _next: IComparer; + protected _comparer: Comparison; + protected _order: Order; + order: Order; + constructor(_next: IComparer, _comparer?: Comparison, _order?: Order); + generateSortedIndexes(source: T[]): number[]; + compare(a: T, b: T): number; +} diff --git a/dist/system/System/Collections/Sorting/SortContext.js b/dist/system/System/Collections/Sorting/SortContext.js new file mode 100644 index 00000000..bb6a5ce0 --- /dev/null +++ b/dist/system/System/Collections/Sorting/SortContext.js @@ -0,0 +1,50 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../../Compare"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var Values; + var SortContext; + return { + setters:[ + function (Values_1) { + Values = Values_1; + }], + execute: function() { + SortContext = (function () { + function SortContext(_next, _comparer, _order) { + if (_comparer === void 0) { _comparer = Values.compare; } + if (_order === void 0) { _order = 1; } + this._next = _next; + this._comparer = _comparer; + this._order = _order; + } + Object.defineProperty(SortContext.prototype, "order", { + get: function () { return this._order; }, + enumerable: true, + configurable: true + }); + SortContext.prototype.generateSortedIndexes = function (source) { + var _this = this; + if (source == null) + return []; + var result = source.map(function (s, i) { return i; }); + result.sort(function (a, b) { return _this.compare(source[a], source[b]); }); + return result; + }; + SortContext.prototype.compare = function (a, b) { + var _ = this; + var d = _._comparer(a, b); + if (d == 0 && _._next) + return _._next.compare(a, b); + return _._order * d; + }; + return SortContext; + }()); + exports_1("default", SortContext); + } + } +}); +//# sourceMappingURL=SortContext.js.map \ No newline at end of file diff --git a/dist/system/System/Collections/Sorting/SortContext.js.map b/dist/system/System/Collections/Sorting/SortContext.js.map new file mode 100644 index 00000000..7326a1aa --- /dev/null +++ b/dist/system/System/Collections/Sorting/SortContext.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SortContext.js","sourceRoot":"","sources":["../../../../../source/System/Collections/Sorting/SortContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;;IAMH,YAAY,CAAC;;;;;;;;;;YAIb;gBAWC,qBACW,KAAkB,EAClB,SAAwC,EACxC,MAA8B;oBADxC,yBAAkD,GAAlD,YAAoC,MAAM,CAAC,OAAO;oBAClD,sBAAwC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null +++ b/dist/system/System/Compare.d.ts @@ -0,0 +1,11 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function areEqual(a: any, b: any, strict?: boolean): boolean; +export declare function compare(a: IComparable, b: IComparable): number; +export declare function compare(a: T, b: T, strict?: boolean): CompareResult; +export declare function areEquivalent(a: any, b: any, nullEquivalency?: boolean, extraDepth?: number): boolean; diff --git a/dist/system/System/Diagnostics/Stopwatch.d.ts b/dist/system/System/Diagnostics/Stopwatch.d.ts new file mode 100644 index 00000000..b0bd97a1 --- /dev/null +++ b/dist/system/System/Diagnostics/Stopwatch.d.ts @@ -0,0 +1,24 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeSpan from "../Time/TimeSpan"; +export default class Stopwatch implements ITimer { + static getTimestampMilliseconds(): number; + private _elapsed; + private _startTimeStamp; + private _isRunning; + isRunning: boolean; + constructor(); + static startNew(): Stopwatch; + static measure(closure: () => void): TimeSpan; + start(): void; + stop(): void; + reset(): void; + lap(): TimeSpan; + currentLapMilliseconds: number; + currentLap: TimeSpan; + elapsedMilliseconds: number; + elapsed: TimeSpan; +} diff --git a/dist/system/System/Disposable/DisposableBase.d.ts b/dist/system/System/Disposable/DisposableBase.d.ts new file mode 100644 index 00000000..1acd883f --- /dev/null +++ b/dist/system/System/Disposable/DisposableBase.d.ts @@ -0,0 +1,16 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare abstract class DisposableBase implements IDisposableAware { + private _finalizer; + constructor(_finalizer?: () => void); + private _wasDisposed; + wasDisposed: boolean; + protected _disposableObjectName: string; + protected throwIfDisposed(message?: string, objectName?: string): boolean; + dispose(): void; + protected _onDispose(): void; +} +export default DisposableBase; diff --git a/dist/system/System/Disposable/ObjectDisposedException.d.ts b/dist/system/System/Disposable/ObjectDisposedException.d.ts new file mode 100644 index 00000000..66e40831 --- /dev/null +++ b/dist/system/System/Disposable/ObjectDisposedException.d.ts @@ -0,0 +1,15 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import Exception from '../Exception'; +import InvalidOperationException from '../Exceptions/InvalidOperationException'; +export default class ObjectDisposedException extends InvalidOperationException { + objectName: string; + constructor(objectName: string, message?: string, innerException?: Exception); + protected getName(): string; + toString(): string; + static throwIfDisposed(disposable: IDisposableAware, objectName?: string, message?: string): void; +} diff --git a/dist/system/System/Disposable/ObjectPool.d.ts b/dist/system/System/Disposable/ObjectPool.d.ts new file mode 100644 index 00000000..af854543 --- /dev/null +++ b/dist/system/System/Disposable/ObjectPool.d.ts @@ -0,0 +1,30 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon ObjectPool from Parallel Extension Extras and other ObjectPool implementations. + * Uses .add(T) and .take():T + */ +import DisposableBase from "./DisposableBase"; +export default class ObjectPool extends DisposableBase { + private _maxSize; + private _generator; + private _pool; + private _trimmer; + private _flusher; + private _autoFlusher; + private _localAbsMaxSize; + autoClearTimeout: number; + constructor(_maxSize: number, _generator: () => T); + maxSize: number; + count: number; + protected _trim(): void; + trim(defer?: number): void; + protected _clear(): void; + clear(defer?: number): void; + toArrayAndClear(): T[]; + dump(): T[]; + protected _onDispose(): void; + extendAutoClear(): void; + add(o: T): void; + take(): T; +} diff --git a/dist/system/System/Disposable/dispose.d.ts b/dist/system/System/Disposable/dispose.d.ts new file mode 100644 index 00000000..ea01844c --- /dev/null +++ b/dist/system/System/Disposable/dispose.d.ts @@ -0,0 +1,17 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function dispose(...disposables: IDisposable[]): void; +export declare module dispose { + function deferred(...disposables: IDisposable[]): void; + function withoutException(...disposables: IDisposable[]): any[]; + function these(disposables: IDisposable[], trapExceptions?: boolean): any[]; + module these { + function deferred(disposables: IDisposable[], delay?: number): void; + } +} +export declare function using(disposable: TDisposable, closure: (disposable: TDisposable) => TReturn): TReturn; +export default dispose; diff --git a/dist/system/System/Events/EventDispatcherBase.d.ts b/dist/system/System/Events/EventDispatcherBase.d.ts new file mode 100644 index 00000000..e8e78469 --- /dev/null +++ b/dist/system/System/Events/EventDispatcherBase.d.ts @@ -0,0 +1,33 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +import EventDispatcherEntry from "./EventDispatcherEntry"; +export interface IEventBase { + type: string; + target: TTarget; +} +export interface IEvent extends IEventBase { +} +export interface IEntryParams { + priority: number; + dispatcher: EventDispatcherBase; +} +export default class EventDispatcherBase extends DisposableBase implements IEventDispatcher { + protected _entries: EventDispatcherEntry[]; + addEventListener(type: string, listener: IEventListener, priority?: number): void; + removeEntry(entry: EventDispatcherEntry): boolean; + registerEventListener(type: string, listener: IEventListener, priority?: number): void; + hasEventListener(type: string, listener?: IEventListener): boolean; + removeEventListener(type: string, listener: IEventListener): void; + dispatchEvent(type: string, params?: any): boolean; + dispatchEvent(event: IEvent): boolean; + static DISPOSING: string; + static DISPOSED: string; + private _isDisposing; + isDisposing: boolean; + dispose(): void; +} diff --git a/dist/system/System/Events/EventDispatcherEntry.d.ts b/dist/system/System/Events/EventDispatcherEntry.d.ts new file mode 100644 index 00000000..73b2f602 --- /dev/null +++ b/dist/system/System/Events/EventDispatcherEntry.d.ts @@ -0,0 +1,16 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +export default class EventDispatcherEntry extends DisposableBase implements IEquatable> { + type: string; + listener: IEventListener; + params: TParams; + constructor(type: string, listener: IEventListener, params?: TParams, finalizer?: () => void); + protected _onDispose(): void; + dispatch(e: Event): boolean; + matches(type: string, listener: IEventListener): boolean; + equals(other: EventDispatcherEntry): boolean; +} diff --git a/dist/system/System/Events/EventSimple.d.ts b/dist/system/System/Events/EventSimple.d.ts new file mode 100644 index 00000000..f4fd3db2 --- /dev/null +++ b/dist/system/System/Events/EventSimple.d.ts @@ -0,0 +1,13 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Based on Netjs mscorlib.ts + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class EventSimple implements IDisposable { + private _listeners; + add(listener: T): void; + remove(listener: T): void; + dispatch(...params: any[]): void; + toMulticastFunction(): Function; + dispose(): void; +} diff --git a/dist/system/System/Events/EventSimple.js.map b/dist/system/System/Events/EventSimple.js.map new file mode 100644 index 00000000..cca33594 --- /dev/null +++ b/dist/system/System/Events/EventSimple.js.map @@ -0,0 +1 @@ +{"version":3,"file":"EventSimple.js","sourceRoot":"","sources":["../../../../source/System/Events/EventSimple.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;;YAMH;gBAAA;oBAES,eAAU,GAAO,EAAE,CAAC;gBAuC7B,CAAC;gBArCA,yBAAG,GAAH,UAAI,QAAU;oBAEb,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAChC,CAAC;gBAED,4BAAM,GAAN,UAAO,QAAU;oBAEhB,IAAI,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;oBAC9C,EAAE,CAAA,CAAC,KAAK,GAAC,CAAC,CAAC;wBAAC,MAAM,CAAC;oBACnB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBAClC,CAAC;gBAED,8BAAQ,GAAR;oBAAS,gBAAe;yBAAf,WAAe,CAAf,sBAAe,CAAf,IAAe;wBAAf,+BAAe;;oBAEvB,IAAI,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;oBAChC,GAAG,CAAA,CAAU,UAAS,EAAT,uBAAS,EAAT,uBAAS,EAAT,IAAS,CAAC;wBAAnB,IAAI,CAAC,kBAAA;wBAER,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;qBACf;gBACF,CAAC;gBAED,yCAAmB,GAAnB;oBAEC,IAAI,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;oBAChC,MAAM,CAAC;wBAEN,GAAG,CAAA,CAAU,UAAS,EAAT,uBAAS,EAAT,uBAAS,EAAT,IAAS,CAAC;4BAAnB,IAAI,CAAC,kBAAA;4BAER,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;yBAClB;oBACF,CAAC,CAAC;gBACH,CAAC;gBAED,6BAAO,GAAP;oBAEC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;gBAC5B,CAAC;gBACF,kBAAC;YAAD,CAAC,AAzCD,IAyCC;YAzCD,iCAyCC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Exception.d.ts b/dist/system/System/Exception.d.ts new file mode 100644 index 00000000..dce52d48 --- /dev/null +++ b/dist/system/System/Exception.d.ts @@ -0,0 +1,18 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +export default class Exception implements Error, IDisposable { + message: string; + name: string; + constructor(message?: string, innerException?: Error, beforeSealing?: (ex: any) => void); + stack: string; + data: IMap; + protected getName(): string; + toString(): string; + protected toStringWithoutBrackets(): string; + dispose(): void; +} diff --git a/dist/system/System/ExceptionType.d.ts b/dist/system/System/ExceptionType.d.ts new file mode 100644 index 00000000..5cd2e52a --- /dev/null +++ b/dist/system/System/ExceptionType.d.ts @@ -0,0 +1,11 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare const Error: string; +export declare const EvalError: string; +export declare const RangeError: string; +export declare const ReferenceError: string; +export declare const SyntaxError: string; +export declare const TypeError: string; +export declare const URIError: string; diff --git a/dist/system/System/Exceptions/ArgumentException.d.ts b/dist/system/System/Exceptions/ArgumentException.d.ts new file mode 100644 index 00000000..eac4232c --- /dev/null +++ b/dist/system/System/Exceptions/ArgumentException.d.ts @@ -0,0 +1,11 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from "./SystemException"; +export default class ArgumentException extends SystemException { + paramName: string; + constructor(paramName: string, message?: string, innerException?: Error, beforeSealing?: (ex: any) => void); + protected getName(): string; +} diff --git a/dist/system/System/Exceptions/ArgumentException.js b/dist/system/System/Exceptions/ArgumentException.js new file mode 100644 index 00000000..f4c9ea2b --- /dev/null +++ b/dist/system/System/Exceptions/ArgumentException.js @@ -0,0 +1,47 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +System.register(["./SystemException", "../Text/Utility"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var SystemException_1, Utility_1; + var NAME, ArgumentException; + return { + setters:[ + function (SystemException_1_1) { + SystemException_1 = SystemException_1_1; + }, + function (Utility_1_1) { + Utility_1 = Utility_1_1; + }], + execute: function() { + NAME = 'ArgumentException'; + ArgumentException = (function (_super) { + __extends(ArgumentException, _super); + function ArgumentException(paramName, message, innerException, beforeSealing) { + if (message === void 0) { message = null; } + if (innerException === void 0) { innerException = null; } + var pn = paramName ? ('{' + paramName + '} ') : ''; + _super.call(this, Utility_1.trim(pn + (message || '')), innerException, function (_) { + _.paramName = paramName; + if (beforeSealing) + beforeSealing(_); + }); + } + ArgumentException.prototype.getName = function () { + return NAME; + }; + return ArgumentException; + }(SystemException_1.default)); + exports_1("default", ArgumentException); + } + } +}); +//# sourceMappingURL=ArgumentException.js.map \ No newline at end of file diff --git a/dist/system/System/Exceptions/ArgumentException.js.map b/dist/system/System/Exceptions/ArgumentException.js.map new file mode 100644 index 00000000..2e32da98 --- /dev/null +++ b/dist/system/System/Exceptions/ArgumentException.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ArgumentException.js","sourceRoot":"","sources":["../../../../source/System/Exceptions/ArgumentException.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;IAEH,YAAY,CAAC;;;;;;;;QAMP,IAAI;;;;;;;;;;YAAJ,IAAI,GAAU,mBAAmB,CAAC;YAExC;gBACgC,qCAAe;gBAM9C,2BACC,SAAgB,EAChB,OAAqB,EACrB,cAA2B,EAC3B,aAA6B;oBAF7B,uBAAqB,GAArB,cAAqB;oBACrB,8BAA2B,GAA3B,qBAA2B;oBAG3B,IAAI,EAAE,GAAG,SAAS,GAAG,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;oBACnD,kBAAM,cAAI,CAAC,EAAE,GAAG,CAAC,OAAO,IAAE,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,UAAC,CAAC;wBACjD,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC;wBACxB,EAAE,CAAA,CAAC,aAAa,CAAC;4BAAC,aAAa,CAAC,CAAC,CAAC,CAAC;oBACpC,CAAC,CAAC,CAAC;gBACJ,CAAC;gBAGS,mCAAO,GAAjB;oBAEC,MAAM,CAAC,IAAI,CAAC;gBACb,CAAC;gBAEF,wBAAC;YAAD,CAAC,AA1BD,CACgC,yBAAe,GAyB9C;YA1BD,uCA0BC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Exceptions/ArgumentNullException.d.ts b/dist/system/System/Exceptions/ArgumentNullException.d.ts new file mode 100644 index 00000000..5cc13038 --- /dev/null +++ b/dist/system/System/Exceptions/ArgumentNullException.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import ArgumentException from './ArgumentException'; +export default class ArgumentNullException extends ArgumentException { + constructor(paramName: string, message?: string, innerException?: Error); + protected getName(): string; +} diff --git a/dist/system/System/Exceptions/ArgumentNullException.js b/dist/system/System/Exceptions/ArgumentNullException.js new file mode 100644 index 00000000..a84d272a --- /dev/null +++ b/dist/system/System/Exceptions/ArgumentNullException.js @@ -0,0 +1,39 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +System.register(['./ArgumentException'], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ArgumentException_1; + var NAME, ArgumentNullException; + return { + setters:[ + function (ArgumentException_1_1) { + ArgumentException_1 = ArgumentException_1_1; + }], + execute: function() { + NAME = 'ArgumentNullException'; + ArgumentNullException = (function (_super) { + __extends(ArgumentNullException, _super); + function ArgumentNullException(paramName, message, innerException) { + if (message === void 0) { message = ''; } + if (innerException === void 0) { innerException = null; } + _super.call(this, paramName, message, innerException); + } + ArgumentNullException.prototype.getName = function () { + return NAME; + }; + return ArgumentNullException; + }(ArgumentException_1.default)); + exports_1("default", ArgumentNullException); + } + } +}); +//# sourceMappingURL=ArgumentNullException.js.map \ No newline at end of file diff --git a/dist/system/System/Exceptions/ArgumentNullException.js.map b/dist/system/System/Exceptions/ArgumentNullException.js.map new file mode 100644 index 00000000..e7d7f108 --- /dev/null +++ b/dist/system/System/Exceptions/ArgumentNullException.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ArgumentNullException.js","sourceRoot":"","sources":["../../../../source/System/Exceptions/ArgumentNullException.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;IAEH,YAAY,CAAC;;;;;;;;QAKP,IAAI;;;;;;;YAAJ,IAAI,GAAU,uBAAuB,CAAC;YAE5C;gBACoC,yCAAiB;gBAEpD,+BACC,SAAgB,EAChB,OAAmB,EACnB,cAA2B;oBAD3B,uBAAmB,GAAnB,YAAmB;oBACnB,8BAA2B,GAA3B,qBAA2B;oBAE3B,kBAAM,SAAS,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;gBAC3C,CAAC;gBAES,uCAAO,GAAjB;oBAEC,MAAM,CAAC,IAAI,CAAC;gBACb,CAAC;gBAEF,4BAAC;YAAD,CAAC,AAhBD,CACoC,2BAAiB,GAepD;YAhBD,2CAgBC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Exceptions/ArgumentOutOfRangeException.d.ts b/dist/system/System/Exceptions/ArgumentOutOfRangeException.d.ts new file mode 100644 index 00000000..4fd62443 --- /dev/null +++ b/dist/system/System/Exceptions/ArgumentOutOfRangeException.d.ts @@ -0,0 +1,12 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import Exception from "../Exception"; +import ArgumentException from "./ArgumentException"; +export default class ArgumentOutOfRangeException extends ArgumentException { + actualValue: string | number | boolean; + constructor(paramName: string, actualValue: string | number | boolean, message?: string, innerException?: Exception); + protected getName(): string; +} diff --git a/dist/system/System/Exceptions/ArgumentOutOfRangeException.js b/dist/system/System/Exceptions/ArgumentOutOfRangeException.js new file mode 100644 index 00000000..5f4f3fc9 --- /dev/null +++ b/dist/system/System/Exceptions/ArgumentOutOfRangeException.js @@ -0,0 +1,42 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +System.register(["./ArgumentException"], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ArgumentException_1; + var NAME, ArgumentOutOfRangeException; + return { + setters:[ + function (ArgumentException_1_1) { + ArgumentException_1 = ArgumentException_1_1; + }], + execute: function() { + 'use strict'; + NAME = 'ArgumentOutOfRangeException'; + ArgumentOutOfRangeException = (function (_super) { + __extends(ArgumentOutOfRangeException, _super); + function ArgumentOutOfRangeException(paramName, actualValue, message, innerException) { + if (message === void 0) { message = ' '; } + if (innerException === void 0) { innerException = null; } + _super.call(this, paramName, +("(" + actualValue + ") ") + message, innerException, function (_) { + _.actualValue = actualValue; + }); + } + ArgumentOutOfRangeException.prototype.getName = function () { + return NAME; + }; + return ArgumentOutOfRangeException; + }(ArgumentException_1.default)); + exports_1("default", ArgumentOutOfRangeException); + } + } +}); +//# sourceMappingURL=ArgumentOutOfRangeException.js.map \ No newline at end of file diff --git a/dist/system/System/Exceptions/ArgumentOutOfRangeException.js.map b/dist/system/System/Exceptions/ArgumentOutOfRangeException.js.map new file mode 100644 index 00000000..8840a4da --- /dev/null +++ b/dist/system/System/Exceptions/ArgumentOutOfRangeException.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ArgumentOutOfRangeException.js","sourceRoot":"","sources":["../../../../source/System/Exceptions/ArgumentOutOfRangeException.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;;;;QAOG,IAAI;;;;;;;YAHV,YAAY,CAAC;YAGP,IAAI,GAAU,6BAA6B,CAAC;YAElD;gBAC0C,+CAAiB;gBAI1D,qCACC,SAAgB,EAChB,WAAiC,EACjC,OAAoB,EACpB,cAA+B;oBAD/B,uBAAoB,GAApB,aAAoB;oBACpB,8BAA+B,GAA/B,qBAA+B;oBAE/B,kBAAM,SAAS,EAAE,CAAE,OAAI,WAAW,QAAI,GAAG,OAAO,EAAG,cAAc,EAAE,UAAC,CAAC;wBACpE,CAAC,CAAC,WAAW,GAAG,WAAW,CAAC;oBAC7B,CAAC,CAAC,CAAC;gBACJ,CAAC;gBAGS,6CAAO,GAAjB;oBAEC,MAAM,CAAC,IAAI,CAAC;gBACb,CAAC;gBAEF,kCAAC;YAAD,CAAC,AAtBD,CAC0C,2BAAiB,GAqB1D;YAtBD,iDAsBC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Exceptions/InvalidOperationException.d.ts b/dist/system/System/Exceptions/InvalidOperationException.d.ts new file mode 100644 index 00000000..4f422d04 --- /dev/null +++ b/dist/system/System/Exceptions/InvalidOperationException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from './SystemException'; +export default class InvalidOperationException extends SystemException { + protected getName(): string; +} diff --git a/dist/system/System/Exceptions/InvalidOperationException.js b/dist/system/System/Exceptions/InvalidOperationException.js new file mode 100644 index 00000000..67cfae55 --- /dev/null +++ b/dist/system/System/Exceptions/InvalidOperationException.js @@ -0,0 +1,37 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +System.register(['./SystemException'], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var SystemException_1; + var NAME, InvalidOperationException; + return { + setters:[ + function (SystemException_1_1) { + SystemException_1 = SystemException_1_1; + }], + execute: function() { + NAME = 'InvalidOperationException'; + InvalidOperationException = (function (_super) { + __extends(InvalidOperationException, _super); + function InvalidOperationException() { + _super.apply(this, arguments); + } + InvalidOperationException.prototype.getName = function () { + return NAME; + }; + return InvalidOperationException; + }(SystemException_1.default)); + exports_1("default", InvalidOperationException); + } + } +}); +//# sourceMappingURL=InvalidOperationException.js.map \ No newline at end of file diff --git a/dist/system/System/Exceptions/InvalidOperationException.js.map b/dist/system/System/Exceptions/InvalidOperationException.js.map new file mode 100644 index 00000000..d29a4958 --- /dev/null +++ b/dist/system/System/Exceptions/InvalidOperationException.js.map @@ -0,0 +1 @@ +{"version":3,"file":"InvalidOperationException.js","sourceRoot":"","sources":["../../../../source/System/Exceptions/InvalidOperationException.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;IAEH,YAAY,CAAC;;;;;;;;QAKP,IAAI;;;;;;;YAAJ,IAAI,GAAU,2BAA2B,CAAC;YAEhD;gBACwC,6CAAe;gBADvD;oBACwC,8BAAe;gBAOvD,CAAC;gBALU,2CAAO,GAAjB;oBAEC,MAAM,CAAC,IAAI,CAAC;gBACb,CAAC;gBAEF,gCAAC;YAAD,CAAC,AARD,CACwC,yBAAe,GAOtD;YARD,+CAQC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Exceptions/NotImplementedException.d.ts b/dist/system/System/Exceptions/NotImplementedException.d.ts new file mode 100644 index 00000000..0225eeb8 --- /dev/null +++ b/dist/system/System/Exceptions/NotImplementedException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from './SystemException'; +export default class NotImplementedException extends SystemException { + protected getName(): string; +} diff --git a/dist/system/System/Exceptions/NotImplementedException.js b/dist/system/System/Exceptions/NotImplementedException.js new file mode 100644 index 00000000..196dbe93 --- /dev/null +++ b/dist/system/System/Exceptions/NotImplementedException.js @@ -0,0 +1,37 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +System.register(['./SystemException'], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var SystemException_1; + var NAME, NotImplementedException; + return { + setters:[ + function (SystemException_1_1) { + SystemException_1 = SystemException_1_1; + }], + execute: function() { + NAME = 'NotImplementedException'; + NotImplementedException = (function (_super) { + __extends(NotImplementedException, _super); + function NotImplementedException() { + _super.apply(this, arguments); + } + NotImplementedException.prototype.getName = function () { + return NAME; + }; + return NotImplementedException; + }(SystemException_1.default)); + exports_1("default", NotImplementedException); + } + } +}); +//# sourceMappingURL=NotImplementedException.js.map \ No newline at end of file diff --git a/dist/system/System/Exceptions/NotImplementedException.js.map b/dist/system/System/Exceptions/NotImplementedException.js.map new file mode 100644 index 00000000..d74e3c1f --- /dev/null +++ b/dist/system/System/Exceptions/NotImplementedException.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NotImplementedException.js","sourceRoot":"","sources":["../../../../source/System/Exceptions/NotImplementedException.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;IAEH,YAAY,CAAC;;;;;;;;QAKP,IAAI;;;;;;;YAAJ,IAAI,GAAU,yBAAyB,CAAC;YAE9C;gBACsC,2CAAe;gBADrD;oBACsC,8BAAe;gBAOrD,CAAC;gBALU,yCAAO,GAAjB;oBAEC,MAAM,CAAC,IAAI,CAAC;gBACb,CAAC;gBAEF,8BAAC;YAAD,CAAC,AARD,CACsC,yBAAe,GAOpD;YARD,6CAQC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Exceptions/NullReferenceException.d.ts b/dist/system/System/Exceptions/NullReferenceException.d.ts new file mode 100644 index 00000000..780b64a6 --- /dev/null +++ b/dist/system/System/Exceptions/NullReferenceException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from './SystemException'; +export default class NullReferenceException extends SystemException { + protected getName(): string; +} diff --git a/dist/system/System/Exceptions/NullReferenceException.js b/dist/system/System/Exceptions/NullReferenceException.js new file mode 100644 index 00000000..eeddb085 --- /dev/null +++ b/dist/system/System/Exceptions/NullReferenceException.js @@ -0,0 +1,37 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +System.register(['./SystemException'], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var SystemException_1; + var NAME, NullReferenceException; + return { + setters:[ + function (SystemException_1_1) { + SystemException_1 = SystemException_1_1; + }], + execute: function() { + NAME = 'NullReferenceException'; + NullReferenceException = (function (_super) { + __extends(NullReferenceException, _super); + function NullReferenceException() { + _super.apply(this, arguments); + } + NullReferenceException.prototype.getName = function () { + return NAME; + }; + return NullReferenceException; + }(SystemException_1.default)); + exports_1("default", NullReferenceException); + } + } +}); +//# sourceMappingURL=NullReferenceException.js.map \ No newline at end of file diff --git a/dist/system/System/Exceptions/NullReferenceException.js.map b/dist/system/System/Exceptions/NullReferenceException.js.map new file mode 100644 index 00000000..3c21a346 --- /dev/null +++ b/dist/system/System/Exceptions/NullReferenceException.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NullReferenceException.js","sourceRoot":"","sources":["../../../../source/System/Exceptions/NullReferenceException.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;IAEH,YAAY,CAAC;;;;;;;;QAKP,IAAI;;;;;;;YAAJ,IAAI,GAAU,wBAAwB,CAAC;YAE7C;gBACqC,0CAAe;gBADpD;oBACqC,8BAAe;gBAOpD,CAAC;gBALU,wCAAO,GAAjB;oBAEC,MAAM,CAAC,IAAI,CAAC;gBACb,CAAC;gBAEF,6BAAC;YAAD,CAAC,AARD,CACqC,yBAAe,GAOnD;YARD,4CAQC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Exceptions/SystemException.d.ts b/dist/system/System/Exceptions/SystemException.d.ts new file mode 100644 index 00000000..239bfbef --- /dev/null +++ b/dist/system/System/Exceptions/SystemException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/system.systemexception%28v=vs.110%29.aspx + */ +import Exception from '../Exception'; +export default class SystemException extends Exception { + protected getName(): string; +} diff --git a/dist/system/System/Exceptions/SystemException.js b/dist/system/System/Exceptions/SystemException.js new file mode 100644 index 00000000..4aaadca5 --- /dev/null +++ b/dist/system/System/Exceptions/SystemException.js @@ -0,0 +1,37 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/system.systemexception%28v=vs.110%29.aspx + */ +System.register(['../Exception'], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Exception_1; + var NAME, SystemException; + return { + setters:[ + function (Exception_1_1) { + Exception_1 = Exception_1_1; + }], + execute: function() { + NAME = 'SystemException'; + SystemException = (function (_super) { + __extends(SystemException, _super); + function SystemException() { + _super.apply(this, arguments); + } + SystemException.prototype.getName = function () { + return NAME; + }; + return SystemException; + }(Exception_1.default)); + exports_1("default", SystemException); + } + } +}); +//# sourceMappingURL=SystemException.js.map \ No newline at end of file diff --git a/dist/system/System/Exceptions/SystemException.js.map b/dist/system/System/Exceptions/SystemException.js.map new file mode 100644 index 00000000..1a43c2ca --- /dev/null +++ b/dist/system/System/Exceptions/SystemException.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SystemException.js","sourceRoot":"","sources":["../../../../source/System/Exceptions/SystemException.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;IAEH,YAAY,CAAC;;;;;;;;QAKP,IAAI;;;;;;;YAAJ,IAAI,GAAU,iBAAiB,CAAC;YAEtC;gBAC8B,mCAAS;gBADvC;oBAC8B,8BAAS;gBAgBvC,CAAC;gBAJU,iCAAO,GAAjB;oBAEC,MAAM,CAAC,IAAI,CAAC;gBACb,CAAC;gBACF,sBAAC;YAAD,CAAC,AAjBD,CAC8B,mBAAS,GAgBtC;YAjBD,qCAiBC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Functions.d.ts b/dist/system/System/Functions.d.ts new file mode 100644 index 00000000..0262bc62 --- /dev/null +++ b/dist/system/System/Functions.d.ts @@ -0,0 +1,17 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare class Functions { + Identity(x: T): T; + True(): boolean; + False(): boolean; + Blank(): void; +} +declare module Functions { + var Identity: (x: T) => T; + var True: () => boolean; + var False: () => boolean; + var Blank: () => void; +} +export default Functions; diff --git a/dist/system/System/Integer.d.ts b/dist/system/System/Integer.d.ts new file mode 100644 index 00000000..04881834 --- /dev/null +++ b/dist/system/System/Integer.d.ts @@ -0,0 +1,25 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function Integer(n: number): number; +export declare module Integer { + const MAX_32_BIT: number; + function random(maxExclusive: number): number; + module random { + function next(boundary: number, inclusive?: boolean): number; + function nextInRange(min: number, max: number, inclusive?: boolean): number; + function select(source: IArray): T; + module select { + function one(source: IArray): T; + } + } + function as32Bit(n: number): number; + function is(n: number): boolean; + function is32Bit(n: number): boolean; + function assert(n: number, argumentName?: string): boolean; + function assertZeroOrGreater(n: number, argumentName?: string): boolean; + function assertPositive(n: number, argumentName?: string): boolean; +} +export default Integer; diff --git a/dist/system/System/KeyValueExtract.d.ts b/dist/system/System/KeyValueExtract.d.ts new file mode 100644 index 00000000..cfe473b9 --- /dev/null +++ b/dist/system/System/KeyValueExtract.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function isKeyValuePair(kvp: any): kvp is IKeyValuePair; +export declare function assertKey(key: TKey, name?: string): TKey; +export declare function assertTuple(tuple: IArray, name?: string): void; +export declare function assertNotUndefined(value: T, name: string): T; +export default function extractKeyValue(item: KeyValuePair, to: (key: TKey, value: TValue) => TResult): TResult; diff --git a/dist/system/System/Lazy.d.ts b/dist/system/System/Lazy.d.ts new file mode 100644 index 00000000..de32b287 --- /dev/null +++ b/dist/system/System/Lazy.d.ts @@ -0,0 +1,21 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from './Disposable/DisposableBase'; +export default class Lazy extends DisposableBase implements ILazy { + private _closure; + private _isValueCreated; + private _value; + constructor(_closure: Func); + isValueCreated: boolean; + canReset: boolean; + reset(throwIfCannotReset?: boolean): boolean; + value: T; + getValue(clearClosureReference?: boolean): T; + protected _onDispose(): void; + equals(other: Lazy): boolean; + valueEquals(other: Lazy): boolean; +} diff --git a/dist/system/System/Net/Http/HttpMethod.d.ts b/dist/system/System/Net/Http/HttpMethod.d.ts new file mode 100644 index 00000000..d70dbbd8 --- /dev/null +++ b/dist/system/System/Net/Http/HttpMethod.d.ts @@ -0,0 +1,7 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + */ +export declare const OPTIONS: HttpMethodValue, HEAD: HttpMethodValue, GET: HttpMethodValue, PUT: HttpMethodValue, POST: HttpMethodValue, DELETE: HttpMethodValue, TRACE: HttpMethodValue, CONNECT: HttpMethodValue; diff --git a/dist/system/System/Net/Http/HttpMethod.js b/dist/system/System/Net/Http/HttpMethod.js new file mode 100644 index 00000000..4645400b --- /dev/null +++ b/dist/system/System/Net/Http/HttpMethod.js @@ -0,0 +1,17 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + */ +System.register([], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var OPTIONS, HEAD, GET, PUT, POST, DELETE, TRACE, CONNECT; + return { + setters:[], + execute: function() { + exports_1("OPTIONS", OPTIONS = 'OPTIONS'), exports_1("HEAD", HEAD = 'HEAD'), exports_1("GET", GET = 'GET'), exports_1("PUT", PUT = 'PUT'), exports_1("POST", POST = 'POST'), exports_1("DELETE", DELETE = 'DELETE'), exports_1("TRACE", TRACE = 'TRACE'), exports_1("CONNECT", CONNECT = 'CONNECT'); + } + } +}); +//# sourceMappingURL=HttpMethod.js.map \ No newline at end of file diff --git a/dist/system/System/Net/Http/HttpMethod.js.map b/dist/system/System/Net/Http/HttpMethod.js.map new file mode 100644 index 00000000..215fedcb --- /dev/null +++ b/dist/system/System/Net/Http/HttpMethod.js.map @@ -0,0 +1 @@ +{"version":3,"file":"HttpMethod.js","sourceRoot":"","sources":["../../../../../source/System/Net/Http/HttpMethod.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;QAKF,OAAO,EACP,IAAI,EACJ,GAAG,EACH,GAAG,EACH,IAAI,EACJ,MAAM,EACN,KAAK,EACL,OAAO;;;;YAPP,qBAAA,OAAO,GAAmB,SAAS,CAAA,EACnC,kBAAA,IAAI,GAAsB,MAAM,CAAA,EAChC,iBAAA,GAAG,GAAuB,KAAK,CAAA,EAC/B,iBAAA,GAAG,GAAuB,KAAK,CAAA,EAC/B,kBAAA,IAAI,GAAsB,MAAM,CAAA,EAChC,oBAAA,MAAM,GAAoB,QAAQ,CAAA,EAClC,mBAAA,KAAK,GAAqB,OAAO,CAAA,EACjC,qBAAA,OAAO,GAAmB,SAAS,CAAA,CAAC"} \ No newline at end of file diff --git a/dist/system/System/Net/Http/HttpRequestFactory.d.ts b/dist/system/System/Net/Http/HttpRequestFactory.d.ts new file mode 100644 index 00000000..1342a0e0 --- /dev/null +++ b/dist/system/System/Net/Http/HttpRequestFactory.d.ts @@ -0,0 +1,21 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import Uri from "../../Uri/Uri"; +import DisposableBase from "../../Disposable/DisposableBase"; +export default class HttpRequestFactory extends DisposableBase { + private _http; + protected _uriDefaults: Uri; + constructor(_http: IHttpRequestAdapter, uriDefaults?: string | IUri); + protected _onDispose(): void; + uri(uri: string | IUri): HttpRequestFactory; + params(params: QueryParamsConvertible): HttpRequestFactory; + request(method: HttpMethodValue, data?: any): IPromise; + get(): IPromise; + put(): IPromise; + post(data: any): IPromise; + 'delete'(): IPromise; +} diff --git a/dist/system/System/Net/Http/HttpRequestFactory.js b/dist/system/System/Net/Http/HttpRequestFactory.js new file mode 100644 index 00000000..44c1bb7b --- /dev/null +++ b/dist/system/System/Net/Http/HttpRequestFactory.js @@ -0,0 +1,84 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../../Exceptions/ArgumentNullException", "../../Uri/Uri", "../../Disposable/DisposableBase", "./HttpMethod"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ArgumentNullException_1, Uri_1, DisposableBase_1, HttpMethod_1; + var HttpRequestFactory; + return { + setters:[ + function (ArgumentNullException_1_1) { + ArgumentNullException_1 = ArgumentNullException_1_1; + }, + function (Uri_1_1) { + Uri_1 = Uri_1_1; + }, + function (DisposableBase_1_1) { + DisposableBase_1 = DisposableBase_1_1; + }, + function (HttpMethod_1_1) { + HttpMethod_1 = HttpMethod_1_1; + }], + execute: function() { + HttpRequestFactory = (function (_super) { + __extends(HttpRequestFactory, _super); + function HttpRequestFactory(_http, uriDefaults) { + _super.call(this); + this._http = _http; + this._disposableObjectName = 'HttpRequestFactory'; + if (!_http) + throw new ArgumentNullException_1.default('_http'); + this._uriDefaults = Uri_1.default.from(uriDefaults); + } + HttpRequestFactory.prototype._onDispose = function () { + this._http = null; + this._uriDefaults = null; + }; + HttpRequestFactory.prototype.uri = function (uri) { + var _ = this; + _.throwIfDisposed(); + var u = Uri_1.default.from(uri, _._uriDefaults); + return _._uriDefaults.equals(u) + ? _ + : new HttpRequestFactory(_._http, u); + }; + HttpRequestFactory.prototype.params = function (params) { + var _ = this; + _.throwIfDisposed(); + return _.uri(_._uriDefaults.updateQuery(params)); + }; + HttpRequestFactory.prototype.request = function (method, data) { + var _ = this; + _.throwIfDisposed(); + return _._http.request({ + method: method, + uri: _._uriDefaults, + data: data + }); + }; + HttpRequestFactory.prototype.get = function () { + return this.request(HttpMethod_1.GET); + }; + HttpRequestFactory.prototype.put = function () { + return this.request(HttpMethod_1.PUT); + }; + HttpRequestFactory.prototype.post = function (data) { + return this.request(HttpMethod_1.POST, data); + }; + HttpRequestFactory.prototype['delete'] = function () { + return this.request(HttpMethod_1.DELETE); + }; + return HttpRequestFactory; + }(DisposableBase_1.default)); + exports_1("default", HttpRequestFactory); + } + } +}); +//# sourceMappingURL=HttpRequestFactory.js.map \ No newline at end of file diff --git a/dist/system/System/Net/Http/HttpRequestFactory.js.map b/dist/system/System/Net/Http/HttpRequestFactory.js.map new file mode 100644 index 00000000..61b53579 --- /dev/null +++ b/dist/system/System/Net/Http/HttpRequestFactory.js.map @@ -0,0 +1 @@ +{"version":3,"file":"HttpRequestFactory.js","sourceRoot":"","sources":["../../../../../source/System/Net/Http/HttpRequestFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;;IAIH,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;YAWb;gBAAgD,sCAAc;gBAK7D,4BACS,KAAyB,EACjC,WAAwB;oBAExB,iBAAO,CAAC;oBAHA,UAAK,GAAL,KAAK,CAAoB;oBAKjC,IAAI,CAAC,qBAAqB,GAAG,oBAA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AAI,CAAC,OAAO,CAAU,gBAAG,CAAC,CAAC;gBACnC,CAAC;gBAED,gCAAG,GAAH;oBAEC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAU,gBAAG,CAAC,CAAC;gBACnC,CAAC;gBAED,iCAAI,GAAJ,UAAc,IAAQ;oBAErB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAU,iBAAI,EAAE,IAAI,CAAC,CAAC;gBAC1C,CAAC;gBAED,sCAAQ,GAAR;oBAEC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAU,mBAAM,CAAC,CAAC;gBACtC,CAAC;gBAEF,yBAAC;YAAD,CAAC,AA3ED,CAAgD,wBAAc,GA2E7D;YA3ED,wCA2EC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Observable/ObservableBase.d.ts b/dist/system/System/Observable/ObservableBase.d.ts new file mode 100644 index 00000000..050d9f79 --- /dev/null +++ b/dist/system/System/Observable/ObservableBase.d.ts @@ -0,0 +1,15 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +import SubscribableBase from "./SubscribableBase"; +declare abstract class ObservableBase extends SubscribableBase> implements IObservable { + protected _onNext(value: T): void; + protected _onError(error: Error): void; + protected _onCompleted(): void; +} +export default ObservableBase; diff --git a/dist/system/System/Observable/ObservableBase.js b/dist/system/System/Observable/ObservableBase.js new file mode 100644 index 00000000..88918992 --- /dev/null +++ b/dist/system/System/Observable/ObservableBase.js @@ -0,0 +1,67 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +System.register(["./SubscribableBase"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var SubscribableBase_1; + var ObservableBase, OBSERVER_ERROR_MESSAGE; + function processAction(observers, handler) { + var observersErrors = null; + for (var _i = 0, observers_1 = observers; _i < observers_1.length; _i++) { + var s = observers_1[_i]; + try { + handler(s); + } + catch (ex) { + observersErrors = observersErrors || []; + observersErrors.push({ observer: s, ex: ex }); + } + } + observers.length = 0; + if (observersErrors && observersErrors.length) { + if (console && console.error) + console.error(OBSERVER_ERROR_MESSAGE, observersErrors); + else + throw { + message: OBSERVER_ERROR_MESSAGE, + errors: observersErrors + }; + } + } + return { + setters:[ + function (SubscribableBase_1_1) { + SubscribableBase_1 = SubscribableBase_1_1; + }], + execute: function() { + ObservableBase = (function (_super) { + __extends(ObservableBase, _super); + function ObservableBase() { + _super.apply(this, arguments); + } + ObservableBase.prototype._onNext = function (value) { + processAction(this._getSubscribers(), function (s) { s.onNext && s.onNext(value); }); + }; + ObservableBase.prototype._onError = function (error) { + processAction(this._getSubscribers(), function (s) { s.onError && s.onError(error); }); + }; + ObservableBase.prototype._onCompleted = function () { + processAction(this._unsubscribeAll(true), function (s) { s.onCompleted && s.onCompleted(); }); + }; + return ObservableBase; + }(SubscribableBase_1.default)); + OBSERVER_ERROR_MESSAGE = 'One or more observers had errors when attempting to pass information.'; + exports_1("default",ObservableBase); + } + } +}); +//# sourceMappingURL=ObservableBase.js.map \ No newline at end of file diff --git a/dist/system/System/Observable/ObservableBase.js.map b/dist/system/System/Observable/ObservableBase.js.map new file mode 100644 index 00000000..f882f617 --- /dev/null +++ b/dist/system/System/Observable/ObservableBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ObservableBase.js","sourceRoot":"","sources":["../../../../source/System/Observable/ObservableBase.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;IAIH,YAAY,CAAC;;;;;;;;wBAoCP,sB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CAAC,CAAC,CAAC,CAAC,CACvC,CAAC;gBACH,CAAC;gBAES,qCAAY,GAAtB;oBAEC,aAAa,CACZ,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAC1B,UAAA,CAAC,IAAM,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAC1C,CAAC;gBACH,CAAC;gBACF,qBAAC;YAAD,CAAC,AA5BD,CACQ,0BAAgB,GA2BvB;YAEK,sBAAsB,GAAU,uEAAuE,CAAC;YAoC9G,oBAAe,cAAc,EAAC"} \ No newline at end of file diff --git a/dist/system/System/Observable/ObservableNodeBase.d.ts b/dist/system/System/Observable/ObservableNodeBase.d.ts new file mode 100644 index 00000000..420a0dbc --- /dev/null +++ b/dist/system/System/Observable/ObservableNodeBase.d.ts @@ -0,0 +1,14 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +import ObservableBase from "./ObservableBase"; +export default class ObservableNodeBase extends ObservableBase implements IObserver { + onNext(value: T): void; + onError(error: Error): void; + onCompleted(): void; +} diff --git a/dist/system/System/Observable/ObservableNodeBase.js b/dist/system/System/Observable/ObservableNodeBase.js new file mode 100644 index 00000000..c410176e --- /dev/null +++ b/dist/system/System/Observable/ObservableNodeBase.js @@ -0,0 +1,43 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +System.register(["./ObservableBase"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ObservableBase_1; + var ObservableNodeBase; + return { + setters:[ + function (ObservableBase_1_1) { + ObservableBase_1 = ObservableBase_1_1; + }], + execute: function() { + ObservableNodeBase = (function (_super) { + __extends(ObservableNodeBase, _super); + function ObservableNodeBase() { + _super.apply(this, arguments); + } + ObservableNodeBase.prototype.onNext = function (value) { + this._onNext(value); + }; + ObservableNodeBase.prototype.onError = function (error) { + this._onError(error); + }; + ObservableNodeBase.prototype.onCompleted = function () { + this._onCompleted(); + }; + return ObservableNodeBase; + }(ObservableBase_1.default)); + exports_1("default", ObservableNodeBase); + } + } +}); +//# sourceMappingURL=ObservableNodeBase.js.map \ No newline at end of file diff --git a/dist/system/System/Observable/ObservableNodeBase.js.map b/dist/system/System/Observable/ObservableNodeBase.js.map new file mode 100644 index 00000000..dae82c03 --- /dev/null +++ b/dist/system/System/Observable/ObservableNodeBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ObservableNodeBase.js","sourceRoot":"","sources":["../../../../source/System/Observable/ObservableNodeBase.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;IAIH,YAAY,CAAC;;;;;;;;;;;;;;;YAKb;gBAEQ,sCAAiB;gBAFzB;oBAEQ,8BAAiB;gBAkBzB,CAAC;gBAdA,mCAAM,GAAN,UAAO,KAAO;oBAEb,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBACrB,CAAC;gBAED,oCAAO,GAAP,UAAQ,KAAW;oBAElB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;gBACtB,CAAC;gBAED,wCAAW,GAAX;oBAEC,IAAI,CAAC,YAAY,EAAE,CAAC;gBACrB,CAAC;gBACF,yBAAC;YAAD,CAAC,AApBD,CAEQ,wBAAc,GAkBrB;YApBD,wCAoBC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Observable/SubscribableBase.d.ts b/dist/system/System/Observable/SubscribableBase.d.ts new file mode 100644 index 00000000..5de54bfc --- /dev/null +++ b/dist/system/System/Observable/SubscribableBase.d.ts @@ -0,0 +1,19 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +export default class SubscribableBase implements IDisposable { + private __subscriptions; + protected _getSubscribers(): TSubscriber[]; + constructor(); + private _findEntryNode(subscriber); + subscribe(subscriber: TSubscriber): IDisposable; + unsubscribe(subscriber: TSubscriber): void; + protected _unsubscribeAll(returnSubscribers?: boolean): TSubscriber[]; + unsubscribeAll(): void; + dispose(): void; +} diff --git a/dist/system/System/Observable/SubscribableBase.js b/dist/system/System/Observable/SubscribableBase.js new file mode 100644 index 00000000..4ec0a692 --- /dev/null +++ b/dist/system/System/Observable/SubscribableBase.js @@ -0,0 +1,78 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +System.register(["../Collections/LinkedNodeList", "../Disposable/dispose", "./Subscription"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var LinkedNodeList_1, dispose_1, Subscription_1; + var SubscribableBase; + return { + setters:[ + function (LinkedNodeList_1_1) { + LinkedNodeList_1 = LinkedNodeList_1_1; + }, + function (dispose_1_1) { + dispose_1 = dispose_1_1; + }, + function (Subscription_1_1) { + Subscription_1 = Subscription_1_1; + }], + execute: function() { + SubscribableBase = (function () { + function SubscribableBase() { + this.__subscriptions + = new LinkedNodeList_1.default(); + } + SubscribableBase.prototype._getSubscribers = function () { + return this + .__subscriptions + .map(function (node) { return node.value && node.value.subscriber; }); + }; + SubscribableBase.prototype._findEntryNode = function (subscriber) { + return this + .__subscriptions + .find(function (n) { return n.value.subscriber === subscriber; }); + }; + SubscribableBase.prototype.subscribe = function (subscriber) { + var _ = this; + var n = _._findEntryNode(subscriber); + if (n) + return n.value; + var s = new Subscription_1.default(_, subscriber); + _.__subscriptions.addNode({ value: s }); + return s; + }; + SubscribableBase.prototype.unsubscribe = function (subscriber) { + var _ = this; + var n = _._findEntryNode(subscriber); + if (n) { + var s = n.value; + _.__subscriptions.removeNode(n); + s.dispose(); + } + }; + SubscribableBase.prototype._unsubscribeAll = function (returnSubscribers) { + if (returnSubscribers === void 0) { returnSubscribers = false; } + var _ = this, _s = _.__subscriptions; + var s = _s.map(function (n) { return n.value; }); + var u = returnSubscribers ? s.map(function (o) { return o.subscriber; }) : null; + _s.clear(); + dispose_1.default.these(s); + return u; + }; + SubscribableBase.prototype.unsubscribeAll = function () { + this._unsubscribeAll(); + }; + SubscribableBase.prototype.dispose = function () { + this._unsubscribeAll(); + }; + return SubscribableBase; + }()); + exports_1("default", SubscribableBase); + } + } +}); +//# sourceMappingURL=SubscribableBase.js.map \ No newline at end of file diff --git a/dist/system/System/Observable/SubscribableBase.js.map b/dist/system/System/Observable/SubscribableBase.js.map new file mode 100644 index 00000000..47d303b1 --- /dev/null +++ b/dist/system/System/Observable/SubscribableBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SubscribableBase.js","sourceRoot":"","sources":["../../../../source/System/Observable/SubscribableBase.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;IAIH,YAAY,CAAC;;;;;;;;;;;;;;;;YAQb;gBAeC;oBAEC,IAAI,CAAC,eAAe;0BACjB,IAAI,wBAAc,EAAmD,CAAC;gBAC1E,CAAC;gBAXS,0CAAe,GAAzB;oBAEC,MAAM,CAAC,IAAI;yBACT,eAAe;yBACf,GAAG,CAAC,UAAA,IAAI,IAAE,OAAA,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,EAAnC,CAAmC,CAAC,CAAC;gBAClD,CAAC;gBAQO,yCAAc,GAAtB,UACC,UAAsB;oBAEtB,MAAM,CAAC,IAAI;yBACT,eAAe;yBACf,IAAI,C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E,OAAA,CAAC,CAAC,UAAU,EAAZ,CAAY,CAAC,GAAG,IAAI,CAAC;oBAC1D,EAAE,CAAC,KAAK,EAAE,CAAC;oBAEX,iBAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;oBAEjB,MAAM,CAAC,CAAC,CAAC;gBACV,CAAC;gBAED,yCAAc,GAAd;oBAEC,IAAI,CAAC,eAAe,EAAE,CAAC;gBACxB,CAAC;gBAED,kCAAO,GAAP;oBAEC,IAAI,CAAC,eAAe,EAAE,CAAC;gBACxB,CAAC;gBAEF,uBAAC;YAAD,CAAC,AA7ED,IA6EC;YA7ED,sCA6EC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Observable/Subscription.d.ts b/dist/system/System/Observable/Subscription.d.ts new file mode 100644 index 00000000..ad70893a --- /dev/null +++ b/dist/system/System/Observable/Subscription.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +export default class Subscription implements IDisposableAware { + private _subscribable; + private _subscriber; + constructor(_subscribable: ISubscribable, _subscriber: T); + subscriber: T; + wasDisposed: boolean; + dispose(): void; +} diff --git a/dist/system/System/Observable/Subscription.js b/dist/system/System/Observable/Subscription.js new file mode 100644 index 00000000..36c5cf18 --- /dev/null +++ b/dist/system/System/Observable/Subscription.js @@ -0,0 +1,50 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +System.register([], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var Subscription; + return { + setters:[], + execute: function() { + Subscription = (function () { + function Subscription(_subscribable, _subscriber) { + this._subscribable = _subscribable; + this._subscriber = _subscriber; + if (!_subscribable || !_subscriber) + throw 'Subscribable and subscriber cannot be null.'; + } + Object.defineProperty(Subscription.prototype, "subscriber", { + get: function () { + return this._subscriber; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Subscription.prototype, "wasDisposed", { + get: function () { + return !this._subscribable || !this._subscriber; + }, + enumerable: true, + configurable: true + }); + Subscription.prototype.dispose = function () { + var subscriber = this.subscriber; + var subscribable = this._subscribable; + this._subscriber = null; + this._subscribable = null; + if (subscriber && subscribable) { + subscribable.unsubscribe(subscriber); + } + }; + return Subscription; + }()); + exports_1("default", Subscription); + } + } +}); +//# sourceMappingURL=Subscription.js.map \ No newline at end of file diff --git a/dist/system/System/Observable/Subscription.js.map b/dist/system/System/Observable/Subscription.js.map new file mode 100644 index 00000000..0ef900fc --- /dev/null +++ b/dist/system/System/Observable/Subscription.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../../../../source/System/Observable/Subscription.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;IAKH,YAAY,CAAC;;;;;;YAKb;gBAGC,sBACS,aAA+B,EAC/B,WAAc;oBADd,kBAAa,GAAb,aAAa,CAAkB;oBAC/B,gBAAW,GAAX,WAAW,CAAG;oBAEtB,EAAE,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,WAAW,CAAC;wBAClC,MAAM,6CAA6C,CAAC;gBACtD,CAAC;gBAED,sBAAI,oCAAU;yBAAd;wBACC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;oBACzB,CAAC;;;mBAAA;gBAiBD,sBAAI,qCAAW;yBAAf;wBAEC,MAAM,CAAC,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;oBACjD,CAAC;;;mBAAA;gBAED,8BAAO,GAAP;oBAEC,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;oBACjC,IAAI,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC;oBAGtC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;oBACxB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;oBAG1B,EAAE,CAAC,CAAC,UAAU,IAAI,YAAY,CAAC,CAC/B,CAAC;wBACA,YAAY,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;oBACtC,CAAC;gBACF,CAAC;gBACF,mBAAC;YAAD,CAAC,AAlDD,IAkDC;YAlDD,kCAkDC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Serialization/Utility.d.ts b/dist/system/System/Serialization/Utility.d.ts new file mode 100644 index 00000000..f53d368c --- /dev/null +++ b/dist/system/System/Serialization/Utility.d.ts @@ -0,0 +1,9 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function toString(value: Primitive | ISerializable, defaultForUnknown?: string): string; +export declare function isSerializable(instance: any): instance is ISerializable; +export declare function toPrimitive(value: string, caseInsensitive?: boolean, unknownHandler?: (v: string) => string): Primitive; diff --git a/dist/system/System/Serialization/Utility.js b/dist/system/System/Serialization/Utility.js new file mode 100644 index 00000000..28d57213 --- /dev/null +++ b/dist/system/System/Serialization/Utility.js @@ -0,0 +1,85 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(['../Types', '../Exceptions/InvalidOperationException'], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var Types_1, InvalidOperationException_1; + var EMPTY, TRUE, FALSE; + function toString(value, defaultForUnknown) { + var v = value; + switch (typeof v) { + case Types_1.default.UNDEFINED: + case Types_1.default.STRING: + return v; + case Types_1.default.BOOLEAN: + return v ? TRUE : FALSE; + case Types_1.default.NUMBER: + return EMPTY + v; + default: + if (v === null) + return v; + if (isSerializable(v)) + return v.serialize(); + else if (arguments.length > 1) + return defaultForUnknown; + var ex = new InvalidOperationException_1.default('Attempting to serialize unidentifiable type.'); + ex.data['value'] = v; + throw ex; + } + } + exports_1("toString", toString); + function isSerializable(instance) { + return Types_1.default.hasMemberOfType(instance, 'serialize', Types_1.default.FUNCTION); + } + exports_1("isSerializable", isSerializable); + function toPrimitive(value, caseInsensitive, unknownHandler) { + if (value) { + if (caseInsensitive) + value = value.toLowerCase(); + switch (value) { + case 'null': + return null; + case Types_1.default.UNDEFINED: + return undefined; + case TRUE: + return true; + case FALSE: + return false; + default: + var cleaned = value.replace(/^\s+|,|\s+$/g, EMPTY); + if (cleaned) { + if (/^\d+$/g.test(cleaned)) { + var int = parseInt(cleaned); + if (!isNaN(int)) + return int; + } + else { + var number = parseFloat(value); + if (!isNaN(number)) + return number; + } + } + if (unknownHandler) + value = unknownHandler(value); + break; + } + } + return value; + } + exports_1("toPrimitive", toPrimitive); + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }, + function (InvalidOperationException_1_1) { + InvalidOperationException_1 = InvalidOperationException_1_1; + }], + execute: function() { + EMPTY = '', TRUE = 'true', FALSE = 'false'; + } + } +}); +//# sourceMappingURL=Utility.js.map \ No newline at end of file diff --git a/dist/system/System/Serialization/Utility.js.map b/dist/system/System/Serialization/Utility.js.map new file mode 100644 index 00000000..c27ef763 --- /dev/null +++ b/dist/system/System/Serialization/Utility.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Utility.js","sourceRoot":"","sources":["../../../../source/System/Serialization/Utility.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;QASG,KAAK,EAAO,IAAI,EAAW,KAAK;IAEtC,kBACC,KAA6B,EAC7B,iBAAyB;QAGzB,IAAI,CAAC,GAAQ,KAAK,CAAC;QACnB,MAAM,CAAA,CAAC,OAAO,CAAC,CAAC,CAChB,CAAC;YACA,KAAK,eAAI,CAAC,SAAS,CAAC;YACpB,KAAK,eAAI,CAAC,MAAM;gBACf,MAAM,CAAC,CAAC,CAAC;YACV,KAAK,eAAI,CAAC,OAAO;gBAChB,MAAM,CAAC,CAAC,GAAG,I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AAc,EAAC,KAAK,CAAC,CAAC;oBAClD,EAAE,CAAA,CAAC,OAAO,CAAC,CAAC,CAAC;wBAEZ,EAAE,CAAA,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;4BAC3B,IAAI,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;4BAC5B,EAAE,CAAA,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gCAAC,MAAM,CAAC,GAAG,CAAC;wBAC5B,CAAC;wBAAC,IAAI,CAAC,CAAC;4BACP,IAAI,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;4BAC/B,EAAE,CAAA,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gCAAC,MAAM,CAAC,MAAM,CAAC;wBAClC,CAAC;oBAEF,CAAC;oBAKD,EAAE,CAAA,CAAC,cAAc,CAAC;wBAAC,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;oBAEjD,KAAK,CAAC;YACR,CAAC;QAEF,CAAC;QAED,MAAM,CAAC,KAAK,CAAC;IAEd,CAAC;IAhDD,qCAgDC,CAAA;;;;;;;;;;YAvFK,KAAK,GAAG,EAAE,EAAE,IAAI,GAAG,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC"} \ No newline at end of file diff --git a/dist/system/System/Tasks/TaskHandler.d.ts b/dist/system/System/Tasks/TaskHandler.d.ts new file mode 100644 index 00000000..750d1dd3 --- /dev/null +++ b/dist/system/System/Tasks/TaskHandler.d.ts @@ -0,0 +1,12 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TaskHandlerBase from "./TaskHandlerBase"; +export default class TaskHandler extends TaskHandlerBase { + private _action; + constructor(_action: Closure); + protected _onExecute(): void; + protected _onDispose(): void; +} diff --git a/dist/system/System/Tasks/TaskHandler.js b/dist/system/System/Tasks/TaskHandler.js new file mode 100644 index 00000000..cd164dd8 --- /dev/null +++ b/dist/system/System/Tasks/TaskHandler.js @@ -0,0 +1,45 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["./TaskHandlerBase", "../Exceptions/ArgumentNullException"], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var TaskHandlerBase_1, ArgumentNullException_1; + var TaskHandler; + return { + setters:[ + function (TaskHandlerBase_1_1) { + TaskHandlerBase_1 = TaskHandlerBase_1_1; + }, + function (ArgumentNullException_1_1) { + ArgumentNullException_1 = ArgumentNullException_1_1; + }], + execute: function() { + TaskHandler = (function (_super) { + __extends(TaskHandler, _super); + function TaskHandler(_action) { + _super.call(this); + this._action = _action; + if (!_action) + throw new ArgumentNullException_1.default('action'); + } + TaskHandler.prototype._onExecute = function () { + this._action(); + }; + TaskHandler.prototype._onDispose = function () { + _super.prototype._onDispose.call(this); + this._action = null; + }; + return TaskHandler; + }(TaskHandlerBase_1.default)); + exports_1("default", TaskHandler); + } + } +}); +//# sourceMappingURL=TaskHandler.js.map \ No newline at end of file diff --git a/dist/system/System/Tasks/TaskHandler.js.map b/dist/system/System/Tasks/TaskHandler.js.map new file mode 100644 index 00000000..cee227d0 --- /dev/null +++ b/dist/system/System/Tasks/TaskHandler.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TaskHandler.js","sourceRoot":"","sources":["../../../../source/System/Tasks/TaskHandler.ts"],"names":[],"mappings":"AACA;;;GAGG;;;;;;;;;;;;;;;;;;;;YAIH;gBAAyC,+BAAe;gBAEvD,qBAAoB,OAAe;oBAClC,iBAAO,CAAC;oBADW,YAAO,GAAP,OAAO,CAAQ;oBAElC,EAAE,CAAA,CAAC,CAAC,OAAO,CAAC;wBAAC,MAAM,IAAI,+BAAqB,CAAC,QAAQ,CAAC,CAAC;gBACxD,CAAC;gBAES,gCAAU,GAApB;oBAEC,IAAI,CAAC,OAAO,EAAE,CAAC;gBAChB,CAAC;gBAES,gCAAU,GAApB;oBAEC,gBAAK,CAAC,UAAU,WAAE,CAAC;oBACnB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;gBACrB,CAAC;gBACF,kBAAC;YAAD,CAAC,AAjBD,CAAyC,yBAAe,GAiBvD;YAjBD,iCAiBC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Tasks/TaskHandlerBase.d.ts b/dist/system/System/Tasks/TaskHandlerBase.d.ts new file mode 100644 index 00000000..c3945286 --- /dev/null +++ b/dist/system/System/Tasks/TaskHandlerBase.d.ts @@ -0,0 +1,17 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +declare abstract class TaskHandlerBase extends DisposableBase implements ICancellable { + constructor(); + protected _id: any; + isScheduled: boolean; + execute(defer?: number): void; + private static _handler(d); + protected abstract _onExecute(): void; + protected _onDispose(): void; + cancel(): boolean; +} +export default TaskHandlerBase; diff --git a/dist/system/System/Tasks/TaskHandlerBase.js b/dist/system/System/Tasks/TaskHandlerBase.js new file mode 100644 index 00000000..0359440d --- /dev/null +++ b/dist/system/System/Tasks/TaskHandlerBase.js @@ -0,0 +1,65 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../Disposable/DisposableBase"], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var DisposableBase_1; + var TaskHandlerBase; + return { + setters:[ + function (DisposableBase_1_1) { + DisposableBase_1 = DisposableBase_1_1; + }], + execute: function() { + TaskHandlerBase = (function (_super) { + __extends(TaskHandlerBase, _super); + function TaskHandlerBase() { + _super.call(this); + this._id = null; + } + Object.defineProperty(TaskHandlerBase.prototype, "isScheduled", { + get: function () { + return !!this._id; + }, + enumerable: true, + configurable: true + }); + TaskHandlerBase.prototype.execute = function (defer) { + this.cancel(); + if (isNaN(defer) || defer < 0) { + this._onExecute(); + } + else if (isFinite(defer)) { + this._id = setTimeout(TaskHandlerBase._handler, defer, this); + } + }; + TaskHandlerBase._handler = function (d) { + d.cancel(); + d._onExecute(); + }; + TaskHandlerBase.prototype._onDispose = function () { + this.cancel(); + }; + TaskHandlerBase.prototype.cancel = function () { + var id = this._id; + if (id) { + clearTimeout(id); + this._id = null; + return true; + } + return false; + }; + return TaskHandlerBase; + }(DisposableBase_1.default)); + exports_1("default",TaskHandlerBase); + } + } +}); +//# sourceMappingURL=TaskHandlerBase.js.map \ No newline at end of file diff --git a/dist/system/System/Tasks/TaskHandlerBase.js.map b/dist/system/System/Tasks/TaskHandlerBase.js.map new file mode 100644 index 00000000..9a13118c --- /dev/null +++ b/dist/system/System/Tasks/TaskHandlerBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TaskHandlerBase.js","sourceRoot":"","sources":["../../../../source/System/Tasks/TaskHandlerBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;;;;;;YAQH;gBACQ,mCAAc;gBAErB;oBAEC,iBAAO,CAAC;oBACR,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;gBACjB,CAAC;gBAID,sBAAI,wCAAW;yBAAf;wBACC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;oBACnB,CAAC;;;mBAAA;gBAOD,iCAAO,GAAP,UAAQ,KAAa;oBAEpB,IAAI,CAAC,MAAM,EAAE,CAAC;oBACd,EAAE,CAAA,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,GAAC,CAAC,CAAC,CAC3B,CAAC;wBACA,IAAI,CAAC,UAAU,EAAE,CAAC;oBACnB,CAAC;oBACD,IAAI,CAAC,EAAE,CAAA,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CACxB,CAAC;wBACA,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,eAAe,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;oBAC9D,CAAC;gBACF,CAAC;gBAGc,wBAAQ,GAAvB,UAAwB,CAAiB;oBAExC,CAAC,CAAC,MAAM,EAAE,CAAC;oBACX,CAAC,CAAC,UAAU,EAAE,CAAC;gBAChB,CAAC;gBAIS,oCAAU,GAApB;oBAEC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACf,CAAC;gBAED,gCAAM,GAAN;oBAEC,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;oBAClB,EAAE,CAAA,CAAC,EAAE,CAAC,CACN,CAAC;wBACA,YAAY,CAAC,EAAE,CAAC,CAAC;wBACjB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;wBAChB,MAAM,CAAC,IAAI,CAAC;oBACb,CAAC;oBACD,MAAM,CAAC,KAAK,CAAC;gBACd,CAAC;gBAGF,sBAAC;YAAD,CAAC,AA5DD,CACQ,wBAAc,GA2DrB;YAED,oBAAe,eAAe,EAAC"} \ No newline at end of file diff --git a/dist/system/System/Tasks/defer.d.ts b/dist/system/System/Tasks/defer.d.ts new file mode 100644 index 00000000..2b37b77f --- /dev/null +++ b/dist/system/System/Tasks/defer.d.ts @@ -0,0 +1,7 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function defer(task: Closure, delay?: number): ICancellable; +export declare function interval(task: Function, interval: number, count?: number): ICancellable; diff --git a/dist/system/System/Tasks/defer.js b/dist/system/System/Tasks/defer.js new file mode 100644 index 00000000..159aa9c3 --- /dev/null +++ b/dist/system/System/Tasks/defer.js @@ -0,0 +1,88 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register([], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var DeferBase, Defer, DeferInterval; + function defer(task, delay) { + return new Defer(task, delay); + } + exports_1("default", defer); + function interval(task, interval, count) { + if (count === void 0) { count = Infinity; } + return new DeferInterval(task, interval, count); + } + exports_1("interval", interval); + return { + setters:[], + execute: function() { + DeferBase = (function () { + function DeferBase() { + } + DeferBase.prototype.dispose = function () { + this.cancel(); + }; + return DeferBase; + }()); + Defer = (function (_super) { + __extends(Defer, _super); + function Defer(task, delay) { + _super.call(this); + if (!(delay >= 0)) + delay = 0; + this._id = setTimeout(Defer.handler, delay, task, this); + } + Defer.prototype.cancel = function () { + var id = this._id; + if (id) { + clearTimeout(id); + this._id = null; + return true; + } + return false; + }; + Defer.handler = function (task, d) { + d.cancel(); + task(); + }; + return Defer; + }(DeferBase)); + DeferInterval = (function (_super) { + __extends(DeferInterval, _super); + function DeferInterval(task, interval, _remaining) { + if (_remaining === void 0) { _remaining = Infinity; } + _super.call(this); + this._remaining = _remaining; + if (interval === null || interval === void (0)) + throw "'interval' must be a valid number."; + if (interval < 0) + throw "'interval' cannot be negative."; + this._id = setInterval(DeferInterval.handler, interval, task, this); + } + DeferInterval.prototype.cancel = function () { + var id = this._id; + if (id) { + clearInterval(id); + this._id = null; + return true; + } + return false; + }; + DeferInterval.handler = function (task, d) { + if (!(--d._remaining)) + d.cancel(); + task(); + }; + return DeferInterval; + }(DeferBase)); + } + } +}); +//# sourceMappingURL=defer.js.map \ No newline at end of file diff --git a/dist/system/System/Tasks/defer.js.map b/dist/system/System/Tasks/defer.js.map new file mode 100644 index 00000000..f4d2ae24 --- /dev/null +++ b/dist/system/System/Tasks/defer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"defer.js","sourceRoot":"","sources":["../../../../source/System/Tasks/defer.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;IAwFH,eACC,IAAY,EACZ,KAAa;QAEb,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;IALD,2BAKC,CAAA;IAED,kBACC,IAAa,EACb,QAAe,EACf,KAAuB;QAAvB,qBAAuB,GAAvB,gBAAuB;QAEvB,MAAM,CAAC,IAAI,aAAa,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IAND,+BAMC,CAAA;;;;YAjGD;gBAAA;gBAWA,CAAC;gBAJA,2BAAO,GAAP;oBAEC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACf,CAAC;gBACF,gBAAC;YAAD,CAAC,AAXD,IAWC;YAED;gBAAoB,yBAAS;gBAI5B,eAAY,IAAY,EAAE,KAAa;oBAEtC,iBAAO,CAAC;oBACR,EAAE,CAAA,CAAC,CAAC,CAAC,KAAK,IAAE,CAAC,CAAC,CAAC;wBAAC,KAAK,GAAG,CAAC,CAAC;oBAC1B,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;gBACzD,CAAC;gBAED,sBAAM,GAAN;oBAEC,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;oBAClB,EAAE,CAAA,CAAC,EAAE,CAAC,CACN,CAAC;wBACA,YAAY,CAAC,EAAE,CAAC,CAAC;wBACjB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;wBAChB,MAAM,CAAC,IAAI,CAAC;oBACb,CAAC;oBACD,MAAM,CAAC,KAAK,C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Immediate.d.ts b/dist/system/System/Tasks/deferImmediate.d.ts new file mode 100644 index 00000000..9c479d18 --- /dev/null +++ b/dist/system/System/Tasks/deferImmediate.d.ts @@ -0,0 +1,8 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on code from: https://github.com/kriskowal/q + */ +export default function deferImmediate(task: Closure): ICancellable; +export declare function runAfterDeferred(task: Closure): void; diff --git a/dist/system/System/Tasks/deferImmediate.js b/dist/system/System/Tasks/deferImmediate.js new file mode 100644 index 00000000..734862d3 --- /dev/null +++ b/dist/system/System/Tasks/deferImmediate.js @@ -0,0 +1,134 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on code from: https://github.com/kriskowal/q + */ +System.register(["../Types", "../Collections/LinkedNodeList", "../Collections/Queue"], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var Types_1, LinkedNodeList_1, Queue_1; + var requestTick, isNodeJS, flushing, immediateQueue, laterQueue, channel, requestPortTick; + function flush() { + var entry; + while (entry = immediateQueue.first) { + var task_1 = entry.task, domain = entry.domain; + immediateQueue.removeNode(entry); + if (domain) + domain.enter(); + runSingle(task_1, domain); + } + var task; + while (task = laterQueue.dequeue()) { + runSingle(task); + } + flushing = false; + } + function runSingle(task, domain) { + try { + task(); + } + catch (e) { + if (isNodeJS) { + if (domain) { + domain.exit(); + } + setTimeout(flush, 0); + if (domain) { + domain.enter(); + } + throw e; + } + else { + setTimeout(function () { + throw e; + }, 0); + } + } + if (domain) { + domain.exit(); + } + } + function requestFlush() { + if (!flushing) { + flushing = true; + requestTick(); + } + } + function deferImmediate(task) { + var _this = this; + var entry = { + task: task, + domain: isNodeJS && process['domain'] + }; + immediateQueue.addNode(entry); + requestFlush(); + return { + cancel: function () { return !!immediateQueue.removeNode(entry); }, + dispose: function () { _this.cancel(); } + }; + } + exports_1("default", deferImmediate); + function runAfterDeferred(task) { + laterQueue.enqueue(task); + requestFlush(); + } + exports_1("runAfterDeferred", runAfterDeferred); + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }, + function (LinkedNodeList_1_1) { + LinkedNodeList_1 = LinkedNodeList_1_1; + }, + function (Queue_1_1) { + Queue_1 = Queue_1_1; + }], + execute: function() { + "use strict"; + isNodeJS = false; + flushing = false; + immediateQueue = new LinkedNodeList_1.default(); + laterQueue = new Queue_1.default(); + if (Types_1.default.isObject(process) + && process.toString() === "[object process]" + && process.nextTick) { + isNodeJS = true; + requestTick = function () { + process.nextTick(flush); + }; + } + else if (typeof setImmediate === "function") { + if (typeof window !== "undefined") { + requestTick = setImmediate.bind(window, flush); + } + else { + requestTick = function () { + setImmediate(flush); + }; + } + } + else if (typeof MessageChannel !== "undefined") { + channel = new MessageChannel(); + channel.port1.onmessage = function () { + requestTick = requestPortTick; + channel.port1.onmessage = flush; + flush(); + }; + requestPortTick = function () { + channel.port2.postMessage(0); + }; + requestTick = function () { + setTimeout(flush, 0); + requestPortTick(); + }; + } + else { + requestTick = function () { + setTimeout(flush, 0); + }; + } + } + } +}); +//# sourceMappingURL=deferImmediate.js.map \ No newline at end of file diff --git a/dist/system/System/Tasks/deferImmediate.js.map b/dist/system/System/Tasks/deferImmediate.js.map new file mode 100644 index 00000000..a37da6b2 --- /dev/null +++ b/dist/system/System/Tasks/deferImmediate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"deferImmediate.js","sourceRoot":"","sources":["../../../../source/System/Tasks/deferImmediate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;QA6BC,WAAW,EACX,QAAQ,EACR,QAAQ,EA6BR,cAAc,EAGd,UAAU,EAgIT,OAAO,EASP,eAAe;IAnKpB;QAGC,IAAI,KAAqB,CAAC;QAC1B,OAAM,KAAK,GAAG,cAAc,CAAC,KAAK,EAClC,CAAC;YACK,uBAAI,EAAE,qBAAM,CAAU;YAC3B,c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AAC;oBACA,WAAW,GAAG;wBAEb,YAAY,CAAC,KAAK,CAAC,CAAC;oBACrB,CAAC,CAAC;gBACH,CAAC;YAEF,CAAC;YACD,IAAI,CAAC,EAAE,CAAA,CAAC,OAAO,cAAc,KAAG,WAAW,CAAC,CAC5C,CAAC;gBAGI,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;gBAGnC,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG;oBAEzB,WAAW,GAAG,eAAe,CAAC;oBAC9B,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC;oBAChC,KAAK,EAAE,CAAC;gBACT,CAAC,CAAC;gBACE,eAAe,GAAG;oBAIrB,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBAC9B,CAAC,CAAC;gBACF,WAAW,GAAG;oBAEb,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;oBACrB,eAAe,EAAE,CAAC;gBACnB,CAAC,CAAC;YAEH,CAAC;YACD,IAAI,CACJ,CAAC;gBAEA,WAAW,GAAG;oBAEb,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBACtB,CAAC,CAAC;YACH,CAAC"} \ No newline at end of file diff --git a/dist/system/System/Text/RegexMatchEnumerator.d.ts b/dist/system/System/Text/RegexMatchEnumerator.d.ts new file mode 100644 index 00000000..90c0d0d9 --- /dev/null +++ b/dist/system/System/Text/RegexMatchEnumerator.d.ts @@ -0,0 +1,14 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import { Regex, Match } from "./RegularExpressions"; +export declare class RegexMatchEnumerator { + private _pattern; + constructor(pattern: string | RegExp | Regex); + matches(input: string): IEnumerator; + static matches(input: string, pattern: string | RegExp | Regex): IEnumerator; +} +declare var _default: typeof RegexMatchEnumerator.matches; +export default _default; diff --git a/dist/system/System/Text/RegexMatchEnumerator.js b/dist/system/System/Text/RegexMatchEnumerator.js new file mode 100644 index 00000000..ec675604 --- /dev/null +++ b/dist/system/System/Text/RegexMatchEnumerator.js @@ -0,0 +1,57 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["./RegularExpressions", "../Collections/Enumeration/Enumerator", "../Collections/Enumeration/EnumeratorBase"], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var RegularExpressions_1, Enumerator_1, EnumeratorBase_1; + var RegexMatchEnumerator; + return { + setters:[ + function (RegularExpressions_1_1) { + RegularExpressions_1 = RegularExpressions_1_1; + }, + function (Enumerator_1_1) { + Enumerator_1 = Enumerator_1_1; + }, + function (EnumeratorBase_1_1) { + EnumeratorBase_1 = EnumeratorBase_1_1; + }], + execute: function() { + RegexMatchEnumerator = (function () { + function RegexMatchEnumerator(pattern) { + if (pattern instanceof RegularExpressions_1.Regex) { + this._pattern = pattern; + } + else { + this._pattern = new RegularExpressions_1.Regex(pattern); + } + } + RegexMatchEnumerator.prototype.matches = function (input) { + var _this = this; + var p; + return new EnumeratorBase_1.default(function () { + p = 0; + }, function (yielder) { + var match = _this._pattern.match(input, p); + if (match.success) { + p = match.index + match.length; + return yielder.yieldReturn(match); + } + return yielder.yieldBreak(); + }); + }; + RegexMatchEnumerator.matches = function (input, pattern) { + return input && pattern + ? (new RegexMatchEnumerator(pattern)).matches(input) + : Enumerator_1.empty; + }; + return RegexMatchEnumerator; + }()); + exports_1("RegexMatchEnumerator", RegexMatchEnumerator); + exports_1("default",RegexMatchEnumerator.matches); + } + } +}); +//# sourceMappingURL=RegexMatchEnumerator.js.map \ No newline at end of file diff --git a/dist/system/System/Text/RegexMatchEnumerator.js.map b/dist/system/System/Text/RegexMatchEnumerator.js.map new file mode 100644 index 00000000..2cbe3a15 --- /dev/null +++ b/dist/system/System/Text/RegexMatchEnumerator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RegexMatch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No newline at end of file diff --git a/dist/system/System/Text/RegularExpressions.d.ts b/dist/system/System/Text/RegularExpressions.d.ts new file mode 100644 index 00000000..af3b1fbd --- /dev/null +++ b/dist/system/System/Text/RegularExpressions.d.ts @@ -0,0 +1,62 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Named groups based on: http://trentrichardson.com/2011/08/02/javascript-regexp-match-named-captures/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare module RegexOptions { + const IGNORE_CASE: string; + const I: string; + const GLOBAL: string; + const G: string; + const MULTI_LINE: string; + const M: string; + const UNICODE: string; + const U: string; + const STICKY: string; + const Y: string; + const IGNORE_PATTERN_WHITESPACE: string; + const W: string; + type Global = 'g'; + type IgnoreCase = 'i'; + type MultiLine = 'm'; + type Unicode = 'u'; + type Sticky = 'y'; + type IgnorePatternWhitespace = "w"; + type Literal = Global | IgnoreCase | MultiLine | Unicode | Sticky | IgnorePatternWhitespace; +} +export interface MatchEvaluator extends Selector { +} +export declare class Regex { + private _re; + private _keys; + constructor(pattern: string | RegExp, options?: RegexOptions.Literal | RegexOptions.Literal[], ...extra: RegexOptions.Literal[]); + match(input: string, startIndex?: number): Match; + matches(input: string): Match[]; + replace(input: string, replacement: Primitive, count?: number): string; + replace(input: string, evaluator: MatchEvaluator, count?: number): string; + isMatch(input: string): boolean; + static isMatch(input: string, pattern: string, options?: RegexOptions.Literal[]): boolean; + static replace(input: string, pattern: string, replacement: string, options?: RegexOptions.Literal[]): string; + static replace(input: string, pattern: string, evaluator: MatchEvaluator, options?: RegexOptions.Literal[]): string; +} +export declare class Capture { + value: string; + index: number; + length: number; + constructor(value?: string, index?: number); + freeze(): void; +} +export declare class Group extends Capture { + success: boolean; + constructor(value?: string, index?: number); + static Empty: Group; +} +export declare class Match extends Group { + groups: Group[]; + namedGroups: IMap; + constructor(value?: string, index?: number, groups?: Group[], namedGroups?: IMap); + freeze(): void; + static Empty: Match; +} +export default Regex; diff --git a/dist/system/System/Text/RegularExpressions.js b/dist/system/System/Text/RegularExpressions.js new file mode 100644 index 00000000..b08b76aa --- /dev/null +++ b/dist/system/System/Text/RegularExpressions.js @@ -0,0 +1,226 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Named groups based on: http://trentrichardson.com/2011/08/02/javascript-regexp-match-named-captures/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register([], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var EMPTY, UNDEFINED, _I, _G, _M, _U, _W, _Y, RegexOptions, Regex, Capture, Group, EmptyGroup, Match, EmptyMatch; + return { + setters:[], + execute: function() { + EMPTY = ""; + UNDEFINED = "undefined"; + _I = 'i', _G = 'g', _M = 'm', _U = 'u', _W = 'w', _Y = 'y'; + (function (RegexOptions) { + RegexOptions.IGNORE_CASE = _I; + RegexOptions.I = _I; + RegexOptions.GLOBAL = _G; + RegexOptions.G = _G; + RegexOptions.MULTI_LINE = _M; + RegexOptions.M = _M; + RegexOptions.UNICODE = _U; + RegexOptions.U = _U; + RegexOptions.STICKY = _Y; + RegexOptions.Y = _Y; + RegexOptions.IGNORE_PATTERN_WHITESPACE = _W; + RegexOptions.W = _W; + })(RegexOptions = RegexOptions || (RegexOptions = {})); + exports_1("RegexOptions", RegexOptions); + Regex = (function () { + function Regex(pattern, options) { + var extra = []; + for (var _i = 2; _i < arguments.length; _i++) { + extra[_i - 2] = arguments[_i]; + } + if (!pattern) + throw new Error("'pattern' cannot be null or empty."); + var patternString, flags = (options && (Array.isArray(options) ? options : [options]).concat(extra) || extra) + .join(EMPTY).toLowerCase(); + if (pattern instanceof RegExp) { + var p = pattern; + if (p.ignoreCase && flags.indexOf(_I) === -1) + flags += _I; + if (p.multiline && flags.indexOf(_M) === -1) + flags += _M; + patternString = p.source; + } + else { + patternString = pattern; + } + var ignoreWhiteSpace = flags.indexOf(_W) != -1; + flags = flags.replace(/[gw]/g, EMPTY); + var keys = []; + { + var k = patternString.match(/(?!\(\?<)(\w+)(?=>)/g); + if (k) { + for (var i = 0, len = k.length; i < len; i++) { + keys[i + 1] = k[i]; + } + patternString = patternString.replace(/\?<\w+>/g, EMPTY); + this._keys = keys; + } + if (ignoreWhiteSpace) + patternString = patternString.replace(/\s+/g, "\\s*"); + this._re = new RegExp(patternString, flags); + } + Object.freeze(this); + } + Regex.prototype.match = function (input, startIndex) { + if (startIndex === void 0) { startIndex = 0; } + var _ = this; + var r; + if (!input + || startIndex >= input.length + || !(r = this._re.exec(input.substring(startIndex)))) + return Match.Empty; + if (!(startIndex > 0)) + startIndex = 0; + var first = startIndex + r.index, loc = first, groups = [], groupMap = {}; + for (var i = 0, len = r.length; i < len; ++i) { + var text = r[i]; + var g = EmptyGroup; + if (text !== null || text !== void 0) { + g = new Group(text, loc); + g.freeze(); + } + if (i && _._keys && i < _._keys.length) + groupMap[_._keys[i]] = g; + groups.push(g); + if (i !== 0) + loc += text.length; + } + var m = new Match(r[0], first, groups, groupMap); + m.freeze(); + return m; + }; + Regex.prototype.matches = function (input) { + var matches = [], m, p = 0, end = input && input.length || 0; + while (p < end && (m = this.match(input, p)) && m.success) { + matches.push(m); + p = m.index + m.length; + } + return Object.freeze(matches); + }; + Regex.prototype.replace = function (input, r, count) { + if (count === void 0) { count = Infinity; } + if (!input || r === null || r === void 0 || !(count > 0)) + return input; + var result = []; + var p = 0, end = input.length, isEvaluator = typeof r == "function"; + var m, i = 0; + while (i < count && p < end && (m = this.match(input, p)) && m.success) { + var index = m.index, length_1 = m.length; + if (p !== index) + result.push(input.substring(p, index)); + result.push(isEvaluator ? r(m, i++) : r); + p = index + length_1; + } + if (p < end) + result.push(input.substring(p)); + return result.join(EMPTY); + }; + Regex.prototype.isMatch = function (input) { + return this._re.test(input); + }; + Regex.isMatch = function (input, pattern, options) { + var r = new Regex(pattern, options); + return r.isMatch(input); + }; + Regex.replace = function (input, pattern, e, options) { + var r = new Regex(pattern, options); + return r.replace(input, e); + }; + return Regex; + }()); + exports_1("Regex", Regex); + Capture = (function () { + function Capture(value, index) { + if (value === void 0) { value = EMPTY; } + if (index === void 0) { index = -1; } + this.value = value; + this.index = index; + } + Object.defineProperty(Capture.prototype, "length", { + get: function () { + var v = this.value; + return v && v.length || 0; + }, + enumerable: true, + configurable: true + }); + Capture.prototype.freeze = function () { + Object.freeze(this); + }; + return Capture; + }()); + exports_1("Capture", Capture); + Group = (function (_super) { + __extends(Group, _super); + function Group(value, index) { + if (value === void 0) { value = EMPTY; } + if (index === void 0) { index = -1; } + _super.call(this, value, index); + } + Object.defineProperty(Group.prototype, "success", { + get: function () { + return this.index != -1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Group, "Empty", { + get: function () { + return EmptyGroup; + }, + enumerable: true, + configurable: true + }); + return Group; + }(Capture)); + exports_1("Group", Group); + EmptyGroup = new Group(); + EmptyGroup.freeze(); + Match = (function (_super) { + __extends(Match, _super); + function Match(value, index, groups, namedGroups) { + if (value === void 0) { value = EMPTY; } + if (index === void 0) { index = -1; } + if (groups === void 0) { groups = []; } + if (namedGroups === void 0) { namedGroups = {}; } + _super.call(this, value, index); + this.groups = groups; + this.namedGroups = namedGroups; + } + Match.prototype.freeze = function () { + if (!this.groups) + throw new Error("'groups' cannot be null."); + if (!this.namedGroups) + throw new Error("'groupMap' cannot be null."); + Object.freeze(this.groups.slice()); + Object.freeze(this.namedGroups); + _super.prototype.freeze.call(this); + }; + Object.defineProperty(Match, "Empty", { + get: function () { + return EmptyMatch; + }, + enumerable: true, + configurable: true + }); + return Match; + }(Group)); + exports_1("Match", Match); + EmptyMatch = new Match(); + EmptyMatch.freeze(); + exports_1("default",Regex); + } + } +}); +//# sourceMappingURL=RegularExpressions.js.map \ No newline at end of file diff --git a/dist/system/System/Text/RegularExpressions.js.map b/dist/system/System/Text/RegularExpressions.js.map new file mode 100644 index 00000000..eb74105f --- /dev/null +++ b/dist/system/System/Text/RegularExpressions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"RegularExpressions.js","sourceRoot":"","sources":["../../../../source/System/Text/RegularExpressions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;;;QAOG,KAAK,EACL,SAAS,EACT,EAAE,EAAQ,EAAE,EAAQ,EAAE,EAAQ,EAAE,EAAQ,EAAE,EAAQ,EAAE,uCAoRpD,UAAU,SA6BV,UAAU;;;;YAnTV,KAAK,GAAU,EAAE,CAAC;YAClB,SAAS,GAAU,WAAW,CAAC;YAC/B,EAAE,GAAG,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,EAAE,GAAG,GAAG,CAAC;YAMjE,WAAc,YAAY,EAC1B,CAAC;gBAIa,wBAAW,GAAU,EAAE,CAAC;gBACxB,cAAC,GAAU,EAAE,CAAC;gBAKd,mBAAM,GAAU,EAAE,CAAC;gBACnB,cAAC,GAAU,EAAE,CAAC;gBAKd,uBAAU,GAAU,EAAE,CAAC;gBACvB,cAAC,GAAU,EAAE,CAAC;gBAKd,oBAAO,GAAU,EAAE,CAAC;gBACpB,cAAC,GAAU,EAAE,CAAC;gBAKd,mBAAM,GAAU,EAAE,CAAC;gBACnB,cAAC,GAAU,EAAE,CAAC;gBAKd,sCAAyB,GAAU,EAAE,CAAC;gBACtC,cAAC,GAAU,EAAE,CAAC;YAU5B,CAAC,EA9Ca,YAAY,GAAZ,YAAY,KAAZ,YAAY,QA8CzB;oDAAA;YAMD;gBAKC,eACC,OAAqB,EACrB,OAAoD;oBACpD,eAA+B;yBAA/B,WAA+B,CAA/B,sBAA+B,CAA/B,IAA+B;wBAA/B,8BAA+B;;oBAE/B,EAAE,CAAA,CAAC,CAAC,OAAO,CAAC;wBAAC,MAAM,IAAI,K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CAAC,MAAM,WAAE,CAAC;gBAChB,CAAC;gBAED,sBAAW,cAAK;yBAAhB;wBAEC,MAAM,CAAC,UAAU,CAAC;oBACnB,CAAC;;;mBAAA;gBACF,YAAC;YAAD,CAAC,AAzBD,CAA2B,KAAK,GAyB/B;YAzBD,yBAyBC,CAAA;YACK,UAAU,GAAG,IAAI,KAAK,EAAE,CAAC;YAC/B,UAAU,CAAC,MAAM,EAAE,CAAC;YAGpB,oBAAe,KAAK,EAAC"} \ No newline at end of file diff --git a/dist/system/System/Text/StringBuilder.d.ts b/dist/system/System/Text/StringBuilder.d.ts new file mode 100644 index 00000000..72f52b4c --- /dev/null +++ b/dist/system/System/Text/StringBuilder.d.ts @@ -0,0 +1,21 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * .NET Reference: http://referencesource.microsoft.com/#mscorlib/system/text/StringBuilder.cs + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class StringBuilder implements IDisposable { + private _partArray; + private _latest; + constructor(...initial: any[]); + private appendSingle(item); + appendThese(items: any[]): StringBuilder; + append(...items: any[]): StringBuilder; + appendLine(...items: any[]): StringBuilder; + appendLines(items: any[]): StringBuilder; + isEmpty: boolean; + toString(): string; + join(delimiter: string): string; + clear(): void; + dispose(): void; +} diff --git a/dist/system/System/Text/StringBuilder.js b/dist/system/System/Text/StringBuilder.js new file mode 100644 index 00000000..5d77909c --- /dev/null +++ b/dist/system/System/Text/StringBuilder.js @@ -0,0 +1,102 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * .NET Reference: http://referencesource.microsoft.com/#mscorlib/system/text/StringBuilder.cs + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(['../Types'], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var Types_1; + var VOID0, StringBuilder; + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }], + execute: function() { + VOID0 = void 0; + StringBuilder = (function () { + function StringBuilder() { + var initial = []; + for (var _i = 0; _i < arguments.length; _i++) { + initial[_i - 0] = arguments[_i]; + } + var _ = this; + _._latest = null; + _._partArray = []; + _.appendThese(initial); + } + StringBuilder.prototype.appendSingle = function (item) { + if (item !== null && item !== VOID0) { + var _ = this; + _._latest = null; + switch (typeof item) { + case Types_1.default.OBJECT: + case Types_1.default.FUNCTION: + item = item.toString(); + break; + } + _._partArray.push(item); + } + }; + StringBuilder.prototype.appendThese = function (items) { + var _ = this; + items.forEach(function (s) { return _.appendSingle(s); }); + return _; + }; + StringBuilder.prototype.append = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i - 0] = arguments[_i]; + } + this.appendThese(items); + return this; + }; + StringBuilder.prototype.appendLine = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i - 0] = arguments[_i]; + } + this.appendLines(items); + return this; + }; + StringBuilder.prototype.appendLines = function (items) { + var _ = this; + items.forEach(function (i) { + if (i !== null && i !== VOID0) { + _.appendSingle(i); + _._partArray.push("\r\n"); + } + }); + return _; + }; + Object.defineProperty(StringBuilder.prototype, "isEmpty", { + get: function () { + return this._partArray.length === 0; + }, + enumerable: true, + configurable: true + }); + StringBuilder.prototype.toString = function () { + var latest = this._latest; + if (!latest === null) + this._latest = latest = this._partArray.join(); + return latest; + }; + StringBuilder.prototype.join = function (delimiter) { + return this._partArray.join(delimiter); + }; + StringBuilder.prototype.clear = function () { + this._partArray.length = 0; + this._latest = null; + }; + StringBuilder.prototype.dispose = function () { + this.clear(); + }; + return StringBuilder; + }()); + exports_1("default", StringBuilder); + } + } +}); +//# sourceMappingURL=StringBuilder.js.map \ No newline at end of file diff --git a/dist/system/System/Text/StringBuilder.js.map b/dist/system/System/Text/StringBuilder.js.map new file mode 100644 index 00000000..7c38798b --- /dev/null +++ b/dist/system/System/Text/StringBuilder.js.map @@ -0,0 +1 @@ +{"version":3,"file":"StringBuilder.js","sourceRoot":"","sources":["../../../../source/System/Text/String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AAG,IAAI,CAAC;gBACrB,CAAC;gBAED,+BAAO,GAAP;oBAEC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACd,CAAC;gBAEF,oBAAC;YAAD,CAAC,AA7GD,IA6GC;YA7GD,mCA6GC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Text/Utility.d.ts b/dist/system/System/Text/Utility.d.ts new file mode 100644 index 00000000..324fdfb2 --- /dev/null +++ b/dist/system/System/Text/Utility.d.ts @@ -0,0 +1,17 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare const EMPTY: string; +export declare function getHashCode(source: string): number; +export declare function repeat(source: string, count: number): string; +export declare function fromChars(ch: number, count: number): string; +export declare function fromChars(chars: number[]): string; +export declare function escapeRegExp(source: string): string; +export declare function trim(source: string, chars?: string | string[], ignoreCase?: boolean): string; +export declare function format(source: string, ...args: any[]): string; +export declare function supplant(source: string, params: { + [key: string]: any; +} | any[]): string; +export declare function startsWith(source: string, pattern: string): boolean; +export declare function endsWith(source: string, pattern: string): boolean; diff --git a/dist/system/System/Text/Utility.js b/dist/system/System/Text/Utility.js new file mode 100644 index 00000000..1a7e5276 --- /dev/null +++ b/dist/system/System/Text/Utility.js @@ -0,0 +1,122 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../Types"], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var Types_1; + var EMPTY; + function getHashCode(source) { + var hash = 0 | 0; + if (source.length == 0) + return hash; + for (var i = 0, l = source.length; i < l; i++) { + var ch = source.charCodeAt(i); + hash = ((hash << 5) - hash) + ch; + hash |= 0; + } + return hash; + } + exports_1("getHashCode", getHashCode); + function repeat(source, count) { + var result = EMPTY; + if (!isNaN(count)) { + for (var i = 0; i < count; i++) { + result += source; + } + } + return result; + } + exports_1("repeat", repeat); + function fromChars(chOrChars, count) { + if (count === void 0) { count = 1; } + if (Array.isArray(chOrChars)) { + var result = EMPTY; + for (var _i = 0, chOrChars_1 = chOrChars; _i < chOrChars_1.length; _i++) { + var char = chOrChars_1[_i]; + result += String.fromCharCode(char); + } + return result; + } + else { + return repeat(String.fromCharCode(chOrChars), count); + } + } + exports_1("fromChars", fromChars); + function escapeRegExp(source) { + return source.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + } + exports_1("escapeRegExp", escapeRegExp); + function trim(source, chars, ignoreCase) { + if (chars === EMPTY) + return source; + if (chars) { + var escaped = escapeRegExp(Array.isArray(chars) ? chars.join() : chars); + return source.replace(new RegExp('^[' + escaped + ']+|[' + escaped + ']+$', 'g' + (ignoreCase + ? 'i' + : '')), EMPTY); + } + return source.replace(/^\s+|\s+$/g, EMPTY); + } + exports_1("trim", trim); + function format(source) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + return supplant(source, args); + } + exports_1("format", format); + function supplant(source, params) { + var oIsArray = Array.isArray(params); + return source.replace(/\{([^{}]*)\}/g, function (a, b) { + var n = b; + if (oIsArray) { + var i = parseInt(b); + if (!isNaN(i)) + n = i; + } + var r = params[n]; + switch (typeof r) { + case Types_1.default.STRING: + case Types_1.default.NUMBER: + case Types_1.default.BOOLEAN: + return r; + default: + return (r && Types_1.default.hasMemberOfType(r, "toString", Types_1.default.FUNCTION)) + ? r.toString() + : a; + } + }); + } + exports_1("supplant", supplant); + function canMatch(source, match) { + if (!Types_1.default.isString(source) || !match) + return false; + if (source === match) + return true; + if (match.length < source.length) + return null; + } + function startsWith(source, pattern) { + var m = canMatch(source, pattern); + return Types_1.default.isBoolean(m) ? m : source.indexOf(pattern) == 0; + } + exports_1("startsWith", startsWith); + function endsWith(source, pattern) { + var m = canMatch(source, pattern); + return Types_1.default.isBoolean(m) ? m : source.lastIndexOf(pattern) == (source.length - pattern.length); + } + exports_1("endsWith", endsWith); + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }], + execute: function() { + exports_1("EMPTY", EMPTY = ''); + } + } +}); +//# sourceMappingURL=Utility.js.map \ No newline at end of file diff --git a/dist/system/System/Text/Utility.js.map b/dist/system/System/Text/Utility.js.map new file mode 100644 index 00000000..4d556da1 --- /dev/null +++ b/dist/system/System/Text/Utility.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Utility.js","sourceRoot":"","sources":["../../../../source/System/Text/Utility.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;QAIU,KAAK;IAOlB,qBAA4B,MAAa;QAExC,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,EAAE,CAAA,CAAC,MAAM,CAAC,MAAM,IAAE,CAAC,CAAC;YAAC,MAAM,CAAC,IAAI,CAAC;QACjC,GAAG,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAC,CAAC,EAAE,CAAC,EAAE,EAC1C,CAAC;YACA,IAAI,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAC9B,IAAI,GAAG,CAAC,CAAC,IAAI,IAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAC/B,IAAI,IAAI,CAAC,CAAC;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC;IACb,CAAC;IAXD,qCAWC,CAAA;IAED,gBAAuB,MAAa,EAAE,KAAY;QAEjD,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,EAAE,CAAA,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CACjB,CAAC;YACA,GAAG,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAC,KAAK,EAAE,CAAC,EAAE,EAC3B,CAAC;gBACA,MAAM,IAAI,MAAM,CAAC;YAClB,CAAC;QACF,CAAC;QACD,MAAM,CAAC,MAAM,CAAC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AAC,eAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;YAAC,MAAM,CAAC,KAAK,CAAC;QAClD,EAAE,CAAA,CAAC,MAAM,KAAG,KAAK,CAAC;YAAC,MAAM,CAAC,IAAI,CAAC;QAC/B,EAAE,CAAA,CAAC,KAAK,CAAC,MAAM,GAAC,MAAM,CAAC,MAAM,CAAC;YAAC,MAAM,CAAC,IAAI,CAAC;IAC5C,CAAC;IAQD,oBAA2B,MAAa,EAAE,OAAc;QAEvD,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAC,OAAO,CAAC,CAAC;QACjC,MAAM,CAAC,eAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAE,CAAC,CAAC;IAC3D,CAAC;IAJD,mCAIC,CAAA;IAQD,kBAAyB,MAAa,EAAE,OAAc;QAErD,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAC,OAAO,CAAC,CAAC;QACjC,MAAM,CAAC,eAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,IAAE,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9F,CAAC;IAJD,+BAIC,CAAA;;;;;;;YApKY,mBAAA,KAAK,GAAU,EAAE,CAAA,CAAC"} \ No newline at end of file diff --git a/dist/system/System/Time/ClockTime.d.ts b/dist/system/System/Time/ClockTime.d.ts new file mode 100644 index 00000000..97a20646 --- /dev/null +++ b/dist/system/System/Time/ClockTime.d.ts @@ -0,0 +1,22 @@ +/// +/// +/// +/// +/// +/// +/// +/// +import TimeQuantity from './TimeQuantity'; +export default class ClockTime extends TimeQuantity implements IClockTime { + days: number; + hour: number; + minute: number; + second: number; + millisecond: number; + tick: number; + constructor(milliseconds: number); + constructor(hours: number, minutes: number, seconds?: number, milliseconds?: number); + static from(hours: number, minutes: number, seconds?: number, milliseconds?: number): ClockTime; + static millisecondsFromTime(hours: number, minutes: number, seconds?: number, milliseconds?: number): number; + toString(): string; +} diff --git a/dist/system/System/Time/ClockTime.js b/dist/system/System/Time/ClockTime.js new file mode 100644 index 00000000..023820a5 --- /dev/null +++ b/dist/system/System/Time/ClockTime.js @@ -0,0 +1,84 @@ +System.register(['./TimeQuantity'], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var TimeQuantity_1; + var ClockTime; + function pluralize(value, label) { + if (Math.abs(value) !== 1) + label += "s"; + return label; + } + return { + setters:[ + function (TimeQuantity_1_1) { + TimeQuantity_1 = TimeQuantity_1_1; + }], + execute: function() { + ClockTime = (function (_super) { + __extends(ClockTime, _super); + function ClockTime() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + _super.call(this, args.length > 1 + ? ClockTime.millisecondsFromTime(args[0] || 0, args[1] || 0, args.length > 2 && args[2] || 0, args.length > 3 && args[3] || 0) + : (args.length > 0 && args[0] || 0)); + var _ = this; + var ms = Math.abs(_.getTotalMilliseconds()); + var msi = Math.floor(ms); + _.tick = (ms - msi) * 10000; + _.days = (msi / 86400000) | 0; + msi -= _.days * 86400000; + _.hour = (msi / 3600000) | 0; + msi -= _.hour * 3600000; + _.minute = (msi / 60000) | 0; + msi -= _.minute * 60000; + _.second = (msi / 1000) | 0; + msi -= _.second * 1000; + _.millisecond = msi; + Object.freeze(_); + } + ClockTime.from = function (hours, minutes, seconds, milliseconds) { + if (seconds === void 0) { seconds = 0; } + if (milliseconds === void 0) { milliseconds = 0; } + return new ClockTime(hours, minutes, seconds, milliseconds); + }; + ClockTime.millisecondsFromTime = function (hours, minutes, seconds, milliseconds) { + if (seconds === void 0) { seconds = 0; } + if (milliseconds === void 0) { milliseconds = 0; } + var value = hours; + value *= 60; + value += minutes; + value *= 60; + value += seconds; + value *= 1000; + value += milliseconds; + return value; + }; + ClockTime.prototype.toString = function () { + var _ = this, a = []; + if (_.days) + a.push(pluralize(_.days, "day")); + if (_.hour) + a.push(pluralize(_.hour, "hour")); + if (_.minute) + a.push(pluralize(_.minute, "minute")); + if (_.second) + a.push(pluralize(_.second, "second")); + if (a.length > 1) + a.splice(a.length - 1, 0, "and"); + return a.join(", ").replace(", and, ", " and "); + }; + return ClockTime; + }(TimeQuantity_1.default)); + exports_1("default", ClockTime); + } + } +}); +//# sourceMappingURL=ClockTime.js.map \ No newline at end of file diff --git a/dist/system/System/Time/ClockTime.js.map b/dist/system/System/Time/ClockTime.js.map new file mode 100644 index 00000000..4e9e67e4 --- /dev/null +++ b/dist/system/System/Time/ClockTime.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ClockTime.js","sourceRoot":"","sources":["../../../../source/System/Time/ClockTime.ts"],"names":[],"mappings":";IAaA,YAAY,CAAC;;;;;;;;;IA2Gb,mBAAmB,KAAY,EAAE,KAAY;QAE5C,EAAE,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAG,CAAC,CAAC;YACtB,KAAK,IAAI,GAAG,CAAC;QAEd,MAAM,CAAC,KAAK,CAAC;IACd,CAAC;;;;;;;YA3GD;gBACwB,6BAAY;gBAYnC;oBAAY,cAAgB;yBAAhB,WAAgB,CAAhB,sBAAgB,CAAhB,IAAgB;wBAAhB,6BAAgB;;oBAE3B,kBACC,IAAI,CAAC,MAAM,GAAC,CAAC;0BACV,SAAS,CAAC,oBAAoB,CAChC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EACZ,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EACZ,IAAI,CAAC,MAAM,GAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAC7B,IAA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wBACb,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;oBAElC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;gBACjD,CAAC;gBAEF,gBAAC;YAAD,CAAC,AAjGD,CACwB,sBAAY,GAgGnC;YAjGD,+BAiGC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Time/DateTime.d.ts b/dist/system/System/Time/DateTime.d.ts new file mode 100644 index 00000000..88241a62 --- /dev/null +++ b/dist/system/System/Time/DateTime.d.ts @@ -0,0 +1,57 @@ +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based on .NET DateTime's interface. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ClockTime from './ClockTime'; +import TimeSpan from './TimeSpan'; +declare class DateTime implements ICalendarDate, IDateTime { + private _value; + toJsDate(): Date; + private _setJsDate(value); + constructor(); + constructor(dateString: string, kind?: DateTime.Kind); + constructor(milliseconds: number, kind?: DateTime.Kind); + constructor(source: Date, kind?: DateTime.Kind); + constructor(source: DateTime, kind?: DateTime.Kind); + private _kind; + kind: DateTime.Kind; + year: number; + month: Gregorian.Month; + day: number; + dayOfWeek: Gregorian.DayOfWeek; + addMilliseconds(ms: number): DateTime; + addSeconds(seconds: number): DateTime; + addMinutes(minutes: number): DateTime; + addHours(hours: number): DateTime; + addDays(days: number): DateTime; + addMonths(months: number): DateTime; + addYears(years: number): DateTime; + add(time: ITimeQuantity): DateTime; + subtract(time: ITimeQuantity): DateTime; + timePassedSince(previous: Date | DateTime): TimeSpan; + date: DateTime; + private _time; + timeOfDay: ClockTime; + toTimeStamp(): ITimeStamp; + static now: DateTime; + toUniversalTime: DateTime; + static today: DateTime; + static tomorrow: DateTime; + static between(first: Date | DateTime, last: Date | DateTime): TimeSpan; + static isLeapYear(year: number): boolean; + static daysInMonth(year: number, month: Gregorian.Month): number; +} +declare module DateTime { + const enum Kind { + Unspecified = 0, + Local = 1, + Utc = 2, + } +} +export default DateTime; diff --git a/dist/system/System/Time/DateTime.js b/dist/system/System/Time/DateTime.js new file mode 100644 index 00000000..c9dffd82 --- /dev/null +++ b/dist/system/System/Time/DateTime.js @@ -0,0 +1,194 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Based on .NET DateTime's interface. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(['./ClockTime', './TimeSpan', './TimeStamp'], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var ClockTime_1, TimeSpan_1, TimeStamp_1; + var DateTime; + return { + setters:[ + function (ClockTime_1_1) { + ClockTime_1 = ClockTime_1_1; + }, + function (TimeSpan_1_1) { + TimeSpan_1 = TimeSpan_1_1; + }, + function (TimeStamp_1_1) { + TimeStamp_1 = TimeStamp_1_1; + }], + execute: function() { + DateTime = (function () { + function DateTime(value, kind) { + if (value === void 0) { value = new Date(); } + if (kind === void 0) { kind = 1; } + var _ = this; + _._kind = kind; + if (value instanceof DateTime) + _._value = value.toJsDate(); + else if (value instanceof Date) + _._setJsDate(value); + else + _._value = value === void (0) + ? new Date() + : new Date(value); + } + DateTime.prototype.toJsDate = function () { + return new Date(this._value.getTime()); + }; + DateTime.prototype._setJsDate = function (value) { + this._time = null; + this._value = new Date(value.getTime()); + }; + Object.defineProperty(DateTime.prototype, "kind", { + get: function () { + return this._kind; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateTime.prototype, "year", { + get: function () { + return this._value.getFullYear(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateTime.prototype, "month", { + get: function () { + return this._value.getMonth(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateTime.prototype, "day", { + get: function () { + return this._value.getDate(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateTime.prototype, "dayOfWeek", { + get: function () { + return this._value.getDay(); + }, + enumerable: true, + configurable: true + }); + DateTime.prototype.addMilliseconds = function (ms) { + ms = ms || 0; + return new DateTime(this._value.getTime() + ms, this._kind); + }; + DateTime.prototype.addSeconds = function (seconds) { + seconds = seconds || 0; + return this.addMilliseconds(seconds * 1000); + }; + DateTime.prototype.addMinutes = function (minutes) { + minutes = minutes || 0; + return this.addMilliseconds(minutes * 60000); + }; + DateTime.prototype.addHours = function (hours) { + hours = hours || 0; + return this.addMilliseconds(hours * 3600000); + }; + DateTime.prototype.addDays = function (days) { + days = days || 0; + return this.addMilliseconds(days * 86400000); + }; + DateTime.prototype.addMonths = function (months) { + months = months || 0; + var d = this.toJsDate(); + d.setMonth(d.getMonth() + months); + return new DateTime(d, this._kind); + }; + DateTime.prototype.addYears = function (years) { + years = years || 0; + var d = this.toJsDate(); + d.setFullYear(d.getFullYear() + years); + return new DateTime(d, this._kind); + }; + DateTime.prototype.add = function (time) { + return this.addMilliseconds(time.getTotalMilliseconds()); + }; + DateTime.prototype.subtract = function (time) { + return this.addMilliseconds(-time.getTotalMilliseconds()); + }; + DateTime.prototype.timePassedSince = function (previous) { + return DateTime.between(previous, this); + }; + Object.defineProperty(DateTime.prototype, "date", { + get: function () { + var _ = this; + return new DateTime(new Date(_.year, _.month, _.day), _._kind); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateTime.prototype, "timeOfDay", { + get: function () { + var _ = this, t = _._time; + if (!t) { + var d = this._value; + _._time = t = new ClockTime_1.default(d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds()); + } + return t; + }, + enumerable: true, + configurable: true + }); + DateTime.prototype.toTimeStamp = function () { + return TimeStamp_1.default.from(this); + }; + Object.defineProperty(DateTime, "now", { + get: function () { + return new DateTime(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateTime.prototype, "toUniversalTime", { + get: function () { + var _ = this; + if (_._kind != 1) + return new DateTime(_, _._kind); + var d = _._value; + return new DateTime(new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds()), 2); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateTime, "today", { + get: function () { + return DateTime.now.date; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateTime, "tomorrow", { + get: function () { + var today = DateTime.today; + return today.addDays(1); + }, + enumerable: true, + configurable: true + }); + DateTime.between = function (first, last) { + var f = first instanceof DateTime ? first._value : first, l = last instanceof DateTime ? last._value : last; + return new TimeSpan_1.default(f.getTime() - l.getTime()); + }; + DateTime.isLeapYear = function (year) { + return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0); + }; + DateTime.daysInMonth = function (year, month) { + return (new Date(year, month + 1, 0)).getDate(); + }; + return DateTime; + }()); + Object.freeze(DateTime); + exports_1("default",DateTime); + } + } +}); +//# sourceMappingURL=DateTime.js.map \ No newline at end of file diff --git a/dist/system/System/Time/DateTime.js.map b/dist/system/System/Time/DateTime.js.map new file mode 100644 index 00000000..be90f44d --- /dev/null +++ b/dist/system/System/Time/DateTime.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DateTime.js","sourceRoot":"","sources":["../../../../source/System/Time/DateTime.ts"],"names":[],"mappings":"AAKA;;;;GAIG;;IAEH,YAAY,CAAC;;;;;;;;;;;;;;;;YAQb;gBAoBC,kBAAY,KAAsB,EAAE,IAAwC;oBAAhE,qBAAsB,GAAtB,YAAgB,IAAI,EAAE;oBAAE,oBAAwC,GAAxC,QAAwC;oBAE3E,IAAI,CAAC,GAAG,IAAI,CAAC;oBACb,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC;oBACf,EAAE,CAAA,CAAC,KAAK,YAAY,QAAQ,CAAC;wBAC5B,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;oBAC7B,IAAI,CAAC,EAAE,CAAA,CAAC,KAAK,YAAY,IAAI,CAAC;wBAC7B,CAAC,C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AO,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;gBAChD,CAAC;gBAQM,mBAAU,GAAjB,UAAkB,IAAW;oBAC5B,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC;gBACpE,CAAC;gBAQM,oBAAW,GAAlB,UAAmB,IAAW,EAAE,KAAqB;oBAEpD,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,EAAC,KAAK,GAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;gBAC7C,CAAC;gBAGF,eAAC;YAAD,CAAC,AAtRD,IAsRC;YAYD,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAExB,oBAAe,QAAQ,EAAC"} \ No newline at end of file diff --git a/dist/system/System/Time/HowMany.d.ts b/dist/system/System/Time/HowMany.d.ts new file mode 100644 index 00000000..314a22e2 --- /dev/null +++ b/dist/system/System/Time/HowMany.d.ts @@ -0,0 +1,41 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare module HowMany { + module Hours { + const enum Per { + Day = 24, + } + } + module Minutes { + const enum Per { + Hour = 60, + Day = 1440, + } + } + module Seconds { + const enum Per { + Minute = 60, + Hour = 3600, + Day = 86400, + } + } + module Milliseconds { + const enum Per { + Second = 1000, + Minute = 60000, + Hour = 3600000, + Day = 86400000, + } + } + module Ticks { + const enum Per { + Millisecond = 10000, + Second = 10000000, + Minute = 600000000, + Hour = 36000000000, + Day = 864000000000, + } + } +} diff --git a/dist/system/System/Time/HowMany.js b/dist/system/System/Time/HowMany.js new file mode 100644 index 00000000..0ad64868 --- /dev/null +++ b/dist/system/System/Time/HowMany.js @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +//# sourceMappingURL=HowMany.js.map \ No newline at end of file diff --git a/dist/system/System/Time/HowMany.js.map b/dist/system/System/Time/HowMany.js.map new file mode 100644 index 00000000..82128061 --- /dev/null +++ b/dist/system/System/Time/HowMany.js.map @@ -0,0 +1 @@ +{"version":3,"file":"HowMany.js","sourceRoot":"","sources":["../../../../source/System/Time/HowMany.ts"],"names":[],"mappings":"AAAA;;;GAGG"} \ No newline at end of file diff --git a/dist/system/System/Time/TimeQuantity.d.ts b/dist/system/System/Time/TimeQuantity.d.ts new file mode 100644 index 00000000..77e6cb20 --- /dev/null +++ b/dist/system/System/Time/TimeQuantity.d.ts @@ -0,0 +1,20 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeUnit from './TimeUnit'; +export default class TimeQuantity implements IEquatable, IComparable, ITimeQuantity { + protected _quantity: number; + constructor(_quantity?: number); + getTotalMilliseconds(): number; + direction: number; + equals(other: ITimeQuantity): boolean; + compareTo(other: ITimeQuantity): number; + protected _total: ITimeMeasurement; + total: ITimeMeasurement; + getTotal(units: TimeUnit): number; +} diff --git a/dist/system/System/Time/TimeQuantity.js b/dist/system/System/Time/TimeQuantity.js new file mode 100644 index 00000000..db18ffa8 --- /dev/null +++ b/dist/system/System/Time/TimeQuantity.js @@ -0,0 +1,68 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(['../Compare', './TimeUnit'], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var Compare_1, TimeUnit_1; + var TimeQuantity; + return { + setters:[ + function (Compare_1_1) { + Compare_1 = Compare_1_1; + }, + function (TimeUnit_1_1) { + TimeUnit_1 = TimeUnit_1_1; + }], + execute: function() { + TimeQuantity = (function () { + function TimeQuantity(_quantity) { + if (_quantity === void 0) { _quantity = 0; } + this._quantity = _quantity; + } + TimeQuantity.prototype.getTotalMilliseconds = function () { + return this._quantity; + }; + Object.defineProperty(TimeQuantity.prototype, "direction", { + get: function () { + return Compare_1.compare(this.getTotalMilliseconds(), 0); + }, + enumerable: true, + configurable: true + }); + TimeQuantity.prototype.equals = function (other) { + return Compare_1.areEqual(this.getTotalMilliseconds(), other && other.total && other.total.milliseconds); + }; + TimeQuantity.prototype.compareTo = function (other) { + return Compare_1.compare(this.getTotalMilliseconds(), other && other.total && other.total.milliseconds); + }; + Object.defineProperty(TimeQuantity.prototype, "total", { + get: function () { + var t = this._total; + if (!t) { + var ms = this.getTotalMilliseconds(); + this._total = t = Object.freeze({ + ticks: ms * 10000, + milliseconds: ms, + seconds: ms / 1000, + minutes: ms / 60000, + hours: ms / 3600000, + days: ms / 86400000, + }); + } + return t; + }, + enumerable: true, + configurable: true + }); + TimeQuantity.prototype.getTotal = function (units) { + return TimeUnit_1.default.fromMilliseconds(this.getTotalMilliseconds(), units); + }; + return TimeQuantity; + }()); + exports_1("default", TimeQuantity); + } + } +}); +//# sourceMappingURL=TimeQuantity.js.map \ No newline at end of file diff --git a/dist/system/System/Time/TimeQuantity.js.map b/dist/system/System/Time/TimeQuantity.js.map new file mode 100644 index 00000000..4024ffa6 --- /dev/null +++ b/dist/system/System/Time/TimeQuantity.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TimeQuantity.js","sourceRoot":"","sources":["../../../../source/System/Time/TimeQuantity.ts"],"names":[],"mappings":"AAAA;;;GAGG;;IAMH,YAAY,CAAC;;;;;;;;;;;;;YAQb;gBAIC,sBAAsB,SAAoB;oBAA9B,yBAA8B,GAA9B,aAA8B;oBAApB,cAAS,GAAT,SAAS,CAAW;gBAE1C,CAAC;gBAGD,2CAAoB,GAApB;oBAEC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;gBACvB,CAAC;gBAMD,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C;YAAD,CAAC,AA/ED,IA+EC;YA/ED,kCA+EC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Time/TimeSpan.d.ts b/dist/system/System/Time/TimeSpan.d.ts new file mode 100644 index 00000000..a6d780f2 --- /dev/null +++ b/dist/system/System/Time/TimeSpan.d.ts @@ -0,0 +1,34 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Originally based upon .NET source but with many additions and improvements. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeUnit from './TimeUnit'; +import ClockTime from './ClockTime'; +import TimeQuantity from './TimeQuantity'; +export default class TimeSpan extends TimeQuantity implements ITimeMeasurement { + ticks: number; + milliseconds: number; + seconds: number; + minutes: number; + hours: number; + days: number; + constructor(value: number, units?: TimeUnit); + total: TimeSpan; + private _time; + time: ClockTime; + add(other: ITimeQuantity): TimeSpan; + addUnit(value: number, units?: TimeUnit): TimeSpan; + static from(value: number, units: TimeUnit): TimeSpan; + static fromDays(value: number): TimeSpan; + static fromHours(value: number): TimeSpan; + static fromMinutes(value: number): TimeSpan; + static fromSeconds(value: number): TimeSpan; + static fromMilliseconds(value: number): TimeSpan; + static fromTicks(value: number): TimeSpan; + static zero: TimeSpan; +} diff --git a/dist/system/System/Time/TimeSpan.js b/dist/system/System/Time/TimeSpan.js new file mode 100644 index 00000000..58153b0b --- /dev/null +++ b/dist/system/System/Time/TimeSpan.js @@ -0,0 +1,106 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Originally based upon .NET source but with many additions and improvements. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(['../Types', './TimeUnit', './ClockTime', './TimeQuantity'], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Types_1, TimeUnit_1, ClockTime_1, TimeQuantity_1; + var TimeSpan, timeSpanZero; + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }, + function (TimeUnit_1_1) { + TimeUnit_1 = TimeUnit_1_1; + }, + function (ClockTime_1_1) { + ClockTime_1 = ClockTime_1_1; + }, + function (TimeQuantity_1_1) { + TimeQuantity_1 = TimeQuantity_1_1; + }], + execute: function() { + TimeSpan = (function (_super) { + __extends(TimeSpan, _super); + function TimeSpan(value, units) { + if (units === void 0) { units = TimeUnit_1.default.Milliseconds; } + var ms = TimeUnit_1.default.toMilliseconds(value, units); + _super.call(this, ms); + var _ = this; + _.ticks = ms * 10000; + _.milliseconds = ms; + _.seconds = ms / 1000; + _.minutes = ms / 60000; + _.hours = ms / 3600000; + _.days = ms / 86400000; + } + Object.defineProperty(TimeSpan.prototype, "total", { + get: function () { + return this; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TimeSpan.prototype, "time", { + get: function () { + var _ = this, t = _._time; + if (!t) + _._time = t = new ClockTime_1.default(_.getTotalMilliseconds()); + return t; + }, + enumerable: true, + configurable: true + }); + TimeSpan.prototype.add = function (other) { + if (Types_1.default.isNumber(other)) + throw new Error("Use .addUnit(value:number,units:TimeUnit) to add a numerical value amount. Default units are milliseconds.\n" + + ".add only supports quantifiable time values (ITimeTotal)."); + return new TimeSpan(this.getTotalMilliseconds() + other.total.milliseconds); + }; + TimeSpan.prototype.addUnit = function (value, units) { + if (units === void 0) { units = TimeUnit_1.default.Milliseconds; } + return new TimeSpan(this.getTotalMilliseconds() + TimeUnit_1.default.toMilliseconds(value, units)); + }; + TimeSpan.from = function (value, units) { + return new TimeSpan(value, units); + }; + TimeSpan.fromDays = function (value) { + return new TimeSpan(value, TimeUnit_1.default.Days); + }; + TimeSpan.fromHours = function (value) { + return new TimeSpan(value, TimeUnit_1.default.Hours); + }; + TimeSpan.fromMinutes = function (value) { + return new TimeSpan(value, TimeUnit_1.default.Minutes); + }; + TimeSpan.fromSeconds = function (value) { + return new TimeSpan(value, TimeUnit_1.default.Seconds); + }; + TimeSpan.fromMilliseconds = function (value) { + return new TimeSpan(value, TimeUnit_1.default.Milliseconds); + }; + TimeSpan.fromTicks = function (value) { + return new TimeSpan(value, TimeUnit_1.default.Ticks); + }; + Object.defineProperty(TimeSpan, "zero", { + get: function () { + return timeSpanZero || (timeSpanZero = new TimeSpan(0)); + }, + enumerable: true, + configurable: true + }); + return TimeSpan; + }(TimeQuantity_1.default)); + exports_1("default", TimeSpan); + } + } +}); +//# sourceMappingURL=TimeSpan.js.map \ No newline at end of file diff --git a/dist/system/System/Time/TimeSpan.js.map b/dist/system/System/Time/TimeSpan.js.map new file mode 100644 index 00000000..368f0859 --- /dev/null +++ b/dist/system/System/Time/TimeSpan.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TimeSpan.js","sourceRoot":"","sources":["../../../../source/System/Time/TimeSpan.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;IAMH,YAAY,CAAC;;;;;;;;kBAmHT,YAAY;;;;;;;;;;;;;;;;YAxGhB;gBACuB,4BAAY;gBAWlC,kBAAY,KAAY,EAAE,KAAsC;oBAAtC,qBAAsC,GAAtC,QAAiB,kBAAQ,CAAC,YAAY;oBAE/D,IAAI,EAAE,GAAG,kBAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;oBAC/C,kBAAM,EAAE,CAAC,CAAC;oBAEV,IAAI,CAAC,GAAG,IAAI,CAAC;oBACb,CAAC,CAAC,KAAK,GAAG,EAAE,GAAC,KAA6B,CAAC;oBAC3C,CAAC,CAAC,YAAY,GAAG,EAAE,CAAC;oBACpB,CAAC,CAAC,OAAO,GAAG,EAAE,GAAC,IAA+B,CAAC;oBAC/C,CAAC,CAAC,OAAO,GAAG,EAAE,GAAC,KAA+B,CAAC;oBAC/C,CAAC,CAAC,KAAK,GAAG,EAAE,GAAC,OAA6B,CAAC;oBAC3C,CAAC,CAAC,IAAI,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;gBAEM,kBAAS,GAAhB,UAAiB,KAAY;oBAE5B,MAAM,CAAC,IAAI,QAAQ,CAAC,KAAK,EAAE,kBAAQ,CAAC,KAAK,CAAC,CAAC;gBAC5C,CAAC;gBAEM,oBAAW,GAAlB,UAAmB,KAAY;oBAE9B,MAAM,CAAC,IAAI,QAAQ,CAAC,KAAK,EAAE,kBAAQ,CAAC,OAAO,CAAC,CAAC;gBAC9C,CAAC;gBAEM,oBAAW,GAAlB,UAAmB,KAAY;oBAE9B,MAAM,CAAC,IAAI,QAAQ,CAAC,KAAK,EAAE,kBAAQ,CAAC,OAAO,CAAC,CAAC;gBAC9C,CAAC;gBAEM,yBAAgB,GAAvB,UAAwB,KAAY;oBAEnC,MAAM,CAAC,IAAI,QAAQ,CAAC,KAAK,EAAE,kBAAQ,CAAC,YAAY,CAAC,CAAC;gBACnD,CAAC;gBAEM,kBAAS,GAAhB,UAAiB,KAAY;oBAE5B,MAAM,CAAC,IAAI,QAAQ,CAAC,KAAK,EAAE,kBAAQ,CAAC,KAAK,CAAC,CAAC;gBAC5C,CAAC;gBAGD,sBAAW,gBAAI;yBAAf;wBAEC,MAAM,CAAC,YAAY,IAAI,CAAC,YAAY,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;oBACzD,CAAC;;;mBAAA;gBACF,eAAC;YAAD,CAAC,AArGD,CACuB,sBAAY,GAoGlC;YArGD,8BAqGC,CAAA;YAGyB"} \ No newline at end of file diff --git a/dist/system/System/Time/TimeStamp.d.ts b/dist/system/System/Time/TimeStamp.d.ts new file mode 100644 index 00000000..20096a53 --- /dev/null +++ b/dist/system/System/Time/TimeStamp.d.ts @@ -0,0 +1,21 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class TimeStamp implements ITimeStamp, IDateTime { + year: number; + month: Gregorian.Month; + day: number; + hour: number; + minute: number; + second: number; + millisecond: number; + tick: number; + constructor(year: number, month: Gregorian.Month, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, tick?: number); + toJsDate(): Date; + static from(d: Date | IDateTime): TimeStamp; +} diff --git a/dist/system/System/Time/TimeStamp.js b/dist/system/System/Time/TimeStamp.js new file mode 100644 index 00000000..3ef59fc1 --- /dev/null +++ b/dist/system/System/Time/TimeStamp.js @@ -0,0 +1,54 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(['../Types'], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var Types_1; + var TimeStamp; + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }], + execute: function() { + TimeStamp = (function () { + function TimeStamp(year, month, day, hour, minute, second, millisecond, tick) { + if (day === void 0) { day = 1; } + if (hour === void 0) { hour = 0; } + if (minute === void 0) { minute = 0; } + if (second === void 0) { second = 0; } + if (millisecond === void 0) { millisecond = 0; } + if (tick === void 0) { tick = 0; } + this.year = year; + this.month = month; + this.day = day; + this.hour = hour; + this.minute = minute; + this.second = second; + this.millisecond = millisecond; + this.tick = tick; + Object.freeze(this); + } + TimeStamp.prototype.toJsDate = function () { + var _ = this; + return new Date(_.year, _.month, _.day, _.hour, _.minute, _.second, _.millisecond + _.tick / 10000); + }; + TimeStamp.from = function (d) { + if (!(d instanceof Date) && Types_1.default.hasMember(d, 'toJsDate')) + d = d.toJsDate(); + if (d instanceof Date) { + return new TimeStamp(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds()); + } + else { + throw Error('Invalid date type.'); + } + }; + return TimeStamp; + }()); + exports_1("default", TimeStamp); + } + } +}); +//# sourceMappingURL=TimeStamp.js.map \ No newline at end of file diff --git a/dist/system/System/Time/TimeStamp.js.map b/dist/system/System/Time/TimeStamp.js.map new file mode 100644 index 00000000..e6a9afb6 --- /dev/null +++ b/dist/system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CAAC,CAAC;wBACxD,CAAC,GAAe,CAAE,CAAC,QAAQ,EAAE,CAAC;oBAC/B,EAAE,CAAA,CAAC,CAAC,YAAY,IAAI,CAAC,CACrB,CAAC;wBACA,MAAM,CAAC,IAAI,SAAS,CACnB,CAAC,CAAC,WAAW,EAAE,EACf,CAAC,CAAC,QAAQ,EAAE,EACZ,CAAC,CAAC,OAAO,EAAE,EACX,CAAC,CAAC,QAAQ,EAAE,EACZ,CAAC,CAAC,UAAU,EAAE,EACd,CAAC,CAAC,UAAU,EAAE,EACd,CAAC,CAAC,eAAe,EAAE,CACnB,CAAC;oBACH,CAAC;oBACD,IAAI,CACJ,CAAC;wBACA,MAAM,KAAK,CAAC,oBAAoB,CAAC,CAAC;oBACnC,CAAC;gBACF,CAAC;gBACF,gBAAC;YAAD,CAAC,AA/CD,IA+CC;YA/CD,+BA+CC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Time/TimeUnit.d.ts b/dist/system/System/Time/TimeUnit.d.ts new file mode 100644 index 00000000..d308bd69 --- /dev/null +++ b/dist/system/System/Time/TimeUnit.d.ts @@ -0,0 +1,22 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Originally based upon .NET source but with many additions and improvements. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare enum TimeUnit { + Ticks = 0, + Milliseconds = 1, + Seconds = 2, + Minutes = 3, + Hours = 4, + Days = 5, +} +declare module TimeUnit { + function toMilliseconds(value: number, units?: TimeUnit): number; + function fromMilliseconds(ms: number, units: TimeUnit): number; + function from(quantity: ITimeQuantity, unit: TimeUnit): number; + function assertValid(unit: TimeUnit): boolean; +} +export default TimeUnit; diff --git a/dist/system/System/Time/TimeUnit.js b/dist/system/System/Time/TimeUnit.js new file mode 100644 index 00000000..76bb0dcc --- /dev/null +++ b/dist/system/System/Time/TimeUnit.js @@ -0,0 +1,77 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Originally based upon .NET source but with many additions and improvements. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register([], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var TimeUnit; + return { + setters:[], + execute: function() { + (function (TimeUnit) { + TimeUnit[TimeUnit["Ticks"] = 0] = "Ticks"; + TimeUnit[TimeUnit["Milliseconds"] = 1] = "Milliseconds"; + TimeUnit[TimeUnit["Seconds"] = 2] = "Seconds"; + TimeUnit[TimeUnit["Minutes"] = 3] = "Minutes"; + TimeUnit[TimeUnit["Hours"] = 4] = "Hours"; + TimeUnit[TimeUnit["Days"] = 5] = "Days"; + })(TimeUnit || (TimeUnit = {})); + (function (TimeUnit) { + function toMilliseconds(value, units) { + if (units === void 0) { units = TimeUnit.Milliseconds; } + switch (units) { + case TimeUnit.Days: + value *= 24; + case TimeUnit.Hours: + value *= 60; + case TimeUnit.Minutes: + value *= 60; + case TimeUnit.Seconds: + value *= 1000; + case TimeUnit.Milliseconds: + return value; + case TimeUnit.Ticks: + return value / 10000; + default: + throw new Error("Invalid TimeUnit."); + } + } + TimeUnit.toMilliseconds = toMilliseconds; + function fromMilliseconds(ms, units) { + switch (units) { + case TimeUnit.Days: + return ms / 86400000; + case TimeUnit.Hours: + return ms / 3600000; + case TimeUnit.Minutes: + return ms / 60000; + case TimeUnit.Seconds: + return ms / 1000; + case TimeUnit.Milliseconds: + return ms; + case TimeUnit.Ticks: + return ms * 10000; + default: + throw new Error("Invalid TimeUnit."); + } + } + TimeUnit.fromMilliseconds = fromMilliseconds; + function from(quantity, unit) { + return quantity && fromMilliseconds(quantity.getTotalMilliseconds(), unit); + } + TimeUnit.from = from; + function assertValid(unit) { + if (isNaN(unit) || unit > TimeUnit.Days || unit < TimeUnit.Ticks || Math.floor(unit) !== unit) + throw new Error("Invalid TimeUnit."); + return true; + } + TimeUnit.assertValid = assertValid; + })(TimeUnit || (TimeUnit = {})); + Object.freeze(TimeUnit); + exports_1("default",TimeUnit); + } + } +}); +//# sourceMappingURL=TimeUnit.js.map \ No newline at end of file diff --git a/dist/system/System/Time/TimeUnit.js.map b/dist/system/System/Time/TimeUnit.js.map new file mode 100644 index 00000000..b74c2b6c --- /dev/null +++ b/dist/system/System/Time/TimeUnit.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TimeUnit.js","sourceRoot":"","sources":["../../../../source/System/Time/TimeUnit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;;YAMH,WAAK,QAAQ;gBAEZ,yCAAK,CAAA;gBACL,uDAAY,CAAA;gBACZ,6CAAO,CAAA;gBACP,6CAAO,CAAA;gBACP,yCAAK,CAAA;gBACL,uCAAI,CAAA;YACL,CAAC,EARI,QAAQ,KAAR,QAAQ,QAQZ;YAED,WAAO,QAAQ,EACf,CAAC;gBAEA,wBACC,KAAY,EACZ,KAAsC;oBAAtC,qBAAsC,GAAtC,QAAiB,QAAQ,CAAC,YAAY;oBAGtC,MAAM,CAAA,CAAC,KAAK,CAAC,CACb,CAAC;wBACA,KAAK,QAAQ,CAAC,IAAI;4BACjB,KAAK,IAAI,EAAqB,CAAC;wBAChC,KAAK,QAAQ,CAAC,KAAK;4BAClB,KAAK,IAAI,EAAwB,CAAC;wBACnC,KAAK,QAAQ,CAAC,OAAO;4BACpB,KAAK,IAAI,EAA0B,CAAC;wBACrC,KAAK,QAAQ,CAAC,OAAO;4BACpB,KAAK,IAAI,IAA+B,CAAC;wBAC1C,KAAK,QAAQ,CAAC,YAAY;4BACzB,MAAM,CAAC,KAAK,CAAC;wBACd,KAAK,QAAQ,CAAC,KAAK;4BAClB,MAAM,CAAC,KAAK,GAAC,KAA6B,CAAC;wBAC5C;4BACC,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;oBACvC,CAAC;gBACF,CAAC;gBAtBe,uBAAc,iBAsB7B,CAAA;gBAED,0BACC,EAAS,EACT,KAAc;oBAEd,MAAM,CAAA,CAAC,KAAK,CAAC,CACb,CAAC;wBACA,KAAK,QAAQ,CAA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Value.d.ts new file mode 100644 index 00000000..782f6cd6 --- /dev/null +++ b/dist/system/System/Time/TimeUnitValue.d.ts @@ -0,0 +1,19 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeUnit from './TimeUnit'; +import TimeQuantity from './TimeQuantity'; +export default class TimeUnitValue extends TimeQuantity { + private _units; + constructor(value: number | ITimeQuantity, _units: TimeUnit); + value: number; + getTotalMilliseconds(): number; + units: TimeUnit; + to(units?: TimeUnit): TimeUnitValue; + static from(value: number | ITimeQuantity, units?: TimeUnit): TimeUnitValue; +} diff --git a/dist/system/System/Time/TimeUnitValue.js b/dist/system/System/Time/TimeUnitValue.js new file mode 100644 index 00000000..1c61953a --- /dev/null +++ b/dist/system/System/Time/TimeUnitValue.js @@ -0,0 +1,71 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(['./TimeUnit', './TimeQuantity'], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var TimeUnit_1, TimeQuantity_1; + var TimeUnitValue; + function getUnitQuantityFrom(q, units) { + return TimeUnit_1.default.fromMilliseconds(q.getTotalMilliseconds(), units); + } + return { + setters:[ + function (TimeUnit_1_1) { + TimeUnit_1 = TimeUnit_1_1; + }, + function (TimeQuantity_1_1) { + TimeQuantity_1 = TimeQuantity_1_1; + }], + execute: function() { + TimeUnitValue = (function (_super) { + __extends(TimeUnitValue, _super); + function TimeUnitValue(value, _units) { + _super.call(this, typeof (value) == 'number' + ? value + : getUnitQuantityFrom(value, _units)); + this._units = _units; + TimeUnit_1.default.assertValid(_units); + } + Object.defineProperty(TimeUnitValue.prototype, "value", { + get: function () { + return this._quantity; + }, + set: function (v) { + this._total = null; + this._quantity = v; + }, + enumerable: true, + configurable: true + }); + TimeUnitValue.prototype.getTotalMilliseconds = function () { + return TimeUnit_1.default.toMilliseconds(this._quantity, this._units); + }; + Object.defineProperty(TimeUnitValue.prototype, "units", { + get: function () { + return this._units; + }, + enumerable: true, + configurable: true + }); + TimeUnitValue.prototype.to = function (units) { + if (units === void 0) { units = this.units; } + return TimeUnitValue.from(this, units); + }; + TimeUnitValue.from = function (value, units) { + if (units === void 0) { units = TimeUnit_1.default.Milliseconds; } + return new TimeUnitValue(value, units); + }; + return TimeUnitValue; + }(TimeQuantity_1.default)); + exports_1("default", TimeUnitValue); + } + } +}); +//# sourceMappingURL=TimeUnitValue.js.map \ No newline at end of file diff --git a/dist/system/System/Time/TimeUnitValue.js.map b/dist/system/System/Time/TimeUnitValue.js.map new file mode 100644 index 00000000..1008f539 --- /dev/null +++ b/dist/system/System/Time/TimeUnitValue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"TimeUnitValue.js","sourceRoot":"","sources":["../../../../source/System/Time/TimeUnitValue.ts"],"names":[],"mappings":"AAAA;;;GAGG;;IAMH,YAAY,CAAC;;;;;;;;;IAuDb,6BAA6B,CAAe,EAAE,KAAc;QAE3D,MAAM,CAAC,kBAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,oBAAoB,EAAE,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;;;;;;;;;;YAjDD;gBAC4B,iCAAY;gBAGvC,uBAAY,KAA0B,EAAU,MAAe;oBAE9D,kBAAM,OAAM,CAAC,KAAK,CAAC,IAAE,QAAQ;0BAClB,KAAK;0BACb,mBAAmB,CAAgB,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;oBAJP,WAAM,GAAN,MAAM,CAAS;oBAK9D,kBAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBAC9B,CAAC;gBAED,sBAAI,gCAAK;yBAAT;wBAEC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;oBACvB,CAAC;yBAED,UAAU,CAAQ;wBAEjB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;wBACnB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;oBACpB,CAAC;;;mBANA;gBAQD,4CAAoB,GAApB;oBAEC,MAAM,CAAC,kBAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC7D,CAAC;gBAGD,sBAAI,gCAAK;yBAAT;wBAEC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;oBACpB,CAAC;;;mBAAA;gBAED,0BAAE,GAAF,UAAG,KAA2B;oBAA3B,qBAA2B,GAA3B,QAAiB,IAAI,CAAC,KAAK;oBAE7B,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAC,KAAK,CAAC,CAAC;gBACvC,CAAC;gBAEM,kBAAI,GAAX,UAAY,KAA0B,EAAE,KAAsC;oBAAtC,qBAAsC,GAAtC,QAAiB,kBAAQ,CAAC,YAAY;oBAE7E,MAAM,CAAC,IAAI,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBACxC,CAAC;gBAEF,oBAAC;YAAD,CAAC,AA5CD,CAC4B,sBAAY,GA2CvC;YA5CD,mCA4CC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Timers/Timer.d.ts b/dist/system/System/Timers/Timer.d.ts new file mode 100644 index 00000000..00797473 --- /dev/null +++ b/dist/system/System/Timers/Timer.d.ts @@ -0,0 +1,24 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ObservableBase from "./../Observable/ObservableBase"; +export default class Timer extends ObservableBase implements ITimer, ICancellable { + private _interval; + private _maxCount; + private _initialDelay; + private _cancel; + private _count; + constructor(_interval: number, _maxCount?: number, _initialDelay?: number); + static startNew(millisecondInterval: number, maxCount?: number, initialDelay?: number): Timer; + isRunning: boolean; + count: number; + start(): void; + stop(): void; + reset(): void; + cancel(): boolean; + dispose(): void; + private static _onTick(timer, reInitTimer?); +} diff --git a/dist/system/System/Timers/Timer.js b/dist/system/System/Timers/Timer.js new file mode 100644 index 00000000..3b3a49aa --- /dev/null +++ b/dist/system/System/Timers/Timer.js @@ -0,0 +1,115 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["./../Observable/ObservableBase"], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ObservableBase_1; + var Timer; + return { + setters:[ + function (ObservableBase_1_1) { + ObservableBase_1 = ObservableBase_1_1; + }], + execute: function() { + Timer = (function (_super) { + __extends(Timer, _super); + function Timer(_interval, _maxCount, _initialDelay) { + if (_maxCount === void 0) { _maxCount = Infinity; } + if (_initialDelay === void 0) { _initialDelay = _interval; } + _super.call(this); + this._interval = _interval; + this._maxCount = _maxCount; + this._initialDelay = _initialDelay; + this._count = 0; + if (_interval === null || _interval === void (0)) + throw "'interval' must be a valid number."; + if (_interval < 0) + throw "'interval' cannot be negative."; + } + Timer.startNew = function (millisecondInterval, maxCount, initialDelay) { + if (maxCount === void 0) { maxCount = Infinity; } + if (initialDelay === void 0) { initialDelay = millisecondInterval; } + var t = new Timer(millisecondInterval, maxCount, millisecondInterval); + t.start(); + return t; + }; + Object.defineProperty(Timer.prototype, "isRunning", { + get: function () { + return !!this._cancel; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Timer.prototype, "count", { + get: function () { + return this._count; + }, + enumerable: true, + configurable: true + }); + Timer.prototype.start = function () { + var _ = this; + if (!_._cancel && _._count < _._maxCount) { + if (_._count || _._initialDelay == _._interval) { + var i_1 = setInterval(Timer._onTick, _._interval, _); + _._cancel = function () { + clearInterval(i_1); + }; + } + else { + var i_2 = setTimeout(Timer._onTick, _._initialDelay, _, true); + _._cancel = function () { + clearTimeout(i_2); + }; + } + } + }; + Timer.prototype.stop = function () { + this.cancel(); + }; + Timer.prototype.reset = function () { + this.stop(); + this._count = 0; + }; + Timer.prototype.cancel = function () { + if (this._cancel) { + this._cancel(); + this._cancel = null; + return true; + } + return false; + }; + Timer.prototype.dispose = function () { + this.cancel(); + _super.prototype.dispose.call(this); + }; + Timer._onTick = function (timer, reInitTimer) { + var index = timer._count++, max = timer._maxCount, isComplete = timer._count >= max; + if (reInitTimer) { + timer.cancel(); + timer.start(); + } + if (isComplete) { + timer.stop(); + } + if (index < max) { + timer._onNext(index); + } + if (isComplete) { + timer._onCompleted(); + } + }; + return Timer; + }(ObservableBase_1.default)); + exports_1("default", Timer); + } + } +}); +//# sourceMappingURL=Timer.js.map \ No newline at end of file diff --git a/dist/system/System/Timers/Timer.js.map b/dist/system/System/Timers/Timer.js.map new file mode 100644 index 00000000..4d5ef430 --- /dev/null +++ b/dist/system/System/Timers/Timer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Timer.js","sourceRoot":"","sources":["../../../../source/System/Timers/Timer.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;;;;;;YAMH;gBAAmC,yBAAsB;gBAMxD,eACS,SAAgB,EAChB,SAA2B,EAC3B,aAAyB;oBADjC,yBAAmC,GAAnC,oBAAmC;oBACnC,6BAAiC,GAAjC,yBAAiC;oBAEjC,iBAAO,CAAC;oBAJA,cAAS,GAAT,SAAS,CAAO;oBAChB,cAAS,GAAT,SAAS,CAAkB;oBAC3B,kBAAa,GAAb,aAAa,CAAY;oBAL1B,WAAM,GAAU,CAAC,CAAC;oBASzB,EAAE,CAAA,CAAC,SAAS,KAAG,IAAI,IAAI,SAAS,KAAI,KAAI,CAAC,CAAC,CAAC,CAA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AC,CACd,CAAC;wBACA,KAAK,CAAC,YAAY,EAAE,CAAC;oBACtB,CAAC;gBACF,CAAC;gBAEF,YAAC;YAAD,CAAC,AAlID,CAAmC,wBAAc,GAkIhD;YAlID,2BAkIC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Types.d.ts b/dist/system/System/Types.d.ts new file mode 100644 index 00000000..cddf07c8 --- /dev/null +++ b/dist/system/System/Types.d.ts @@ -0,0 +1,46 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare class TypeInfo { + private target; + type: string; + isBoolean: boolean; + isNumber: boolean; + isFinite: boolean; + isValidNumber: boolean; + isString: boolean; + isTrueNaN: boolean; + isObject: boolean; + isFunction: boolean; + isUndefined: boolean; + isNull: boolean; + isNullOrUndefined: boolean; + isPrimitive: boolean; + constructor(target: any); + member(name: string): TypeInfo; + static getFor(target: any): TypeInfo; +} +export declare module Type { + const BOOLEAN: string; + const NUMBER: string; + const STRING: string; + const OBJECT: string; + const UNDEFINED: string; + const FUNCTION: string; + function isBoolean(value: any): value is boolean; + function isNumber(value: any, allowNaN?: boolean): value is number; + function isTrueNaN(value: any): value is number; + function isString(value: any): value is string; + function isPrimitive(value: any): value is Primitive; + function isFunction(value: any): value is Function; + function isObject(value: any, allowNull?: boolean): boolean; + function numberOrNaN(value: any): number; + function of(target: any): TypeInfo; + function hasMember(value: any, property: string): boolean; + function hasMemberOfType(instance: any, property: string, type: string): instance is T; + function isArrayLike(instance: any): instance is IArray; +} +export default Type; diff --git a/dist/system/System/Uri/HostNameType.d.ts b/dist/system/System/Uri/HostNameType.d.ts new file mode 100644 index 00000000..b4e74073 --- /dev/null +++ b/dist/system/System/Uri/HostNameType.d.ts @@ -0,0 +1,13 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.UriHostNameType%28v=vs.110%29.aspx + */ +declare enum UriHostNameType { + Basic = 0, + DNS = 1, + IPv4 = 2, + IPv6 = 3, + Unknown = 4, +} +export default UriHostNameType; diff --git a/dist/system/System/Uri/HostNameType.js b/dist/system/System/Uri/HostNameType.js new file mode 100644 index 00000000..ee02802f --- /dev/null +++ b/dist/system/System/Uri/HostNameType.js @@ -0,0 +1,25 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.UriHostNameType%28v=vs.110%29.aspx + */ +System.register([], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var UriHostNameType; + return { + setters:[], + execute: function() { + (function (UriHostNameType) { + UriHostNameType[UriHostNameType["Basic"] = 0] = "Basic"; + UriHostNameType[UriHostNameType["DNS"] = 1] = "DNS"; + UriHostNameType[UriHostNameType["IPv4"] = 2] = "IPv4"; + UriHostNameType[UriHostNameType["IPv6"] = 3] = "IPv6"; + UriHostNameType[UriHostNameType["Unknown"] = 4] = "Unknown"; + })(UriHostNameType || (UriHostNameType = {})); + Object.freeze(UriHostNameType); + exports_1("default",UriHostNameType); + } + } +}); +//# sourceMappingURL=HostNameType.js.map \ No newline at end of file diff --git a/dist/system/System/Uri/HostNameType.js.map b/dist/system/System/Uri/HostNameType.js.map new file mode 100644 index 00000000..706897f6 --- /dev/null +++ b/dist/system/System/Uri/HostNameType.js.map @@ -0,0 +1 @@ +{"version":3,"file":"HostNameType.js","sourceRoot":"","sources":["../../../../source/System/Uri/HostNameType.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;;YAGH,WAAK,eAAe;gBAInB,uDAAK,CAAA;gBAKL,mDAAG,CAAA;gBAKH,qDAAI,CAAA;gBAKJ,qDAAI,CAAA;gBAKJ,2DAAO,CAAA;YACR,CAAC,EAzBI,eAAe,KAAf,eAAe,QAyBnB;YAED,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;YAE/B,oBAAe,eAAe,EAAC"} \ No newline at end of file diff --git a/dist/system/System/Uri/QueryBuilder.d.ts b/dist/system/System/Uri/QueryBuilder.d.ts new file mode 100644 index 00000000..891db685 --- /dev/null +++ b/dist/system/System/Uri/QueryBuilder.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import OrderedStringKeyDictionary from "../Collections/Dictionaries/OrderedStringKeyDictionary"; +export default class QueryBuilder extends OrderedStringKeyDictionary { + constructor(query: QueryParamsConvertible, decodeValues?: boolean); + static init(query: QueryParamsConvertible, decodeValues?: boolean): QueryBuilder; + importQuery(query: QueryParamsConvertible, decodeValues?: boolean): QueryBuilder; + importFromString(values: string, deserialize?: boolean, decodeValues?: boolean): QueryBuilder; + encode(prefixIfNotEmpty?: boolean): string; + toString(): string; +} diff --git a/dist/system/System/Uri/QueryBuilder.js b/dist/system/System/Uri/QueryBuilder.js new file mode 100644 index 00000000..31c9462d --- /dev/null +++ b/dist/system/System/Uri/QueryBuilder.js @@ -0,0 +1,83 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../Types", "./QueryParams", "../Collections/Dictionaries/OrderedStringKeyDictionary", "../Collections/Enumeration/Enumerator"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Types_1, QueryParams, OrderedStringKeyDictionary_1, Enumerator_1; + var QueryBuilder; + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }, + function (QueryParams_1) { + QueryParams = QueryParams_1; + }, + function (OrderedStringKeyDictionary_1_1) { + OrderedStringKeyDictionary_1 = OrderedStringKeyDictionary_1_1; + }, + function (Enumerator_1_1) { + Enumerator_1 = Enumerator_1_1; + }], + execute: function() { + QueryBuilder = (function (_super) { + __extends(QueryBuilder, _super); + function QueryBuilder(query, decodeValues) { + if (decodeValues === void 0) { decodeValues = true; } + _super.call(this); + this.importQuery(query, decodeValues); + } + QueryBuilder.init = function (query, decodeValues) { + if (decodeValues === void 0) { decodeValues = true; } + return new QueryBuilder(query, decodeValues); + }; + QueryBuilder.prototype.importQuery = function (query, decodeValues) { + if (decodeValues === void 0) { decodeValues = true; } + if (Types_1.default.isString(query)) { + this.importFromString(query, decodeValues); + } + else if (Enumerator_1.isEnumerableOrArrayLike(query)) { + this.importEntries(query); + } + else { + this.importMap(query); + } + return this; + }; + QueryBuilder.prototype.importFromString = function (values, deserialize, decodeValues) { + if (deserialize === void 0) { deserialize = true; } + if (decodeValues === void 0) { decodeValues = true; } + var _ = this; + QueryParams.parse(values, function (key, value) { + if (_.containsKey(key)) { + var prev = _.getValue(key); + if (Array.isArray(prev)) + prev.push(value); + else + _.setValue(key, [prev, value]); + } + else + _.setValue(key, value); + }, deserialize, decodeValues); + return this; + }; + QueryBuilder.prototype.encode = function (prefixIfNotEmpty) { + return QueryParams.encode(this, prefixIfNotEmpty); + }; + QueryBuilder.prototype.toString = function () { + return this.encode(); + }; + return QueryBuilder; + }(OrderedStringKeyDictionary_1.default)); + exports_1("default", QueryBuilder); + } + } +}); +//# sourceMappingURL=QueryBuilder.js.map \ No newline at end of file diff --git a/dist/system/System/Uri/QueryBuilder.js.map b/dist/system/System/Uri/QueryBuilder.js.map new file mode 100644 index 00000000..42f39cd0 --- /dev/null +++ b/dist/system/System/Uri/QueryBuilder.js.map @@ -0,0 +1 @@ +{"version":3,"file":"QueryBuilder.js","sourceRoot":"","sources":["../../../../source/System/Uri/QueryBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;;IAMH,YAAY,CAAC;;;;;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AC,GAAG,CAAC,CAAC;4BAC3B,EAAE,CAAA,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gCACtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;4BAClB,IAAI;gCACH,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAoB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;wBACpD,CAAC;wBACD,IAAI;4BACH,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;oBACzB,CAAC,EACD,WAAW,EACX,YAAY,CAAC,CAAC;oBAEf,MAAM,CAAC,IAAI,CAAC;gBACb,CAAC;gBAOD,6BAAM,GAAN,UAAO,gBAAyB;oBAE/B,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;gBACnD,CAAC;gBAED,+BAAQ,GAAR;oBAEC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACtB,CAAC;gBACF,mBAAC;YAAD,CAAC,AAxFD,CAC2B,oCAA0B,GAuFpD;YAxFD,kCAwFC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Uri/QueryParams.d.ts b/dist/system/System/Uri/QueryParams.d.ts new file mode 100644 index 00000000..6bedb350 --- /dev/null +++ b/dist/system/System/Uri/QueryParams.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function encode(values: IUriComponentMap | QueryParamEnumerableOrArray, prefixIfNotEmpty?: boolean): string; +export declare function encodeValue(value: UriComponentValue): string; +export declare function isUriComponentFormattable(instance: any): instance is IUriComponentFormattable; +export declare function parse(query: string, entryHandler: (key: string, value: Primitive) => void, deserialize?: boolean, decodeValues?: boolean): void; +export declare function parseToMap(query: string, deserialize?: boolean, decodeValues?: boolean): IMap; +export declare function parseToArray(query: string, deserialize?: boolean, decodeValues?: boolean): IStringKeyValuePair[]; +export declare module Separator { + const Entry: string; + const KeyValue: string; +} diff --git a/dist/system/System/Uri/QueryParams.js b/dist/system/System/Uri/QueryParams.js new file mode 100644 index 00000000..f152ecc7 --- /dev/null +++ b/dist/system/System/Uri/QueryParams.js @@ -0,0 +1,125 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(["../Types", "../Serialization/Utility", "../KeyValueExtract", "../Collections/Enumeration/Enumerator"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var Types_1, Serialization, KeyValueExtract_1, Enumerator_1; + var ENTRY_SEPARATOR, KEY_VALUE_SEPARATOR, Separator; + function encode(values, prefixIfNotEmpty) { + if (!values) + return ''; + var entries = []; + if (Enumerator_1.isEnumerableOrArrayLike(values)) { + Enumerator_1.forEach(values, function (entry) { + return KeyValueExtract_1.default(entry, function (key, value) { return appendKeyValue(entries, key, value); }); + }); + } + else { + Object.keys(values).forEach(function (key) { return appendKeyValue(entries, key, values[key]); }); + } + return (entries.length && prefixIfNotEmpty ? '?' : '') + + entries.join(ENTRY_SEPARATOR); + } + exports_1("encode", encode); + function appendKeyValueSingle(entries, key, value) { + entries.push(key + KEY_VALUE_SEPARATOR + encodeValue(value)); + } + function appendKeyValue(entries, key, value) { + if (Enumerator_1.isEnumerableOrArrayLike(value)) { + Enumerator_1.forEach(value, function (v) { return appendKeyValueSingle(entries, key, v); }); + } + else { + appendKeyValueSingle(entries, key, value); + } + } + function encodeValue(value) { + var v = null; + if (isUriComponentFormattable(value)) { + v = value.toUriComponent(); + if (v && v.indexOf('&') != 1) + throw '.toUriComponent() did not encode the value.'; + } + else { + v = encodeURIComponent(Serialization.toString(v)); + } + return v; + } + exports_1("encodeValue", encodeValue); + function isUriComponentFormattable(instance) { + return Types_1.default.hasMemberOfType(instance, "toUriComponent", Types_1.default.FUNCTION); + } + exports_1("isUriComponentFormattable", isUriComponentFormattable); + function parse(query, entryHandler, deserialize, decodeValues) { + if (deserialize === void 0) { deserialize = true; } + if (decodeValues === void 0) { decodeValues = true; } + if (query && (query = query.replace(/^\s*\?+/, ''))) { + var entries = query.split(ENTRY_SEPARATOR); + for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { + var entry = entries_1[_i]; + var si = entry.indexOf(KEY_VALUE_SEPARATOR); + if (si != -1) { + var key = entry.substring(0, si); + var value = entry.substring(si + 1); + if (decodeValues) + value = decodeURIComponent(value); + if (deserialize) + value = Serialization.toPrimitive(value); + entryHandler(key, value); + } + } + } + } + exports_1("parse", parse); + function parseToMap(query, deserialize, decodeValues) { + if (deserialize === void 0) { deserialize = true; } + if (decodeValues === void 0) { decodeValues = true; } + var result = {}; + parse(query, function (key, value) { + if ((key) in (result)) { + var prev = result[key]; + if (!(Array.isArray(prev))) + result[key] = prev = [prev]; + prev.push(value); + } + else + result[key] = value; + }, deserialize, decodeValues); + return result; + } + exports_1("parseToMap", parseToMap); + function parseToArray(query, deserialize, decodeValues) { + if (deserialize === void 0) { deserialize = true; } + if (decodeValues === void 0) { decodeValues = true; } + var result = []; + parse(query, function (key, value) { result.push({ key: key, value: value }); }, deserialize, decodeValues); + return result; + } + exports_1("parseToArray", parseToArray); + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }, + function (Serialization_1) { + Serialization = Serialization_1; + }, + function (KeyValueExtract_1_1) { + KeyValueExtract_1 = KeyValueExtract_1_1; + }, + function (Enumerator_1_1) { + Enumerator_1 = Enumerator_1_1; + }], + execute: function() { + ENTRY_SEPARATOR = "&", KEY_VALUE_SEPARATOR = "="; + (function (Separator) { + Separator.Entry = ENTRY_SEPARATOR; + Separator.KeyValue = KEY_VALUE_SEPARATOR; + })(Separator = Separator || (Separator = {})); + exports_1("Separator", Separator); + Object.freeze(Separator); + } + } +}); +//# sourceMappingURL=QueryParams.js.map \ No newline at end of file diff --git a/dist/system/System/Uri/QueryParams.js.map b/dist/system/System/Uri/QueryParams.js.map new file mode 100644 index 00000000..a9308640 --- /dev/null +++ b/dist/system/System/Uri/QueryParams.js.map @@ -0,0 +1 @@ +{"version":3,"file":"QueryParams.js","sourceRoot":"","sources":["../../../../source/System/Uri/QueryParams.ts"],"names":[],"mappings":"AAAA;;;GAGG;;IAKH,YAAY,CAAC;;;QAaZ,eAAe,EACf,mBAAmB;IASpB,gBACC,MAAqD,EACrD,gBAAyB;QAEzB,EAAE,CAAA,CAAC,CAAC,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,CAAC;QACtB,IAAI,OAAO,GAAY,EAAE,CAAC;QAE1B,EAAE,CAAA,CAAC,oCAAuB,CAAC,MAAM,CAAC,CAAC,CACnC,CAAC;YACA,oBAAO,CAAC,MAAM,EAAE,UAAA,KAAK;gBACpB,OAAA,yBAAe,CAAC,KAAK,EACpB,UAAC,GAAG,EAAE,KAAK,IAAI,OAAA,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,EAAnC,CAAmC,CAAC;YADpD,CACoD,CACpD,CAAC;QACH,CAAC;QACD,IAAI,CACJ,CAAC;YACA,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAC1B,UAAA,GAAG,IAAG,OAAA,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAzC,CAAyC,CAC/C,CAAC;QACH,CAAC;QAED,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,gBAAgB,GAAG,GAAG,GAAG,EAAE,CAAC;cACnD,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAClC,CAAC;IAvBD,2BAuBC,CAAA;IAED,8BACC,OAAgB,EAChB,GAAU,EACV,KAAuB;QAEvB,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,mBAAmB,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9D,CAAC;IAGD,wBACC,OAAgB,EAChB,GAAU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CAAC,CAAC;gBAC7B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC;YACD,IAAI;gBACH,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACtB,CAAC,EACD,WAAW,EACX,YAAY,CAAC,CAAC;QACf,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAtBD,mCAsBC,CAAA;IASD,sBACC,KAAY,EACZ,WAA0B,EAC1B,YAA2B;QAD3B,2BAA0B,GAA1B,kBAA0B;QAC1B,4BAA2B,GAA3B,mBAA2B;QAE3B,IAAI,MAAM,GAAoC,EAAE,CAAC;QACjD,KAAK,CAAC,KAAK,EACV,UAAC,GAAG,EAAE,KAAK,IAAK,MAAM,CAAC,IAAI,CAAC,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAC,CAAC,CAAC,CAAA,CAAC,EACvD,WAAW,EACX,YAAY,CACZ,CAAC;QACF,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAZD,uCAYC,CAAA;;;;;;;;;;;;;;;;YA/KA,eAAe,GAAO,GAAG,EACzB,mBAAmB,GAAG,GAAG,CAAC;YAiL3B,WAAc,SAAS,EACvB,CAAC;gBACa,eAAK,GAAU,eAAe,CAAC;gBAC/B,kBAAQ,GAAU,mBAAmB,CAAC;YACpD,CAAC,EAJa,SAAS,GAAT,SAAS,KAAT,SAAS,QAItB;8CAAA;YACD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/dist/system/System/Uri/Scheme.d.ts b/dist/system/System/Uri/Scheme.d.ts new file mode 100644 index 00000000..5e625ec8 --- /dev/null +++ b/dist/system/System/Uri/Scheme.d.ts @@ -0,0 +1,21 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx + */ +declare enum Scheme { + file = 0, + ftp = 1, + gopher = 2, + http = 3, + https = 4, + ldap = 5, + mailto = 6, + pipe = 7, + tcp = 8, + news = 9, + nntp = 10, + telnet = 11, + uuid = 12, +} +export default Scheme; diff --git a/dist/system/System/Uri/Scheme.js b/dist/system/System/Uri/Scheme.js new file mode 100644 index 00000000..f2d70e15 --- /dev/null +++ b/dist/system/System/Uri/Scheme.js @@ -0,0 +1,39 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx + */ +System.register([], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var Scheme, PIPE, TCP; + return { + setters:[], + execute: function() { + (function (Scheme) { + Scheme[Scheme["file"] = 0] = "file"; + Scheme[Scheme["ftp"] = 1] = "ftp"; + Scheme[Scheme["gopher"] = 2] = "gopher"; + Scheme[Scheme["http"] = 3] = "http"; + Scheme[Scheme["https"] = 4] = "https"; + Scheme[Scheme["ldap"] = 5] = "ldap"; + Scheme[Scheme["mailto"] = 6] = "mailto"; + Scheme[Scheme["pipe"] = 7] = "pipe"; + Scheme[Scheme["tcp"] = 8] = "tcp"; + Scheme[Scheme["news"] = 9] = "news"; + Scheme[Scheme["nntp"] = 10] = "nntp"; + Scheme[Scheme["telnet"] = 11] = "telnet"; + Scheme[Scheme["uuid"] = 12] = "uuid"; + })(Scheme || (Scheme = {})); + PIPE = 'net.pipe'; + TCP = 'net.tcp'; + Scheme[Scheme.pipe] = PIPE; + Scheme[Scheme.tcp] = TCP; + Scheme[PIPE] = Scheme.pipe; + Scheme[TCP] = Scheme.tcp; + Object.freeze(Scheme); + exports_1("default",Scheme); + } + } +}); +//# sourceMappingURL=Scheme.js.map \ No newline at end of file diff --git a/dist/system/System/Uri/Scheme.js.map b/dist/system/System/Uri/Scheme.js.map new file mode 100644 index 00000000..b6d80cdc --- /dev/null +++ b/dist/system/System/Uri/Scheme.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Scheme.js","sourceRoot":"","sources":["../../../../source/System/Uri/Scheme.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;gBAkFG,IAAI,EACJ,GAAG;;;;YAhFT,WAAK,MAAM;gBAIV,mCAAI,CAAA;gBAMJ,iCAAG,CAAA;gBAMH,uCAAM,CAAA;gBAMN,mCAAI,CAAA;gBAMJ,qCAAK,CAAA;gBAML,mCAAI,CAAA;gBAMJ,uCAAM,CAAA;gBAMN,mCAAI,CAAA;gBAMJ,iCAAG,CAAA;gBAMH,mCAAI,CAAA;gBAMJ,oCAAI,CAAA;gBAMJ,wCAAM,CAAA;gBAKN,oCAAI,CAAA;YACL,CAAC,EA5EI,MAAM,KAAN,MAAM,QA4EV;YAGK,IAAI,GAAG,UAAU,CAAC;YAClB,GAAG,GAAG,SAAS,CAAC;YAEtB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;YAC3B,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;YAEnB,MAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC;YAC5B,MAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC;YAEhC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAEtB,oBAAe,MAAM,EAAC"} \ No newline at end of file diff --git a/dist/system/System/Uri/Uri.d.ts b/dist/system/System/Uri/Uri.d.ts new file mode 100644 index 00000000..731d150d --- /dev/null +++ b/dist/system/System/Uri/Uri.d.ts @@ -0,0 +1,48 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier + */ +import UriScheme from "../Uri/Scheme"; +export default class Uri implements IUri, IEquatable { + scheme: SchemeValue; + userInfo: string; + host: string; + port: number; + path: string; + query: string; + fragment: string; + queryParams: IMap; + constructor(scheme: UriScheme | SchemeValue, userInfo: string, host: string, port: number, path: string, query?: QueryParamsConvertible, fragment?: string); + equals(other: IUri): boolean; + static from(uri: string | IUri, defaults?: IUri): Uri; + static parse(url: string, throwIfInvalid?: boolean): IUri; + static tryParse(url: string, out: (result: IUri) => void): boolean; + static copyOf(map: IUri): IUri; + copyTo(map: IUri): IUri; + updateQuery(query: QueryParamsConvertible): Uri; + protected getAbsoluteUri(): string; + protected getAuthority(): string; + protected getPathAndQuery(): string; + absoluteUri: string; + authority: string; + pathAndQuery: string; + baseUri: string; + pathSegments: string[]; + toMap(): IUri; + toString(): string; + static toString(uri: IUri): string; + static getAuthority(uri: IUri): string; +} +export declare enum Fields { + scheme = 0, + userInfo = 1, + host = 2, + port = 3, + path = 4, + query = 5, + fragment = 6, +} diff --git a/dist/system/System/Uri/Uri.js b/dist/system/System/Uri/Uri.js new file mode 100644 index 00000000..d008c1ef --- /dev/null +++ b/dist/system/System/Uri/Uri.js @@ -0,0 +1,272 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier + */ +System.register(["../Types", "../Uri/QueryParams", "../Text/Utility", "../Uri/Scheme", "../Exceptions/ArgumentException", "../Exceptions/ArgumentOutOfRangeException"], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var Types_1, QueryParams, Utility_1, Scheme_1, ArgumentException_1, ArgumentOutOfRangeException_1; + var VOID0, Uri, Fields, SLASH, SLASH2, QM, HASH, EMPTY, AT; + function copyUri(from, to) { + var i = 0, field; + if (!to) + to = {}; + while (field = Fields[i++]) { + var value = from[field]; + if (value) + to[field] = value; + } + return to; + } + function getScheme(scheme) { + var s = scheme; + if (Types_1.default.isString(s)) { + if (!s) + return VOID0; + s = Scheme_1.default[Utility_1.trim(s).toLowerCase().replace(/[^a-z0-9+.-]+$/g, EMPTY)]; + if (isNaN(s)) + throw new ArgumentOutOfRangeException_1.default('scheme', scheme, 'Invalid scheme.'); + } + if (Types_1.default.isNumber(s, false)) { + s = Scheme_1.default[s]; + if (!s) + throw new ArgumentOutOfRangeException_1.default('scheme', scheme, 'Invalid scheme.'); + return s; + } + return VOID0; + } + function getPort(port) { + if (port === 0) + return port; + if (!port) + return null; + var p; + if (Types_1.default.isNumber(port, true)) { + p = port; + if (p >= 0 && isFinite(p)) + return p; + } + else if (Types_1.default.isString(port) && (p = parseInt(port)) && !isNaN(p)) { + return getPort(p); + } + throw new ArgumentException_1.default("port", "invalid value"); + } + function getAuthority(uri) { + if (!uri.host) { + if (uri.userInfo) + throw new ArgumentException_1.default('host', 'Cannot include user info when there is no host.'); + if (Types_1.default.isNumber(uri.port, false)) + throw new ArgumentException_1.default('host', 'Cannot include a port when there is no host.'); + } + var result = uri.host || EMPTY; + if (result) { + if (uri.userInfo) + result = uri.userInfo + AT + result; + if (!isNaN(uri.port)) + result += ':' + uri.port; + result = SLASH2 + result; + } + return result; + } + function formatQuery(query) { + return query && ((query.indexOf(QM) !== 0 ? QM : EMPTY) + query); + } + function formatFragment(fragment) { + return fragment && ((fragment.indexOf(HASH) !== 0 ? HASH : EMPTY) + fragment); + } + function getPathAndQuery(uri) { + var path = uri.path, query = uri.query; + return EMPTY + + (path || EMPTY) + + (formatQuery(query) || EMPTY); + } + function uriToString(uri) { + var scheme = getScheme(uri.scheme), authority = getAuthority(uri), pathAndQuery = getPathAndQuery(uri), fragment = formatFragment(uri.fragment); + var part1 = EMPTY + + ((scheme && (scheme + ':')) || EMPTY) + + (authority || EMPTY); + var part2 = EMPTY + + (pathAndQuery || EMPTY) + + (fragment || EMPTY); + if (part1 && part2 && scheme && !authority) + throw new ArgumentException_1.default('authority', "Cannot format schemed Uri with missing authority."); + if (part1 && pathAndQuery && pathAndQuery.indexOf(SLASH) !== 0) + part2 = SLASH + part2; + return part1 + part2; + } + function tryParse(url, out) { + if (!url) + return new ArgumentException_1.default('url', 'Nothing to parse.'); + var i, result = {}; + i = url.indexOf(HASH); + if (i != -1) { + result.fragment = url.substring(i + 1) || VOID0; + url = url.substring(0, i); + } + i = url.indexOf(QM); + if (i != -1) { + result.query = url.substring(i + 1) || VOID0; + url = url.substring(0, i); + } + i = url.indexOf(SLASH2); + if (i != -1) { + var scheme = Utility_1.trim(url.substring(0, i)), c = /:$/; + if (!c.test(scheme)) + return new ArgumentException_1.default('url', 'Scheme was improperly formatted'); + scheme = Utility_1.trim(scheme.replace(c, EMPTY)); + try { + result.scheme = getScheme(scheme) || VOID0; + } + catch (ex) { + return ex; + } + url = url.substring(i + 2); + } + i = url.indexOf(SLASH); + if (i != -1) { + result.path = url.substring(i); + url = url.substring(0, i); + } + i = url.indexOf(AT); + if (i != -1) { + result.userInfo = url.substring(0, i) || VOID0; + url = url.substring(i + 1); + } + i = url.indexOf(':'); + if (i != -1) { + var port = parseInt(Utility_1.trim(url.substring(i + 1))); + if (isNaN(port)) + return new ArgumentException_1.default('url', 'Port was invalid.'); + result.port = port; + url = url.substring(0, i); + } + url = Utility_1.trim(url); + if (url) + result.host = url; + out(copyUri(result)); + return null; + } + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }, + function (QueryParams_1) { + QueryParams = QueryParams_1; + }, + function (Utility_1_1) { + Utility_1 = Utility_1_1; + }, + function (Scheme_1_1) { + Scheme_1 = Scheme_1_1; + }, + function (ArgumentException_1_1) { + ArgumentException_1 = ArgumentException_1_1; + }, + function (ArgumentOutOfRangeException_1_1) { + ArgumentOutOfRangeException_1 = ArgumentOutOfRangeException_1_1; + }], + execute: function() { + VOID0 = void (0); + Uri = (function () { + function Uri(scheme, userInfo, host, port, path, query, fragment) { + var _ = this; + _.scheme = getScheme(scheme) || null; + _.userInfo = userInfo || null; + _.host = host || null; + _.port = getPort(port); + _.authority = _.getAuthority() || null; + _.path = path || null; + if (!Types_1.default.isString(query)) + query = QueryParams.encode(query); + _.query = formatQuery(query) || null; + Object.freeze(_.queryParams + = _.query + ? QueryParams.parseToMap(_.query) + : {}); + _.pathAndQuery = _.getPathAndQuery() || null; + _.fragment = formatFragment(fragment) || null; + _.absoluteUri = _.getAbsoluteUri(); + _.baseUri = _.absoluteUri.replace(/[?#].*/, ''); + Object.freeze(_); + } + Uri.prototype.equals = function (other) { + return this === other || this.absoluteUri == Uri.toString(other); + }; + Uri.from = function (uri, defaults) { + var u = (!uri || Types_1.default.isString(uri)) + ? Uri.parse(uri) : uri; + return new Uri(u.scheme || defaults && defaults.scheme, u.userInfo || defaults && defaults.userInfo, u.host || defaults && defaults.host, isNaN(u.port) ? defaults && defaults.port : u.port, u.path || defaults && defaults.path, u.query || defaults && defaults.query, u.fragment || defaults && defaults.fragment); + }; + Uri.parse = function (url, throwIfInvalid) { + if (throwIfInvalid === void 0) { throwIfInvalid = true; } + var result = null; + var ex = tryParse(url, function (out) { result = out; }); + if (throwIfInvalid && ex) + throw ex; + return result; + }; + Uri.tryParse = function (url, out) { + return !tryParse(url, out); + }; + Uri.copyOf = function (map) { + return copyUri(map); + }; + Uri.prototype.copyTo = function (map) { + return copyUri(this, map); + }; + Uri.prototype.updateQuery = function (query) { + var map = this.toMap(); + map.query = query; + return Uri.from(map); + }; + Uri.prototype.getAbsoluteUri = function () { + return uriToString(this); + }; + Uri.prototype.getAuthority = function () { + return getAuthority(this); + }; + Uri.prototype.getPathAndQuery = function () { + return getPathAndQuery(this); + }; + Object.defineProperty(Uri.prototype, "pathSegments", { + get: function () { + return this.path.match(/^[/]|[^/]*[/]|[^/]+$/g); + }, + enumerable: true, + configurable: true + }); + Uri.prototype.toMap = function () { + return this.copyTo({}); + }; + Uri.prototype.toString = function () { + return this.absoluteUri; + }; + Uri.toString = function (uri) { + return uri instanceof Uri + ? uri.absoluteUri + : uriToString(uri); + }; + Uri.getAuthority = function (uri) { + return getAuthority(uri); + }; + return Uri; + }()); + exports_1("default", Uri); + (function (Fields) { + Fields[Fields["scheme"] = 0] = "scheme"; + Fields[Fields["userInfo"] = 1] = "userInfo"; + Fields[Fields["host"] = 2] = "host"; + Fields[Fields["port"] = 3] = "port"; + Fields[Fields["path"] = 4] = "path"; + Fields[Fields["query"] = 5] = "query"; + Fields[Fields["fragment"] = 6] = "fragment"; + })(Fields || (Fields = {})); + exports_1("Fields", Fields); + Object.freeze(Fields); + SLASH = '/', SLASH2 = '//', QM = '?', HASH = '#', EMPTY = '', AT = '@'; + } + } +}); +//# sourceMappingURL=Uri.js.map \ No newline at end of file diff --git a/dist/system/System/Uri/Uri.js.map b/dist/system/System/Uri/Uri.js.map new file mode 100644 index 00000000..70245abd --- /dev/null +++ b/dist/system/System/Uri/Uri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Uri.js","sourceRoot":"","sources":["../../../../source/System/Uri/Uri.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;IAKH,YAAY,CAAC;;;QAUP,KAAK,eAgRL,KAAK,EAAQ,MAAM,EAAS,EAAE,EAAQ,IAAI,EAAQ,KAAK,EAAO,EAAE;IAZtE,iBAAiB,IAAS,EAAE,EAAQ;QAEnC,IAAI,CAAC,GAAG,CAAC,EAAE,KAAY,CAAC;QACxB,EAAE,CAAA,CAAC,CAAC,EAAE,CAAC;YAAC,EAAE,GAAG,EAAE,CAAC;QAChB,OAAM,KAAK,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,EACzB,CAAC;YACA,IAAI,KAAK,GAAS,IAAK,CAAC,KAAK,CAAC,CAAC;YAC/B,EAAE,CAAA,CAAC,KAAK,CAAC;gBAAO,EAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QACpC,CAAC;QACD,MAAM,CAAC,EAAE,CAAC;IACX,CAAC;IAID,mBAAmB,MAAuB;QAEzC,IAAI,CAAC,GAAO,MAAM,CAAC;QACnB,EAAE,CAAA,CAAC,eAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACpB,CAAC;YACA,EAAE,CAAA,CA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KS,6BAAe,GAAzB;oBAEC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;gBAC9B,CAAC;gBA+BD,sBAAI,6BAAY;yBAAhB;wBAEC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;oBACjD,CAAC;;;mBAAA;gBAMD,mBAAK,GAAL;oBAEC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACxB,CAAC;gBAKD,sBAAQ,GAAR;oBAEC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;gBACzB,CAAC;gBAOM,YAAQ,GAAf,UAAgB,GAAQ;oBAEvB,MAAM,CAAC,GAAG,YAAY,GAAG;0BAChB,GAAI,CAAC,WAAW;0BACtB,WAAW,CAAC,GAAG,CAAC,CAAC;gBACrB,CAAC;gBAOM,gBAAY,GAAnB,UAAoB,GAAQ;oBAE3B,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;gBAC1B,CAAC;gBAGF,UAAC;YAAD,CAAC,AA/OD,IA+OC;YA/OD,yBA+OC,CAAA;YAED,WAAY,MAAM;gBACjB,uCAAM,CAAA;gBACN,2CAAQ,CAAA;gBACR,mCAAI,CAAA;gBACJ,mCAAI,CAAA;gBACJ,mCAAI,CAAA;gBACJ,qCAAK,CAAA;gBACL,2CAAQ,CAAA;YACT,CAAC,EARW,MAAM,KAAN,MAAM,QAQjB;wCAAA;YACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAchB,KAAK,GAAG,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,EAAE,GAAG,GAAG,EAAE,IAAI,GAAG,GAAG,EAAE,KAAK,GAAG,EAAE,EAAE,EAAE,GAAG,GAAG,CAAC"} \ No newline at end of file diff --git a/dist/system/System/Utility/applyMixins.d.ts b/dist/system/System/Utility/applyMixins.d.ts new file mode 100644 index 00000000..89e245e2 --- /dev/null +++ b/dist/system/System/Utility/applyMixins.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function applyMixins(derivedConstructor: any, baseConstructors: any[]): void; diff --git a/dist/system/System/Utility/applyMixins.js b/dist/system/System/Utility/applyMixins.js new file mode 100644 index 00000000..066034fc --- /dev/null +++ b/dist/system/System/Utility/applyMixins.js @@ -0,0 +1,23 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register([], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + function applyMixins(derivedConstructor, baseConstructors) { + baseConstructors + .forEach(function (bc) { + Object.getOwnPropertyNames(bc.prototype).forEach(function (name) { + derivedConstructor.prototype[name] = bc.prototype[name]; + }); + }); + } + exports_1("default", applyMixins); + return { + setters:[], + execute: function() { + } + } +}); +//# sourceMappingURL=applyMixins.js.map \ No newline at end of file diff --git a/dist/system/System/Utility/applyMixins.js.map b/dist/system/System/Utility/applyMixins.js.map new file mode 100644 index 00000000..c8467b25 --- /dev/null +++ b/dist/system/System/Utility/applyMixins.js.map @@ -0,0 +1 @@ +{"version":3,"file":"applyMixins.js","sourceRoot":"","sources":["../../../../source/System/Utility/applyMixins.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;IAEH,qBAAoC,kBAAsB,EAAE,gBAAsB;QAEjF,gBAAgB;aACd,OAAO,CAAC,UAAA,EAAE;YAEV,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,OAAO,CAC9C,UAAA,IAAI;gBAEJ,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACzD,CAAC,CACD,CAAC;QACH,CAAC,CACD,CAAC;IACH,CAAC;IAbD,iCAaC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Utility/clone.d.ts b/dist/system/System/Utility/clone.d.ts new file mode 100644 index 00000000..3c3527fd --- /dev/null +++ b/dist/system/System/Utility/clone.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function clone(source: any, depth?: number): any; diff --git a/dist/system/System/Utility/clone.js b/dist/system/System/Utility/clone.js new file mode 100644 index 00000000..85101445 --- /dev/null +++ b/dist/system/System/Utility/clone.js @@ -0,0 +1,43 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register(['../Types'], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + var Types_1; + function clone(source, depth) { + if (depth === void 0) { depth = 0; } + if (depth < 0) + return source; + if (!Types_1.default.isObject(source)) + return source; + var result; + if (Array.isArray(source)) { + result = source.slice(); + if (depth > 0) { + for (var i = 0; i < result.length; i++) { + result[i] = clone(result[i], depth - 1); + } + } + } + else { + result = {}; + if (depth > 0) + for (var k in source) { + result[k] = clone(source[k], depth - 1); + } + } + return result; + } + exports_1("default", clone); + return { + setters:[ + function (Types_1_1) { + Types_1 = Types_1_1; + }], + execute: function() { + } + } +}); +//# sourceMappingURL=clone.js.map \ No newline at end of file diff --git a/dist/system/System/Utility/clone.js.map b/dist/system/System/Utility/clone.js.map new file mode 100644 index 00000000..97adf8b3 --- /dev/null +++ b/dist/system/System/Utility/clone.js.map @@ -0,0 +1 @@ +{"version":3,"file":"clone.js","sourceRoot":"","sources":["../../../../source/System/Utility/clone.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;IAIH,eAA8B,MAAU,EAAE,KAAgB;QAAhB,qBAAgB,GAAhB,SAAgB;QAEzD,EAAE,CAAA,CAAC,KAAK,GAAC,CAAC,CAAC;YACV,MAAM,CAAC,MAAM,CAAC;QAGf,EAAE,CAAA,CAAC,CAAC,eAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAAC,MAAM,CAAC,MAAM,CAAC;QAEzC,IAAI,MAAU,CAAC;QACf,EAAE,CAAA,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CACzB,CAAC;YACA,MAAM,GAAS,MAAO,CAAC,KAAK,EAAE,CAAC;YAC/B,EAAE,CAAA,CAAC,KAAK,GAAC,CAAC,CAAC,CACX,CAAC;gBACA,GAAG,CAAA,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EACnC,CAAC;oBACA,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;gBACzC,CAAC;YACF,CAAC;QACF,CAAC;QACD,IAAI,CACJ,CAAC;YACA,MAAM,GAAG,EAAE,CAAC;YACZ,EAAE,CAAA,CAAC,KAAK,GAAC,CAAC,CAAC;gBAAC,GAAG,CAAA,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,CAChC,CAAC;oBAEA,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;gBACzC,CAAC;QACF,CAAC;QAED,MAAM,CAAC,MAAM,CAAC;IAEf,CAAC;IAhCD,2BAgCC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Utility/shallowCopy.d.ts b/dist/system/System/Utility/shallowCopy.d.ts new file mode 100644 index 00000000..df935e23 --- /dev/null +++ b/dist/system/System/Utility/shallowCopy.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function shallowCopy(source: any, target?: any): any; diff --git a/dist/system/System/Utility/shallowCopy.js b/dist/system/System/Utility/shallowCopy.js new file mode 100644 index 00000000..f15c7411 --- /dev/null +++ b/dist/system/System/Utility/shallowCopy.js @@ -0,0 +1,24 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register([], function(exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + function shallowCopy(source, target) { + if (target === void 0) { target = {}; } + if (target) { + for (var k in source) { + target[k] = source[k]; + } + } + return target; + } + exports_1("default", shallowCopy); + return { + setters:[], + execute: function() { + } + } +}); +//# sourceMappingURL=shallowCopy.js.map \ No newline at end of file diff --git a/dist/system/System/Utility/shallowCopy.js.map b/dist/system/System/Utility/shallowCopy.js.map new file mode 100644 index 00000000..16f0b1e9 --- /dev/null +++ b/dist/system/System/Utility/shallowCopy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"shallowCopy.js","sourceRoot":"","sources":["../../../../source/System/Utility/shallowCopy.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;IAEH,qBAAoC,MAAU,EAAE,MAAe;QAAf,sBAAe,GAAf,WAAe;QAE9D,EAAE,CAAA,CAAC,MAAM,CAAC,CACV,CAAC;YACA,GAAG,CAAA,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,CACpB,CAAC;gBAEA,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACvB,CAAC;QACF,CAAC;QAED,MAAM,CAAC,MAAM,CAAC;IACf,CAAC;IAZD,iCAYC,CAAA"} \ No newline at end of file diff --git a/dist/system/System/Validation/ValidationResult.d.ts b/dist/system/System/Validation/ValidationResult.d.ts new file mode 100644 index 00000000..8fdffed8 --- /dev/null +++ b/dist/system/System/Validation/ValidationResult.d.ts @@ -0,0 +1,15 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class ValidationResult implements IValidationResult, IEquatable { + isValid: boolean; + message: string; + data: any; + constructor(isValid?: boolean, message?: string, data?: any); + equals(other: IValidationResult): boolean; + static valid: IValidationResult; + static invalid(message: string, data?: any): IValidationResult; +} diff --git a/dist/system/System/Validation/ValidationResult.js b/dist/system/System/Validation/ValidationResult.js new file mode 100644 index 00000000..35cc7cbc --- /dev/null +++ b/dist/system/System/Validation/ValidationResult.js @@ -0,0 +1,46 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +System.register([], function(exports_1, context_1) { + 'use strict'; + var __moduleName = context_1 && context_1.id; + var valid, ValidationResult; + return { + setters:[], + execute: function() { + valid = new ValidationResult(true); + ValidationResult = (function () { + function ValidationResult(isValid, message, data) { + if (isValid === void 0) { isValid = false; } + if (message === void 0) { message = null; } + if (data === void 0) { data = null; } + this.isValid = isValid; + this.message = message; + this.data = data; + Object.freeze(this); + } + ValidationResult.prototype.equals = function (other) { + var _ = this; + return _.isValid === other.isValid + && _.message == _.message + && _.data == _.data; + }; + Object.defineProperty(ValidationResult, "valid", { + get: function () { + return valid; + }, + enumerable: true, + configurable: true + }); + ValidationResult.invalid = function (message, data) { + if (data === void 0) { data = null; } + return new ValidationResult(false, message, data); + }; + return ValidationResult; + }()); + exports_1("default", ValidationResult); + } + } +}); +//# sourceMappingURL=ValidationResult.js.map \ No newline at end of file diff --git a/dist/system/System/Validation/ValidationResult.js.map b/dist/system/System/Validation/ValidationResult.js.map new file mode 100644 index 00000000..6b62a21e --- /dev/null +++ b/dist/system/System/Validation/ValidationResult.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ValidationResult.js","sourceRoot":"","sources":["../../../../source/System/Validation/ValidationResult.ts"],"names":[],"mappings":"AAAA;;;GAGG;;IAIH,YAAY,CAAC;;QAEP,KAAK;;;;YAAL,KAAK,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAKzC;gBAOC,0BACQ,OAAuB,EACvB,OAAqB,EACrB,IAAe;oBAFtB,uBAA8B,GAA9B,eAA8B;oBAC9B,uBAA4B,GAA5B,cAA4B;oBAC5B,oBAAsB,GAAtB,WAAsB;oBAFf,YAAO,GAAP,OAAO,CAAgB;oBACvB,YAAO,GAAP,OAAO,CAAc;oBACrB,SAAI,GAAJ,IAAI,CAAW;oBAItB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACrB,CAAC;gBAKD,iCAAM,GAAN,UAAO,KAAuB;oBAE7B,IAAI,CAAC,GAAG,IAAI,CAAC;oBACb,MAAM,CAAC,CAAC,CAAC,OAAO,KAAG,KAAK,CAAC,OAAO;2BAC5B,CAAC,CAAC,OAAO,IAAE,CAAC,CAAC,OAAO;2BACpB,CAAC,CAAC,IAAI,IAAE,CAAC,CAAC,IAAI,CAAC;gBACpB,CAAC;gBAOD,sBAAW,yBAAK;yBAAhB;wBACC,MAAM,CAAC,KAAK,CAAC;oBACd,CAAC;;;mBAAA;gBAKM,wBAAO,GAAd,UACC,OAAc,EACd,IAAe;oBAAf,oBAAe,GAAf,WAAe;oBAEf,MAAM,CAAC,IAAI,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;gBACnD,CAAC;gBACF,uBAAC;YAAD,CAAC,AA9CD,IA8CC;YA9CD,sCA8CC,CAAA"} \ No newline at end of file diff --git a/dist/system/extends.d.ts b/dist/system/extends.d.ts new file mode 100644 index 00000000..6a21de64 --- /dev/null +++ b/dist/system/extends.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function (d: any, b: any): void; diff --git a/dist/umd.min/System.Linq/Linq.d.ts b/dist/umd.min/System.Linq/Linq.d.ts new file mode 100644 index 00000000..fabea935 --- /dev/null +++ b/dist/umd.min/System.Linq/Linq.d.ts @@ -0,0 +1,196 @@ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Original: http://linqjs.codeplex.com/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import Dictionary from "../System/Collections/Dictionaries/Dictionary"; +import DisposableBase from "../System/Disposable/DisposableBase"; +export declare const enum EnumerableAction { + Break = 0, + Return = 1, + Skip = 2, +} +export declare class InfiniteEnumerable extends DisposableBase implements IEnumerable { + protected _enumeratorFactory: () => IEnumerator; + constructor(_enumeratorFactory: () => IEnumerator, finalizer?: () => void); + protected _isEndless: boolean; + isEndless: boolean; + getEnumerator(): IEnumerator; + protected _onDispose(): void; + asEnumerable(): InfiniteEnumerable; + doAction(action: Action | Predicate | Selector | Selector, initializer?: () => void, isEndless?: boolean): InfiniteEnumerable; + force(): void; + skip(count: number): InfiniteEnumerable; + take(count: number): FiniteEnumerable; + elementAt(index: number): T; + elementAtOrDefault(index: number, defaultValue?: T): T; + first(): T; + firstOrDefault(defaultValue?: T): T; + single(): T; + singleOrDefault(defaultValue?: T): T; + any(): boolean; + isEmpty(): boolean; + traverseBreadthFirst(childrenSelector: (element: T) => IEnumerableOrArray): Enumerable; + traverseBreadthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray): Enumerable; + traverseBreadthFirst(childrenSelector: (element: T) => IEnumerableOrArray, resultSelector?: (element: T, nestLevel?: number) => TResult): Enumerable; + traverseBreadthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray, resultSelector?: (element: TNode, nestLevel?: number) => TResult): Enumerable; + traverseDepthFirst(childrenSelector: (element: T) => IEnumerableOrArray): Enumerable; + traverseDepthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray): Enumerable; + traverseDepthFirst(childrenSelector: (element: T) => IEnumerableOrArray, resultSelector?: (element: T, nestLevel?: number) => TResult): Enumerable; + traverseDepthFirst(childrenSelector: (element: T | TNode) => IEnumerableOrArray, resultSelector?: (element: TNode, nestLevel?: number) => TResult): Enumerable; + flatten(): Enumerable; + pairwise(selector: (prev: T, current: T) => TSelect): Enumerable; + scan(func: (a: T, b: T) => T, seed?: T): Enumerable; + select(selector: Selector): InfiniteEnumerable; + protected _selectMany(collectionSelector: Selector>, resultSelector?: (collection: T, element: TElement) => TResult): Enumerable; + selectMany(collectionSelector: Selector>): InfiniteEnumerable; + selectMany(collectionSelector: Selector>, resultSelector: (collection: T, element: TElement) => TResult): InfiniteEnumerable; + protected _choose(selector: Selector): Enumerable; + choose(): InfiniteEnumerable; + choose(selector?: Selector): InfiniteEnumerable; + where(predicate: Predicate): InfiniteEnumerable; + ofType(type: { + new (...params: any[]): TType; + }): InfiniteEnumerable; + except(second: IEnumerableOrArray, compareSelector?: Selector): InfiniteEnumerable; + distinct(compareSelector?: (value: T) => T): InfiniteEnumerable; + distinctUntilChanged(compareSelector?: Selector): InfiniteEnumerable; + defaultIfEmpty(defaultValue?: T): Enumerable; + zip(second: IEnumerableOrArray, resultSelector: (first: T, second: TSecond, index?: number) => TResult): Enumerable; + zipMultiple(second: IArray>, resultSelector: (first: T, second: TSecond, index?: number) => TResult): Enumerable; + join(inner: IEnumerableOrArray, outerKeySelector: Selector, innerKeySelector: Selector, resultSelector: (outer: T, inner: TInner) => TResult, compareSelector?: Selector): Enumerable; + groupJoin(inner: IEnumerableOrArray, outerKeySelector: Selector, innerKeySelector: Selector, resultSelector: (outer: T, inner: TInner[]) => TResult, compareSelector?: Selector): Enumerable; + merge(enumerables: IArray>): InfiniteEnumerable; + concat(...enumerables: Array>): InfiniteEnumerable; + union(second: IEnumerableOrArray, compareSelector?: Selector): Enumerable; + insertAt(index: number, other: IEnumerableOrArray): Enumerable; + alternateMultiple(sequence: IEnumerableOrArray): Enumerable; + alternateSingle(value: T): Enumerable; + alternate(...sequence: T[]): Enumerable; + catchError(handler: (e: any) => void): InfiniteEnumerable; + finallyAction(action: () => void): InfiniteEnumerable; + buffer(size: number): InfiniteEnumerable; + share(): InfiniteEnumerable; +} +export declare class Enumerable extends InfiniteEnumerable { + constructor(enumeratorFactory: () => IEnumerator, finalizer?: () => void, isEndless?: boolean); + static from(source: IEnumerableOrArray): Enumerable; + static fromAny(source: IEnumerableOrArray): Enumerable; + static fromAny(source: any): Enumerable; + static fromOrEmpty(source: IEnumerableOrArray): Enumerable; + static toArray(source: IEnumerableOrArray): T[]; + static choice(values: IArray): InfiniteEnumerable; + static chooseFrom(...args: T[]): InfiniteEnumerable; + static cycle(values: IArray): InfiniteEnumerable; + static cycleThrough(...args: T[]): InfiniteEnumerable; + static empty(): FiniteEnumerable; + static repeat(element: T): InfiniteEnumerable; + static repeat(element: T, count: number): FiniteEnumerable; + static repeatWithFinalize(initializer: () => T, finalizer: (element: T) => void): InfiniteEnumerable; + static make(element: T): FiniteEnumerable; + static range(start: number, count: number, step?: number): FiniteEnumerable; + static rangeDown(start: number, count: number, step?: number): FiniteEnumerable; + static toInfinity(start?: number, step?: number): InfiniteEnumerable; + static toNegativeInfinity(start?: number, step?: number): InfiniteEnumerable; + static rangeTo(start: number, to: number, step?: number): FiniteEnumerable; + static matches(input: string, pattern: any, flags?: string): FiniteEnumerable; + static generate(factory: (index?: number) => T): InfiniteEnumerable; + static generate(factory: (index?: number) => T, count: number): FiniteEnumerable; + static unfold(seed: T, valueFactory: Selector, skipSeed?: Boolean): InfiniteEnumerable; + static forEach(enumerable: IEnumerableOrArray, action: (element: T, index?: number) => any): void; + static map(enumerable: IEnumerableOrArray, selector: Selector): TResult[]; + static max(values: FiniteEnumerable): number; + static min(values: FiniteEnumerable): number; + static weave(enumerables: IEnumerableOrArray>): Enumerable; + doAction(action: Action | Predicate | Selector | Selector, initializer?: () => void, isEndless?: boolean): Enumerable; + skip(count: number): Enumerable; + skipWhile(predicate: Predicate): Enumerable; + takeWhile(predicate: Predicate): Enumerable; + takeUntil(predicate: Predicate, includeUntilValue?: boolean): Enumerable; + forEach(action: Predicate | Action): void; + toArray(predicate?: Predicate): T[]; + copyTo(target: T[], index?: number): T[]; + toLookup(keySelector: Selector, elementSelector?: Selector, compareSelector?: Selector): ILookup; + toMap(keySelector: Selector, elementSelector: Selector): IMap; + toDictionary(keySelector: Selector, elementSelector: Selector, compareSelector?: Selector): Dictionary; + toJoinedString(separator?: string, selector?: Selector): string; + takeExceptLast(count?: number): Enumerable; + skipToLast(count: number): Enumerable; + where(predicate: Predicate): Enumerable; + select(selector: Selector): Enumerable; + selectMany(collectionSelector: Selector>): Enumerable; + selectMany(collectionSelector: Selector>, resultSelector: (collection: T, element: TElement) => TResult): Enumerable; + choose(): Enumerable; + choose(selector?: Selector): Enumerable; + reverse(): Enumerable; + shuffle(): Enumerable; + count(predicate?: Predicate): number; + all(predicate: Predicate): boolean; + every(predicate: Predicate): boolean; + any(predicate?: Predicate): boolean; + some(predicate: Predicate): boolean; + contains(value: T, compareSelector?: Selector): boolean; + indexOf(value: T, compareSelector?: Selector): number; + lastIndexOf(value: T, compareSelector?: Selector): number; + merge(enumerables: IArray>): Enumerable; + concat(...enumerables: Array>): Enumerable; + intersect(second: IEnumerableOrArray, compareSelector?: Selector): Enumerable; + sequenceEqual(second: IEnumerableOrArray, equalityComparer?: EqualityComparison): boolean; + ofType(type: { + new (...params: any[]): TType; + }): Enumerable; + except(second: IEnumerableOrArray, compareSelector?: Selector): Enumerable; + distinct(compareSelector?: (value: T) => T): Enumerable; + distinctUntilChanged(compareSelector?: Selector): Enumerable; + orderBy(keySelector?: Selector): IOrderedEnumerable; + orderUsing(comparison: Comparison): IOrderedEnumerable; + orderUsingReversed(comparison: Comparison): IOrderedEnumerable; + orderByDescending(keySelector?: Selector): IOrderedEnumerable; + buffer(size: number): Enumerable; + groupBy(keySelector: Selector): Enumerable>; + groupBy(keySelector: Selector, elementSelector?: Selector, compareSelector?: Selector): Enumerable>; + partitionBy(keySelector: Selector): Enumerable>; + partitionBy(keySelector: Selector, elementSelector: Selector, resultSelector?: (key: TKey, element: TElement[]) => IGrouping, compareSelector?: Selector): Enumerable>; + aggregate(func: (a: T, b: T) => T, seed?: T): T; + average(selector?: Selector): number; + max(): T; + min(): T; + maxBy(keySelector?: Selector): T; + minBy(keySelector?: Selector): T; + sum(selector?: Selector): number; + product(selector?: Selector): number; + quotient(selector?: Selector): number; + last(): T; + lastOrDefault(defaultValue?: T): T; + share(): Enumerable; + catchError(handler: (e: any) => void): Enumerable; + finallyAction(action: () => void): Enumerable; + memoize(): Enumerable; +} +export declare class FiniteEnumerable extends Enumerable { + constructor(enumeratorFactory: () => IEnumerator, finalizer?: () => void); +} +export interface IGrouping extends Enumerable { + key: TKey; +} +export interface ILookup extends IEnumerable> { + count: number; + get(key: TKey): TElement[]; + contains(key: TKey): boolean; +} +export interface IOrderedEnumerable extends FiniteEnumerable { + thenBy(keySelector: (value: T) => any): IOrderedEnumerable; + thenByDescending(keySelector: (value: T) => any): IOrderedEnumerable; + thenUsing(comparison: Comparison): IOrderedEnumerable; + thenUsingReversed(comparison: Comparison): IOrderedEnumerable; +} +export default Enumerable; diff --git a/dist/umd.min/System/Char.d.ts b/dist/umd.min/System/Char.d.ts new file mode 100644 index 00000000..fa6b5cef --- /dev/null +++ b/dist/umd.min/System/Char.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * From Netjs mscorlib.ts + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function isWhiteSpace(ch: number): boolean; +export declare function isLetter(ch: number): boolean; +export declare function isLetterOrDigit(ch: number): boolean; +export declare function isDigit(ch: number): boolean; +export declare function isDigit(str: string, index: number): boolean; diff --git a/dist/umd.min/System/Collections/Array/Compare.d.ts b/dist/umd.min/System/Collections/Array/Compare.d.ts new file mode 100644 index 00000000..2ce82c2d --- /dev/null +++ b/dist/umd.min/System/Collections/Array/Compare.d.ts @@ -0,0 +1,13 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function areAllEqual(arrays: any[][], strict?: boolean, equalityComparer?: EqualityComparison): boolean; +export declare function areEqual(a: IArray, b: IArray, strict?: boolean, equalityComparer?: EqualityComparison): boolean; +export declare function areEquivalent(a: IArray, b: IArray): boolean; +export declare function areEquivalent(a: IArray>, b: IArray>): boolean; +export declare function areEquivalent(a: IArray, b: IArray, comparer: Comparison): boolean; diff --git a/dist/umd.min/System/Collections/Array/Dispatch.d.ts b/dist/umd.min/System/Collections/Array/Dispatch.d.ts new file mode 100644 index 00000000..d9d28acc --- /dev/null +++ b/dist/umd.min/System/Collections/Array/Dispatch.d.ts @@ -0,0 +1,13 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export interface DispatchErrorHandler { + (ex?: any, i?: number): void; +} +export declare function unsafe(listeners: IArray<(payload: T) => any>, payload: T, trap?: boolean | DispatchErrorHandler): void; +export declare function mapped(listeners: IArray<(payload: T) => TResult>, payload: T, trap?: boolean | DispatchErrorHandler): TResult[]; +export declare function dispatch(listeners: IArray<(payload: T) => any>, payload: T, trap?: boolean | DispatchErrorHandler): void; +export default dispatch; diff --git a/dist/umd.min/System/Collections/Array/Dispatch.js b/dist/umd.min/System/Collections/Array/Dispatch.js new file mode 100644 index 00000000..3d5bce7b --- /dev/null +++ b/dist/umd.min/System/Collections/Array/Dispatch.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define(["require","exports","../../Types","./Utility"],e)}(function(e,t){"use strict";function i(e,t,i){if(e&&e.length)for(var o=0,n=e.length;n>o;o++){var f=e[o];if(f)try{f(t)}catch(u){if(!i)throw u;r["default"].isFunction(i)&&i(u,o)}}}function o(e,t,i){if(!e)return null;var o=f.copy(e);if(e.length)for(var n=0,c=o.length;c>n;n++){var a=o[n];try{o[n]=a?a(t):u}catch(l){if(o[n]=u,!i)throw l;r["default"].isFunction(i)&&i(l,n)}}return o}function n(e,t,o){i(f.copy(e),t,o)}var r=e("../../Types"),f=e("./Utility"),u=void 0;t.unsafe=i,t.mapped=o,t.dispatch=n,Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n}); +//# sourceMappingURL=Dispatch.js.map diff --git a/dist/umd.min/System/Collections/Array/Dispatch.js.map b/dist/umd.min/System/Collections/Array/Dispatch.js.map new file mode 100644 index 00000000..d931ab86 --- /dev/null +++ b/dist/umd.min/System/Collections/Array/Dispatch.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Collections/Array/Dispatch.js","System/Collections/Array/Dispatch.ts"],"names":["factory","module","exports","v","require","undefined","define","amd","unsafe","listeners","payload","trap","length","i","len","fn","ex","Types_1","isFunction","mapped","result","Utility_1","copy","VOID0","dispatch","Object","defineProperty","value"],"mappings":";;;;CAIA,SAAWA,GACP,GAAsB,gBAAXC,SAAiD,gBAAnBA,QAAOC,QAAsB,CAClE,GAAIC,GAAIH,EAAQI,QAASF,QAAoBG,UAANF,IAAiBF,OAAOC,QAAUC,OAElD,kBAAXG,SAAyBA,OAAOC,KAC5CD,QAAQ,UAAW,UAAW,cAAe,aAAcN,IAEhE,SAAUI,EAASF,GAClB,YC0BJ,SAAAM,GACCC,EACAC,EAAWC,GAEX,GAAGF,GAAaA,EAAUG,OAEzB,IAAI,GAAIC,GAAI,EAAGC,EAAML,EAAUG,OAAUE,EAAFD,EAAOA,IAC9C,CACC,GAAIE,GAAcN,EAAUI,EAC5B,IAAIE,EACJ,IAECA,EAAGL,GAEJ,MAAMM,GAEL,IAAIL,EACH,KAAMK,EACCC,GAAAA,WAAKC,WAAWP,IACvBA,EAAKK,EAAIH,KAed,QAAAM,GACCV,EACAC,EAAWC,GAGX,IAAIF,EAAW,MAAO,KAEtB,IAAIW,GAAeC,EAAAC,KAAKb,EACxB,IAAGA,EAAUG,OAGZ,IAAI,GAAIC,GAAI,EAAGC,EAAMM,EAAOR,OAAUE,EAAFD,EAAOA,IAC3C,CACC,GAAIE,GAAcK,EAAOP,EACzB,KAECO,EAAOP,GAAKE,EACTA,EAAGL,GACHa,EAEJ,MAAMP,GAGL,GADAI,EAAOP,GAAKU,GACRZ,EACH,KAAMK,EACCC,GAAAA,WAAKC,WAAWP,IACvBA,EAAKK,EAAIH,IAKb,MAAOO,GAYR,QAAAI,GACCf,EACAC,EAAWC,GAEXH,EAAOa,EAAAC,KAAKb,GAAYC,EAASC,GAhHlC,GAAAM,GAAAb,EAAiB,eACjBiB,EAAAjB,EAAmB,aAEbmB,EAAY,MA4BFrB,GAAAM,OAAMA,EAkCNN,EAAAiB,OAAMA,EA2CNjB,EAAAsB,SAAQA,EAOxBC,OAAAC,eAAAxB,EAAA,cAAAyB,OAAA,ID1DIzB,EAAAA,WC0DWsB","file":"System/Collections/Array/Dispatch.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\n(function (factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define([\"require\", \"exports\", \"../../Types\", \"./Utility\"], factory);\n }\n})(function (require, exports) {\n \"use strict\";\n var Types_1 = require(\"../../Types\");\n var Utility_1 = require(\"./Utility\");\n var VOID0 = void (0);\n function unsafe(listeners, payload, trap) {\n if (listeners && listeners.length) {\n for (var i = 0, len = listeners.length; i < len; i++) {\n var fn = listeners[i];\n if (!fn)\n continue;\n try {\n fn(payload);\n }\n catch (ex) {\n if (!trap)\n throw ex;\n else if (Types_1.default.isFunction(trap))\n trap(ex, i);\n }\n }\n }\n }\n exports.unsafe = unsafe;\n function mapped(listeners, payload, trap) {\n if (!listeners)\n return null;\n var result = Utility_1.copy(listeners);\n if (listeners.length) {\n for (var i = 0, len = result.length; i < len; i++) {\n var fn = result[i];\n try {\n result[i] = fn\n ? fn(payload)\n : VOID0;\n }\n catch (ex) {\n result[i] = VOID0;\n if (!trap)\n throw ex;\n else if (Types_1.default.isFunction(trap))\n trap(ex, i);\n }\n }\n }\n return result;\n }\n exports.mapped = mapped;\n function dispatch(listeners, payload, trap) {\n unsafe(Utility_1.copy(listeners), payload, trap);\n }\n exports.dispatch = dispatch;\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = dispatch;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n///\r\n///\r\nimport Type from \"../../Types\";\r\nimport {copy} from \"./Utility\";\r\n\r\nconst VOID0:any = void(0);\r\n\r\nexport interface DispatchErrorHandler\r\n{\r\n\t(ex?:any, i?:number):void;\r\n}\r\n\r\n/**\r\n * Simply takes a payload and passes it to all the listeners.\r\n *\r\n * While dispatching:\r\n * * This is an unsafe method if by chance any of the listeners modify the array.\r\n * * It cannot prevent changes to the payload.\r\n *\r\n * Improving safety:\r\n * * Only use a local array that isn't exposed to the listeners.\r\n * * Use the dispatch method instead as it makes a copy of the listeners array.\r\n * * Freeze the listeners array so it can't be modified.\r\n * * Freeze the payload.\r\n *\r\n * Specifying trap will catch any errors and pass them along if trap is a function.\r\n * A payload is used instead of arguments for easy typing.\r\n *\r\n *\r\n * @param listeners\r\n * @param payload\r\n * @param trap\r\n */\r\nexport function unsafe(\r\n\tlisteners:IArray<(payload:T)=>any>,\r\n\tpayload:T, trap?:boolean|DispatchErrorHandler):void\r\n{\r\n\tif(listeners && listeners.length)\r\n\t{\r\n\t\tfor(let i = 0, len = listeners.length; i(\r\n\tlisteners:IArray<(payload:T)=>TResult>,\r\n\tpayload:T, trap?:boolean|DispatchErrorHandler):TResult[]\r\n{\r\n\r\n\tif(!listeners) return null;\r\n\t// Reuse the copy as the array result.\r\n\tvar result:any[] = copy(listeners);\r\n\tif(listeners.length)\r\n\t{\r\n\r\n\t\tfor(let i = 0, len = result.length; i(\r\n\tlisteners:IArray<(payload:T)=>any>,\r\n\tpayload:T, trap?:boolean|DispatchErrorHandler):void\r\n{\r\n\tunsafe(copy(listeners), payload, trap);\r\n}\r\n\r\nexport default dispatch;"]} \ No newline at end of file diff --git a/dist/umd.min/System/Collections/Array/Procedure.d.ts b/dist/umd.min/System/Collections/Array/Procedure.d.ts new file mode 100644 index 00000000..227353e3 --- /dev/null +++ b/dist/umd.min/System/Collections/Array/Procedure.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function sum(source: number[], ignoreNaN?: boolean): number; +export declare function average(source: number[], ignoreNaN?: boolean): number; +export declare function product(source: number[], ignoreNaN?: boolean): number; +export declare function quotient(source: number[], ignoreNaN?: boolean): number; +export declare function min(source: number[], ignoreNaN?: boolean): number; +export declare function max(source: number[], ignoreNaN?: boolean): number; diff --git a/dist/umd.min/System/Collections/Array/Procedure.js b/dist/umd.min/System/Collections/Array/Procedure.js new file mode 100644 index 00000000..4de1b08f --- /dev/null +++ b/dist/umd.min/System/Collections/Array/Procedure.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +!function(n){if("object"==typeof module&&"object"==typeof module.exports){var e=n(require,exports);void 0!==e&&(module.exports=e)}else"function"==typeof define&&define.amd&&define(["require","exports"],n)}(function(n,e){"use strict";function r(n,e){if(void 0===e&&(e=!1),!n||!n.length)return 0;var r=0;return e?n.forEach(function(n){isNaN(n)||(r+=n)}):n.every(function(n){return r+=n,!isNaN(r)}),r}function t(n,e){if(void 0===e&&(e=!1),!n||!n.length)return NaN;var r,t=0;return e?(r=0,n.forEach(function(n){isNaN(n)||(t+=n,r++)})):(r=n.length,n.every(function(n){return t+=n,!isNaN(t)})),!r||isNaN(t)?NaN:t/r}function i(n,e){if(void 0===e&&(e=!1),!n||!n.length)return NaN;var r=1;if(e){var t=!1;n.forEach(function(n){isNaN(n)||(r*=n,t||(t=!0))}),t||(r=NaN)}else n.every(function(n){return isNaN(n)?(r=NaN,!1):(r*=n,!0)});return r}function u(n,e){if(void 0===e&&(e=!1),!n||n.length<2)return NaN;var r=n[0],t=!1;return n.every(function(n,i){if(i){if(0===n)return r=NaN,!1;if(isNaN(n)){if(!e)return r=NaN,!1}else r/=n,t||(t=!0)}return!0}),t||(r=NaN),r}function o(n,e,r,t){if(!n||!n.length)return NaN;var i=e;if(r){var u=!1;n.forEach(function(n){isNaN(n)||(t(n,i)&&(i=n),u||(u=!0))}),u||(i=NaN)}else n.every(function(n){return isNaN(n)?(i=NaN,!1):(t(n,i)&&(i=n),!0)});return i}function N(n,e){return void 0===e&&(e=!1),o(n,+(1/0),e,function(n,e){return e>n})}function f(n,e){return void 0===e&&(e=!1),o(n,-(1/0),e,function(n,e){return n>e})}e.sum=r,e.average=t,e.product=i,e.quotient=u,e.min=N,e.max=f}); +//# sourceMappingURL=Procedure.js.map diff --git a/dist/umd.min/System/Collections/Array/Procedure.js.map b/dist/umd.min/System/Collections/Array/Procedure.js.map new file mode 100644 index 00000000..8a63ac24 --- /dev/null +++ b/dist/umd.min/System/Collections/Array/Procedure.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Collections/Array/Procedure.js","System/Collections/Array/Procedure.ts"],"names":["factory","module","exports","v","require","undefined","define","amd","sum","source","ignoreNaN","length","result","forEach","n","isNaN","every","average","NaN","count","product","found","quotient","i","ifSet","start","predicate","min","Infinity","max"],"mappings":";;;;CAIA,SAAWA,GACP,GAAsB,gBAAXC,SAAiD,gBAAnBA,QAAOC,QAAsB,CAClE,GAAIC,GAAIH,EAAQI,QAASF,QAAoBG,UAANF,IAAiBF,OAAOC,QAAUC,OAElD,kBAAXG,SAAyBA,OAAOC,KAC5CD,QAAQ,UAAW,WAAYN,IAEpC,SAAUI,EAASF,GAClB,YCNJ,SAAAM,GA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M,KACF,MAKRN,IAAUE,EACNO,IAAOA,GAAQ,GAGrB,OAAO,IAGJA,IACHT,EAASM,KAEHN,EAIR,QAAAY,GACCf,EACAgB,EACAf,EACAgB,GAEA,IAAIjB,IAAWA,EAAOE,OACrB,MAAOO,IAER,IAAIN,GAASa,CACb,IAAGf,EACH,CACC,GAAIW,IAAQ,CACZZ,GAAOI,QAAQ,SAAAC,GAEVC,MAAMD,KAENY,EAAUZ,EAAGF,KACfA,EAASE,GACNO,IAAOA,GAAQ,MAIjBA,IACHT,EAASM,SAIVT,GAAOO,MAAM,SAAAF,GAEZ,MAAGC,OAAMD,IAERF,EAASM,KACF,IAGLQ,EAAUZ,EAAGF,KACfA,EAASE,IAEH,IAGT,OAAOF,GAIR,QAAAe,GAAoBlB,EAAiBC,GAEpC,MAFoC,UAAAA,IAAAA,GAAA,GAE7Bc,EAAMf,IAASmB,EAAAA,GAAUlB,EAAW,SAACI,EAAGF,GAAW,MAAEA,GAAFE,IAG3D,QAAAe,GAAoBpB,EAAiBC,GAEpC,MAFoC,UAAAA,IAAAA,GAAA,GAE7Bc,EAAMf,IAASmB,EAAAA,GAAUlB,EAAW,SAACI,EAAGF,GAAW,MAAAE,GAAEF,IAjM7CV,EAAAM,IAAGA,EAqBHN,EAAAe,QAAOA,EAiCPf,EAAAkB,QAAOA,EA8CPlB,EAAAoB,SAAQA,EAsFRpB,EAAAyB,IAAGA,EAKHzB,EAAA2B,IAAGA","file":"System/Collections/Array/Procedure.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\n(function (factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define([\"require\", \"exports\"], factory);\n }\n})(function (require, exports) {\n \"use strict\";\n function sum(source, ignoreNaN) {\n if (ignoreNaN === void 0) { ignoreNaN = false; }\n if (!source || !source.length)\n return 0;\n var result = 0;\n if (ignoreNaN)\n source.forEach(function (n) {\n if (!isNaN(n))\n result += n;\n });\n else\n source.every(function (n) {\n result += n;\n return !isNaN(result);\n });\n return result;\n }\n exports.sum = sum;\n function average(source, ignoreNaN) {\n if (ignoreNaN === void 0) { ignoreNaN = false; }\n if (!source || !source.length)\n return NaN;\n var result = 0, count;\n if (ignoreNaN) {\n count = 0;\n source.forEach(function (n) {\n if (!isNaN(n)) {\n result += n;\n count++;\n }\n });\n }\n else {\n count = source.length;\n source.every(function (n) {\n result += n;\n return !isNaN(result);\n });\n }\n return (!count || isNaN(result)) ? NaN : (result / count);\n }\n exports.average = average;\n function product(source, ignoreNaN) {\n if (ignoreNaN === void 0) { ignoreNaN = false; }\n if (!source || !source.length)\n return NaN;\n var result = 1;\n if (ignoreNaN) {\n var found = false;\n source.forEach(function (n) {\n if (!isNaN(n)) {\n result *= n;\n if (!found)\n found = true;\n }\n });\n if (!found)\n result = NaN;\n }\n else {\n source.every(function (n) {\n if (isNaN(n)) {\n result = NaN;\n return false;\n }\n result *= n;\n return true;\n });\n }\n return result;\n }\n exports.product = product;\n function quotient(source, ignoreNaN) {\n if (ignoreNaN === void 0) { ignoreNaN = false; }\n if (!source || source.length < 2)\n return NaN;\n var result = source[0];\n var found = false;\n source.every(function (n, i) {\n if (i) {\n if (n === 0) {\n result = NaN;\n return false;\n }\n if (isNaN(n)) {\n if (!ignoreNaN) {\n result = NaN;\n return false;\n }\n }\n else {\n result /= n;\n if (!found)\n found = true;\n }\n }\n return true;\n });\n if (!found)\n result = NaN;\n return result;\n }\n exports.quotient = quotient;\n function ifSet(source, start, ignoreNaN, predicate) {\n if (!source || !source.length)\n return NaN;\n var result = start;\n if (ignoreNaN) {\n var found = false;\n source.forEach(function (n) {\n if (!isNaN(n)) {\n if (predicate(n, result))\n result = n;\n if (!found)\n found = true;\n }\n });\n if (!found)\n result = NaN;\n }\n else {\n source.every(function (n) {\n if (isNaN(n)) {\n result = NaN;\n return false;\n }\n if (predicate(n, result))\n result = n;\n return true;\n });\n }\n return result;\n }\n function min(source, ignoreNaN) {\n if (ignoreNaN === void 0) { ignoreNaN = false; }\n return ifSet(source, +Infinity, ignoreNaN, function (n, result) { return n < result; });\n }\n exports.min = min;\n function max(source, ignoreNaN) {\n if (ignoreNaN === void 0) { ignoreNaN = false; }\n return ifSet(source, -Infinity, ignoreNaN, function (n, result) { return n > result; });\n }\n exports.max = max;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n\r\nexport function sum(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\tif(!source || !source.length)\r\n\t\treturn 0;\r\n\r\n\tvar result = 0;\r\n\tif(ignoreNaN)\r\n\t\tsource.forEach(n =>\r\n\t\t{\r\n\t\t\tif(!isNaN(n)) result += n;\r\n\t\t});\r\n\telse\r\n\t\tsource.every(n =>\r\n\t\t{\r\n\t\t\tresult += n;\r\n\t\t\treturn !isNaN(result);\r\n\t\t});\r\n\r\n\treturn result;\r\n}\r\n\r\nexport function average(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\tif(!source || !source.length)\r\n\t\treturn NaN;\r\n\r\n\tvar result = 0, count:number;\r\n\tif(ignoreNaN)\r\n\t{\r\n\t\tcount = 0;\r\n\t\tsource.forEach(n =>\r\n\t\t{\r\n\t\t\tif(!isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tresult += n;\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}\r\n\telse\r\n\t{\r\n\t\tcount = source.length;\r\n\t\tsource.every(n =>\r\n\t\t{\r\n\t\t\tresult += n;\r\n\t\t\treturn !isNaN(result);\r\n\t\t});\r\n\r\n\t}\r\n\r\n\treturn (!count || isNaN(result)) ? NaN : (result/count);\r\n}\r\n\r\nexport function product(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\tif(!source || !source.length)\r\n\t\treturn NaN;\r\n\r\n\tvar result = 1;\r\n\tif(ignoreNaN)\r\n\t{\r\n\t\tvar found = false;\r\n\t\tsource.forEach(n =>\r\n\t\t{\r\n\t\t\tif(!isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tresult *= n;\r\n\t\t\t\tif(!found) found = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(!found)\r\n\t\t\tresult = NaN;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tsource.every(n =>\r\n\t\t{\r\n\t\t\tif(isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tresult = NaN;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tresult *= n;\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\n/**\r\n * Takes the first number and divides it by all following.\r\n * @param source\r\n * @param ignoreNaN Will cause this skip any NaN values.\r\n * @returns {number}\r\n */\r\nexport function quotient(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\tif(!source || source.length<2)\r\n\t\treturn NaN;\r\n\r\n\tvar result = source[0];\r\n\r\n\tvar found = false;\r\n\tsource.every((n,i) =>\r\n\t{\r\n\t\tif(i) {\r\n\t\t\tif(n===0)\r\n\t\t\t{\r\n\t\t\t\tresult = NaN;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tif(isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tif(!ignoreNaN)\r\n\t\t\t\t{\r\n\t\t\t\t\tresult = NaN;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tresult /= n;\r\n\t\t\t\tif(!found) found = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tif(!found)\r\n\t\tresult = NaN;\r\n\r\n\treturn result;\r\n}\r\n\r\n\r\nfunction ifSet(\r\n\tsource:number[],\r\n\tstart:number,\r\n\tignoreNaN:boolean,\r\n\tpredicate:(n:number, result:number) => boolean)\r\n{\r\n\tif(!source || !source.length)\r\n\t\treturn NaN;\r\n\r\n\tvar result = start;\r\n\tif(ignoreNaN)\r\n\t{\r\n\t\tvar found = false;\r\n\t\tsource.forEach(n =>\r\n\t\t{\r\n\t\t\tif(!isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tif(predicate(n, result))\r\n\t\t\t\t\tresult = n;\r\n\t\t\t\tif(!found) found = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(!found)\r\n\t\t\tresult = NaN;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tsource.every(n =>\r\n\t\t{\r\n\t\t\tif(isNaN(n))\r\n\t\t\t{\r\n\t\t\t\tresult = NaN;\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif(predicate(n, result))\r\n\t\t\t\tresult = n;\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\t}\r\n\treturn result;\r\n\r\n}\r\n\r\nexport function min(source:number[], ignoreNaN:boolean = false):number\r\n{\r\n\treturn ifSet(source, +Infinity, ignoreNaN, (n, result) => n n>result);\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/umd.min/System/Collections/Array/ReadOnlyArrayWrapper.d.ts b/dist/umd.min/System/Collections/Array/ReadOnlyArrayWrapper.d.ts new file mode 100644 index 00000000..88e74cbc --- /dev/null +++ b/dist/umd.min/System/Collections/Array/ReadOnlyArrayWrapper.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ReadOnlyCollectionBase from "../ReadOnlyCollectionBase"; +export default class ReadOnlyArrayWrapper extends ReadOnlyCollectionBase { + constructor(array: IArray); + getValueAt: (index: number) => T; +} diff --git a/dist/umd.min/System/Collections/Array/ReadOnlyArrayWrapper.js b/dist/umd.min/System/Collections/Array/ReadOnlyArrayWrapper.js new file mode 100644 index 00000000..0726a3d8 --- /dev/null +++ b/dist/umd.min/System/Collections/Array/ReadOnlyArrayWrapper.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +var __extends=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)};!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define(["require","exports","../../Exceptions/ArgumentNullException","../Enumeration/Enumerator","../ReadOnlyCollectionBase"],e)}(function(e,t){"use strict";var n=e("../../Exceptions/ArgumentNullException"),o=e("../Enumeration/Enumerator"),r=e("../ReadOnlyCollectionBase"),u=function(e){function t(t){if(e.call(this),!t)throw new n["default"]("array");var r=this;r._getCount=function(){return t.length},r.getEnumerator=function(){return o.from(t)},r.getValueAt=function(e){return t[e]}}return __extends(t,e),t}(r["default"]);Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=u}); +//# sourceMappingURL=ReadOnlyArrayWrapper.js.map diff --git a/dist/umd.min/System/Collections/Array/ReadOnlyArrayWrapper.js.map b/dist/umd.min/System/Collections/Array/ReadOnlyArrayWrapper.js.map new file mode 100644 index 00000000..6bbb38b4 --- /dev/null +++ b/dist/umd.min/System/Collections/Array/ReadOnlyArrayWrapper.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Collections/Array/ReadOnlyArrayWrapper.js","System/Collections/Array/ReadOnlyArrayWrapper.ts"],"names":["__extends","this","d","b","__","constructor","p","hasOwnProperty","prototype","Object","create","factory","module","exports","v","require","undefined","define","amd","ArgumentNullException_1","Enumerator_1","ReadOnlyCollectionBase_1","ReadOnlyArrayWrapper","_super","array","call","_","_getCount","length","getEnumerator","from","getValueAt","i","defineProperty","value"],"mappings":";;;;AAIA,GAAIA,WAAaC,MAAQA,KAAKD,WAAc,SAAUE,EAAGC,GAErD,QAASC,KAAOH,KAAKI,YAAcH,EADnC,IAAK,GAAII,KAAKH,GAAOA,EAAEI,eAAeD,KAAIJ,EAAEI,GAAKH,EAAEG,GAEnDJ,GAAEM,UAAkB,OAANL,EAAaM,OAAOC,OAAOP,IAAMC,EAAGI,UAAYL,EAAEK,UAAW,GAAIJ,MAEnF,SAAWO,GACP,GAAsB,gBAAXC,SAAiD,gBAAnBA,QAAOC,QAAsB,CAClE,GAAIC,GAAIH,EAAQI,QAASF,QAAoBG,UAANF,IAAiBF,OAAOC,QAAUC,OAElD,kBAAXG,SAAyBA,OAAOC,KAC5CD,QAAQ,UAAW,UAAW,yCAA0C,4BAA6B,6BAA8BN,IAExI,SAAUI,EAASF,GAClB,YCZJ,IAAAM,GAAAJ,EAAkC,0CAClCK,EAAAL,EAAqC,6BACrCM,EAAAN,EAAmC,6BAEnCO,EAAA,SAAAC,GAGC,QAAAD,GAAYE,GAGX,GADAD,EAAAE,KAAAxB,OACIuB,EACH,KAAM,IAAIL,GAAAA,WAAsB,QAEjC,IAAIO,GAAIzB,IACRyB,GAAEC,UAAY,WAAM,MAAAH,GAAMI,QAC1BF,EAAEG,cAAgB,WAAM,MAAAT,GAAAU,KAAeN,IACvCE,EAAEK,WAAa,SAAAC,GAAK,MAAAR,GAAMQ,IAI5B,MAhBqDhC,WAAAsB,EAAAC,GAgBrDD,GAhBqDD,EAAAA,WAArDZ,QAAAwB,eAAApB,EAAA,cAAAqB,OAAA,ID0BIrB,EAAAA,WAAkBS","file":"System/Collections/Array/ReadOnlyArrayWrapper.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n(function (factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define([\"require\", \"exports\", \"../../Exceptions/ArgumentNullException\", \"../Enumeration/Enumerator\", \"../ReadOnlyCollectionBase\"], factory);\n }\n})(function (require, exports) {\n \"use strict\";\n var ArgumentNullException_1 = require(\"../../Exceptions/ArgumentNullException\");\n var Enumerator_1 = require(\"../Enumeration/Enumerator\");\n var ReadOnlyCollectionBase_1 = require(\"../ReadOnlyCollectionBase\");\n var ReadOnlyArrayWrapper = (function (_super) {\n __extends(ReadOnlyArrayWrapper, _super);\n function ReadOnlyArrayWrapper(array) {\n _super.call(this);\n if (!array)\n throw new ArgumentNullException_1.default('array');\n var _ = this;\n _._getCount = function () { return array.length; };\n _.getEnumerator = function () { return Enumerator_1.from(array); };\n _.getValueAt = function (i) { return array[i]; };\n }\n return ReadOnlyArrayWrapper;\n }(ReadOnlyCollectionBase_1.default));\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = ReadOnlyArrayWrapper;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\nimport ArgumentNullException from \"../../Exceptions/ArgumentNullException\";\r\nimport {from as enumeratorFrom} from \"../Enumeration/Enumerator\";\r\nimport ReadOnlyCollectionBase from \"../ReadOnlyCollectionBase\";\r\n\r\nexport default class ReadOnlyArrayWrapper extends ReadOnlyCollectionBase\r\n{\r\n\r\n\tconstructor(array:IArray)\r\n\t{\r\n\t\tsuper();\r\n\t\tif(!array)\r\n\t\t\tthrow new ArgumentNullException('array');\r\n\r\n\t\tvar _ = this;\r\n\t\t_._getCount = () => array.length;\r\n\t\t_.getEnumerator = () => enumeratorFrom(array);\r\n\t\t_.getValueAt = i => array[i];\r\n\t}\r\n\r\n\tgetValueAt:(index:number)=>T;\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/umd.min/System/Collections/Array/Sort.d.ts b/dist/umd.min/System/Collections/Array/Sort.d.ts new file mode 100644 index 00000000..5524bcb8 --- /dev/null +++ b/dist/umd.min/System/Collections/Array/Sort.d.ts @@ -0,0 +1,9 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function createComparer(selector: Selector, order?: Order | Order[], equivalentToNaN?: any): Comparison; +export { createComparer as default, createComparer as by }; diff --git a/dist/umd.min/System/Collections/Array/Sort.js b/dist/umd.min/System/Collections/Array/Sort.js new file mode 100644 index 00000000..5fff322c --- /dev/null +++ b/dist/umd.min/System/Collections/Array/Sort.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +!function(e){if("object"==typeof module&&"object"==typeof module.exports){var r=e(require,exports);void 0!==r&&(module.exports=r)}else"function"==typeof define&&define.amd&&define(["require","exports","../../Types","../../Compare"],e)}(function(e,r){"use strict";function t(e){return Array.isArray(e)?e:[e]}function o(e,r,o){void 0===r&&(r=1),void 0===o&&(o=NaN);var u=!a["default"].isTrueNaN(o);return function(i,f){for(var d=t(e(i)),s=t(e(f)),l=Math.min(d.length,s.length),p=Array.isArray(r)?r:null,c=0;l>c;c++){var y=d[c],m=s[c],v=p?c\r\n///\r\n///\r\n\r\nimport Type from '../../Types';\r\nimport {compare} from '../../Compare';\r\n\r\nfunction ensureArray(value:T|T[]):T[]\r\n{\r\n\treturn Array.isArray(value)\r\n\t\t? value\r\n\t\t: [value];\r\n}\r\n\r\n/**\r\n * A factory function that creates a comparer to be used in multi-dimensional sorting.\r\n *\r\n *

Example

\r\n * ```typescript\r\n * var myArray = [{a:1:b:2},{a:3,b:4},{a:1,b:3}];\r\n *\r\n * // First sort by a, then by b.\r\n * myArray.sort(\r\n * createComparer(\r\n * (e)=> [e.a, e.b],\r\n * [Order.Ascending, Order.Descending]\r\n * )\r\n * );\r\n *\r\n * // result: [{a:1,b:3},{a:1:b:2},{a:3,b:4}]\r\n * ```\r\n *\r\n * @param selector\r\n * @param order\r\n * @param equivalentToNaN\r\n * @returns {function((TSource|TSource[]), (TSource|TSource[])): CompareResult}\r\n */\r\nexport function createComparer(\r\n\tselector:Selector,\r\n\torder:Order | Order[] = Order.Ascending,\r\n\tequivalentToNaN:any = NaN):Comparison\r\n{\r\n\tvar nanHasEquivalent = !Type.isTrueNaN(equivalentToNaN);\r\n\r\n\treturn (a:TSource|TSource[], b:TSource|TSource[]):CompareResult=>\r\n\t{\r\n\t\t// Use an array always to ensure a single code path.\r\n\t\tvar aValue = ensureArray(selector(a));\r\n\t\tvar bValue = ensureArray(selector(b));\r\n\t\tvar len = Math.min(aValue.length, bValue.length);\r\n\r\n\t\tvar oArray:Order[] = Array.isArray(order) ? order : null;\r\n\t\tfor(let i = 0; iorder;\r\n\r\n\t\t\tif(nanHasEquivalent)\r\n\t\t\t{\r\n\t\t\t\tif(Type.isTrueNaN(vA))\r\n\t\t\t\t\tvA = equivalentToNaN;\r\n\t\t\t\tif(Type.isTrueNaN(vB))\r\n\t\t\t\t\tvB = equivalentToNaN;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar r = compare(vA, vB);\r\n\t\t\tif(r!==CompareResult.Equal)\r\n\t\t\t\treturn o*r;\r\n\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t};\r\n}\r\n\r\nexport {\r\n\tcreateComparer as default, // Allow for default import.\r\n\tcreateComparer as by // Alias for Sort.by(...) instead of Sort.createComparer\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/umd.min/System/Collections/Array/Utility.d.ts b/dist/umd.min/System/Collections/Array/Utility.d.ts new file mode 100644 index 00000000..2314ac04 --- /dev/null +++ b/dist/umd.min/System/Collections/Array/Utility.d.ts @@ -0,0 +1,26 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function initialize(length: number): T[]; +export declare function copy(source: IArray, sourceIndex?: number, length?: number): T[]; +export declare function copyTo>(source: IArray, destination: TDestination, sourceIndex?: number, destinationIndex?: number, length?: number): TDestination; +export declare function indexOf(array: IArray, item: T, equalityComparer?: EqualityComparison): number; +export declare function contains(array: IArray, item: T, equalityComparer?: EqualityComparison): boolean; +export declare function replace(array: IArray, old: T, newValue: T, max?: number): number; +export declare function updateRange(array: IArray, value: T, start?: number, stop?: number): void; +export declare function clear(array: IArray, start?: number, stop?: number): void; +export declare function register(array: IArray, item: T, equalityComparer?: EqualityComparison): boolean; +export declare function findIndex(array: IArray, predicate: Predicate): number; +export declare function forEach(source: IArray, action: Predicate | Action): void; +export declare function applyTo(target: IArray, fn: (a: T) => T): void; +export declare function removeIndex(array: T[], index: number): boolean; +export declare function remove(array: T[], value: T, max?: number, equalityComparer?: EqualityComparison): number; +export declare function repeat(element: T, count: number): T[]; +export declare function range(first: number, count: number, step?: number): number[]; +export declare function rangeUntil(first: number, until: number, step?: number): number[]; +export declare function distinct(source: string[]): string[]; +export declare function distinct(source: number[]): number[]; +export declare function flatten(a: any[], recurseDepth?: number): any[]; diff --git a/dist/umd.min/System/Collections/CollectionBase.d.ts b/dist/umd.min/System/Collections/CollectionBase.d.ts new file mode 100644 index 00000000..d3ff773a --- /dev/null +++ b/dist/umd.min/System/Collections/CollectionBase.d.ts @@ -0,0 +1,40 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +declare abstract class CollectionBase extends DisposableBase implements ICollection, IEnumerateEach { + protected _equalityComparer: EqualityComparison; + constructor(source?: IEnumerableOrArray, _equalityComparer?: EqualityComparison); + protected abstract getCount(): number; + count: number; + protected getIsReadOnly(): boolean; + isReadOnly: boolean; + protected assertModifiable(): void; + protected _version: number; + assertVersion(version: number): void; + private _modifiedCount; + private _updateRecursion; + protected _onModified(): void; + protected _signalModification(increment?: boolean): boolean; + protected _incrementModified(): void; + isUpdating: boolean; + handleUpdate(closure?: () => boolean): boolean; + protected abstract _addInternal(entry: T): boolean; + add(entry: T): void; + protected abstract _removeInternal(entry: T, max?: number): number; + remove(entry: T, max?: number): number; + protected abstract _clearInternal(): number; + clear(): number; + protected _onDispose(): void; + protected _importEntries(entries: IEnumerableOrArray): number; + importEntries(entries: IEnumerableOrArray): number; + abstract getEnumerator(): IEnumerator; + contains(entry: T): boolean; + forEach(action: Predicate | Action, useCopy?: boolean): void; + copyTo>(target: TTarget, index?: number): TTarget; + toArray(): T[]; +} +export default CollectionBase; diff --git a/dist/umd.min/System/Collections/Dictionaries/Dictionary.d.ts b/dist/umd.min/System/Collections/Dictionaries/Dictionary.d.ts new file mode 100644 index 00000000..8ce9d526 --- /dev/null +++ b/dist/umd.min/System/Collections/Dictionaries/Dictionary.d.ts @@ -0,0 +1,26 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Original: http://linqjs.codeplex.com/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DictionaryBase from "./DictionaryBase"; +export interface IHashEntry extends ILinkedNode>, IKeyValuePair { +} +export default class Dictionary extends DictionaryBase { + private _keyComparer; + private _entries; + private _buckets; + constructor(_keyComparer?: Selector); + protected getCount(): number; + private _getBucket(hash, createIfMissing?); + private _getBucketEntry(key, hash?, bucket?); + protected _getEntry(key: TKey): IHashEntry; + getValue(key: TKey): TValue; + protected _setValueInternal(key: TKey, value: TValue): boolean; + protected _clearInternal(): number; + getEnumerator(): IEnumerator>; + protected getKeys(): TKey[]; + protected getValues(): TValue[]; +} diff --git a/dist/umd.min/System/Collections/Dictionaries/DictionaryBase.d.ts b/dist/umd.min/System/Collections/Dictionaries/DictionaryBase.d.ts new file mode 100644 index 00000000..f931e1a7 --- /dev/null +++ b/dist/umd.min/System/Collections/Dictionaries/DictionaryBase.d.ts @@ -0,0 +1,31 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "../CollectionBase"; +declare abstract class DictionaryBase extends CollectionBase> implements IDictionary { + constructor(source?: IEnumerableOrArray>); + protected _onValueModified(key: TKey, value: TValue, old: TValue): void; + protected _addInternal(item: KeyValuePair): boolean; + protected _clearInternal(): number; + contains(item: KeyValuePair): boolean; + protected _removeInternal(item: IKeyValuePair | [TKey, TValue]): number; + protected abstract getKeys(): TKey[]; + keys: TKey[]; + protected abstract getValues(): TValue[]; + values: TValue[]; + addByKeyValue(key: TKey, value: TValue): boolean; + protected abstract _getEntry(key: TKey): IKeyValuePair; + abstract getValue(key: TKey): TValue; + protected abstract _setValueInternal(key: TKey, value: TValue): boolean; + setValue(key: TKey, value: TValue): boolean; + containsKey(key: TKey): boolean; + containsValue(value: TValue): boolean; + removeByKey(key: TKey): boolean; + removeByValue(value: TValue): number; + importEntries(pairs: IEnumerableOrArray>): number; + protected _importEntries(pairs: IEnumerableOrArray>): number; + getEnumerator(): IEnumerator>; +} +export default DictionaryBase; diff --git a/dist/umd.min/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts b/dist/umd.min/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts new file mode 100644 index 00000000..159e833b --- /dev/null +++ b/dist/umd.min/System/Collections/Dictionaries/OrderedStringKeyDictionary.d.ts @@ -0,0 +1,17 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import StringKeyDictionary from "./StringKeyDictionary"; +export default class OrderedStringKeyDictionary extends StringKeyDictionary implements IOrderedDictionary { + private _order; + constructor(); + indexOfKey(key: string): number; + getValueByIndex(index: number): TValue; + setValue(key: string, value: TValue, keepIndex?: boolean): boolean; + setByIndex(index: number, value: TValue): boolean; + importValues(values: TValue[]): boolean; + setValues(...values: TValue[]): boolean; + removeByIndex(index: number): boolean; + protected getKeys(): string[]; +} diff --git a/dist/umd.min/System/Collections/Dictionaries/StringKeyDictionary.d.ts b/dist/umd.min/System/Collections/Dictionaries/StringKeyDictionary.d.ts new file mode 100644 index 00000000..15152615 --- /dev/null +++ b/dist/umd.min/System/Collections/Dictionaries/StringKeyDictionary.d.ts @@ -0,0 +1,20 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DictionaryBase from "./DictionaryBase"; +export default class StringKeyDictionary extends DictionaryBase implements IStringKeyDictionary { + private _count; + private _map; + protected _getEntry(key: string): IKeyValuePair; + containsKey(key: string): boolean; + containsValue(value: TValue): boolean; + getValue(key: string): TValue; + protected _setValueInternal(key: string, value: TValue): boolean; + importMap(values: IMap): boolean; + toMap(selector?: (key: string, value: TValue) => TValue): IMap; + protected getKeys(): string[]; + protected getValues(): TValue[]; + protected getCount(): number; +} diff --git a/dist/umd.min/System/Collections/Enumeration/ArrayEnumerator.d.ts b/dist/umd.min/System/Collections/Enumeration/ArrayEnumerator.d.ts new file mode 100644 index 00000000..a54be9a0 --- /dev/null +++ b/dist/umd.min/System/Collections/Enumeration/ArrayEnumerator.d.ts @@ -0,0 +1,10 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import IndexEnumerator from "./IndexEnumerator"; +export default class ArrayEnumerator extends IndexEnumerator { + constructor(arrayFactory: () => IArray, start?: number, step?: number); + constructor(array: IArray, start?: number, step?: number); +} diff --git a/dist/umd.min/System/Collections/Enumeration/Enumerator.d.ts b/dist/umd.min/System/Collections/Enumeration/Enumerator.d.ts new file mode 100644 index 00000000..4001711b --- /dev/null +++ b/dist/umd.min/System/Collections/Enumeration/Enumerator.d.ts @@ -0,0 +1,19 @@ +/// +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function throwIfEndless(isEndless: boolean): void; +export declare const empty: IEnumerator; +export declare function from(source: IEnumerableOrArray): IEnumerator; +export declare function isEnumerable(instance: any): instance is IEnumerable; +export declare function isEnumerableOrArrayLike(instance: any): instance is IEnumerableOrArray; +export declare function isEnumerator(instance: any): instance is IEnumerator; +export declare function forEach(e: IEnumerableOrArray | IEnumerator, action: (element: T, index?: number) => any): boolean | void; +export declare function toArray(source: IEnumerableOrArray | IEnumerator): T[]; +export declare function map(source: IEnumerableOrArray | IEnumerator, selector: Selector): TResult[]; diff --git a/dist/umd.min/System/Collections/Enumeration/EnumeratorBase.d.ts b/dist/umd.min/System/Collections/Enumeration/EnumeratorBase.d.ts new file mode 100644 index 00000000..8ed548b8 --- /dev/null +++ b/dist/umd.min/System/Collections/Enumeration/EnumeratorBase.d.ts @@ -0,0 +1,26 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../../Disposable/DisposableBase"; +export default class EnumeratorBase extends DisposableBase implements IEnumerator { + private _initializer; + private _tryGetNext; + private _yielder; + private _state; + private _disposer; + current: T; + constructor(initializer: () => void, tryGetNext: (yielder: IYield) => boolean, isEndless?: boolean); + constructor(initializer: () => void, tryGetNext: (yielder: IYield) => boolean, disposer?: () => void, isEndless?: boolean); + protected _isEndless: boolean; + isEndless: boolean; + reset(): void; + moveNext(): boolean; + nextValue(): T; + next(): IIteratorResult; + protected _onDispose(): void; +} diff --git a/dist/umd.min/System/Collections/Enumeration/IndexEnumerator.d.ts b/dist/umd.min/System/Collections/Enumeration/IndexEnumerator.d.ts new file mode 100644 index 00000000..e85a88be --- /dev/null +++ b/dist/umd.min/System/Collections/Enumeration/IndexEnumerator.d.ts @@ -0,0 +1,15 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import EnumeratorBase from "./EnumeratorBase"; +export default class IndexEnumerator extends EnumeratorBase { + constructor(sourceFactory: () => { + source: { + [index: number]: T; + }; + pointer?: number; + length: number; + step?: number; + }); +} diff --git a/dist/umd.min/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts b/dist/umd.min/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts new file mode 100644 index 00000000..b966255b --- /dev/null +++ b/dist/umd.min/System/Collections/Enumeration/UnsupportedEnumerableException.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from "../../Exceptions/SystemException"; +export default class UnsupportedEnumerableException extends SystemException { + constructor(message?: string); + protected getName(): string; +} diff --git a/dist/umd.min/System/Collections/LinkedList.d.ts b/dist/umd.min/System/Collections/LinkedList.d.ts new file mode 100644 index 00000000..6de7a80e --- /dev/null +++ b/dist/umd.min/System/Collections/LinkedList.d.ts @@ -0,0 +1,37 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based Upon: http://msdn.microsoft.com/en-us/library/he2s3bh7%28v=vs.110%29.aspx + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +export default class LinkedList extends CollectionBase implements ILinkedList { + private _listInternal; + constructor(source?: IEnumerableOrArray, equalityComparer?: EqualityComparison); + protected getCount(): number; + protected _addInternal(entry: T): boolean; + protected _removeInternal(entry: T, max?: number): number; + protected _clearInternal(): number; + forEach(action: Predicate | Action, useCopy?: boolean): void; + getEnumerator(): IEnumerator; + private _findFirst(entry); + private _findLast(entry); + removeOnce(entry: T): boolean; + first: ILinkedListNode; + last: ILinkedListNode; + getValueAt(index: number): T; + getNodeAt(index: number): ILinkedListNode; + find(entry: T): ILinkedListNode; + findLast(entry: T): ILinkedListNode; + addFirst(entry: T): void; + addLast(entry: T): void; + removeFirst(): void; + removeLast(): void; + removeNode(node: ILinkedListNode): boolean; + addBefore(before: ILinkedListNode, entry: T): void; + addAfter(after: ILinkedListNode, entry: T): void; + addNodeBefore(node: ILinkedListNode, before: ILinkedListNode): void; + addNodeAfter(node: ILinkedListNode, after: ILinkedListNode): void; +} diff --git a/dist/umd.min/System/Collections/LinkedNodeList.d.ts b/dist/umd.min/System/Collections/LinkedNodeList.d.ts new file mode 100644 index 00000000..2f91455d --- /dev/null +++ b/dist/umd.min/System/Collections/LinkedNodeList.d.ts @@ -0,0 +1,31 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class LinkedNodeList> implements ILinkedNodeList, IEnumerateEach, IDisposable { + private _first; + private _last; + unsafeCount: number; + constructor(); + first: TNode; + last: TNode; + count: number; + forEach(action: Predicate | Action): void; + map(selector: Selector): T[]; + clear(): number; + dispose(): void; + contains(node: TNode): boolean; + getNodeAt(index: number): TNode; + find(condition: Predicate): TNode; + indexOf(node: TNode): number; + removeFirst(): boolean; + removeLast(): boolean; + removeNode(node: TNode): boolean; + addNode(node: TNode): void; + addNodeBefore(node: TNode, before?: TNode): void; + addNodeAfter(node: TNode, after?: TNode): void; + replace(node: TNode, replacement: TNode): void; + static valueEnumeratorFrom(list: LinkedNodeList>): IEnumerator; + static copyValues>(list: LinkedNodeList>, array: TDestination, index?: number): TDestination; +} diff --git a/dist/umd.min/System/Collections/List.d.ts b/dist/umd.min/System/Collections/List.d.ts new file mode 100644 index 00000000..39f8549b --- /dev/null +++ b/dist/umd.min/System/Collections/List.d.ts @@ -0,0 +1,24 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +export default class List extends CollectionBase implements IList, IEnumerateEach { + protected _source: T[]; + constructor(source?: IEnumerableOrArray, equalityComparer?: EqualityComparison); + protected getCount(): number; + protected _addInternal(entry: T): boolean; + protected _removeInternal(entry: T, max?: number): number; + protected _clearInternal(): number; + protected _importEntries(entries: IEnumerableOrArray): number; + get(index: number): T; + set(index: number, value: T): boolean; + indexOf(item: T): number; + insert(index: number, value: T): void; + removeAt(index: number): boolean; + contains(item: T): boolean; + copyTo>(target: TTarget, index?: number): TTarget; + getEnumerator(): IEnumerator; + forEach(action: Predicate | Action, useCopy?: boolean): void; +} diff --git a/dist/umd.min/System/Collections/Queue.d.ts b/dist/umd.min/System/Collections/Queue.d.ts new file mode 100644 index 00000000..e634439d --- /dev/null +++ b/dist/umd.min/System/Collections/Queue.d.ts @@ -0,0 +1,35 @@ +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based Upon: http://referencesource.microsoft.com/#System/CompMod/system/collections/generic/queue.cs + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +export default class Queue extends CollectionBase { + private _array; + private _head; + private _tail; + private _size; + private _capacity; + constructor(source?: IEnumerableOrArray | number, equalityComparer?: EqualityComparison); + protected getCount(): number; + protected _addInternal(item: T): boolean; + protected _removeInternal(item: T, max?: number): number; + protected _clearInternal(): number; + protected _onDispose(): void; + dump(max?: number): T[]; + forEach(action: Predicate | Action): void; + setCapacity(capacity: number): void; + enqueue(item: T): void; + protected _dequeueInternal(throwIfEmpty?: boolean): T; + dequeue(throwIfEmpty?: boolean): T; + tryDequeue(out: (value: T) => void): boolean; + private _getElement(index); + peek(): T; + trimExcess(threshold?: number): void; + getEnumerator(): IEnumerator; +} diff --git a/dist/umd.min/System/Collections/ReadOnlyCollectionBase.d.ts b/dist/umd.min/System/Collections/ReadOnlyCollectionBase.d.ts new file mode 100644 index 00000000..5633231c --- /dev/null +++ b/dist/umd.min/System/Collections/ReadOnlyCollectionBase.d.ts @@ -0,0 +1,18 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import CollectionBase from "./CollectionBase"; +declare abstract class ReadOnlyCollectionBase extends CollectionBase { + protected _getCount: () => number; + protected getCount(): number; + protected getIsReadOnly(): boolean; + protected _addInternal(entry: T): boolean; + protected _removeInternal(entry: T, max?: number): number; + protected _clearInternal(): number; + protected _getEnumerator: () => IEnumerator; + getEnumerator(): IEnumerator; +} +export default ReadOnlyCollectionBase; diff --git a/dist/umd.min/System/Collections/ReadOnlyCollectionWrapper.d.ts b/dist/umd.min/System/Collections/ReadOnlyCollectionWrapper.d.ts new file mode 100644 index 00000000..4b2dbde9 --- /dev/null +++ b/dist/umd.min/System/Collections/ReadOnlyCollectionWrapper.d.ts @@ -0,0 +1,8 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ReadOnlyCollection from "./ReadOnlyCollectionBase"; +export default class ReadOnlyCollectionWrapper extends ReadOnlyCollection { + constructor(c: ICollection); +} diff --git a/dist/umd.min/System/Collections/Set.d.ts b/dist/umd.min/System/Collections/Set.d.ts new file mode 100644 index 00000000..b44c6c2d --- /dev/null +++ b/dist/umd.min/System/Collections/Set.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import SetBase from "./SetBase"; +export default class Set extends SetBase { + protected newUsing(source?: IEnumerableOrArray): Set; + private _registry; + protected _addInternal(item: T): boolean; + protected _clearInternal(): number; + protected _onDispose(): void; + protected _getNode(item: T): ILinkedNodeWithValue; + protected _removeInternal(item: T, max?: number): number; +} diff --git a/dist/umd.min/System/Collections/SetBase.d.ts b/dist/umd.min/System/Collections/SetBase.d.ts new file mode 100644 index 00000000..1b129395 --- /dev/null +++ b/dist/umd.min/System/Collections/SetBase.d.ts @@ -0,0 +1,36 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import LinkedNodeList from "./LinkedNodeList"; +import CollectionBase from "./CollectionBase"; +declare abstract class SetBase extends CollectionBase implements ISet, IDisposable { + constructor(source?: IEnumerableOrArray); + protected abstract newUsing(source?: IEnumerableOrArray): SetBase; + protected _set: LinkedNodeList>; + protected _getSet(): LinkedNodeList>; + protected getCount(): number; + exceptWith(other: IEnumerableOrArray): void; + intersectWith(other: IEnumerableOrArray): void; + isProperSubsetOf(other: IEnumerableOrArray): boolean; + isProperSupersetOf(other: IEnumerableOrArray): boolean; + isSubsetOf(other: IEnumerableOrArray): boolean; + isSupersetOf(other: IEnumerableOrArray): boolean; + overlaps(other: IEnumerableOrArray): boolean; + setEquals(other: IEnumerableOrArray): boolean; + symmetricExceptWith(other: IEnumerableOrArray): void; + unionWith(other: IEnumerableOrArray): void; + protected _clearInternal(): number; + protected _onDispose(): void; + protected abstract _getNode(item: T): ILinkedNodeWithValue; + contains(item: T): boolean; + getEnumerator(): IEnumerator; + forEach(action: Predicate | Action, useCopy?: boolean): void; + protected _removeNode(node: ILinkedNodeWithValue): boolean; + removeFirst(): boolean; + removeLast(): boolean; +} +export default SetBase; diff --git a/dist/umd.min/System/Collections/Sorting/KeySortedContext.d.ts b/dist/umd.min/System/Collections/Sorting/KeySortedContext.d.ts new file mode 100644 index 00000000..36822f6a --- /dev/null +++ b/dist/umd.min/System/Collections/Sorting/KeySortedContext.d.ts @@ -0,0 +1,16 @@ +/// +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import SortContext from "./SortContext"; +export default class KeySortedContext extends SortContext { + protected _keySelector: Selector; + constructor(next: IComparer, _keySelector: Selector, order?: Order, comparer?: Comparison); + compare(a: T, b: T): number; +} diff --git a/dist/umd.min/System/Collections/Sorting/SortContext.d.ts b/dist/umd.min/System/Collections/Sorting/SortContext.d.ts new file mode 100644 index 00000000..b459e302 --- /dev/null +++ b/dist/umd.min/System/Collections/Sorting/SortContext.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class SortContext implements IComparer { + protected _next: IComparer; + protected _comparer: Comparison; + protected _order: Order; + order: Order; + constructor(_next: IComparer, _comparer?: Comparison, _order?: Order); + generateSortedIndexes(source: T[]): number[]; + compare(a: T, b: T): number; +} diff --git a/dist/umd.min/System/Compare.d.ts b/dist/umd.min/System/Compare.d.ts new file mode 100644 index 00000000..1d12a4b3 --- /dev/null +++ b/dist/umd.min/System/Compare.d.ts @@ -0,0 +1,11 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function areEqual(a: any, b: any, strict?: boolean): boolean; +export declare function compare(a: IComparable, b: IComparable): number; +export declare function compare(a: T, b: T, strict?: boolean): CompareResult; +export declare function areEquivalent(a: any, b: any, nullEquivalency?: boolean, extraDepth?: number): boolean; diff --git a/dist/umd.min/System/Diagnostics/Stopwatch.d.ts b/dist/umd.min/System/Diagnostics/Stopwatch.d.ts new file mode 100644 index 00000000..b0bd97a1 --- /dev/null +++ b/dist/umd.min/System/Diagnostics/Stopwatch.d.ts @@ -0,0 +1,24 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeSpan from "../Time/TimeSpan"; +export default class Stopwatch implements ITimer { + static getTimestampMilliseconds(): number; + private _elapsed; + private _startTimeStamp; + private _isRunning; + isRunning: boolean; + constructor(); + static startNew(): Stopwatch; + static measure(closure: () => void): TimeSpan; + start(): void; + stop(): void; + reset(): void; + lap(): TimeSpan; + currentLapMilliseconds: number; + currentLap: TimeSpan; + elapsedMilliseconds: number; + elapsed: TimeSpan; +} diff --git a/dist/umd.min/System/Disposable/DisposableBase.d.ts b/dist/umd.min/System/Disposable/DisposableBase.d.ts new file mode 100644 index 00000000..1acd883f --- /dev/null +++ b/dist/umd.min/System/Disposable/DisposableBase.d.ts @@ -0,0 +1,16 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare abstract class DisposableBase implements IDisposableAware { + private _finalizer; + constructor(_finalizer?: () => void); + private _wasDisposed; + wasDisposed: boolean; + protected _disposableObjectName: string; + protected throwIfDisposed(message?: string, objectName?: string): boolean; + dispose(): void; + protected _onDispose(): void; +} +export default DisposableBase; diff --git a/dist/umd.min/System/Disposable/ObjectDisposedException.d.ts b/dist/umd.min/System/Disposable/ObjectDisposedException.d.ts new file mode 100644 index 00000000..66e40831 --- /dev/null +++ b/dist/umd.min/System/Disposable/ObjectDisposedException.d.ts @@ -0,0 +1,15 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import Exception from '../Exception'; +import InvalidOperationException from '../Exceptions/InvalidOperationException'; +export default class ObjectDisposedException extends InvalidOperationException { + objectName: string; + constructor(objectName: string, message?: string, innerException?: Exception); + protected getName(): string; + toString(): string; + static throwIfDisposed(disposable: IDisposableAware, objectName?: string, message?: string): void; +} diff --git a/dist/umd.min/System/Disposable/ObjectPool.d.ts b/dist/umd.min/System/Disposable/ObjectPool.d.ts new file mode 100644 index 00000000..af854543 --- /dev/null +++ b/dist/umd.min/System/Disposable/ObjectPool.d.ts @@ -0,0 +1,30 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon ObjectPool from Parallel Extension Extras and other ObjectPool implementations. + * Uses .add(T) and .take():T + */ +import DisposableBase from "./DisposableBase"; +export default class ObjectPool extends DisposableBase { + private _maxSize; + private _generator; + private _pool; + private _trimmer; + private _flusher; + private _autoFlusher; + private _localAbsMaxSize; + autoClearTimeout: number; + constructor(_maxSize: number, _generator: () => T); + maxSize: number; + count: number; + protected _trim(): void; + trim(defer?: number): void; + protected _clear(): void; + clear(defer?: number): void; + toArrayAndClear(): T[]; + dump(): T[]; + protected _onDispose(): void; + extendAutoClear(): void; + add(o: T): void; + take(): T; +} diff --git a/dist/umd.min/System/Disposable/dispose.d.ts b/dist/umd.min/System/Disposable/dispose.d.ts new file mode 100644 index 00000000..ea01844c --- /dev/null +++ b/dist/umd.min/System/Disposable/dispose.d.ts @@ -0,0 +1,17 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function dispose(...disposables: IDisposable[]): void; +export declare module dispose { + function deferred(...disposables: IDisposable[]): void; + function withoutException(...disposables: IDisposable[]): any[]; + function these(disposables: IDisposable[], trapExceptions?: boolean): any[]; + module these { + function deferred(disposables: IDisposable[], delay?: number): void; + } +} +export declare function using(disposable: TDisposable, closure: (disposable: TDisposable) => TReturn): TReturn; +export default dispose; diff --git a/dist/umd.min/System/Events/EventDispatcherBase.d.ts b/dist/umd.min/System/Events/EventDispatcherBase.d.ts new file mode 100644 index 00000000..e8e78469 --- /dev/null +++ b/dist/umd.min/System/Events/EventDispatcherBase.d.ts @@ -0,0 +1,33 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +import EventDispatcherEntry from "./EventDispatcherEntry"; +export interface IEventBase { + type: string; + target: TTarget; +} +export interface IEvent extends IEventBase { +} +export interface IEntryParams { + priority: number; + dispatcher: EventDispatcherBase; +} +export default class EventDispatcherBase extends DisposableBase implements IEventDispatcher { + protected _entries: EventDispatcherEntry[]; + addEventListener(type: string, listener: IEventListener, priority?: number): void; + removeEntry(entry: EventDispatcherEntry): boolean; + registerEventListener(type: string, listener: IEventListener, priority?: number): void; + hasEventListener(type: string, listener?: IEventListener): boolean; + removeEventListener(type: string, listener: IEventListener): void; + dispatchEvent(type: string, params?: any): boolean; + dispatchEvent(event: IEvent): boolean; + static DISPOSING: string; + static DISPOSED: string; + private _isDisposing; + isDisposing: boolean; + dispose(): void; +} diff --git a/dist/umd.min/System/Events/EventDispatcherEntry.d.ts b/dist/umd.min/System/Events/EventDispatcherEntry.d.ts new file mode 100644 index 00000000..73b2f602 --- /dev/null +++ b/dist/umd.min/System/Events/EventDispatcherEntry.d.ts @@ -0,0 +1,16 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +export default class EventDispatcherEntry extends DisposableBase implements IEquatable> { + type: string; + listener: IEventListener; + params: TParams; + constructor(type: string, listener: IEventListener, params?: TParams, finalizer?: () => void); + protected _onDispose(): void; + dispatch(e: Event): boolean; + matches(type: string, listener: IEventListener): boolean; + equals(other: EventDispatcherEntry): boolean; +} diff --git a/dist/umd.min/System/Events/EventSimple.d.ts b/dist/umd.min/System/Events/EventSimple.d.ts new file mode 100644 index 00000000..f4fd3db2 --- /dev/null +++ b/dist/umd.min/System/Events/EventSimple.d.ts @@ -0,0 +1,13 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Based on Netjs mscorlib.ts + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class EventSimple implements IDisposable { + private _listeners; + add(listener: T): void; + remove(listener: T): void; + dispatch(...params: any[]): void; + toMulticastFunction(): Function; + dispose(): void; +} diff --git a/dist/umd.min/System/Exception.d.ts b/dist/umd.min/System/Exception.d.ts new file mode 100644 index 00000000..dce52d48 --- /dev/null +++ b/dist/umd.min/System/Exception.d.ts @@ -0,0 +1,18 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +export default class Exception implements Error, IDisposable { + message: string; + name: string; + constructor(message?: string, innerException?: Error, beforeSealing?: (ex: any) => void); + stack: string; + data: IMap; + protected getName(): string; + toString(): string; + protected toStringWithoutBrackets(): string; + dispose(): void; +} diff --git a/dist/umd.min/System/ExceptionType.d.ts b/dist/umd.min/System/ExceptionType.d.ts new file mode 100644 index 00000000..5cd2e52a --- /dev/null +++ b/dist/umd.min/System/ExceptionType.d.ts @@ -0,0 +1,11 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare const Error: string; +export declare const EvalError: string; +export declare const RangeError: string; +export declare const ReferenceError: string; +export declare const SyntaxError: string; +export declare const TypeError: string; +export declare const URIError: string; diff --git a/dist/umd.min/System/Exceptions/ArgumentException.d.ts b/dist/umd.min/System/Exceptions/ArgumentException.d.ts new file mode 100644 index 00000000..eac4232c --- /dev/null +++ b/dist/umd.min/System/Exceptions/ArgumentException.d.ts @@ -0,0 +1,11 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from "./SystemException"; +export default class ArgumentException extends SystemException { + paramName: string; + constructor(paramName: string, message?: string, innerException?: Error, beforeSealing?: (ex: any) => void); + protected getName(): string; +} diff --git a/dist/umd.min/System/Exceptions/ArgumentNullException.d.ts b/dist/umd.min/System/Exceptions/ArgumentNullException.d.ts new file mode 100644 index 00000000..5cc13038 --- /dev/null +++ b/dist/umd.min/System/Exceptions/ArgumentNullException.d.ts @@ -0,0 +1,10 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import ArgumentException from './ArgumentException'; +export default class ArgumentNullException extends ArgumentException { + constructor(paramName: string, message?: string, innerException?: Error); + protected getName(): string; +} diff --git a/dist/umd.min/System/Exceptions/ArgumentOutOfRangeException.d.ts b/dist/umd.min/System/Exceptions/ArgumentOutOfRangeException.d.ts new file mode 100644 index 00000000..4fd62443 --- /dev/null +++ b/dist/umd.min/System/Exceptions/ArgumentOutOfRangeException.d.ts @@ -0,0 +1,12 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import Exception from "../Exception"; +import ArgumentException from "./ArgumentException"; +export default class ArgumentOutOfRangeException extends ArgumentException { + actualValue: string | number | boolean; + constructor(paramName: string, actualValue: string | number | boolean, message?: string, innerException?: Exception); + protected getName(): string; +} diff --git a/dist/umd.min/System/Exceptions/InvalidOperationException.d.ts b/dist/umd.min/System/Exceptions/InvalidOperationException.d.ts new file mode 100644 index 00000000..4f422d04 --- /dev/null +++ b/dist/umd.min/System/Exceptions/InvalidOperationException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from './SystemException'; +export default class InvalidOperationException extends SystemException { + protected getName(): string; +} diff --git a/dist/umd.min/System/Exceptions/NotImplementedException.d.ts b/dist/umd.min/System/Exceptions/NotImplementedException.d.ts new file mode 100644 index 00000000..0225eeb8 --- /dev/null +++ b/dist/umd.min/System/Exceptions/NotImplementedException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from './SystemException'; +export default class NotImplementedException extends SystemException { + protected getName(): string; +} diff --git a/dist/umd.min/System/Exceptions/NullReferenceException.d.ts b/dist/umd.min/System/Exceptions/NullReferenceException.d.ts new file mode 100644 index 00000000..780b64a6 --- /dev/null +++ b/dist/umd.min/System/Exceptions/NullReferenceException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/System.Exception%28v=vs.110%29.aspx + */ +import SystemException from './SystemException'; +export default class NullReferenceException extends SystemException { + protected getName(): string; +} diff --git a/dist/umd.min/System/Exceptions/SystemException.d.ts b/dist/umd.min/System/Exceptions/SystemException.d.ts new file mode 100644 index 00000000..239bfbef --- /dev/null +++ b/dist/umd.min/System/Exceptions/SystemException.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based upon: https://msdn.microsoft.com/en-us/library/system.systemexception%28v=vs.110%29.aspx + */ +import Exception from '../Exception'; +export default class SystemException extends Exception { + protected getName(): string; +} diff --git a/dist/umd.min/System/Functions.d.ts b/dist/umd.min/System/Functions.d.ts new file mode 100644 index 00000000..0262bc62 --- /dev/null +++ b/dist/umd.min/System/Functions.d.ts @@ -0,0 +1,17 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare class Functions { + Identity(x: T): T; + True(): boolean; + False(): boolean; + Blank(): void; +} +declare module Functions { + var Identity: (x: T) => T; + var True: () => boolean; + var False: () => boolean; + var Blank: () => void; +} +export default Functions; diff --git a/dist/umd.min/System/Integer.d.ts b/dist/umd.min/System/Integer.d.ts new file mode 100644 index 00000000..04881834 --- /dev/null +++ b/dist/umd.min/System/Integer.d.ts @@ -0,0 +1,25 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function Integer(n: number): number; +export declare module Integer { + const MAX_32_BIT: number; + function random(maxExclusive: number): number; + module random { + function next(boundary: number, inclusive?: boolean): number; + function nextInRange(min: number, max: number, inclusive?: boolean): number; + function select(source: IArray): T; + module select { + function one(source: IArray): T; + } + } + function as32Bit(n: number): number; + function is(n: number): boolean; + function is32Bit(n: number): boolean; + function assert(n: number, argumentName?: string): boolean; + function assertZeroOrGreater(n: number, argumentName?: string): boolean; + function assertPositive(n: number, argumentName?: string): boolean; +} +export default Integer; diff --git a/dist/umd.min/System/KeyValueExtract.d.ts b/dist/umd.min/System/KeyValueExtract.d.ts new file mode 100644 index 00000000..cfe473b9 --- /dev/null +++ b/dist/umd.min/System/KeyValueExtract.d.ts @@ -0,0 +1,9 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function isKeyValuePair(kvp: any): kvp is IKeyValuePair; +export declare function assertKey(key: TKey, name?: string): TKey; +export declare function assertTuple(tuple: IArray, name?: string): void; +export declare function assertNotUndefined(value: T, name: string): T; +export default function extractKeyValue(item: KeyValuePair, to: (key: TKey, value: TValue) => TResult): TResult; diff --git a/dist/umd.min/System/Lazy.d.ts b/dist/umd.min/System/Lazy.d.ts new file mode 100644 index 00000000..de32b287 --- /dev/null +++ b/dist/umd.min/System/Lazy.d.ts @@ -0,0 +1,21 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from './Disposable/DisposableBase'; +export default class Lazy extends DisposableBase implements ILazy { + private _closure; + private _isValueCreated; + private _value; + constructor(_closure: Func); + isValueCreated: boolean; + canReset: boolean; + reset(throwIfCannotReset?: boolean): boolean; + value: T; + getValue(clearClosureReference?: boolean): T; + protected _onDispose(): void; + equals(other: Lazy): boolean; + valueEquals(other: Lazy): boolean; +} diff --git a/dist/umd.min/System/Net/Http/HttpMethod.d.ts b/dist/umd.min/System/Net/Http/HttpMethod.d.ts new file mode 100644 index 00000000..d70dbbd8 --- /dev/null +++ b/dist/umd.min/System/Net/Http/HttpMethod.d.ts @@ -0,0 +1,7 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + */ +export declare const OPTIONS: HttpMethodValue, HEAD: HttpMethodValue, GET: HttpMethodValue, PUT: HttpMethodValue, POST: HttpMethodValue, DELETE: HttpMethodValue, TRACE: HttpMethodValue, CONNECT: HttpMethodValue; diff --git a/dist/umd.min/System/Net/Http/HttpMethod.js b/dist/umd.min/System/Net/Http/HttpMethod.js new file mode 100644 index 00000000..d4e1a08f --- /dev/null +++ b/dist/umd.min/System/Net/Http/HttpMethod.js @@ -0,0 +1,7 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html + */ +!function(e){if("object"==typeof module&&"object"==typeof module.exports){var o=e(require,exports);void 0!==o&&(module.exports=o)}else"function"==typeof define&&define.amd&&define(["require","exports"],e)}(function(e,o){"use strict";o.OPTIONS="OPTIONS",o.HEAD="HEAD",o.GET="GET",o.PUT="PUT",o.POST="POST",o.DELETE="DELETE",o.TRACE="TRACE",o.CONNECT="CONNECT"}); +//# sourceMappingURL=HttpMethod.js.map diff --git a/dist/umd.min/System/Net/Http/HttpMethod.js.map b/dist/umd.min/System/Net/Http/HttpMethod.js.map new file mode 100644 index 00000000..474368b6 --- /dev/null +++ b/dist/umd.min/System/Net/Http/HttpMethod.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Net/Http/HttpMethod.js","System/Net/Http/HttpMethod.ts"],"names":["factory","module","exports","v","require","undefined","define","amd","OPTIONS","HEAD","GET","PUT","POST","DELETE","TRACE","CONNECT"],"mappings":";;;;;CAKA,SAAWA,GACP,GAAsB,gBAAXC,SAAiD,gBAAnBA,QAAOC,QAAsB,CAClE,GAAIC,GAAIH,EAAQI,QAASF,QAAoBG,UAANF,IAAiBF,OAAOC,QAAUC,OAElD,kBAAXG,SAAyBA,OAAOC,KAC5CD,QAAQ,UAAW,WAAYN,IAEpC,SAAUI,EAASF,GAClB,YCJHA,GAAAM,QAA0B,UAC1BN,EAAAO,KAA0B,OAC1BP,EAAAQ,IAA0B,MAC1BR,EAAAS,IAA0B,MAC1BT,EAAAU,KAA0B,OAC1BV,EAAAW,OAA0B,SAC1BX,EAAAY,MAA0B,QAC1BZ,EAAAa,QAA0B","file":"System/Net/Http/HttpMethod.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html\n */\n(function (factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define([\"require\", \"exports\"], factory);\n }\n})(function (require, exports) {\n \"use strict\";\n exports.OPTIONS = 'OPTIONS', exports.HEAD = 'HEAD', exports.GET = 'GET', exports.PUT = 'PUT', exports.POST = 'POST', exports.DELETE = 'DELETE', exports.TRACE = 'TRACE', exports.CONNECT = 'CONNECT';\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n * Based on: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html\r\n */\r\n\r\n///\r\n\r\nexport const\r\n\tOPTIONS:HttpMethodValue = 'OPTIONS',\r\n\tHEAD:HttpMethodValue = 'HEAD',\r\n\tGET:HttpMethodValue = 'GET',\r\n\tPUT:HttpMethodValue = 'PUT',\r\n\tPOST:HttpMethodValue = 'POST',\r\n\tDELETE:HttpMethodValue = 'DELETE',\r\n\tTRACE:HttpMethodValue = 'TRACE',\r\n\tCONNECT:HttpMethodValue = 'CONNECT';\r\n"]} \ No newline at end of file diff --git a/dist/umd.min/System/Net/Http/HttpRequestFactory.d.ts b/dist/umd.min/System/Net/Http/HttpRequestFactory.d.ts new file mode 100644 index 00000000..1342a0e0 --- /dev/null +++ b/dist/umd.min/System/Net/Http/HttpRequestFactory.d.ts @@ -0,0 +1,21 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import Uri from "../../Uri/Uri"; +import DisposableBase from "../../Disposable/DisposableBase"; +export default class HttpRequestFactory extends DisposableBase { + private _http; + protected _uriDefaults: Uri; + constructor(_http: IHttpRequestAdapter, uriDefaults?: string | IUri); + protected _onDispose(): void; + uri(uri: string | IUri): HttpRequestFactory; + params(params: QueryParamsConvertible): HttpRequestFactory; + request(method: HttpMethodValue, data?: any): IPromise; + get(): IPromise; + put(): IPromise; + post(data: any): IPromise; + 'delete'(): IPromise; +} diff --git a/dist/umd.min/System/Net/Http/HttpRequestFactory.js b/dist/umd.min/System/Net/Http/HttpRequestFactory.js new file mode 100644 index 00000000..8e10080a --- /dev/null +++ b/dist/umd.min/System/Net/Http/HttpRequestFactory.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +var __extends=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)};!function(t){if("object"==typeof module&&"object"==typeof module.exports){var e=t(require,exports);void 0!==e&&(module.exports=e)}else"function"==typeof define&&define.amd&&define(["require","exports","../../Exceptions/ArgumentNullException","../../Uri/Uri","../../Disposable/DisposableBase","./HttpMethod"],t)}(function(t,e){"use strict";var r=t("../../Exceptions/ArgumentNullException"),o=t("../../Uri/Uri"),u=t("../../Disposable/DisposableBase"),i=t("./HttpMethod"),s=function(t){function e(e,u){if(t.call(this),this._http=e,this._disposableObjectName="HttpRequestFactory",!e)throw new r["default"]("_http");this._uriDefaults=o["default"].from(u)}return __extends(e,t),e.prototype._onDispose=function(){this._http=null,this._uriDefaults=null},e.prototype.uri=function(t){var r=this;r.throwIfDisposed();var u=o["default"].from(t,r._uriDefaults);return r._uriDefaults.equals(u)?r:new e(r._http,u)},e.prototype.params=function(t){var e=this;return e.throwIfDisposed(),e.uri(e._uriDefaults.updateQuery(t))},e.prototype.request=function(t,e){var r=this;return r.throwIfDisposed(),r._http.request({method:t,uri:r._uriDefaults,data:e})},e.prototype.get=function(){return this.request(i.GET)},e.prototype.put=function(){return this.request(i.PUT)},e.prototype.post=function(t){return this.request(i.POST,t)},e.prototype["delete"]=function(){return this.request(i.DELETE)},e}(u["default"]);Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=s}); +//# sourceMappingURL=HttpRequestFactory.js.map diff --git a/dist/umd.min/System/Net/Http/HttpRequestFactory.js.map b/dist/umd.min/System/Net/Http/HttpRequestFactory.js.map new file mode 100644 index 00000000..25862019 --- /dev/null +++ b/dist/umd.min/System/Net/Http/HttpRequestFactory.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Net/Http/HttpRequestFactory.js","System/Net/Http/HttpRequestFactory.ts"],"names":["__extends","this","d","b","__","constructor","p","hasOwnProperty","prototype","Object","create","factory","module","exports","v","require","undefined","define","amd","ArgumentNullException_1","Uri_1","DisposableBase_1","HttpMethod_1","HttpRequestFactory","_super","_http","uriDefaults","call","_disposableObjectName","_uriDefaults","from","_onDispose","uri","_","throwIfDisposed","u","equals","params","updateQuery","request","method","data","get","GET","put","PUT","post","POST","DELETE","defineProperty","value"],"mappings":";;;;AAIA,GAAIA,WAAaC,MAAQA,KAAKD,WAAc,SAAUE,EAAGC,GAErD,QAASC,KAAOH,KAAKI,YAAcH,EADnC,IAAK,GAAII,KAAKH,GAAOA,EAAEI,eAAeD,KAAIJ,EAAEI,GAAKH,EAAEG,GAEnDJ,GAAEM,UAAkB,OAANL,EAAaM,OAAOC,OAAOP,IAAMC,EAAGI,UAAYL,EAAEK,UAAW,GAAIJ,MAEnF,SAAWO,GACP,GAAsB,gBAAXC,SAAiD,gBAAnBA,QAAOC,QAAsB,CAClE,GAAIC,GAAIH,EAAQI,QAASF,QAAoBG,UAANF,IAAiBF,OAAOC,QAAUC,OAElD,kBAAXG,SAAyBA,OAAOC,KAC5CD,QAAQ,UAAW,UAAW,yCAA0C,gBAAiB,kCAAmC,gBAAiBN,IAElJ,SAAUI,EAASF,GCTtB,YAEA,IAAAM,GAAAJ,EAAkC,0CAClCK,EAAAL,EAAgB,iBAChBM,EAAAN,EAA2B,mCAE3BO,EAAAP,EAAqC,gBAKrCQ,EAAA,SAAAC,GAKC,QAAAD,GACSE,EACRC,GAMA,GAJAF,EAAAG,KAAA1B,MAHQA,KAAAwB,MAAAA,EAKRxB,KAAK2B,sBAAwB,sBAEzBH,EACH,KAAM,IAAIN,GAAAA,WAAsB,QAEjClB,MAAK4B,aAAeT,EAAAA,WAAIU,KAAKJ,GA2D/B,MA3EgD1B,WAAAuB,EAAAC,GAmBrCD,EAAAf,UAAAuB,WAAV,WAEC9B,KAAKwB,MAAQ,KACbxB,KAAK4B,aAAe,MAGrBN,EAAAf,UAAAwB,IAAA,SAAIA,GAGH,GAAIC,GAAIhC,IACRgC,GAAEC,iBACF,IAAIC,GAAIf,EAAAA,WAAIU,KAAKE,EAAKC,EAAEJ,aACxB,OAAOI,GAAEJ,aAAaO,OAAOD,GAC1BF,EACA,GAAIV,GAAmBU,EAAER,MAAOU,IAGpCZ,EAAAf,UAAA6B,OAAA,SAAOA,GAEN,GAAIJ,GAAIhC,IAER,OADAgC,GAAEC,kBACKD,EAAED,IAAIC,EAAEJ,aAAaS,YAAYD,KAGzCd,EAAAf,UAAA+B,QAAA,SAAiBC,EAAwBC,GAExC,GAAIR,GAAIhC,IAER,OADAgC,GAAEC,kBACKD,EAAER,MAAMc,SACdC,OAAQA,EACRR,IAAKC,EAAEJ,aACPY,KAAMA,KAKRlB,EAAAf,UAAAkC,IAAA,WAEC,MAAOzC,MAAKsC,QAAiBjB,EAAAqB,MAG9BpB,EAAAf,UAAAoC,IAAA,WAEC,MAAO3C,MAAKsC,QAAiBjB,EAAAuB,MAG9BtB,EAAAf,UAAAsC,KAAA,SAAcL,GAEb,MAAOxC,MAAKsC,QAAiBjB,EAAAyB,KAAMN,IAGpClB,EAAAf,UAAA,UAAA,WAEC,MAAOP,MAAKsC,QAAiBjB,EAAA0B,SAG/BzB,GA3EgDF,EAAAA,WAAhDZ,QAAAwC,eAAApC,EAAA,cAAAqC,OAAA,IDuDIrC,EAAAA,WAAkBU","file":"System/Net/Http/HttpRequestFactory.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n(function (factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define([\"require\", \"exports\", \"../../Exceptions/ArgumentNullException\", \"../../Uri/Uri\", \"../../Disposable/DisposableBase\", \"./HttpMethod\"], factory);\n }\n})(function (require, exports) {\n 'use strict';\n var ArgumentNullException_1 = require(\"../../Exceptions/ArgumentNullException\");\n var Uri_1 = require(\"../../Uri/Uri\");\n var DisposableBase_1 = require(\"../../Disposable/DisposableBase\");\n var HttpMethod_1 = require(\"./HttpMethod\");\n var HttpRequestFactory = (function (_super) {\n __extends(HttpRequestFactory, _super);\n function HttpRequestFactory(_http, uriDefaults) {\n _super.call(this);\n this._http = _http;\n this._disposableObjectName = 'HttpRequestFactory';\n if (!_http)\n throw new ArgumentNullException_1.default('_http');\n this._uriDefaults = Uri_1.default.from(uriDefaults);\n }\n HttpRequestFactory.prototype._onDispose = function () {\n this._http = null;\n this._uriDefaults = null;\n };\n HttpRequestFactory.prototype.uri = function (uri) {\n var _ = this;\n _.throwIfDisposed();\n var u = Uri_1.default.from(uri, _._uriDefaults);\n return _._uriDefaults.equals(u)\n ? _\n : new HttpRequestFactory(_._http, u);\n };\n HttpRequestFactory.prototype.params = function (params) {\n var _ = this;\n _.throwIfDisposed();\n return _.uri(_._uriDefaults.updateQuery(params));\n };\n HttpRequestFactory.prototype.request = function (method, data) {\n var _ = this;\n _.throwIfDisposed();\n return _._http.request({\n method: method,\n uri: _._uriDefaults,\n data: data\n });\n };\n HttpRequestFactory.prototype.get = function () {\n return this.request(HttpMethod_1.GET);\n };\n HttpRequestFactory.prototype.put = function () {\n return this.request(HttpMethod_1.PUT);\n };\n HttpRequestFactory.prototype.post = function (data) {\n return this.request(HttpMethod_1.POST, data);\n };\n HttpRequestFactory.prototype['delete'] = function () {\n return this.request(HttpMethod_1.DELETE);\n };\n return HttpRequestFactory;\n }(DisposableBase_1.default));\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = HttpRequestFactory;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n///\r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nimport ArgumentNullException from \"../../Exceptions/ArgumentNullException\";\r\nimport Uri from \"../../Uri/Uri\";\r\nimport DisposableBase from \"../../Disposable/DisposableBase\";\r\nimport QueryBuilder from \"../../Uri/QueryBuilder\";\r\nimport {GET, PUT, POST, DELETE} from \"./HttpMethod\";\r\n\r\n/**\r\n * This class exposes a factory for making requests to prepared uri and params.\r\n */\r\nexport default class HttpRequestFactory extends DisposableBase\r\n{\r\n\r\n\tprotected _uriDefaults:Uri;\r\n\r\n\tconstructor(\r\n\t\tprivate _http:IHttpRequestAdapter,\r\n\t\turiDefaults?:string|IUri)\r\n\t{\r\n\t\tsuper();\r\n\r\n\t\tthis._disposableObjectName = 'HttpRequestFactory';\r\n\r\n\t\tif(!_http)\r\n\t\t\tthrow new ArgumentNullException('_http');\r\n\r\n\t\tthis._uriDefaults = Uri.from(uriDefaults);\r\n\t}\r\n\r\n\tprotected _onDispose() {\r\n\t\t// super._onDispose(); // Not required for first level inheritance.\r\n\t\tthis._http = null;\r\n\t\tthis._uriDefaults = null;\r\n\t}\r\n\r\n\turi(uri:string|IUri):HttpRequestFactory\r\n\t{\r\n\r\n\t\tvar _ = this;\r\n\t\t_.throwIfDisposed();\r\n\t\tvar u = Uri.from(uri, _._uriDefaults);\r\n\t\treturn _._uriDefaults.equals(u)\r\n\t\t\t? _\r\n\t\t\t: new HttpRequestFactory(_._http, u);\r\n\t}\r\n\r\n\tparams(params:QueryParamsConvertible):HttpRequestFactory\r\n\t{\r\n\t\tvar _ = this;\r\n\t\t_.throwIfDisposed();\r\n\t\treturn _.uri(_._uriDefaults.updateQuery(params));\r\n\t}\r\n\r\n\trequest(method:HttpMethodValue, data?:any):IPromise\r\n\t{\r\n\t\tvar _ = this;\r\n\t\t_.throwIfDisposed();\r\n\t\treturn _._http.request({\r\n\t\t\tmethod: method,\r\n\t\t\turi: _._uriDefaults,\r\n\t\t\tdata: data\r\n\t\t});\r\n\t}\r\n\r\n\r\n\tget():IPromise\r\n\t{\r\n\t\treturn this.request(GET);\r\n\t}\r\n\r\n\tput():IPromise\r\n\t{\r\n\t\treturn this.request(PUT);\r\n\t}\r\n\r\n\tpost(data:any):IPromise\r\n\t{\r\n\t\treturn this.request(POST, data);\r\n\t}\r\n\r\n\t'delete'():IPromise\r\n\t{\r\n\t\treturn this.request(DELETE);\r\n\t}\r\n\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/umd.min/System/Observable/ObservableBase.d.ts b/dist/umd.min/System/Observable/ObservableBase.d.ts new file mode 100644 index 00000000..050d9f79 --- /dev/null +++ b/dist/umd.min/System/Observable/ObservableBase.d.ts @@ -0,0 +1,15 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +import SubscribableBase from "./SubscribableBase"; +declare abstract class ObservableBase extends SubscribableBase> implements IObservable { + protected _onNext(value: T): void; + protected _onError(error: Error): void; + protected _onCompleted(): void; +} +export default ObservableBase; diff --git a/dist/umd.min/System/Observable/ObservableNodeBase.d.ts b/dist/umd.min/System/Observable/ObservableNodeBase.d.ts new file mode 100644 index 00000000..420a0dbc --- /dev/null +++ b/dist/umd.min/System/Observable/ObservableNodeBase.d.ts @@ -0,0 +1,14 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +import ObservableBase from "./ObservableBase"; +export default class ObservableNodeBase extends ObservableBase implements IObserver { + onNext(value: T): void; + onError(error: Error): void; + onCompleted(): void; +} diff --git a/dist/umd.min/System/Observable/SubscribableBase.d.ts b/dist/umd.min/System/Observable/SubscribableBase.d.ts new file mode 100644 index 00000000..5de54bfc --- /dev/null +++ b/dist/umd.min/System/Observable/SubscribableBase.d.ts @@ -0,0 +1,19 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +export default class SubscribableBase implements IDisposable { + private __subscriptions; + protected _getSubscribers(): TSubscriber[]; + constructor(); + private _findEntryNode(subscriber); + subscribe(subscriber: TSubscriber): IDisposable; + unsubscribe(subscriber: TSubscriber): void; + protected _unsubscribeAll(returnSubscribers?: boolean): TSubscriber[]; + unsubscribeAll(): void; + dispose(): void; +} diff --git a/dist/umd.min/System/Observable/Subscription.d.ts b/dist/umd.min/System/Observable/Subscription.d.ts new file mode 100644 index 00000000..ad70893a --- /dev/null +++ b/dist/umd.min/System/Observable/Subscription.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based upon .NET source. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Source: http://referencesource.microsoft.com/#mscorlib/system/IObserver.cs + */ +export default class Subscription implements IDisposableAware { + private _subscribable; + private _subscriber; + constructor(_subscribable: ISubscribable, _subscriber: T); + subscriber: T; + wasDisposed: boolean; + dispose(): void; +} diff --git a/dist/umd.min/System/Serialization/Utility.d.ts b/dist/umd.min/System/Serialization/Utility.d.ts new file mode 100644 index 00000000..f53d368c --- /dev/null +++ b/dist/umd.min/System/Serialization/Utility.d.ts @@ -0,0 +1,9 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function toString(value: Primitive | ISerializable, defaultForUnknown?: string): string; +export declare function isSerializable(instance: any): instance is ISerializable; +export declare function toPrimitive(value: string, caseInsensitive?: boolean, unknownHandler?: (v: string) => string): Primitive; diff --git a/dist/umd.min/System/Tasks/TaskHandler.d.ts b/dist/umd.min/System/Tasks/TaskHandler.d.ts new file mode 100644 index 00000000..750d1dd3 --- /dev/null +++ b/dist/umd.min/System/Tasks/TaskHandler.d.ts @@ -0,0 +1,12 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TaskHandlerBase from "./TaskHandlerBase"; +export default class TaskHandler extends TaskHandlerBase { + private _action; + constructor(_action: Closure); + protected _onExecute(): void; + protected _onDispose(): void; +} diff --git a/dist/umd.min/System/Tasks/TaskHandlerBase.d.ts b/dist/umd.min/System/Tasks/TaskHandlerBase.d.ts new file mode 100644 index 00000000..c3945286 --- /dev/null +++ b/dist/umd.min/System/Tasks/TaskHandlerBase.d.ts @@ -0,0 +1,17 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import DisposableBase from "../Disposable/DisposableBase"; +declare abstract class TaskHandlerBase extends DisposableBase implements ICancellable { + constructor(); + protected _id: any; + isScheduled: boolean; + execute(defer?: number): void; + private static _handler(d); + protected abstract _onExecute(): void; + protected _onDispose(): void; + cancel(): boolean; +} +export default TaskHandlerBase; diff --git a/dist/umd.min/System/Tasks/defer.d.ts b/dist/umd.min/System/Tasks/defer.d.ts new file mode 100644 index 00000000..2b37b77f --- /dev/null +++ b/dist/umd.min/System/Tasks/defer.d.ts @@ -0,0 +1,7 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function defer(task: Closure, delay?: number): ICancellable; +export declare function interval(task: Function, interval: number, count?: number): ICancellable; diff --git a/dist/umd.min/System/Tasks/deferImmediate.d.ts b/dist/umd.min/System/Tasks/deferImmediate.d.ts new file mode 100644 index 00000000..9c479d18 --- /dev/null +++ b/dist/umd.min/System/Tasks/deferImmediate.d.ts @@ -0,0 +1,8 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on code from: https://github.com/kriskowal/q + */ +export default function deferImmediate(task: Closure): ICancellable; +export declare function runAfterDeferred(task: Closure): void; diff --git a/dist/umd.min/System/Text/RegexMatchEnumerator.d.ts b/dist/umd.min/System/Text/RegexMatchEnumerator.d.ts new file mode 100644 index 00000000..90c0d0d9 --- /dev/null +++ b/dist/umd.min/System/Text/RegexMatchEnumerator.d.ts @@ -0,0 +1,14 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import { Regex, Match } from "./RegularExpressions"; +export declare class RegexMatchEnumerator { + private _pattern; + constructor(pattern: string | RegExp | Regex); + matches(input: string): IEnumerator; + static matches(input: string, pattern: string | RegExp | Regex): IEnumerator; +} +declare var _default: typeof RegexMatchEnumerator.matches; +export default _default; diff --git a/dist/umd.min/System/Text/RegularExpressions.d.ts b/dist/umd.min/System/Text/RegularExpressions.d.ts new file mode 100644 index 00000000..af3b1fbd --- /dev/null +++ b/dist/umd.min/System/Text/RegularExpressions.d.ts @@ -0,0 +1,62 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Named groups based on: http://trentrichardson.com/2011/08/02/javascript-regexp-match-named-captures/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare module RegexOptions { + const IGNORE_CASE: string; + const I: string; + const GLOBAL: string; + const G: string; + const MULTI_LINE: string; + const M: string; + const UNICODE: string; + const U: string; + const STICKY: string; + const Y: string; + const IGNORE_PATTERN_WHITESPACE: string; + const W: string; + type Global = 'g'; + type IgnoreCase = 'i'; + type MultiLine = 'm'; + type Unicode = 'u'; + type Sticky = 'y'; + type IgnorePatternWhitespace = "w"; + type Literal = Global | IgnoreCase | MultiLine | Unicode | Sticky | IgnorePatternWhitespace; +} +export interface MatchEvaluator extends Selector { +} +export declare class Regex { + private _re; + private _keys; + constructor(pattern: string | RegExp, options?: RegexOptions.Literal | RegexOptions.Literal[], ...extra: RegexOptions.Literal[]); + match(input: string, startIndex?: number): Match; + matches(input: string): Match[]; + replace(input: string, replacement: Primitive, count?: number): string; + replace(input: string, evaluator: MatchEvaluator, count?: number): string; + isMatch(input: string): boolean; + static isMatch(input: string, pattern: string, options?: RegexOptions.Literal[]): boolean; + static replace(input: string, pattern: string, replacement: string, options?: RegexOptions.Literal[]): string; + static replace(input: string, pattern: string, evaluator: MatchEvaluator, options?: RegexOptions.Literal[]): string; +} +export declare class Capture { + value: string; + index: number; + length: number; + constructor(value?: string, index?: number); + freeze(): void; +} +export declare class Group extends Capture { + success: boolean; + constructor(value?: string, index?: number); + static Empty: Group; +} +export declare class Match extends Group { + groups: Group[]; + namedGroups: IMap; + constructor(value?: string, index?: number, groups?: Group[], namedGroups?: IMap); + freeze(): void; + static Empty: Match; +} +export default Regex; diff --git a/dist/umd.min/System/Text/StringBuilder.d.ts b/dist/umd.min/System/Text/StringBuilder.d.ts new file mode 100644 index 00000000..72f52b4c --- /dev/null +++ b/dist/umd.min/System/Text/StringBuilder.d.ts @@ -0,0 +1,21 @@ +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * .NET Reference: http://referencesource.microsoft.com/#mscorlib/system/text/StringBuilder.cs + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class StringBuilder implements IDisposable { + private _partArray; + private _latest; + constructor(...initial: any[]); + private appendSingle(item); + appendThese(items: any[]): StringBuilder; + append(...items: any[]): StringBuilder; + appendLine(...items: any[]): StringBuilder; + appendLines(items: any[]): StringBuilder; + isEmpty: boolean; + toString(): string; + join(delimiter: string): string; + clear(): void; + dispose(): void; +} diff --git a/dist/umd.min/System/Text/Utility.d.ts b/dist/umd.min/System/Text/Utility.d.ts new file mode 100644 index 00000000..324fdfb2 --- /dev/null +++ b/dist/umd.min/System/Text/Utility.d.ts @@ -0,0 +1,17 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare const EMPTY: string; +export declare function getHashCode(source: string): number; +export declare function repeat(source: string, count: number): string; +export declare function fromChars(ch: number, count: number): string; +export declare function fromChars(chars: number[]): string; +export declare function escapeRegExp(source: string): string; +export declare function trim(source: string, chars?: string | string[], ignoreCase?: boolean): string; +export declare function format(source: string, ...args: any[]): string; +export declare function supplant(source: string, params: { + [key: string]: any; +} | any[]): string; +export declare function startsWith(source: string, pattern: string): boolean; +export declare function endsWith(source: string, pattern: string): boolean; diff --git a/dist/umd.min/System/Time/ClockTime.d.ts b/dist/umd.min/System/Time/ClockTime.d.ts new file mode 100644 index 00000000..7d23b942 --- /dev/null +++ b/dist/umd.min/System/Time/ClockTime.d.ts @@ -0,0 +1,22 @@ +/// +/// +/// +/// +/// +/// +/// +/// +import TimeQuantity from './TimeQuantity'; +export default class ClockTime extends TimeQuantity implements IClockTime { + days: number; + hour: number; + minute: number; + second: number; + millisecond: number; + tick: number; + constructor(milliseconds: number); + constructor(hours: number, minutes: number, seconds?: number, milliseconds?: number); + static from(hours: number, minutes: number, seconds?: number, milliseconds?: number): ClockTime; + static millisecondsFromTime(hours: number, minutes: number, seconds?: number, milliseconds?: number): number; + toString(): string; +} diff --git a/dist/umd.min/System/Time/DateTime.d.ts b/dist/umd.min/System/Time/DateTime.d.ts new file mode 100644 index 00000000..f283e5e7 --- /dev/null +++ b/dist/umd.min/System/Time/DateTime.d.ts @@ -0,0 +1,57 @@ +/// +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Based on .NET DateTime's interface. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ClockTime from './ClockTime'; +import TimeSpan from './TimeSpan'; +declare class DateTime implements ICalendarDate, IDateTime { + private _value; + toJsDate(): Date; + private _setJsDate(value); + constructor(); + constructor(dateString: string, kind?: DateTime.Kind); + constructor(milliseconds: number, kind?: DateTime.Kind); + constructor(source: Date, kind?: DateTime.Kind); + constructor(source: DateTime, kind?: DateTime.Kind); + private _kind; + kind: DateTime.Kind; + year: number; + month: Gregorian.Month; + day: number; + dayOfWeek: Gregorian.DayOfWeek; + addMilliseconds(ms: number): DateTime; + addSeconds(seconds: number): DateTime; + addMinutes(minutes: number): DateTime; + addHours(hours: number): DateTime; + addDays(days: number): DateTime; + addMonths(months: number): DateTime; + addYears(years: number): DateTime; + add(time: ITimeQuantity): DateTime; + subtract(time: ITimeQuantity): DateTime; + timePassedSince(previous: Date | DateTime): TimeSpan; + date: DateTime; + private _time; + timeOfDay: ClockTime; + toTimeStamp(): ITimeStamp; + static now: DateTime; + toUniversalTime: DateTime; + static today: DateTime; + static tomorrow: DateTime; + static between(first: Date | DateTime, last: Date | DateTime): TimeSpan; + static isLeapYear(year: number): boolean; + static daysInMonth(year: number, month: Gregorian.Month): number; +} +declare module DateTime { + const enum Kind { + Unspecified = 0, + Local = 1, + Utc = 2, + } +} +export default DateTime; diff --git a/dist/umd.min/System/Time/HowMany.d.ts b/dist/umd.min/System/Time/HowMany.d.ts new file mode 100644 index 00000000..314a22e2 --- /dev/null +++ b/dist/umd.min/System/Time/HowMany.d.ts @@ -0,0 +1,41 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare module HowMany { + module Hours { + const enum Per { + Day = 24, + } + } + module Minutes { + const enum Per { + Hour = 60, + Day = 1440, + } + } + module Seconds { + const enum Per { + Minute = 60, + Hour = 3600, + Day = 86400, + } + } + module Milliseconds { + const enum Per { + Second = 1000, + Minute = 60000, + Hour = 3600000, + Day = 86400000, + } + } + module Ticks { + const enum Per { + Millisecond = 10000, + Second = 10000000, + Minute = 600000000, + Hour = 36000000000, + Day = 864000000000, + } + } +} diff --git a/dist/umd.min/System/Time/TimeQuantity.d.ts b/dist/umd.min/System/Time/TimeQuantity.d.ts new file mode 100644 index 00000000..d0a17b9f --- /dev/null +++ b/dist/umd.min/System/Time/TimeQuantity.d.ts @@ -0,0 +1,20 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeUnit from './TimeUnit'; +export default class TimeQuantity implements IEquatable, IComparable, ITimeQuantity { + protected _quantity: number; + constructor(_quantity?: number); + getTotalMilliseconds(): number; + direction: number; + equals(other: ITimeQuantity): boolean; + compareTo(other: ITimeQuantity): number; + protected _total: ITimeMeasurement; + total: ITimeMeasurement; + getTotal(units: TimeUnit): number; +} diff --git a/dist/umd.min/System/Time/TimeSpan.d.ts b/dist/umd.min/System/Time/TimeSpan.d.ts new file mode 100644 index 00000000..aff6b6f2 --- /dev/null +++ b/dist/umd.min/System/Time/TimeSpan.d.ts @@ -0,0 +1,34 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Originally based upon .NET source but with many additions and improvements. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeUnit from './TimeUnit'; +import ClockTime from './ClockTime'; +import TimeQuantity from './TimeQuantity'; +export default class TimeSpan extends TimeQuantity implements ITimeMeasurement { + ticks: number; + milliseconds: number; + seconds: number; + minutes: number; + hours: number; + days: number; + constructor(value: number, units?: TimeUnit); + total: TimeSpan; + private _time; + time: ClockTime; + add(other: ITimeQuantity): TimeSpan; + addUnit(value: number, units?: TimeUnit): TimeSpan; + static from(value: number, units: TimeUnit): TimeSpan; + static fromDays(value: number): TimeSpan; + static fromHours(value: number): TimeSpan; + static fromMinutes(value: number): TimeSpan; + static fromSeconds(value: number): TimeSpan; + static fromMilliseconds(value: number): TimeSpan; + static fromTicks(value: number): TimeSpan; + static zero: TimeSpan; +} diff --git a/dist/umd.min/System/Time/TimeStamp.d.ts b/dist/umd.min/System/Time/TimeStamp.d.ts new file mode 100644 index 00000000..8aff84a1 --- /dev/null +++ b/dist/umd.min/System/Time/TimeStamp.d.ts @@ -0,0 +1,21 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class TimeStamp implements ITimeStamp, IDateTime { + year: number; + month: Gregorian.Month; + day: number; + hour: number; + minute: number; + second: number; + millisecond: number; + tick: number; + constructor(year: number, month: Gregorian.Month, day?: number, hour?: number, minute?: number, second?: number, millisecond?: number, tick?: number); + toJsDate(): Date; + static from(d: Date | IDateTime): TimeStamp; +} diff --git a/dist/umd.min/System/Time/TimeUnit.d.ts b/dist/umd.min/System/Time/TimeUnit.d.ts new file mode 100644 index 00000000..64ba86e3 --- /dev/null +++ b/dist/umd.min/System/Time/TimeUnit.d.ts @@ -0,0 +1,22 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Originally based upon .NET source but with many additions and improvements. + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +declare enum TimeUnit { + Ticks = 0, + Milliseconds = 1, + Seconds = 2, + Minutes = 3, + Hours = 4, + Days = 5, +} +declare module TimeUnit { + function toMilliseconds(value: number, units?: TimeUnit): number; + function fromMilliseconds(ms: number, units: TimeUnit): number; + function from(quantity: ITimeQuantity, unit: TimeUnit): number; + function assertValid(unit: TimeUnit): boolean; +} +export default TimeUnit; diff --git a/dist/umd.min/System/Time/TimeUnitValue.d.ts b/dist/umd.min/System/Time/TimeUnitValue.d.ts new file mode 100644 index 00000000..782f6cd6 --- /dev/null +++ b/dist/umd.min/System/Time/TimeUnitValue.d.ts @@ -0,0 +1,19 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import TimeUnit from './TimeUnit'; +import TimeQuantity from './TimeQuantity'; +export default class TimeUnitValue extends TimeQuantity { + private _units; + constructor(value: number | ITimeQuantity, _units: TimeUnit); + value: number; + getTotalMilliseconds(): number; + units: TimeUnit; + to(units?: TimeUnit): TimeUnitValue; + static from(value: number | ITimeQuantity, units?: TimeUnit): TimeUnitValue; +} diff --git a/dist/umd.min/System/Timers/Timer.d.ts b/dist/umd.min/System/Timers/Timer.d.ts new file mode 100644 index 00000000..00797473 --- /dev/null +++ b/dist/umd.min/System/Timers/Timer.d.ts @@ -0,0 +1,24 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import ObservableBase from "./../Observable/ObservableBase"; +export default class Timer extends ObservableBase implements ITimer, ICancellable { + private _interval; + private _maxCount; + private _initialDelay; + private _cancel; + private _count; + constructor(_interval: number, _maxCount?: number, _initialDelay?: number); + static startNew(millisecondInterval: number, maxCount?: number, initialDelay?: number): Timer; + isRunning: boolean; + count: number; + start(): void; + stop(): void; + reset(): void; + cancel(): boolean; + dispose(): void; + private static _onTick(timer, reInitTimer?); +} diff --git a/dist/umd.min/System/Types.d.ts b/dist/umd.min/System/Types.d.ts new file mode 100644 index 00000000..cddf07c8 --- /dev/null +++ b/dist/umd.min/System/Types.d.ts @@ -0,0 +1,46 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare class TypeInfo { + private target; + type: string; + isBoolean: boolean; + isNumber: boolean; + isFinite: boolean; + isValidNumber: boolean; + isString: boolean; + isTrueNaN: boolean; + isObject: boolean; + isFunction: boolean; + isUndefined: boolean; + isNull: boolean; + isNullOrUndefined: boolean; + isPrimitive: boolean; + constructor(target: any); + member(name: string): TypeInfo; + static getFor(target: any): TypeInfo; +} +export declare module Type { + const BOOLEAN: string; + const NUMBER: string; + const STRING: string; + const OBJECT: string; + const UNDEFINED: string; + const FUNCTION: string; + function isBoolean(value: any): value is boolean; + function isNumber(value: any, allowNaN?: boolean): value is number; + function isTrueNaN(value: any): value is number; + function isString(value: any): value is string; + function isPrimitive(value: any): value is Primitive; + function isFunction(value: any): value is Function; + function isObject(value: any, allowNull?: boolean): boolean; + function numberOrNaN(value: any): number; + function of(target: any): TypeInfo; + function hasMember(value: any, property: string): boolean; + function hasMemberOfType(instance: any, property: string, type: string): instance is T; + function isArrayLike(instance: any): instance is IArray; +} +export default Type; diff --git a/dist/umd.min/System/Uri/HostNameType.d.ts b/dist/umd.min/System/Uri/HostNameType.d.ts new file mode 100644 index 00000000..b4e74073 --- /dev/null +++ b/dist/umd.min/System/Uri/HostNameType.d.ts @@ -0,0 +1,13 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.UriHostNameType%28v=vs.110%29.aspx + */ +declare enum UriHostNameType { + Basic = 0, + DNS = 1, + IPv4 = 2, + IPv6 = 3, + Unknown = 4, +} +export default UriHostNameType; diff --git a/dist/umd.min/System/Uri/QueryBuilder.d.ts b/dist/umd.min/System/Uri/QueryBuilder.d.ts new file mode 100644 index 00000000..891db685 --- /dev/null +++ b/dist/umd.min/System/Uri/QueryBuilder.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +import OrderedStringKeyDictionary from "../Collections/Dictionaries/OrderedStringKeyDictionary"; +export default class QueryBuilder extends OrderedStringKeyDictionary { + constructor(query: QueryParamsConvertible, decodeValues?: boolean); + static init(query: QueryParamsConvertible, decodeValues?: boolean): QueryBuilder; + importQuery(query: QueryParamsConvertible, decodeValues?: boolean): QueryBuilder; + importFromString(values: string, deserialize?: boolean, decodeValues?: boolean): QueryBuilder; + encode(prefixIfNotEmpty?: boolean): string; + toString(): string; +} diff --git a/dist/umd.min/System/Uri/QueryBuilder.js b/dist/umd.min/System/Uri/QueryBuilder.js new file mode 100644 index 00000000..c4deef0b --- /dev/null +++ b/dist/umd.min/System/Uri/QueryBuilder.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +var __extends=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)};!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define(["require","exports","../Types","./QueryParams","../Collections/Dictionaries/OrderedStringKeyDictionary","../Collections/Enumeration/Enumerator"],e)}(function(e,t){"use strict";var r=e("../Types"),o=e("./QueryParams"),i=e("../Collections/Dictionaries/OrderedStringKeyDictionary"),n=e("../Collections/Enumeration/Enumerator"),s=function(e){function t(t,r){void 0===r&&(r=!0),e.call(this),this.importQuery(t,r)}return __extends(t,e),t.init=function(e,r){return void 0===r&&(r=!0),new t(e,r)},t.prototype.importQuery=function(e,t){return void 0===t&&(t=!0),r["default"].isString(e)?this.importFromString(e,t):n.isEnumerableOrArrayLike(e)?this.importEntries(e):this.importMap(e),this},t.prototype.importFromString=function(e,t,r){void 0===t&&(t=!0),void 0===r&&(r=!0);var i=this;return o.parse(e,function(e,t){if(i.containsKey(e)){var r=i.getValue(e);Array.isArray(r)?r.push(t):i.setValue(e,[r,t])}else i.setValue(e,t)},t,r),this},t.prototype.encode=function(e){return o.encode(this,e)},t.prototype.toString=function(){return this.encode()},t}(i["default"]);Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=s}); +//# sourceMappingURL=QueryBuilder.js.map diff --git a/dist/umd.min/System/Uri/QueryParams.d.ts b/dist/umd.min/System/Uri/QueryParams.d.ts new file mode 100644 index 00000000..6bedb350 --- /dev/null +++ b/dist/umd.min/System/Uri/QueryParams.d.ts @@ -0,0 +1,17 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export declare function encode(values: IUriComponentMap | QueryParamEnumerableOrArray, prefixIfNotEmpty?: boolean): string; +export declare function encodeValue(value: UriComponentValue): string; +export declare function isUriComponentFormattable(instance: any): instance is IUriComponentFormattable; +export declare function parse(query: string, entryHandler: (key: string, value: Primitive) => void, deserialize?: boolean, decodeValues?: boolean): void; +export declare function parseToMap(query: string, deserialize?: boolean, decodeValues?: boolean): IMap; +export declare function parseToArray(query: string, deserialize?: boolean, decodeValues?: boolean): IStringKeyValuePair[]; +export declare module Separator { + const Entry: string; + const KeyValue: string; +} diff --git a/dist/umd.min/System/Uri/Scheme.d.ts b/dist/umd.min/System/Uri/Scheme.d.ts new file mode 100644 index 00000000..5e625ec8 --- /dev/null +++ b/dist/umd.min/System/Uri/Scheme.d.ts @@ -0,0 +1,21 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx + */ +declare enum Scheme { + file = 0, + ftp = 1, + gopher = 2, + http = 3, + https = 4, + ldap = 5, + mailto = 6, + pipe = 7, + tcp = 8, + news = 9, + nntp = 10, + telnet = 11, + uuid = 12, +} +export default Scheme; diff --git a/dist/umd.min/System/Uri/Scheme.js b/dist/umd.min/System/Uri/Scheme.js new file mode 100644 index 00000000..1478c96a --- /dev/null +++ b/dist/umd.min/System/Uri/Scheme.js @@ -0,0 +1,7 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx + */ +!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define(["require","exports"],e)}(function(e,t){"use strict";var p;!function(e){e[e.file=0]="file",e[e.ftp=1]="ftp",e[e.gopher=2]="gopher",e[e.http=3]="http",e[e.https=4]="https",e[e.ldap=5]="ldap",e[e.mailto=6]="mailto",e[e.pipe=7]="pipe",e[e.tcp=8]="tcp",e[e.news=9]="news",e[e.nntp=10]="nntp",e[e.telnet=11]="telnet",e[e.uuid=12]="uuid"}(p||(p={}));var i="net.pipe",o="net.tcp";p[p.pipe]=i,p[p.tcp]=o,p[i]=p.pipe,p[o]=p.tcp,Object.freeze(p),Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=p}); +//# sourceMappingURL=Scheme.js.map diff --git a/dist/umd.min/System/Uri/Scheme.js.map b/dist/umd.min/System/Uri/Scheme.js.map new file mode 100644 index 00000000..8e519dec --- /dev/null +++ b/dist/umd.min/System/Uri/Scheme.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Uri/Scheme.js","System/Uri/Scheme.ts"],"names":["factory","module","exports","v","require","undefined","define","amd","Scheme","PIPE","TCP","pipe","tcp","Object","freeze","defineProperty","value"],"mappings":";;;;;CAKA,SAAWA,GACP,GAAsB,gBAAXC,SAAiD,gBAAnBA,QAAOC,QAAsB,CAClE,GAAIC,GAAIH,EAAQI,QAASF,QAAoBG,UAANF,IAAiBF,OAAOC,QAAUC,OAElD,kBAAXG,SAAyBA,OAAOC,KAC5CD,QAAQ,UAAW,WAAYN,IAEpC,SAAUI,EAASF,GAClB,YCNJ,IAAKM,IAAL,SAAKA,GAIJA,EAAAA,EAAA,KAAA,GAAA,OAMAA,EAAAA,EAAA,IAAA,GAAA,MAMAA,EAAAA,EAAA,OAAA,GAAA,SAMAA,EAAAA,EAAA,KAAA,GAAA,OAMAA,EAAAA,EAAA,MAAA,GAAA,QAMAA,EAAAA,EAAA,KAAA,GAAA,OAMAA,EAAAA,EAAA,OAAA,GAAA,SAMAA,EAAAA,EAAA,KAAA,GAAA,OAMAA,EAAAA,EAAA,IAAA,GAAA,MAMAA,EAAAA,EAAA,KAAA,GAAA,OAMAA,EAAAA,EAAA,KAAA,IAAA,OAMAA,EAAAA,EAAA,OAAA,IAAA,SAKAA,EAAAA,EAAA,KAAA,IAAA,QA3EIA,IAAAA,MA+EL,IAAMC,GAAO,WACPC,EAAM,SAEZF,GAAOA,EAAOG,MAAQF,EACtBD,EAAOA,EAAOI,KAAOF,EAEfF,EAAQC,GAAQD,EAAOG,KACvBH,EAAQE,GAAOF,EAAOI,IAE5BC,OAAOC,OAAON,GAEdK,OAAAE,eAAAb,EAAA,cAAAc,OAAA,ID3DId,EAAAA,WC2DWM","file":"System/Uri/Scheme.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx\n */\n(function (factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define([\"require\", \"exports\"], factory);\n }\n})(function (require, exports) {\n \"use strict\";\n var Scheme;\n (function (Scheme) {\n Scheme[Scheme[\"file\"] = 0] = \"file\";\n Scheme[Scheme[\"ftp\"] = 1] = \"ftp\";\n Scheme[Scheme[\"gopher\"] = 2] = \"gopher\";\n Scheme[Scheme[\"http\"] = 3] = \"http\";\n Scheme[Scheme[\"https\"] = 4] = \"https\";\n Scheme[Scheme[\"ldap\"] = 5] = \"ldap\";\n Scheme[Scheme[\"mailto\"] = 6] = \"mailto\";\n Scheme[Scheme[\"pipe\"] = 7] = \"pipe\";\n Scheme[Scheme[\"tcp\"] = 8] = \"tcp\";\n Scheme[Scheme[\"news\"] = 9] = \"news\";\n Scheme[Scheme[\"nntp\"] = 10] = \"nntp\";\n Scheme[Scheme[\"telnet\"] = 11] = \"telnet\";\n Scheme[Scheme[\"uuid\"] = 12] = \"uuid\";\n })(Scheme || (Scheme = {}));\n var PIPE = 'net.pipe';\n var TCP = 'net.tcp';\n Scheme[Scheme.pipe] = PIPE;\n Scheme[Scheme.tcp] = TCP;\n Scheme[PIPE] = Scheme.pipe;\n Scheme[TCP] = Scheme.tcp;\n Object.freeze(Scheme);\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = Scheme;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n * Based on: https://msdn.microsoft.com/en-us/library/system.uri.scheme%28v=vs.110%29.aspx\r\n */\r\n\r\n// TODO: Possibly use string literals instead.\r\nenum Scheme {\r\n\t/**\r\n\t * The resource is a file on the local computer.\r\n\t */\r\n\tfile,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through FTP.\r\n\t */\r\n\tftp,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the Gopher protocol.\r\n\t */\r\n\tgopher,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through HTTP.\r\n\t */\r\n\thttp,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through SSL-encrypted HTTP.\r\n\t */\r\n\thttps,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the LDAP protocol.\r\n\t */\r\n\tldap,\r\n\r\n\r\n\t/**\r\n\t * The resource is an e-mail address and accessed through the SMTP protocol.\r\n\t */\r\n\tmailto,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through a named pipe.\r\n\t */\r\n\tpipe,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed from TCP endpoint.\r\n\t */\r\n\ttcp,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the NNTP protocol.\r\n\t */\r\n\tnews,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the NNTP protocol.\r\n\t */\r\n\tnntp,\r\n\r\n\r\n\t/**\r\n\t * The resource is accessed through the TELNET protocol.\r\n\t */\r\n\ttelnet,\r\n\r\n\t/**\r\n\t * The resource is accessed through a unique UUID endpoint name for communicating with a service.\r\n\t */\r\n\tuuid\r\n}\r\n\r\n// Extend the usefulness of the enum.\r\nconst PIPE = 'net.pipe';\r\nconst TCP = 'net.tcp';\r\n\r\nScheme[Scheme.pipe] = PIPE;\r\nScheme[Scheme.tcp] = TCP;\r\n\r\n(Scheme)[PIPE] = Scheme.pipe;\r\n(Scheme)[TCP] = Scheme.tcp;\r\n\r\nObject.freeze(Scheme);\r\n\r\nexport default Scheme;\r\n"]} \ No newline at end of file diff --git a/dist/umd.min/System/Uri/Uri.d.ts b/dist/umd.min/System/Uri/Uri.d.ts new file mode 100644 index 00000000..731d150d --- /dev/null +++ b/dist/umd.min/System/Uri/Uri.d.ts @@ -0,0 +1,48 @@ +/// +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier + */ +import UriScheme from "../Uri/Scheme"; +export default class Uri implements IUri, IEquatable { + scheme: SchemeValue; + userInfo: string; + host: string; + port: number; + path: string; + query: string; + fragment: string; + queryParams: IMap; + constructor(scheme: UriScheme | SchemeValue, userInfo: string, host: string, port: number, path: string, query?: QueryParamsConvertible, fragment?: string); + equals(other: IUri): boolean; + static from(uri: string | IUri, defaults?: IUri): Uri; + static parse(url: string, throwIfInvalid?: boolean): IUri; + static tryParse(url: string, out: (result: IUri) => void): boolean; + static copyOf(map: IUri): IUri; + copyTo(map: IUri): IUri; + updateQuery(query: QueryParamsConvertible): Uri; + protected getAbsoluteUri(): string; + protected getAuthority(): string; + protected getPathAndQuery(): string; + absoluteUri: string; + authority: string; + pathAndQuery: string; + baseUri: string; + pathSegments: string[]; + toMap(): IUri; + toString(): string; + static toString(uri: IUri): string; + static getAuthority(uri: IUri): string; +} +export declare enum Fields { + scheme = 0, + userInfo = 1, + host = 2, + port = 3, + path = 4, + query = 5, + fragment = 6, +} diff --git a/dist/umd.min/System/Uri/Uri.js b/dist/umd.min/System/Uri/Uri.js new file mode 100644 index 00000000..be2e1261 --- /dev/null +++ b/dist/umd.min/System/Uri/Uri.js @@ -0,0 +1,7 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier + */ +!function(t){if("object"==typeof module&&"object"==typeof module.exports){var e=t(require,exports);void 0!==e&&(module.exports=e)}else"function"==typeof define&&define.amd&&define(["require","exports","../Types","../Uri/QueryParams","../Text/Utility","../Uri/Scheme","../Exceptions/ArgumentException","../Exceptions/ArgumentOutOfRangeException"],t)}(function(t,e){"use strict";function r(t,e){var r,n=0;for(e||(e={});r=v[n++];){var i=t[r];i&&(e[r]=i)}return e}function n(t){var e=t;if(p["default"].isString(e)){if(!e)return g;if(e=d["default"][h.trim(e).toLowerCase().replace(/[^a-z0-9+.-]+$/g,q)],isNaN(e))throw new y["default"]("scheme",t,"Invalid scheme.")}if(p["default"].isNumber(e,!1)){if(e=d["default"][e],!e)throw new y["default"]("scheme",t,"Invalid scheme.");return e}return g}function i(t){if(0===t)return t;if(!t)return null;var e;if(p["default"].isNumber(t,!0)){if(e=t,e>=0&&isFinite(e))return e}else if(p["default"].isString(t)&&(e=parseInt(t))&&!isNaN(e))return i(e);throw new m["default"]("port","invalid value")}function u(t){if(!t.host){if(t.userInfo)throw new m["default"]("host","Cannot include user info when there is no host.");if(p["default"].isNumber(t.port,!1))throw new m["default"]("host","Cannot include a port when there is no host.")}var e=t.host||q;return e&&(t.userInfo&&(e=t.userInfo+N+e),isNaN(t.port)||(e+=":"+t.port),e=x+e),e}function o(t){return t&&(0!==t.indexOf(O)?O:q)+t}function s(t){return t&&(0!==t.indexOf(U)?U:q)+t}function f(t){var e=t.path,r=t.query;return q+(e||q)+(o(r)||q)}function a(t){var e=n(t.scheme),r=u(t),i=f(t),o=s(t.fragment),a=q+(e&&e+":"||q)+(r||q),l=q+(i||q)+(o||q);if(a&&l&&e&&!r)throw new m["default"]("authority","Cannot format schemed Uri with missing authority.");return a&&i&&0!==i.indexOf(w)&&(l=w+l),a+l}function l(t,e){if(!t)return new m["default"]("url","Nothing to parse.");var i,u={};if(i=t.indexOf(U),-1!=i&&(u.fragment=t.substring(i+1)||g,t=t.substring(0,i)),i=t.indexOf(O),-1!=i&&(u.query=t.substring(i+1)||g,t=t.substring(0,i)),i=t.indexOf(x),-1!=i){var o=h.trim(t.substring(0,i)),s=/:$/;if(!s.test(o))return new m["default"]("url","Scheme was improperly formatted");o=h.trim(o.replace(s,q));try{u.scheme=n(o)||g}catch(f){return f}t=t.substring(i+2)}if(i=t.indexOf(w),-1!=i&&(u.path=t.substring(i),t=t.substring(0,i)),i=t.indexOf(N),-1!=i&&(u.userInfo=t.substring(0,i)||g,t=t.substring(i+1)),i=t.indexOf(":"),-1!=i){var a=parseInt(h.trim(t.substring(i+1)));if(isNaN(a))return new m["default"]("url","Port was invalid.");u.port=a,t=t.substring(0,i)}return t=h.trim(t),t&&(u.host=t),e(r(u)),null}var p=t("../Types"),c=t("../Uri/QueryParams"),h=t("../Text/Utility"),d=t("../Uri/Scheme"),m=t("../Exceptions/ArgumentException"),y=t("../Exceptions/ArgumentOutOfRangeException"),g=void 0,b=function(){function t(t,e,r,u,f,a,l){var h=this;h.scheme=n(t)||null,h.userInfo=e||null,h.host=r||null,h.port=i(u),h.authority=h.getAuthority()||null,h.path=f||null,p["default"].isString(a)||(a=c.encode(a)),h.query=o(a)||null,Object.freeze(h.queryParams=h.query?c.parseToMap(h.query):{}),h.pathAndQuery=h.getPathAndQuery()||null,h.fragment=s(l)||null,h.absoluteUri=h.getAbsoluteUri(),h.baseUri=h.absoluteUri.replace(/[?#].*/,""),Object.freeze(h)}return t.prototype.equals=function(e){return this===e||this.absoluteUri==t.toString(e)},t.from=function(e,r){var n=!e||p["default"].isString(e)?t.parse(e):e;return new t(n.scheme||r&&r.scheme,n.userInfo||r&&r.userInfo,n.host||r&&r.host,isNaN(n.port)?r&&r.port:n.port,n.path||r&&r.path,n.query||r&&r.query,n.fragment||r&&r.fragment)},t.parse=function(t,e){void 0===e&&(e=!0);var r=null,n=l(t,function(t){r=t});if(e&&n)throw n;return r},t.tryParse=function(t,e){return!l(t,e)},t.copyOf=function(t){return r(t)},t.prototype.copyTo=function(t){return r(this,t)},t.prototype.updateQuery=function(e){var r=this.toMap();return r.query=e,t.from(r)},t.prototype.getAbsoluteUri=function(){return a(this)},t.prototype.getAuthority=function(){return u(this)},t.prototype.getPathAndQuery=function(){return f(this)},Object.defineProperty(t.prototype,"pathSegments",{get:function(){return this.path.match(/^[\/]|[^\/]*[\/]|[^\/]+$/g)},enumerable:!0,configurable:!0}),t.prototype.toMap=function(){return this.copyTo({})},t.prototype.toString=function(){return this.absoluteUri},t.toString=function(e){return e instanceof t?e.absoluteUri:a(e)},t.getAuthority=function(t){return u(t)},t}();Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=b,function(t){t[t.scheme=0]="scheme",t[t.userInfo=1]="userInfo",t[t.host=2]="host",t[t.port=3]="port",t[t.path=4]="path",t[t.query=5]="query",t[t.fragment=6]="fragment"}(e.Fields||(e.Fields={}));var v=e.Fields;Object.freeze(v);var w="/",x="//",O="?",U="#",q="",N="@"}); +//# sourceMappingURL=Uri.js.map diff --git a/dist/umd.min/System/Uri/Uri.js.map b/dist/umd.min/System/Uri/Uri.js.map new file mode 100644 index 00000000..018df45f --- /dev/null +++ b/dist/umd.min/System/Uri/Uri.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Uri/Uri.js","System/Uri/Uri.ts"],"names":["factory","module","exports","v","require","undefined","define","amd","copyUri","from","to","field","i","Fields","value","getScheme","scheme","s","Types_1","isString","VOID0","Scheme_1","Utility_1","trim","toLowerCase","replace","EMPTY","isNaN","ArgumentOutOfRangeException_1","isNumber","getPort","port","p","isFinite","parseInt","ArgumentException_1","getAuthority","uri","host","userInfo","result","AT","SLASH2","formatQuery","query","indexOf","QM","formatFragment","fragment","HASH","getPathAndQuery","path","uriToString","authority","pathAndQuery","part1","part2","SLASH","tryParse","url","out","substring","c","test","ex","QueryParams","Uri","_","this","encode","Object","freeze","queryParams","parseToMap","absoluteUri","getAbsoluteUri","baseUri","prototype","equals","other","toString","defaults","u","parse","throwIfInvalid","copyOf","map","copyTo","updateQuery","toMap","defineProperty","get","match","enumerable","configurable"],"mappings":";;;;;CAKA,SAAWA,GACP,GAAsB,gBAAXC,SAAiD,gBAAnBA,QAAOC,QAAsB,CAClE,GAAIC,GAAIH,EAAQI,QAASF,QAAoBG,UAANF,IAAiBF,OAAOC,QAAUC,OAElD,kBAAXG,SAAyBA,OAAOC,KAC5CD,QAAQ,UAAW,UAAW,WAAY,qBAAsB,kBAAmB,gBAAiB,kCAAmC,6CAA8CN,IAE1L,SAAUI,EAASF,GCHtB,YA8QA,SAAAM,GAAiBC,EAAWC,GAE3B,GAAWC,GAAPC,EAAI,CAER,KADIF,IAAIA,MACFC,EAAQE,EAAOD,MACrB,CACC,GAAIE,GAAcL,EAAME,EACrBG,KAAaJ,EAAIC,GAASG,GAE9B,MAAOJ,GAKR,QAAAK,GAAmBC,GAElB,GAAIC,GAAQD,CACZ,IAAGE,EAAAA,WAAKC,SAASF,GACjB,CACC,IAAIA,EAAG,MAAOG,EAId,IAFAH,EAAII,EAAAA,WAAeC,EAAAC,KAAKN,GAAGO,cAAcC,QAAQ,kBAAmBC,IAEjEC,MAAMV,GACR,KAAM,IAAIW,GAAAA,WAA4B,SAAUZ,EAAQ,mBAG1D,GAAGE,EAAAA,WAAKW,SAASZ,GAAG,GACpB,CAEC,GADAA,EAAII,EAAAA,WAAkBJ,IAClBA,EACH,KAAM,IAAIW,GAAAA,WAA4B,SAAUZ,EAAQ,kBAEzD,OAAOC,GAGR,MAAOG,GAGR,QAAAU,GAAiBC,GAEhB,GAAU,IAAPA,EAAU,MAAeA,EAC5B,KAAIA,EAAM,MAAO,KACjB,IAAIC,EAEJ,I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AQNR,EAAAc,SAAP,SAAgB3C,GAEf,MAAOA,aAAe6B,GACb7B,EAAKqC,YACXtB,EAAYf,IAQT6B,EAAA9B,aAAP,SAAoBC,GAEnB,MAAOD,GAAaC,IAItB6B,IA/OAI,QAAAoB,eAAAxF,EAAA,cAAAY,OAAA,ID+EIZ,EAAAA,WAAkBgE,ECkKtB,SAAYrD,GACXA,EAAAA,EAAA,OAAA,GAAA,SACAA,EAAAA,EAAA,SAAA,GAAA,WACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,MAAA,GAAA,QACAA,EAAAA,EAAA,SAAA,GAAA,YAPWX,EAAAW,SAAAX,EAAAW,WAAZ,IAAYA,GAAAX,EAAAW,MASZyD,QAAOC,OAAO1D,EAcd,IAAM4C,GAAQ,IAAKf,EAAS,KAAMI,EAAK,IAAKG,EAAO,IAAKvB,EAAQ,GAAIe,EAAK","file":"System/Uri/Uri.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier\n */\n(function (factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define([\"require\", \"exports\", \"../Types\", \"../Uri/QueryParams\", \"../Text/Utility\", \"../Uri/Scheme\", \"../Exceptions/ArgumentException\", \"../Exceptions/ArgumentOutOfRangeException\"], factory);\n }\n})(function (require, exports) {\n 'use strict';\n var Types_1 = require(\"../Types\");\n var QueryParams = require(\"../Uri/QueryParams\");\n var Utility_1 = require(\"../Text/Utility\");\n var Scheme_1 = require(\"../Uri/Scheme\");\n var ArgumentException_1 = require(\"../Exceptions/ArgumentException\");\n var ArgumentOutOfRangeException_1 = require(\"../Exceptions/ArgumentOutOfRangeException\");\n var VOID0 = void (0);\n var Uri = (function () {\n function Uri(scheme, userInfo, host, port, path, query, fragment) {\n var _ = this;\n _.scheme = getScheme(scheme) || null;\n _.userInfo = userInfo || null;\n _.host = host || null;\n _.port = getPort(port);\n _.authority = _.getAuthority() || null;\n _.path = path || null;\n if (!Types_1.default.isString(query))\n query = QueryParams.encode(query);\n _.query = formatQuery(query) || null;\n Object.freeze(_.queryParams\n = _.query\n ? QueryParams.parseToMap(_.query)\n : {});\n _.pathAndQuery = _.getPathAndQuery() || null;\n _.fragment = formatFragment(fragment) || null;\n _.absoluteUri = _.getAbsoluteUri();\n _.baseUri = _.absoluteUri.replace(/[?#].*/, '');\n Object.freeze(_);\n }\n Uri.prototype.equals = function (other) {\n return this === other || this.absoluteUri == Uri.toString(other);\n };\n Uri.from = function (uri, defaults) {\n var u = (!uri || Types_1.default.isString(uri))\n ? Uri.parse(uri) : uri;\n return new Uri(u.scheme || defaults && defaults.scheme, u.userInfo || defaults && defaults.userInfo, u.host || defaults && defaults.host, isNaN(u.port) ? defaults && defaults.port : u.port, u.path || defaults && defaults.path, u.query || defaults && defaults.query, u.fragment || defaults && defaults.fragment);\n };\n Uri.parse = function (url, throwIfInvalid) {\n if (throwIfInvalid === void 0) { throwIfInvalid = true; }\n var result = null;\n var ex = tryParse(url, function (out) { result = out; });\n if (throwIfInvalid && ex)\n throw ex;\n return result;\n };\n Uri.tryParse = function (url, out) {\n return !tryParse(url, out);\n };\n Uri.copyOf = function (map) {\n return copyUri(map);\n };\n Uri.prototype.copyTo = function (map) {\n return copyUri(this, map);\n };\n Uri.prototype.updateQuery = function (query) {\n var map = this.toMap();\n map.query = query;\n return Uri.from(map);\n };\n Uri.prototype.getAbsoluteUri = function () {\n return uriToString(this);\n };\n Uri.prototype.getAuthority = function () {\n return getAuthority(this);\n };\n Uri.prototype.getPathAndQuery = function () {\n return getPathAndQuery(this);\n };\n Object.defineProperty(Uri.prototype, \"pathSegments\", {\n get: function () {\n return this.path.match(/^[/]|[^/]*[/]|[^/]+$/g);\n },\n enumerable: true,\n configurable: true\n });\n Uri.prototype.toMap = function () {\n return this.copyTo({});\n };\n Uri.prototype.toString = function () {\n return this.absoluteUri;\n };\n Uri.toString = function (uri) {\n return uri instanceof Uri\n ? uri.absoluteUri\n : uriToString(uri);\n };\n Uri.getAuthority = function (uri) {\n return getAuthority(uri);\n };\n return Uri;\n }());\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = Uri;\n (function (Fields) {\n Fields[Fields[\"scheme\"] = 0] = \"scheme\";\n Fields[Fields[\"userInfo\"] = 1] = \"userInfo\";\n Fields[Fields[\"host\"] = 2] = \"host\";\n Fields[Fields[\"port\"] = 3] = \"port\";\n Fields[Fields[\"path\"] = 4] = \"path\";\n Fields[Fields[\"query\"] = 5] = \"query\";\n Fields[Fields[\"fragment\"] = 6] = \"fragment\";\n })(exports.Fields || (exports.Fields = {}));\n var Fields = exports.Fields;\n Object.freeze(Fields);\n function copyUri(from, to) {\n var i = 0, field;\n if (!to)\n to = {};\n while (field = Fields[i++]) {\n var value = from[field];\n if (value)\n to[field] = value;\n }\n return to;\n }\n var SLASH = '/', SLASH2 = '//', QM = '?', HASH = '#', EMPTY = '', AT = '@';\n function getScheme(scheme) {\n var s = scheme;\n if (Types_1.default.isString(s)) {\n if (!s)\n return VOID0;\n s = Scheme_1.default[Utility_1.trim(s).toLowerCase().replace(/[^a-z0-9+.-]+$/g, EMPTY)];\n if (isNaN(s))\n throw new ArgumentOutOfRangeException_1.default('scheme', scheme, 'Invalid scheme.');\n }\n if (Types_1.default.isNumber(s, false)) {\n s = Scheme_1.default[s];\n if (!s)\n throw new ArgumentOutOfRangeException_1.default('scheme', scheme, 'Invalid scheme.');\n return s;\n }\n return VOID0;\n }\n function getPort(port) {\n if (port === 0)\n return port;\n if (!port)\n return null;\n var p;\n if (Types_1.default.isNumber(port, true)) {\n p = port;\n if (p >= 0 && isFinite(p))\n return p;\n }\n else if (Types_1.default.isString(port) && (p = parseInt(port)) && !isNaN(p)) {\n return getPort(p);\n }\n throw new ArgumentException_1.default(\"port\", \"invalid value\");\n }\n function getAuthority(uri) {\n if (!uri.host) {\n if (uri.userInfo)\n throw new ArgumentException_1.default('host', 'Cannot include user info when there is no host.');\n if (Types_1.default.isNumber(uri.port, false))\n throw new ArgumentException_1.default('host', 'Cannot include a port when there is no host.');\n }\n var result = uri.host || EMPTY;\n if (result) {\n if (uri.userInfo)\n result = uri.userInfo + AT + result;\n if (!isNaN(uri.port))\n result += ':' + uri.port;\n result = SLASH2 + result;\n }\n return result;\n }\n function formatQuery(query) {\n return query && ((query.indexOf(QM) !== 0 ? QM : EMPTY) + query);\n }\n function formatFragment(fragment) {\n return fragment && ((fragment.indexOf(HASH) !== 0 ? HASH : EMPTY) + fragment);\n }\n function getPathAndQuery(uri) {\n var path = uri.path, query = uri.query;\n return EMPTY\n + (path || EMPTY)\n + (formatQuery(query) || EMPTY);\n }\n function uriToString(uri) {\n var scheme = getScheme(uri.scheme), authority = getAuthority(uri), pathAndQuery = getPathAndQuery(uri), fragment = formatFragment(uri.fragment);\n var part1 = EMPTY\n + ((scheme && (scheme + ':')) || EMPTY)\n + (authority || EMPTY);\n var part2 = EMPTY\n + (pathAndQuery || EMPTY)\n + (fragment || EMPTY);\n if (part1 && part2 && scheme && !authority)\n throw new ArgumentException_1.default('authority', \"Cannot format schemed Uri with missing authority.\");\n if (part1 && pathAndQuery && pathAndQuery.indexOf(SLASH) !== 0)\n part2 = SLASH + part2;\n return part1 + part2;\n }\n function tryParse(url, out) {\n if (!url)\n return new ArgumentException_1.default('url', 'Nothing to parse.');\n var i, result = {};\n i = url.indexOf(HASH);\n if (i != -1) {\n result.fragment = url.substring(i + 1) || VOID0;\n url = url.substring(0, i);\n }\n i = url.indexOf(QM);\n if (i != -1) {\n result.query = url.substring(i + 1) || VOID0;\n url = url.substring(0, i);\n }\n i = url.indexOf(SLASH2);\n if (i != -1) {\n var scheme = Utility_1.trim(url.substring(0, i)), c = /:$/;\n if (!c.test(scheme))\n return new ArgumentException_1.default('url', 'Scheme was improperly formatted');\n scheme = Utility_1.trim(scheme.replace(c, EMPTY));\n try {\n result.scheme = getScheme(scheme) || VOID0;\n }\n catch (ex) {\n return ex;\n }\n url = url.substring(i + 2);\n }\n i = url.indexOf(SLASH);\n if (i != -1) {\n result.path = url.substring(i);\n url = url.substring(0, i);\n }\n i = url.indexOf(AT);\n if (i != -1) {\n result.userInfo = url.substring(0, i) || VOID0;\n url = url.substring(i + 1);\n }\n i = url.indexOf(':');\n if (i != -1) {\n var port = parseInt(Utility_1.trim(url.substring(i + 1)));\n if (isNaN(port))\n return new ArgumentException_1.default('url', 'Port was invalid.');\n result.port = port;\n url = url.substring(0, i);\n }\n url = Utility_1.trim(url);\n if (url)\n result.host = url;\n out(copyUri(result));\n return null;\n }\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n * Based on: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier\r\n */\r\n\r\n///\r\n///\r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nimport Type from \"../Types\";\r\nimport * as QueryParams from \"../Uri/QueryParams\";\r\nimport {trim} from \"../Text/Utility\";\r\nimport UriScheme from \"../Uri/Scheme\";\r\nimport Exception from \"../Exception\";\r\nimport ArgumentException from \"../Exceptions/ArgumentException\";\r\nimport ArgumentOutOfRangeException from \"../Exceptions/ArgumentOutOfRangeException\";\r\n\r\nconst VOID0:any = void(0);\r\n\r\n/**\r\n * Provides an read-only model representation of a uniform resource identifier (URI) and easy access to the parts of the URI.\r\n *\r\n * The read-only model (frozen) is easier for debugging than exposing accessors for each property.\r\n * ICloneable<Uri> is not used to prevent unnecessary copying of values that won't change.\r\n */\r\nexport default class Uri implements IUri, IEquatable\r\n{\r\n\r\n\tscheme:SchemeValue;\r\n\tuserInfo:string;\r\n\thost:string;\r\n\tport:number;\r\n\tpath:string;\r\n\tquery:string;\r\n\tfragment:string;\r\n\r\n\tqueryParams:IMap;\r\n\r\n\t/**\r\n\t * @param scheme The user name, password, or other user-specific information associated with the specified URI.\r\n\t * @param userInfo The host component of this instance.\r\n\t * @param host The port number of this URI.\r\n\t * @param port The absolute path of the URI.\r\n\t * @param path The absolute path of the URI.\r\n\t * @param query Any query information included in the specified URI.\r\n\t * @param fragment The escaped URI fragment.\r\n\t */\r\n\tconstructor(\r\n\t\tscheme:UriScheme|SchemeValue,\r\n\t\tuserInfo:string,\r\n\t\thost:string,\r\n\t\tport:number,\r\n\t\tpath:string,\r\n\t\tquery?:QueryParamsConvertible,\r\n\t\tfragment?:string)\r\n\t{\r\n\t\tvar _ = this;\r\n\t\t_.scheme = getScheme(scheme) || null;\r\n\t\t_.userInfo = userInfo || null;\r\n\t\t_.host = host || null;\r\n\r\n\t\t_.port = getPort(port);\r\n\r\n\t\t_.authority = _.getAuthority() || null;\r\n\r\n\t\t_.path = path || null;\r\n\r\n\r\n\t\tif(!Type.isString(query))\r\n\t\t\tquery = QueryParams.encode([]>query);\r\n\r\n\t\t_.query = formatQuery(query) || null;\r\n\t\tObject.freeze(_.queryParams\r\n\t\t\t= _.query\r\n\t\t\t? QueryParams.parseToMap(_.query)\r\n\t\t\t: {});\r\n\r\n\t\t_.pathAndQuery = _.getPathAndQuery() || null;\r\n\r\n\t\t_.fragment = formatFragment(fragment) || null;\r\n\r\n\t\t// This should validate the uri...\r\n\t\t_.absoluteUri = _.getAbsoluteUri();\r\n\r\n\t\t_.baseUri = _.absoluteUri.replace(/[?#].*/, '');\r\n\r\n\t\t// Intended to be read-only. Call .toMap() to get a writable copy.\r\n\t\tObject.freeze(_);\r\n\t}\r\n\r\n\t/**\r\n\t * Compares the values of another IUri via toString comparison.\r\n\t * @param other\r\n\t * @returns {boolean}\r\n\t */\r\n\tequals(other:IUri):boolean\r\n\t{\r\n\t\treturn this===other || this.absoluteUri==Uri.toString(other);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Parses or clones values from existing Uri values.\r\n\t * @param uri\r\n\t * @param defaults\r\n\t * @returns {Uri}\r\n\t */\r\n\tstatic from(uri:string|IUri, defaults?:IUri):Uri\r\n\t{\r\n\t\tvar u = (!uri || Type.isString(uri))\r\n\t\t\t? Uri.parse(uri) : uri;\r\n\r\n\t\treturn new Uri(\r\n\t\t\tu.scheme || defaults && defaults.scheme,\r\n\t\t\tu.userInfo || defaults && defaults.userInfo,\r\n\t\t\tu.host || defaults && defaults.host,\r\n\t\t\tisNaN(u.port) ? defaults && defaults.port : u.port,\r\n\t\t\tu.path || defaults && defaults.path,\r\n\t\t\tu.query || defaults && defaults.query,\r\n\t\t\tu.fragment || defaults && defaults.fragment\r\n\t\t);\r\n\t}\r\n\r\n\t/**\r\n\t * Parses a URL into it's components.\r\n\t * @param url The url to parse.\r\n\t * @param throwIfInvalid Defaults to true.\r\n\t * @returns {IUri} Returns a map of the values or *null* if invalid and *throwIfInvalid* is false.\r\n\t */\r\n\tstatic parse(url:string, throwIfInvalid:boolean = true):IUri\r\n\t{\r\n\t\tvar result:IUri = null;\r\n\t\tvar ex = tryParse(url, (out)=> {result = out;});\r\n\t\tif(throwIfInvalid && ex) throw ex;\r\n\t\treturn result;\r\n\t}\r\n\r\n\t/**\r\n\t * Parses a URL into it's components.\r\n\t * @param url The url to parse.\r\n\t * @param out A delegate to capture the value.\r\n\t * @returns {boolean} True if valid. False if invalid.\r\n\t */\r\n\tstatic tryParse(url:string, out:(result:IUri)=>void):boolean\r\n\t{\r\n\t\treturn !tryParse(url, out); // return type is Exception.\r\n\t}\r\n\r\n\tstatic copyOf(map:IUri):IUri\r\n\t{\r\n\t\treturn copyUri(map);\r\n\t}\r\n\r\n\tcopyTo(map:IUri):IUri\r\n\t{\r\n\t\treturn copyUri(this, map);\r\n\t}\r\n\r\n\tupdateQuery(query:QueryParamsConvertible):Uri\r\n\t{\r\n\t\tvar map = this.toMap();\r\n\t\tmap.query = query;\r\n\t\treturn Uri.from(map);\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Is provided for sub classes to override this value.\r\n\t */\r\n\tprotected getAbsoluteUri():string\r\n\t{\r\n\t\treturn uriToString(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Is provided for sub classes to override this value.\r\n\t */\r\n\tprotected getAuthority():string\r\n\t{\r\n\t\treturn getAuthority(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Is provided for sub classes to override this value.\r\n\t */\r\n\tprotected getPathAndQuery():string\r\n\t{\r\n\t\treturn getPathAndQuery(this);\r\n\t}\r\n\r\n\t/**\r\n\t * The absolute URI.\r\n\t */\r\n\tabsoluteUri:string;\r\n\r\n\t/**\r\n\t * Gets the Domain Name System (DNS) host name or IP address and the port number for a server.\r\n\t */\r\n\tauthority:string;\r\n\r\n\t/**\r\n\t * Gets the path and Query properties separated by a question mark (?).\r\n\t */\r\n\tpathAndQuery:string;\r\n\r\n\t/**\r\n\t * Gets the full path without the query or fragment.\r\n\t */\r\n\tbaseUri:string;\r\n\r\n\t/**\r\n\t * The segments that represent a path.
\r\n\t * https://msdn.microsoft.com/en-us/library/system.uri.segments%28v=vs.110%29.aspx\r\n\t *\r\n\t *
Example:
\r\n\t * If the path value equals: ```/tree/node/index.html```
\r\n\t * The result will be: ```['/','tree/','node/','index.html']```\r\n\t * @returns {string[]}\r\n\t */\r\n\tget pathSegments():string[]\r\n\t{\r\n\t\treturn this.path.match(/^[/]|[^/]*[/]|[^/]+$/g);\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a writable copy.\r\n\t * @returns {IUri}\r\n\t */\r\n\ttoMap():IUri\r\n\t{\r\n\t\treturn this.copyTo({});\r\n\t}\r\n\r\n\t/**\r\n\t * @returns {string} The full absolute uri.\r\n\t */\r\n\ttoString():string\r\n\t{\r\n\t\treturn this.absoluteUri;\r\n\t}\r\n\r\n\t/**\r\n\t * Properly converts an existing URI to a string.\r\n\t * @param uri\r\n\t * @returns {string}\r\n\t */\r\n\tstatic toString(uri:IUri):string\r\n\t{\r\n\t\treturn uri instanceof Uri\r\n\t\t\t? (uri).absoluteUri\r\n\t\t\t: uriToString(uri);\r\n\t}\r\n\r\n\t/**\r\n\t * Returns the authority segment of an URI.\r\n\t * @param uri\r\n\t * @returns {string}\r\n\t */\r\n\tstatic getAuthority(uri:IUri):string\r\n\t{\r\n\t\treturn getAuthority(uri);\r\n\t}\r\n\r\n\r\n}\r\n\r\nexport enum Fields {\r\n\tscheme,\r\n\tuserInfo,\r\n\thost,\r\n\tport,\r\n\tpath,\r\n\tquery,\r\n\tfragment\r\n}\r\nObject.freeze(Fields);\r\n\r\nfunction copyUri(from:IUri, to?:IUri)\r\n{\r\n\tvar i = 0, field:string;\r\n\tif(!to) to = {};\r\n\twhile(field = Fields[i++])\r\n\t{\r\n\t\tvar value = (from)[field];\r\n\t\tif(value) (to)[field] = value;\r\n\t}\r\n\treturn to;\r\n}\r\n\r\nconst SLASH = '/', SLASH2 = '//', QM = '?', HASH = '#', EMPTY = '', AT = '@';\r\n\r\nfunction getScheme(scheme:UriScheme|string):SchemeValue\r\n{\r\n\tvar s:any = scheme;\r\n\tif(Type.isString(s))\r\n\t{\r\n\t\tif(!s) return VOID0;\r\n\r\n\t\ts = UriScheme[trim(s).toLowerCase().replace(/[^a-z0-9+.-]+$/g, EMPTY)];\r\n\r\n\t\tif(isNaN(s))\r\n\t\t\tthrow new ArgumentOutOfRangeException('scheme', scheme, 'Invalid scheme.');\r\n\t}\r\n\r\n\tif(Type.isNumber(s, false))\r\n\t{\r\n\t\ts = UriScheme[s];\r\n\t\tif(!s)\r\n\t\t\tthrow new ArgumentOutOfRangeException('scheme', scheme, 'Invalid scheme.');\r\n\r\n\t\treturn s;\r\n\t}\r\n\r\n\treturn VOID0;\r\n}\r\n\r\nfunction getPort(port:number|string):number\r\n{\r\n\tif(port===0) return port;\r\n\tif(!port) return null;\r\n\tvar p:number;\r\n\r\n\tif(Type.isNumber(port, true))\r\n\t{\r\n\t\tp = port;\r\n\t\tif(p>=0 && isFinite(p))\r\n\t\t\treturn p;\r\n\t}\r\n\telse if(Type.isString(port) && (p = parseInt(port)) && !isNaN(p))\r\n\t{\r\n\t\treturn getPort(p);\r\n\t}\r\n\r\n\tthrow new ArgumentException(\"port\", \"invalid value\");\r\n}\r\n\r\nfunction getAuthority(uri:IUri):string\r\n{\r\n\r\n\tif(!uri.host)\r\n\t{\r\n\t\tif(uri.userInfo)\r\n\t\t\tthrow new ArgumentException('host', 'Cannot include user info when there is no host.');\r\n\r\n\t\tif(Type.isNumber(uri.port, false))\r\n\t\t\tthrow new ArgumentException('host', 'Cannot include a port when there is no host.');\r\n\t}\r\n\r\n\t/*\r\n\t * [//[user:password@]host[:port]]\r\n\t */\r\n\r\n\tvar result = uri.host || EMPTY;\r\n\r\n\tif(result)\r\n\t{\r\n\t\tif(uri.userInfo) result = uri.userInfo + AT + result;\r\n\t\tif(!isNaN(uri.port)) result += ':' + uri.port;\r\n\t\tresult = SLASH2 + result;\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\nfunction formatQuery(query:string):string\r\n{\r\n\treturn query && ((query.indexOf(QM)!==0 ? QM : EMPTY) + query);\r\n}\r\n\r\nfunction formatFragment(fragment:string):string\r\n{\r\n\treturn fragment && ((fragment.indexOf(HASH)!==0 ? HASH : EMPTY) + fragment);\r\n}\r\n\r\nfunction getPathAndQuery(uri:IUri):string\r\n{\r\n\r\n\tvar path = uri.path,\r\n\t query = uri.query;\r\n\r\n\treturn EMPTY\r\n\t\t+ (path || EMPTY)\r\n\t\t+ (formatQuery(query) || EMPTY);\r\n\r\n}\r\n\r\nfunction uriToString(uri:IUri):string\r\n{\r\n\t// scheme:[//[user:password@]domain[:port]][/]path[?query][#fragment]\r\n\t// {scheme}{authority}{path}{query}{fragment}\r\n\r\n\tvar scheme = getScheme(uri.scheme),\r\n\t authority = getAuthority(uri),\r\n\t pathAndQuery = getPathAndQuery(uri),\r\n\t fragment = formatFragment(uri.fragment);\r\n\r\n\tvar part1 = EMPTY\r\n\t\t+ ((scheme && (scheme + ':')) || EMPTY)\r\n\t\t+ (authority || EMPTY);\r\n\r\n\tvar part2 = EMPTY\r\n\t\t+ (pathAndQuery || EMPTY)\r\n\t\t+ (fragment || EMPTY);\r\n\r\n\tif(part1 && part2 && scheme && !authority)\r\n\t\tthrow new ArgumentException('authority', \"Cannot format schemed Uri with missing authority.\");\r\n\r\n\tif(part1 && pathAndQuery && pathAndQuery.indexOf(SLASH)!==0)\r\n\t\tpart2 = SLASH + part2;\r\n\r\n\treturn part1 + part2;\r\n\r\n}\r\n\r\n\r\nfunction tryParse(url:string, out:(result:IUri)=>void):Exception\r\n{\r\n\tif(!url)\r\n\t\treturn new ArgumentException('url', 'Nothing to parse.');\r\n\r\n\r\n\t// Could use a regex here, but well follow some rules instead.\r\n\t// The intention is to 'gather' the pieces. This isn't validation (yet).\r\n\r\n\t// scheme:[//[user:password@]domain[:port]][/]path[?query][#fragment]\r\n\tvar i:number, result:IUri = {};\r\n\r\n\t// Anything after the first # is the fragment.\r\n\ti = url.indexOf(HASH);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tresult.fragment = url.substring(i + 1) || VOID0;\r\n\t\turl = url.substring(0, i);\r\n\t}\r\n\r\n\t// Anything after the first ? is the query.\r\n\ti = url.indexOf(QM);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tresult.query = url.substring(i + 1) || VOID0;\r\n\t\turl = url.substring(0, i);\r\n\t}\r\n\r\n\t// Guarantees a separation.\r\n\ti = url.indexOf(SLASH2);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tvar scheme = trim(url.substring(0, i)), c = /:$/;\r\n\t\tif(!c.test(scheme))\r\n\t\t\treturn new ArgumentException('url', 'Scheme was improperly formatted');\r\n\r\n\t\tscheme = trim(scheme.replace(c, EMPTY));\r\n\t\ttry\r\n\t\t{\r\n\t\t\tresult.scheme = getScheme(scheme) || VOID0;\r\n\t\t}\r\n\t\tcatch(ex)\r\n\t\t{\r\n\t\t\treturn ex;\r\n\t\t}\r\n\r\n\t\turl = url.substring(i + 2);\r\n\t}\r\n\r\n\t// Find any path information.\r\n\ti = url.indexOf(SLASH);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tresult.path = url.substring(i);\r\n\t\turl = url.substring(0, i);\r\n\t}\r\n\r\n\t// Separate user info.\r\n\ti = url.indexOf(AT);\r\n\tif(i!= -1)\r\n\t{\r\n\t\tresult.userInfo = url.substring(0, i) || VOID0;\r\n\t\turl = url.substring(i + 1);\r\n\t}\r\n\r\n\t// Remaining is host and port.\r\n\ti = url.indexOf(':');\r\n\tif(i!= -1)\r\n\t{\r\n\t\tvar port = parseInt(trim(url.substring(i + 1)));\r\n\t\tif(isNaN(port))\r\n\t\t\treturn new ArgumentException('url', 'Port was invalid.');\r\n\r\n\t\tresult.port = port;\r\n\t\turl = url.substring(0, i);\r\n\t}\r\n\r\n\turl = trim(url);\r\n\tif(url)\r\n\t\tresult.host = url;\r\n\r\n\tout(copyUri(result));\r\n\r\n\t// null is good! (here)\r\n\treturn null;\r\n\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/umd.min/System/Utility/applyMixins.d.ts b/dist/umd.min/System/Utility/applyMixins.d.ts new file mode 100644 index 00000000..89e245e2 --- /dev/null +++ b/dist/umd.min/System/Utility/applyMixins.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function applyMixins(derivedConstructor: any, baseConstructors: any[]): void; diff --git a/dist/umd.min/System/Utility/applyMixins.js b/dist/umd.min/System/Utility/applyMixins.js new file mode 100644 index 00000000..a148d344 --- /dev/null +++ b/dist/umd.min/System/Utility/applyMixins.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +!function(e){if("object"==typeof module&&"object"==typeof module.exports){var o=e(require,exports);void 0!==o&&(module.exports=o)}else"function"==typeof define&&define.amd&&define(["require","exports"],e)}(function(e,o){"use strict";function t(e,o){o.forEach(function(o){Object.getOwnPropertyNames(o.prototype).forEach(function(t){e.prototype[t]=o.prototype[t]})})}Object.defineProperty(o,"__esModule",{value:!0}),o["default"]=t}); +//# sourceMappingURL=applyMixins.js.map diff --git a/dist/umd.min/System/Utility/applyMixins.js.map b/dist/umd.min/System/Utility/applyMixins.js.map new file mode 100644 index 00000000..0e083d4c --- /dev/null +++ b/dist/umd.min/System/Utility/applyMixins.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Utility/applyMixins.js","System/Utility/applyMixins.ts"],"names":["factory","module","exports","v","require","undefined","define","amd","applyMixins","derivedConstructor","baseConstructors","forEach","bc","Object","getOwnPropertyNames","prototype","name","defineProperty","value"],"mappings":";;;;CAIA,SAAWA,GACP,GAAsB,gBAAXC,SAAiD,gBAAnBA,QAAOC,QAAsB,CAClE,GAAIC,GAAIH,EAAQI,QAASF,QAAoBG,UAANF,IAAiBF,OAAOC,QAAUC,OAElD,kBAAXG,SAAyBA,OAAOC,KAC5CD,QAAQ,UAAW,WAAYN,IAEpC,SAAUI,EAASF,GAClB,YCPJ,SAAAM,GAAoCC,EAAwBC,GAE3DA,EACEC,QAAQ,SAAAC,GAERC,OAAOC,oBAAoBF,EAAGG,WAAWJ,QACvC,SAAAK,GAEAP,EAAmBM,UAAUC,GAAQJ,EAAGG,UAAUC,OARvDH,OAAAI,eAAAf,EAAA,cAAAgB,OAAA,IDiBIhB,EAAAA,WAAkBM","file":"System/Utility/applyMixins.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\n(function (factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define([\"require\", \"exports\"], factory);\n }\n})(function (require, exports) {\n \"use strict\";\n function applyMixins(derivedConstructor, baseConstructors) {\n baseConstructors\n .forEach(function (bc) {\n Object.getOwnPropertyNames(bc.prototype).forEach(function (name) {\n derivedConstructor.prototype[name] = bc.prototype[name];\n });\n });\n }\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = applyMixins;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\nexport default function applyMixins(derivedConstructor:any, baseConstructors:any[]):void\r\n{\r\n\tbaseConstructors\r\n\t\t.forEach(bc =>\r\n\t\t{\r\n\t\t\tObject.getOwnPropertyNames(bc.prototype).forEach(\r\n\t\t\t\t\tname =>\r\n\t\t\t\t{\r\n\t\t\t\t\tderivedConstructor.prototype[name] = bc.prototype[name];\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t);\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/umd.min/System/Utility/clone.d.ts b/dist/umd.min/System/Utility/clone.d.ts new file mode 100644 index 00000000..3c3527fd --- /dev/null +++ b/dist/umd.min/System/Utility/clone.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function clone(source: any, depth?: number): any; diff --git a/dist/umd.min/System/Utility/clone.js b/dist/umd.min/System/Utility/clone.js new file mode 100644 index 00000000..e1fe7d8d --- /dev/null +++ b/dist/umd.min/System/Utility/clone.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +!function(e){if("object"==typeof module&&"object"==typeof module.exports){var r=e(require,exports);void 0!==r&&(module.exports=r)}else"function"==typeof define&&define.amd&&define(["require","exports","../Types"],e)}(function(e,r){"use strict";function t(e,r){if(void 0===r&&(r=0),0>r)return e;if(!i["default"].isObject(e))return e;var o;if(Array.isArray(e)){if(o=e.slice(),r>0)for(var f=0;f0)for(var n in e)o[n]=t(e[n],r-1);return o}var i=e("../Types");Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=t}); +//# sourceMappingURL=clone.js.map diff --git a/dist/umd.min/System/Utility/clone.js.map b/dist/umd.min/System/Utility/clone.js.map new file mode 100644 index 00000000..e082e3aa --- /dev/null +++ b/dist/umd.min/System/Utility/clone.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Utility/clone.js","System/Utility/clone.ts"],"names":["factory","module","exports","v","require","undefined","define","amd","clone","source","depth","Types_1","isObject","result","Array","isArray","slice","i","length","k","Object","defineProperty","value"],"mappings":";;;;CAIA,SAAWA,GACP,GAAsB,gBAAXC,SAAiD,gBAAnBA,QAAOC,QAAsB,CAClE,GAAIC,GAAIH,EAAQI,QAASF,QAAoBG,UAANF,IAAiBF,OAAOC,QAAUC,OAElD,kBAAXG,SAAyBA,OAAOC,KAC5CD,QAAQ,UAAW,UAAW,YAAaN,IAEhD,SAAUI,EAASF,GAClB,YCLJ,SAAAM,GAA8BC,EAAYC,GAEzC,GAFyC,SAAAA,IAAAA,EAAA,GAEhC,EAANA,EACF,MAAOD,EAGR,KAAIE,EAAAA,WAAKC,SAASH,GAAS,MAAOA,EAElC,IAAII,EACJ,IAAGC,MAAMC,QAAQN,IAGhB,GADAI,EAAeJ,EAAQO,QACpBN,EAAM,EAER,IAAI,GAAIO,GAAI,EAAGA,EAAEJ,EAAOK,OAAQD,IAE/BJ,EAAOI,GAAKT,EAAMK,EAAOI,GAAIP,EAAQ,OAOvC,IADAG,KACGH,EAAM,EAAG,IAAI,GAAIS,KAAKV,GAGxBI,EAAOM,GAAKX,EAAMC,EAAOU,GAAIT,EAAQ,EAIvC,OAAOG,GAhCR,GAAAF,GAAAP,EAAiB,WAEjBgB,QAAAC,eAAAnB,EAAA,cAAAoB,OAAA,IDgCIpB,EAAAA,WAAkBM","file":"System/Utility/clone.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\n(function (factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define([\"require\", \"exports\", '../Types'], factory);\n }\n})(function (require, exports) {\n \"use strict\";\n var Types_1 = require('../Types');\n function clone(source, depth) {\n if (depth === void 0) { depth = 0; }\n if (depth < 0)\n return source;\n if (!Types_1.default.isObject(source))\n return source;\n var result;\n if (Array.isArray(source)) {\n result = source.slice();\n if (depth > 0) {\n for (var i = 0; i < result.length; i++) {\n result[i] = clone(result[i], depth - 1);\n }\n }\n }\n else {\n result = {};\n if (depth > 0)\n for (var k in source) {\n result[k] = clone(source[k], depth - 1);\n }\n }\n return result;\n }\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = clone;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\nimport Type from '../Types';\r\n\r\nexport default function clone(source:any, depth:number = 0):any\r\n{\r\n\tif(depth<0)\r\n\t\treturn source;\r\n\r\n\t// return primitives as is.\r\n\tif(!Type.isObject(source)) return source;\r\n\r\n\tvar result:any;\r\n\tif(Array.isArray(source))\r\n\t{\r\n\t\tresult = (source).slice();\r\n\t\tif(depth>0)\r\n\t\t{\r\n\t\t\tfor(let i = 0; i0) for(let k in source)\r\n\t\t{\r\n\t\t\t//noinspection JSUnfilteredForInLoop\r\n\t\t\tresult[k] = clone(source[k], depth - 1);\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/umd.min/System/Utility/shallowCopy.d.ts b/dist/umd.min/System/Utility/shallowCopy.d.ts new file mode 100644 index 00000000..df935e23 --- /dev/null +++ b/dist/umd.min/System/Utility/shallowCopy.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function shallowCopy(source: any, target?: any): any; diff --git a/dist/umd.min/System/Validation/ValidationResult.d.ts b/dist/umd.min/System/Validation/ValidationResult.d.ts new file mode 100644 index 00000000..8fdffed8 --- /dev/null +++ b/dist/umd.min/System/Validation/ValidationResult.d.ts @@ -0,0 +1,15 @@ +/// +/// +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default class ValidationResult implements IValidationResult, IEquatable { + isValid: boolean; + message: string; + data: any; + constructor(isValid?: boolean, message?: string, data?: any); + equals(other: IValidationResult): boolean; + static valid: IValidationResult; + static invalid(message: string, data?: any): IValidationResult; +} diff --git a/dist/umd.min/System/Validation/ValidationResult.js b/dist/umd.min/System/Validation/ValidationResult.js new file mode 100644 index 00000000..f32713ba --- /dev/null +++ b/dist/umd.min/System/Validation/ValidationResult.js @@ -0,0 +1,6 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define(["require","exports"],e)}(function(e,t){"use strict";var i=new n(!0),n=function(){function e(e,t,i){void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=null),this.isValid=e,this.message=t,this.data=i,Object.freeze(this)}return e.prototype.equals=function(e){var t=this;return t.isValid===e.isValid&&t.message==t.message&&t.data==t.data},Object.defineProperty(e,"valid",{get:function(){return i},enumerable:!0,configurable:!0}),e.invalid=function(t,i){return void 0===i&&(i=null),new e(!1,t,i)},e}();Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n}); +//# sourceMappingURL=ValidationResult.js.map diff --git a/dist/umd.min/System/Validation/ValidationResult.js.map b/dist/umd.min/System/Validation/ValidationResult.js.map new file mode 100644 index 00000000..1b0f0889 --- /dev/null +++ b/dist/umd.min/System/Validation/ValidationResult.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["System/Validation/ValidationResult.js","System/Validation/ValidationResult.ts"],"names":["factory","module","exports","v","require","undefined","define","amd","valid","ValidationResult","isValid","message","data","this","Object","freeze","prototype","equals","other","_","defineProperty","get","enumerable","configurable","invalid","value"],"mappings":";;;;CAIA,SAAWA,GACP,GAAsB,gBAAXC,SAAiD,gBAAnBA,QAAOC,QAAsB,CAClE,GAAIC,GAAIH,EAAQI,QAASF,QAAoBG,UAANF,IAAiBF,OAAOC,QAAUC,OAElD,kBAAXG,SAAyBA,OAAOC,KAC5CD,QAAQ,UAAW,WAAYN,IAEpC,SAAUI,EAASF,GCJtB,YAEA,IAAMM,GAAQ,GAAIC,IAAiB,GAKnCA,EAAA,WAOC,QAAAA,GACQC,EACAC,EACAC,GAFP,SAAAF,IAAAA,GAAA,GACA,SAAAC,IAAAA,EAAA,MACA,SAAAC,IAAAA,EAAA,MAFOC,KAAAH,QAAAA,EACAG,KAAAF,QAAAA,EACAE,KAAAD,KAAAA,EAIPE,OAAOC,OAAOF,MAgChB,MA1BCJ,GAAAO,UAAAC,OAAA,SAAOC,GAEN,GAAIC,GAAIN,IACR,OAAOM,GAAET,UAAUQ,EAAMR,SACrBS,EAAER,SAASQ,EAAER,SACbQ,EAAEP,MAAMO,EAAEP,MAQfE,OAAAM,eAAWX,EAAA,SDhBAY,ICgBX,WACC,MAAOb,IDdGc,YAAY,EACZC,cAAc,ICmBlBd,EAAAe,QAAP,SACCb,EACAC,GAEA,MAFA,UAAAA,IAAAA,EAAA,MAEO,GAAIH,IAAiB,EAAOE,EAASC,IAE9CH,IA9CAK,QAAAM,eAAAlB,EAAA,cAAAuB,OAAA,ID8BIvB,EAAAA,WAAkBO","file":"System/Validation/ValidationResult.js","sourcesContent":["/*!\n * @author electricessence / https://github.com/electricessence/\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\n */\n(function (factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define([\"require\", \"exports\"], factory);\n }\n})(function (require, exports) {\n 'use strict';\n var valid = new ValidationResult(true);\n var ValidationResult = (function () {\n function ValidationResult(isValid, message, data) {\n if (isValid === void 0) { isValid = false; }\n if (message === void 0) { message = null; }\n if (data === void 0) { data = null; }\n this.isValid = isValid;\n this.message = message;\n this.data = data;\n Object.freeze(this);\n }\n ValidationResult.prototype.equals = function (other) {\n var _ = this;\n return _.isValid === other.isValid\n && _.message == _.message\n && _.data == _.data;\n };\n Object.defineProperty(ValidationResult, \"valid\", {\n get: function () {\n return valid;\n },\n enumerable: true,\n configurable: true\n });\n ValidationResult.invalid = function (message, data) {\n if (data === void 0) { data = null; }\n return new ValidationResult(false, message, data);\n };\n return ValidationResult;\n }());\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.default = ValidationResult;\n});\n","/*!\r\n * @author electricessence / https://github.com/electricessence/\r\n * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md\r\n */\r\n\r\n/// \r\n///\r\n'use strict'; // For compatibility with (let, const, function, class);\r\n\r\nconst valid = new ValidationResult(true);\r\n\r\n/**\r\n * A class for generating responses to validation.\r\n */\r\nexport default\r\nclass ValidationResult\r\nimplements IValidationResult, IEquatable\r\n{\r\n\t/**\r\n\t * Allows for rare cases that ValidationResult.valid and ValidationResult.invalid() don't cover.\r\n\t */\r\n\tconstructor(\r\n\t\tpublic isValid:boolean = false,\r\n\t\tpublic message:string = null,\r\n\t\tpublic data:any = null)\r\n\t{\r\n\r\n\t\t// Readonly...\r\n\t\tObject.freeze(this);\r\n\t}\r\n\r\n\t/**\r\n\t * Allows for comparing another IValidationResult to see if they are equal.\r\n\t */\r\n\tequals(other:IValidationResult):boolean\r\n\t{\r\n\t\tvar _ = this;\r\n\t\treturn _.isValid===other.isValid\r\n\t\t\t&& _.message==_.message\r\n\t\t\t&& _.data==_.data;\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Represents a single/shared instance of a valid result.\r\n\t * Allows for returning this instance like you would return 'true'.\r\n\t */\r\n\tstatic get valid():IValidationResult {\r\n\t\treturn valid;\r\n\t}\r\n\r\n\t/**\r\n\t * Factory method for easily creating an invalid result.\r\n\t */\r\n\tstatic invalid(\r\n\t\tmessage:string,\r\n\t\tdata:any = null):IValidationResult\r\n\t{\r\n\t\treturn new ValidationResult(false, message, data);\r\n\t}\r\n}\r\n"]} \ No newline at end of file diff --git a/dist/umd.min/extends.d.ts b/dist/umd.min/extends.d.ts new file mode 100644 index 00000000..6a21de64 --- /dev/null +++ b/dist/umd.min/extends.d.ts @@ -0,0 +1,5 @@ +/*! + * @author electricessence / https://github.com/electricessence/ + * Licensing: MIT https://github.com/electricessence/TypeScript.NET/blob/master/LICENSE.md + */ +export default function (d: any, b: any): void; diff --git a/gulpfile.js b/gulpfile.js index 19743dbc..48a605fb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -84,9 +84,14 @@ const tsc = (function() { } } - function fromTo(from, to, target, module, declaration) { + function fromTo(from, to, target, module, declaration, doNotEmit) { - console.log('TypeScript Render:', target, module, from == to ? from : (from + ' >> ' + to)); + if(!doNotEmit) { + if(module) + console.log('TypeScript Render:', target, module, from == to ? from : (from + ' >> ' + to)); + else + console.log('TypeScript Render:', target, from == to ? from : (from + ' >> ' + to)); + } // In order to mirror WebStorm's compiler option (the tsc), gulp-tsc is used. return gulp .src([from + '/**/*.ts']) @@ -122,52 +127,69 @@ const tsc = (function() { .pipe(gulp.dest(folder)); } - function sourceTo(folder, target, module, declaration) { - return tsc.fromTo(PATH.SOURCE, folder, target, module, declaration); + function sourceTo(folder, target, module, declaration, doNotEmit) { + return tsc.fromTo(PATH.SOURCE, folder, target, module, declaration, doNotEmit); } - function dist(folder, target, module, declaration) { + function distES6(folder) { //noinspection JSUnresolvedFunction var deferred = Q.defer(); var d = './dist/' + folder; + del(d + '/**/*')['then'](function() { - sourceTo(d, target, module, declaration) + sourceTo(d, TARGET.ES6, TARGET.ES6, true, true) .on(EVENT.END, deferred.resolve); }); + return deferred.promise; } - function distPostProcess(folder, target, module, postProcess) { + function dist(folder, target, module) { //noinspection JSUnresolvedFunction var deferred = Q.defer(); var d = './dist/' + folder; - //noinspection JSUnresolvedFunction - del(d + '/**/*').then(function() { + distES6(folder).then(function(){ + sourceTo(d, target, module) + .on(EVENT.END, deferred.resolve); + }); + return deferred.promise; + } + + function distPostProcess(folder, target, module, postProcess) { - console.log('TypeScript Render:', target, module, './source >> ' + d); + var deferred = Q.defer(); + var d = './dist/' + folder; - var typescriptOptions = { - noImplicitAny: true, - module: module, - target: target, - removeComments: true - }; + // Export declarations first, then over-write... + distES6(folder, TARGET.ES6, TARGET.ES6, true) + .then(function() { - var sourceMapOptions = { - sourceRoot: null - }; + console.log('TypeScript Render:', target, module, './source >> ' + d); + var typescriptOptions = { + noImplicitAny: true, + module: module, + target: target, + removeComments: true + }; - gulp - .src(['./source/**/*.ts']) - .pipe(sourcemaps.init()) - .pipe(typescript(typescriptOptions)) - .pipe(postProcess()) - .pipe(sourcemaps.write('.', sourceMapOptions)) - .pipe(gulp.dest(d)) - .on(EVENT.END, deferred.resolve); + var sourceMapOptions = { + sourceRoot: null + }; + + + gulp + .src(['./source/**/*.ts']) + .pipe(sourcemaps.init()) + .pipe(typescript(typescriptOptions)) + .pipe(postProcess()) + .pipe(sourcemaps.write('.', sourceMapOptions)) + .pipe(gulp.dest(d)) + .on(EVENT.END, deferred.resolve); + + } + ); - }); return deferred.promise; } @@ -196,11 +218,10 @@ gulp.task( TASK.DIST_ES6, function() { const ES6 = TARGET.ES6; - return tsc.dist(ES6, ES6, null, true); + return tsc.dist(ES6, ES6); } ); - gulp.task( TASK.DIST_AMD, function() { @@ -216,10 +237,9 @@ gulp.task( MODULE.UMD + '.min', TARGET.ES5, MODULE.UMD); }); -gulp.task( +gulp.task( // Need to double process to get the declarations from es6 without modules TASK.DIST_COMMONJS, function() { - return tsc.distPostProcess( MODULE.COMMONJS, TARGET.ES6, MODULE.COMMONJS, babel); diff --git a/package.json b/package.json index 274538c2..4bfd398e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typescript-dotnet", - "version": "2.11.7", + "version": "2.12.0", "license": "MIT", "author": "electricessence ", "description": "A JavaScript-Friendly .NET Based TypeScript Library.", @@ -9,6 +9,9 @@ "type": "git", "url": "https://github.com/electricessence/TypeScript.NET.git" }, + "directories": { + "lib": "./source" + }, "keywords": [ "JavaScript", "TypeScript", diff --git a/tests/mocha/System.Linq/Enumerable.js b/tests/mocha/System.Linq/Enumerable.js index 86265bfa..25187cff 100644 --- a/tests/mocha/System.Linq/Enumerable.js +++ b/tests/mocha/System.Linq/Enumerable.js @@ -772,4 +772,5 @@ }); }); }); -//# sourceMappingURL=Enumerable.js.map \ No newline at end of file + +//# sourceMappingURL=Enumerable.js.map diff --git a/tests/mocha/System.Linq/Enumerable.js.map b/tests/mocha/System.Linq/Enumerable.js.map index 0ec54e7f..88f2bb8e 100644 --- a/tests/mocha/System.Linq/Enumerable.js.map +++ b/tests/mocha/System.Linq/Enumerable.js.map @@ -1 +1 @@ -{"version":3,"file":"Enumerable.js","sourceRoot":"","sources":["Enumerable.ts"],"names":[],"mappings":";;;;;;;;;IAEA,wBAA+B,kDAAkD,CAAC,CAAA;IAClF,IAAY,SAAS,WAAM,oDAAoD,CAAC,CAAA;IAChF,qBAAuB,kCAAkC,CAAC,CAAA;IAC1D,0BAAsB,kCAAkC,CAAC,CAAA;IACzD,2BAAuC,2DAA2D,CAAC,CAAA;IACnG,IAAI,MAAM,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;IAY5D,IAAM,MAAM,GAAc,MAAM,CAAC,MAAM,CAAC;QACvC;YACC,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,GAA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;YAClE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,CAAC,IAAE,OAAA,CAAC,CAAC,CAAC,EAAH,CAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAE3C,CAAC,CAAC,CAAC;IAEJ,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,qBAAqB,EAAE;QAG/B,EAAE,CAAC,uBAAuB,EAAE;YAE3B,IAAI,CAAC,GAAG,cAAU,CAAC,KAAK,CAAC;gBACxB,CAAC,GAAG,EAAE,GAAG,CAAC;gBACV,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;gBACpB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;aACf,CAAC,CAAC;YAEH,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,EAAC,CAAC,CAAC,CAAC;YAC1B,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,EAAE,EAAC,WAAW,CAAC,CAAC;YAE7C,MAAM,CAAC,KAAK,CACX,cAAU,CAAC,KAAK,CAAC;gBAChB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;aACrB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;QAEjB,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,cAAc,EAAC;YACjB,MAAM,CAAC,MAAM,CAAC,cAAI,OAAA,cAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAtB,CAAsB,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IAEJ,CAAC,CAAC,CAAC","file":"System.Linq/Enumerable.js","sourcesContent":["///\r\n\r\nimport {contains, repeat} from \"../../../source/System/Collections/Array/Utility\";\r\nimport * as Procedure from \"../../../source/System/Collections/Array/Procedure\";\r\nimport Enumerable from \"../../../source/System.Linq/Linq\";\r\nimport Functions from \"../../../source/System/Functions\";\r\nimport {empty as EmptyEnumerator} from \"../../../source/System/Collections/Enumeration/Enumerator\";\r\nvar assert = require('../../../node_modules/assert/assert');\r\n\r\n\r\ninterface TestItem\r\n{\r\n\ta:number;\r\n\tb:number;\r\n\tc:string;\r\n\tchildren?:TestItem[];\r\n}\r\n\r\n\r\nconst source:TestItem[] = Object.freeze([\r\n\t{\r\n\t\ta: 1,\r\n\t\tb: 2,\r\n\t\tc: \"a\",\r\n\t\tchildren: [\r\n\t\t\t{\r\n\t\t\t\ta: 1,\r\n\t\t\t\tb: 2,\r\n\t\t\t\tc: \"a\",\r\n\t\t\t\tchildren: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ta: 1,\r\n\t\t\t\t\t\tb: 2,\r\n\t\t\t\t\t\tc: \"a\",\r\n\t\t\t\t\t\tchildren: []\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ta: 1,\r\n\t\t\t\t\t\tb: 1,\r\n\t\t\t\t\t\tc: \"b\",\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ta: 1,\r\n\t\t\t\t\t\tb: 3,\r\n\t\t\t\t\t\tc: \"c\"\r\n\t\t\t\t\t}\r\n\t\t\t\t]\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\ta: 1,\r\n\t\t\t\tb: 1,\r\n\t\t\t\tc: \"b\",\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\ta: 1,\r\n\t\t\t\tb: 3,\r\n\t\t\t\tc: \"c\"\r\n\t\t\t}\r\n\t\t]\r\n\t},\r\n\t{\r\n\t\ta: 1,\r\n\t\tb: 1,\r\n\t\tc: \"b\",\r\n\t},\r\n\t{\r\n\t\ta: 1,\r\n\t\tb: 3,\r\n\t\tc: \"c\"\r\n\t},\r\n\t{\r\n\t\ta: 2,\r\n\t\tb: 2,\r\n\t\tc: \"d\"\r\n\t},\r\n\t{\r\n\t\ta: 2,\r\n\t\tb: 1,\r\n\t\tc: \"e\"\r\n\t},\r\n\t{\r\n\t\ta: 2,\r\n\t\tb: 3,\r\n\t\tc: \"f\"\r\n\t}\r\n]);\r\n\r\n\r\nconst sourceMany:Enumerable = Enumerable.from(Object.freeze([\r\n\t\"a,b,c,d,e\",\r\n\tnull,\r\n\t\"f,g,h,i,j\",\r\n\t\"k,l,m,n,o\",\r\n\t\"p,q,r,s,t\",\r\n\t\"u,v,w,x,y\",\r\n]));\r\nconst sourceManyFlat = \"abcdefghijklmnopqrstuvwxy\";\r\n\r\nvar sourceArrayEnumerable = Enumerable.from(source),\r\n sourceEnumerable = new Enumerable(()=>sourceArrayEnumerable.getEnumerator());\r\n\r\ndescribe(\".force()\", ()=>\r\n{\r\n\tit(\"should not throw\", ()=>\r\n\t{\r\n\t\tassert.doesNotThrow(()=> { sourceEnumerable.force() });\r\n\t});\r\n});\r\n\r\ndescribe(\".count()\", ()=>\r\n{\r\n\tit(\"should match count to length\", ()=>\r\n\t{\r\n\t\tassert.equal(sourceArrayEnumerable.count(), source.length);\r\n\t\tassert.equal(sourceEnumerable.count(), source.length);\r\n\t\tassert.equal(Enumerable.from([]).count(), 0);\r\n\t\tassert.equal(Enumerable.empty().count(), 0);\r\n\t\tassert.equal(sourceArrayEnumerable.count(e=>e.a===1), 3);\r\n\t});\r\n});\r\n\r\ndescribe(\".source\", ()=>\r\n{\r\n\tit(\"should equal the original\", ()=>\r\n\t{\r\n\t\tassert.equal(source, ((sourceArrayEnumerable)).source);\r\n\t});\r\n});\r\n\r\ndescribe(\".memoize()\", ()=>\r\n{\r\n\tit(\"should cache the values as it goes for reuse later\", ()=>\r\n\t{\r\n\t\tvar source = sourceEnumerable;\r\n\t\tvar A = source.memoize();\r\n\r\n\t\tsource.memoize().dispose(); // Covers else condition.\r\n\r\n\t\tvar sum = A.sum(o=>o.a);\r\n\r\n\t\tassert.equal(sum, source.sum(o=>o.a), \"Values must be equal after memoize pass 1.\");\r\n\r\n\t\tsum = A.sum(o=>o.b);\r\n\t\tassert.equal(sum, source.sum(o=>o.b), \"Values must be equal after memoize pass 2.\");\r\n\t\tA.dispose(); // Disposing this memoized source should not affect other tests.\r\n\r\n\t\tassert.throws(()=>\r\n\t\t{\r\n\t\t\t// Should throw after disposal.\r\n\t\t\tA.force();\r\n\t\t});\r\n\r\n\t\tA = sourceArrayEnumerable.memoize();\r\n\t\tA.dispose();\r\n\t\tassert.throws(()=>\r\n\t\t{\r\n\t\t\t// Should throw after disposal.\r\n\t\t\tA.force();\r\n\t\t});\r\n\r\n\t});\r\n});\r\n\r\n\r\ndescribe(\".choose(predicate)\", ()=>\r\n{\r\n\tit(\"should filter out null and undefined values.\", ()=>\r\n\t{\r\n\t\tvar other = [null, void(0)];\r\n\t\tassert.equal(sourceArrayEnumerable\r\n\t\t\t.concat(other)\r\n\t\t\t.choose()\r\n\t\t\t.select(s=>s.a)\r\n\t\t\t.where(s=>s===1)\r\n\t\t\t.count(), 3);\r\n\r\n\t\tassert.equal(sourceArrayEnumerable\r\n\t\t\t.concat(other)\r\n\t\t\t.choose((e:TestItem, i:number)=>\r\n\t\t\t{\r\n\t\t\t\treturn (i%2 ? e : null);\r\n\t\t\t})\r\n\t\t\t.count(), 3);\r\n\r\n\t\tsourceArrayEnumerable\r\n\t\t\t.concat(other)\r\n\t\t\t.choose()\r\n\t\t\t.dispose();\r\n\r\n\t});\r\n});\r\n\r\ndescribe(\".where(predicate).memoize()\", ()=>\r\n{\r\n\tit(\"should cache the values as it goes for reuse later\", ()=>\r\n\t{\r\n\r\n\t\tvar source = sourceArrayEnumerable.where(i => i.a==1);\r\n\r\n\t\tvar sum:number, A = source;\r\n\r\n\t\tsum = A.sum(o=>o.a);\r\n\r\n\t\tassert.equal(sum, source.sum(o=>o.a), \"Values must be equal after where pass 1.\");\r\n\r\n\t\tsum = A.sum(o=>o.b);\r\n\t\tassert.equal(sum, source.sum(o=>o.b), \"Values must be equal after where pass 2.\");\r\n\r\n\r\n\t\tA = source.memoize();\r\n\r\n\t\tsum = A.sum(o=>o.a);\r\n\r\n\t\tassert.equal(sum, source.sum(o=>o.a), \"Values must be equal after memoize pass 1.\");\r\n\r\n\t\tsum = A.sum(o=>o.b);\r\n\t\tassert.equal(sum, source.sum(o=>o.b), \"Values must be equal after memoize pass 2.\");\r\n\r\n\t\tsource.dispose();\r\n\t});\r\n});\r\n\r\ndescribe(\".orderBy(selector)\", ()=>\r\n{\r\n\tit(\"should order ascending based upon the selector\", ()=>\r\n\t{\r\n\t\tvar source = sourceArrayEnumerable.reverse();\r\n\t\tassert.equal(source.first().c, \"f\");\r\n\t});\r\n});\r\n\r\n\r\ndescribe(\".orderBy(selector)\", ()=>\r\n{\r\n\tit(\"should order ascending based upon the selector\", ()=>\r\n\t{\r\n\r\n\t\tvar source = sourceArrayEnumerable.reverse();\r\n\r\n\t\tvar A = source.orderBy(o=>o.a).toArray();\r\n\t\tfor(let i = 0; i<3; i++)\r\n\t\t{\r\n\t\t\tassert.equal(A[i].a, 1, \"First three 'a' values should be 1 when ordered by 'a'.\");\r\n\t\t}\r\n\t\tfor(let i = 3; i<6; i++)\r\n\t\t{\r\n\t\t\tassert.equal(A[i].a, 2, \"Last three 'a' values should be 2 when ordered by 'a'.\");\r\n\t\t}\r\n\r\n\t\tvar B = source.orderBy(o=> o.b).toArray();\r\n\t\tfor(let i = 0; i<2; i++)\r\n\t\t{\r\n\t\t\tassert.equal(B[i].b, 1, \"First two 'b' values should be 1 when ordered by 'b'.\");\r\n\t\t}\r\n\t\tfor(let i = 2; i<4; i++)\r\n\t\t{\r\n\t\t\tassert.equal(B[i].b, 2, \"Second two 'b' values should be 2 when ordered by 'b'.\");\r\n\t\t}\r\n\t\tfor(let i = 4; i<6; i++)\r\n\t\t{\r\n\t\t\tassert.equal(B[i].b, 3, \"Last two 'b' values should be 3 when ordered by 'b'.\");\r\n\t\t}\r\n\t});\r\n});\r\n\r\n\r\ndescribe(\".orderByDescending(selector)\", ()=>\r\n{\r\n\tit(\"should order descending based upon the selector\", ()=>\r\n\t{\r\n\r\n\r\n\t\tvar source = sourceArrayEnumerable.reverse();\r\n\r\n\t\tvar A = source.orderByDescending((o:TestItem)=> o.a).toArray();\r\n\t\tfor(let i = 0; i<3; i++)\r\n\t\t{\r\n\t\t\tassert.equal(A[i].a, 2, \"First three 'a' values should be 2 when ordered by 'a'.\");\r\n\t\t}\r\n\t\tfor(let i = 3; i<6; i++)\r\n\t\t{\r\n\t\t\tassert.equal(A[i].a, 1, \"Last three 'a' values should be 1 when ordered by 'a'.\");\r\n\t\t}\r\n\r\n\t\tvar B = source.orderByDescending((o:TestItem)=> o.b).toArray();\r\n\t\tfor(let i = 0; i<2; i++)\r\n\t\t{\r\n\t\t\tassert.equal(B[i].b, 3, \"First two 'b' values should be 3 when ordered by 'b'.\");\r\n\t\t}\r\n\t\tfor(let i = 2; i<4; i++)\r\n\t\t{\r\n\t\t\tassert.equal(B[i].b, 2, \"Second two 'b' values should be 2 when ordered by 'b'.\");\r\n\t\t}\r\n\t\tfor(let i = 4; i<6; i++)\r\n\t\t{\r\n\t\t\tassert.equal(B[i].b, 1, \"Last two 'b' values should be 1 when ordered by 'b'.\");\r\n\t\t}\r\n\t});\r\n});\r\n\r\ndescribe(\".orderBy(selector).thenBy(selector)\", ()=>\r\n{\r\n\tit(\"should order by one then the other\", ()=>\r\n\t{\r\n\r\n\r\n\t\tvar B = sourceArrayEnumerable\r\n\t\t\t.orderBy(o => o.b)\r\n\t\t\t.thenBy(o => o.c)\r\n\t\t\t.toArray();\r\n\r\n\t\tfor(let i = 0; i<2; i++)\r\n\t\t{\r\n\t\t\tassert.equal(B[i].b, 1, \"First two 'b' values should be 1 when ordered by 'b'.\");\r\n\t\t}\r\n\t\tfor(let i = 2; i<4; i++)\r\n\t\t{\r\n\t\t\tassert.equal(B[i].b, 2, \"Second two 'b' values should be 2 when ordered by 'b'.\");\r\n\t\t}\r\n\t\tfor(let i = 4; i<6; i++)\r\n\t\t{\r\n\t\t\tassert.equal(B[i].b, 3, \"Last two 'b' values should be 3 when ordered by 'b'.\");\r\n\t\t}\r\n\r\n\t\tassert.equal(B[0].c, \"b\");\r\n\t\tassert.equal(B[1].c, \"e\");\r\n\r\n\t\tassert.equal(B[2].c, \"a\");\r\n\t\tassert.equal(B[3].c, \"d\");\r\n\r\n\t\tassert.equal(B[4].c, \"c\");\r\n\t\tassert.equal(B[5].c, \"f\");\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".select(b)\", ()=>\r\n{\r\n\r\n\tvar b = sourceArrayEnumerable.select(e=>e.b);\r\n\tdescribe(\".distinct()\", ()=>\r\n\t{\r\n\t\tvar d = b.distinct();\r\n\t\tdescribe(\".orderBy()\", ()=>\r\n\t\t{\r\n\t\t\tit(\"should be 1,2,3\", ()=>\r\n\t\t\t{\r\n\t\t\t\tvar s = d.orderBy();\r\n\t\t\t\tassert.equal(s.count(), 3);\r\n\t\t\t\tassert.equal(s.sum(), 6);\r\n\t\t\t\tassert.equal(s.elementAt(0), 1);\r\n\t\t\t\tassert.equal(s.elementAt(1), 2);\r\n\t\t\t\tassert.equal(s.elementAt(2), 3);\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tdescribe(\".orderByDescending()\", ()=>\r\n\t\t{\r\n\t\t\tit(\"should be 1,2,3\", ()=>\r\n\t\t\t{\r\n\t\t\t\tvar s = d.orderByDescending();\r\n\t\t\t\tassert.equal(s.count(), 3);\r\n\t\t\t\tassert.equal(s.sum(), 6);\r\n\t\t\t\tassert.equal(s.elementAt(0), 3);\r\n\t\t\t\tassert.equal(s.elementAt(1), 2);\r\n\t\t\t\tassert.equal(s.elementAt(2), 1);\r\n\t\t\t});\r\n\t\t});\r\n\t});\r\n\r\n\tdescribe(\".distinctUntilChanged()\", ()=>\r\n\t{\r\n\t\tit(\"should be as expected\", ()=>\r\n\t\t{\r\n\t\t\tassert.equal(b.distinctUntilChanged().toJoinedString(), \"213213\");\r\n\t\t\tassert.equal(b.distinctUntilChanged(v=>Math.max(v, 2)).toJoinedString(), \"2323\");\r\n\t\t\tassert.equal(b.distinctUntilChanged(v=>Math.min(v, 2)).toJoinedString(), \"21313\");\r\n\t\t\tassert.equal(b.orderBy().distinctUntilChanged().toJoinedString(), \"123\");\r\n\t\t});\r\n\t});\r\n});\r\n\r\ndescribe(\".groupBy(selector)\", ()=>\r\n{\r\n\tit(\"should group by key provided by the selector\", ()=>\r\n\t{\r\n\r\n\r\n\t\tvar A_distinct = sourceArrayEnumerable\r\n\t\t\t.select(o=>o.a).distinct();\r\n\t\tvar A = sourceArrayEnumerable\r\n\t\t\t.groupBy(o=>o.a);\r\n\r\n\t\tassert.equal(A_distinct.count(), A.count(), \"Number of groups should match distinct values.\");\r\n\r\n\t\tvar B = sourceArrayEnumerable\r\n\t\t\t.groupBy(o=>o.b);\r\n\r\n\t\tvar C = sourceArrayEnumerable\r\n\t\t\t.groupBy(o=>o.b, null, Functions.Identity);\r\n\r\n\t\tvar D = sourceArrayEnumerable\r\n\t\t\t.groupBy(o=>o.b, Functions.Identity, Functions.Identity);\r\n\r\n\r\n\t\tassert.ok(B.first().sequenceEqual(C.first()));\r\n\t\tassert.ok(C.first().sequenceEqual(D.first()));\r\n\r\n\t\tvar B_distinct = sourceArrayEnumerable\r\n\t\t\t.select(o=>o.b).distinct();\r\n\r\n\t\tassert.equal(B_distinct.count(), B.count(), \"Number of groups should match distinct values.\");\r\n\r\n\r\n\t\tconst COMPANY_A = \"Microsoft\", COMPANY_B = \"Hell Corp.\";\r\n\t\tvar objArray = [\r\n\t\t\t{Name: \"John\", Id: 0, Salary: 1300.00, Company: COMPANY_A},\r\n\t\t\t{Name: \"Peter\", Id: 1, Salary: 4800.50, Company: COMPANY_A},\r\n\t\t\t{Name: \"Sandra\", Id: 2, Salary: 999.99, Company: COMPANY_A},\r\n\t\t\t{Name: \"Me\", Id: 3, Salary: 1000000000.00, Company: COMPANY_B}\r\n\t\t];\r\n\t\tvar groups = Enumerable.from(objArray).groupBy(x => x.Company);\r\n\t\tvar companies = groups.select(x => x.key).toArray();\r\n\r\n\t\tassert.equal(companies.length, 2, \"2 groups expected.\");\r\n\t\tassert.ok(contains(companies, COMPANY_A), \"Expect \" + COMPANY_A);\r\n\t\tassert.ok(contains(companies, COMPANY_B), \"Expect \" + COMPANY_B);\r\n\t\tvar group_A = groups.where(g=>g.key==COMPANY_A).single();\r\n\t\tvar group_B = groups.where(g=>g.key==COMPANY_B).single();\r\n\t\tassert.equal(group_A.count(), 3, \"Expected count of 3.\");\r\n\t\tassert.equal(group_A.sum(x => x.Salary), 7100.49, \"Expected sum to be correct.\");\r\n\t\tassert.equal(group_B.count(), 1, \"Expected count of 1.\");\r\n\t\tassert.equal(group_B.sum(x => x.Salary), 1000000000.00, \"Expected sum to be correct.\");\r\n\t});\r\n});\r\n\r\ndescribe(\".take(count)\", ()=>\r\n{\r\n\tit(\"count should match number taken\", ()=>\r\n\t{\r\n\t\tvar e = sourceArrayEnumerable.take(2);\r\n\t\tassert.equal(e.count(), 2);\r\n\t});\r\n});\r\n\r\n\r\ndescribe(\".takeWhile(predicate)\", ()=>\r\n{\r\n\tit(\"should take while predicate returns true\", ()=>\r\n\t{\r\n\t\tvar e = sourceArrayEnumerable.takeWhile(v=>v.a==1);\r\n\t\tassert.equal(e.count(), 3, \"count should match number taken\");\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".takeUntil(predicate,includeUntil)\", ()=>\r\n{\r\n\tit(\"should take until predicate returns true\", ()=>\r\n\t{\r\n\t\tvar e = sourceArrayEnumerable.takeUntil(v=>v.a==2);\r\n\t\tassert.equal(e.count(), 3, \"count should match number taken\");\r\n\t});\r\n\r\n\tit(\"should take until predicate returns true and include value matched\", ()=>\r\n\t{\r\n\t\tvar e = sourceArrayEnumerable.takeUntil(v=>v.a==2, true);\r\n\t\tassert.equal(e.count(), 4, \"count should match number taken\");\r\n\t\tassert.equal(e.last().c, \"d\");\r\n\t});\r\n});\r\n\r\n\r\ndescribe(\".takeExceptLast(count)\", ()=>\r\n{\r\n\tit(\"should take the first ones minus the last\", ()=>\r\n\t{\r\n\t\tvar test = (s:Enumerable)=>\r\n\t\t{\r\n\t\t\tvar e = s.takeExceptLast(2);\r\n\t\t\tassert.equal(e.count(), 4);\r\n\t\t\tassert.equal(e.count(), 4, \"count should match number taken\");\r\n\t\t\tassert.equal(e.last().c, \"d\");\r\n\t\t\tvar e = s.takeExceptLast();\r\n\t\t\tassert.equal(e.count(), 5);\r\n\t\t\tassert.equal(e.count(), 5, \"count should match number taken\");\r\n\t\t\tassert.equal(e.last().c, \"e\");\r\n\t\t};\r\n\t\ttest(sourceArrayEnumerable);\r\n\t\ttest(sourceEnumerable);\r\n\t});\r\n\r\n});\r\n\r\n// Inverse of takeExceptLast\r\ndescribe(\".skipToLast(count)\", ()=>\r\n{\r\n\tit(\"should take the last items based on the count\", ()=>\r\n\t{\r\n\t\tvar test = (s:Enumerable)=>\r\n\t\t{\r\n\t\t\tvar e = s.skipToLast(2);\r\n\t\t\tassert.equal(e.count(), 2, \"count should match number taken\");\r\n\t\t\tassert.equal(e.first().c, \"e\");\r\n\t\t\tassert.equal(e.last().c, \"f\");\r\n\r\n\t\t\te = s.skipToLast(0);\r\n\t\t\tassert.equal(e.count(), 0);\r\n\t\t\te = s.skipToLast(Infinity);\r\n\t\t\tassert.equal(e.count(), 6);\r\n\t\t};\r\n\t\ttest(sourceArrayEnumerable);\r\n\t\ttest(sourceEnumerable);\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".skip(count)\", ()=>\r\n{\r\n\tit(\"count should match total less skipped\", ()=>\r\n\t{\r\n\t\tvar test = (s:Enumerable)=>\r\n\t\t{\r\n\t\t\tvar e = s.skip(2);\r\n\t\t\tassert.equal(e.count(), 4);\r\n\t\t\tassert.equal(e.first().c, \"c\");\r\n\t\t\tassert.equal(e.last().c, \"f\");\r\n\t\t};\r\n\t\ttest(sourceArrayEnumerable);\r\n\t\ttest(sourceEnumerable);\r\n\r\n\t\tassert.equal(sourceArrayEnumerable.skip(0), sourceArrayEnumerable)\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".skipWhile(predicate)\", ()=>\r\n{\r\n\tit(\"should skip while predicate returns true\", ()=>\r\n\t{\r\n\t\tvar e = sourceArrayEnumerable.skipWhile(v=>v.a==1);\r\n\t\tassert.equal(e.count(), 3, \"count should match number taken\");\r\n\t\tassert.equal(e.first().c, \"d\");\r\n\t\tassert.equal(e.last().c, \"f\");\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".select(selector)\", ()=>\r\n{\r\n\r\n\tit(\"should use appropriate selection mechanism\", ()=>\r\n\t{\r\n\t\tvar test = (s:Enumerable)=>\r\n\t\t{\r\n\t\t\tvar e = s.select(e=>e.c);\r\n\t\t\tassert.equal(e.count(), 6);\r\n\t\t\tassert.equal(e.first(), \"a\");\r\n\t\t\tassert.equal(e.last(), \"f\");\r\n\t\t};\r\n\t\ttest(sourceArrayEnumerable);\r\n\t\ttest(sourceEnumerable);\r\n\t});\r\n\r\n\tit(\"should use appropriate selection mechanism\", ()=>\r\n\t{\r\n\t\tvar test = (s:Enumerable)=>\r\n\t\t{\r\n\t\t\tvar e = s.select((e, i)=>i);\r\n\t\t\tassert.equal(e.count(), 6);\r\n\t\t\tassert.equal(e.first(), 0);\r\n\t\t\tassert.equal(e.last(), 5);\r\n\t\t};\r\n\t\ttest(sourceArrayEnumerable);\r\n\t\ttest(sourceEnumerable);\r\n\t});\r\n});\r\n\r\ndescribe(\".shuffle()\", ()=>\r\n{\r\n\tit(\"should randomize the enumerable\", ()=>\r\n\t{\r\n\t\tvar e = sourceArrayEnumerable.shuffle();\r\n\t\tassert.equal(e.count(v=>v.a==1), 3);\r\n\t\te.dispose();\r\n\t\tassert.throws(()=>e.count());\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".every(predicate)\", ()=>\r\n{\r\n\tit(\"should determine if every element matches the criteria\", ()=>\r\n\t{\r\n\t\tvar test = (s:Enumerable)=>\r\n\t\t{\r\n\t\t\tassert.ok(!s.every(v=>v.a==1));\r\n\t\t};\r\n\t\ttest(sourceArrayEnumerable);\r\n\t\ttest(sourceEnumerable);\r\n\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".any(predicate)\", ()=>\r\n{\r\n\tit(\"should determine if every element matches the criteria\", ()=>\r\n\t{\r\n\t\tvar test = (s:Enumerable)=>\r\n\t\t{\r\n\t\t\tassert.ok(s.some(v=>v.a==1));\r\n\t\t\tassert.ok(!s.isEmpty());\r\n\t\t};\r\n\t\ttest(sourceArrayEnumerable);\r\n\t\ttest(sourceEnumerable);\r\n\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".empty()\", ()=>\r\n{\r\n\r\n\tvar source = Enumerable.empty();\r\n\r\n\r\n\tdescribe(\".singleOrDefault()\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should be defaulted\", ()=>\r\n\t\t{\r\n\t\t\tassert.equal(source.singleOrDefault(), null);\r\n\t\t\tassert.equal(source.singleOrDefault(-1), -1);\r\n\t\t});\r\n\r\n\t});\r\n\r\n\tdescribe(\".single()\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should throw\", ()=>\r\n\t\t{\r\n\t\t\tassert.throws(()=>\r\n\t\t\t{\r\n\t\t\t\tsource.single();\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t});\r\n\r\n\tdescribe(\".first()\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should throw\", ()=>\r\n\t\t{\r\n\t\t\tassert.throws(()=>\r\n\t\t\t{\r\n\t\t\t\tsource.first();\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t});\r\n\r\n\tdescribe(\".firstOrDefault()\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should be defaulted\", ()=>\r\n\t\t{\r\n\t\t\tassert.equal(source.firstOrDefault(), null);\r\n\t\t});\r\n\r\n\t});\r\n\r\n\tdescribe(\".last()\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should throw\", ()=>\r\n\t\t{\r\n\t\t\tassert.throws(()=>\r\n\t\t\t{\r\n\t\t\t\tsource.last();\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t});\r\n\r\n\tdescribe(\".lastOrDefault()\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should be defaulted\", ()=>\r\n\t\t{\r\n\t\t\tassert.equal(source.lastOrDefault(), null);\r\n\t\t\tvar d = 1;\r\n\t\t\tassert.equal(source.lastOrDefault(d), d);\r\n\t\t});\r\n\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".last()\", ()=>\r\n{\r\n\r\n\tit(\"should match last\", ()=>\r\n\t{\r\n\t\tassert.equal(sourceArrayEnumerable.last().c, \"f\");\r\n\t});\r\n\r\n\tit(\"should throw\", ()=>\r\n\t{\r\n\t\tassert.throws(()=>Enumerable.from([]).last());\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".lastOrDefault()\", ()=>\r\n{\r\n\r\n\tit(\"should match last\", ()=>\r\n\t{\r\n\t\tassert.equal(sourceArrayEnumerable.lastOrDefault().c, \"f\");\r\n\t});\r\n\r\n\tit(\"should be defaulted\", ()=>\r\n\t{\r\n\t\tassert.equal(Enumerable.from([]).lastOrDefault(\"f\"), \"f\");\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".from(x)\", ()=>\r\n{\r\n\tit(\"should throw if not enumerable\", ()=>\r\n\t{\r\n\t\tassert.throws(()=>Enumerable.from(1));\r\n\t});\r\n});\r\n\r\ndescribe(\".fromAny(x,default)\", ()=>\r\n{\r\n\tit(\"should return the default if not enumerable\", ()=>\r\n\t{\r\n\t\tassert.equal(Enumerable.fromAny(1), null);\r\n\t});\r\n});\r\n\r\ndescribe(\".fromAny(x,default)\", ()=>\r\n{\r\n\tit(\"should return an enumerable from an enumerable\", ()=>\r\n\t{\r\n\t\tassert.ok(Enumerable.fromAny(sourceArrayEnumerable) instanceof Enumerable);\r\n\t});\r\n\tit(\"should return an enumerable from an array\", ()=>\r\n\t{\r\n\t\tassert.ok(Enumerable.fromAny(source) instanceof Enumerable);\r\n\t});\r\n\tit(\"should return an enumerable from an IEnumerable\", ()=>\r\n\t{\r\n\t\tvar e = Enumerable.fromAny({getEnumerator: ()=> { return EmptyEnumerator; }});\r\n\t\te.getEnumerator();\r\n\t\tassert.ok(e instanceof Enumerable);\r\n\t});\r\n});\r\n\r\ndescribe(\".from([1])\", ()=>\r\n{\r\n\r\n\tlet source = new Enumerable(()=>Enumerable.from([1]).getEnumerator());\r\n\r\n\tdescribe(\".singleOrDefault()\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should return single value\", ()=>\r\n\t\t{\r\n\t\t\tassert.equal(source.single(), 1);\r\n\t\t});\r\n\r\n\t});\r\n\r\n\tdescribe(\".singleOrDefault()\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should return single value\", ()=>\r\n\t\t{\r\n\t\t\tassert.equal(source.singleOrDefault(), 1);\r\n\t\t});\r\n\r\n\t});\r\n\r\n\tdescribe(\".elementAt(x)\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should throw if no more\", ()=>\r\n\t\t{\r\n\t\t\tassert.throws(()=>source.elementAt(2));\r\n\t\t});\r\n\r\n\t});\r\n\r\n\tdescribe(\".elementAtOrDefault (x)\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should be defaulted\", ()=>\r\n\t\t{\r\n\t\t\tassert.equal(source.elementAtOrDefault(2, -1), -1);\r\n\t\t\tassert.equal(source.elementAtOrDefault(2), null);\r\n\t\t});\r\n\r\n\t\tit(\"should throw\", ()=>\r\n\t\t{\r\n\t\t\tassert.throws(()=> {source.elementAtOrDefault(NaN)});\r\n\t\t\tassert.throws(()=> {source.elementAtOrDefault(-1)});\r\n\t\t\tassert.throws(()=> {source.elementAtOrDefault(Infinity)});\r\n\t\t});\r\n\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".elementAt(x)\", ()=>\r\n{\r\n\tit(\"should return the indexed element\", ()=>\r\n\t{\r\n\t\tassert.equal(sourceEnumerable.elementAt(2), source[2]);\r\n\t\tassert.equal(sourceArrayEnumerable.elementAt(2), source[2]);\r\n\t});\r\n\r\n\tit(\"should throw\", ()=>\r\n\t{\r\n\t\tassert.throws(()=>sourceArrayEnumerable.elementAt(-1));\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".elementAtOrDefault (x)\", ()=>\r\n{\r\n\tit(\"should return the indexed element\", ()=>\r\n\t{\r\n\t\tassert.equal(sourceEnumerable.elementAtOrDefault(2), source[2]);\r\n\t\tassert.equal(sourceArrayEnumerable.elementAtOrDefault(2), source[2]);\r\n\t\tvar d = {};\r\n\t\tassert.equal(sourceArrayEnumerable.elementAtOrDefault(10, d), d);\r\n\t});\r\n\r\n\tit(\"should throw\", ()=>\r\n\t{\r\n\t\tassert.throws(()=>sourceArrayEnumerable.elementAtOrDefault(-1));\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".min()\", ()=>\r\n{\r\n\tit(\"should return the minimum of the selected\", ()=>\r\n\t{\r\n\t\tassert.equal(sourceArrayEnumerable.select(e=>e.b).min(), 1);\r\n\t\tassert.equal(sourceArrayEnumerable.select(e=>e.c).min(), \"a\");\r\n\t});\r\n});\r\n\r\ndescribe(\".max()\", ()=>\r\n{\r\n\tit(\"should return the maximum of the selected\", ()=>\r\n\t{\r\n\t\tassert.equal(sourceArrayEnumerable.select(e=>e.b).max(), 3);\r\n\t\tassert.equal(sourceArrayEnumerable.select(e=>e.c).max(), \"f\");\r\n\r\n\r\n\t});\r\n});\r\n\r\ndescribe(\".minBy(selector)\", ()=>\r\n{\r\n\tit(\"should return the minimum of the selected\", ()=>\r\n\t{\r\n\t\tassert.equal(sourceArrayEnumerable.minBy(e=>e.b).b, 1);\r\n\t\tassert.equal(sourceArrayEnumerable.minBy(e=>e.c).c, \"a\");\r\n\r\n\t\tassert.equal(sourceArrayEnumerable.select(e=>e.b).minBy(), 1);\r\n\t\tassert.equal(sourceArrayEnumerable.select(e=>e.c).minBy(), \"a\");\r\n\t});\r\n});\r\n\r\n\r\ndescribe(\".maxBy(selector)\", ()=>\r\n{\r\n\tit(\"should return the maximum of the selected\", ()=>\r\n\t{\r\n\t\tassert.equal(sourceArrayEnumerable.maxBy(e=>e.b).b, 3);\r\n\t\tassert.equal(sourceArrayEnumerable.maxBy(e=>e.c).c, \"f\");\r\n\r\n\t\tassert.equal(sourceArrayEnumerable.select(e=>e.b).maxBy(), 3);\r\n\t\tassert.equal(sourceArrayEnumerable.select(e=>e.c).maxBy(), \"f\");\r\n\r\n\t});\r\n});\r\n\r\ndescribe(\".concat(...)\", ()=>\r\n{\r\n\tit(\"should remain the same\", ()=>\r\n\t{\r\n\t\tassert.equal(sourceArrayEnumerable.merge(null).count(), 6);\r\n\t\tassert.equal(sourceArrayEnumerable.merge([]).count(), 6);\r\n\t});\r\n\tit(\"should combine two into one\", ()=>\r\n\t{\r\n\t\tassert.equal(sourceArrayEnumerable.concat(sourceArrayEnumerable).count(), 12);\r\n\t});\r\n});\r\n\r\ndescribe(\".selectMany(...)\", ()=>\r\n{\r\n\tit(\"should select the sub values\", ()=>\r\n\t{\r\n\t\tfunction test(values:Enumerable)\r\n\t\t{\r\n\t\t\tassert.equal(values.count(), 25);\r\n\t\t\tassert.equal(values.toJoinedString(), sourceManyFlat);\r\n\t\t}\r\n\r\n\t\tvar split:(s:string)=>string[] = (s)=>s && s.split(\",\");\r\n\t\tvar sm:(s:string,e:string)=>string = (c, e)=>e;\r\n\r\n\t\tvar a = sourceMany.selectMany(split);\r\n\t\ttest(a);\r\n\t\tvar b = sourceMany.selectMany(split, sm);\r\n\t\ttest(b);\r\n\r\n\t\tassert.equal(Enumerable.from([]).selectMany(split).count(), 0);\r\n\r\n\t\tvar iSource = Enumerable.toInfinity().selectMany(s=>repeat(\"\" + s, s));\r\n\t\tassert.equal(iSource.take(10).toJoinedString(), \"1223334444\");\r\n\r\n\t\tvar s = sourceMany.select(s=>s.length);\r\n\t\ts.dispose();\r\n\t\tassert.throws(()=>s.toArray());\r\n\t});\r\n});\r\n\r\ndescribe(\".traverseBreadthFirst()\", ()=>\r\n{\r\n\tit(\"walk the tree in proper order\", ()=>\r\n\t{\r\n\t\tvar tree = sourceEnumerable\r\n\t\t\t.traverseBreadthFirst(e=>e.children),\r\n\t\t c = tree.select(e=>e.c);\r\n\r\n\t\tassert.equal(c.elementAt(2), \"c\");\r\n\t\tassert.equal(c.elementAt(6), \"a\");\r\n\t\tassert.equal(c.count(), 12);\r\n\r\n\t\tassert.equal(Enumerable.empty().traverseBreadthFirst(\r\n\t\t\te=>e.children, Functions.Identity).count(), 0);\r\n\t});\r\n});\r\n\r\ndescribe(\".traverseDepthFirst()\", ()=>\r\n{\r\n\tit(\"walk the tree in proper order\", ()=>\r\n\t{\r\n\t\tvar tree = sourceEnumerable\r\n\t\t\t.traverseDepthFirst(e=>e.children),\r\n\t\t c = tree.select(e=>e.c);\r\n\r\n\t\tassert.equal(c.elementAt(2), \"a\");\r\n\t\tassert.equal(c.elementAt(6), \"c\");\r\n\t\tassert.equal(c.count(), 12);\r\n\r\n\t\tassert.equal(Enumerable.empty().traverseDepthFirst(\r\n\t\t\te=>e.children, Functions.Identity).count(), 0);\r\n\t});\r\n});\r\n\r\ndescribe(\".flatten()\", ()=>\r\n{\r\n\tit(\"should convert deep enumerable to flat one\", ()=>\r\n\t{\r\n\t\tassert.equal(\r\n\t\t\tsourceMany\r\n\t\t\t\t.choose()\r\n\t\t\t\t.select(s=>s.split(','))\r\n\t\t\t\t.concat([[\"z\"]])\r\n\t\t\t\t.flatten()\r\n\t\t\t\t.toJoinedString(),\r\n\t\t\tsourceManyFlat + \"z\");\r\n\t});\r\n});\r\n\r\ndescribe(\".ofType(type)\", ()=>\r\n{\r\n\r\n\tvar source = Enumerable.from([\r\n\t\t1,\r\n\t\t\"a\",\r\n\t\ttrue,\r\n\t\t[],\r\n\t\t[],\r\n\t\t2,\r\n\t\t\"b\",\r\n\t\t[],\r\n\t\tfalse,\r\n\t\tfunction() {},\r\n\t\t3,\r\n\t\t\"c\",\r\n\t\t[],\r\n\t\t\"d\",\r\n\t\t\"e\",\r\n\t\tnull,\r\n\t\tundefined\r\n\t]);\r\n\r\n\tit(\"should select only the type requested\", ()=>\r\n\t{\r\n\t\tassert.equal(source.ofType(Number).count(), 3);\r\n\t\tassert.equal(source.ofType(String).count(), 5);\r\n\t\tassert.equal(source.ofType(Boolean).count(), 2);\r\n\t\tassert.equal(source.ofType(Function).count(), 1);\r\n\t\tassert.equal(source.ofType(Array).count(), 4);\r\n\t});\r\n});\r\n\r\ndescribe(\".buffer(size)\", ()=>\r\n{\r\n\tit(\"should return arrays at the size provided\", ()=>\r\n\t{\r\n\t\tvar s2 = sourceEnumerable.buffer(2);\r\n\t\tassert.equal(s2.first().length, 2);\r\n\t\tassert.equal(s2.count(), 3);\r\n\r\n\t});\r\n\r\n\tit(\"should throw for invalid sizes\", ()=>\r\n\t{\r\n\t\tassert.throws(()=>sourceEnumerable.buffer(-1));\r\n\t\tassert.throws(()=>sourceEnumerable.buffer(Infinity));\r\n\t});\r\n});\r\n\r\ndescribe(\".share()\", ()=>\r\n{\r\n\r\n\tit(\"should share an enumerator\", ()=>\r\n\t{\r\n\t\tvar s = sourceEnumerable.select(e=>e.c).share();\r\n\t\tvar e1 = s.getEnumerator();\r\n\t\tvar e2 = s.getEnumerator();\r\n\r\n\t\te1.moveNext();\r\n\t\tassert.equal(e1.current, \"a\");\r\n\t\tassert.equal(e2.current, \"a\");\r\n\t\te2.moveNext();\r\n\t\tassert.equal(e1.current, \"b\");\r\n\t\tassert.equal(e2.current, \"b\");\r\n\r\n\t});\r\n\r\n});\r\n\r\nvar mathTree = sourceEnumerable.traverseDepthFirst(e=>e.children),\r\n mathTreeArray = mathTree.select(e=>e.b).toArray();\r\n\r\ndescribe(\".sum()\", ()=>\r\n{\r\n\tit(\"should render the sum value\", ()=>\r\n\t{\r\n\t\tvar v = Procedure.sum(mathTreeArray);\r\n\r\n\t\tassert.equal(Enumerable.empty().sum(), 0);\r\n\t\tassert.equal(mathTree.select(e=>e.b).sum(), v);\r\n\t\tassert.equal(mathTree.select(e=>e.b).concat([Infinity, -Infinity]).sum(), v);\r\n\t\tassert.equal(mathTree.select(e=>e.b).concat([\r\n\t\t\tInfinity,\r\n\t\t\tInfinity,\r\n\t\t\t-Infinity\r\n\t\t]).sum(), Infinity);\r\n\t\tassert.equal(mathTree.select(e=>e.b).concat([\r\n\t\t\tInfinity,\r\n\t\t\t-Infinity,\r\n\t\t\t-Infinity\r\n\t\t]).sum(), -Infinity);\r\n\t\tassert.ok(isNaN(mathTree.select(e=>e.b).concat([NaN]).sum()));\r\n\t\tassert.equal(mathTree.sum(e=>e.b), v);\r\n\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".product()\", ()=>\r\n{\r\n\tit(\"should render the product value\", ()=>\r\n\t{\r\n\t\tvar v = Procedure.product(mathTreeArray);\r\n\r\n\t\tassert.equal(mathTree.select(e=>e.b).product(), v);\r\n\t\tassert.ok(isNaN(mathTree.select(e=>e.b).concat([NaN]).product()));\r\n\t\tassert.equal(mathTree.select(e=>e.b).concat([0]).product(), 0);\r\n\t\tassert.equal(mathTree.product(e=>e.b), v);\r\n\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".quotient()\", ()=>\r\n{\r\n\tit(\"should render the quotient value\", ()=>\r\n\t{\r\n\t\tvar v = Procedure.quotient(mathTreeArray);\r\n\r\n\t\tassert.equal(mathTree.select(e=>e.b).quotient(), v);\r\n\t\tassert.ok(isNaN(mathTree.select(e=>e.b).concat([NaN]).quotient()));\r\n\t\tassert.ok(isNaN(mathTree.select(e=>e.b).take(1).quotient()));\r\n\t\tassert.equal(mathTree.quotient(e=>e.b), v);\r\n\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".average()\", ()=>\r\n{\r\n\tit(\"should render the average value\", ()=>\r\n\t{\r\n\t\tvar tree = sourceEnumerable\r\n\t\t\t.traverseDepthFirst(e=>e.children);\r\n\t\tvar v = Procedure.average(mathTreeArray);\r\n\r\n\t\tassert.equal(mathTree.select(e=>e.b).average(), v);\r\n\t\tassert.ok(isNaN(mathTree.select(e=>e.b).concat([NaN]).average()));\r\n\t\tassert.equal(mathTree.average(e=>e.b), v);\r\n\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".weave(enumerables)\", ()=>\r\n{\r\n\r\n\tit(\"should weave in order\", ()=>\r\n\t{\r\n\t\tlet w = Enumerable.weave([\r\n\t\t\t[\"a\", \"d\"],\r\n\t\t\t[\"b\", \"e\", \"g\", \"i\"],\r\n\t\t\t[\"c\", \"f\", \"h\"]\r\n\t\t]);\r\n\r\n\t\tassert.equal(w.count(),9);\r\n\t\tassert.equal(w.toJoinedString(),\"abcdefghi\");\r\n\r\n\t\tassert.equal(\r\n\t\t\tEnumerable.weave([\r\n\t\t\t\t[1, 2, 3, 4, 5, 6, 7]\r\n\t\t\t]).count(), 7);\r\n\r\n\t});\r\n\r\n\tit(\"should throw\",()=>{\r\n\t\tassert.throws(()=>Enumerable.weave(null));\r\n\t});\r\n\r\n});"]} \ No newline at end of file diff --git a/tests/mocha/System.Linq/InfiniteEnumerable.js b/tests/mocha/System.Linq/InfiniteEnumerable.js index 1001715b..cacd8a98 100644 --- a/tests/mocha/System.Linq/InfiniteEnumerable.js +++ b/tests/mocha/System.Linq/InfiniteEnumerable.js @@ -114,4 +114,5 @@ }); }); }); -//# sourceMappingURL=InfiniteEnumerable.js.map \ No newline at end of file + +//# sourceMappingURL=InfiniteEnumerable.js.map diff --git a/tests/mocha/System.Linq/InfiniteEnumerable.js.map b/tests/mocha/System.Linq/InfiniteEnumerable.js.map index e99c046f..1a6b4d2b 100644 --- a/tests/mocha/System.Linq/InfiniteEnumerable.js.map +++ b/tests/mocha/System.Linq/InfiniteEnumerable.js.map @@ -1 +1 @@ -{"version":3,"file":"InfiniteEnumerable.js","sourceRoot":"","sources":["InfiniteEnumerable.ts"],"names":[],"mappings":";;;;;;;;;IAEA,qBAAuB,kCAAkC,CAAC,CAAA;IAC1D,IAAI,MAAM,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;IA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AC,CAAC,CAAC,KAAK,EAAE,EAAC,CAAC,CAAC,CAAC;YAC7C,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAChC,CAAC,CAAC,CAAC;IAEJ,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,qBAAqB,EAAE;QAG/B,EAAE,CAAC,qCAAqC,EAAE;YAEzC,IAAI,CAAC,GAAG,cAAU,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,UAAC,CAAC,EAAC,CAAC,IAAG,OAAA,EAAE,GAAC,CAAC,GAAC,EAAE,GAAC,CAAC,EAAT,CAAS,CAAC,CAAC;YAC3D,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAC,IAAI,CAAC,CAAC;YAClC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAC,IAAI,CAAC,CAAC;YAClC,CAAC,CAAC,OAAO,EAAE,CAAC;QACb,CAAC,CAAC,CAAC;IAEJ,CAAC,CAAC,CAAC","file":"System.Linq/InfiniteEnumerable.js","sourcesContent":["///\r\n\r\nimport Enumerable from \"../../../source/System.Linq/Linq\";\r\nvar assert = require('../../../node_modules/assert/assert');\r\n\r\n\r\nvar source = Enumerable.toInfinity().asEnumerable();\r\n\r\ndescribe(\".doAction(...)\",()=>{\r\n\tit(\"should throw when disposed\",()=>{\r\n\t\tvar a = source.doAction(e=>{});\r\n\t\ta.force();\r\n\t\tvar n = a.getEnumerator();\r\n\t\tassert.ok(n.moveNext());\r\n\t\tn.dispose();\r\n\t\tassert.ok(!n.moveNext());\r\n\t\tn = a.getEnumerator();\r\n\t\tassert.ok(n.moveNext());\r\n\t\ta.dispose();\r\n\t\tassert.throws(()=>n.moveNext());\r\n\t});\r\n});\r\n\r\ndescribe(\".elementAt(x)\", ()=>\r\n{\r\n\r\n\tit(\"the index should match the value\", ()=>\r\n\t{\r\n\t\tfor(let i = 0; i<10; i++)\r\n\t\t{\r\n\t\t\tassert.equal(source.elementAt(i), i);\r\n\t\t}\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".singleOrDefault()\", ()=>\r\n{\r\n\r\n\tit(\"should be defaulted\", ()=>\r\n\t{\r\n\t\tassert.equal(source.singleOrDefault(), null);\r\n\t\tassert.equal(source.singleOrDefault(-1), -1);\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".single()\", ()=>\r\n{\r\n\r\n\tit(\"should throw\", ()=>\r\n\t{\r\n\t\tassert.throws(()=>\r\n\t\t{\r\n\t\t\tsource.single();\r\n\t\t});\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".skip(count)\", ()=>\r\n{\r\n\tit(\"should return empty if Infinity\", ()=>\r\n\t{\r\n\t\tassert.equal(\r\n\t\t\tsource\r\n\t\t\t\t.skip(Infinity)\r\n\t\t\t\t.firstOrDefault(-1), -1);\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".take(count)\", ()=>\r\n{\r\n\tit(\"should return empty if zero less\", ()=>\r\n\t{\r\n\t\tassert.equal(\r\n\t\t\tsource\r\n\t\t\t\t.take(0)\r\n\t\t\t\t.defaultIfEmpty(-1)\r\n\t\t\t\t.first(), -1);\r\n\r\n\t\tassert.equal(\r\n\t\t\tsource\r\n\t\t\t\t.take(-1)\r\n\t\t\t\t.firstOrDefault(-1), -1);\r\n\r\n\t\tassert.throws(()=>\r\n\t\t{\r\n\t\t\tvar t = source.take(2);\r\n\t\t\tvar e = t.getEnumerator();\r\n\t\t\te.moveNext();\r\n\t\t\tt.dispose();\r\n\t\t\te.moveNext();\r\n\t\t});\r\n\r\n\t\tassert.doesNotThrow(()=>\r\n\t\t{\r\n\t\t\tvar e = false, f = false;\r\n\t\t\tassert.ok(\r\n\t\t\t\tsource\r\n\t\t\t\t\t.where(e=>\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(!e) throw \"Error\";\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.catchError(error=>\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\te = error==\"Error\";\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.finallyAction(()=>{\r\n\t\t\t\t\t\tf = true;\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.isEmpty());\r\n\t\t\tassert.ok(e);\r\n\t\t\tassert.ok(f);\r\n\t\t});\r\n\r\n\t});\r\n\r\n\t// All .take operations should return a finite enumerable.\r\n\t// For other conditional take operations, like takeWhile, the isEndless property is indeterminate.\r\n\tit(\"should throw for Infinity\", ()=>\r\n\t{\r\n\t\tassert.throws(()=>\r\n\t\t{\r\n\t\t\tsource.take(Infinity);\r\n\t\t})\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".choose()\", ()=>\r\n{\r\n\r\n\tit(\"should filter non-null\", ()=>\r\n\t{\r\n\t\tassert.equal(source.choose().first(),0);\r\n\t\tassert.equal(source.choose(s=>s).first(),0);\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".except()\", ()=>\r\n{\r\n\r\n\tit(\"should skip values that are excepted\", ()=>\r\n\t{\r\n\t\tassert.equal(source.except([0,1]).first(),2);\r\n\t\tassert.equal(source.except([1,2]).elementAt(2),4);\r\n\t\tsource.except([1,2]).dispose();\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".pairwise(selector)\", ()=>\r\n{\r\n\r\n\tit(\"should produce pair selected values\", ()=>\r\n\t{\r\n\t\tvar s = Enumerable.toInfinity().pairwise((a,b)=>\"\"+a+\"\"+b);\r\n\t\tassert.equal(s.elementAt(0),\"01\");\r\n\t\tassert.equal(s.elementAt(5),\"56\");\r\n\t\ts.dispose();\r\n\t});\r\n\r\n});\r\n"]} \ No newline at end of file diff --git a/tests/mocha/System/Collections/Arrays/Compare.js b/tests/mocha/System/Collections/Arrays/Compare.js index 765c4f17..7a16946a 100644 --- a/tests/mocha/System/Collections/Arrays/Compare.js +++ b/tests/mocha/System/Collections/Arrays/Compare.js @@ -60,4 +60,5 @@ }); }); }); -//# sourceMappingURL=Compare.js.map \ No newline at end of file + +//# sourceMappingURL=Compare.js.map diff --git a/tests/mocha/System/Collections/Arrays/Compare.js.map b/tests/mocha/System/Collections/Arrays/Compare.js.map index 3a57efdb..072a639a 100644 --- a/tests/mocha/System/Collections/Arrays/Compare.js.map +++ b/tests/mocha/System/Collections/Arrays/Compare.js.map @@ -1 +1 @@ -{"version":3,"file":"Compare.js","sourceRoot":"","sources":["Compare.ts"],"names":[],"mappings":";;;;;;;;;IAEA,IAAY,YAAY,WAAM,wDAAwD,CAAC,CAAA;IACvF,IAAI,MAAM,GAAG,OAAO,CAAC,2CAA2C,CAAC,CAAC;IAElE,IAAM,EAAE,GAAG,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IACnB,IAAM,EAAE,GAAG,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IACnB,IAAM,CAAC,GAAG,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IAClB,IAAM,CAAC,GAAG,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAC,CAAC;IACrB,IAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;IACpB,IAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC;IAE7B,QAAQ,CAAC,aAAa,EAAC;QAEtB,EAAE,CAAC,iBAAiB,EAAC;YACpB,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC,CA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C,aAAa,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAChD,MAAM,CAAC,EAAE,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,EAAC,CAAC,EAAC,cAAI,OAAA,CAAC,EAAD,CAAC,CAAC,CAAC,CAAC;YACnD,MAAM,CAAC,EAAE,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,EAAC,CAAC,CAAC,CAAC,CAAC;YAC7C,MAAM,CAAC,EAAE,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IAEJ,CAAC,CAAC,CAAC","file":"System/Collections/Arrays/Compare.js","sourcesContent":["///\r\n\r\nimport * as ArrayCompare from \"../../../../../source/System/Collections/Array/Compare\";\r\nvar assert = require('../../../../../node_modules/assert/assert');\r\n\r\nconst a1 = [1,2,3];\r\nconst a2 = [1,2,3];\r\nconst b = [4,5,6];\r\nconst c = [7,8,9,10];\r\nconst d = b.slice();\r\nconst e = c.slice();\r\nd.length = e.length = 200000;\r\n\r\ndescribe(\".areEqual()\",()=>{\r\n\r\n\tit(\"should be equal\",()=>{\r\n\t\tassert.ok(ArrayCompare.areEqual([],[]));\r\n\t\tassert.ok(ArrayCompare.areEqual(a1,a1));\r\n\t\tassert.ok(ArrayCompare.areEqual(a1,a2));\r\n\t});\r\n\r\n\tit(\"should not be equal\",()=>{\r\n\t\tassert.ok(!ArrayCompare.areEqual(null,a1));\r\n\t\tassert.ok(!ArrayCompare.areEqual(a1,null));\r\n\t\tassert.ok(!ArrayCompare.areEqual(a1,b));\r\n\t\tassert.ok(!ArrayCompare.areEqual(b,c));\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".areAllEqual()\",()=>{\r\n\r\n\tit(\"should be equal\",()=>{\r\n\t\tassert.ok(ArrayCompare.areAllEqual([[],[],[]]));\r\n\t\tassert.ok(ArrayCompare.areAllEqual([a1,a1,a2]));\r\n\t});\r\n\r\n\tit(\"should not be equal\",()=>{\r\n\t\tassert.ok(!ArrayCompare.areAllEqual([a1,null]));\r\n\t\tassert.ok(!ArrayCompare.areAllEqual([a1,b,c]));\r\n\t\tassert.ok(!ArrayCompare.areAllEqual([a1,b],true,()=>false));\r\n\t});\r\n\r\n\tit(\"should error for invalid\",()=>{\r\n\t\tassert.throws(()=>ArrayCompare.areAllEqual(null));\r\n\t\tassert.throws(()=>ArrayCompare.areAllEqual([]));\r\n\t\tassert.throws(()=>ArrayCompare.areAllEqual([a1]));\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".areEquivalent()\",()=>{\r\n\r\n\tit(\"should be equivalent\",()=>{\r\n\t\tassert.ok(ArrayCompare.areEquivalent([1],[1]));\r\n\t\tassert.ok(ArrayCompare.areEquivalent(a1,a1));\r\n\t\tassert.ok(ArrayCompare.areEquivalent(a1,a2));\r\n\t\tassert.ok(ArrayCompare.areEquivalent(a1,a1.slice().reverse()));\r\n\t});\r\n\r\n\tit(\"should not be equivalent\",()=>{\r\n\t\tassert.ok(!ArrayCompare.areEquivalent([1],[2]));\r\n\t\tassert.ok(!ArrayCompare.areEquivalent(a1,b,()=>1));\r\n\t\tassert.ok(!ArrayCompare.areEquivalent(a1,b));\r\n\t\tassert.ok(!ArrayCompare.areEquivalent(d,e));\r\n\t});\r\n\r\n});"]} \ No newline at end of file diff --git a/tests/mocha/System/Collections/Arrays/Dispatch.js b/tests/mocha/System/Collections/Arrays/Dispatch.js index 2db7717d..4255b726 100644 --- a/tests/mocha/System/Collections/Arrays/Dispatch.js +++ b/tests/mocha/System/Collections/Arrays/Dispatch.js @@ -52,4 +52,5 @@ }); }); }); -//# sourceMappingURL=Dispatch.js.map \ No newline at end of file + +//# sourceMappingURL=Dispatch.js.map diff --git a/tests/mocha/System/Collections/Arrays/Dispatch.js.map b/tests/mocha/System/Collections/Arrays/Dispatch.js.map index 0902eba6..a823b946 100644 --- a/tests/mocha/System/Collections/Arrays/Dispatch.js.map +++ b/tests/mocha/System/Collections/Arrays/Dispatch.js.map @@ -1 +1 @@ -{"version":3,"file":"Dispatch.js","sourceRoot":"","sources":["Dispatch.ts"],"names":[],"mappings":";;;;;;;;;IAEA,yBAAuC,yDAAyD,CAAC,CAAA;IACjG,IAAI,MAAM,GAAG,OAAO,CAAC,2CAA2C,CAAC,CAAC;IAElE,EAAE,CAAC,gCAAgC,EAAE;QAEpC,IAAI,MAAM,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,GAAG;YACP,UAAC,CAAQ;gBAER,MAAM,IAAI,CAAC,CAAC;YACb,CAAC;YACD,UAAC,CAAQ;gBAER,MAAM,IAAI,CAAC,CAAC;YACb,CAAC;YACD,IAAI;SACJ,CAAC;QAGF,mBAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAChB,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE1B,MAAM,CAAC,KAAK,CAAC,iBAAM,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,iBAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACvC,MAAM,CAAC,KAAK,CAAC,iBAAM,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACtC,iBAAM,CAAC,IAAI,EAAC,EAAE,CAAC,CAAC;QAChB,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG;QACP,UAAC,CAAQ;YAER,MAAM,OAAO,CAAC;QACf,CAAC;KACD,CAAC;IAEF,EAAE,CAAC,yBAAyB,EAAC;QAC5B,MAAM,CAAC,MAAM,CAAC;YAEb,mBAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACjB,CAAC,C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MAAM,CAAC,KAAK,CAAC,GAAG,EAAC,OAAO,CAAC,EAAzB,CAAyB,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC","file":"System/Collections/Arrays/Dispatch.js","sourcesContent":["///\r\n\r\nimport {dispatch, mapped, unsafe} from \"../../../../../source/System/Collections/Array/Dispatch\";\r\nvar assert = require('../../../../../node_modules/assert/assert');\r\n\r\nit(\"should apply closures in order\", ()=>\r\n{\r\n\tvar result = 0;\r\n\tvar a = [\r\n\t\t(p:number)=>\r\n\t\t{\r\n\t\t\tresult += p;\r\n\t\t},\r\n\t\t(p:number)=>\r\n\t\t{\r\n\t\t\tresult *= p;\r\n\t\t},\r\n\t\tnull\r\n\t];\r\n\r\n\r\n\tdispatch(a, 10);\r\n\tassert.equal(result, 100);\r\n\r\n\tassert.equal(mapped(null, 20), null);\r\n\tassert.equal(mapped([], 20).length, 0);\r\n\tassert.equal(mapped(a, 20).length, 3);\r\n\tunsafe(null,10);\r\n\tassert.equal(result, 2400);\r\n});\r\n\r\nvar b = [\r\n\t(p:number)=>\r\n\t{\r\n\t\tthrow \"error\";\r\n\t}\r\n];\r\n\r\nit(\"should propagate errors\",()=>{\r\n\tassert.throws(()=>\r\n\t{\r\n\t\tdispatch(b, 10);\r\n\t});\r\n\r\n\tassert.throws(()=>\r\n\t{\r\n\t\tmapped(b, 10);\r\n\t});\r\n});\r\n\r\n\r\nit(\"should trap errors\",()=>{\r\n\tassert.doesNotThrow(()=>\r\n\t{\r\n\t\tdispatch(b, 10, true);\r\n\t\tdispatch(b, 10,err=>assert.equal(err,'error'));\r\n\t});\r\n\r\n\tassert.doesNotThrow(()=>\r\n\t{\r\n\t\tmapped(b, 10, true);\r\n\t\tmapped(b, 10,err=>assert.equal(err,'error'));\r\n\t});\r\n});"]} \ No newline at end of file diff --git a/tests/mocha/System/Collections/Arrays/Procedure.js b/tests/mocha/System/Collections/Arrays/Procedure.js index eac2421e..5d380092 100644 --- a/tests/mocha/System/Collections/Arrays/Procedure.js +++ b/tests/mocha/System/Collections/Arrays/Procedure.js @@ -72,4 +72,5 @@ }); }); }); -//# sourceMappingURL=Procedure.js.map \ No newline at end of file + +//# sourceMappingURL=Procedure.js.map diff --git a/tests/mocha/System/Collections/Arrays/Procedure.js.map b/tests/mocha/System/Collections/Arrays/Procedure.js.map index 6418b59a..59ab3902 100644 --- a/tests/mocha/System/Collections/Arrays/Procedure.js.map +++ b/tests/mocha/System/Collections/Arrays/Procedure.js.map @@ -1 +1 @@ -{"version":3,"file":"Procedure.js","sourceRoot":"","sources":["Procedure.ts"],"names":[],"mappings":";;;;;;;;;IAEA,IAAY,cAAc,WAAM,0DAA0D,CAAC,CAAA;IAC3F,IAAI,MAAM,GAAG,OAAO,CAAC,2CAA2C,CAAC,CAAC;IAGlE,IACC,IAAI,GAAO,CAAC,EAAE,EACd,IAAI,GAAO,IAAI,EACf,IAAI,GAAO,CAAC,QAAQ,EACpB,IAAI,GAAO,QAAQ,EACnB,CAAC,GAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,EAC3C,CAAC,GAAU,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EACtD,GAAG,GAAQ,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAC7C,OAAO,GAAI,GAAG,GAAC,CAAC,EAChB,OAAO,GAAI,CAAC,GAAC,IAAI,GAAC,CAAC,CAAC,CAAC,CAAC,GAAC,IAAI,GAAC,CAAC,CAAC,CAAC,CAAC,GAAC,EAAE,EACnC,QAAQ,GAAG,CAAC,GAAC,IAAI,GAAC,CAAC,CAAC,CAAC,CAAC,G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AAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC3C,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC","file":"System/Collections/Arrays/Procedure.js","sourcesContent":["///\r\n\r\nimport * as ArrayProcedure from \"../../../../../source/System/Collections/Array/Procedure\";\r\nvar assert = require('../../../../../node_modules/assert/assert');\r\n\r\n\r\nconst\r\n\tminA = -10,\r\n\tmaxA = 2000,\r\n\tminB = -Infinity,\r\n\tmaxB = Infinity,\r\n\ta = [5, minA, -1, maxA, -2, NaN, 20],\r\n\tb = [5, 2000, maxB, -1, NaN, -10, minB, -2, 20],\r\n\tsum = 5 + minA + (-1) + maxA + (-2) + 20,\r\n\taverage = sum/6, // Not including NaN\r\n\tproduct = 5*minA*(-1)*maxA*(-2)*20,\r\n\tquotient = 5/minA/(-1)/maxA/(-2)/20;\r\n\r\n\r\nfunction procedureShouldBe(\r\n\tsource:number[],\r\n\tvalue:number,\r\n\tp:(array:number[], ignoreNaN?:boolean)=>number)\r\n{\r\n\tit('should be NaN', ()=>\r\n\t{\r\n\t\tassert.ok(isNaN(p(source)));\r\n\t});\r\n\tit('should be ' + value, ()=>\r\n\t{\r\n\t\tassert.equal(p(source, true), value);\r\n\t});\r\n}\r\n\r\ndescribe(\".sum(source)\", ()=>\r\n{\r\n\tprocedureShouldBe(a, sum, ArrayProcedure.sum);\r\n\tit('should be 0', ()=>\r\n\t{\r\n\t\tassert.equal(ArrayProcedure.sum([]), 0);\r\n\t});\r\n});\r\n\r\ndescribe(\".average(source)\", ()=>\r\n{\r\n\tprocedureShouldBe(a, average, ArrayProcedure.average);\r\n\tit('should be NaN', ()=>\r\n\t{\r\n\t\tassert.ok(isNaN(ArrayProcedure.average([])));\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".product(source)\", ()=>\r\n{\r\n\tprocedureShouldBe(a, product, ArrayProcedure.product);\r\n\tit('should be NaN', ()=>\r\n\t{\r\n\t\tassert.ok(isNaN(ArrayProcedure.product([])));\r\n\t\tassert.ok(isNaN(ArrayProcedure.product([NaN], true)));\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".quotient(source)\", ()=>\r\n{\r\n\tprocedureShouldBe(a, quotient, ArrayProcedure.quotient);\r\n\tit('should be NaN', ()=>\r\n\t{\r\n\t\tassert.ok(isNaN(ArrayProcedure.quotient([])));\r\n\t\tassert.ok(isNaN(ArrayProcedure.quotient([1])));\r\n\t\tassert.ok(isNaN(ArrayProcedure.quotient([3,2,1,0])));\r\n\t\tassert.ok(isNaN(ArrayProcedure.quotient([NaN], true)));\r\n\t\tassert.ok(isNaN(ArrayProcedure.quotient([NaN,NaN,NaN])));\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".min(source)\", ()=>\r\n{\r\n\tdescribe(\"a\", ()=>\r\n\t{\r\n\t\tprocedureShouldBe(a, minA, ArrayProcedure.min);\r\n\t});\r\n\r\n\tdescribe(\"b\", ()=>\r\n\t{\r\n\t\tprocedureShouldBe(b, minB, ArrayProcedure.min);\r\n\t});\r\n\r\n\tit(\"should be NaN\",()=>{\r\n\t\tassert.ok(isNaN(ArrayProcedure.min(null)));\r\n\t\tassert.ok(isNaN(ArrayProcedure.min([NaN],true)));\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".max(source)\", ()=>\r\n{\r\n\tdescribe(\"a\", ()=>\r\n\t{\r\n\t\tprocedureShouldBe(a, maxA, ArrayProcedure.max);\r\n\t});\r\n\r\n\tdescribe(\"b\", ()=>\r\n\t{\r\n\t\tprocedureShouldBe(b, maxB, ArrayProcedure.max);\r\n\t});\r\n\r\n\tit(\"should be NaN\",()=>{\r\n\t\tassert.ok(isNaN(ArrayProcedure.max(null)));\r\n\t\tassert.ok(isNaN(ArrayProcedure.max([NaN],true)));\r\n\t});\r\n});\r\n"]} \ No newline at end of file diff --git a/tests/mocha/System/Collections/Arrays/Utility.js b/tests/mocha/System/Collections/Arrays/Utility.js index 24660b25..3fff8ff8 100644 --- a/tests/mocha/System/Collections/Arrays/Utility.js +++ b/tests/mocha/System/Collections/Arrays/Utility.js @@ -244,4 +244,5 @@ }); } }); -//# sourceMappingURL=Utility.js.map \ No newline at end of file + +//# sourceMappingURL=Utility.js.map diff --git a/tests/mocha/System/Collections/Arrays/Utility.js.map b/tests/mocha/System/Collections/Arrays/Utility.js.map index d4029217..931d5c49 100644 --- a/tests/mocha/System/Collections/Arrays/Utility.js.map +++ b/tests/mocha/System/Collections/Arrays/Utility.js.map @@ -1 +1 @@ -{"version":3,"file":"Utility.js","sourceRoot":"","sources":["Utility.ts"],"names":[],"mappings":";;;;;;;;;IAEA,IAAY,MAAM,WAAM,wDAAwD,CAAC,CAAA;IACjF,IAAY,YAAY,WAAM,wDAAwD,CAAC,CAAA;IACvF,0BAAsB,oDAAoD,CAAC,CAAA;IAC3E,IAAI,MAAM,GAAG,OAAO,CAAC,2CAA2C,CAAC,CAAC;IAIlE,IAAM,IAAI,GAAG,CAAC,EAAE,EAAE,IAAI,GAAG,IAAI,CAAC;IAE9B;QAEC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAA;IACxC,CAAC;IAED,QAAQ,CAAC,qBAAqB,EAAE;QAE/B,oBAAoB,GAAU;YAE7B,EAAE,CAAC,mBAAmB,GAAG,GAAG,EAAE;gBAE7B,IAAI,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;gBACrC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,oBAAoB,GAAG,GAAG,CAAC,CAAC;YACzD,CAAC,CAAC,CAAC;QACJ,CAAC;QAED,UAAU,CA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AAM,EAAE,CAAC,EAAE,EAC5B,CAAC;YACA,EAAE,IAAI,mBAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;QACrD,CAAC;QAED,MAAM,CAAC,EAAE,CAAC;IACX,CAAC;IAED,wBAAwB,MAAa,EAAE,OAAgB;QAEtD,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,iBAAiB,GAAG,MAAM,EAAE;YAEzD,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACJ,CAAC","file":"System/Collections/Arrays/Utility.js","sourcesContent":["///\r\n\r\nimport * as Arrays from \"../../../../../source/System/Collections/Array/Compare\";\r\nimport * as ArrayUtility from \"../../../../../source/System/Collections/Array/Utility\";\r\nimport Stopwatch from \"../../../../../source/System/Diagnostics/Stopwatch\";\r\nvar assert = require('../../../../../node_modules/assert/assert');\r\n\r\n\r\n// Min/Max tests...\r\nconst minA = -10, maxA = 2000;\r\n\r\nfunction initTestArray()\r\n{\r\n\treturn [5, minA, -1, maxA, -2, NaN, 20]\r\n}\r\n\r\ndescribe(\".initialize(length)\", ()=>\r\n{\r\n\tfunction testLength(len:number):void\r\n\t{\r\n\t\tit(\"should be length \" + len, ()=>\r\n\t\t{\r\n\t\t\tvar a = ArrayUtility.initialize(len);\r\n\t\t\tassert.equal(a.length, len, \".length should be \" + len);\r\n\t\t});\r\n\t}\r\n\r\n\ttestLength(100);\r\n\ttestLength(100000);\r\n});\r\n\r\n\r\ndescribe(\".copy(source) & .equals(old,new)\", ()=>\r\n{\r\n\tit(\"should equal\", ()=>\r\n\t{\r\n\t\tvar s1 = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3],\r\n\t\t s2 = ArrayUtility.copy(s1),\r\n\t\t s3 = ArrayUtility.copy(s1, 1),\r\n\t\t s4 = ArrayUtility.copy(s1, 1, 3),\r\n\t\t s5 = ArrayUtility.copy(null);\r\n\t\tassert.ok(Arrays.areEqual(s1, s2));\r\n\t\tassert.equal(s5, null);\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".copyTo(source,destination)\", ()=>\r\n{\r\n\tit(\"should throw for invalid parameter\", ()=>\r\n\t{\r\n\t\tassert.throws(()=> {ArrayUtility.copyTo(null, null);});\r\n\t\tassert.throws(()=> {ArrayUtility.copyTo([], null);});\r\n\t\tassert.throws(()=> {ArrayUtility.copyTo([1], [], -1);});\r\n\t\tassert.throws(()=> {ArrayUtility.copyTo([1], [], 2);});\r\n\t\tassert.throws(()=> {ArrayUtility.copyTo([1], {length: -1});});\r\n\t\tassert.throws(()=> {ArrayUtility.copyTo([1], [], 0, 0, 5);});\r\n\t});\r\n});\r\n\r\ndescribe(\".indexOf(source,value)\", ()=>\r\n{\r\n\tvar a = initTestArray();\r\n\tit(\"should return true for a value contained\", ()=>\r\n\t{\r\n\t\tassert.notEqual(ArrayUtility.indexOf(a, -1), -1);\r\n\t});\r\n});\r\n\r\n\r\ndescribe(\".contains(source,value)\", ()=>\r\n{\r\n\tvar a = initTestArray();\r\n\tit(\"should return true for a value contained\", ()=>\r\n\t{\r\n\t\tassert.ok(ArrayUtility.contains(a, -1));\r\n\t});\r\n\tit(\"should return false for a value that is not present\", ()=>\r\n\t{\r\n\t\tassert.ok(!ArrayUtility.contains(a, -9876));\r\n\t});\r\n});\r\n\r\n\r\ndescribe(\".replace(source,oldValue,newValue)\", ()=>\r\n{\r\n\tvar a = initTestArray();\r\n\ta.push(5);\r\n\tit(\"should properly replace items with max\", ()=>\r\n\t{\r\n\t\tassert.equal(ArrayUtility.replace(null, 5, 6), 0);\r\n\t\tassert.equal(ArrayUtility.replace([], 5, 6), 0);\r\n\t\tassert.equal(ArrayUtility.replace(a, 5, 6), 2);\r\n\t\tassert.ok(ArrayUtility.contains(a, 6));\r\n\t\tassert.equal(ArrayUtility.replace(a, 6, 5, 1), 1);\r\n\t\tassert.ok(ArrayUtility.contains(a, 6));\r\n\t\tassert.ok(ArrayUtility.contains(a, 5));\r\n\r\n\t});\r\n\tit(\"should throw for invalid parameter\", ()=>\r\n\t{\r\n\t\tassert.throws(()=> {ArrayUtility.replace([4, 5, 6], 5, 6, -5);});\r\n\t});\r\n});\r\n\r\ndescribe(\".findIndex(source,of)\", ()=>\r\n{\r\n\tvar a = initTestArray(), b:IArray = {0: 3, 1: 1, 2: 2, length: 3};\r\n\tit(\"should find and return the correct index\", ()=>\r\n\t{\r\n\t\tassert.equal(ArrayUtility.findIndex(a, (v:number)=>v== -1), 2);\r\n\t});\r\n\tit(\"should find and return the correct index\", ()=>\r\n\t{\r\n\t\tassert.equal(ArrayUtility.findIndex(b, (v:number)=>v==1), 1);\r\n\t});\r\n\tit(\"should return -1 when the value is not present\", ()=>\r\n\t{\r\n\t\tassert.equal(ArrayUtility.findIndex(a, (v:number)=> v== -9876), -1);\r\n\t});\r\n\r\n\tit(\"should throw for invalid parameter\", ()=>\r\n\t{\r\n\t\tassert.throws(()=> {ArrayUtility.findIndex(null, ()=>true)});\r\n\t\tassert.throws(()=> {ArrayUtility.findIndex(a, null)});\r\n\t});\r\n});\r\n\r\ndescribe(\".register(target,value)\", ()=>\r\n{\r\n\tit(\"should add a value that isn't present\", ()=>\r\n\t{\r\n\t\tvar a = initTestArray();\r\n\t\tvar len = a.length;\r\n\t\tassert.ok(ArrayUtility.register(a, -9876));\r\n\t\tassert.equal(a.length, len + 1);\r\n\t});\r\n\r\n\tit(\"should not add a value that is present\", ()=>\r\n\t{\r\n\t\tvar a = initTestArray();\r\n\t\tvar len = a.length;\r\n\t\tassert.ok(!ArrayUtility.register(a, -1));\r\n\t\tassert.equal(a.length, len);\r\n\t});\r\n\r\n\tit(\"should throw for invalid parameter\", ()=>\r\n\t{\r\n\t\tassert.throws(()=> {ArrayUtility.register(null, -1, ()=>true)});\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".remove(target,value)\", ()=>\r\n{\r\n\tit(\"should remove the item/value request and return the number of instances removed\", ()=>\r\n\t{\r\n\t\tvar s = [10, 9, 9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 3];\r\n\t\tvar len = s.length;\r\n\r\n\t\tassert.equal(ArrayUtility.remove(s, 9, 1), 1, \"Only 9 removed once\");\r\n\t\tassert.equal(s.length, len - 1, \".length should be less by one\");\r\n\t\tassert.equal(ArrayUtility.remove(s, 9, 3), 2, \"Remaining 9s removed.\");\r\n\t\tassert.equal(s[1], 8, \"Index [1] is now 8\");\r\n\t\tlen = s.length;\r\n\r\n\t\tassert.equal(ArrayUtility.remove(s, 2), 2, \"2 removed twice\");\r\n\t\tassert.equal(s.length, len - 2, \".length should be less by two\");\r\n\t\tassert.equal(s[7], 1, \"Index [7] is now 1\");\r\n\t\tassert.equal(s[10], 3, \"Index [10] is now 3\");\r\n\t\tlen = s.length;\r\n\r\n\t\tassert.equal(ArrayUtility.remove(s, 15), 0, \"15 does not exist\");\r\n\t\tassert.equal(s.length, len, \".length should be the same\");\r\n\t\tlen = s.length;\r\n\r\n\t\tassert.ok(ArrayUtility.removeIndex(s, 5), \"Index [5] removed\");\r\n\t\tassert.equal(s.length, len - 1, \".length should be less by one\");\r\n\t\tlen = s.length;\r\n\r\n\t\tassert.equal(ArrayUtility.remove(s, 3, null), 3, \"All 3s removed.\");\r\n\t\tassert.equal(s.length, len - 3, \".length should be the same\");\r\n\t\tlen = s.length;\r\n\r\n\t\tassert.ok(!ArrayUtility.removeIndex(s, 15), \"Index [15] doesn't exist\");\r\n\t\tassert.equal(s.length, len, \".length should be the same\");\r\n\t});\r\n\r\n\tit(\"should assert invalid parameters\", ()=>\r\n\t{\r\n\t\tassert.throws(()=>\r\n\t\t{\r\n\t\t\tArrayUtility.removeIndex(null, 0);\r\n\t\t});\r\n\t\tassert.throws(()=>\r\n\t\t{\r\n\t\t\tArrayUtility.removeIndex([1, 2], -1);\r\n\t\t});\r\n\t\tassert.throws(()=>\r\n\t\t{\r\n\t\t\tArrayUtility.remove([1, 2], 1, -2);\r\n\t\t});\r\n\t});\r\n\r\n});\r\n\r\n/*\tUtility.applyTo skipped.\r\n It has too many permutations while being a straight forward function. */\r\n\r\n\r\ndescribe(\".updateRange(value,count)\", ()=>\r\n{\r\n\tit(\"should correctly overwrite the value requested\", ()=>\r\n\t{\r\n\r\n\t\tvar value = 10, count = 3, r = [1, 2, 3];\r\n\t\tassert.doesNotThrow(()=> {ArrayUtility.updateRange(null, value)});\r\n\t\tArrayUtility.updateRange(r, value);\r\n\r\n\t\tassert.equal(r.length, count, \".length should be 3\");\r\n\t\tfor(let i = 0; i\r\n\t{\r\n\t\tassert.throws(()=> {ArrayUtility.updateRange([1, 2, 3], 4, 2, 1);})\r\n\t})\r\n});\r\n\r\ndescribe(\".applyTo(source,action)\", ()=>\r\n{\r\n\tit(\"should correctly overwrite the values\", ()=>\r\n\t{\r\n\r\n\t\tvar value = 10, count = 3, r = [1, 2, 3];\r\n\t\tassert.doesNotThrow(()=> {ArrayUtility.applyTo(null, ()=>null)});\r\n\t\tArrayUtility.applyTo(r, ()=>null);\r\n\t\tassert.equal(r.length, count, \".length should be 3\");\r\n\t\tfor(let i = 0; i\r\n{\r\n\tit(\"should correctly overwrite the values\", ()=>\r\n\t{\r\n\r\n\t\tvar count = 0, r = [1, 2, 3];\r\n\t\tassert.doesNotThrow(()=> {ArrayUtility.forEach(null, ()=>true)});\r\n\t\tArrayUtility.forEach(r, (n, i)=>\r\n\t\t{\r\n\t\t\tassert.equal(count, i, \"count should be \" + i);\r\n\t\t\tcount++;\r\n\t\t\treturn i ? false : true;\r\n\t\t});\r\n\t\tassert.equal(count, 2, \"count should be 2\");\r\n\t});\r\n});\r\n\r\ndescribe(\".repeat(value,count)\", ()=>\r\n{\r\n\tit(\"should correctly repeat the value requested\", ()=>\r\n\t{\r\n\t\tvar value = 10, count = 3;\r\n\t\tvar r = ArrayUtility.repeat(value, count);\r\n\t\tassert.equal(r.length, count, \".length should be 3\");\r\n\t\tfor(let i = 0; i\r\n\t{\r\n\t\tassert.throws(()=> {ArrayUtility.repeat(1, -2);})\r\n\t})\r\n});\r\n\r\ndescribe(\".rangeUntil(first,until,step)\", ()=>\r\n{\r\n\tit(\"should correctly increase the value requested\", ()=>\r\n\t{\r\n\t\tvar first = 10, count = 3, step = 2, until = first + count*step;\r\n\t\tvar r = ArrayUtility.rangeUntil(first, until, 2);\r\n\t\tassert.equal(r.length, count, \".length should be 3\");\r\n\t\tfor(let i = 0; i\r\n\t{\r\n\t\tassert.throws(()=> {ArrayUtility.rangeUntil(Infinity, 10);});\r\n\t\tassert.throws(()=> {ArrayUtility.rangeUntil(NaN, 10);});\r\n\t\tassert.throws(()=> {ArrayUtility.rangeUntil(1, NaN);});\r\n\t\tassert.throws(()=> {ArrayUtility.rangeUntil(1, Infinity);});\r\n\t\tassert.throws(()=> {ArrayUtility.range(1, -1);});\r\n\t\tassert.throws(()=> {ArrayUtility.rangeUntil(1, 5, 0);});\r\n\t});\r\n});\r\n\r\ndescribe(\".flatten(source,recurseDepth)\",()=>{\r\n\tit(\"should convert multi dimensional array tree to a flat one\",()=>{\r\n\t\tvar len = initTestArray().length;\r\n\t\tvar a = [[initTestArray(),initTestArray()],initTestArray()];\r\n\t\tvar b = ArrayUtility.flatten(a,3);\r\n\t\tassert.equal(b.length,len*3);\r\n\t});\r\n\r\n\tit(\"should reduce multi dimensional array tree\",()=>{\r\n\t\tvar len = initTestArray().length;\r\n\t\tvar a = [[initTestArray(),initTestArray()],initTestArray()];\r\n\t\tvar b = ArrayUtility.flatten(a);\r\n\t\tassert.equal(b.length,len+2);\r\n\t})\r\n\r\n});\r\n\r\nfunction measureRepeated(closure:()=>void):number\r\n{\r\n\tconst repeat = 50;\r\n\tvar ms = 0;\r\n\r\n\tfor(let i = 0; ivoid):void\r\n{\r\n\tit(measureRepeated(closure) + \" milliseconds: \" + suffix, ()=>\r\n\t{\r\n\t\tassert.ok(true);\r\n\t});\r\n}\r\n\r\n/*\r\n * The below code proves (for Node.js and Mocha) that best practice with arrays is:\r\n * 1) Initialize them. Set their capacity when constructed or set the length before iterating.\r\n * 2) Standard for loops are typically compiler optimized well and i++ may be compiler optimized as well (better than ++i).\r\n */\r\n//\r\n// describe(\"Array Performance\", ()=>\r\n// {\r\n// \tconst max = 1000000;\r\n// \toutputMeasured(\"Array.push(i)\", ()=>\r\n// \t{\r\n// \t\tlet a:number[] = [];\r\n// \t\tfor(let i = 0; i\r\n// \t{\r\n// \t\tlet a:number[] = [];\r\n// \t\tfor(let i = 0; i\r\n// \t{\r\n// \t\tlet a:number[] = [];\r\n// \t\ta.length = max;\r\n// \t\ta.forEach((v,i)=>{\r\n// \t\t\ta[i] = v;\r\n// \t\t});\r\n// \t\t// To ensure compiler doesn't dismiss the array, must consume the array at least once.\r\n// \t\treturn a[max-1];\r\n// \t});*/\r\n//\r\n// \toutputMeasured(\"Array[i] = i (preset capacity i++)\", ()=>\r\n// \t{\r\n// \t\tlet a:number[] = new Array(max);\r\n// \t\tfor(let i = 0; i\r\n// \t{\r\n// \t\tlet a:number[] = [];\r\n// \t\ta.length = max;\r\n// \t\tfor(let i = 0; i\r\n// \t{\r\n// \t\tlet a:number[] = [];\r\n// \t\tfor(let i=max-1;i>=0; i--) {\r\n// \t\t\ta[i] = i;\r\n// \t\t}\r\n// \t\t// To ensure compiler doesn't dismiss the array, must consume the array at least once.\r\n// \t\treturn a[max-1];\r\n// \t});\r\n//\r\n// \toutputMeasured(\"Array[i] = i (for reverse)\", ()=>\r\n// \t{\r\n// \t\tlet a:number[] = new Array(max);\r\n// \t\tfor(let i=max-1;i>=0; i--) {\r\n// \t\t\ta[i] = i;\r\n// \t\t}\r\n// \t\t// To ensure compiler doesn't dismiss the array, must consume the array at least once.\r\n// \t\treturn a[max-1];\r\n// \t});\r\n//\r\n// \toutputMeasured(\"Array[m] = m (while reverse)\", ()=>\r\n// \t{\r\n// \t\tlet a:number[] = new Array(max);\r\n// \t\tlet m = max;\r\n// \t\twhile(m--) {\r\n// \t\t\ta[m] = m;\r\n// \t\t}\r\n// \t\t// To ensure compiler doesn't dismiss the array, must consume the array at least once.\r\n// \t\treturn a[max-1];\r\n// \t});\r\n//\r\n// \toutputMeasured(\"LinkedList.add(i)\", ()=>\r\n// \t{\r\n// \t\tlet a = new LinkedList();\r\n// \t\tfor(let i = 0; i\r\n// \t{\r\n// \t\tlet root:LinkedNextNode = { value: -1, next:null };\r\n// \t\tlet next = root;\r\n// \t\tfor(let i = 0; i\r\n\r\nimport ArrayEnumerator from \"../../../../../source/System/Collections/Enumeration/ArrayEnumerator\";\r\nvar assert = require('../../../../../node_modules/assert/assert');\r\n\r\n\r\nit(\"should allow empty arrays\", ()=>\r\n{\r\n\tassert.doesNotThrow(()=>\r\n\t{\r\n\t\tvar i = new ArrayEnumerator([]);\r\n\t\ti.moveNext();\r\n\t});\r\n\r\n\tassert.doesNotThrow(()=>\r\n\t{\r\n\t\tvar i = new ArrayEnumerator(null);\r\n\t\ti.moveNext();\r\n\t});\r\n\r\n});\r\n"]} \ No newline at end of file diff --git a/tests/mocha/System/Collections/Enumeration/Enumerator.js b/tests/mocha/System/Collections/Enumeration/Enumerator.js index 2dd902bb..40cc3b0b 100644 --- a/tests/mocha/System/Collections/Enumeration/Enumerator.js +++ b/tests/mocha/System/Collections/Enumeration/Enumerator.js @@ -89,4 +89,5 @@ }); }); }); -//# sourceMappingURL=Enumerator.js.map \ No newline at end of file + +//# sourceMappingURL=Enumerator.js.map diff --git a/tests/mocha/System/Collections/Enumeration/Enumerator.js.map b/tests/mocha/System/Collections/Enumeration/Enumerator.js.map index f9604dfc..ae14a302 100644 --- a/tests/mocha/System/Collections/Enumeration/Enumerator.js.map +++ b/tests/mocha/System/Collections/Enumeration/Enumerator.js.map @@ -1 +1 @@ -{"version":3,"file":"Enumerator.js","sourceRoot":"","sources":["Enumerator.ts"],"names":[],"mappings":";;;;;;;;;IAEA,sBAAuB,oCAAoC,CAAC,CAAA;IAC5D,sBAAkB,gDAAgD,CAAC,CAAA;IACnE,IAAY,UAAU,WA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","file":"System/Collections/Enumeration/Enumerator.js","sourcesContent":["///\r\n\r\nimport {TypeInfo} from \"../../../../../source/System/Types\";\r\nimport Queue from \"../../../../../source/System/Collections/Queue\";\r\nimport * as Enumerator from \"../../../../../source/System/Collections/Enumeration/Enumerator\";\r\nvar assert = require('../../../../../node_modules/assert/assert');\r\n\r\nconst VOID0:any = void(0);\r\n\r\ndescribe(\".from(source)\",()=>{\r\n\r\n\tit(\"null should use an empty enumerator\",()=>{\r\n\t\tvar test = Enumerator.from(null), count = 0;\r\n\t\twhile(test.moveNext()) {\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tassert.equal(test.current,VOID0);\r\n\t\tassert.equal(test.nextValue(),VOID0);\r\n\t\tassert.equal(test.next().done,true);\r\n\t\tassert.equal(count,0);\r\n\t\ttest.reset();\r\n\t\ttest.dispose();\r\n\t});\r\n\r\n\tit(\"primitive values should throw\",()=>{\r\n\t\tassert.throws(()=>Enumerator.from(1));\r\n\t});\r\n\r\n\tit(\"non enumerable objects should throw\",()=>{\r\n\t\tassert.throws(()=>Enumerator.from({}));\r\n\t\tassert.throws(()=>Enumerator.from((()=>true)));\r\n\t});\r\n\r\n\tit(\"IEnumerable should enumerate\",()=>{\r\n\t\tvar a = [0,1,2,3,4];\r\n\t\tvar len = a.length, count = 0;\r\n\t\tvar q = new Queue(a);\r\n\t\tvar type = new TypeInfo(q);\r\n\t\ttype.member(\"getEnumerator\");\r\n\t\t// Creates an enumerable.\r\n\t\tvar test = Enumerator.from({getEnumerator:()=>Enumerator.from(a)});\r\n\t\twhile(test.moveNext()) {\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tassert.equal(count,len);\r\n\t});\r\n\r\n\tit(\"arrays should enumerate\",()=>{\r\n\t\tvar a = [0,1,2,3,4];\r\n\t\tvar type = new TypeInfo(a);\r\n\t\ttype.member(\"length\");\r\n\t\tvar len = a.length, count = 0;\r\n\t\tvar test = Enumerator.from(a);\r\n\t\twhile(test.moveNext()) {\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tassert.equal(count,len);\r\n\t});\r\n\r\n\tit(\"strings should enumerate\",()=>{\r\n\t\tvar a = \"01234\";\r\n\t\tvar type = new TypeInfo(a);\r\n\t\ttype.member(\"length\");\r\n\t\tvar len = a.length, count = 0;\r\n\t\tvar test = Enumerator.from(a);\r\n\t\twhile(test.moveNext()) {\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tassert.equal(count,len);\r\n\t});\r\n\r\n\tit(\"array like objects should enumerate\",()=>{\r\n\t\tvar a:IArray = {0:0,1:1,2:2,3:3,4:4,length:5};\r\n\t\tvar type = new TypeInfo(a);\r\n\t\ttype.member(\"length\");\r\n\t\tvar len = a.length, count = 0;\r\n\t\tvar test = Enumerator.from(a);\r\n\t\twhile(test.moveNext()) {\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\tassert.equal(count,len);\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".forEach(source)\",()=>\r\n{\r\n\tconst blankAction:(n:any,i:number)=>void = (n,i)=>{};\r\n\r\n\tit(\"null values ignored\", ()=>\r\n\t{\r\n\t\tassert.doesNotThrow(()=>Enumerator.forEach(null,blankAction));\r\n\t});\r\n\r\n\tit(\"non-enumerable values ignored\", ()=>\r\n\t{\r\n\t\tassert.doesNotThrow(()=>Enumerator.forEach({},blankAction));\r\n\t\tassert.doesNotThrow(()=>Enumerator.forEach(1,blankAction));\r\n\t});\r\n\r\n});\r\n"]} \ No newline at end of file diff --git a/tests/mocha/System/Collections/Enumeration/IndexEnumerator.js b/tests/mocha/System/Collections/Enumeration/IndexEnumerator.js index 16e77c5b..5c5c2e52 100644 --- a/tests/mocha/System/Collections/Enumeration/IndexEnumerator.js +++ b/tests/mocha/System/Collections/Enumeration/IndexEnumerator.js @@ -102,4 +102,5 @@ test.dispose(); }); }); -//# sourceMappingURL=IndexEnumerator.js.map \ No newline at end of file + +//# sourceMappingURL=IndexEnumerator.js.map diff --git a/tests/mocha/System/Collections/Enumeration/IndexEnumerator.js.map b/tests/mocha/System/Collections/Enumeration/IndexEnumerator.js.map index f4b1702d..846995d7 100644 --- a/tests/mocha/System/Collections/Enumeration/IndexEnumerator.js.map +++ b/tests/mocha/System/Collections/Enumeration/IndexEnumerator.js.map @@ -1 +1 @@ -{"version":3,"file":"IndexEnumerator.js","sourceRoot":"","sources":["IndexEnumerator.ts"],"names":[],"mappings":";;;;;;;;;IAEA,gCAA4B,sEAAsE,CAAC,CAAA;IACnG,IAAI,MAAM,GAAG,OAAO,CAAC,2CAA2C,CAAC,CAAC;IAElE,IAAM,KAAK,GAAO,KAAI,CAAC,CAAC,CAAC,CAAC;IAG1B,IAAM,CAAC,GAA6B,EAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAC,CAAC;IAGnE,EAAE,CAAC,4BAA4B,EAAE;QAGhC,MAAM,CAAC,YAAY,CAAC;YAEnB,IAAI,CAAC,GAAG,IAAI,yBAAe,CAAC;gBAE3B,MAAM,CAAC;oBACN,MAAM,EAAE,IAAI;oBACZ,OAAO,EAAE,CAAC;oBACV,MAAM,EAAE,CAAC;oBACT,IAAI,EAAE,CAAC;iBACP,CAAA;YACF,CAAC,CAAC,CAAC;YACH,CAAC,CAAC,QAAQ,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,YAAY,CAAC;YAEnB,IAAI,CAAC,GAAG,IAAI,yBAAe,CAAC;gBAE3B,MAAM,CAAC;oBACN,MAAM,EAAE,IAAI;oBACZ,MAAM,EAAE,CAAC;iBACT,CAAA;YACF,CAAC,CAAC,CAAC;YACH,CAAC,CAAC,OAAO,EAAE,CAAC;QACb,CAAC,CAAC,CAAC;IAEJ,CAAC,CAAC,CAAC;IAGH,EAAE,CAAC,+BAA+B,EAAE;QAGnC,MAAM,CAAC,MAAM,CAAC;YAEb,IAAI,CAAC,GAAG,IAAI,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AC,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC","file":"System/Collections/Enumeration/IndexEnumerator.js","sourcesContent":["///\r\n\r\nimport IndexEnumerator from \"../../../../../source/System/Collections/Enumeration/IndexEnumerator\";\r\nvar assert = require('../../../../../node_modules/assert/assert');\r\n\r\nconst VOID0:any = void(0);\r\n\r\n\r\nconst a:{ [index:number]:number } = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4};\r\n\r\n\r\nit(\"should ignore null sources\", ()=>\r\n{\r\n\r\n\tassert.doesNotThrow(()=>\r\n\t{\r\n\t\tvar i = new IndexEnumerator(()=>\r\n\t\t{\r\n\t\t\treturn {\r\n\t\t\t\tsource: null,\r\n\t\t\t\tpointer: 1,\r\n\t\t\t\tlength: 3,\r\n\t\t\t\tstep: 0\r\n\t\t\t}\r\n\t\t});\r\n\t\ti.moveNext();\r\n\t});\r\n\r\n\tassert.doesNotThrow(()=>\r\n\t{\r\n\t\tvar i = new IndexEnumerator(()=>\r\n\t\t{\r\n\t\t\treturn {\r\n\t\t\t\tsource: null,\r\n\t\t\t\tlength: 3,\r\n\t\t\t}\r\n\t\t});\r\n\t\ti.dispose();\r\n\t});\r\n\r\n});\r\n\r\n\r\nit(\"should throw for invalid step\", ()=>\r\n{\r\n\r\n\tassert.throws(()=>\r\n\t{\r\n\t\tvar i = new IndexEnumerator(()=>\r\n\t\t{\r\n\t\t\treturn {\r\n\t\t\t\tsource: a,\r\n\t\t\t\tpointer: 1,\r\n\t\t\t\tlength: 3,\r\n\t\t\t\tstep: 0\r\n\t\t\t}\r\n\t\t});\r\n\t\ti.moveNext();\r\n\t});\r\n\r\n\tassert.throws(()=>\r\n\t{\r\n\t\tvar i = new IndexEnumerator(()=>\r\n\t\t{\r\n\t\t\treturn {\r\n\t\t\t\tsource: a,\r\n\t\t\t\tpointer: 1,\r\n\t\t\t\tlength: 3,\r\n\t\t\t\tstep: 1.2\r\n\t\t\t}\r\n\t\t});\r\n\t\ti.moveNext();\r\n\t});\r\n});\r\n\r\nit(\"should throw for invalid pointer\", ()=>\r\n{\r\n\r\n\tassert.throws(()=>\r\n\t{\r\n\t\tvar i = new IndexEnumerator(()=>\r\n\t\t{\r\n\t\t\treturn {\r\n\t\t\t\tsource: a,\r\n\t\t\t\tpointer: 1.3,\r\n\t\t\t\tlength: 3,\r\n\t\t\t\tstep: 1\r\n\t\t\t}\r\n\t\t});\r\n\t\ti.moveNext();\r\n\t});\r\n\r\n});\r\n\r\nit(\"should throw for invalid length\", ()=>\r\n{\r\n\r\n\tassert.throws(()=>\r\n\t{\r\n\t\tvar i = new IndexEnumerator(()=>\r\n\t\t{\r\n\t\t\treturn {\r\n\t\t\t\tsource: a,\r\n\t\t\t\tpointer: 1,\r\n\t\t\t\tlength: -1,\r\n\t\t\t\tstep: 1\r\n\t\t\t}\r\n\t\t});\r\n\t\ti.moveNext();\r\n\t});\r\n\r\n});\r\n\r\nit(\"should enumerate by 1 with no step\",()=>{\r\n\r\n\r\n\tvar a = [0,1,2,3,4];\r\n\tvar len = a.length, count = 0;\r\n\tvar test = new IndexEnumerator(()=>\r\n\t{\r\n\t\treturn {\r\n\t\t\tsource: [0,1,2,3,4],\r\n\t\t\tlength: 5,\r\n\t\t}\r\n\t});\r\n\tvar last:number = null;\r\n\twhile(test.moveNext()) {\r\n\t\tcount++;\r\n\t\tlast = test.current;\r\n\t}\r\n\tassert.equal(count,len);\r\n\tassert.equal(last,4);\r\n\ttest.dispose();\r\n});"]} \ No newline at end of file diff --git a/tests/mocha/System/Collections/ICollection.js b/tests/mocha/System/Collections/ICollection.js index fb57bb2a..395ec89c 100644 --- a/tests/mocha/System/Collections/ICollection.js +++ b/tests/mocha/System/Collections/ICollection.js @@ -140,4 +140,5 @@ } exports.InstanceCollection = InstanceCollection; }); -//# sourceMappingURL=ICollection.js.map \ No newline at end of file + +//# sourceMappingURL=ICollection.js.map diff --git a/tests/mocha/System/Collections/ICollection.js.map b/tests/mocha/System/Collections/ICollection.js.map index a8d743f1..f1d7a5ee 100644 --- a/tests/mocha/System/Collections/ICollection.js.map +++ b/tests/mocha/System/Collections/ICollection.js.map @@ -1 +1 @@ -{"version":3,"file":"ICollection.js","sourceRoot":"","sources":["ICollection.ts"],"names":[],"mappings":";;;;;;;;;IAGA,IAAY,EAAE,WAAM,qDAAqD,CAAC,CAAA;IAC1E,wCAAoC,8DAA8D,CAAC,CAAA;IACnG,IAAI,MAAM,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAM/D,iBACC,UAA8B;QAE9B,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAE7B,QAAQ,CAAC,QAAQ,EAAE;YAElB,cAAc,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACJ,CAAC;IATe,eAAO,UAStB,CAAA;IAED,wBAAwB,KAAS,EAAE,OAA0C;QAA1C,uBAA0C,GAA1C,mCAA0C;QAE5E,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,sBAAyB,CAAgB,EAAE,CAAK;QAE/C,EAAE,CAAC,aAAa,EAAE;YAEjB,IAAI,KAAY,CAAC;YACjB,GAAG,CAAA,CAAU,UAAC,EAAD,OAAC,EAAD,eAAC,EAAD,IAAC,CAAC;gBAAX,IAAI,CAAC,UAAA;gBAER,cAAc,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;gBACjD,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;gBACT,cAAc,CAAC,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;gBACxC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,+BAA+B,CAAC,CAAC;gBAClE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAA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S,EAAE,UAAU,EAAE;YAC9C,CAAC;YACD,CAAC;YACD,CAAC;YACD,CAAC;YACD,CAAC;YACD,CAAC;YACD,CAAC;YACD,GAAG;SACH,CAAC,CAAC;IAGJ,CAAC;IAjBe,wBAAgB,mBAiB/B,CAAA;IAED,4BACC,IAAW,EACX,UAA8B;QAE9B,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,UAAU,CAAC,IAAI,GAAG,GAAG,GAAG,SAAS,EAAE,UAAU,EAAE;YAC9C,SAAS;YACT,EAAE;YACF,MAAM;YACN,EAAE;YACF,MAAM;SACN,CAAC,CAAA;IACH,CAAC;IAbe,0BAAkB,qBAajC,CAAA","file":"System/Collections/ICollection.js","sourcesContent":["///\r\n///\r\n\r\nimport * as AU from \"../../../../source/System/Collections/Array/Utility\";\r\nimport NotImplementedException from \"../../../../source/System/Exceptions/NotImplementedException\";\r\nvar assert = require('../../../../node_modules/assert/assert');\r\n\r\n/*\r\n * This is a reusable set of unit test for use with any ICollection to ensure all features of that ICollection function properly.\r\n */\r\n\r\nexport function General(\r\n\tcollection:ICollection):void\r\n{\r\n\tvar count = collection.count;\r\n\r\n\tdescribe(\".count\", ()=>\r\n\t{\r\n\t\tassertIsNumber(count);\r\n\t});\r\n}\r\n\r\nfunction assertIsNumber(value:any, message:string = \"should be a real number\")\r\n{\r\n\tassert.ok(!isNaN(value), message);\r\n}\r\n\r\nfunction assertAdding(c:ICollection, a:T[])\r\n{\r\n\tit(\".add(value)\", ()=>\r\n\t{\r\n\t\tvar count:number;\r\n\t\tfor(let v of a)\r\n\t\t{\r\n\t\t\tassertIsNumber(count = c.count, \"before adding\");\r\n\t\t\tc.add(v);\r\n\t\t\tassertIsNumber(c.count, \"after adding\");\r\n\t\t\tassert.equal(c.count, count + 1, \"count should have incremented\");\r\n\t\t\tassert.ok(c.contains(v), \"'value' must exist after adding\");\r\n\t\t}\r\n\t});\r\n}\r\n\r\nfunction assertCopyToClear(c:ICollection)\r\n{\r\n\tit(\".copyTo(other) & .clear()\", ()=>\r\n\t{\r\n\t\tvar count:number = c.count;\r\n\t\tassertIsNumber(count);\r\n\t\tif(count<2) throw \"Can't assert '.copyTo()' or '.clear()' without at least (2) entries.\";\r\n\r\n\t\tvar a:T[] = [];\r\n\r\n\t\tc.copyTo(a);\r\n\t\tassertIsNumber(c.count, 'count');\r\n\t\tassert.equal(a.length, count, \"An empty array's length should match the count if copied to.\");\r\n\t\tc.clear();\r\n\t\tassert.equal(c.count, 0, \"A collection's count should be zero after calling '.clear()'.\");\r\n\r\n\t\t// Restore contents.\r\n\t\tfor(let v of a) c.add(v);\r\n\r\n\t\tvar extraSize = 10;\r\n\t\tvar b = AU.initialize(count + extraSize);\r\n\r\n\t\tc.copyTo(b, 1);\r\n\t\tassert.equal(b.length, count + extraSize, \"An array's length should be equal to it's original length if the count added does not exceed the length.\");\r\n\t\tc.copyTo(b, count + extraSize - 1);\r\n\t\tassert.equal(b.length, 2*count + extraSize - 1, \"An array's length should be equal to index+count if the count exceeds the length.\");\r\n\t\tc.clear();\r\n\t\tassert.equal(c.count, 0, \"A collection's count should be zero after calling '.clear()'.\");\r\n\r\n\t\t// Restore contents.\r\n\t\tfor(let v of a) c.add(v);\r\n\t\tassert.equal(c.count, a.length, \"A collection's count should be equal to the number of items added.\");\r\n\t});\r\n\r\n}\r\n\r\nfunction assertRemoving(c:ICollection)\r\n{\r\n\tit(\".remove(values)\", ()=>\r\n\t{\r\n\r\n\t\tvar count:number;\r\n\t\tassertIsNumber(count = c.count);\r\n\t\tif(c.count<2) throw \"Can't assert '.remove()' without at least (2) entries.\";\r\n\r\n\t\tvar a:T[] = [];\r\n\t\tc.copyTo(a);\r\n\t\tassertIsNumber(c.count);\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tfor(let v of a)\r\n\t\t\t{\r\n\t\t\t\tcount -= c.remove(v); // More than one instance can exist and it should remove both.\r\n\t\t\t\tassertIsNumber(c.count, \"after removing\");\r\n\t\t\t\tassert.equal(c.count, count, \"'count' should increment after removing.\");\r\n\t\t\t\tassert.ok(!c.contains(v), \"'value' must not exist after removing.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(ex)\r\n\t\t{\r\n\t\t\tif((ex)instanceof(NotImplementedException))\r\n\t\t\t{\r\n\t\t\t\t//console.log(ex);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tthrow ex;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n}\r\n\r\nexport function Collection(\r\n\tname:string,\r\n\tcollection:ICollection,\r\n\tsourceValues:T[]):void\r\n{\r\n\tif(sourceValues.indexOf(null)!= -1)\r\n\t\tthrow \"Source values should not contain null as checking against null is one of the tests.\";\r\n\r\n\t/* The following tests inherently test:\r\n\t - count\r\n\t - contains\r\n\t */\r\n\tdescribe(name, ()=>\r\n\t{\r\n\t\tassertAdding(collection, sourceValues);\r\n\t\tassertCopyToClear(collection);\r\n\t\tassertRemoving(collection);\r\n\t\tit(\"equality comparison should be strict\", ()=>\r\n\t\t{\r\n\t\t\tassert.ok(!collection.contains(null));\r\n\t\t})\r\n\r\n\t});\r\n\r\n}\r\n\r\nexport function StringCollection(\r\n\tname:string,\r\n\tcollection:ICollection):void\r\n{\r\n\r\n\t//noinspection SpellCheckingInspection\r\n\tCollection(name + '<' + 'string>', collection, [\r\n\t\t\"\",\r\n\t\t\"lorem\",\r\n\t\t\"ipsum\",\r\n\t\t\"dolem\",\r\n\t\t\"ipsum\" // Have a repeated entry to test removing multiple.\r\n\t])\r\n\r\n\r\n}\r\n\r\nexport function NumberCollection(\r\n\tname:string,\r\n\tcollection:ICollection):void\r\n{\r\n\t//noinspection SpellCheckingInspection\r\n\tCollection(name + '<' + 'number>', collection, [\r\n\t\t0,\r\n\t\t1,\r\n\t\t1, // Have a repeated entry to test removing multiple.\r\n\t\t2,\r\n\t\t3,\r\n\t\t5,\r\n\t\t8,\r\n\t\tNaN // Must be able to reconginze NaN\r\n\t]);\r\n\r\n\r\n}\r\n\r\nexport function InstanceCollection(\r\n\tname:string,\r\n\tcollection:ICollection):void\r\n{\r\n\tvar repeat = {};\r\n\t//noinspection SpellCheckingInspection\r\n\tCollection(name + '<' + 'Object>', collection, [\r\n\t\tundefined,\r\n\t\t{},\r\n\t\trepeat,\r\n\t\t{},\r\n\t\trepeat // Have a repeated entry to test removing multiple.\r\n\t])\r\n}\r\n\r\n"]} \ No newline at end of file diff --git a/tests/mocha/System/Collections/LinkedList.js b/tests/mocha/System/Collections/LinkedList.js index 86f123db..bd248c81 100644 --- a/tests/mocha/System/Collections/LinkedList.js +++ b/tests/mocha/System/Collections/LinkedList.js @@ -43,4 +43,5 @@ }); }); }); -//# sourceMappingURL=LinkedList.js.map \ No newline at end of file + +//# sourceMappingURL=LinkedList.js.map diff --git a/tests/mocha/System/Collections/LinkedList.js.map b/tests/mocha/System/Collections/LinkedList.js.map index 820e9e93..da07f6a8 100644 --- a/tests/mocha/System/Collections/LinkedList.js.map +++ b/tests/mocha/System/Collections/LinkedList.js.map @@ -1 +1 @@ -{"version":3,"file":"LinkedList.js","sourceRoot":"","sources":["LinkedList.ts"],"names":[],"mappings":";;;;;;;;;IAEA,IAAY,gBAAgB,WAAM,eAAe,CAAC,CAAA;IAClD,2BAAuB,kDAAkD,CAAC,CAAA;IAC1E,wBAAuB,qDAAqD,CAAC,CAAA;IAC7E,IAAI,MAAM,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAE/D,IAAM,UAAU,GAAG,YAAY,CAAC;IAChC,gBAAgB,CAAC,gBAAgB,CAAC,UAAU,EAAC,IAAI,oBAAU,EAAU,CAAC,CAAC;IACvE,gBAAgB,CAAC,gBAAgB,CAAC,UAAU,EAAC,IAAI,oBAAU,EAAU,CAAC,CAAC;IACvE,gBAAgB,CAAC,kBAAkB,CAAC,UAAU,EAAC,IAAI,oBAAU,EAAU,CAAC,CAAC;IAEzE,QAAQ,CAAC,wBAAwB,EAAE;QAElC,IAAI,KAAK,GAAY,CAAC,CAAC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,IAAI,GAAC,CAAC,EAAE,MAAM,CAAC,CAAC;YAC7B,MAAM,CAAC,EAAE,CAAC,kBAAQ,CAAC,YAAY,EAAC,KAAK,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAE,CAAC;QAC3D,CAAC,CAAC,CAAC;IAGJ,CAAC,CAAC,CAAC","file":"System/Collections/LinkedList.js","sourcesContent":["///\r\n\r\nimport * as ICollectionTests from \"./ICollection\";\r\nimport LinkedList from \"../../../../source/System/Collections/LinkedList\";\r\nimport {areEqual} from \"../../../../source/System/Collections/Array/Compare\";\r\nvar assert = require('../../../../node_modules/assert/assert');\r\n\r\nconst CLASS_NAME = 'LinkedList';\r\nICollectionTests.StringCollection(CLASS_NAME,new LinkedList());\r\nICollectionTests.NumberCollection(CLASS_NAME,new LinkedList());\r\nICollectionTests.InstanceCollection(CLASS_NAME,new LinkedList());\r\n\r\ndescribe('.addAfter & .addBefore', ()=>\r\n{\r\n\tvar part1:number[] = [1,2,3], part2:number[] = [5,6,7];\r\n\tvar parts = part1.concat(part2), len1 = parts.length;\r\n\tvar list = new LinkedList(parts);\r\n\tvar list1 = list.toArray();\r\n\tvar count1 = list.count;\r\n\r\n\tvar partsSpliced = part1.concat([4]).concat(part2);\r\n\tvar len2 = partsSpliced.length;\r\n\tlist.find(5).addBefore(4);\r\n\tvar count2 = list.count;\r\n\tvar list2 = list.toArray();\r\n\tlist.find(6).addAfter(6.5);\r\n\tvar count3 = list.count;\r\n\tvar list3 = list.toArray();\r\n\r\n\r\n\t\r\n\tit('should match expected initial count', ()=>\r\n\t{\r\n\t\tassert.equal(len1, count1);\r\n\t\tassert.ok(areEqual(parts,list1));\r\n\t});\r\n\r\n\tit('should match expected count after inserting before', ()=>\r\n\t{\r\n\t\tassert.equal(len2, count2);\r\n\t\tassert.ok(areEqual(partsSpliced,list2), partsSpliced.join(',') + \" != \" + list2.join(',') );\r\n\t});\r\n\r\n\tit('should match expected count after inserting after', ()=>\r\n\t{\r\n\t\tassert.equal(len2+1, count3);\r\n\t\tassert.ok(areEqual(partsSpliced,list2), list3.join(',') );\r\n\t});\r\n\r\n\r\n});"]} \ No newline at end of file diff --git a/tests/mocha/System/Collections/List.js b/tests/mocha/System/Collections/List.js index 095a1082..a89b9496 100644 --- a/tests/mocha/System/Collections/List.js +++ b/tests/mocha/System/Collections/List.js @@ -14,4 +14,5 @@ ICollectionTests.NumberCollection(CLASS_NAME, new List_1.default()); ICollectionTests.InstanceCollection(CLASS_NAME, new List_1.default()); }); -//# sourceMappingURL=List.js.map \ No newline at end of file + +//# sourceMappingURL=List.js.map diff --git a/tests/mocha/System/Collections/List.js.map b/tests/mocha/System/Collections/List.js.map index d3a656d0..6cfd781f 100644 --- a/tests/mocha/System/Collections/List.js.map +++ b/tests/mocha/System/Collections/List.js.map @@ -1 +1 @@ -{"version":3,"file":"List.js","sourceRoot":"","sources":["List.ts"],"names":[],"mappings":";;;;;;;;;IAEA,IAAY,gBAAgB,WAAM,eAAe,CAAC,CAAA;IAClD,qBAAiB,4CAA4C,CAAC,CAAA;IAE9D,IAAM,UAAU,GAAG,MAAM,CAAC;IAE1B,gBAAgB,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,cAAI,EAAU,CAAC,CAAC;IAClE,gBAAgB,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,cAAI,EAAU,CAAC,CAAC;IAClE,gBAAgB,CAAC,kBAAkB,CAAC,UAAU,EAAE,IAAI,cAAI,EAAU,CAAC,CAAC"} \ No newline at end of file +{"version":3,"sources":["System/Collections/List.ts"],"names":[],"mappings":";;;;;;;;;IAEA,IAAY,gBAAgB,WAAM,eAAe,CAAC,CAAA;IAClD,qBAAiB,4CAA4C,CAAC,CAAA;IAE9D,IAAM,UAAU,GAAG,MAAM,CAAC;IAE1B,gBAAgB,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,cAAI,EAAU,CAAC,CAAC;IAClE,gBAAgB,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,cAAI,EAAU,CAAC,CAAC;IAClE,gBAAgB,CAAC,kBAAkB,CAAC,UAAU,EAAE,IAAI,cAAI,EAAU,CAAC,CAAC","file":"System/Collections/List.js","sourcesContent":["///\r\n\r\nimport * as ICollectionTests from \"./ICollection\";\r\nimport List from \"../../../../source/System/Collections/List\";\r\n\r\nconst CLASS_NAME = 'List';\r\n\r\nICollectionTests.StringCollection(CLASS_NAME, new List());\r\nICollectionTests.NumberCollection(CLASS_NAME, new List());\r\nICollectionTests.InstanceCollection(CLASS_NAME, new List());"]} \ No newline at end of file diff --git a/tests/mocha/System/Collections/OrderedStringKeyDictionary.js b/tests/mocha/System/Collections/OrderedStringKeyDictionary.js index 879ee625..eb9198fd 100644 --- a/tests/mocha/System/Collections/OrderedStringKeyDictionary.js +++ b/tests/mocha/System/Collections/OrderedStringKeyDictionary.js @@ -18,4 +18,5 @@ { key: 'F', value: 6 } ]); }); -//# sourceMappingURL=OrderedStringKeyDictionary.js.map \ No newline at end of file + +//# sourceMappingURL=OrderedStringKeyDictionary.js.map diff --git a/tests/mocha/System/Collections/OrderedStringKeyDictionary.js.map b/tests/mocha/System/Collections/OrderedStringKeyDictionary.js.map index cfdcebf2..10c5c25f 100644 --- a/tests/mocha/System/Collections/OrderedStringKeyDictionary.js.map +++ b/tests/mocha/System/Collections/OrderedStringKeyDictionary.js.map @@ -1 +1 @@ -{"version":3,"file":"OrderedStringKeyDictionary.js","sourceRoot":"","sources":["OrderedStringKeyDictionary.ts"],"names":[],"mappings":";;;;;;;;;IACA,IAAY,gBAAgB,WAAM,eAAe,CAAC,CAAA;IAClD,2CAAuC,+EAA+E,CAAC,CAAA;IAEvH,gBAAgB,CAAC,UAAU,CAC1B,oCAAoC,EACpC,IAAI,oCAA0B,EAAU,EACxC;QACC,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAC;QACpB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAC;QACpB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAC;QACpB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAC;QACpB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAC;QACpB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAC;KACpB,CAAC,CAAC"} \ No newline at end of file +{"version":3,"sources":["System/Collections/OrderedStringKeyDictionary.ts"],"names":[],"mappings":";;;;;;;;;IACA,IAAY,gBAAgB,WAAM,eAAe,CAAC,CAAA;IAClD,2CAAuC,+EAA+E,CAAC,CAAA;IAEvH,gBAAgB,CAAC,UAAU,CAC1B,oCAAoC,EACpC,IAAI,oCAA0B,EAAU,EACxC;QACC,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAC;QACpB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAC;QACpB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAC;QACpB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAC;QACpB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAC;QACpB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAC;KACpB,CAAC,CAAC","file":"System/Collections/OrderedStringKeyDictionary.js","sourcesContent":["/// \r\nimport * as ICollectionTests from './ICollection';\r\nimport OrderedStringKeyDictionary from '../../../../source/System/Collections/Dictionaries/OrderedStringKeyDictionary';\r\n\r\nICollectionTests.Collection>(\r\n\t'OrderedStringKeyDictionary',\r\n\tnew OrderedStringKeyDictionary(),\r\n\t[\r\n\t\t{key: 'A', value: 1},\r\n\t\t{key: 'B', value: 2},\r\n\t\t{key: 'C', value: 3},\r\n\t\t{key: 'D', value: 4},\r\n\t\t{key: 'E', value: 5},\r\n\t\t{key: 'F', value: 6}\r\n\t]);\r\n"]} \ No newline at end of file diff --git a/tests/mocha/System/Collections/Queue.js b/tests/mocha/System/Collections/Queue.js index 97c971fe..01a7dcc4 100644 --- a/tests/mocha/System/Collections/Queue.js +++ b/tests/mocha/System/Collections/Queue.js @@ -13,4 +13,5 @@ ICollectionTests.NumberCollection('Queue', new Queue_1.default()); ICollectionTests.InstanceCollection('Queue', new Queue_1.default()); }); -//# sourceMappingURL=Queue.js.map \ No newline at end of file + +//# sourceMappingURL=Queue.js.map diff --git a/tests/mocha/System/Collections/Queue.js.map b/tests/mocha/System/Collections/Queue.js.map index feb60257..70749243 100644 --- a/tests/mocha/System/Collections/Queue.js.map +++ b/tests/mocha/System/Collections/Queue.js.map @@ -1 +1 @@ -{"version":3,"file":"Queue.js","sourceRoot":"","sources":["Queue.ts"],"names":[],"mappings":";;;;;;;;;IAAA,IAAY,gBAAgB,WAAM,eAAe,CAAC,CAAA;IAClD,sBAAkB,6CAA6C,CAAC,CAAA;IAEhE,gBAAgB,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,eAAK,EAAU,CAAC,CAAC;IAChE,gBAAgB,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,eAAK,EAAU,CAAC,CAAC;IAChE,gBAAgB,CAAC,kBAAkB,CAAC,OAAO,EAAE,IAAI,eAAK,EAAU,CAAC,CAAC"} \ No newline at end of file +{"version":3,"sources":["System/Collections/Queue.ts"],"names":[],"mappings":";;;;;;;;;IAAA,IAAY,gBAAgB,WAAM,eAAe,CAAC,CAAA;IAClD,sBAAkB,6CAA6C,CAAC,CAAA;IAEhE,gBAAgB,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,eAAK,EAAU,CAAC,CAAC;IAChE,gBAAgB,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,eAAK,EAAU,CAAC,CAAC;IAChE,gBAAgB,CAAC,kBAAkB,CAAC,OAAO,EAAE,IAAI,eAAK,EAAU,CAAC,CAAC","file":"System/Collections/Queue.js","sourcesContent":["import * as ICollectionTests from './ICollection';\r\nimport Queue from '../../../../source/System/Collections/Queue';\r\n\r\nICollectionTests.StringCollection('Queue', new Queue());\r\nICollectionTests.NumberCollection('Queue', new Queue());\r\nICollectionTests.InstanceCollection('Queue', new Queue());\r\n"]} \ No newline at end of file diff --git a/tests/mocha/System/Collections/Set.js b/tests/mocha/System/Collections/Set.js index fb60a2b4..8def722a 100644 --- a/tests/mocha/System/Collections/Set.js +++ b/tests/mocha/System/Collections/Set.js @@ -144,4 +144,5 @@ }); }); }); -//# sourceMappingURL=Set.js.map \ No newline at end of file + +//# sourceMappingURL=Set.js.map diff --git a/tests/mocha/System/Collections/Set.js.map b/tests/mocha/System/Collections/Set.js.map index 8e8c208d..b8882ac3 100644 --- a/tests/mocha/System/Collections/Set.js.map +++ b/tests/mocha/System/Collections/Set.js.map @@ -1 +1 @@ -{"version":3,"file":"Set.js","sourceRoot":"","sources":["Set.ts"],"names":[],"mappings":";;;;;;;;;IAGA,IAAY,gBAAgB,WAAM,eAAe,CAAC,CAAA;IAClD,oBAAgB,2CAA2C,CAAC,CAAA;IAC5D,IAAI,MAAM,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAG/D,gBAAgB,CAAC,UAAU,CAAC,MAAM,GAAG,SAAS,EAAE,IAAI,aAAG,EAAU,EAAE;QAClE,EAAE;QACF,OAAO;QACP,OAAO;QACP,OAAO;KACP,CAAC,CAAC;IAEH,gBAAgB,CAAC,UAAU,CAAC,MAAM,GAAG,SAAS,EAAE,IAAI,aAAG,EAAU,EAAE;QAClE,CAAC;QACD,CAAC;QACD,CAAC;QACD,CAAC;QACD,CAAC;QACD,CAAC;QACD,EAAE;QACF,EAAE;KACF,CAAC,CAAC;IAGH,gBAAgB,CAAC,UAAU,CAAC,MAAM,GAAG,YAAY,EAAE,IAAI,aAAG,EAAa,EAAE;QACxE,CAAC;QACD,CAAC;QACD,CAAC;QACD,CAAC;QACD,CAAC;QACD,CAAC;QACD,EAAE;QACF,EAAE;QAC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AQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC;YAC1C,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;YACnC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IAEJ,CAAC,CAAC,CAAC","file":"System/Collections/Set.js","sourcesContent":["///\r\n///\r\n\r\nimport * as ICollectionTests from \"./ICollection\";\r\nimport Set from \"../../../../source/System/Collections/Set\";\r\nvar assert = require('../../../../node_modules/assert/assert');\r\n\r\n//noinspection SpellCheckingInspection\r\nICollectionTests.Collection('Set<' + 'string>', new Set(), [\r\n\t\"\",\r\n\t\"lorem\",\r\n\t\"ipsum\",\r\n\t\"dolem\"\r\n]);\r\n\r\nICollectionTests.Collection('Set<' + 'number>', new Set(), [\r\n\t0,\r\n\t1,\r\n\t2,\r\n\t3,\r\n\t5,\r\n\t7,\r\n\t11,\r\n\t13\r\n]);\r\n\r\n\r\nICollectionTests.Collection('Set<' + 'Primitive>', new Set(), [\r\n\t0,\r\n\t1,\r\n\t2,\r\n\t3,\r\n\t5,\r\n\t7,\r\n\t11,\r\n\t13,\r\n\t\"\",\r\n\t\"0\",\r\n\t\"1\",\r\n\t\"2\",\r\n\t\"3\",\r\n\t\"5\",\r\n\t\"7\",\r\n\t\"11\",\r\n\t\"13\",\r\n\ttrue,\r\n\tfalse\r\n\r\n]);\r\n\r\nvar sourcePrimitives = [\r\n\t1, 2, 1, \"1\", true, false, \"hello\", \"hello\", \"hi\", true\r\n];\r\nvar subset = sourcePrimitives.slice(4);\r\nvar superset = sourcePrimitives.slice();\r\nsuperset.push(\"NO\");\r\nvar otherWithIntersect = [1,\"1\",4000,\"goodbye\"];\r\n\r\n\r\nit(\"should not repeat entries\", ()=>\r\n{\r\n\tvar s = new Set(sourcePrimitives);\r\n\r\n\tassert.equal(s.count, 7);\r\n\r\n});\r\n\r\n\r\ndescribe(\".setEquals()\", ()=>\r\n{\r\n\r\n\tit(\"the current set should equal to the same set and not equal for different sets\", ()=>\r\n\t{\r\n\t\tvar s = new Set(sourcePrimitives);\r\n\t\tvar v = sourcePrimitives.slice();\r\n\t\tv[8] = \"hola\";\r\n\r\n\t\tassert.equal(s.setEquals(sourcePrimitives), true, \"Exact same set should be equal.\");\r\n\t\tassert.equal(s.setEquals(subset), false, \"Smaller set should not be equal.\");\r\n\t\tassert.equal(s.setEquals(superset), false, \"Larger set should not be a equal.\");\r\n\t\tassert.equal(s.setEquals(v), false, \"Similar set should not be a equal.\");\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".isSupersetOf()\", ()=>\r\n{\r\n\r\n\tit(\"the current set should be a super set of any equal or smaller set\", ()=>\r\n\t{\r\n\t\tvar s = new Set(sourcePrimitives);\r\n\r\n\t\tassert.equal(s.isSupersetOf(sourcePrimitives), true, \"Exact same set should be a superset and subset.\");\r\n\t\tassert.equal(s.isSupersetOf(subset), true, \"Smaller set should be a subset.\");\r\n\t\tassert.equal(s.isSupersetOf(superset), false, \"Larger set should not be a subset.\");\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".isProperSupersetOf()\", ()=>\r\n{\r\n\r\n\tit(\"the current set should be a super set of any smaller matching set\", ()=>\r\n\t{\r\n\t\tvar s = new Set(sourcePrimitives);\r\n\r\n\t\tassert.equal(s.isProperSupersetOf(sourcePrimitives), false, \"Exact same set should not be a proper superset or subset.\");\r\n\t\tassert.equal(s.isProperSupersetOf(subset), true, \"Smaller set should be a subset.\");\r\n\t\tassert.equal(s.isProperSupersetOf(superset), false, \"Larger set should not be a subset.\");\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".isSubsetOf()\", ()=>\r\n{\r\n\r\n\tit(\"the current set should be a sub set of any equal or larger matching set\", ()=>\r\n\t{\r\n\t\tvar s = new Set(sourcePrimitives);\r\n\r\n\t\tassert.equal(s.isSubsetOf(sourcePrimitives), true, \"Exact same set should be a superset and subset.\");\r\n\t\tassert.equal(s.isSubsetOf(subset), false, \"Smaller set should be a subset.\");\r\n\t\tassert.equal(s.isSubsetOf(superset), true, \"Larger set should be a superset.\");\r\n\t});\r\n\r\n});\r\n\r\n\r\ndescribe(\".isProperSubsetOf()\", ()=>\r\n{\r\n\r\n\tit(\"the current set should be a sub set of any larger matching set\", ()=>\r\n\t{\r\n\t\tvar s = new Set(sourcePrimitives);\r\n\r\n\t\tassert.equal(s.isProperSubsetOf(sourcePrimitives), false, \"Exact same set should not be a proper superset or subset.\");\r\n\t\tassert.equal(s.isProperSubsetOf(subset), false, \"Smaller set should be a subset.\");\r\n\t\tassert.equal(s.isProperSubsetOf(superset), true, \"Larger set should be a superset.\");\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".exceptWith()\", ()=>\r\n{\r\n\r\n\tit(\"should remove the specified items fromt the set\", ()=>\r\n\t{\r\n\t\tvar s = new Set(sourcePrimitives);\r\n\t\ts.exceptWith([1,\"1\"]);\r\n\r\n\t\tassert.equal(s.count, 5);\r\n\t\tassert.equal(s.contains(1), false);\r\n\t\tassert.equal(s.contains(\"1\"), false);\r\n\t\tassert.equal(s.contains(\"hello\"), true);\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".intersectWith()\", ()=>\r\n{\r\n\r\n\tit(\"should only leave the intersecting items behind\", ()=>\r\n\t{\r\n\t\tvar s = new Set(sourcePrimitives);\r\n\t\ts.intersectWith(otherWithIntersect);\r\n\r\n\t\tassert.equal(s.count, 2);\r\n\t\tassert.equal(s.contains(1), true);\r\n\t\tassert.equal(s.contains(\"1\"), true);\r\n\t\tassert.equal(s.contains(\"hello\"), false);\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".unionWith()\", ()=>\r\n{\r\n\r\n\tit(\"should only leave the intersecting items behind\", ()=>\r\n\t{\r\n\t\tvar s = new Set(sourcePrimitives);\r\n\t\tvar c = s.count;\r\n\t\ts.unionWith(otherWithIntersect);\r\n\r\n\t\tassert.equal(s.count, c+2);\r\n\t\tassert.equal(s.contains(4000), true);\r\n\t\tassert.equal(s.contains(\"goodbye\"), true);\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\".symmetricExceptWith()\", ()=>\r\n{\r\n\r\n\tit(\"should only leave unique items behind\", ()=>\r\n\t{\r\n\t\tvar s = new Set(sourcePrimitives);\r\n\t\tvar c = s.count;\r\n\t\ts.symmetricExceptWith(otherWithIntersect);\r\n\r\n\t\tassert.equal(s.count, c-2+2);\r\n\t\tassert.equal(s.contains(4000), true);\r\n\t\tassert.equal(s.contains(\"goodbye\"), true);\r\n\t\tassert.equal(s.contains(1), false);\r\n\t\tassert.equal(s.contains(\"1\"), false);\r\n\t});\r\n\r\n});"]} \ No newline at end of file diff --git a/tests/mocha/System/Diagnostics/Stopwatch.js b/tests/mocha/System/Diagnostics/Stopwatch.js index 1942c53b..89c133ed 100644 --- a/tests/mocha/System/Diagnostics/Stopwatch.js +++ b/tests/mocha/System/Diagnostics/Stopwatch.js @@ -38,4 +38,5 @@ assert.ok(!sw.isRunning); }); }); -//# sourceMappingURL=Stopwatch.js.map \ No newline at end of file + +//# sourceMappingURL=Stopwatch.js.map diff --git a/tests/mocha/System/Diagnostics/Stopwatch.js.map b/tests/mocha/System/Diagnostics/Stopwatch.js.map index 06b2f463..4839d853 100644 --- a/tests/mocha/System/Diagnostics/Stopwatch.js.map +++ b/tests/mocha/System/Diagnostics/Stopwatch.js.map @@ -1 +1 @@ -{"version":3,"file":"Stopwatch.js","sourceRoot":"","sources":["Stopwatch.ts"],"names":[],"mappings":";;;;;;;;;IAGA,0BAAsB,iDAAiD,CAAC,CAAA;IACxE,IAAI,MAAM,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAI/D,EAAE,CAAC,0BAA0B,EAAC;QAC7B,MAAM,CAAC,EAAE,CAAC,mBAAS,CAAC,OAAO,CAAC;YAC3B,GAAG,CAAA,CAAC,IAAI,CAAC,GAAG,CAA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C;QACX,EAAE,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,mBAAmB,IAAE,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,IAAE,CAAC,CAAC,CAAC;QACzC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;QACxB,EAAE,CAAC,IAAI,EAAE,CAAC;QACV,EAAE,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;QACzB,EAAE,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;QACxB,EAAE,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC","file":"System/Diagnostics/Stopwatch.js","sourcesContent":["\r\n///\r\n\r\nimport Stopwatch from \"../../../../source/System/Diagnostics/Stopwatch\";\r\nvar assert = require('../../../../node_modules/assert/assert');\r\n\r\n\r\n\r\nit(\"should measure a closure\",()=>{\r\n\tassert.ok(Stopwatch.measure(()=>{\r\n\t\tfor(let i = 0;i<100000;i++){\r\n\t\t\tnew Array(100);\r\n\t\t}\r\n\t}).milliseconds>0);\r\n});\r\n\r\nit(\"should start, stop, and reset with isRunning correctly reflected\",()=>\r\n{\r\n\tassert.ok(Stopwatch.getTimestampMilliseconds()>0);\r\n\tvar sw = new Stopwatch();\r\n\tassert.equal(sw.elapsed.milliseconds,0);\r\n\tassert.equal(sw.lap().milliseconds,0);\r\n\tassert.equal(sw.currentLap.milliseconds,0);\r\n\tassert.equal(sw.currentLapMilliseconds,0);\r\n\tsw = Stopwatch.startNew();\r\n\tsw.start();\r\n\tsw.lap();\r\n\tassert.ok(sw.elapsedMilliseconds>=0);\r\n\tassert.ok(sw.currentLap.milliseconds>=0);\r\n\tassert.ok(sw.isRunning);\r\n\tsw.stop();\r\n\tsw.stop();\r\n\tassert.ok(!sw.isRunning);\r\n\tsw.start();\r\n\tassert.ok(sw.isRunning);\r\n\tsw.reset();\r\n\tassert.ok(!sw.isRunning);\r\n});\r\n"]} \ No newline at end of file diff --git a/tests/mocha/System/Disposable/ObjectPool.js b/tests/mocha/System/Disposable/ObjectPool.js index 277d0fe4..f2dd097a 100644 --- a/tests/mocha/System/Disposable/ObjectPool.js +++ b/tests/mocha/System/Disposable/ObjectPool.js @@ -11,4 +11,5 @@ var assert = require('../../../../node_modules/assert/assert'); var pool = new ObjectPool_1.default(40, function () { return new Array(100); }); }); -//# sourceMappingURL=ObjectPool.js.map \ No newline at end of file + +//# sourceMappingURL=ObjectPool.js.map diff --git a/tests/mocha/System/Disposable/ObjectPool.js.map b/tests/mocha/System/Disposable/ObjectPool.js.map index d23ab9b3..6396def1 100644 --- a/tests/mocha/System/Disposable/ObjectPool.js.map +++ b/tests/mocha/System/Disposable/ObjectPool.js.map @@ -1 +1 @@ -{"version":3,"file":"ObjectPool.js","sourceRoot":"","sources":["ObjectPool.ts"],"names":[],"mappings":";;;;;;;;;IAEA,2BAAuB,iDAAiD,CAAC,CAAA;IACzE,IAAI,MAAM,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAE/D,IAAM,IAAI,GAAG,IAAI,oBAAU,CAAC,EAAE,EAAE,cAAI,OAAA,IAAI,KAAK,CAAM,GAAG,CAAC,EAAnB,CAAmB,CAAC,CAAC"} \ No newline at end of file +{"version":3,"sources":["System/Disposable/ObjectPool.ts"],"names":[],"mappings":";;;;;;;;;IAEA,2BAAuB,iDAAiD,CAAC,CAAA;IACzE,IAAI,MAAM,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAE/D,IAAM,IAAI,GAAG,IAAI,oBAAU,CAAC,EAAE,EAAE,cAAI,OAAA,IAAI,KAAK,CAAM,GAAG,CAAC,EAAnB,CAAmB,CAAC,CAAC","file":"System/Disposable/ObjectPool.js","sourcesContent":["///\r\n\r\nimport ObjectPool from \"../../../../source/System/Disposable/ObjectPool\";\r\nvar assert = require('../../../../node_modules/assert/assert');\r\n\r\nconst pool = new ObjectPool(40, ()=>new Array(100));\r\n\r\n\r\n\r\n/*\r\nimport Stopwatch from \"../../../../source/System/Diagnostics/Stopwatch\";\r\nfunction fake(o:any) {}\r\nconst TRIES:number = 1000;\r\ndescribe(\"should be performant\", ()=>\r\n{\r\n\tvar n1:number, n2:number;\r\n\tit((n1=Stopwatch.measure(()=>\r\n\t\t{\r\n\t\t\tvar a:any[], b:any[];\r\n\t\t\tfor(let i = 0; i(100);\r\n\t\t\t\tb = new Array(100);\r\n\t\t\t\tfake(a);\r\n\t\t\t\tfake(b);\r\n\t\t\t}\r\n\r\n\t\t}).milliseconds) + \" milliseconds using new only\", ()=>\r\n\t{\r\n\t\tassert.ok(true);\r\n\t});\r\n\r\n\tit((n2=Stopwatch.measure(()=>\r\n\t\t{\r\n\t\t\tvar a:any[], b:any[];\r\n\t\t\tfor(let i = 0; i\r\n\t{\r\n\t\tassert.ok(true);\r\n\t});\r\n\r\n\t// if(n1\r\n\r\nimport Integer from \"../../../source/System/Integer\";\r\nvar assert = require('../../../node_modules/assert/assert');\r\n\r\n\r\nconst TEST_FLOAT = 10.915, TEST_INT = 10, MAX = 9007199254740991;\r\n\r\ndescribe('(value)', ()=>\r\n{\r\n\tit('should convert float number to integer without rounding', ()=>\r\n\t{\r\n\t\tassert.equal(\r\n\t\t\tInteger(TEST_FLOAT),\r\n\t\t\tTEST_INT);\r\n\t});\r\n});\r\n\r\ndescribe('.as32Bit(value)', ()=>\r\n{\r\n\tit('should convert float number to integer without rounding', ()=>\r\n\t{\r\n\t\tassert.equal(\r\n\t\t\tInteger.as32Bit(TEST_FLOAT),\r\n\t\t\tTEST_INT);\r\n\t});\r\n\r\n\tit('should return null if not 32', ()=>\r\n\t{\r\n\t\tassert.equal(\r\n\t\t\tInteger.as32Bit(MAX),\r\n\t\t\tnull);\r\n\t});\r\n});\r\n\r\ndescribe('.is(value)', ()=>\r\n{\r\n\tit('should detect a number that is not an integer', ()=>\r\n\t{\r\n\t\tfunction baseTests(fn:(n:number)=>boolean):void {\r\n\r\n\t\t\tassert.equal(\r\n\t\t\t\tfn(\"1\"),\r\n\t\t\t\tfalse);\r\n\r\n\t\t\tassert.equal(\r\n\t\t\t\tfn(\"test\"),\r\n\t\t\t\tfalse);\r\n\r\n\t\t\tassert.equal(\r\n\t\t\t\tfn(NaN),\r\n\t\t\t\tfalse);\r\n\r\n\t\t\tassert.equal(\r\n\t\t\t\tfn(Infinity),\r\n\t\t\t\tfalse);\r\n\r\n\t\t\tassert.equal(\r\n\t\t\t\tfn(-Infinity),\r\n\t\t\t\tfalse);\r\n\r\n\t\t\tassert.equal(\r\n\t\t\t\tfn(TEST_FLOAT),\r\n\t\t\t\tfalse);\r\n\r\n\t\t\tassert.equal(\r\n\t\t\t\tfn(-TEST_FLOAT),\r\n\t\t\t\tfalse);\r\n\t\t}\r\n\r\n\t\tbaseTests(Integer.is);\r\n\t\tbaseTests(Integer.is32Bit);\r\n\r\n\t\tassert.equal(\r\n\t\t\tInteger.is32Bit(Integer.MAX_32_BIT+1),\r\n\t\t\tfalse);\r\n\t});\r\n\r\n\tit('should detect a number that is an integer', ()=>\r\n\t{\r\n\t\tfunction baseTests(fn:(n:number)=>boolean):void {\r\n\r\n\t\t\tassert.equal(\r\n\t\t\t\tfn(-0),\r\n\t\t\t\ttrue);\r\n\r\n\t\t\tassert.equal(\r\n\t\t\t\tfn(-TEST_INT),\r\n\t\t\t\ttrue);\r\n\r\n\t\t\tassert.equal(\r\n\t\t\t\tfn(TEST_INT),\r\n\t\t\t\ttrue);\r\n\r\n\t\t\tassert.equal(\r\n\t\t\t\tfn(Integer.MAX_32_BIT),\r\n\t\t\t\ttrue);\r\n\r\n\t\t\tassert.equal(\r\n\t\t\t\tfn(-Integer.MAX_32_BIT),\r\n\t\t\t\ttrue);\r\n\t\t}\r\n\r\n\t\tbaseTests(Integer.is);\r\n\t\tbaseTests(Integer.is32Bit);\r\n\r\n\t\tassert.equal(\r\n\t\t\tInteger.is(Integer.MAX_32_BIT+1),\r\n\t\t\ttrue);\r\n\r\n\t\tassert.equal(\r\n\t\t\tInteger.is(-MAX),\r\n\t\t\ttrue);\r\n\r\n\t\tassert.equal(\r\n\t\t\tInteger.is(MAX),\r\n\t\t\ttrue);\r\n\r\n\t});\r\n});\r\n\r\n\r\ndescribe('.assert(value)', ()=>\r\n{\r\n\tit('should detect a number that is not an integer', ()=>\r\n\t{\r\n\t\tassert.throws(()=>\r\n\t\t{\r\n\t\t\tInteger.assert(TEST_FLOAT);\r\n\t\t});\r\n\t});\r\n\r\n\tit('should detect a number that is an integer', ()=>\r\n\t{\r\n\t\tassert.equal(\r\n\t\t\tInteger.assert(TEST_INT),\r\n\t\t\ttrue);\r\n\t});\r\n});\r\n"]} \ No newline at end of file diff --git a/tests/mocha/System/Tasks/TaskHandler.js b/tests/mocha/System/Tasks/TaskHandler.js index cc48b617..1a0b8025 100644 --- a/tests/mocha/System/Tasks/TaskHandler.js +++ b/tests/mocha/System/Tasks/TaskHandler.js @@ -21,4 +21,5 @@ }); }); }); -//# sourceMappingURL=TaskHandler.js.map \ No newline at end of file + +//# sourceMappingURL=TaskHandler.js.map diff --git a/tests/mocha/System/Tasks/TaskHandler.js.map b/tests/mocha/System/Tasks/TaskHandler.js.map index bff12c79..cc11c6e0 100644 --- a/tests/mocha/System/Tasks/TaskHandler.js.map +++ b/tests/mocha/System/Tasks/TaskHandler.js.map @@ -1 +1 @@ -{"version":3,"file":"TaskHandler.js","sourceRoot":"","sources":["TaskHandler.ts"],"names":[],"mappings":";;;;;;;;;IAEA,4BAAwB,6CAA6C,CAAC,CAAA;IACtE,0BAAsB,qCAAqC,CAAC,CAAA;IAC5D,IAAI,MAAM,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAE/D,QAAQ,CAAC,KAAK,EAAC;QACd,EAAE,CAAC,cAAc,EAAC;YACjB,MAAM,CAAC,MAAM,CAAC;gBACb,IAAI,qBAAW,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,YAAY,CAAC;gBACnB,CAAC,IAAI,qBAAW,CAAC,mBAAS,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;YAC9C,CAAC,CAAC,CAAC;QAEJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"sources":["System/Tasks/TaskHandler.ts"],"names":[],"mappings":";;;;;;;;;IAEA,4BAAwB,6CAA6C,CAAC,CAAA;IACtE,0BAAsB,qCAAqC,CAAC,CAAA;IAC5D,IAAI,MAAM,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAE/D,QAAQ,CAAC,KAAK,EAAC;QACd,EAAE,CAAC,cAAc,EAAC;YACjB,MAAM,CAAC,MAAM,CAAC;gBACb,IAAI,qBAAW,CAAC,IAAI,CAAC,CAAC;YACvB,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,YAAY,CAAC;gBACnB,CAAC,IAAI,qBAAW,CAAC,mBAAS,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;YAC9C,CAAC,CAAC,CAAC;QAEJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC","file":"System/Tasks/TaskHandler.js","sourcesContent":["///\r\n\r\nimport TaskHandler from \"../../../../source/System/Tasks/TaskHandler\";\r\nimport Functions from \"../../../../source/System/Functions\";\r\nvar assert = require('../../../../node_modules/assert/assert');\r\n\r\ndescribe('new',()=>{\r\n\tit(\"should throw\",()=>{\r\n\t\tassert.throws(()=>{\r\n\t\t\tnew TaskHandler(null);\r\n\t\t});\r\n\t\tassert.doesNotThrow(()=>{\r\n\t\t\t(new TaskHandler(Functions.Blank)).dispose();\r\n\t\t});\r\n\r\n\t});\r\n});"]} \ No newline at end of file diff --git a/tests/mocha/System/Text/RegularExpressions.js b/tests/mocha/System/Text/RegularExpressions.js index b958941f..cf27ec3f 100644 --- a/tests/mocha/System/Text/RegularExpressions.js +++ b/tests/mocha/System/Text/RegularExpressions.js @@ -80,4 +80,5 @@ }); }); }); -//# sourceMappingURL=RegularExpressions.js.map \ No newline at end of file + +//# sourceMappingURL=RegularExpressions.js.map diff --git a/tests/mocha/System/Text/RegularExpressions.js.map b/tests/mocha/System/Text/RegularExpressions.js.map index 39932feb..272fe0b9 100644 --- a/tests/mocha/System/Text/RegularExpressions.js.map +++ b/tests/mocha/System/Text/RegularExpressions.js.map @@ -1 +1 @@ -{"version":3,"file":"RegularExpressions.js","sourceRoot":"","sources":["RegularExpressions.ts"],"names":[],"mappings":";;;;;;;;;IAEA,qCAAiC,qDAAqD,CAAC,CAAA;IACvF,mCAA2B,mDAAmD,CAAC,CAAA;IAC/E,IAAM,MAAM,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAEjE,IAAM,GAAG,GAAG,sDAAsD,CAAC;IACnE,IAAM,KAAK,GAAG,IAAI,4BAAK,CAAC,kBAAkB,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACnD,IAAM,MAAM,GAAG,IAAI,4BAAK,CAAC,YAAY,CAAC,CAAC;IACvC,IAAM,MAAM,GAAG,IAAI,4BAAK,CAAC,UAAU,CAAC,CAAC;IACrC,IAAM,MAAM,GAAG,IAAI,4BAAK,CAAC,YAAY,EAAC,GAAG,EAAC,GAAG,CAAC,CAAC;IAC/C,IAAM,OAAO,GAAG,UAAU,CAAC;IAE3B,QAAQ,CAAC,OAAO,EAAE;QAGjB,QAAQ,CAAC,KAAK,EAAE;YAEf,EAAE,CAAC,cAAc,EAAE;gBAElB,MAAM,CAAC,MAAM,CAAC,cAAI,OAAA,IAAI,4BAAK,CAAC,IAAI,CAAC,EAAf,CAAe,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,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CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC9B,CAAC;YACD,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,EAAC,OAAO,EAAC,CAAC,CAAC,CAAC;YAC/B,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,EAAC,OAAO,EAAC,EAAE,CAAC,CAAC;YAChC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAA;IACH,CAAC,CAAC,CAAC","file":"System/Text/RegularExpressions.js","sourcesContent":["///\r\n\r\nimport RegexMatchEnumerator from \"../../../../source/System/Text/RegexMatchEnumerator\";\r\nimport Regex, {Match} from \"../../../../source/System/Text/RegularExpressions\";\r\nconst assert = require('../../../../node_modules/assert/assert');\r\n\r\nconst str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\r\nconst regex = new Regex(\"(?[A-E]+)\", [\"i\"]);\r\nconst regex2 = new Regex(/([A-E]+)/im);\r\nconst regex3 = new Regex(/([A-E]+)/);\r\nconst regex4 = new Regex(/A\tB C D E/,\"i\",\"w\");\r\nconst pattern = \"([A-E]+)\";\r\n\r\ndescribe(\"Regex\", ()=>\r\n{\r\n\r\n\tdescribe(\"new\", ()=>\r\n\t{\r\n\t\tit(\"should throw\", ()=>\r\n\t\t{\r\n\t\t\tassert.throws(()=>new Regex(null));\r\n\t\t});\r\n\t});\r\n\r\n\tdescribe(\".isMatch(input)\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should indicate true for match\", ()=>\r\n\t\t{\r\n\t\t\tassert.ok(regex.isMatch(str));\r\n\t\t\tassert.ok(Regex.isMatch(str, pattern, [\"i\"]));\r\n\t\t});\r\n\r\n\t\tit(\"should indicate false for non-match\", ()=>\r\n\t\t{\r\n\t\t\tassert.ok(!regex.isMatch(\"ZYXWV\"));\r\n\t\t\tassert.ok(!Regex.isMatch(\"ZYXWV\", pattern, [\"i\"]));\r\n\t\t});\r\n\r\n\t});\r\n\r\n\tdescribe(\".match(input)\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should match correctly\", ()=>\r\n\t\t{\r\n\r\n\t\t\tvar m = regex.match(str);\r\n\t\t\tassert.equal(m.value, \"ABCDE\");\r\n\t\t\tassert.equal(m.index, 0);\r\n\t\t\tassert.equal(m.namedGroups[\"first\"].value, \"ABCDE\");\r\n\r\n\t\t\tm = regex.match(str, 20);\r\n\t\t\tassert.equal(m.value, \"abcde\");\r\n\t\t\tassert.equal(m.index, 26);\r\n\t\t\tassert.equal(m.namedGroups[\"first\"].value, \"abcde\");\r\n\t\t});\r\n\r\n\t});\r\n\r\n\tdescribe(\".matches(input)\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should capture all instances\", ()=>\r\n\t\t{\r\n\t\t\tfunction check(m:Match[]):void {\r\n\t\t\t\tassert.equal(m.length, 2);\r\n\t\t\t\tassert.equal(m[0].value, \"ABCDE\");\r\n\t\t\t\tassert.equal(m[0].index, 0);\r\n\t\t\t\tassert.equal(m[1].value, \"abcde\");\r\n\t\t\t\tassert.equal(m[1].index, 26);\r\n\t\t\t}\r\n\t\t\tcheck(regex.matches(str));\r\n\t\t\tcheck(regex4.matches(str));\r\n\t\t});\r\n\r\n\t});\r\n\r\n\tdescribe(\".replace(input, x)\", ()=>\r\n\t{\r\n\r\n\t\tit(\"should replace requested instances\", ()=>\r\n\t\t{\r\n\t\t\t//noinspection SpellCheckingInspection\r\n\t\t\tassert.equal(regex.replace(str, \"XXX\"), \"XXXFGHIJKLMNOPQRSTUVWXYZXXXfghijklmnopqrstuvwxyz\");\r\n\t\t\tassert.equal(Regex.replace(str, pattern, \"XXX\",['i']), \"XXXFGHIJKLMNOPQRSTUVWXYZXXXfghijklmnopqrstuvwxyz\");\r\n\t\t\t//noinspection SpellCheckingInspection\r\n\t\t\tassert.equal(regex.replace(str, \"\"), \"FGHIJKLMNOPQRSTUVWXYZfghijklmnopqrstuvwxyz\");\r\n\t\t\tassert.equal(regex.replace(str, null), str);\r\n\t\t\t//noinspection SpellCheckingInspection\r\n\t\t\tassert.equal(regex.replace(str, (x,i)=>i), \"0FGHIJKLMNOPQRSTUVWXYZ1fghijklmnopqrstuvwxyz\");\r\n\t\t});\r\n\r\n\t});\r\n\r\n});\r\n\r\ndescribe(\"RegexMatchEnumerator\",()=>{\r\n\tit(\"should enumerate properly\",()=>{\r\n\t\tvar m = RegexMatchEnumerator(str,regex);\r\n\t\tfunction check(v:Match, value:string, index:number):void{\r\n\t\t\tassert.equal(v.value, value);\r\n\t\t\tassert.equal(v.index, index);\r\n\t\t}\r\n\t\tcheck(m.nextValue(),\"ABCDE\",0);\r\n\t\tcheck(m.nextValue(),\"abcde\",26);\r\n\t\tassert.ok(!m.moveNext());\r\n\t})\r\n});\r\n"]} \ No newline at end of file diff --git a/tests/mocha/System/Text/Utility.js b/tests/mocha/System/Text/Utility.js index 8948399a..5df2ded5 100644 --- a/tests/mocha/System/Text/Utility.js +++ b/tests/mocha/System/Text/Utility.js @@ -36,4 +36,5 @@ }); }); }); -//# sourceMappingURL=Utility.js.map \ No newline at end of file + +//# sourceMappingURL=Utility.js.map diff --git a/tests/mocha/System/Text/Utility.js.map b/tests/mocha/System/Text/Utility.js.map index 8f756404..5878d47d 100644 --- a/tests/mocha/System/Text/Utility.js.map +++ b/tests/mocha/System/Text/Utility.js.map @@ -1 +1 @@ -{"version":3,"file":"Utility.js","sourceRoot":"","sources":["Utility.ts"],"names":[],"mappings":";;;;;;;;;IAEA,IAAI,MAAM,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAE/D,IAAY,WAAW,WAAM,wCAAwC,CAAC,CAAA;IAEtE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAClB,IAAI,EAAE,GAAG,cAAc,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAC;QAClB,EAAE,CAAC,8DAA8D,EAAC;YACjE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE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,EAAE,CAAC,qCAAqC,EAAC;YACxC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAChC,qDAAqD,EAAC,EAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,CAAC,EAAC,EAAE,EAAC,CAAC,EACzF,iEAAiE,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC","file":"System/Text/Utility.js","sourcesContent":["///\r\n\r\nvar assert = require('../../../../node_modules/assert/assert');\r\n\r\nimport * as TextUtility from \"../../../../source/System/Text/Utility\";\r\n\r\nvar s1 = \"\t HI \";\r\nvar s2 = \".-.-xHIX//\\\\\";\r\ndescribe('.trim()',()=>{\r\n\tit(\"should leave a string without leading or trailing whitespace\",()=>{\r\n\t\tassert.equal(TextUtility.trim(s1),\"HI\");\r\n\t});\r\n\tit(\"should leave a string without leading or trailing trim characters (string)\",()=>{\r\n\t\tassert.equal(TextUtility.trim(s2,\".-/\\\\x\",true),\"HI\");\r\n\t});\r\n\r\n\tit(\"should leave a string without leading or trailing trim characters (array)\",()=>{\r\n\t\tassert.equal(TextUtility.trim(s2,[\".\",\"-\",\"/\",\"\\\\\",\"x\",\"X\"]),\"HI\");\r\n\t});\r\n\r\n\tit(\"should leave a string untouched if no trim characters\",()=>{\r\n\t\tassert.equal(TextUtility.trim(s2,\"\"),s2);\r\n\t});\r\n});\r\n\r\ndescribe(\".format(source,..args)\",()=>{\r\n\tit(\"should replace contents of a string\",()=>{\r\n\t\tassert.equal(TextUtility.format(\r\n\t\t\t\"Hello, my name is {0} and I'm number {length}.\",\"George\",2),\r\n\t\t\t\"Hello, my name is George and I'm number 2.\");\r\n\t});\r\n});\r\n\r\ndescribe(\".supplant(source,..args)\",()=>{\r\n\tit(\"should replace contents of a string\",()=>{\r\n\t\tassert.equal(TextUtility.supplant(\r\n\t\t\t\"Hello, my name is {name} and I like {like}. {x} {y}\",{name:\"George\",like:\"cheese\",x:{}}),\r\n\t\t\t\"Hello, my name is George and I like cheese. [object Object] {y}\");\r\n\t});\r\n});"]} \ No newline at end of file diff --git a/tests/mocha/System/Time/ClockTime.js b/tests/mocha/System/Time/ClockTime.js index e4686b30..bfd41d0d 100644 --- a/tests/mocha/System/Time/ClockTime.js +++ b/tests/mocha/System/Time/ClockTime.js @@ -31,4 +31,5 @@ assert.equal(c2.millisecond, millisecond); }); }); -//# sourceMappingURL=ClockTime.js.map \ No newline at end of file + +//# sourceMappingURL=ClockTime.js.map diff --git a/tests/mocha/System/Time/ClockTime.js.map b/tests/mocha/System/Time/ClockTime.js.map index 45027c00..a6837dbe 100644 --- a/tests/mocha/System/Time/ClockTime.js.map +++ b/tests/mocha/System/Time/ClockTime.js.map @@ -1 +1 @@ -{"version":3,"file":"ClockTime.js","sourceRoot":"","sources":["ClockTime.ts"],"names":[],"mappings":";;;;;;;;;IAGA,0BAAsB,0CAA0C,CAAC,CAAA;IACjE,wBAAoB,mCAAmC,CAAC,CAAA;IACxD,IAAI,MAAM,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAE/D,IACA,IAAI,GAAU,iBAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EACjC,IAAI,GAAU,iBAAO,CAAC,MAAM,CAAC,EAAE,CAAC,EAChC,MAAM,GAAQ,iBAAO,CAAC,MAAM,CAAC,EAAE,CAAC,EAChC,MAAM,GAAQ,iBAAO,CAAC,MAAM,CAAC,EAAE,CAAC,EAChC,WAAW,GAAG,iBAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEnC,IAAI,EAAE,GAAG,IAAI,mBAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1D,IAAI,EAAE,GAAG,IAAI,mBAAS,CACrB,IAAI,GAAC,QAA4B;UAC/B,IAAI,GAAC,OAA6B;UAClC,MAAM,GAAC,KAA+B;UACtC,MAAM,GAAC,IAA+B;UACtC,WAAW,CAAC,CAAC;IAEhB,EAAE,CA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C,CAAC;IAEnC,IAAI,EAAE,GAAG,IAAI,mBAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IAC1D,IAAI,EAAE,GAAG,IAAI,mBAAS,CACrB,IAAI,GAAC,QAA4B;UAC/B,IAAI,GAAC,OAA6B;UAClC,MAAM,GAAC,KAA+B;UACtC,MAAM,GAAC,IAA+B;UACtC,WAAW,CAAC,CAAC;IAEhB,EAAE,CAAC,iCAAiC,EAAE;QAErC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC5B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4BAA4B,EAAE;QAEhC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC5B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC5B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC","file":"System/Time/ClockTime.js","sourcesContent":["///\r\n///\r\n\r\nimport ClockTime from \"../../../../source/System/Time/ClockTime\";\r\nimport Integer from \"../../../../source/System/Integer\";\r\nvar assert = require('../../../../node_modules/assert/assert');\r\n\r\nconst\r\ndays = Integer.random(365),\r\nhour = Integer.random(24),\r\nminute = Integer.random(60),\r\nsecond = Integer.random(60),\r\nmillisecond = Integer.random(1000);\r\n\r\nvar c1 = new ClockTime(hour, minute, second, millisecond);\r\nvar c2 = new ClockTime(\r\n\tdays*HowMany.Milliseconds.Per.Day\r\n\t+ hour*HowMany.Milliseconds.Per.Hour\r\n\t+ minute*HowMany.Milliseconds.Per.Minute\r\n\t+ second*HowMany.Milliseconds.Per.Second\r\n\t+ millisecond);\r\n\r\nit('should match constructor values', ()=>\r\n{\r\n\tassert.equal(c1.hour, hour);\r\n\tassert.equal(c1.minute, minute);\r\n\tassert.equal(c1.second, second);\r\n\tassert.equal(c1.millisecond, millisecond);\r\n});\r\n\r\nit('should match summed values', ()=>\r\n{\r\n\tassert.equal(c2.days, days);\r\n\tassert.equal(c2.hour, hour);\r\n\tassert.equal(c2.minute, minute);\r\n\tassert.equal(c2.second, second);\r\n\tassert.equal(c2.millisecond, millisecond);\r\n});\r\n"]} \ No newline at end of file diff --git a/tests/mocha/System/Time/DateTime.js b/tests/mocha/System/Time/DateTime.js index 21b97b78..ca45bb59 100644 --- a/tests/mocha/System/Time/DateTime.js +++ b/tests/mocha/System/Time/DateTime.js @@ -39,4 +39,5 @@ }); }); }); -//# sourceMappingURL=DateTime.js.map \ No newline at end of file + +//# sourceMappingURL=DateTime.js.map diff --git a/tests/mocha/System/Time/DateTime.js.map b/tests/mocha/System/Time/DateTime.js.map index b5b984b1..829dc14b 100644 --- a/tests/mocha/System/Time/DateTime.js.map +++ b/tests/mocha/System/Time/DateTime.js.map @@ -1 +1 @@ -{"version":3,"file":"DateTime.js","sourceRoot":"","sources":["DateTime.ts"],"names":[],"mappings":";;;;;;;;;IAEA,yBAAqB,yCAAyC,CAAC,CAAA;IAC/D,IAAI,MAAM,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAK/D,QAAQ,CAAC,8CAA8C,EAAC;QAGvD,IAAM,SAAS,GAAG,IAAI,CAAC;QACvB,IAAM,YAAY,GAAG;YACpB,EAAE;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AAE,CAAC,uCAAuC,EAAE;YAE3C,GAAG,CAAA,CAAC,IAAI,CAAC,GAAC,SAAS,EAAC,CAAC,GAAC,IAAI,EAAC,CAAC,EAAE,EAAE,CAAC;gBAChC,GAAG,CAAA,CAAC,IAAI,CAAC,GAAC,CAAC,EAAC,CAAC,GAAC,EAAE,EAAC,CAAC,EAAE,EAAE,CAAC;oBACtB,EAAE,CAAA,CAAC,CAAC,IAAE,CAAC,IAAI,kBAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBACnC,MAAM,CAAC,KAAK,CAAC,kBAAQ,CAAC,WAAW,CAAC,CAAC,EAAC,CAAC,CAAC,EAAC,EAAE,CAAC,CAAC;oBAC5C,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACP,MAAM,CAAC,KAAK,CAAC,kBAAQ,CAAC,WAAW,CAAC,CAAC,EAAC,CAAC,CAAC,EAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;oBACzD,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC,CAAC,CAAC;IAEJ,CAAC,CAAC,CAAC","file":"System/Time/DateTime.js","sourcesContent":["///\r\n\r\nimport DateTime from '../../../../source/System/Time/DateTime';\r\nvar assert = require('../../../../node_modules/assert/assert');\r\n\r\n\r\n\r\n\r\ndescribe(\".daysInMonth(year,month) & .isLeapYear(year)\",()=>{\r\n\r\n\r\n\tconst startYear = 2000;\r\n\tconst daysPerMonth = [\r\n\t\t31, //January,\r\n\t\t28,//February,\r\n\t\t31,//March,\r\n\t\t30,//April,\r\n\t\t31,//May,\r\n\t\t30,//June,\r\n\t\t31,//July,\r\n\t\t31,//August,\r\n\t\t30,//September,\r\n\t\t31,//October,\r\n\t\t30,//November,\r\n\t\t31//December\r\n\t];\r\n\r\n\tit('should match actual Gregorian values.', ()=>\r\n\t{\r\n\t\tfor(let y=startYear;y<2004;y++) {\r\n\t\t\tfor(let m=0;m<12;m++) {\r\n\t\t\t\tif(m==1 && DateTime.isLeapYear(y)) {\r\n\t\t\t\t\tassert.equal(DateTime.daysInMonth(y,m),29);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tassert.equal(DateTime.daysInMonth(y,m),daysPerMonth[m]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n});\r\n\r\n"]} \ No newline at end of file diff --git a/tests/mocha/System/Uri/Uri.js b/tests/mocha/System/Uri/Uri.js index aee09930..2f06936c 100644 --- a/tests/mocha/System/Uri/Uri.js +++ b/tests/mocha/System/Uri/Uri.js @@ -199,4 +199,5 @@ }); }); }); -//# sourceMappingURL=Uri.js.map \ No newline at end of file + +//# sourceMappingURL=Uri.js.map diff --git a/tests/mocha/System/Uri/Uri.js.map b/tests/mocha/System/Uri/Uri.js.map index c3bdb947..f86f998a 100644 --- a/tests/mocha/System/Uri/Uri.js.map +++ b/tests/mocha/System/Uri/Uri.js.map @@ -1 +1 @@ -{"version":3,"file":"Uri.js","sourceRoot":"","sources":["Uri.ts"],"names":[],"mappings":";;;;;;;;;IAEA,oBAAgB,mCAAmC,CAAC,CAAA;IACpD,uBAAmB,sCAAsC,CAAC,CAAA;IAC1D,0BAAsB,qCAAqC,CAAC,CAAA;IAC5D,IAAI,MAAM,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC;IAE/D,IAAM,aAAa,GAAE,oBAAoB,CAAC;IAC1C,IAAM,IAAI,GAAG,GAAG,GAAC,aAAa,CAAC;IAC/B,IAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAC,MAAM,CAAC,EAAC,CAAC,KAAK,EAAC,OAAO,CAAC,CAAC,CAAC;IACjD,IAAM,KAAK,GAAG,GAAG,GAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAC,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAGhE,IAAI,CAAC,GAAG,aAAG,CAAC,IAAI,CAAC,IAAI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C,CAAC,MAAM,EAAC,CAAC,CAAC,QAAQ,EAAC,CAAC,CAAC,IAAI,EAAC,CAAC,CAAC,IAAI,EAAC,CAAC,CAAC,IAAI,EAAC,CAAC,CAAC,WAAW,CAAC,CAAC;YAE3E,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IAIJ,CAAC,CAAC,CAAC","file":"System/Uri/Uri.js","sourcesContent":["///\r\n\r\nimport Uri from \"../../../../source/System/Uri/Uri\";\r\nimport Scheme from \"../../../../source/System/Uri/Scheme\";\r\nimport Functions from \"../../../../source/System/Functions\";\r\nvar assert = require('../../../../node_modules/assert/assert');\r\n\r\nconst pathAfterRoot= 'one/two/three.html';\r\nconst path = '/'+pathAfterRoot;\r\nconst params = [['four','five'],['six','seven']];\r\nconst query = '?'+params[0].join('=')+'&' + params[1].join('=');\r\n\r\n\r\nvar u = Uri.from(path + query);\r\n\r\ndescribe('.scheme', ()=>\r\n{\r\n\tit('should equal',()=>\r\n\t{\r\n\t\tassert.equal((new Uri(null,'','',null,'',null)).scheme,null);\r\n\t\tassert.equal((new Uri(\"http\",'','',null,'',null)).scheme,\"http\");\r\n\t\tassert.equal((new Uri(Scheme.http,'','',null,'',null)).scheme,\"http\");\r\n\t});\r\n\r\n\tit('should throw',()=>\r\n\t{\r\n\t\tassert.throws(()=>{new Uri(64,'','',null,'',null);});\r\n\t});\r\n});\r\n\r\ndescribe('.port', ()=>\r\n{\r\n\tit('should equal',()=>\r\n\t{\r\n\t\tvar d = 'x.com', port = 80;\r\n\t\tassert.equal((new Uri(null,'',d,0,'',null)).port,0);\r\n\t\tassert.equal((new Uri(null,'',d,null,'',null)).port,null);\r\n\t\tassert.equal((new Uri(null,'',d,'','',null)).port,null);\r\n\t\tassert.equal((new Uri(null,'',d,NaN,'',null)).port,null);\r\n\t\tassert.equal((new Uri(null,'',d,port,'',null)).port,port);\r\n\t\tassert.equal((new Uri(null,'',d,(port+''),'',null)).port,port);\r\n\t});\r\n\tit('should throw',()=>\r\n\t{\r\n\t\tassert.throws(()=>{new Uri(null,'','','foo','',null);});\r\n\t\tassert.throws(()=>{new Uri(null,'','',{},'',null);});\r\n\t\tassert.throws(()=>{new Uri(null,'','',-1,'',null);});\r\n\t\tassert.throws(()=>{new Uri(null,'','',Infinity,'',null);});\r\n\t});\r\n\r\n});\r\n\r\ndescribe('.path', ()=>\r\n{\r\n\tit('should equal ' + path, ()=>\r\n\t{\r\n\t\tassert.equal(u.path, path);\r\n\t\tassert.equal((new Uri(null,null,null,null,pathAfterRoot)).path, pathAfterRoot);\r\n\t\tassert.equal(Uri.toString({\r\n\t\t\tpath:pathAfterRoot,\r\n\t\t\tfragment:'#x'\r\n\t\t}), pathAfterRoot+\"#x\");\r\n\t});\r\n\r\n\tit('should allow null',()=>\r\n\t{\r\n\t\tassert.equal((new Uri(null,'','',null,'',null)).path,null);\r\n\t\tassert.equal((new Uri(Scheme.http,'','',null,'',null)).path,null);\r\n\t\tassert.equal((new Uri('http','','',null,'',null)).path,null);\r\n\t});\r\n});\r\n\r\ndescribe('.fragment', ()=>\r\n{\r\n\tit('should equal', ()=>\r\n\t{\r\n\t\tassert.equal(u.path, path);\r\n\t});\r\n\r\n\tit('should allow null',()=>\r\n\t{\r\n\t\tassert.equal((new Uri(null,'','',null,'',null)).path,null);\r\n\t\tassert.equal((new Uri(Scheme.http,'','',null,'',null)).path,null);\r\n\t\tassert.equal((new Uri('http','','',null,'',null)).path,null);\r\n\t});\r\n});\r\n\r\ndescribe('.from(uri)', ()=>\r\n{\r\n\tit('should be equal', ()=>\r\n\t{\r\n\t\tvar c1 = Uri.from(u);\r\n\t\tassert.ok(u.equals(c1));\r\n\r\n\t\tvar c2 = Uri.from({},u);\r\n\t\tassert.ok(u.equals(c2));\r\n\r\n\t});\r\n});\r\n\r\ndescribe('.updateQuery(query)', ()=>\r\n{\r\n\tit('should be equal', ()=>\r\n\t{\r\n\t\tvar c = u.updateQuery(\"x=y\");\r\n\t\tassert.equal(c.queryParams[\"x\"],\"y\");\r\n\t});\r\n});\r\n\r\ndescribe('.pathSegments', ()=>\r\n{\r\n\tit('should be equal', ()=>\r\n\t{\r\n\t\tassert.equal(u.pathSegments.join(''),u.path);\r\n\t});\r\n});\r\n\r\ndescribe('.getAuthority(uri)', ()=>\r\n{\r\n\tit('should be equal', ()=>\r\n\t{\r\n\t\tassert.equal(Uri.getAuthority({host:'a',port:80,userInfo:'b',path:'xxx'}),\"//b@a:80\");\r\n\t\tassert.equal(Uri.getAuthority({host:'a',port:80,path:'xxx'}),\"//a:80\");\r\n\t\tassert.equal(Uri.getAuthority({host:'a',userInfo:'b',path:'xxx'}),\"//b@a\");\r\n\t\tassert.equal(Uri.getAuthority({host:'a'}),\"//a\");\r\n\t});\r\n\r\n\tit('should throw', ()=>\r\n\t{\r\n\t\tassert.throws(()=>{\r\n\t\t\tUri.getAuthority({userInfo:'b'});\r\n\t\t});\r\n\t\tassert.throws(()=>{\r\n\t\t\tUri.getAuthority({port:80});\r\n\t\t});\r\n\t});\r\n\r\n});\r\n\r\ndescribe('.copyOf(), .copyTo() & .equals()',()=>{\r\n\tit('should equal the copy',()=>{\r\n\t\tassert.ok(u.equals(Uri.copyOf(u)));\r\n\t\tassert.ok(u.equals(u.copyTo({})));\r\n\t});\r\n});\r\n\r\ndescribe('.parse(url)',()=>{\r\n\tit('should throw',()=>{\r\n\t\tassert.throws(()=>Uri.parse(null,true));\r\n\t});\r\n});\r\n\r\ndescribe('.toString(uri)',()=>{\r\n\tit('should throw',()=>{\r\n\t\tassert.throws(()=>Uri.toString({\r\n\t\t\tscheme:\"http\", // Can't target a scheme when no authority is provided.\r\n\t\t\tpath:pathAfterRoot,\r\n\t\t\tfragment:'#x'\r\n\t\t}));\r\n\t});\r\n\r\n\tit('should equal',()=>{\r\n\t\tassert.equal(Uri.toString({\r\n\t\t\tscheme: \"http\",\r\n\t\t\thost:\"x.com\",\r\n\t\t\tpath: pathAfterRoot,\r\n\t\t\tfragment: '#x',\r\n\t\t}),\"http://x.com\"+path+\"#x\");\r\n\t});\r\n});\r\n\r\ndescribe('.tryParse(uri)',()=>{\r\n\tit('should return false if invalid',()=>{\r\n\t\tassert.ok(!Uri.tryParse(null,Functions.Blank));\r\n\t});\r\n\r\n\tit('should parse correctly',()=>{\r\n\t\tvar fragment = \"x##?y\",full = \"http://x.com/y/z#\"+fragment;\r\n\t\tassert.ok(Uri.tryParse(full,out=>{\r\n\t\t\tassert.equal(out.fragment,fragment);\r\n\t\t\tassert.equal(Uri.toString(out),full);\r\n\t\t}));\r\n\r\n\t\tassert.ok(Uri.tryParse(\"http://x.com/y/z?#\",out=>{\r\n\t\t\tassert.equal(out.query,undefined);\r\n\t\t\tassert.equal(out.fragment,undefined);\r\n\t\t}));\r\n\r\n\t\tassert.ok(!Uri.tryParse(\"hello//x.com/y/z#\"+fragment,Functions.Blank));\r\n\t\tassert.ok(!Uri.tryParse(\"hello://x.com/y/z#\"+fragment,Functions.Blank));\r\n\t\tassert.ok(Uri.tryParse(\" ://x.com/y/z#\"+fragment,Functions.Blank));\r\n\t\tassert.ok(Uri.tryParse(\"x.com\",out=>{\r\n\t\t\tassert.equal(out.path,undefined);\r\n\t\t}));\r\n\t\tassert.ok(Uri.tryParse(\"x.com/\",out=>{\r\n\t\t\tassert.equal(out.path,'/');\r\n\t\t}));\r\n\t\tassert.ok(Uri.tryParse(\"me@x.com/\"+fragment,out=>{\r\n\t\t\tassert.equal(out.userInfo,'me');\r\n\t\t}));\r\n\t\tassert.ok(Uri.tryParse(\"@x.com/\"+fragment,out=>{\r\n\t\t\tassert.equal(out.userInfo,undefined);\r\n\t\t}));\r\n\r\n\t\tassert.ok(Uri.tryParse(\"@x.com:80\"+fragment,out=>{\r\n\t\t\tassert.equal(out.port,80);\r\n\t\t}));\r\n\t\tassert.ok(!Uri.tryParse(\"@x.com:\"+fragment,Functions.Blank));\r\n\r\n\t\tassert.ok(!Uri.tryParse(\"\",out=>{\r\n\t\t\tassert.equal(out.scheme,undefined);\r\n\t\t\tassert.equal(out.host,undefined);\r\n\t\t\tassert.equal(out.userInfo,undefined);\r\n\t\t\tassert.equal(out.port,undefined);\r\n\t\t\tassert.equal(out.path,undefined);\r\n\t\t\tassert.equal(out.query,undefined);\r\n\t\t\tassert.equal(out.fragment,undefined);\r\n\t\t}));\r\n\t});\r\n\r\n});\r\n\r\ndescribe('.baseUri', ()=>\r\n{\r\n\tit('should equal ' + path, ()=>\r\n\t{\r\n\t\tassert.equal(u.baseUri, path);\r\n\t});\r\n});\r\n\r\ndescribe('.query', ()=>\r\n{\r\n\tit('should equal ' + query, ()=>\r\n\t{\r\n\t\tassert.equal(u.query, query);\r\n\t});\r\n});\r\n\r\n\r\n\r\ndescribe('.queryParams', ()=>\r\n{\r\n\tit('should equal contain correct values', ()=>\r\n\t{\r\n\t\tassert.equal(u.queryParams[params[0][0]], params[0][1]);\r\n\t\tassert.equal(u.queryParams[params[1][0]], params[1][1]);\r\n\t});\r\n\r\n\r\n});\r\n\r\n\r\ndescribe('KVP versus Tuple', ()=>\r\n{\r\n\r\n\tit('should be equal', ()=>\r\n\t{\r\n\t\tvar uTuples = new Uri(u.scheme,u.userInfo,u.host,u.port,u.path,params);\r\n\t\tvar uKvp = new Uri(u.scheme,u.userInfo,u.host,u.port,u.path,u.queryParams);\r\n\r\n\t\tassert.equal(uTuples.toString(),uKvp.toString());\r\n\t});\r\n\r\n\r\n\r\n});\r\n\r\n// Disabled for code coverage report\r\n// describe('es6 > babel > commonjs', ()=>\r\n// {\r\n// \tconst Uri2 = require('../../../../dist/commonjs/System/Uri/Uri').default;\r\n//\r\n// \tvar u2 = Uri2.from(path + query);\r\n//\r\n// \tdescribe('.path', ()=>\r\n// \t{\r\n// \t\tit('should equal ' + path, ()=>\r\n// \t\t{\r\n// \t\t\tassert.equal(u2.path, path);\r\n// \t\t});\r\n// \t});\r\n//\r\n// \tdescribe('.query', ()=>\r\n// \t{\r\n// \t\tit('should equal ' + query, ()=>\r\n// \t\t{\r\n// \t\t\tassert.equal(u2.query, query);\r\n// \t\t});\r\n// \t});\r\n// });\r\n"]} \ No newline at end of file diff --git a/tests/mocha/import-tests.js b/tests/mocha/import-tests.js index 44d42fe9..5a32d098 100644 --- a/tests/mocha/import-tests.js +++ b/tests/mocha/import-tests.js @@ -57,4 +57,5 @@ console.log("Importing Tests:"); importRecursive(); }); -//# sourceMappingURL=import-tests.js.map \ No newline at end of file + +//# sourceMappingURL=import-tests.js.map diff --git a/tests/mocha/import-tests.js.map b/tests/mocha/import-tests.js.map index 36bc1dea..c849e2e6 100644 --- a/tests/mocha/import-tests.js.map +++ b/tests/mocha/import-tests.js.map @@ -1 +1 @@ -{"version":3,"file":"import-tests.js","sourceRoot":"","sources":["import-tests.ts"],"names":[],"mappings":";;;;;;;;;IAEA,IAAY,EAAE,WAAM,IAAI,CAAC,CAAA;IAEzB,IAAM,IAAI,GAAG,gBAAgB,CAAC;IAE9B,oBAAoB,IAAW,EAAE,GAAW;QAE3C,MAAM,CAAC,EAAE;aACP,WAAW,CAAC,IAAI,CAAC;aACjB,MAAM,CAAC,UAAC,IAAI;YACb,OAAA,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAE,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;mBACtD,EAAE,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,MAAM,EAAE;QAD1C,CAC0C,CAAC,CAAC;IAC9C,CAAC;IAED,0BAA0B,IAAW;QAEpC,MAAM,CAAC,EAAE;aACP,WAAW,CAAC,IAAI,CAAC;aACjB,MAAM,CAAC,UAAC,IAAI,IAAG,OAAA,EAAE,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,EAA5C,CAA4C,CAAC,CAAC;IAChE,CAAC;IAED,yBAAy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OAAO,GAAG,GAAG,EAAE;gBAEvB,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,GAAG,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEJ,EAAE,CAAA,CAAC,WAAW,CAAC,CACf,CAAC;YACA,IAAI,KAAK,GAAG,UAAU,CAAC,IAAI,GAAG,OAAO,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;YAEpE,KAAK;iBACH,IAAI,EAAE;iBACN,OAAO,CAAC,UAAC,QAAQ;gBAEjB,IAAI,QAAQ,GAAG,OAAO,GAAG,GAAG,GAAG,QAAQ,CAAC;gBACxC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;gBAE3B,IAAI,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAEzC,IAAI,CAAC,GAAG;oBAEP,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC;gBAC1B,CAAC,CAAC;gBAGF,EAAE,CAAA,CAAC,KAAK,IAAE,CAAC,IAAI,IAAI,IAAE,IAAI,CAAC;oBAAC,CAAC,EAAE,CAAC;gBAC/B,IAAI;oBAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YAExB,CAAC,CAAC,CAAC;QACL,CAAC;IAEF,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAChC,eAAe,EAAE,CAAC","file":"import-tests.js","sourcesContent":["///\r\n\r\nimport * as fs from \"fs\";\r\n\r\nconst root = \"./tests/mocha/\";\r\n\r\nfunction getFilesAt(path:string, ext?:string):string[]\r\n{\r\n\treturn fs\r\n\t\t.readdirSync(path)\r\n\t\t.filter((name)=>\r\n\t\t(!ext || name.lastIndexOf(ext)==name.length - ext.length)\r\n\t\t&& fs.statSync(path + '/' + name).isFile());\r\n}\r\n\r\nfunction getDirectoriesAt(path:string):string[]\r\n{\r\n\treturn fs\r\n\t\t.readdirSync(path)\r\n\t\t.filter((name)=>fs.statSync(path + '/' + name).isDirectory());\r\n}\r\n\r\nfunction importRecursive(path:string = \"\", importFiles:boolean = false, base:string = \"\")\r\n{\r\n\tvar dirPath = base + path;\r\n\tif(importFiles) console.log(dirPath);\r\n\tgetDirectoriesAt(root + dirPath)\r\n\t\t.sort()\r\n\t\t.forEach((dirname)=>\r\n\t\t{\r\n\t\t\tdescribe(dirname + '/', ()=>\r\n\t\t\t{\r\n\t\t\t\timportRecursive(dirname, true, dirPath + '/');\r\n\t\t\t});\r\n\t\t});\r\n\r\n\tif(importFiles)\r\n\t{\r\n\t\tvar files = getFilesAt(root + dirPath, '.js'), count = files.length;\r\n\r\n\t\tfiles\r\n\t\t\t.sort()\r\n\t\t\t.forEach((filename)=>\r\n\t\t\t{\r\n\t\t\t\tvar filePath = dirPath + '/' + filename;\r\n\t\t\t\tconsole.log(\" \", filename);\r\n\r\n\t\t\t\tvar name = filename.replace(/\\.js$/, '');\r\n\r\n\t\t\t\tvar i = ()=>\r\n\t\t\t\t{\r\n\t\t\t\t\trequire('./' + filePath);\r\n\t\t\t\t};\r\n\r\n\t\t\t\t// Allows for simple default instead of recursive.\r\n\t\t\t\tif(count==1 && name==path) i();\r\n\t\t\t\telse describe(name, i);\r\n\r\n\t\t\t});\r\n\t}\r\n\r\n}\r\nconsole.log(\"Importing Tests:\");\r\nimportRecursive();\r\n"]} \ No newline at end of file