From ab1d6b03d0b3383eee40f4f67b8b061927ec5981 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Mon, 12 Sep 2016 01:20:04 +0900 Subject: [PATCH 01/28] TypeScript-STL v1.0.8 & Samchon-Framework v2.0 beta-8 --- samchon-framework/samchon-framework.d.ts | 1466 +++++++++++++--------- typescript-stl/typescript-stl.d.ts | 1074 +++++++++------- 2 files changed, 1484 insertions(+), 1056 deletions(-) diff --git a/samchon-framework/samchon-framework.d.ts b/samchon-framework/samchon-framework.d.ts index a6d03758dd..70d9dda38f 100644 --- a/samchon-framework/samchon-framework.d.ts +++ b/samchon-framework/samchon-framework.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Samchon Framework v2.0.0-beta.1 +// Type definitions for Samchon Framework v2.0.0-beta.8 // Project: https://github.com/samchon/framework // Definitions by: Jeongho Nam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -82,19 +82,15 @@ declare namespace samchon.collection { /** * @hidden */ - protected insert_by_repeating_val(position: std.VectorIterator, n: number, val: T): std.VectorIterator; + protected _Insert_by_repeating_val(position: std.VectorIterator, n: number, val: T): std.VectorIterator; /** * @hidden */ - protected insert_by_range>(position: std.VectorIterator, begin: InputIterator, end: InputIterator): std.VectorIterator; - /** - * @inheritdoc - */ - pop_back(): void; + protected _Insert_by_range>(position: std.VectorIterator, begin: InputIterator, end: InputIterator): std.VectorIterator; /** * @hidden */ - protected erase_by_range(first: std.VectorIterator, last: std.VectorIterator): std.VectorIterator; + protected _Erase_by_range(first: std.VectorIterator, last: std.VectorIterator): std.VectorIterator; /** * @hidden */ @@ -110,7 +106,7 @@ declare namespace samchon.collection { /** * @inheritdoc */ - dispatchEvent(event: Event): boolean; + dispatchEvent(event: library.BasicEvent): boolean; /** * @inheritdoc */ @@ -126,28 +122,28 @@ declare namespace samchon.collection { /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; + addEventListener(type: string, listener: library.BasicEventListener): void; addEventListener(type: "insert", listener: CollectionEventListener): void; addEventListener(type: "erase", listener: CollectionEventListener): void; addEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; removeEventListener(type: "insert", listener: CollectionEventListener): void; removeEventListener(type: "erase", listener: CollectionEventListener): void; removeEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; @@ -176,13 +172,9 @@ declare namespace samchon.library { * @reference https://developer.mozilla.org/en-US/docs/Web/API/Event * @author Jeongho Nam */ - class BasicEvent implements Event { - NONE: number; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; - private type_; - private target_; + class BasicEvent { + protected type_: string; + protected target_: IEventDispatcher; private currentTarget_; protected trusted_: boolean; protected bubbles_: boolean; @@ -198,7 +190,6 @@ declare namespace samchon.library { /** * @inheritdoc */ - preventDefault(): void; /** * @inheritdoc */ @@ -256,22 +247,12 @@ declare namespace samchon.library { */ returnValue: boolean; } - class ProgressEvent extends library.BasicEvent { - static PROGRESS: string; - protected numerator_: number; - protected denominator_: number; - constructor(type: string, numerator: number, denominator: number); - numerator: number; - denominator: number; - } } declare namespace samchon.collection { /** * Type of function pointer for listener of {@link CollectionEvent CollectionEvents}. */ - interface CollectionEventListener extends EventListener { - (event: CollectionEvent): void; - } + type CollectionEventListener = (event: CollectionEvent) => void; } declare namespace samchon.collection { /** @@ -281,11 +262,13 @@ declare namespace samchon.collection { /** * @hidden */ - private first_; + protected first_: std.Iterator; /** * @hidden */ - private last_; + protected last_: std.Iterator; + private temporary_container_; + private origin_first_; /** * Initialization Constructor. * @@ -298,9 +281,9 @@ declare namespace samchon.collection { constructor(type: "erase", first: std.Iterator, last: std.Iterator); constructor(type: "refresh", first: std.Iterator, last: std.Iterator); /** - * Get associative container. + * Get associative target, the container. */ - container: ICollection; + target: ICollection; /** * Get range of the first. */ @@ -309,12 +292,19 @@ declare namespace samchon.collection { * Get range of the last. */ last: std.Iterator; + /** + * @inheritdoc + */ + preventDefault(): void; } } +/** + * @hidden + */ declare namespace samchon.collection.CollectionEvent { - const INSERT: string; - const ERASE: string; - const REFRESH: string; + const INSERT: "insert"; + const ERASE: "erase"; + const REFRESH: "refresh"; } declare namespace samchon.collection { /** @@ -357,11 +347,11 @@ declare namespace samchon.collection { /** * @hidden */ - protected insert_by_repeating_val(position: std.DequeIterator, n: number, val: T): std.DequeIterator; + protected _Insert_by_repeating_val(position: std.DequeIterator, n: number, val: T): std.DequeIterator; /** * @hidden */ - protected insert_by_range>(position: std.DequeIterator, begin: InputIterator, end: InputIterator): std.DequeIterator; + protected _Insert_by_range>(position: std.DequeIterator, begin: InputIterator, end: InputIterator): std.DequeIterator; /** * @inheritdoc */ @@ -369,7 +359,7 @@ declare namespace samchon.collection { /** * @hidden */ - protected erase_by_range(first: std.DequeIterator, last: std.DequeIterator): std.DequeIterator; + protected _Erase_by_range(first: std.DequeIterator, last: std.DequeIterator): std.DequeIterator; /** * @hidden */ @@ -385,7 +375,7 @@ declare namespace samchon.collection { /** * @inheritdoc */ - dispatchEvent(event: Event): boolean; + dispatchEvent(event: library.BasicEvent): boolean; /** * @inheritdoc */ @@ -401,28 +391,28 @@ declare namespace samchon.collection { /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; + addEventListener(type: string, listener: library.BasicEventListener): void; addEventListener(type: "insert", listener: CollectionEventListener): void; addEventListener(type: "erase", listener: CollectionEventListener): void; addEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; removeEventListener(type: "insert", listener: CollectionEventListener): void; removeEventListener(type: "erase", listener: CollectionEventListener): void; removeEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; @@ -462,11 +452,11 @@ declare namespace samchon.collection { /** * @inheritdoc */ - protected handle_insert(first: std.MapIterator, last: std.MapIterator): void; + protected _Handle_insert(first: std.MapIterator, last: std.MapIterator): void; /** * @inheritdoc */ - protected handle_erase(first: std.MapIterator, last: std.MapIterator): void; + protected _Handle_erase(first: std.MapIterator, last: std.MapIterator): void; /** * @inheritdoc */ @@ -474,7 +464,7 @@ declare namespace samchon.collection { /** * @inheritdoc */ - dispatchEvent(event: Event): boolean; + dispatchEvent(event: library.BasicEvent): boolean; /** * @inheritdoc */ @@ -490,31 +480,31 @@ declare namespace samchon.collection { /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; - addEventListener(type: "insert", listener: CollectionEventListener>): void; - addEventListener(type: "erase", listener: CollectionEventListener>): void; - addEventListener(type: "refresh", listener: CollectionEventListener>): void; + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: MapCollectionEventListener): void; + addEventListener(type: "erase", listener: MapCollectionEventListener): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: CollectionEventListener>, thisArg: Object): void; - addEventListener(type: "erase", listener: CollectionEventListener>, thisArg: Object): void; - addEventListener(type: "refresh", listener: CollectionEventListener>, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; - removeEventListener(type: "insert", listener: CollectionEventListener>): void; - removeEventListener(type: "erase", listener: CollectionEventListener>): void; - removeEventListener(type: "refresh", listener: CollectionEventListener>): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: CollectionEventListener>, thisArg: Object): void; - removeEventListener(type: "erase", listener: CollectionEventListener>, thisArg: Object): void; - removeEventListener(type: "refresh", listener: CollectionEventListener>, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; } } declare namespace samchon.collection { @@ -544,11 +534,11 @@ declare namespace samchon.collection { /** * @inheritdoc */ - protected handle_insert(first: std.MapIterator, last: std.MapIterator): void; + protected _Handle_insert(first: std.MapIterator, last: std.MapIterator): void; /** * @inheritdoc */ - protected handle_erase(first: std.MapIterator, last: std.MapIterator): void; + protected _Handle_erase(first: std.MapIterator, last: std.MapIterator): void; /** * @inheritdoc */ @@ -556,7 +546,7 @@ declare namespace samchon.collection { /** * @inheritdoc */ - dispatchEvent(event: Event): boolean; + dispatchEvent(event: library.BasicEvent): boolean; /** * @inheritdoc */ @@ -572,31 +562,31 @@ declare namespace samchon.collection { /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; - addEventListener(type: "insert", listener: CollectionEventListener>): void; - addEventListener(type: "erase", listener: CollectionEventListener>): void; - addEventListener(type: "refresh", listener: CollectionEventListener>): void; + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: MapCollectionEventListener): void; + addEventListener(type: "erase", listener: MapCollectionEventListener): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: CollectionEventListener>, thisArg: Object): void; - addEventListener(type: "erase", listener: CollectionEventListener>, thisArg: Object): void; - addEventListener(type: "refresh", listener: CollectionEventListener>, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; - removeEventListener(type: "insert", listener: CollectionEventListener>): void; - removeEventListener(type: "erase", listener: CollectionEventListener>): void; - removeEventListener(type: "refresh", listener: CollectionEventListener>): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: CollectionEventListener>, thisArg: Object): void; - removeEventListener(type: "erase", listener: CollectionEventListener>, thisArg: Object): void; - removeEventListener(type: "refresh", listener: CollectionEventListener>, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; } } declare namespace samchon.collection { @@ -623,6 +613,14 @@ declare namespace samchon.collection { * A chain object taking responsibility of dispatching events. */ private event_dispatcher_; + /** + * @inheritdoc + */ + protected _Handle_insert(first: std.SetIterator, last: std.SetIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: std.SetIterator, last: std.SetIterator): void; /** * @inheritdoc */ @@ -630,7 +628,7 @@ declare namespace samchon.collection { /** * @inheritdoc */ - dispatchEvent(event: Event): boolean; + dispatchEvent(event: library.BasicEvent): boolean; /** * @inheritdoc */ @@ -646,28 +644,28 @@ declare namespace samchon.collection { /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; + addEventListener(type: string, listener: library.BasicEventListener): void; addEventListener(type: "insert", listener: CollectionEventListener): void; addEventListener(type: "erase", listener: CollectionEventListener): void; addEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; removeEventListener(type: "insert", listener: CollectionEventListener): void; removeEventListener(type: "erase", listener: CollectionEventListener): void; removeEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; @@ -701,11 +699,11 @@ declare namespace samchon.collection { /** * @inheritdoc */ - protected handle_insert(first: std.SetIterator, last: std.SetIterator): void; + protected _Handle_insert(first: std.SetIterator, last: std.SetIterator): void; /** * @inheritdoc */ - protected handle_erase(first: std.SetIterator, last: std.SetIterator): void; + protected _Handle_erase(first: std.SetIterator, last: std.SetIterator): void; /** * @inheritdoc */ @@ -713,7 +711,7 @@ declare namespace samchon.collection { /** * @inheritdoc */ - dispatchEvent(event: Event): boolean; + dispatchEvent(event: library.BasicEvent): boolean; /** * @inheritdoc */ @@ -729,28 +727,28 @@ declare namespace samchon.collection { /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; + addEventListener(type: string, listener: library.BasicEventListener): void; addEventListener(type: "insert", listener: CollectionEventListener): void; addEventListener(type: "erase", listener: CollectionEventListener): void; addEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; removeEventListener(type: "insert", listener: CollectionEventListener): void; removeEventListener(type: "erase", listener: CollectionEventListener): void; removeEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; @@ -830,32 +828,39 @@ declare namespace samchon.collection { /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; + addEventListener(type: string, listener: library.BasicEventListener): void; addEventListener(type: "insert", listener: CollectionEventListener): void; addEventListener(type: "erase", listener: CollectionEventListener): void; addEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; removeEventListener(type: "insert", listener: CollectionEventListener): void; removeEventListener(type: "erase", listener: CollectionEventListener): void; removeEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; } + /** + * @hidden + */ + namespace ICollection { + function _Dispatch_CollectionEvent(collection: ICollection, type: string, first: std.Iterator, last: std.Iterator): void; + function _Dispatch_MapCollectionEvent(collection: ICollection>, type: string, first: std.MapIterator, last: std.MapIterator): void; + } } declare namespace samchon.collection { /** @@ -908,11 +913,11 @@ declare namespace samchon.collection { /** * @hidden */ - protected insert_by_repeating_val(position: std.ListIterator, n: number, val: T): std.ListIterator; + protected _Insert_by_repeating_val(position: std.ListIterator, n: number, val: T): std.ListIterator; /** * @hidden */ - protected insert_by_range>(position: std.ListIterator, begin: InputIterator, end: InputIterator): std.ListIterator; + protected _Insert_by_range>(position: std.ListIterator, begin: InputIterator, end: InputIterator): std.ListIterator; /** * @inheritdoc */ @@ -924,7 +929,7 @@ declare namespace samchon.collection { /** * @hidden */ - protected erase_by_range(first: std.ListIterator, last: std.ListIterator): std.ListIterator; + protected _Erase_by_range(first: std.ListIterator, last: std.ListIterator): std.ListIterator; /** * @hidden */ @@ -940,7 +945,7 @@ declare namespace samchon.collection { /** * @inheritdoc */ - dispatchEvent(event: Event): boolean; + dispatchEvent(event: library.BasicEvent): boolean; /** * @inheritdoc */ @@ -956,33 +961,46 @@ declare namespace samchon.collection { /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; + addEventListener(type: string, listener: library.BasicEventListener): void; addEventListener(type: "insert", listener: CollectionEventListener): void; addEventListener(type: "erase", listener: CollectionEventListener): void; addEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; removeEventListener(type: "insert", listener: CollectionEventListener): void; removeEventListener(type: "erase", listener: CollectionEventListener): void; removeEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; } } +declare namespace samchon.collection { + type MapCollectionEventListener = (event: MapCollectionEvent) => void; + class MapCollectionEvent extends CollectionEvent> { + /** + * @inheritdoc + */ + first: std.MapIterator; + /** + * @inheritdoc + */ + last: std.MapIterator; + } +} declare namespace samchon.collection { /** * A {@link TreeMap} who can detect element I/O events. @@ -1017,11 +1035,11 @@ declare namespace samchon.collection { /** * @inheritdoc */ - protected handle_insert(first: std.MapIterator, last: std.MapIterator): void; + protected _Handle_insert(first: std.MapIterator, last: std.MapIterator): void; /** * @inheritdoc */ - protected handle_erase(first: std.MapIterator, last: std.MapIterator): void; + protected _Handle_erase(first: std.MapIterator, last: std.MapIterator): void; /** * @inheritdoc */ @@ -1029,7 +1047,7 @@ declare namespace samchon.collection { /** * @inheritdoc */ - dispatchEvent(event: Event): boolean; + dispatchEvent(event: library.BasicEvent): boolean; /** * @inheritdoc */ @@ -1045,31 +1063,31 @@ declare namespace samchon.collection { /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; - addEventListener(type: "insert", listener: CollectionEventListener>): void; - addEventListener(type: "erase", listener: CollectionEventListener>): void; - addEventListener(type: "refresh", listener: CollectionEventListener>): void; + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: MapCollectionEventListener): void; + addEventListener(type: "erase", listener: MapCollectionEventListener): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: CollectionEventListener>, thisArg: Object): void; - addEventListener(type: "erase", listener: CollectionEventListener>, thisArg: Object): void; - addEventListener(type: "refresh", listener: CollectionEventListener>, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; - removeEventListener(type: "insert", listener: CollectionEventListener>): void; - removeEventListener(type: "erase", listener: CollectionEventListener>): void; - removeEventListener(type: "refresh", listener: CollectionEventListener>): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: CollectionEventListener>, thisArg: Object): void; - removeEventListener(type: "erase", listener: CollectionEventListener>, thisArg: Object): void; - removeEventListener(type: "refresh", listener: CollectionEventListener>, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; } } declare namespace samchon.collection { @@ -1099,11 +1117,11 @@ declare namespace samchon.collection { /** * @inheritdoc */ - protected handle_insert(first: std.MapIterator, last: std.MapIterator): void; + protected _Handle_insert(first: std.MapIterator, last: std.MapIterator): void; /** * @inheritdoc */ - protected handle_erase(first: std.MapIterator, last: std.MapIterator): void; + protected _Handle_erase(first: std.MapIterator, last: std.MapIterator): void; /** * @inheritdoc */ @@ -1111,7 +1129,7 @@ declare namespace samchon.collection { /** * @inheritdoc */ - dispatchEvent(event: Event): boolean; + dispatchEvent(event: library.BasicEvent): boolean; /** * @inheritdoc */ @@ -1127,31 +1145,31 @@ declare namespace samchon.collection { /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; - addEventListener(type: "insert", listener: CollectionEventListener>): void; - addEventListener(type: "erase", listener: CollectionEventListener>): void; - addEventListener(type: "refresh", listener: CollectionEventListener>): void; + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: MapCollectionEventListener): void; + addEventListener(type: "erase", listener: MapCollectionEventListener): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: CollectionEventListener>, thisArg: Object): void; - addEventListener(type: "erase", listener: CollectionEventListener>, thisArg: Object): void; - addEventListener(type: "refresh", listener: CollectionEventListener>, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; - removeEventListener(type: "insert", listener: CollectionEventListener>): void; - removeEventListener(type: "erase", listener: CollectionEventListener>): void; - removeEventListener(type: "refresh", listener: CollectionEventListener>): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: CollectionEventListener>, thisArg: Object): void; - removeEventListener(type: "erase", listener: CollectionEventListener>, thisArg: Object): void; - removeEventListener(type: "refresh", listener: CollectionEventListener>, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; } } declare namespace samchon.collection { @@ -1181,11 +1199,11 @@ declare namespace samchon.collection { /** * @inheritdoc */ - protected handle_insert(first: std.SetIterator, last: std.SetIterator): void; + protected _Handle_insert(first: std.SetIterator, last: std.SetIterator): void; /** * @inheritdoc */ - protected handle_erase(first: std.SetIterator, last: std.SetIterator): void; + protected _Handle_erase(first: std.SetIterator, last: std.SetIterator): void; /** * @inheritdoc */ @@ -1193,7 +1211,7 @@ declare namespace samchon.collection { /** * @inheritdoc */ - dispatchEvent(event: Event): boolean; + dispatchEvent(event: library.BasicEvent): boolean; /** * @inheritdoc */ @@ -1209,28 +1227,28 @@ declare namespace samchon.collection { /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; + addEventListener(type: string, listener: library.BasicEventListener): void; addEventListener(type: "insert", listener: CollectionEventListener): void; addEventListener(type: "erase", listener: CollectionEventListener): void; addEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; removeEventListener(type: "insert", listener: CollectionEventListener): void; removeEventListener(type: "erase", listener: CollectionEventListener): void; removeEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; @@ -1261,6 +1279,14 @@ declare namespace samchon.collection { * A chain object taking responsibility of dispatching events. */ private event_dispatcher_; + /** + * @inheritdoc + */ + protected _Handle_insert(first: std.SetIterator, last: std.SetIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: std.SetIterator, last: std.SetIterator): void; /** * @inheritdoc */ @@ -1268,7 +1294,7 @@ declare namespace samchon.collection { /** * @inheritdoc */ - dispatchEvent(event: Event): boolean; + dispatchEvent(event: library.BasicEvent): boolean; /** * @inheritdoc */ @@ -1284,28 +1310,28 @@ declare namespace samchon.collection { /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; + addEventListener(type: string, listener: library.BasicEventListener): void; addEventListener(type: "insert", listener: CollectionEventListener): void; addEventListener(type: "erase", listener: CollectionEventListener): void; addEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; removeEventListener(type: "insert", listener: CollectionEventListener): void; removeEventListener(type: "erase", listener: CollectionEventListener): void; removeEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; @@ -1323,8 +1349,8 @@ declare namespace samchon.library { * *

Relationships between XML and XMLList

*
    - *
  • XML contains XMLList from dictionary of XMLList.
  • - *
  • XMLList contains XML from vector of XML.
  • + *
  • XML is std.HashMap
  • + *
  • XMLList is std.Deque
  • *
* *

Note

@@ -1337,17 +1363,28 @@ declare namespace samchon.library { * * * - * <memberList>
- *      <member id='jhnam88' name='Jeongho+Nam' birthdate='1988-03-11' />
- *      <member id='master' name='Administartor' birthdate='2011-07-28' />
- * </memberList> + * + * + * + * + * + * * * - * <member>
- *      <id>jhnam88</id>
- *      <name>Jeongho+Nam</name>
- *      <birthdate>1988-03-11</birthdate>
- * </member> + * + * + * + * jhnam88 + * Jeongho Nam + * 1988-03-11 + * + * + * master + * Administartor + * 2011-07-28 + * + * + * * * * @@ -1363,7 +1400,7 @@ declare namespace samchon.library { *
  • \<price high='1500' low='1300' open='1450' close='1320' /\>: tag => \"price\"
  • * */ - private tag; + private tag_; /** *

    Value of the XML.

    * @@ -1372,7 +1409,7 @@ declare namespace samchon.library { *
  • \: value => null
  • * */ - private value; + private value_; /** *

    Properties belongs to the XML.

    *

    A Dictionary of properties accessing each property by its key.

    @@ -1385,7 +1422,7 @@ declare namespace samchon.library { * {\"comment\", \"Hello. My name is Jeongho Nam \"}} * */ - private properties; + private property_map_; /** *

    Default Constructor.

    * @@ -1703,11 +1740,11 @@ declare namespace samchon.collection { /** * @hidden */ - protected insert_by_repeating_val(position: std.DequeIterator, n: number, val: library.XML): std.DequeIterator; + protected _Insert_by_repeating_val(position: std.DequeIterator, n: number, val: library.XML): std.DequeIterator; /** * @hidden */ - protected insert_by_range>(position: std.DequeIterator, begin: InputIterator, end: InputIterator): std.DequeIterator; + protected _Insert_by_range>(position: std.DequeIterator, begin: InputIterator, end: InputIterator): std.DequeIterator; /** * @inheritdoc */ @@ -1715,7 +1752,7 @@ declare namespace samchon.collection { /** * @hidden */ - protected erase_by_range(first: std.DequeIterator, last: std.DequeIterator): std.DequeIterator; + protected _Erase_by_range(first: std.DequeIterator, last: std.DequeIterator): std.DequeIterator; /** * @hidden */ @@ -1731,7 +1768,7 @@ declare namespace samchon.collection { /** * @inheritdoc */ - dispatchEvent(event: Event): boolean; + dispatchEvent(event: library.BasicEvent): boolean; /** * @inheritdoc */ @@ -1747,28 +1784,28 @@ declare namespace samchon.collection { /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; + addEventListener(type: string, listener: library.BasicEventListener): void; addEventListener(type: "insert", listener: CollectionEventListener): void; addEventListener(type: "erase", listener: CollectionEventListener): void; addEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; removeEventListener(type: "insert", listener: CollectionEventListener): void; removeEventListener(type: "erase", listener: CollectionEventListener): void; removeEventListener(type: "refresh", listener: CollectionEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; @@ -1887,6 +1924,7 @@ declare namespace samchon.library { } } declare namespace samchon.library { + type BasicEventListener = (event: BasicEvent) => void; /** *

    The IEventDispatcher interface defines methods for adding or removing event listeners, checks * whether specific types of event listeners are registered, and dispatches events.

    @@ -1975,7 +2013,7 @@ declare namespace samchon.library { * This function must accept an Event object as its only parameter and must return * nothing. */ - addEventListener(type: string, listener: EventListener): void; + addEventListener(type: string, listener: library.BasicEventListener): void; /** *

    Registers an event listener object with an EventDispatcher object so that the listener * receives notification of an event. You can register event listeners on all nodes in the display @@ -2020,7 +2058,7 @@ declare namespace samchon.library { * nothing. * @param thisArg The object to be used as the this object. */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; /** * Removes a listener from the EventDispatcher object. If there is no matching listener registered * with the EventDispatcher object, a call to this method has no effect. @@ -2028,7 +2066,7 @@ declare namespace samchon.library { * @param type The type of event. * @param listener The listener object to remove. */ - removeEventListener(type: string, listener: EventListener): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; /** * Removes a listener from the EventDispatcher object. If there is no matching listener registered * with the EventDispatcher object, a call to this method has no effect. @@ -2037,7 +2075,7 @@ declare namespace samchon.library { * @param listener The listener object to remove. * @param thisArg The object to be used as the this object. */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; } /** *

    Registers an event listener object with an EventDispatcher object so that the listener @@ -2091,7 +2129,7 @@ declare namespace samchon.library { /** * Container of listeners. */ - protected event_listeners_: std.HashMap>>; + protected event_listeners_: std.HashMap>>; /** * Default Constructor. */ @@ -2109,23 +2147,23 @@ declare namespace samchon.library { /** * @inheritdoc */ - dispatchEvent(event: Event): boolean; + dispatchEvent(event: library.BasicEvent): boolean; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener): void; + addEventListener(type: string, listener: library.BasicEventListener): void; /** * @inheritdoc */ - addEventListener(type: string, listener: EventListener, thisArg: Object): void; + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener): void; + removeEventListener(type: string, listener: library.BasicEventListener): void; /** * @inheritdoc */ - removeEventListener(type: string, listener: EventListener, thisArg: Object): void; + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; } } declare namespace samchon.library { @@ -2247,6 +2285,10 @@ declare namespace samchon.library { *

    */ modificationDate: Date; + /** + * @hidden + */ + _Set_file(val: File): void; /** *

    Displays a file-browsing dialog box that lets the user select a file to upload. The dialog box is native * to the user's browser system. The user can select a file on the local computer or from other systems, for @@ -2418,7 +2460,7 @@ declare namespace samchon.library { /** * Whether each element (Gene) is unique in their GeneArray. */ - private unique; + private unique_; /** * Rate of mutation. * @@ -2432,11 +2474,11 @@ declare namespace samchon.library { * * */ - private mutation_rate; + private mutation_rate_; /** * Number of tournaments in selection. */ - private tournament; + private tournament_; /** * Initialization Constructor. * @@ -2567,7 +2609,7 @@ declare namespace samchon.library { /** * Genes representing the population. */ - private children; + private children_; /** *

    A comparison function returns whether left gene is more optimal, greater.

    * @@ -2586,7 +2628,7 @@ declare namespace samchon.library { *

    If you don't want to follow the rule or want a custom comparison function, you have to realize a * comparison function.

    */ - private compare; + private compare_; /** *

    Private constructor with population.

    * @@ -2622,6 +2664,7 @@ declare namespace samchon.library { * @param compare A comparison function returns whether left gene is more optimal. */ constructor(geneArray: GeneArray, size: number, compare: (left: GeneArray, right: GeneArray) => boolean); + _Get_children(): std.Vector; /** * Test fitness of each GeneArray in the {@link population}. * @@ -2924,6 +2967,13 @@ declare namespace samchon.protocol { */ toXML(): library.XML; } + /** + * @hidden + */ + namespace IEntity { + function construct(entity: IEntity, xml: library.XML, ...prohibited_names: string[]): void; + function toXML(entity: IEntity, ...prohibited_names: string[]): library.XML; + } /** *

    An entity, a standard data class.

    * @@ -3104,7 +3154,8 @@ declare namespace samchon.protocol { /** * Close connection. */ - close(): any; + close(): void; + isConnected(): boolean; sendData(invoke: protocol.Invoke): void; replyData(invoke: protocol.Invoke): void; } @@ -3114,19 +3165,20 @@ declare namespace samchon.protocol { /** * @hidden */ - protected listener: IProtocol; + protected listener_: IProtocol; /** * @inheritdoc */ onClose: Function; + protected connected_: boolean; /** * @hidden */ - private binary_invoke; + private binary_invoke_; /** * @hidden */ - private binary_parameters; + private binary_parameters_; /** * @hidden */ @@ -3135,11 +3187,20 @@ declare namespace samchon.protocol { * Default Constructor. */ constructor(); + /** + * Construct from listener. + * + * @param listener An {@link IProtocol} object to listen {@link Invoke} messages. + */ constructor(listener: IProtocol); /** * @inheritdoc */ abstract close(): void; + /** + * @inheritdoc + */ + isConnected(): boolean; protected is_binary_invoke(): boolean; abstract sendData(invoke: Invoke): void; replyData(invoke: Invoke): void; @@ -3148,27 +3209,27 @@ declare namespace samchon.protocol { } } declare namespace samchon.protocol { - class Communicator extends CommunicatorBase { + abstract class Communicator extends CommunicatorBase { /** * @hidden */ - protected socket: socket.socket; + protected socket_: socket.socket; /** * @hidden */ - private header_bytes; + private header_bytes_; /** * @hidden */ - private data; + private data_; /** * @hidden */ - private data_index; + private data_index_; /** * @hidden */ - private listening; + private listening_; /** * @inheritdoc */ @@ -3223,11 +3284,11 @@ declare namespace samchon.protocol { * * @author Jeongho Nam */ - class WebCommunicator extends CommunicatorBase { + abstract class WebCommunicator extends CommunicatorBase { /** * Connection driver, a socket for web-socket. */ - protected connection: websocket.connection; + protected connection_: websocket.connection; /** * Close the connection. */ @@ -3249,8 +3310,8 @@ declare namespace samchon.protocol { } } declare namespace samchon.protocol { - class SharedWorkerCommunicator extends CommunicatorBase { - protected port: MessagePort; + abstract class SharedWorkerCommunicator extends CommunicatorBase { + protected port_: MessagePort; close(): void; /** * @inheritdoc @@ -3481,12 +3542,12 @@ declare namespace samchon.protocol { /** * Requested path. */ - private path; + private path_; /** * Session ID, an identifier of the remote client. */ - private session_id; - private listening; + private session_id_; + private listening_; /** * Initialization Constructor. * @@ -3556,6 +3617,11 @@ declare namespace samchon.protocol { } } declare namespace samchon.protocol { + /** + * A container of entity, and it's a type of entity, too. + * + * @author Jeongho Nam + */ interface IEntityGroup extends IEntity, std.base.IContainer { /** *

    Construct data of the Entity from an XML object.

    @@ -3578,6 +3644,7 @@ declare namespace samchon.protocol { * * @return A new child Entity belongs to EntityArray. */ + createChild(xml: library.XML): T; /** *

    Get iterator to element.

    * @@ -3644,6 +3711,24 @@ declare namespace samchon.protocol { */ toXML(): library.XML; } + /** + * @hidden + */ + namespace IEntityGroup { + /** + * @hidden + */ + function construct(entityGroup: IEntityGroup, xml: library.XML, ...prohibited_names: string[]): void; + /** + * @hidden + */ + function toXML(entityGroup: IEntityGroup, ...prohibited_names: string[]): library.XML; + function has(entityGroup: IEntityGroup, key: any): boolean; + function count(entityGroup: IEntityGroup, key: any): number; + function get(entityGroup: IEntityGroup, key: any): T; + } +} +declare namespace samchon.protocol { /** * @inheritdoc */ @@ -3653,22 +3738,13 @@ declare namespace samchon.protocol { */ construct(xml: library.XML): void; /** - *

    Factory method of a child Entity.

    - * - *

    EntityArray::createChild() is a factory method creating a new child Entity which is belonged - * to the EntityArray. This method is called by EntityArray::construct(). The children construction - * methods Entity::construct() will be called by abstract method of the EntityArray::construct().

    - * - * @return A new child Entity belongs to EntityArray. + * @inheritdoc */ - protected abstract createChild(xml: library.XML): T; + abstract createChild(xml: library.XML): T; /** * @inheritdoc */ key(): any; - /** - * @inheritdoc - */ /** * @inheritdoc */ @@ -3694,6 +3770,8 @@ declare namespace samchon.protocol { */ toXML(): library.XML; } +} +declare namespace samchon.protocol { /** * @inheritdoc */ @@ -3703,22 +3781,13 @@ declare namespace samchon.protocol { */ construct(xml: library.XML): void; /** - *

    Factory method of a child Entity.

    - * - *

    EntityArray::createChild() is a factory method creating a new child Entity which is belonged - * to the EntityArray. This method is called by EntityArray::construct(). The children construction - * methods Entity::construct() will be called by abstract method of the EntityArray::construct().

    - * - * @return A new child Entity belongs to EntityArray. + * @inheritdoc */ - protected abstract createChild(xml: library.XML): T; + abstract createChild(xml: library.XML): T; /** * @inheritdoc */ key(): any; - /** - * @inheritdoc - */ /** * @inheritdoc */ @@ -3744,6 +3813,8 @@ declare namespace samchon.protocol { */ toXML(): library.XML; } +} +declare namespace samchon.protocol { /** * @inheritdoc */ @@ -3753,22 +3824,13 @@ declare namespace samchon.protocol { */ construct(xml: library.XML): void; /** - *

    Factory method of a child Entity.

    - * - *

    EntityArray::createChild() is a factory method creating a new child Entity which is belonged - * to the EntityArray. This method is called by EntityArray::construct(). The children construction - * methods Entity::construct() will be called by abstract method of the EntityArray::construct().

    - * - * @return A new child Entity belongs to EntityArray. + * @inheritdoc */ - protected abstract createChild(xml: library.XML): T; + abstract createChild(xml: library.XML): T; /** * @inheritdoc */ key(): any; - /** - * @inheritdoc - */ /** * @inheritdoc */ @@ -3801,6 +3863,8 @@ declare namespace samchon.protocol { */ interface IEntityCollection extends IEntityGroup, collection.ICollection { } +} +declare namespace samchon.protocol { /** * @inheritdoc */ @@ -3810,22 +3874,13 @@ declare namespace samchon.protocol { */ construct(xml: library.XML): void; /** - *

    Factory method of a child Entity.

    - * - *

    EntityArray::createChild() is a factory method creating a new child Entity which is belonged - * to the EntityArray. This method is called by EntityArray::construct(). The children construction - * methods Entity::construct() will be called by abstract method of the EntityArray::construct().

    - * - * @return A new child Entity belongs to EntityArray. + * @inheritdoc */ - protected abstract createChild(xml: library.XML): T; + abstract createChild(xml: library.XML): T; /** * @inheritdoc */ key(): any; - /** - * @inheritdoc - */ /** * @inheritdoc */ @@ -3851,6 +3906,8 @@ declare namespace samchon.protocol { */ toXML(): library.XML; } +} +declare namespace samchon.protocol { /** * @inheritdoc */ @@ -3860,22 +3917,13 @@ declare namespace samchon.protocol { */ construct(xml: library.XML): void; /** - *

    Factory method of a child Entity.

    - * - *

    EntityArray::createChild() is a factory method creating a new child Entity which is belonged - * to the EntityArray. This method is called by EntityArray::construct(). The children construction - * methods Entity::construct() will be called by abstract method of the EntityArray::construct().

    - * - * @return A new child Entity belongs to EntityArray. + * @inheritdoc */ - protected abstract createChild(xml: library.XML): T; + abstract createChild(xml: library.XML): T; /** * @inheritdoc */ key(): any; - /** - * @inheritdoc - */ /** * @inheritdoc */ @@ -3901,6 +3949,8 @@ declare namespace samchon.protocol { */ toXML(): library.XML; } +} +declare namespace samchon.protocol { /** * @inheritdoc */ @@ -3910,22 +3960,13 @@ declare namespace samchon.protocol { */ construct(xml: library.XML): void; /** - *

    Factory method of a child Entity.

    - * - *

    EntityArray::createChild() is a factory method creating a new child Entity which is belonged - * to the EntityArray. This method is called by EntityArray::construct(). The children construction - * methods Entity::construct() will be called by abstract method of the EntityArray::construct().

    - * - * @return A new child Entity belongs to EntityArray. + * @inheritdoc */ - protected abstract createChild(xml: library.XML): T; + abstract createChild(xml: library.XML): T; /** * @inheritdoc */ key(): any; - /** - * @inheritdoc - */ /** * @inheritdoc */ @@ -4232,7 +4273,7 @@ declare namespace samchon.protocol { /** *

    Listener, represent function's name.

    */ - protected listener: string; + private listener; /** * Default Constructor. */ @@ -4254,7 +4295,7 @@ declare namespace samchon.protocol { /** * @inheritdoc */ - protected createChild(xml: library.XML): InvokeParameter; + createChild(xml: library.XML): InvokeParameter; /** * Get listener. */ @@ -4322,10 +4363,10 @@ declare namespace samchon.protocol { * @inheritdoc */ construct(xml: library.XML): void; - setValue(value: number): any; - setValue(value: string): any; - setValue(value: library.XML): any; - setValue(value: Uint8Array): any; + setValue(value: number): void; + setValue(value: string): void; + setValue(value: library.XML): void; + setValue(value: Uint8Array): void; /** * @inheritdoc */ @@ -4365,25 +4406,31 @@ declare namespace samchon.protocol { /** * */ - private startTime; + private start_time_; /** * */ - private endTime; + private end_time_; /** * Default Constructor. */ constructor(); constructor(invoke: Invoke); construct(xml: library.XML): void; - notifyEnd(): void; + complete(): void; key(): number; getUID(): number; getListener(): string; getStartTime(): Date; getEndTime(): Date; computeElapsedTime(): number; + /** + * @inheritdoc + */ TAG(): string; + /** + * @inheritdoc + */ toXML(): library.XML; toInvoke(): Invoke; } @@ -4525,15 +4572,15 @@ declare namespace samchon.protocol { /** * A server handler. */ - private http_server; + private http_server_; /** * Sequence number for issuing session id. */ - private sequence; + private sequence_; /** * @hidden */ - private my_port; + private my_port_; /** * Default Constructor. */ @@ -4685,7 +4732,7 @@ declare namespace samchon.protocol { * @author Jeongho Nam */ class ServerBase extends Server implements IServerBase { - private target; + private target_; constructor(target: IServer); addClient(driver: IClientDriver): void; } @@ -4730,7 +4777,7 @@ declare namespace samchon.protocol { * @author Jeongho Nam */ class WebServerBase extends WebServer implements IServerBase { - private target; + private target_; constructor(target: IServer); addClient(driver: IClientDriver): void; } @@ -4776,7 +4823,7 @@ declare namespace samchon.protocol { * @author Jeongho Nam */ class SharedWorkerServerBase extends SharedWorkerServer implements IServerBase { - private target; + private target_; constructor(target: IServer); addClient(driver: IClientDriver): void; } @@ -4849,13 +4896,13 @@ declare namespace samchon.protocol { * *

    Note that, {@link socket} is only used in web-browser environment.

    */ - private browser_socket; + private browser_socket_; /** *

    A driver for server connection.

    * *

    Note that, {@link node_client} is only used in NodeJS environment.

    */ - private node_client; + private node_client_; /** * @inheritdoc */ @@ -4889,11 +4936,17 @@ declare namespace samchon.protocol { } } declare namespace samchon.protocol { + /** + * @hidden + */ namespace socket { type socket = any; type server = any; type http_server = any; } + /** + * @hidden + */ namespace websocket { type connection = any; type request = any; @@ -4902,14 +4955,42 @@ declare namespace samchon.protocol { type client = any; } } +declare namespace samchon.protocol.distributed { + class DSInvokeHistory extends InvokeHistory { + private system_; + private role_; + /** + * Construct from a DistributedSystem. + * + * @param system + */ + constructor(system: DistributedSystem); + /** + * Initilizer Constructor. + * + * @param system + * @param role + * @param invoke + */ + constructor(system: DistributedSystem, role: DistributedSystemRole, invoke: Invoke); + /** + * @inheritdoc + */ + construct(xml: library.XML): void; + getSystem(): DistributedSystem; + getRole(): DistributedSystemRole; + /** + * @inheritdoc + */ + toXML(): library.XML; + } +} declare namespace samchon.protocol.external { /** - *

    An external system driver.

    + *

    A role of an external system.

    * - *

    The {@link ExternalSystem} class represents an external system, connected and interact with this system. - * {@link ExternalSystem} takes full charge of network communication with external system have connected. - * Replied {@link Invoke messages} from the external system is shifted to and processed in, children elements of this - * class, {@link ExternalSystemRole} objects.

    + *

    The {@link ExternalSystemRole} class represents a role, what to do in an {@link ExternalSystem}. + * Extends this class and writes some methods related to the role.

    * *

    @@ -4917,9 +4998,9 @@ declare namespace samchon.protocol.external { * style="max-width: 100%" /> *

    * - *

    Bridge & Proxy Pattern

    - *

    The {@link ExternalSystem} class can be a bridge for logical proxy. In framework within user, - * which {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not + *

    Proxy Pattern

    + *

    The {@link ExternalSystemRole} class can be an logical proxy. In framework within user, which + * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not * important. Only interested in user's perspective is which can be done.

    * *

    By using the logical proxy, user dont't need to know which {@link ExternalSystemRole role} is belonged @@ -4936,197 +5017,81 @@ declare namespace samchon.protocol.external { * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the * external system. * - *

  • Those strategy is called Bridge Pattern and Proxy Pattern.
  • + *
  • Those strategy is called Proxy Pattern.
  • * * * @author Jeongho Nam */ - abstract class ExternalSystem extends EntityDequeCollection implements IProtocol { + abstract class ExternalSystemRole extends Entity implements IProtocol { /** - * A network communicator with external system. + * An {@link ExternalSystem external system} containing this {@link ExternalSystemRole role}. */ + private system; /** - * A network communicator with external system. - */ - protected communicator: ICommunicator; - /** - * The name represents external system have connected. + *

    A name, represents and identifies this {@link ExternalSystemRole role}.

    + * + *

    This {@link name} is an identifier represents this {@link ExternalSystemRole role}. This {@link name} is + * used in {@link ExternalSystemArray.getRole} and {@link ExternalSystem.get}, as a key elements. Thus, this + * {@link name} should be unique in an {@link ExternalSystemArray}. */ protected name: string; /** - * Default Constructor. - */ - constructor(); - /** - * Construct from an IClientDriver object. + * Constructor from a system. * - * @param driver + * @param system An external system containing this role. */ - constructor(driver: IClientDriver); + constructor(system: ExternalSystem); /** - * Default Destructor. - */ - destructor(): void; - /** - * Identifier of {@link ExternalSystem} is its {@link name}. + * Identifier of {@link ExternalSystemRole} is its {@link name}. */ key(): string; /** - * Get {@link name}. + * Get external system, this role is belonged to. + */ + getSystem(): ExternalSystem; + /** + * Get name, who represents and identifies this role. */ getName(): string; - close(): void; /** - * Send {@link Invoke} message to external system. + * Send an {@link Invoke} message to the external system via {@link system}. * - * @param invoke An {@link Invoke} message to send. + * @param invoke An {@link Invoke} message to send to the external system. */ sendData(invoke: Invoke): void; /** - * Handle an {@Invoke} message have received. + *

    Handle replied {@link Invoke message} from the {@link system external system} belonged to.

    * - * @param invoke An {@link Invoke} message have received. + *

    This {@link replyData replyData()} will call a member method named following {@link Invoke.listener}. + * in the invoke.

    + * + * @param invoke An {@link Invoke} message received from the {@link system external system}. */ replyData(invoke: Invoke): void; /** - * Tag name of the {@link ExternalSytem} in {@link XML}. - * - * @return system. - */ - TAG(): string; - /** - * Tag name of {@link ExternalSystemRole children elements} belonged to the {@link ExternalSytem} in {@link XML}. + * Tag name of the {@link ExternalSytemRole} in {@link XML}. * * @return role. */ - CHILD_TAG(): string; - /** - * @inheritdoc - */ - toXML(): library.XML; - /** - * @hidden - */ - private communicator_; - /** - * @hidden - */ - private external_system_array_; - /** - * @hidden - */ - private erasing_; - /** - * @hidden - */ - private external_system_array; - /** - * @hidden - */ - private handle_close(); - } -} -declare namespace samchon.protocol.parallel { - /** - *

    An external parallel system driver.

    - * - * - * - * @author Jeongho Nam - */ - abstract class ParallelSystem extends external.ExternalSystem { - /** - * A manager containing this {@link ParallelSystem} object. - */ - private systemArray; - /** - * A list of {@link Invoke} messages on process. - * - * @see {@link performance} - */ - private progress_list; - /** - * A list of {@link Invoke} messages had processed. - * - * @see {@link performance} - */ - private history_list; - /** - *

    Performance index.

    - * - *

    A performance index that indicates how much fast the connected parallel system is.

    - * - *

    If this {@link ParallelSystem parallel system} hasn't any {@link Invoke} message - * {@link history_list had handled}, then the {@link performance performance index} will be 1, which means - * default and average value between all {@link ParallelSystem} instances (belonged to a same - * {@link ParallelSystemArray} object).

    - * - *

    You can specify this {@link performance} by yourself, but notice that, if the - * {@link performance performance index} is higher then other {@link ParallelSystem} objects, then this - * {@link ParallelSystem parallel system} will ordered to handle more processes than other {@link ParallelSystem} - * objects. Otherwise, the {@link performance performance index) is lower than others, of course, less processes - * will be delivered.

    - * - *

    This {@link performance index} is always re-calculated whenever {@link ParallelSystemArray} calls one of - * them below.

    - * - *
      - *
    • {@link ParallelSystemArray.sendSegmentData ParallelSystemArray.sendSegmentData()}
    • - *
    • {@link ParallelSystemArray.sendPieceData ParallelSystemArray.sendPieceData()}
    • - *
    - * - *

    If this class is a type of {@link DistributedSystem}, a derived class from the {@link ParallelSystem}, - * then {@link DistributedSystemRole.sendData DistributedSystem.sendData()} also cause the re-calculation.

    - * - * @see {@link progress_list}, {@link history_list} - */ - protected performance: number; - /** - * Construct from a {@link ParallelSystemArray}. - * - * @param systemArray A manager containing this {@link ParallelSystem} object. - * @param communicator A communicator who takes full charge of network communication with the external - * parallel system. - */ - constructor(systemArray: ParallelSystemArray, communicator?: ICommunicator); - /** - * Get manager of this object, {@link systemArray}. - * - * @return A manager containing this {@link ParallelSystem} object. - */ - getSystemArray(): ParallelSystemArray; - /** - * Get {@link performant performance index}. - * - * A performance index that indicates how much fast the connected parallel system is. - */ - getPerformance(): number; - /** - * Send an {@link Invoke} message with index of segmentation. - * - * @param invoke An invoke message requesting parallel process. - * @param first Initial piece's index in a section. - * @param last Final piece's index in a section. The ranged used is [first, last), which contains - * all the pieces' indices between first and last, including the piece pointed by index - * first, but not the piece pointed by the index last. - * - * @see {@link ParallelSystemArray.sendPieceData} - */ - private send_piece_data(invoke, first, last); - /** - * - * - * @param xml - * - * @see {@link ParallelSystemArray.notify_end} - */ - private report_invoke_history(xml); + TAG(): string; } } declare namespace samchon.protocol.distributed { - abstract class DistributedSystem extends parallel.ParallelSystem { + abstract class DistributedSystemRole extends external.ExternalSystemRole { + private system_array_; + private progress_list_; + private history_list_; + protected performance: number; + constructor(systemArray: DistributedSystemArray); + getSystemArray(): DistributedSystemArray; + getPerformance(): number; + sendData(invoke: protocol.Invoke): void; + _Report_history(history: DSInvokeHistory): void; } } +/** + * [[include: https://raw.githubusercontent.com/samchon/framework/master/handbook/TypeScript-Protocol-External_System.md]] + */ declare namespace samchon.protocol.external { /** *

    An array and manager of {@link ExternalSystem external systems}.

    @@ -5175,23 +5140,15 @@ declare namespace samchon.protocol.external { * * @author Jeongho Nam */ - abstract class ExternalSystemArray extends EntityArrayCollection implements IProtocol { + abstract class ExternalSystemArray extends EntityDequeCollection implements IProtocol { /** * Default Constructor. */ constructor(); - /** - * @hidden - */ - private handle_system_insert(event); /** * @hidden */ private handle_system_erase(event); - /** - * @hidden - */ - protected handle_system_close(system: ExternalSystem): void; /** * Test whether this system array has the role. * @@ -5244,13 +5201,25 @@ declare namespace samchon.protocol.parallel { */ abstract class ParallelSystemArray extends external.ExternalSystemArray { /** - * @see {@link ParallelSystem.progress_list}, {@link ParallelSystem.history_list} + * @hidden */ - private history_sequence; + private history_sequence_; /** * Default Constructor. */ constructor(); + /** + * @inheritdoc + */ + at(index: number): ParallelSystem; + /** + * @hidden + */ + _Fetch_history_sequence(): number; + /** + * @hidden + */ + _Set_history_sequence(val: number): void; /** * * @param invoke An invoke message requesting parallel process. @@ -5272,27 +5241,145 @@ declare namespace samchon.protocol.parallel { * @param history * * @return Whether the processes with same uid are all fininsed. - * - * @see {@link ParallelSystem.report_invoke_history}, {@link normalize_performance} */ - protected notify_end(history: PRInvokeHistory): boolean; + _Complete_history(history: InvokeHistory): boolean; /** - * @see {@link ParallelSystem.performance} + * @hidden */ private normalize_performance(); } } declare namespace samchon.protocol.distributed { abstract class DistributedSystemArray extends parallel.ParallelSystemArray { - protected roles: std.HashMap; + /** + * @hidden + */ + private role_map_; + /** + * Default Constructor. + */ + constructor(); + construct(xml: library.XML): void; + abstract createRole(xml: library.XML): DistributedSystemRole; + /** + * @inheritdoc + */ + at(index: number): DistributedSystem; + getRoleMap(): std.HashMap; + /** + * @inheritdoc + */ + hasRole(name: string): boolean; + /** + * @inheritdoc + */ + getRole(name: string): DistributedSystemRole; + insertRole(role: DistributedSystemRole): void; + eraseRole(name: string): void; + toXML(): library.XML; + } +} +declare namespace samchon.protocol.distributed { + abstract class DistributedClientArray extends DistributedSystemArray implements external.IExternalClientArray { + /** + * A subrogator of {@link IServer server}'s role instead of this {@link ExternalClientArray}. + */ + private server_base_; + /** + * Default Constructor. + */ + constructor(); + /** + *

    Factory method creating {@link IServerBase} object.

    + * + *

    This method {@link createServerBase createServerBase()} determines which protocol is used in this server, + * {@link ExternalClientArray}. If the protocol is determined, then {@link ExternalSystem external clients} who + * may connect to {@link ExternalClientArray this server} must follow the specified protocol.

    + * + *

    Creates and returns one of them:

    + *
      + *
    • {@link ServerBase}
    • + *
    • {@link WebServerBase}
    • + *
    • {@link SharedWorkerServerBase}
    • + *
    + * + * @return A new {@link IServerBase} object. + */ + protected abstract createServerBase(): IServerBase; + addClient(driver: IClientDriver): void; + createChild(xml: library.XML): DistributedSystem; + protected abstract createExternalClient(driver: IClientDriver): DistributedSystem; + /** + * @inheritdoc + */ + open(port: number): void; + /** + * @inheritdoc + */ + close(): void; + } +} +declare namespace samchon.protocol.distributed { + abstract class DistributedSystemArrayMediator extends DistributedSystemArray { + private mediator_; + /** + * Default Constructor. + */ + constructor(); + protected abstract createMediator(): parallel.MediatorSystem; + protected startMediator(): void; + getMediator(): parallel.MediatorSystem; + _Complete_history(history: parallel.PRInvokeHistory): boolean; + } +} +declare namespace samchon.protocol.distributed { + abstract class DistributedClientArrayMediator extends DistributedSystemArrayMediator implements external.IExternalClientArray { + /** + * A subrogator of {@link IServer server}'s role instead of this {@link ExternalClientArray}. + */ + private server_base_; + /** + * Default Constructor. + */ + constructor(); + /** + *

    Factory method creating {@link IServerBase} object.

    + * + *

    This method {@link createServerBase createServerBase()} determines which protocol is used in this server, + * {@link ExternalClientArray}. If the protocol is determined, then {@link ExternalSystem external clients} who + * may connect to {@link ExternalClientArray this server} must follow the specified protocol.

    + * + *

    Creates and returns one of them:

    + *
      + *
    • {@link ServerBase}
    • + *
    • {@link WebServerBase}
    • + *
    • {@link SharedWorkerServerBase}
    • + *
    + * + * @return A new {@link IServerBase} object. + */ + protected abstract createServerBase(): IServerBase; + addClient(driver: IClientDriver): void; + createChild(xml: library.XML): DistributedSystem; + protected abstract createExternalClient(driver: IClientDriver): DistributedSystem; + /** + * @inheritdoc + */ + open(port: number): void; + /** + * @inheritdoc + */ + close(): void; } } declare namespace samchon.protocol.external { /** - *

    A role of an external system.

    + *

    An external system driver.

    * - *

    The {@link ExternalSystemRole} class represents a role, what to do in an {@link ExternalSystem}. - * Extends this class and writes some methods related to the role.

    + *

    The {@link ExternalSystem} class represents an external system, connected and interact with this system. + * {@link ExternalSystem} takes full charge of network communication with external system have connected. + * Replied {@link Invoke messages} from the external system is shifted to and processed in, children elements of this + * class, {@link ExternalSystemRole} objects.

    * *

    @@ -5300,9 +5387,9 @@ declare namespace samchon.protocol.external { * style="max-width: 100%" /> *

    * - *

    Proxy Pattern

    - *

    The {@link ExternalSystemRole} class can be an logical proxy. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not + *

    Bridge & Proxy Pattern

    + *

    The {@link ExternalSystem} class can be a bridge for logical proxy. In framework within user, + * which {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not * important. Only interested in user's perspective is which can be done.

    * *

    By using the logical proxy, user dont't need to know which {@link ExternalSystemRole role} is belonged @@ -5319,68 +5406,249 @@ declare namespace samchon.protocol.external { * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the * external system. * - *

  • Those strategy is called Proxy Pattern.
  • + *
  • Those strategy is called Bridge Pattern and Proxy Pattern.
  • * * * @author Jeongho Nam */ - abstract class ExternalSystemRole extends Entity implements IProtocol { + abstract class ExternalSystem extends EntityDequeCollection implements IProtocol { /** - * An {@link ExternalSystem external system} containing this {@link ExternalSystemRole role}. + * The name represents external system have connected. */ - private system; + protected name: string; /** - *

    A name, represents and identifies this {@link ExternalSystemRole role}.

    - * - *

    This {@link name} is an identifier represents this {@link ExternalSystemRole role}. This {@link name} is - * used in {@link ExternalSystemArray.getRole} and {@link ExternalSystem.get}, as a key elements. Thus, this - * {@link name} should be unique in an {@link ExternalSystemArray}. + * @hidden */ - private name; + private system_array_; /** - * Constructor from a system. - * - * @param system An external system containing this role. + * @hidden */ - constructor(system: ExternalSystem); + private communicator_; + constructor(systemArray: ExternalSystemArray); + constructor(systemArray: ExternalSystemArray, communicator: IClientDriver); /** - * Identifier of {@link ExternalSystemRole} is its {@link name}. + * Default Destructor. + */ + destructor(): void; + /** + * @hidden + */ + private handle_close(); + getSystemArray(): ExternalSystemArray; + /** + * Identifier of {@link ExternalSystem} is its {@link name}. */ key(): string; /** - * Get external system, this role is belonged to. - */ - getSystem(): ExternalSystem; - /** - * Get name, who represents and identifies this role. + * Get {@link name}. */ getName(): string; + protected communicator: protocol.ICommunicator; + close(): void; /** - * Send an {@link Invoke} message to the external system via {@link system}. + * Send {@link Invoke} message to external system. * - * @param invoke An {@link Invoke} message to send to the external system. + * @param invoke An {@link Invoke} message to send. */ sendData(invoke: Invoke): void; /** - *

    Handle replied {@link Invoke message} from the {@link system external system} belonged to.

    + * Handle an {@Invoke} message has received. * - *

    This {@link replyData replyData()} will call a member method named following {@link Invoke.listener}. - * in the invoke.

    - * - * @param invoke An {@link Invoke} message received from the {@link system external system}. + * @param invoke An {@link Invoke} message have received. */ replyData(invoke: Invoke): void; /** - * Tag name of the {@link ExternalSytemRole} in {@link XML}. + * Tag name of the {@link ExternalSytem} in {@link XML}. + * + * @return system. + */ + TAG(): string; + /** + * Tag name of {@link ExternalSystemRole children elements} belonged to the {@link ExternalSytem} in {@link XML}. * * @return role. */ - TAG(): string; + CHILD_TAG(): string; + } +} +declare namespace samchon.protocol.parallel { + /** + *

    An external parallel system driver.

    + * + * + * + * @author Jeongho Nam + */ + abstract class ParallelSystem extends external.ExternalSystem { + /** + * @hidden + */ + private progress_list_; + /** + * @hidden + */ + private history_list_; + /** + *

    Performance index.

    + * + *

    A performance index that indicates how much fast the connected parallel system is.

    + * + *

    If this {@link ParallelSystem parallel system} hasn't any {@link Invoke} message had handled, then the + * {@link performance performance index} will be 1, which means default and average value between all + * {@link ParallelSystem} instances (belonged to a same {@link ParallelSystemArray} object).

    + * + *

    You can specify this {@link performance} by yourself, but notice that, if the + * {@link performance performance index} is higher then other {@link ParallelSystem} objects, then this + * {@link ParallelSystem parallel system} will ordered to handle more processes than other + * {@link ParallelSystem} objects. Otherwise, the {@link performance performance index) is lower than others, + * of course, less processes will be delivered.

    + * + *

    This {@link performance index} is always re-calculated whenever {@link ParallelSystemArray} calls one of + * them below.

    + * + *
      + *
    • {@link ParallelSystemArray.sendSegmentData ParallelSystemArray.sendSegmentData()}
    • + *
    • {@link ParallelSystemArray.sendPieceData ParallelSystemArray.sendPieceData()}
    • + *
    + * + *

    If this class is a type of {@link DistributedSystem} derived class from the {@link ParallelSystem}, + * then {@link DistributedSystemRole.sendData DistributedSystemRole.sendData()} also cause the re-calculation. + *

    + */ + protected performance: number; + constructor(systemArray: ParallelSystemArray); + constructor(systemArray: ParallelSystemArray, communicator: IClientDriver); + destructor(): void; + /** + * Get manager of this object, {@link systemArray}. + * + * @return A manager containing this {@link ParallelSystem} object. + */ + getSystemArray(): ParallelSystemArray; + /** + * Get {@link performant performance index}. + * + * A performance index that indicates how much fast the connected parallel system is. + */ + getPerformance(): number; + _Get_progress_list(): std.HashMap>; + _Get_history_list(): std.HashMap; + _Set_performance(val: number): void; + /** + * @hidden + */ + _Send_piece_data(invoke: Invoke, first: number, last: number): void; + /** + * @hidden + */ + private _replyData(invoke); + /** + * + * + * @param xml + * + * @see {@link ParallelSystemArray.notify_complete} + */ + protected _Report_history(xml: library.XML): void; } } declare namespace samchon.protocol.distributed { - abstract class DistributedSystemRole extends external.ExternalSystemRole { - private systems; + abstract class DistributedSystem extends parallel.ParallelSystem { + destructor(): void; + createChild(xml: library.XML): external.ExternalSystemRole; + /** + * Get manager of this object. + * + * @return A manager containing this {@link DistributedSystem} objects. + */ + getSystemArray(): DistributedSystemArray; + /** + * @inheritdoc + */ + has(key: string): boolean; + /** + * @inheritdoc + */ + get(key: string): DistributedSystemRole; + replyData(invoke: protocol.Invoke): void; + protected _Report_history(xml: library.XML): void; + } +} +declare namespace samchon.protocol.distributed { + interface IDistributedServer extends DistributedSystem, external.IExternalServer { + /** + * @inheritdoc + */ + getSystemArray(): DistributedSystemArray; + /** + * @inheritdoc + */ + has(key: string): boolean; + /** + * @inheritdoc + */ + get(key: string): DistributedSystemRole; + } + abstract class DistributedServer extends DistributedSystem implements external.IExternalServer { + protected ip: string; + protected port: number; + constructor(systemArray: DistributedSystemArray); + protected abstract createServerConnector(): IServerConnector; + connect(): void; + getIP(): string; + getPort(): number; + } +} +declare namespace samchon.protocol.distributed { + abstract class DistributedServerArray extends DistributedSystemArray implements external.IExternalServerArray { + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.protocol.distributed { + abstract class DistributedServerArrayMediator extends DistributedSystemArrayMediator implements external.IExternalServerArray { + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.protocol.distributed { + abstract class DistributedServerClientArray extends DistributedClientArray implements external.IExternalServerClientArray { + /** + * Default Constructor. + */ + constructor(); + createChild(xml: library.XML): DistributedSystem; + protected abstract createExternalServer(xml: library.XML): IDistributedServer; + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.protocol.distributed { + abstract class DistributedServerClientArrayMediator extends DistributedClientArrayMediator implements external.IExternalServerClientArray { + /** + * Default Constructor. + */ + constructor(); + createChild(xml: library.XML): DistributedSystem; + protected abstract createExternalServer(xml: library.XML): IDistributedServer; + /** + * @inheritdoc + */ + connect(): void; } } declare namespace samchon.protocol.external { @@ -5454,7 +5722,7 @@ declare namespace samchon.protocol.external { /** * A subrogator of {@link IServer server}'s role instead of this {@link ExternalClientArray}. */ - private server_base; + private server_base_; /** * Default Constructor. */ @@ -5482,7 +5750,7 @@ declare namespace samchon.protocol.external { * * @return null. */ - protected createChild(xml: library.XML): ExternalSystem; + createChild(xml: library.XML): ExternalSystem; /** * Factory method creating {@link ExternalSystem} object. * @@ -5528,18 +5796,7 @@ declare namespace samchon.protocol.external { * @author Jeongho Nam */ interface IExternalServer extends ExternalSystem { - /** - * Connect to the external system. - */ connect(): void; - /** - * Get ip address. - */ - getIP(): string; - /** - * Get port number. - */ - getPort(): number; } /** *

    An external server driver.

    @@ -5591,7 +5848,7 @@ declare namespace samchon.protocol.external { /** * Default Constructor. */ - constructor(); + constructor(systemArray: ExternalSystemArray); /** * Factory method creating server connector. */ @@ -5779,7 +6036,7 @@ declare namespace samchon.protocol.external { * * @return A new child Entity via {@link createExternalServer createExternalServer()}. */ - protected createChild(xml: library.XML): ExternalSystem; + createChild(xml: library.XML): ExternalSystem; /** * Factory method creating an {@link IExternalServer} object. * @@ -5795,33 +6052,34 @@ declare namespace samchon.protocol.external { } } declare namespace samchon.protocol.slave { - abstract class SlaveSystem extends external.ExternalSystem { + abstract class SlaveSystem implements protocol.IProtocol { + protected communicator_: ICommunicator; /** * Default Constructor. */ constructor(); + sendData(invoke: Invoke): void; + protected _replyData(invoke: Invoke): void; replyData(invoke: Invoke): void; } } -declare namespace samchon.protocol.external { +declare namespace samchon.protocol.parallel { abstract class MediatorSystem extends slave.SlaveSystem { - private system_array; - private progress_list; - constructor(systemArray: ExternalSystemArray); + private mediator_; + private progress_list_; + constructor(systemArray: ParallelSystemArrayMediator | distributed.DistributedSystemArrayMediator); abstract start(): void; - /** - * @hidden - */ - protected createChild(xml: library.XML): ExternalSystemRole; - private notify_end(uid); + getMediator(): ParallelSystemArrayMediator | distributed.DistributedSystemArrayMediator; + _Complete_history(uid: number): void; + protected _replyData(invoke: Invoke): void; replyData(invoke: protocol.Invoke): void; } } -declare namespace samchon.protocol.external { - class MediatorServer extends MediatorSystem implements IServer { - private server_base; +declare namespace samchon.protocol.parallel { + class MediatorServer extends MediatorSystem implements slave.ISlaveServer { + private server_base_; private port; - constructor(systemArray: ExternalSystemArray, port: number); + constructor(systemArray: ParallelSystemArrayMediator, port: number); protected createServerBase(): IServerBase; addClient(driver: IClientDriver): void; start(): void; @@ -5829,17 +6087,23 @@ declare namespace samchon.protocol.external { close(): void; } class MediatorWebServer extends MediatorServer { + /** + * @inheritdoc + */ protected createServerBase(): IServerBase; } class MediatorSharedWorkerServer extends MediatorServer { + /** + * @inheritdoc + */ protected createServerBase(): IServerBase; } } -declare namespace samchon.protocol.external { - class MediatorClient extends MediatorSystem implements IExternalServer { +declare namespace samchon.protocol.parallel { + class MediatorClient extends MediatorSystem implements slave.ISlaveClient { protected ip: string; protected port: number; - constructor(systemArray: ExternalSystemArray, ip: string, port: number); + constructor(systemArray: ParallelSystemArrayMediator, ip: string, port: number); protected createServerConnector(): IServerConnector; getIP(): string; getPort(): number; @@ -5881,6 +6145,8 @@ declare namespace samchon.protocol.parallel { constructor(invoke: Invoke); getFirst(): number; getLast(): number; + _Set_first(val: number): void; + _Set_last(val: number): void; /** * Compute number of allocated pieces. */ @@ -5892,7 +6158,7 @@ declare namespace samchon.protocol.parallel { /** * A subrogator of {@link IServer server}'s role instead of this {@link ExternalClientArray}. */ - private server_base; + private server_base_; /** * Default Constructor. */ @@ -5915,7 +6181,7 @@ declare namespace samchon.protocol.parallel { */ protected abstract createServerBase(): IServerBase; addClient(driver: IClientDriver): void; - protected createChild(xml: library.XML): ParallelSystem; + createChild(xml: library.XML): ParallelSystem; protected abstract createExternalClient(driver: IClientDriver): ParallelSystem; /** * @inheritdoc @@ -5929,16 +6195,15 @@ declare namespace samchon.protocol.parallel { } declare namespace samchon.protocol.parallel { abstract class ParallelSystemArrayMediator extends ParallelSystemArray { - protected mediator: external.MediatorSystem; + private mediator_; /** * Default Constructor. */ constructor(); - protected abstract createMediator(): external.MediatorSystem; + protected abstract createMediator(): MediatorSystem; protected start_mediator(): void; - sendData(invoke: protocol.Invoke): void; - sendPieceData(invoke: protocol.Invoke, first: number, last: number): void; - protected notify_end(history: PRInvokeHistory): boolean; + getMediator(): MediatorSystem; + _Complete_history(history: PRInvokeHistory): boolean; } } declare namespace samchon.protocol.parallel { @@ -5946,7 +6211,7 @@ declare namespace samchon.protocol.parallel { /** * A subrogator of {@link IServer server}'s role instead of this {@link ExternalClientArray}. */ - private server_base; + private server_base_; /** * Default Constructor. */ @@ -5969,7 +6234,7 @@ declare namespace samchon.protocol.parallel { */ protected abstract createServerBase(): IServerBase; addClient(driver: IClientDriver): void; - protected createChild(xml: library.XML): ParallelSystem; + createChild(xml: library.XML): ParallelSystem; protected abstract createExternalClient(driver: IClientDriver): ParallelSystem; /** * @inheritdoc @@ -5982,9 +6247,13 @@ declare namespace samchon.protocol.parallel { } } declare namespace samchon.protocol.parallel { - interface IParallelServer extends ParallelSystem, external.IExternalServer { + interface IParallelServer extends external.IExternalServer, ParallelSystem { + /** + * @inheritdoc + */ + getSystemArray(): ParallelSystemArray; } - abstract class ParallelServer extends ParallelSystem implements IParallelServer { + abstract class ParallelServer extends ParallelSystem implements external.IExternalServer { protected ip: string; protected port: number; constructor(systemArray: ParallelSystemArray); @@ -6003,6 +6272,9 @@ declare namespace samchon.protocol.parallel { declare namespace samchon.protocol.parallel { abstract class ParallelServerArrayMediator extends ParallelSystemArrayMediator implements external.IExternalServerArray { constructor(); + /** + * @inheritdoc + */ connect(): void; } } @@ -6012,7 +6284,7 @@ declare namespace samchon.protocol.parallel { * Default Constructor. */ constructor(); - protected createChild(xml: library.XML): ParallelSystem; + createChild(xml: library.XML): ParallelSystem; protected abstract createExternalServer(xml: library.XML): IParallelServer; connect(): void; } @@ -6023,7 +6295,7 @@ declare namespace samchon.protocol.parallel { * Default Constructor. */ constructor(); - protected createChild(xml: library.XML): ParallelSystem; + createChild(xml: library.XML): ParallelSystem; protected abstract createExternalServer(xml: library.XML): IParallelServer; /** * @inheritdoc @@ -6033,10 +6305,10 @@ declare namespace samchon.protocol.parallel { } declare namespace samchon.protocol.service { abstract class Client implements protocol.IProtocol { - private user; - private service; - private driver; - private no; + private user_; + private service_; + private communicator_; + private no_; /** * Construct from an User and WebClientDriver. */ @@ -6045,6 +6317,8 @@ declare namespace samchon.protocol.service { close(): void; getUser(): User; getService(): Service; + getNo(): number; + _Set_no(val: number): void; sendData(invoke: protocol.Invoke): void; replyData(invoke: protocol.Invoke): void; protected changeService(path: string): void; @@ -6052,8 +6326,8 @@ declare namespace samchon.protocol.service { } declare namespace samchon.protocol.service { abstract class Server extends protocol.WebServer implements IProtocol { - private session_map; - private account_map; + private session_map_; + private account_map_; /** * Default Constructor. */ @@ -6066,16 +6340,20 @@ declare namespace samchon.protocol.service { protected abstract createUser(): User; has(account: string): boolean; get(account: string): User; + /** + * @hidden + */ + _Get_account_map(): std.HashMap; sendData(invoke: protocol.Invoke): void; replyData(invoke: protocol.Invoke): void; addClient(driver: WebClientDriver): void; - private erase_user(user); + _Erase_user(user: User): void; } } declare namespace samchon.protocol.service { abstract class Service implements protocol.IProtocol { - private client; - private path; + private client_; + private path_; /** * Default Constructor. */ @@ -6095,39 +6373,75 @@ declare namespace samchon.protocol.service { } declare namespace samchon.protocol.service { abstract class User extends collection.HashMapCollection implements protocol.IProtocol { - private server; - private session_id; - private sequence; - private account_id; - private authority; + private server_; + private session_id_; + private sequence_; + private account_id_; + private authority_; /** * Construct from a Server. */ constructor(server: Server); protected abstract createClient(driver: WebClientDriver): Client; + /** + * @hidden + */ + _Create_child(driver: WebClientDriver): Client; + /** + * @hidden + */ private handle_erase_client(event); getServer(): Server; getAccountID(): string; getAuthority(): number; setAccount(id: string, authority: number): void; + /** + * @hidden + */ + _Get_session_id(): string; + /** + * @hidden + */ + _Fetch_sequence(): number; + /** + * @hidden + */ + _Set_session_id(val: string): void; sendData(invoke: protocol.Invoke): void; replyData(invoke: protocol.Invoke): void; } } declare namespace samchon.protocol.slave { - abstract class SlaveClient extends SlaveSystem { + interface ISlaveClient extends SlaveSystem { + connect(ip: string, port: number): void; + } + abstract class SlaveClient extends SlaveSystem implements ISlaveClient { + /** + * Default Constructor. + */ constructor(); + /** + * @inheritdoc + */ protected abstract createServerConnector(): IServerConnector; + /** + * @inheritdoc + */ connect(ip: string, port: number): void; } } declare namespace samchon.protocol.slave { - abstract class SlaveServer extends SlaveSystem implements IServer { - private server_base; + interface ISlaveServer extends SlaveSystem, IServer { + } + abstract class SlaveServer extends SlaveSystem implements ISlaveServer { + private server_base_; constructor(); protected abstract createServerBase(): IServerBase; - addClient(driver: IClientDriver): void; open(port: number): void; close(): void; + addClient(driver: IClientDriver): void; } } +declare namespace samchon.test { + function test_collection(): void; +} diff --git a/typescript-stl/typescript-stl.d.ts b/typescript-stl/typescript-stl.d.ts index 96d22ceb8f..36ad79e4a1 100644 --- a/typescript-stl/typescript-stl.d.ts +++ b/typescript-stl/typescript-stl.d.ts @@ -1,4 +1,4 @@ -// Type definitions for TypeScript-STL v1.0.1 +// Type definitions for TypeScript-STL v1.0.8 // Project: https://github.com/samchon/typescript-stl // Definitions by: Jeongho Nam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -2984,7 +2984,7 @@ declare namespace std { /** * @hidden */ - protected abstract create_neighbor(): This; + protected abstract create_neighbor(base: Base): This; /** *

    Get value of the iterator is pointing.

    * @@ -3292,7 +3292,7 @@ declare namespace std { * @param container Another container object of the same type (with the same class template * arguments T), whose contents are either copied or acquired. */ - constructor(container: base.IContainer); + constructor(container: Deque); /** *

    Range Constructor.

    * @@ -3339,6 +3339,10 @@ declare namespace std { * @inheritdoc */ size(): number; + /** + * @inheritdoc + */ + empty(): boolean; /** * @inheritdoc */ @@ -3360,11 +3364,9 @@ declare namespace std { */ back(): T; /** - *

    Fetch row and column's index.

    - * - *

    Fetches index of row and column of {@link matrix_} from sequence number.

    - * - * @param index Sequence number + // Fetch row and column's index. + /** + * @hidden */ private fetch_index(index); /** @@ -3418,11 +3420,11 @@ declare namespace std { /** * @hidden */ - protected insert_by_repeating_val(position: DequeIterator, n: number, val: T): DequeIterator; + protected _Insert_by_repeating_val(position: DequeIterator, n: number, val: T): DequeIterator; /** * @hidden */ - protected insert_by_range>(position: DequeIterator, begin: InputIterator, end: InputIterator): DequeIterator; + protected _Insert_by_range>(position: DequeIterator, begin: InputIterator, end: InputIterator): DequeIterator; /** * @hidden */ @@ -3446,15 +3448,29 @@ declare namespace std { /** * @hidden */ - protected erase_by_range(first: DequeIterator, last: DequeIterator): DequeIterator; + protected _Erase_by_range(first: DequeIterator, last: DequeIterator): DequeIterator; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link Deque container} object with same type of elements. Sizes and container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link Deque container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link container Deque}. + */ + swap(obj: Deque): void; /** * @inheritdoc */ swap(obj: base.IContainer): void; - /** - * @hidden - */ - private swap_deque(obj); } } declare namespace std { @@ -3556,7 +3572,10 @@ declare namespace std { /** * @hidden */ - protected create_neighbor(): DequeReverseIterator; + protected create_neighbor(base: DequeIterator): DequeReverseIterator; + /** + * @inheritdoc + */ /** * Set value of the iterator is pointing to. * @@ -4438,7 +4457,7 @@ declare namespace std.base { * * @author Jeongho Nam */ - abstract class MapContainer extends base.Container> { + abstract class MapContainer extends Container> { /** *

    {@link List} storing elements.

    * @@ -4447,45 +4466,11 @@ declare namespace std.base { * by storing {@link ListIterator iterators} ({@link MapIterator} references {@link ListIterator}) who are * created from {@link data_ here}.

    */ - protected data_: List>; + private data_; /** * Default Constructor. */ constructor(); - /** - * Construct from elements. - */ - constructor(items: Array>); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - */ - constructor(array: Array<[Key, T]>); - /** - * Copy Constructor. - */ - constructor(container: IContainer>); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator>, end: Iterator>); - /** - * @hidden - */ - protected init(): void; - /** - * @hidden - */ - protected construct_from_array(items: Array | [Key, T]>): void; - /** - * @hidden - */ - protected construct_from_container(container: IContainer>): void; - /** - * @hidden - */ - protected construct_from_range>>(begin: InputIterator, end: InputIterator): void; /** * @inheritdoc */ @@ -4595,6 +4580,7 @@ declare namespace std.base { * Return the number of elements in the map. */ size(): number; + protected _Get_data(): List>; /** * @inheritdoc */ @@ -4670,7 +4656,7 @@ declare namespace std.base { /** * @hidden */ - protected abstract insert_by_pair(pair: Pair): any; + protected abstract _Insert_by_pair(pair: Pair): any; /** * @hidden */ @@ -4678,7 +4664,7 @@ declare namespace std.base { /** * @hidden */ - protected abstract insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + protected abstract _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; /** * @hidden */ @@ -4686,7 +4672,7 @@ declare namespace std.base { /** * @hidden */ - protected abstract insert_by_range>>(first: InputIterator, last: InputIterator): void; + protected abstract _Insert_by_range>>(first: InputIterator, last: InputIterator): void; /** *

    Erase an elemet by key.

    * @@ -4785,7 +4771,7 @@ declare namespace std.base { * [first, last), which contains all the elements between first and last, * including the element pointed by first but not the element pointed by last. */ - protected abstract handle_insert(first: MapIterator, last: MapIterator): void; + protected abstract _Handle_insert(first: MapIterator, last: MapIterator): void; /** *

    Abstract method handling deletions for indexing.

    * @@ -4806,7 +4792,11 @@ declare namespace std.base { * [first, last), which contains all the elements between first and last, * including the element pointed by first but not the element pointed by last. */ - protected abstract handle_erase(first: MapIterator, last: MapIterator): void; + protected abstract _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + * @hidden + */ + protected _Swap(obj: MapContainer): void; } } declare namespace std { @@ -4899,7 +4889,7 @@ declare namespace std { /** * @hidden */ - protected create_neighbor(): MapReverseIterator; + protected create_neighbor(base: MapIterator): MapReverseIterator; /** * Get first, key element. */ @@ -5160,24 +5150,6 @@ declare namespace std.base { * @hidden */ private insert_or_assign_with_hint(hint, key, value); - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link UniqueMap map} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link UniqueMap map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link UniqueMap container}. - */ - swap(obj: UniqueMap): void; } } declare namespace std.base { @@ -5268,24 +5240,6 @@ declare namespace std.base { * @inheritdoc */ insert>>(first: InputIterator, last: InputIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link UniqueMap map} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link MultiMap map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link MultiMap container}. - */ - swap(obj: MultiMap): void; } } declare namespace std.HashMap { @@ -5348,13 +5302,27 @@ declare namespace std { */ private hash_buckets_; /** - * @hidden + * Default Constructor. */ - protected init(): void; + constructor(); /** - * @hidden + * Construct from elements. */ - protected construct_from_array(items: Array>): void; + constructor(items: Pair[]); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: [Key, T][]); + /** + * Copy Constructor. + */ + constructor(container: HashMap); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator>, end: Iterator>); /** * @inheritdoc */ @@ -5426,31 +5394,45 @@ declare namespace std { /** * @hidden */ - protected insert_by_pair(pair: Pair): any; + protected _Insert_by_pair(pair: Pair): any; /** * @hidden */ - protected insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; /** * @hidden */ - protected insert_by_range>>(first: InputIterator, last: InputIterator): void; + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; /** * @inheritdoc */ - protected handle_insert(first: MapIterator, last: MapIterator): void; + protected _Handle_insert(first: MapIterator, last: MapIterator): void; /** * @inheritdoc */ - protected handle_erase(first: MapIterator, last: MapIterator): void; + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link HashMap map} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link HashMap map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashMap container}. + */ + swap(obj: HashMap): void; /** * @inheritdoc */ - swap(obj: base.UniqueMap): void; - /** - * @hidden - */ - private swap_hash_map(obj); + swap(obj: base.IContainer>): void; } } declare namespace std.HashMultiMap { @@ -5461,15 +5443,15 @@ declare namespace std { /** *

    Hashed, unordered Multimap.

    * - *

    {@link HashMap}s are associative containers that store elements formed by the combination of - * a key value and a mapped value, much like {@link HashMap} containers, but allowing + *

    {@link HashMultiMap}s are associative containers that store elements formed by the combination of + * a key value and a mapped value, much like {@link HashMultiMap} containers, but allowing * different elements to have equivalent keys.

    * - *

    In an {@link HashMap}, the key value is generally used to uniquely identify the + *

    In an {@link HashMultiMap}, the key value is generally used to uniquely identify the * element, while the mapped value is an object with the content associated to this key. * Types of key and mapped value may differ.

    * - *

    Internally, the elements in the {@link HashMap} are not sorted in any particular order with + *

    Internally, the elements in the {@link HashMultiMap} are not sorted in any particular order with * respect to either their key or mapped values, but organized into buckets depending on * their hash values to allow for fast access to individual elements directly by their key values * (with a constant average time complexity on average).

    @@ -5500,9 +5482,9 @@ declare namespace std { * * * @param Type of the key values. - * Each element in an {@link HashMap} is identified by a key value. + * Each element in an {@link HashMultiMap} is identified by a key value. * @param Type of the mapped value. - * Each element in an {@link HashMap} is used to store some data as its mapped value. + * Each element in an {@link HashMultiMap} is used to store some data as its mapped value. * * @reference http://www.cplusplus.com/reference/unordered_map/unordered_multimap * @author Jeongho Nam @@ -5513,13 +5495,27 @@ declare namespace std { */ private hash_buckets_; /** - * @hidden + * Default Constructor. */ - protected init(): void; + constructor(); /** - * @hidden + * Construct from elements. */ - protected construct_from_array(items: Array>): void; + constructor(items: Pair[]); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: [Key, T][]); + /** + * Copy Constructor. + */ + constructor(container: HashMultiMap); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator>, end: Iterator>); /** * @inheritdoc */ @@ -5595,31 +5591,45 @@ declare namespace std { /** * @hidden */ - protected insert_by_pair(pair: Pair): any; + protected _Insert_by_pair(pair: Pair): any; /** * @hidden */ - protected insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; /** * @hidden */ - protected insert_by_range>>(first: InputIterator, last: InputIterator): void; + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; /** * @inheritdoc */ - protected handle_insert(first: MapIterator, last: MapIterator): void; + protected _Handle_insert(first: MapIterator, last: MapIterator): void; /** * @inheritdoc */ - protected handle_erase(first: MapIterator, last: MapIterator): void; + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link HashMultiMap map} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link HashMultiMap map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashMultiMap container}. + */ + swap(obj: HashMultiMap): void; /** * @inheritdoc */ - swap(obj: base.MultiMap): void; - /** - * @hidden - */ - private swap_hash_multimap(obj); + swap(obj: base.IContainer>): void; } } declare namespace std.base { @@ -5666,39 +5676,11 @@ declare namespace std.base { * by storing {@link ListIterator iterators} ({@link SetIterator} references {@link ListIterator}) who are * created from {@link data_ here}.

    */ - protected data_: List; + private data_; /** * Default Constructor. */ constructor(); - /** - * Construct from elements. - */ - constructor(items: Array); - /** - * Copy Constructor. - */ - constructor(container: IContainer); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @hidden - */ - protected init(): void; - /** - * @hidden - */ - protected construct_from_array(items: Array): void; - /** - * @hidden - */ - protected construct_from_container(container: IContainer): void; - /** - * @hidden - */ - protected construct_from_range>(begin: InputIterator, end: InputIterator): void; /** * @inheritdoc */ @@ -5762,6 +5744,10 @@ declare namespace std.base { * @inheritdoc */ size(): number; + /** + * @hidden + */ + _Get_data(): List; /** * @inheritdoc */ @@ -5805,15 +5791,15 @@ declare namespace std.base { /** * @hidden */ - protected abstract insert_by_val(val: T): any; + protected abstract _Insert_by_val(val: T): any; /** * @hidden */ - protected abstract insert_by_hint(hint: SetIterator, val: T): SetIterator; + protected abstract _Insert_by_hint(hint: SetIterator, val: T): SetIterator; /** * @hidden */ - protected abstract insert_by_range>(begin: InputIterator, end: InputIterator): void; + protected abstract _Insert_by_range>(begin: InputIterator, end: InputIterator): void; /** *

    Erase an element.

    *

    Removes from the set container the elements whose value is key.

    @@ -5886,7 +5872,7 @@ declare namespace std.base { * [first, last), which contains all the elements between first and last, * including the element pointed by first but not the element pointed by last. */ - protected abstract handle_insert(first: SetIterator, last: SetIterator): void; + protected abstract _Handle_insert(first: SetIterator, last: SetIterator): void; /** *

    Abstract method handling deletions for indexing.

    * @@ -5907,7 +5893,11 @@ declare namespace std.base { * [first, last), which contains all the elements between first and last, * including the element pointed by first but not the element pointed by last. */ - protected abstract handle_erase(first: SetIterator, last: SetIterator): void; + protected abstract _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + * @hidden + */ + protected _Swap(obj: SetContainer): void; } } declare namespace std { @@ -5990,7 +5980,7 @@ declare namespace std { /** * @hidden */ - protected create_neighbor(): SetReverseIterator; + protected create_neighbor(base: SetIterator): SetReverseIterator; } } declare namespace std.base { @@ -6055,10 +6045,6 @@ declare namespace std.base { * @inheritdoc */ insert>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - swap(obj: MultiSet): void; } } declare namespace std.HashMultiSet { @@ -6070,7 +6056,7 @@ declare namespace std { *

    Hashed, unordered Multiset.

    * *

    {@link HashMultiSet HashMultiSets} are containers that store elements in no particular order, allowing fast - * retrieval of individual elements based on their value, much like {@link HashSet} containers, + * retrieval of individual elements based on their value, much like {@link HashMultiSet} containers, * but allowing different elements to have equivalent values.

    * *

    In an {@link HashMultiSet}, the value of an element is at the same time its key, used to @@ -6116,13 +6102,21 @@ declare namespace std { */ private hash_buckets_; /** - * @hidden + * Default Constructor. */ - protected init(): void; + constructor(); /** - * @hidden + * Construct from elements. */ - protected construct_from_array(items: Array): void; + constructor(items: T[]); + /** + * Copy Constructor. + */ + constructor(container: HashMultiSet); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator, end: Iterator); /** * @inheritdoc */ @@ -6198,31 +6192,45 @@ declare namespace std { /** * @hidden */ - protected insert_by_val(val: T): any; + protected _Insert_by_val(val: T): any; /** * @hidden */ - protected insert_by_hint(hint: SetIterator, val: T): SetIterator; + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; /** * @hidden */ - protected insert_by_range>(first: InputIterator, last: InputIterator): void; + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; /** * @inheritdoc */ - protected handle_insert(first: SetIterator, last: SetIterator): void; + protected _Handle_insert(first: SetIterator, last: SetIterator): void; /** * @inheritdoc */ - protected handle_erase(first: SetIterator, last: SetIterator): void; + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link HashMultiSet set} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link HashMultiSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashMultiSet container}. + */ + swap(obj: HashMultiSet): void; /** * @inheritdoc */ - swap(obj: base.MultiSet): void; - /** - * @hidden - */ - private swap_tree_set(obj); + swap(obj: base.IContainer): void; } } declare namespace std.base { @@ -6344,10 +6352,6 @@ declare namespace std.base { * @inheritdoc */ insert>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - swap(obj: UniqueSet): void; } } declare namespace std.HashSet { @@ -6399,19 +6403,27 @@ declare namespace std { * @reference http://www.cplusplus.com/reference/unordered_set/unordered_set * @author Jeongho Nam */ - class HashSet extends base.UniqueSet { + class HashSet extends base.UniqueSet implements base.IHashSet { /** * @hidden */ private hash_buckets_; /** - * @hidden + * Default Constructor. */ - protected init(): void; + constructor(); /** - * @hidden + * Construct from elements. */ - protected construct_from_array(items: Array): void; + constructor(items: T[]); + /** + * Copy Constructor. + */ + constructor(container: HashSet); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator, end: Iterator); /** * @inheritdoc */ @@ -6483,31 +6495,45 @@ declare namespace std { /** * @hidden */ - protected insert_by_val(val: T): any; + protected _Insert_by_val(val: T): any; /** * @hidden */ - protected insert_by_hint(hint: SetIterator, val: T): SetIterator; + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; /** * @hidden */ - protected insert_by_range>(first: InputIterator, last: InputIterator): void; + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; /** * @inheritdoc */ - protected handle_insert(first: SetIterator, last: SetIterator): void; + protected _Handle_insert(first: SetIterator, last: SetIterator): void; /** * @inheritdoc */ - protected handle_erase(first: SetIterator, last: SetIterator): void; + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link HashSet set} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link HashSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashSet container}. + */ + swap(obj: HashSet): void; /** * @inheritdoc */ - swap(obj: base.UniqueSet): void; - /** - * @hidden - */ - private swap_tree_set(obj); + swap(obj: base.IContainer): void; } } declare namespace std.List { @@ -6563,15 +6589,15 @@ declare namespace std { /** * @hidden */ - protected begin_: ListIterator; + private begin_; /** * @hidden */ - protected end_: ListIterator; + private end_; /** * @hidden */ - protected size_: number; + private size_; /** *

    Default Constructor.

    * @@ -6604,7 +6630,7 @@ declare namespace std { * @param container Another container object of the same type (with the same class template * arguments T), whose contents are either copied or acquired. */ - constructor(container: base.IContainer); + constructor(container: List); /** *

    Range Constructor.

    * @@ -6794,11 +6820,11 @@ declare namespace std { /** * @hidden */ - protected insert_by_repeating_val(position: ListIterator, size: number, val: T): ListIterator; + protected _Insert_by_repeating_val(position: ListIterator, size: number, val: T): ListIterator; /** * @hidden */ - protected insert_by_range>(position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; + protected _Insert_by_range>(position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; /** *

    Erase an element.

    * @@ -6868,7 +6894,7 @@ declare namespace std { /** * @hidden */ - protected erase_by_range(first: ListIterator, last: ListIterator): ListIterator; + protected _Erase_by_range(first: ListIterator, last: ListIterator): ListIterator; /** *

    Remove duplicate values.

    * @@ -7105,14 +7131,28 @@ declare namespace std { * @hidden */ private partition(first, last, compare); + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link List container} object with same type of elements. Sizes and container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link List container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link container List}. + */ + swap(obj: List): void; /** * @inheritdoc */ swap(obj: base.IContainer): void; - /** - * @hidden - */ - private swap_list(obj); } } declare namespace std { @@ -7142,14 +7182,6 @@ declare namespace std { * @param value Value to be stored in the node (iterator). */ constructor(source: List, prev: ListIterator, next: ListIterator, value: T); - /** - * @inheritdoc - */ - set_prev(it: ListIterator): void; - /** - * @inheritdoc - */ - set_next(next: ListIterator): void; private list(); /** * @inheritdoc @@ -7172,6 +7204,14 @@ declare namespace std { * @param val Value to set. */ value: T; + /** + * @hidden + */ + _Set_prev(it: ListIterator): void; + /** + * @hidden + */ + _Set_next(it: ListIterator): void; /** * @inheritdoc */ @@ -7204,7 +7244,10 @@ declare namespace std { /** * @hidden */ - protected create_neighbor(): ListReverseIterator; + protected create_neighbor(base: ListIterator): ListReverseIterator; + /** + * @inheritdoc + */ /** * Set value of the iterator is pointing to. * @@ -7213,6 +7256,192 @@ declare namespace std { value: T; } } +declare namespace std { + /** + *

    Priority queue.

    + * + *

    {@link PriorityQueue Priority queues} are a type of container adaptors, specifically designed such that its + * first element is always the greatest of the elements it contains, according to some strict weak ordering + * criterion.

    + * + *

    This context is similar to a heap, where elements can be inserted at any moment, and only the + * max heap element can be retrieved (the one at the top in the {@link PriorityQueue priority queue}).

    + * + *

    {@link PriorityQueue Priority queues} are implemented as container adaptors, which are classes that + * use an encapsulated object of a specific container class as its {@link container_ underlying container}, + * providing a specific set of member functions to access its elements. Elements are popped from the "back" + * of the specific container, which is known as the top of the {@link PriorityQueue Priority queue}.

    + * + *

    The {@link container_ underlying container} may be any of the standard container class templates or some + * other specifically designed container class. The container shall be accessible through + * {@link IArrayIterator random access iterators} and support the following operations:

    + * + *
      + *
    • empty()
    • + *
    • size()
    • + *
    • front()
    • + *
    • push_back()
    • + *
    • pop_back()
    • + *
    + * + *

    The standard container classes {@link Vector} and {@link Deque} fulfill these requirements. By default, if + * no container class is specified for a particular {@link PriorityQueue} class instantiation, the standard + * container {@link Vector} is used.

    + * + *

    Support of {@link IArrayIterator random access iterators} is required to keep a heap structure internally + * at all times. This is done automatically by the container adaptor by automatically calling the algorithm + * functions make_heap, push_heap and pop_heap when needed.

    + * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/queue/priority_queue/ + * @author Jeongho Nam + */ + class PriorityQueue { + /** + *

    The underlying container for implementing the priority queue.

    + * + *

    Following standard definition from the C++ committee, the underlying container should be one of + * {@link Vector} or {@link Deque}, however, I've adopted {@link TreeMultiSet} instead of them. Of course, + * there are proper reasons for adapting the {@link TreeMultiSet} even violating standard advice.

    + * + *

    Underlying container of {@link PriorityQueue} must keep a condition; the highest (or lowest) + * element must be placed on the terminal node for fast retrieval and deletion. To keep the condition with + * {@link Vector} or {@link Deque}, lots of times will only be spent for re-arranging elements. It calls + * rearrangement functions like make_heap, push_heap and pop_head for rearrangement.

    + * + *

    However, the {@link TreeMultiSet} container always keeps arrangment automatically without additional + * operations and it even meets full criteria of {@link PriorityQueue}. Those are the reason why I've adopted + * {@link TreeMultiSet} as the underlying container of {@link PriorityQueue}.

    + */ + private container_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (left: T, right: T) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array); + /** + * Contruct from elements with compare. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array, compare: (left: T, right: T) => boolean); + /** + * Copy Constructor. + */ + constructor(container: base.IContainer); + /** + * Copy Constructor with compare. + * + * @param container A container to be copied. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: base.IContainer, compare: (left: T, right: T) => boolean); + /** + * Range Constructor. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * Range Constructor with compare. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator, end: Iterator, compare: (left: T, right: T) => boolean); + /** + *

    Return size.

    + * + *

    Returns the number of elements in the {@link PriorityQueue}.

    + * + *

    This member function effectively calls member {@link IArray.size size} of the + * {@link container_ underlying container} object.

    + * + * @return The number of elements in the underlying + */ + size(): number; + /** + *

    Test whether container is empty.

    + * + *

    Returns whether the {@link PriorityQueue} is empty: i.e. whether its {@link size} is zero.

    + * + *

    This member function effectively calls member {@link IARray.empty empty} of the + * {@link container_ underlying container} object.

    + */ + empty(): boolean; + /** + *

    Access top element.

    + * + *

    Returns a constant reference to the top element in the {@link PriorityQueue}.

    + * + *

    The top element is the element that compares higher in the {@link PriorityQueue}, and the next that is + * removed from the container when {@link PriorityQueue.pop} is called.

    + * + *

    This member function effectively calls member {@link IArray.front front} of the + * {@link container_ underlying container} object.

    + * + * @return A reference to the top element in the {@link PriorityQueue}. + */ + top(): T; + /** + *

    Insert element.

    + * + *

    Inserts a new element in the {@link PriorityQueue}. The content of this new element is initialized to + * val. + * + *

    This member function effectively calls the member function {@link IArray.push_back push_back} of the + * {@link container_ underlying container} object, and then reorders it to its location in the heap by calling + * the push_heap algorithm on the range that includes all the elements of the

    + * + * @param val Value to which the inserted element is initialized. + */ + push(val: T): void; + /** + *

    Remove top element.

    + * + *

    Removes the element on top of the {@link PriorityQueue}, effectively reducing its {@link size} by one. + * The element removed is the one with the highest (or lowest) value.

    + * + *

    The value of this element can be retrieved before being popped by calling member + * {@link PriorityQueue.top}.

    + * + *

    This member function effectively calls the pop_heap algorithm to keep the heap property of + * {@link PriorityQueue PriorityQueues} and then calls the member function {@link IArray.pop_back pop_back} of + * the {@link container_ underlying container} object to remove the element.

    + */ + pop(): void; + /** + *

    Swap contents.

    + * + *

    Exchanges the contents of the container adaptor by those of obj, swapping both the + * {@link container_ underlying container} value and their comparison function using the corresponding + * {@link std.swap swap} non-member functions (unqualified).

    + * + *

    This member function has a noexcept specifier that matches the combined noexcept of the + * {@link IArray.swap swap} operations on the {@link container_ underlying container} and the comparison + * functions.

    + * + * @param obj {@link PriorityQueue} container adaptor of the same type (i.e., instantiated with the same + * template parameters, T). Sizes may differ. + */ + swap(obj: PriorityQueue): void; + } +} declare namespace std { /** *

    FIFO queue.

    @@ -7349,204 +7578,6 @@ declare namespace std { swap(obj: Queue): void; } } -declare namespace std { - /** - *

    Priority queue.

    - * - *

    {@link PriorityQueue Priority queues} are a type of container adaptors, specifically designed such that its - * first element is always the greatest of the elements it contains, according to some strict weak ordering - * criterion.

    - * - *

    This context is similar to a heap, where elements can be inserted at any moment, and only the - * max heap element can be retrieved (the one at the top in the {@link PriorityQueue priority queue}).

    - * - *

    {@link PriorityQueue Priority queues} are implemented as container adaptors, which are classes that - * use an encapsulated object of a specific container class as its {@link container_ underlying container}, - * providing a specific set of member functions to access its elements. Elements are popped from the "back" - * of the specific container, which is known as the top of the {@link PriorityQueue Priority queue}.

    - * - *

    The {@link container_ underlying container} may be any of the standard container class templates or some - * other specifically designed container class. The container shall be accessible through - * {@link IArrayIterator random access iterators} and support the following operations:

    - * - *
      - *
    • empty()
    • - *
    • size()
    • - *
    • front()
    • - *
    • push_back()
    • - *
    • pop_back()
    • - *
    - * - *

    The standard container classes {@link Vector} and {@link Deque} fulfill these requirements. By default, if - * no container class is specified for a particular {@link PriorityQueue} class instantiation, the standard - * container {@link Vector} is used.

    - * - *

    Support of {@link IArrayIterator random access iterators} is required to keep a heap structure internally - * at all times. This is done automatically by the container adaptor by automatically calling the algorithm - * functions make_heap, push_heap and pop_heap when needed.

    - * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/queue/priority_queue/ - * @author Jeongho Nam - */ - class PriorityQueue { - /** - *

    The underlying container for implementing the priority queue.

    - * - *

    Following standard definition from the C++ committee, the underlying container should be one of - * {@link Vector} or {@link Deque}, however, I've adopted {@link TreeMultiSet} instead of them. Of course, - * there are proper reasons for adapting the {@link TreeMultiSet} even violating standard advice.

    - * - *

    Underlying container of {@link PriorityQueue} must keep a condition; the highest (or lowest) - * element must be placed on the terminal node for fast retrieval and deletion. To keep the condition with - * {@link Vector} or {@link Deque}, lots of times will only be spent for re-arranging elements. It calls - * rearrangement functions like make_heap, push_heap and pop_head for rearrangement.

    - * - *

    However, the {@link TreeMultiSet} container always keeps arrangment automatically without additional - * operations and it even meets full criteria of {@link PriorityQueue}. Those are the reason why I've adopted - * {@link TreeMultiSet} as the underlying container of {@link PriorityQueue}.

    - */ - private container_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (left: T, right: T) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array); - /** - * Contruct from elements with compare. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array, compare: (left: T, right: T) => boolean); - /** - * Copy Constructor. - */ - constructor(container: base.Container); - /** - * Copy Constructor with compare. - * - * @param container A container to be copied. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: base.Container, compare: (left: T, right: T) => boolean); - /** - * Range Constructor. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * Range Constructor with compare. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator, end: Iterator, compare: (left: T, right: T) => boolean); - /** - * @hidden - */ - protected construct_from_array(items: Array): void; - /** - * @hidden - */ - protected construct_from_container(container: base.IContainer): void; - /** - * @hidden - */ - protected construct_from_range(begin: Iterator, end: Iterator): void; - /** - *

    Return size.

    - * - *

    Returns the number of elements in the {@link PriorityQueue}.

    - * - *

    This member function effectively calls member {@link IArray.size size} of the - * {@link container_ underlying container} object.

    - * - * @return The number of elements in the underlying - */ - size(): number; - /** - *

    Test whether container is empty.

    - * - *

    Returns whether the {@link PriorityQueue} is empty: i.e. whether its {@link size} is zero.

    - * - *

    This member function effectively calls member {@link IARray.empty empty} of the - * {@link container_ underlying container} object.

    - */ - empty(): boolean; - /** - *

    Access top element.

    - * - *

    Returns a constant reference to the top element in the {@link PriorityQueue}.

    - * - *

    The top element is the element that compares higher in the {@link PriorityQueue}, and the next that is - * removed from the container when {@link PriorityQueue.pop} is called.

    - * - *

    This member function effectively calls member {@link IArray.front front} of the - * {@link container_ underlying container} object.

    - * - * @return A reference to the top element in the {@link PriorityQueue}. - */ - top(): T; - /** - *

    Insert element.

    - * - *

    Inserts a new element in the {@link PriorityQueue}. The content of this new element is initialized to - * val. - * - *

    This member function effectively calls the member function {@link IArray.push_back push_back} of the - * {@link container_ underlying container} object, and then reorders it to its location in the heap by calling - * the push_heap algorithm on the range that includes all the elements of the

    - * - * @param val Value to which the inserted element is initialized. - */ - push(val: T): void; - /** - *

    Remove top element.

    - * - *

    Removes the element on top of the {@link PriorityQueue}, effectively reducing its {@link size} by one. - * The element removed is the one with the highest (or lowest) value.

    - * - *

    The value of this element can be retrieved before being popped by calling member - * {@link PriorityQueue.top}.

    - * - *

    This member function effectively calls the pop_heap algorithm to keep the heap property of - * {@link PriorityQueue PriorityQueues} and then calls the member function {@link IArray.pop_back pop_back} of - * the {@link container_ underlying container} object to remove the element.

    - */ - pop(): void; - /** - *

    Swap contents.

    - * - *

    Exchanges the contents of the container adaptor by those of obj, swapping both the - * {@link container_ underlying container} value and their comparison function using the corresponding - * {@link std.swap swap} non-member functions (unqualified).

    - * - *

    This member function has a noexcept specifier that matches the combined noexcept of the - * {@link IArray.swap swap} operations on the {@link container_ underlying container} and the comparison - * functions.

    - * - * @param obj {@link PriorityQueue} container adaptor of the same type (i.e., instantiated with the same - * template parameters, T). Sizes may differ. - */ - swap(obj: PriorityQueue): void; - } -} declare namespace std { /** *

    LIFO stack.

    @@ -8142,14 +8173,14 @@ declare namespace std { * * @param container Another map to copy. */ - constructor(container: base.MapContainer); + constructor(container: TreeMap); /** * Copy Constructor. * * @param container Another map to copy. * @param compare A binary predicate determines order of elements. */ - constructor(container: base.MapContainer, compare: (x: Key, y: Key) => boolean); + constructor(container: TreeMap, compare: (x: Key, y: Key) => boolean); /** * Range Constructor. * @@ -8196,31 +8227,45 @@ declare namespace std { /** * @hidden */ - protected insert_by_pair(pair: Pair): any; + protected _Insert_by_pair(pair: Pair): any; /** * @hidden */ - protected insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; /** * @hidden */ - protected insert_by_range>>(first: InputIterator, last: InputIterator): void; + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; /** * @inheritdoc */ - protected handle_insert(first: MapIterator, last: MapIterator): void; + protected _Handle_insert(first: MapIterator, last: MapIterator): void; /** * @inheritdoc */ - protected handle_erase(first: MapIterator, last: MapIterator): void; + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link TreeMap map} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link TreeMap map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeMap container}. + */ + swap(obj: TreeMap): void; /** * @inheritdoc */ - swap(obj: base.UniqueMap): void; - /** - * @hidden - */ - private swap_tree_map(obj); + swap(obj: base.IContainer>): void; } } declare namespace std.TreeMultiMap { @@ -8330,14 +8375,14 @@ declare namespace std { * * @param container Another map to copy. */ - constructor(container: base.MapContainer); + constructor(container: TreeMultiMap); /** * Copy Constructor. * * @param container Another map to copy. * @param compare A binary predicate determines order of elements. */ - constructor(container: base.MapContainer, compare: (x: Key, y: Key) => boolean); + constructor(container: TreeMultiMap, compare: (x: Key, y: Key) => boolean); /** * Range Constructor. * @@ -8388,31 +8433,45 @@ declare namespace std { /** * @hidden */ - protected insert_by_pair(pair: Pair): any; + protected _Insert_by_pair(pair: Pair): any; /** * @hidden */ - protected insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; /** * @hidden */ - protected insert_by_range>>(first: InputIterator, last: InputIterator): void; + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; /** * @inheritdoc */ - protected handle_insert(first: MapIterator, last: MapIterator): void; + protected _Handle_insert(first: MapIterator, last: MapIterator): void; /** * @inheritdoc */ - protected handle_erase(first: MapIterator, last: MapIterator): void; + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link TreeMapMulti map} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link TreeMapMulti map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeMapMulti container}. + */ + swap(obj: TreeMultiMap): void; /** * @inheritdoc */ - swap(obj: base.MultiMap): void; - /** - * @hidden - */ - private swap_tree_multimap(obj); + swap(obj: base.IContainer>): void; } } declare namespace std.TreeMultiSet { @@ -8501,14 +8560,14 @@ declare namespace std { /** * Copy Constructor. */ - constructor(container: base.Container); + constructor(container: TreeMultiSet); /** * Copy Constructor with compare. * * @param container A container to be copied. * @param compare A binary predicate determines order of elements. */ - constructor(container: base.Container, compare: (x: T, y: T) => boolean); + constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); /** * Range Constructor. * @@ -8559,31 +8618,49 @@ declare namespace std { /** * @hidden */ - protected insert_by_val(val: T): any; + _Get_tree(): base.AtomicTree; /** * @hidden */ - protected insert_by_hint(hint: SetIterator, val: T): SetIterator; + protected _Insert_by_val(val: T): any; /** * @hidden */ - protected insert_by_range>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected handle_insert(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - protected handle_erase(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - swap(obj: base.MultiSet): void; + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; /** * @hidden */ - private swap_tree_set(obj); + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link TreeMultiSet set} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link TreeMultiSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeMultiSet container}. + */ + swap(obj: TreeMultiSet): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; } } declare namespace std.TreeSet { @@ -8671,14 +8748,14 @@ declare namespace std { /** * Copy Constructor. */ - constructor(container: base.IContainer); + constructor(container: TreeMultiSet); /** * Copy Constructor with compare. * * @param container A container to be copied. * @param compare A binary predicate determines order of elements. */ - constructor(container: base.IContainer, compare: (x: T, y: T) => boolean); + constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); /** * Range Constructor. * @@ -8687,7 +8764,7 @@ declare namespace std { */ constructor(begin: Iterator, end: Iterator); /** - * Range Constructor with compare. + * Construct from range and compare. * * @param begin Input interator of the initial position in a sequence. * @param end Input interator of the final position in a sequence. @@ -8725,28 +8802,42 @@ declare namespace std { /** * @hidden */ - protected insert_by_val(val: T): any; - protected insert_by_hint(hint: SetIterator, val: T): SetIterator; + protected _Insert_by_val(val: T): any; + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; /** * @hidden */ - protected insert_by_range>(first: InputIterator, last: InputIterator): void; + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; /** * @inheritdoc */ - protected handle_insert(first: SetIterator, last: SetIterator): void; + protected _Handle_insert(first: SetIterator, last: SetIterator): void; /** * @inheritdoc */ - protected handle_erase(first: SetIterator, last: SetIterator): void; + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link TreeSet set} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link TreeSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeSet container}. + */ + swap(obj: TreeSet): void; /** * @inheritdoc */ - swap(obj: base.UniqueSet): void; - /** - * @hidden - */ - private swap_tree_set(obj); + swap(obj: base.IContainer): void; } } declare namespace std { @@ -8880,7 +8971,7 @@ declare namespace std { * @reference http://www.cplusplus.com/reference/vector/vector * @author Jeongho Nam */ - class Vector extends Array implements base.IArrayContainer { + class Vector extends Array implements base.IContainer, base.IArrayContainer { /** *

    Default Constructor.

    * @@ -8917,7 +9008,7 @@ declare namespace std { * @param container Another container object of the same type (with the same class template * arguments T), whose contents are either copied or acquired. */ - constructor(container: base.IContainer); + constructor(container: Vector); /** *

    Range Constructor.

    * @@ -9137,11 +9228,11 @@ declare namespace std { /** * @hidden */ - protected insert_by_repeating_val(position: VectorIterator, n: number, val: T): VectorIterator; + protected _Insert_by_repeating_val(position: VectorIterator, n: number, val: T): VectorIterator; /** * @hidden */ - protected insert_by_range>(position: VectorIterator, first: InputIterator, last: InputIterator): VectorIterator; + protected _Insert_by_range>(position: VectorIterator, first: InputIterator, last: InputIterator): VectorIterator; /** * @inheritdoc */ @@ -9227,7 +9318,25 @@ declare namespace std { /** * @hidden */ - protected erase_by_range(first: VectorIterator, last: VectorIterator): VectorIterator; + protected _Erase_by_range(first: VectorIterator, last: VectorIterator): VectorIterator; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link Vector container} object with same type of elements. Sizes and container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link Vector container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link container Vector}. + */ + obj(obj: Vector): void; /** * @inheritdoc */ @@ -9335,7 +9444,10 @@ declare namespace std { /** * @hidden */ - protected create_neighbor(): VectorReverseIterator; + protected create_neighbor(base: VectorIterator): VectorReverseIterator; + /** + * @inheritdoc + */ /** * Set value of the iterator is pointing to. * @@ -11328,6 +11440,7 @@ declare namespace std.base { * Default Constructor. */ constructor(map: TreeMap | TreeMultiMap, compare?: (x: Key, y: Key) => boolean); + _Set_compare(val: (x: Key, y: Key) => boolean): void; find(key: Key): XTreeNode>; find(it: MapIterator): XTreeNode>; /** @@ -11628,6 +11741,7 @@ declare namespace std.base { * Default Constructor. */ constructor(set: TreeSet | TreeMultiSet, compare?: (x: T, y: T) => boolean); + _Set_compare(val: (x: T, y: T) => boolean): void; find(val: T): XTreeNode>; find(it: SetIterator): XTreeNode>; /** From c4bd0cb8a6f4819b3411e16df40666a25f5b5dd2 Mon Sep 17 00:00:00 2001 From: cailenmusselman Date: Tue, 20 Sep 2016 15:40:16 -0600 Subject: [PATCH 02/28] Update react-native.d.ts static "positions" is missing from DrawerLayoutAndroid. From DrawerLayout.android.js: var DrawerLayoutAndroid = React.createClass({ statics: { positions: DrawerConsts.DrawerPosition, } ... } --- react-native/react-native.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/react-native/react-native.d.ts b/react-native/react-native.d.ts index 732e4aacde..2c1eb01234 100644 --- a/react-native/react-native.d.ts +++ b/react-native/react-native.d.ts @@ -1930,6 +1930,14 @@ declare namespace __React { export interface DrawerLayoutAndroidStatic extends React.ComponentClass { + /** + * Specifies the side of the screen from which the drawer will slide in. + */ + positions: { + Left: number; + Right: number; + } + /** * Opens the drawer. */ From 92615efde02e7209b240bd044eff713ced86fd48 Mon Sep 17 00:00:00 2001 From: Subhash Sharma Date: Fri, 23 Sep 2016 15:48:21 +0530 Subject: [PATCH 03/28] fixed type definitions for DropdownList and Combobox --- react-widgets/react-widgets.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/react-widgets/react-widgets.d.ts b/react-widgets/react-widgets.d.ts index bbd81dd7c8..aced7ddf87 100644 --- a/react-widgets/react-widgets.d.ts +++ b/react-widgets/react-widgets.d.ts @@ -63,7 +63,7 @@ declare module 'react-widgets/lib/Combobox' { * textField` prop may also also used as to find an item in the list as you type. Providing * an accessor function allows for computed text values */ - textField?: string; + textField?: string | ((dataItem: any) => string); /** * This component is used to render each possible item in the Combobox. The default * component renders the text of the selected item (specified by textfield) @@ -157,7 +157,7 @@ declare module 'react-widgets/lib/DateTimePicker' { interface DateTimePickerProps extends __React.Props { /** - * Whether to show the date picker button. + * Whether to show the date picker button. * @default true */ calendar?: boolean; @@ -330,8 +330,8 @@ declare module 'react-widgets/lib/Multiselect' { /** * A dataItem field name for uniquely identifying items in the data list. A valueField is * required when the value prop is not itself a dataItem. A valueField is useful when - * specifying the selected item, by its id instead of using the model as the value. - * When a valueField is not provided, the Multiselect will use strict equality checks (===) + * specifying the selected item, by its id instead of using the model as the value. + * When a valueField is not provided, the Multiselect will use strict equality checks (===) * to locate the value in the data list. */ valueField?: string; @@ -823,7 +823,7 @@ declare module 'react-widgets/lib/DropdownList' { * ThetextFieldprop may also also used as to find an item in the list as you type. Providing * an accessor function allows for computed text values */ - textField?: string; + textField?: string | ((dataItem: any) => string); /** * This component is used to render the selected value of the DropdownList. The default * component renders the text of the selected item (specified by textfield) @@ -881,9 +881,9 @@ declare module 'react-widgets/lib/DropdownList' { */ onToggle?: (isOpen: boolean) => void; /** - * Specify a filtering method used to reduce the items in the dropdown as you type. + * Specify a filtering method used to reduce the items in the dropdown as you type. * There are a few built-in filtering methods that can be specified by passing the String name. - * To handle custom filtering techniques provide a function that returns true or false + * To handle custom filtering techniques provide a function that returns true or false * for each passed in item (analogous to the array.filter builtin) * @enum false "startsWith" "endsWith" "contains" */ From ad537776dbcfa2dd4bfbc32dc87041d649068179 Mon Sep 17 00:00:00 2001 From: Tsvetomir Tsonev Date: Fri, 23 Sep 2016 14:38:12 +0300 Subject: [PATCH 04/28] feat: upgrade Kendo UI definitions for the 2016.3.914 release (#11320) --- kendo-ui/kendo-ui.d.ts | 12821 ++++++++++++++++++++------------------- 1 file changed, 6699 insertions(+), 6122 deletions(-) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index e8f02f1776..8ebef4104a 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Kendo UI Professional v2016.1.314 +// Type definitions for Kendo UI Professional v2016.3.914 // Project: http://www.telerik.com/kendo-ui // Definitions by: Telerik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -89,10 +89,40 @@ declare namespace kendo { }; }; - var cultures: { - [culture: string]: { - name?: string; - calendar?: { + var cultures: {[culture: string] : { + name?: string; + calendar?: { + AM: string[]; + PM: string[]; + days: { + names: string[]; + namesAbbr: string[]; + namesShort: string[]; + firstDay: number; + }; + months: { + names: string[]; + namesAbbr: string[]; + }; + patterns: { + D: string; + F: string; + G: string; + M: string; + T: string; + Y: string; + d: string; + g: string; + m: string; + s: string; + t: string; + u: string; + y: string; + }; + twoDigitYearMax: number; + }; + calendars?: { + standard: { AM: string[]; PM: string[]; days: { @@ -122,57 +152,25 @@ declare namespace kendo { }; twoDigitYearMax: number; }; - calendars?: { - standard: { - AM: string[]; - PM: string[]; - days: { - names: string[]; - namesAbbr: string[]; - namesShort: string[]; - firstDay: number; - }; - months: { - names: string[]; - namesAbbr: string[]; - }; - patterns: { - D: string; - F: string; - G: string; - M: string; - T: string; - Y: string; - d: string; - g: string; - m: string; - s: string; - t: string; - u: string; - y: string; - }; - twoDigitYearMax: number; - }; - }; - numberFormat?: { - currency: { - decimals: number; - groupSize: number[]; - pattern: string[]; - symbol: string; - }; + }; + numberFormat?: { + currency: { decimals: number; groupSize: number[]; pattern: string[]; - percent: { - decimals: number; - groupSize: number[]; - pattern: string[]; - symbol: string; - }; + symbol: string; }; - } - }; + decimals: number; + groupSize: number[]; + pattern: string[]; + percent: { + decimals: number; + groupSize: number[]; + pattern: string[]; + symbol: string; + }; + }; + }}; function format(format: string, ...values: any[]): string; @@ -490,8 +488,8 @@ declare namespace kendo.data { change(e: Object): void; start(source: kendo.Observable): void; stop(source: kendo.Observable): void; - get(): any; - set(value: any): void; + get (): any; + set (value: any): void; destroy(): void; } @@ -502,7 +500,7 @@ declare namespace kendo.data { } class EventBinding extends Binding { - get(): void; + get (): void; } class TemplateBinding extends Binding { @@ -533,7 +531,7 @@ declare namespace kendo.data { interface BinderOptions { } - class ObservableObject extends Observable { + class ObservableObject extends Observable{ constructor(value?: any); uid: string; init(value?: any): void; @@ -1302,10 +1300,10 @@ declare namespace kendo.ui { function progress(container: JQuery, toggle: boolean): void; class Widget extends Observable { - static fn: Widget; + static fn: any; element: JQuery; - options: Object; + options: any; events: string[]; static extend(prototype: Object): Widget; @@ -1388,33 +1386,40 @@ declare namespace kendo.ui { } interface DropTargetAreaDragenterEvent extends DropTargetAreaEvent { - draggable?: JQuery; + draggable?: kendo.ui.Draggable; dropTarget?: JQuery; + target?: Element; } interface DropTargetAreaDragleaveEvent extends DropTargetAreaEvent { - draggable?: JQuery; + draggable?: kendo.ui.Draggable; dropTarget?: JQuery; + target?: Element; } interface DropTargetAreaDropEvent extends DropTargetAreaEvent { draggable?: kendo.ui.Draggable; dropTarget?: JQuery; + target?: Element; } interface DraggableOptions { axis?: string; + autoScroll?: boolean; container?: JQuery; cursorOffset?: any; distance?: number; filter?: string; group?: string; - hint?: Function; + hint?: Function|JQuery; + holdToDrag?: boolean; ignore?: string; + cancelHold(): void; drag?(e: DraggableEvent): void; dragcancel?(e: DraggableEvent): void; dragend?(e: DraggableEvent): void; dragstart?(e: DraggableEvent): void; + hold?(e: DraggableEvent): void; } interface GridColumnEditorOptions { @@ -1523,270 +1528,6036 @@ declare namespace kendo.drawing.pdf { proxyUrl?: string, callback?: Function): void; } -declare namespace kendo.geometry { - class Arc extends Observable { +declare namespace kendo.ui { + class Alert extends kendo.ui.Widget { + + static fn: Alert; + + options: AlertOptions; - options: ArcOptions; + element: JQuery; + wrapper: JQuery; - anticlockwise: boolean; - center: kendo.geometry.Point; - endAngle: number; - radiusX: number; - radiusY: number; - startAngle: number; + static extend(proto: Object): Alert; + + constructor(element: Element, options?: AlertOptions); - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - getAnticlockwise(): boolean; - getCenter(): kendo.geometry.Point; - getEndAngle(): number; - getRadiusX(): number; - getRadiusY(): number; - getStartAngle(): number; - pointAt(angle: number): kendo.geometry.Point; - setAnticlockwise(value: boolean): kendo.geometry.Arc; - setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; - setEndAngle(value: number): kendo.geometry.Arc; - setRadiusX(value: number): kendo.geometry.Arc; - setRadiusY(value: number): kendo.geometry.Arc; - setStartAngle(value: number): kendo.geometry.Arc; - } - interface ArcOptions { + interface AlertMessages { + okText?: string; + } + + interface AlertOptions { name?: string; + messages?: AlertMessages; } - interface ArcEvent { - sender: Arc; + interface AlertEvent { + sender: Alert; preventDefault: Function; isDefaultPrevented(): boolean; } - class Circle extends Observable { + class AutoComplete extends kendo.ui.Widget { + + static fn: AutoComplete; + + options: AutoCompleteOptions; + + dataSource: kendo.data.DataSource; + list: JQuery; + ul: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): AutoComplete; + + constructor(element: Element, options?: AutoCompleteOptions); - options: CircleOptions; - - center: kendo.geometry.Point; - radius: number; - - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - clone(): kendo.geometry.Circle; - equals(other: kendo.geometry.Circle): boolean; - getCenter(): kendo.geometry.Point; - getRadius(): number; - pointAt(angle: number): kendo.geometry.Point; - setCenter(value: kendo.geometry.Point): kendo.geometry.Point; - setCenter(value: any): kendo.geometry.Point; - setRadius(value: number): kendo.geometry.Circle; + close(): void; + dataItem(index: number): any; + destroy(): void; + enable(enable: boolean): void; + focus(): void; + items(): any; + readonly(readonly: boolean): void; + refresh(): void; + search(word: string): void; + select(item: string): void; + select(item: Element): void; + select(item: JQuery): void; + setDataSource(dataSource: kendo.data.DataSource): void; + suggest(value: string): void; + value(): string; + value(value: string): void; } - interface CircleOptions { + interface AutoCompleteAnimationClose { + duration?: number; + effects?: string; + } + + interface AutoCompleteAnimationOpen { + duration?: number; + effects?: string; + } + + interface AutoCompleteAnimation { + close?: AutoCompleteAnimationClose; + open?: AutoCompleteAnimationOpen; + } + + interface AutoCompleteVirtual { + itemHeight?: number; + mapValueTo?: string; + valueMapper?: Function; + } + + interface AutoCompleteOptions { name?: string; + animation?: boolean|AutoCompleteAnimation; + dataSource?: any|any|kendo.data.DataSource; + clearButton?: boolean; + dataTextField?: string; + delay?: number; + enable?: boolean; + enforceMinLength?: boolean; + filter?: string; + fixedGroupTemplate?: string|Function; + footerTemplate?: string|Function; + groupTemplate?: string|Function; + height?: number; + highlightFirst?: boolean; + ignoreCase?: boolean; + minLength?: number; + noDataTemplate?: string|Function; + placeholder?: string; + popup?: any; + separator?: string|any; + suggest?: boolean; + headerTemplate?: string|Function; + template?: string|Function; + value?: string; + valuePrimitive?: boolean; + virtual?: boolean|AutoCompleteVirtual; + change?(e: AutoCompleteChangeEvent): void; + close?(e: AutoCompleteCloseEvent): void; + dataBound?(e: AutoCompleteDataBoundEvent): void; + filtering?(e: AutoCompleteFilteringEvent): void; + open?(e: AutoCompleteOpenEvent): void; + select?(e: AutoCompleteSelectEvent): void; } - interface CircleEvent { - sender: Circle; + interface AutoCompleteEvent { + sender: AutoComplete; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface AutoCompleteChangeEvent extends AutoCompleteEvent { + } + + interface AutoCompleteCloseEvent extends AutoCompleteEvent { + } + + interface AutoCompleteDataBoundEvent extends AutoCompleteEvent { + } + + interface AutoCompleteFilteringEvent extends AutoCompleteEvent { + filter?: any; + } + + interface AutoCompleteOpenEvent extends AutoCompleteEvent { + } + + interface AutoCompleteSelectEvent extends AutoCompleteEvent { + dataItem?: any; + item?: JQuery; + } + + + class Button extends kendo.ui.Widget { + + static fn: Button; + + options: ButtonOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Button; + + constructor(element: Element, options?: ButtonOptions); + + + enable(toggle: boolean): void; + + } + + interface ButtonOptions { + name?: string; + enable?: boolean; + icon?: string; + imageUrl?: string; + spriteCssClass?: string; + click?(e: ButtonClickEvent): void; + } + interface ButtonEvent { + sender: Button; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ButtonClickEvent extends ButtonEvent { + event?: any; + } + + + class Calendar extends kendo.ui.Widget { + + static fn: Calendar; + + options: CalendarOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Calendar; + + constructor(element: Element, options?: CalendarOptions); + + + current(): Date; + destroy(): void; + max(): Date; + max(value: Date): void; + max(value: string): void; + min(): Date; + min(value: Date): void; + min(value: string): void; + navigate(value: Date, view: string): void; + navigateDown(value: Date): void; + navigateToFuture(): void; + navigateToPast(): void; + navigateUp(): void; + value(): Date; + value(value: Date): void; + value(value: string): void; + view(): any; + + } + + interface CalendarMonth { + content?: string; + empty?: string; + } + + interface CalendarOptions { + name?: string; + culture?: string; + dates?: any; + depth?: string; + disableDates?: any|Function; + footer?: string|Function; + format?: string; + max?: Date; + min?: Date; + month?: CalendarMonth; + start?: string; + value?: Date; + change?(e: CalendarEvent): void; + navigate?(e: CalendarEvent): void; + } + interface CalendarEvent { + sender: Calendar; preventDefault: Function; isDefaultPrevented(): boolean; } - class Matrix extends Observable { + class ColorPalette extends kendo.ui.Widget { + + static fn: ColorPalette; + + options: ColorPaletteOptions; - options: MatrixOptions; + element: JQuery; + wrapper: JQuery; - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; + static extend(proto: Object): ColorPalette; + + constructor(element: Element, options?: ColorPaletteOptions); - static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; - static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; - static translate(x: number, y: number): kendo.geometry.Matrix; - static unit(): kendo.geometry.Matrix; - - clone(): kendo.geometry.Matrix; - equals(other: kendo.geometry.Matrix): boolean; - round(digits: number): kendo.geometry.Matrix; - multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; - toArray(digits: number): any; - toString(digits: number, separator: string): string; + value(): string; + value(color?: string): void; + color(): kendo.Color; + color(color?: kendo.Color): void; + enable(enable?: boolean): void; } - interface MatrixOptions { + interface ColorPaletteTileSize { + width?: number; + height?: number; + } + + interface ColorPaletteOptions { name?: string; + palette?: string|any; + columns?: number; + tileSize?: ColorPaletteTileSize; + value?: string; + change?(e: ColorPaletteEvent): void; } - interface MatrixEvent { - sender: Matrix; + interface ColorPaletteEvent { + sender: ColorPalette; preventDefault: Function; isDefaultPrevented(): boolean; } - class Point extends Observable { + class ColorPicker extends kendo.ui.Widget { + + static fn: ColorPicker; + + options: ColorPickerOptions; - options: PointOptions; + element: JQuery; + wrapper: JQuery; - x: number; - y: number; + static extend(proto: Object): ColorPicker; - constructor(x: number, y: number); + constructor(element: Element, options?: ColorPickerOptions); - static create(x: number, y: number): kendo.geometry.Point; - static create(x: any, y: number): kendo.geometry.Point; - static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; - static min(): kendo.geometry.Point; - static max(): kendo.geometry.Point; - static minPoint(): kendo.geometry.Point; - static maxPoint(): kendo.geometry.Point; - clone(): kendo.geometry.Point; - distanceTo(point: kendo.geometry.Point): number; - equals(other: kendo.geometry.Point): boolean; - getX(): number; - getY(): number; - move(x: number, y: number): kendo.geometry.Point; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; - rotate(angle: number, center: any): kendo.geometry.Point; - round(digits: number): kendo.geometry.Point; - scale(scaleX: number, scaleY: number): kendo.geometry.Point; - scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; - setX(value: number): kendo.geometry.Point; - setY(value: number): kendo.geometry.Point; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - translate(dx: number, dy: number): kendo.geometry.Point; - translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; - translateWith(vector: any): kendo.geometry.Point; + close(): void; + open(): void; + toggle(): void; + value(): string; + value(color?: string): void; + color(): kendo.Color; + color(color?: kendo.Color): void; + enable(enable?: boolean): void; } - interface PointOptions { + interface ColorPickerMessages { + apply?: string; + cancel?: string; + } + + interface ColorPickerTileSize { + width?: number; + height?: number; + } + + interface ColorPickerOptions { name?: string; + buttons?: boolean; + columns?: number; + tileSize?: ColorPickerTileSize; + messages?: ColorPickerMessages; + palette?: string|any; + opacity?: boolean; + preview?: boolean; + toolIcon?: string; + value?: string; + change?(e: ColorPickerChangeEvent): void; + select?(e: ColorPickerSelectEvent): void; + open?(e: ColorPickerEvent): void; + close?(e: ColorPickerEvent): void; } - interface PointEvent { - sender: Point; + interface ColorPickerEvent { + sender: ColorPicker; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ColorPickerChangeEvent extends ColorPickerEvent { + value?: string; + } + + interface ColorPickerSelectEvent extends ColorPickerEvent { + value?: string; + } + + + class ComboBox extends kendo.ui.Widget { + + static fn: ComboBox; + + options: ComboBoxOptions; + + dataSource: kendo.data.DataSource; + input: JQuery; + list: JQuery; + ul: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ComboBox; + + constructor(element: Element, options?: ComboBoxOptions); + + + close(): void; + dataItem(index?: number): any; + destroy(): void; + enable(enable: boolean): void; + focus(): void; + items(): any; + open(): void; + readonly(readonly: boolean): void; + refresh(): void; + search(word: string): void; + select(): number; + select(li: JQuery): void; + select(li: number): void; + select(li: Function): void; + setDataSource(dataSource: kendo.data.DataSource): void; + suggest(value: string): void; + text(): string; + text(text: string): void; + toggle(toggle: boolean): void; + value(): string; + value(value: string): void; + + } + + interface ComboBoxAnimationClose { + effects?: string; + duration?: number; + } + + interface ComboBoxAnimationOpen { + effects?: string; + duration?: number; + } + + interface ComboBoxAnimation { + close?: ComboBoxAnimationClose; + open?: ComboBoxAnimationOpen; + } + + interface ComboBoxPopup { + appendTo?: string; + origin?: string; + position?: string; + } + + interface ComboBoxVirtual { + itemHeight?: number; + mapValueTo?: string; + valueMapper?: Function; + } + + interface ComboBoxOptions { + name?: string; + animation?: ComboBoxAnimation; + autoBind?: boolean; + cascadeFrom?: string; + cascadeFromField?: string; + clearButton?: boolean; + dataSource?: any|any|kendo.data.DataSource; + dataTextField?: string; + dataValueField?: string; + delay?: number; + enable?: boolean; + enforceMinLength?: boolean; + filter?: string; + fixedGroupTemplate?: string|Function; + footerTemplate?: string|Function; + groupTemplate?: string|Function; + height?: number; + highlightFirst?: boolean; + ignoreCase?: boolean; + index?: number; + minLength?: number; + noDataTemplate?: string|Function; + placeholder?: string; + popup?: ComboBoxPopup; + suggest?: boolean; + headerTemplate?: string|Function; + template?: string|Function; + text?: string; + value?: string; + valuePrimitive?: boolean; + virtual?: boolean|ComboBoxVirtual; + change?(e: ComboBoxChangeEvent): void; + close?(e: ComboBoxCloseEvent): void; + dataBound?(e: ComboBoxDataBoundEvent): void; + filtering?(e: ComboBoxFilteringEvent): void; + open?(e: ComboBoxOpenEvent): void; + select?(e: ComboBoxSelectEvent): void; + cascade?(e: ComboBoxCascadeEvent): void; + } + interface ComboBoxEvent { + sender: ComboBox; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ComboBoxChangeEvent extends ComboBoxEvent { + } + + interface ComboBoxCloseEvent extends ComboBoxEvent { + } + + interface ComboBoxDataBoundEvent extends ComboBoxEvent { + } + + interface ComboBoxFilteringEvent extends ComboBoxEvent { + filter?: any; + } + + interface ComboBoxOpenEvent extends ComboBoxEvent { + } + + interface ComboBoxSelectEvent extends ComboBoxEvent { + dataItem?: any; + item?: JQuery; + } + + interface ComboBoxCascadeEvent extends ComboBoxEvent { + } + + + class Confirm extends kendo.ui.Widget { + + static fn: Confirm; + + options: ConfirmOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Confirm; + + constructor(element: Element, options?: ConfirmOptions); + + + + } + + interface ConfirmMessages { + okText?: string; + cancel?: string; + } + + interface ConfirmOptions { + name?: string; + messages?: ConfirmMessages; + } + interface ConfirmEvent { + sender: Confirm; preventDefault: Function; isDefaultPrevented(): boolean; } - class Rect extends Observable { + class ContextMenu extends kendo.ui.Widget { + + static fn: ContextMenu; + + options: ContextMenuOptions; - options: RectOptions; + element: JQuery; + wrapper: JQuery; - origin: kendo.geometry.Point; - size: kendo.geometry.Size; + static extend(proto: Object): ContextMenu; - constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); + constructor(element: Element, options?: ContextMenuOptions); - static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; - static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - bottomLeft(): kendo.geometry.Point; - bottomRight(): kendo.geometry.Point; - center(): kendo.geometry.Point; - clone(): kendo.geometry.Rect; - equals(other: kendo.geometry.Rect): boolean; - getOrigin(): kendo.geometry.Point; - getSize(): kendo.geometry.Size; - height(): number; - setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; - setOrigin(value: any): kendo.geometry.Rect; - setSize(value: kendo.geometry.Size): kendo.geometry.Rect; - setSize(value: any): kendo.geometry.Rect; - topLeft(): kendo.geometry.Point; - topRight(): kendo.geometry.Point; - width(): number; + append(item: any, referenceItem?: string): kendo.ui.ContextMenu; + append(item: any, referenceItem?: JQuery): kendo.ui.ContextMenu; + close(element: Element): kendo.ui.ContextMenu; + close(element: JQuery): kendo.ui.ContextMenu; + destroy(): void; + enable(element: string, enable: boolean): kendo.ui.ContextMenu; + enable(element: Element, enable: boolean): kendo.ui.ContextMenu; + enable(element: JQuery, enable: boolean): kendo.ui.ContextMenu; + insertAfter(item: any, referenceItem: string): kendo.ui.ContextMenu; + insertAfter(item: any, referenceItem: Element): kendo.ui.ContextMenu; + insertAfter(item: any, referenceItem: JQuery): kendo.ui.ContextMenu; + insertBefore(item: any, referenceItem: string): kendo.ui.ContextMenu; + insertBefore(item: any, referenceItem: Element): kendo.ui.ContextMenu; + insertBefore(item: any, referenceItem: JQuery): kendo.ui.ContextMenu; + open(x: number, y?: number): kendo.ui.ContextMenu; + open(x: Element, y?: number): kendo.ui.ContextMenu; + open(x: JQuery, y?: number): kendo.ui.ContextMenu; + remove(element: string): kendo.ui.ContextMenu; + remove(element: Element): kendo.ui.ContextMenu; + remove(element: JQuery): kendo.ui.ContextMenu; } - interface RectOptions { + interface ContextMenuAnimationClose { + effects?: string; + duration?: number; + } + + interface ContextMenuAnimationOpen { + effects?: string; + duration?: number; + } + + interface ContextMenuAnimation { + close?: ContextMenuAnimationClose; + open?: ContextMenuAnimationOpen; + } + + interface ContextMenuOptions { name?: string; + alignToAnchor?: boolean; + animation?: boolean|ContextMenuAnimation; + closeOnClick?: boolean; + dataSource?: any|any; + direction?: string; + filter?: string; + hoverDelay?: number; + orientation?: string; + popupCollision?: string; + showOn?: string; + target?: string|JQuery; + close?(e: ContextMenuCloseEvent): void; + open?(e: ContextMenuOpenEvent): void; + activate?(e: ContextMenuActivateEvent): void; + deactivate?(e: ContextMenuDeactivateEvent): void; + select?(e: ContextMenuSelectEvent): void; } - interface RectEvent { - sender: Rect; + interface ContextMenuEvent { + sender: ContextMenu; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ContextMenuCloseEvent extends ContextMenuEvent { + item?: Element; + type?: string; + target?: Element; + event?: JQueryEventObject; + } + + interface ContextMenuOpenEvent extends ContextMenuEvent { + item?: Element; + type?: string; + target?: Element; + event?: JQueryEventObject; + } + + interface ContextMenuActivateEvent extends ContextMenuEvent { + item?: Element; + type?: string; + target?: Element; + } + + interface ContextMenuDeactivateEvent extends ContextMenuEvent { + item?: Element; + type?: string; + target?: Element; + } + + interface ContextMenuSelectEvent extends ContextMenuEvent { + item?: Element; + type?: string; + target?: Element; + } + + + class DatePicker extends kendo.ui.Widget { + + static fn: DatePicker; + + options: DatePickerOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): DatePicker; + + constructor(element: Element, options?: DatePickerOptions); + + + close(): void; + destroy(): void; + enable(enable: boolean): void; + readonly(readonly: boolean): void; + max(): Date; + max(value: Date): void; + max(value: string): void; + min(): Date; + min(value: Date): void; + min(value: string): void; + open(): void; + setOptions(options: any): void; + value(): Date; + value(value: Date): void; + value(value: string): void; + + } + + interface DatePickerAnimationClose { + effects?: string; + duration?: number; + } + + interface DatePickerAnimationOpen { + effects?: string; + duration?: number; + } + + interface DatePickerAnimation { + close?: DatePickerAnimationClose; + open?: DatePickerAnimationOpen; + } + + interface DatePickerMonth { + content?: string; + empty?: string; + } + + interface DatePickerOptions { + name?: string; + animation?: boolean|DatePickerAnimation; + ARIATemplate?: string; + culture?: string; + dates?: any; + depth?: string; + disableDates?: any|Function; + footer?: string|Function; + format?: string; + max?: Date; + min?: Date; + month?: DatePickerMonth; + parseFormats?: any; + start?: string; + value?: Date; + change?(e: DatePickerChangeEvent): void; + close?(e: DatePickerCloseEvent): void; + open?(e: DatePickerOpenEvent): void; + } + interface DatePickerEvent { + sender: DatePicker; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface DatePickerChangeEvent extends DatePickerEvent { + } + + interface DatePickerCloseEvent extends DatePickerEvent { + } + + interface DatePickerOpenEvent extends DatePickerEvent { + } + + + class DateTimePicker extends kendo.ui.Widget { + + static fn: DateTimePicker; + + options: DateTimePickerOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): DateTimePicker; + + constructor(element: Element, options?: DateTimePickerOptions); + + + close(view: string): void; + destroy(): void; + enable(enable: boolean): void; + readonly(readonly: boolean): void; + max(): Date; + max(value: Date): void; + max(value: string): void; + min(): Date; + min(value: Date): void; + min(value: string): void; + open(view: string): void; + setOptions(options: any): void; + toggle(view: string): void; + value(): Date; + value(value: Date): void; + value(value: string): void; + + } + + interface DateTimePickerAnimationClose { + effects?: string; + duration?: number; + } + + interface DateTimePickerAnimationOpen { + effects?: string; + duration?: number; + } + + interface DateTimePickerAnimation { + close?: DateTimePickerAnimationClose; + open?: DateTimePickerAnimationOpen; + } + + interface DateTimePickerMonth { + content?: string; + empty?: string; + } + + interface DateTimePickerOptions { + name?: string; + animation?: boolean|DateTimePickerAnimation; + ARIATemplate?: string; + culture?: string; + dates?: any; + depth?: string; + disableDates?: any|Function; + footer?: string; + format?: string; + interval?: number; + max?: Date; + min?: Date; + month?: DateTimePickerMonth; + parseFormats?: any; + start?: string; + timeFormat?: string; + value?: Date; + change?(e: DateTimePickerChangeEvent): void; + close?(e: DateTimePickerCloseEvent): void; + open?(e: DateTimePickerOpenEvent): void; + } + interface DateTimePickerEvent { + sender: DateTimePicker; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface DateTimePickerChangeEvent extends DateTimePickerEvent { + } + + interface DateTimePickerCloseEvent extends DateTimePickerEvent { + view?: string; + } + + interface DateTimePickerOpenEvent extends DateTimePickerEvent { + view?: string; + } + + + class Dialog extends kendo.ui.Widget { + + static fn: Dialog; + + options: DialogOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Dialog; + + constructor(element: Element, options?: DialogOptions); + + + close(): kendo.ui.Dialog; + content(): string; + content(content?: string): kendo.ui.Dialog; + content(content?: JQuery): kendo.ui.Dialog; + destroy(): void; + open(): kendo.ui.Dialog; + title(): string; + title(text?: string): kendo.ui.Dialog; + toFront(): kendo.ui.Dialog; + + } + + interface DialogAction { + text?: string; + action?: Function; + primary?: boolean; + } + + interface DialogAnimationClose { + effects?: string; + duration?: number; + } + + interface DialogAnimationOpen { + effects?: string; + duration?: number; + } + + interface DialogAnimation { + close?: DialogAnimationClose; + open?: DialogAnimationOpen; + } + + interface DialogMessages { + close?: string; + } + + interface DialogOptions { + name?: string; + actions?: DialogAction[]; + animation?: boolean|DialogAnimation; + buttonLayout?: string; + closable?: boolean; + content?: string; + height?: number|string; + maxHeight?: number; + maxWidth?: number; + messages?: DialogMessages; + minHeight?: number; + minWidth?: number; + modal?: boolean; + title?: string|boolean; + visible?: boolean; + width?: number|string; + close?(e: DialogCloseEvent): void; + hide?(e: DialogEvent): void; + initOpen?(e: DialogEvent): void; + open?(e: DialogEvent): void; + show?(e: DialogEvent): void; + } + interface DialogEvent { + sender: Dialog; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface DialogCloseEvent extends DialogEvent { + userTriggered?: boolean; + } + + + class DropDownList extends kendo.ui.Widget { + + static fn: DropDownList; + + options: DropDownListOptions; + popup: kendo.ui.Popup; + + dataSource: kendo.data.DataSource; + span: JQuery; + filterInput: JQuery; + list: JQuery; + ul: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): DropDownList; + + constructor(element: Element, options?: DropDownListOptions); + + + close(): void; + dataItem(index?: JQuery): any; + dataItem(index?: number): any; + destroy(): void; + focus(): void; + items(): any; + enable(enable: boolean): void; + open(): void; + readonly(readonly: boolean): void; + refresh(): void; + search(word: string): void; + select(): number; + select(li: JQuery): void; + select(li: number): void; + select(li: Function): void; + setDataSource(dataSource: kendo.data.DataSource): void; + text(): string; + text(text: string): void; + toggle(toggle: boolean): void; + value(): string; + value(value: string): void; + + } + + interface DropDownListAnimationClose { + effects?: string; + duration?: number; + } + + interface DropDownListAnimationOpen { + effects?: string; + duration?: number; + } + + interface DropDownListAnimation { + close?: DropDownListAnimationClose; + open?: DropDownListAnimationOpen; + } + + interface DropDownListPopup { + appendTo?: string; + origin?: string; + position?: string; + } + + interface DropDownListVirtual { + itemHeight?: number; + mapValueTo?: string; + valueMapper?: Function; + } + + interface DropDownListOptions { + name?: string; + animation?: boolean|DropDownListAnimation; + autoBind?: boolean; + cascadeFrom?: string; + cascadeFromField?: string; + dataSource?: any|any|kendo.data.DataSource; + dataTextField?: string; + dataValueField?: string; + delay?: number; + enable?: boolean; + enforceMinLength?: boolean; + filter?: string; + fixedGroupTemplate?: string|Function; + footerTemplate?: string|Function; + groupTemplate?: string|Function; + height?: number; + ignoreCase?: boolean; + index?: number; + minLength?: number; + noDataTemplate?: string|Function; + popup?: DropDownListPopup; + optionLabel?: string|any; + optionLabelTemplate?: string|Function; + headerTemplate?: string|Function; + template?: string|Function; + valueTemplate?: string|Function; + text?: string; + value?: string; + valuePrimitive?: boolean; + virtual?: boolean|DropDownListVirtual; + change?(e: DropDownListChangeEvent): void; + close?(e: DropDownListCloseEvent): void; + dataBound?(e: DropDownListDataBoundEvent): void; + filtering?(e: DropDownListFilteringEvent): void; + open?(e: DropDownListOpenEvent): void; + select?(e: DropDownListSelectEvent): void; + cascade?(e: DropDownListCascadeEvent): void; + } + interface DropDownListEvent { + sender: DropDownList; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface DropDownListChangeEvent extends DropDownListEvent { + } + + interface DropDownListCloseEvent extends DropDownListEvent { + } + + interface DropDownListDataBoundEvent extends DropDownListEvent { + } + + interface DropDownListFilteringEvent extends DropDownListEvent { + filter?: any; + } + + interface DropDownListOpenEvent extends DropDownListEvent { + } + + interface DropDownListSelectEvent extends DropDownListEvent { + dataItem?: any; + item?: JQuery; + } + + interface DropDownListCascadeEvent extends DropDownListEvent { + } + + + class Editor extends kendo.ui.Widget { + + static fn: Editor; + + options: EditorOptions; + + body: Element; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Editor; + + constructor(element: Element, options?: EditorOptions); + + + createRange(document?: Document): Range; + destroy(): void; + encodedValue(): void; + exec(name: string, params: any): void; + focus(): void; + getRange(): Range; + getSelection(): Selection; + paste(html: string, options: any): void; + selectedHtml(): string; + refresh(): void; + saveAsPDF(): JQueryPromise; + selectRange(range: Range): void; + update(): void; + state(toolName: string): boolean; + value(): string; + value(value: string): void; + + } + + interface EditorDeserialization { + custom?: Function; + } + + interface EditorFileBrowserMessages { + uploadFile?: string; + orderBy?: string; + orderByName?: string; + orderBySize?: string; + directoryNotFound?: string; + emptyFolder?: string; + deleteFile?: string; + invalidFileType?: string; + overwriteFile?: string; + search?: string; + } + + interface EditorFileBrowserSchemaModelFieldsName { + field?: string; + parse?: Function; + } + + interface EditorFileBrowserSchemaModelFieldsSize { + field?: string; + parse?: Function; + } + + interface EditorFileBrowserSchemaModelFieldsType { + parse?: Function; + field?: string; + } + + interface EditorFileBrowserSchemaModelFields { + name?: EditorFileBrowserSchemaModelFieldsName; + type?: EditorFileBrowserSchemaModelFieldsType; + size?: EditorFileBrowserSchemaModelFieldsSize; + } + + interface EditorFileBrowserSchemaModel { + id?: string; + fields?: EditorFileBrowserSchemaModelFields; + } + + interface EditorFileBrowserSchema { + } + + interface EditorFileBrowserTransportCreate { + contentType?: string; + data?: any|string|Function; + dataType?: string; + type?: string; + url?: string|Function; + } + + interface EditorFileBrowserTransportDestroy { + contentType?: string; + data?: any|string|Function; + dataType?: string; + type?: string; + url?: string|Function; + } + + interface EditorFileBrowserTransportRead { + contentType?: string; + data?: any|string|Function; + dataType?: string; + type?: string; + url?: string|Function; + } + + interface EditorFileBrowserTransport { + read?: EditorFileBrowserTransportRead; + uploadUrl?: string; + fileUrl?: string|Function; + destroy?: EditorFileBrowserTransportDestroy; + create?: EditorFileBrowserTransportCreate; + } + + interface EditorFileBrowser { + fileTypes?: string; + path?: string; + transport?: EditorFileBrowserTransport; + schema?: EditorFileBrowserSchema; + messages?: EditorFileBrowserMessages; + } + + interface EditorImageBrowserMessages { + uploadFile?: string; + orderBy?: string; + orderByName?: string; + orderBySize?: string; + directoryNotFound?: string; + emptyFolder?: string; + deleteFile?: string; + invalidFileType?: string; + overwriteFile?: string; + search?: string; + } + + interface EditorImageBrowserSchemaModelFieldsName { + field?: string; + parse?: Function; + } + + interface EditorImageBrowserSchemaModelFieldsSize { + field?: string; + parse?: Function; + } + + interface EditorImageBrowserSchemaModelFieldsType { + parse?: Function; + field?: string; + } + + interface EditorImageBrowserSchemaModelFields { + name?: EditorImageBrowserSchemaModelFieldsName; + type?: EditorImageBrowserSchemaModelFieldsType; + size?: EditorImageBrowserSchemaModelFieldsSize; + } + + interface EditorImageBrowserSchemaModel { + id?: string; + fields?: EditorImageBrowserSchemaModelFields; + } + + interface EditorImageBrowserSchema { + } + + interface EditorImageBrowserTransportCreate { + contentType?: string; + data?: any|string|Function; + dataType?: string; + type?: string; + url?: string|Function; + } + + interface EditorImageBrowserTransportDestroy { + contentType?: string; + data?: any|string|Function; + dataType?: string; + type?: string; + url?: string|Function; + } + + interface EditorImageBrowserTransportRead { + contentType?: string; + data?: any|string|Function; + dataType?: string; + type?: string; + url?: string|Function; + } + + interface EditorImageBrowserTransport { + read?: EditorImageBrowserTransportRead; + thumbnailUrl?: string|Function; + uploadUrl?: string; + imageUrl?: string|Function; + destroy?: EditorImageBrowserTransportDestroy; + create?: EditorImageBrowserTransportCreate; + } + + interface EditorImageBrowser { + fileTypes?: string; + path?: string; + transport?: EditorImageBrowserTransport; + schema?: EditorImageBrowserSchema; + messages?: EditorImageBrowserMessages; + } + + interface EditorImmutables { + deserialization?: Function; + serialization?: string|Function; + } + + interface EditorMessages { + bold?: string; + italic?: string; + underline?: string; + strikethrough?: string; + superscript?: string; + subscript?: string; + justifyCenter?: string; + justifyLeft?: string; + justifyRight?: string; + justifyFull?: string; + insertUnorderedList?: string; + insertOrderedList?: string; + indent?: string; + outdent?: string; + createLink?: string; + unlink?: string; + insertImage?: string; + insertFile?: string; + insertHtml?: string; + viewHtml?: string; + fontName?: string; + fontNameInherit?: string; + fontSize?: string; + fontSizeInherit?: string; + formatBlock?: string; + formatting?: string; + foreColor?: string; + backColor?: string; + style?: string; + emptyFolder?: string; + uploadFile?: string; + editAreaTitle?: string; + orderBy?: string; + orderBySize?: string; + orderByName?: string; + invalidFileType?: string; + deleteFile?: string; + overwriteFile?: string; + directoryNotFound?: string; + imageWebAddress?: string; + imageAltText?: string; + imageWidth?: string; + imageHeight?: string; + fileWebAddress?: string; + fileTitle?: string; + linkWebAddress?: string; + linkText?: string; + linkToolTip?: string; + linkOpenInNewWindow?: string; + dialogUpdate?: string; + dialogInsert?: string; + dialogCancel?: string; + createTable?: string; + createTableHint?: string; + addColumnLeft?: string; + addColumnRight?: string; + addRowAbove?: string; + addRowBelow?: string; + deleteRow?: string; + deleteColumn?: string; + } + + interface EditorPasteCleanup { + all?: boolean; + css?: boolean; + custom?: Function; + keepNewLines?: boolean; + msAllFormatting?: boolean; + msConvertLists?: boolean; + msTags?: boolean; + none?: boolean; + span?: boolean; + } + + interface EditorPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface EditorPdf { + author?: string; + avoidLinks?: boolean|string; + creator?: string; + date?: Date; + fileName?: string; + forceProxy?: boolean; + keywords?: string; + landscape?: boolean; + margin?: EditorPdfMargin; + paperSize?: string|any; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + } + + interface EditorResizable { + content?: boolean; + min?: number; + max?: number; + toolbar?: boolean; + } + + interface EditorSerialization { + custom?: Function; + entities?: boolean; + scripts?: boolean; + semantic?: boolean; + } + + interface EditorToolItem { + text?: string; + value?: string; + context?: string; + } + + interface EditorTool { + name?: string; + tooltip?: string; + exec?: Function; + items?: EditorToolItem[]; + template?: string; + } + + interface EditorExecParams { + value?: any; + } + + interface EditorPasteOptions { + split?: boolean; + } + + interface EditorOptions { + name?: string; + deserialization?: EditorDeserialization; + domain?: string; + encoded?: boolean; + immutables?: boolean|EditorImmutables; + messages?: EditorMessages; + pasteCleanup?: EditorPasteCleanup; + pdf?: EditorPdf; + resizable?: boolean|EditorResizable; + serialization?: EditorSerialization; + stylesheets?: any; + tools?: EditorTool[]; + imageBrowser?: EditorImageBrowser; + fileBrowser?: EditorFileBrowser; + change?(e: EditorEvent): void; + execute?(e: EditorExecuteEvent): void; + keydown?(e: EditorEvent): void; + keyup?(e: EditorEvent): void; + paste?(e: EditorPasteEvent): void; + pdfExport?(e: EditorPdfExportEvent): void; + select?(e: EditorEvent): void; + } + interface EditorEvent { + sender: Editor; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface EditorExecuteEvent extends EditorEvent { + name?: string; + command?: any; + } + + interface EditorPasteEvent extends EditorEvent { + html?: any; + } + + interface EditorPdfExportEvent extends EditorEvent { + promise?: JQueryPromise; + } + + + class FilterMenu extends kendo.ui.Widget { + + static fn: FilterMenu; + + options: FilterMenuOptions; + + field: string; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): FilterMenu; + + constructor(element: Element, options?: FilterMenuOptions); + + + clear(): void; + + } + + interface FilterMenuMessages { + and?: string; + clear?: string; + filter?: string; + info?: string; + isFalse?: string; + isTrue?: string; + or?: string; + selectValue?: string; + } + + interface FilterMenuOperatorsDate { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + gte?: string; + gt?: string; + lte?: string; + lt?: string; + } + + interface FilterMenuOperatorsEnums { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + } + + interface FilterMenuOperatorsNumber { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + gte?: string; + gt?: string; + lte?: string; + lt?: string; + } + + interface FilterMenuOperatorsString { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + isempty?: string; + isnotempty?: string; + startswith?: string; + contains?: string; + doesnotcontain?: string; + endswith?: string; + } + + interface FilterMenuOperators { + string?: FilterMenuOperatorsString; + number?: FilterMenuOperatorsNumber; + date?: FilterMenuOperatorsDate; + enums?: FilterMenuOperatorsEnums; + } + + interface FilterMenuOptions { + name?: string; + dataSource?: any|any|kendo.data.DataSource; + extra?: boolean; + field?: string; + messages?: FilterMenuMessages; + operators?: FilterMenuOperators; + } + interface FilterMenuEvent { + sender: FilterMenu; preventDefault: Function; isDefaultPrevented(): boolean; } - class Size extends Observable { + class FlatColorPicker extends kendo.ui.Widget { + + static fn: FlatColorPicker; + + options: FlatColorPickerOptions; - options: SizeOptions; + element: JQuery; + wrapper: JQuery; - width: number; - height: number; + static extend(proto: Object): FlatColorPicker; + + constructor(element: Element, options?: FlatColorPickerOptions); - static create(width: number, height: number): kendo.geometry.Size; - static create(width: any, height: number): kendo.geometry.Size; - static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; - - clone(): kendo.geometry.Size; - equals(other: kendo.geometry.Size): boolean; - getWidth(): number; - getHeight(): number; - setWidth(value: number): kendo.geometry.Size; - setHeight(value: number): kendo.geometry.Size; + focus(): void; + value(): string; + value(color?: string): void; + color(): kendo.Color; + color(color?: kendo.Color): void; + enable(enable?: boolean): void; } - interface SizeOptions { + interface FlatColorPickerMessages { + apply?: string; + cancel?: string; + } + + interface FlatColorPickerOptions { name?: string; + opacity?: boolean; + buttons?: boolean; + value?: string; + preview?: boolean; + autoupdate?: boolean; + messages?: FlatColorPickerMessages; + change?(e: FlatColorPickerChangeEvent): void; } - interface SizeEvent { - sender: Size; + interface FlatColorPickerEvent { + sender: FlatColorPicker; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface FlatColorPickerChangeEvent extends FlatColorPickerEvent { + value?: string; + } + + + class Gantt extends kendo.ui.Widget { + + static fn: Gantt; + + options: GanttOptions; + + dataSource: kendo.data.DataSource; + dependencies: kendo.data.GanttDependencyDataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Gantt; + + constructor(element: Element, options?: GanttOptions); + + + clearSelection(): void; + dataItem(row: string): kendo.data.GanttTask; + dataItem(row: Element): kendo.data.GanttTask; + dataItem(row: JQuery): kendo.data.GanttTask; + date(date?: Date): Date; + destroy(): void; + range(range?: any): any; + refresh(): void; + refreshDependencies(): void; + removeDependency(dependency: string): void; + removeDependency(dependency: kendo.data.GanttDependency): void; + removeTask(task: string): void; + removeTask(task: kendo.data.GanttTask): void; + saveAsPDF(): JQueryPromise; + select(): JQuery; + select(row: string): void; + select(row: Element): void; + select(row: JQuery): void; + setDataSource(dataSource: kendo.data.GanttDataSource): void; + setDependenciesDataSource(dataSource: kendo.data.GanttDependencyDataSource): void; + view(): kendo.ui.GanttView; + view(type?: string): void; + + } + + interface GanttAssignments { + dataSource?: any|any|kendo.data.DataSource; + dataResourceIdField?: string; + dataTaskIdField?: string; + dataValueField?: string; + } + + interface GanttColumn { + field?: string; + title?: string; + format?: string; + width?: string|number; + editable?: boolean; + sortable?: boolean; + } + + interface GanttCurrentTimeMarker { + updateInterval?: number; + } + + interface GanttEditable { + confirmation?: boolean; + create?: boolean; + dependencyCreate?: boolean; + dependencyDestroy?: boolean; + dragPercentComplete?: boolean; + destroy?: boolean; + move?: boolean; + reorder?: boolean; + resize?: boolean; + template?: string|Function; + update?: boolean; + } + + interface GanttMessagesActions { + addChild?: string; + append?: string; + insertAfter?: string; + insertBefore?: string; + pdf?: string; + } + + interface GanttMessagesEditor { + assignButton?: string; + editorTitle?: string; + end?: string; + percentComplete?: string; + resources?: string; + resourcesEditorTitle?: string; + resourcesHeader?: string; + start?: string; + title?: string; + unitsHeader?: string; + } + + interface GanttMessagesViews { + day?: string; + end?: string; + month?: string; + start?: string; + week?: string; + year?: string; + } + + interface GanttMessages { + actions?: GanttMessagesActions; + cancel?: string; + deleteDependencyConfirmation?: string; + deleteDependencyWindowTitle?: string; + deleteTaskConfirmation?: string; + deleteTaskWindowTitle?: string; + destroy?: string; + editor?: GanttMessagesEditor; + save?: string; + views?: GanttMessagesViews; + } + + interface GanttPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface GanttPdf { + author?: string; + avoidLinks?: boolean|string; + creator?: string; + date?: Date; + fileName?: string; + forceProxy?: boolean; + keywords?: string; + landscape?: boolean; + margin?: GanttPdfMargin; + paperSize?: string|any; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + } + + interface GanttRange { + start?: Date; + end?: Date; + } + + interface GanttResources { + dataFormatField?: string; + dataColorField?: string; + dataSource?: any|any|kendo.data.DataSource; + dataTextField?: string; + field?: string; + } + + interface GanttToolbarItem { + name?: string; + template?: string|Function; + text?: string; + } + + interface GanttTooltip { + template?: string|Function; + visible?: boolean; + } + + interface GanttViewRange { + start?: Date; + end?: Date; + } + + interface GanttView { + date?: Date; + range?: GanttViewRange; + type?: string; + selected?: boolean; + slotSize?: number|string; + timeHeaderTemplate?: string|Function; + dayHeaderTemplate?: string|Function; + weekHeaderTemplate?: string|Function; + monthHeaderTemplate?: string|Function; + yearHeaderTemplate?: string|Function; + resizeTooltipFormat?: string; + } + + interface GanttOptions { + name?: string; + assignments?: GanttAssignments; + autoBind?: boolean; + columnResizeHandleWidth?: number; + columns?: GanttColumn[]; + currentTimeMarker?: boolean|GanttCurrentTimeMarker; + dataSource?: any|any|kendo.data.GanttDataSource; + date?: Date; + dependencies?: any|any|kendo.data.GanttDependencyDataSource; + editable?: boolean|GanttEditable; + navigatable?: boolean; + workDayStart?: Date; + workDayEnd?: Date; + workWeekStart?: number; + workWeekEnd?: number; + hourSpan?: number; + snap?: boolean; + height?: number|string; + listWidth?: string|number; + messages?: GanttMessages; + pdf?: GanttPdf; + range?: GanttRange; + resizable?: boolean; + selectable?: boolean; + showWorkDays?: boolean; + showWorkHours?: boolean; + taskTemplate?: string|Function; + toolbar?: GanttToolbarItem[]; + tooltip?: GanttTooltip; + views?: GanttView[]; + resources?: GanttResources; + rowHeight?: number|string; + dataBinding?(e: GanttDataBindingEvent): void; + dataBound?(e: GanttDataBoundEvent): void; + add?(e: GanttAddEvent): void; + edit?(e: GanttEditEvent): void; + remove?(e: GanttRemoveEvent): void; + cancel?(e: GanttCancelEvent): void; + save?(e: GanttSaveEvent): void; + change?(e: GanttChangeEvent): void; + columnResize?(e: GanttColumnResizeEvent): void; + navigate?(e: GanttNavigateEvent): void; + moveStart?(e: GanttMoveStartEvent): void; + move?(e: GanttMoveEvent): void; + moveEnd?(e: GanttMoveEndEvent): void; + pdfExport?(e: GanttPdfExportEvent): void; + resizeStart?(e: GanttResizeStartEvent): void; + resize?(e: GanttResizeEvent): void; + resizeEnd?(e: GanttResizeEndEvent): void; + } + interface GanttEvent { + sender: Gantt; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface GanttDataBindingEvent extends GanttEvent { + } + + interface GanttDataBoundEvent extends GanttEvent { + } + + interface GanttAddEvent extends GanttEvent { + task?: kendo.data.GanttTask; + dependency?: kendo.data.GanttDependency; + } + + interface GanttEditEvent extends GanttEvent { + container?: JQuery; + task?: kendo.data.GanttTask; + } + + interface GanttRemoveEvent extends GanttEvent { + task?: kendo.data.GanttTask; + dependencies?: any; + } + + interface GanttCancelEvent extends GanttEvent { + container?: JQuery; + task?: kendo.data.GanttTask; + } + + interface GanttSaveEvent extends GanttEvent { + task?: kendo.data.GanttTask; + values?: any; + } + + interface GanttChangeEvent extends GanttEvent { + } + + interface GanttColumnResizeEvent extends GanttEvent { + column?: any; + newWidth?: number; + oldWidth?: number; + } + + interface GanttNavigateEvent extends GanttEvent { + view?: string; + } + + interface GanttMoveStartEvent extends GanttEvent { + task?: kendo.data.GanttTask; + } + + interface GanttMoveEvent extends GanttEvent { + task?: kendo.data.GanttTask; + start?: Date; + end?: Date; + } + + interface GanttMoveEndEvent extends GanttEvent { + task?: kendo.data.GanttTask; + start?: Date; + end?: Date; + } + + interface GanttPdfExportEvent extends GanttEvent { + promise?: JQueryPromise; + } + + interface GanttResizeStartEvent extends GanttEvent { + task?: kendo.data.GanttTask; + } + + interface GanttResizeEvent extends GanttEvent { + task?: kendo.data.GanttTask; + start?: Date; + end?: Date; + } + + interface GanttResizeEndEvent extends GanttEvent { + task?: kendo.data.GanttTask; + start?: Date; + end?: Date; + } + + + class Grid extends kendo.ui.Widget { + + static fn: Grid; + + options: GridOptions; + + dataSource: kendo.data.DataSource; + columns: GridColumn[]; + footer: JQuery; + pager: kendo.ui.Pager; + table: JQuery; + tbody: JQuery; + thead: JQuery; + content: JQuery; + lockedHeader: JQuery; + lockedTable: JQuery; + lockedContent: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Grid; + + constructor(element: Element, options?: GridOptions); + + + addRow(): void; + autoFitColumn(column: number): void; + autoFitColumn(column: string): void; + autoFitColumn(column: any): void; + cancelChanges(): void; + cancelRow(): void; + cellIndex(cell: string): number; + cellIndex(cell: Element): number; + cellIndex(cell: JQuery): number; + clearSelection(): void; + closeCell(isCancel?: boolean): void; + collapseGroup(row: string): void; + collapseGroup(row: Element): void; + collapseGroup(row: JQuery): void; + collapseRow(row: string): void; + collapseRow(row: Element): void; + collapseRow(row: JQuery): void; + current(): JQuery; + current(cell: JQuery): void; + dataItem(row: string): kendo.data.ObservableObject; + dataItem(row: Element): kendo.data.ObservableObject; + dataItem(row: JQuery): kendo.data.ObservableObject; + destroy(): void; + editCell(cell: JQuery): void; + editRow(row: JQuery): void; + expandGroup(row: string): void; + expandGroup(row: Element): void; + expandGroup(row: JQuery): void; + expandRow(row: string): void; + expandRow(row: Element): void; + expandRow(row: JQuery): void; + getOptions(): GridOptions; + hideColumn(column: number): void; + hideColumn(column: string): void; + hideColumn(column: any): void; + items(): any; + lockColumn(column: number): void; + lockColumn(column: string): void; + refresh(): void; + removeRow(row: string): void; + removeRow(row: Element): void; + removeRow(row: JQuery): void; + reorderColumn(destIndex: number, column: any): void; + saveAsExcel(): void; + saveAsPDF(): JQueryPromise; + saveChanges(): void; + saveRow(): void; + select(): JQuery; + select(rows: string): void; + select(rows: Element): void; + select(rows: JQuery): void; + setDataSource(dataSource: kendo.data.DataSource): void; + setOptions(options: any): void; + showColumn(column: number): void; + showColumn(column: string): void; + showColumn(column: any): void; + unlockColumn(column: number): void; + unlockColumn(column: string): void; + + } + + interface GridAllowCopy { + delimeter?: string|any; + } + + interface GridColumnMenuMessages { + columns?: string; + filter?: string; + sortAscending?: string; + sortDescending?: string; + settings?: string; + done?: string; + lock?: string; + unlock?: string; + } + + interface GridColumnMenu { + columns?: boolean; + filterable?: boolean; + sortable?: boolean; + messages?: GridColumnMenuMessages; + } + + interface GridColumnCommandItemText { + edit?: string; + cancel?: string; + update?: string; + } + + interface GridColumnCommandItem { + name?: string; + text?: GridColumnCommandItemText; + className?: string; + click?: Function; + template?: string; + } + + interface GridColumnFilterableCell { + dataSource?: any|kendo.data.DataSource; + dataTextField?: string; + delay?: number; + inputWidth?: number; + suggestionOperator?: string; + minLength?: number; + enabled?: boolean; + operator?: string; + showOperators?: boolean; + template?: Function; + } + + interface GridColumnFilterable { + cell?: GridColumnFilterableCell; + multi?: boolean; + dataSource?: any|any|kendo.data.DataSource; + checkAll?: boolean; + itemTemplate?: Function; + operators?: any; + search?: boolean; + ignoreCase?: boolean; + ui?: string|Function; + } + + interface GridColumnSortable { + compare?: Function; + } + + interface GridColumn { + aggregates?: any; + attributes?: any; + columns?: any; + command?: GridColumnCommandItem[]; + encoded?: boolean; + field?: string; + filterable?: boolean|GridColumnFilterable; + footerAttributes?: any; + footerTemplate?: string|Function; + format?: string; + groupable?: boolean; + groupHeaderTemplate?: string|Function; + groupFooterTemplate?: string|Function; + headerAttributes?: any; + headerTemplate?: string|Function; + hidden?: boolean; + locked?: boolean; + lockable?: boolean; + minScreenWidth?: number; + sortable?: boolean|GridColumnSortable; + template?: string|Function; + title?: string; + width?: string|number; + values?: any; + menu?: boolean; + type?: any; + } + + interface GridEditable { + confirmation?: boolean|string|Function; + cancelDelete?: string; + confirmDelete?: string; + createAt?: string; + destroy?: boolean; + mode?: string; + template?: string|Function; + update?: boolean; + window?: any; + } + + interface GridExcel { + allPages?: boolean; + fileName?: string; + filterable?: boolean; + forceProxy?: boolean; + proxyURL?: string; + } + + interface GridFilterableMessages { + and?: string; + clear?: string; + filter?: string; + info?: string; + isFalse?: string; + isTrue?: string; + or?: string; + search?: string; + selectValue?: string; + cancel?: string; + selectedItemsFormat?: string; + operator?: string; + value?: string; + checkAll?: string; + } + + interface GridFilterableOperatorsDate { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + gte?: string; + gt?: string; + lte?: string; + lt?: string; + } + + interface GridFilterableOperatorsEnums { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + } + + interface GridFilterableOperatorsNumber { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + gte?: string; + gt?: string; + lte?: string; + lt?: string; + } + + interface GridFilterableOperatorsString { + eq?: string; + neq?: string; + isnull?: string; + isnotnull?: string; + isempty?: string; + isnotempty?: string; + startswith?: string; + contains?: string; + doesnotcontain?: string; + endswith?: string; + } + + interface GridFilterableOperators { + string?: GridFilterableOperatorsString; + number?: GridFilterableOperatorsNumber; + date?: GridFilterableOperatorsDate; + enums?: GridFilterableOperatorsEnums; + } + + interface GridFilterable { + extra?: boolean; + messages?: GridFilterableMessages; + operators?: GridFilterableOperators; + mode?: string; + } + + interface GridGroupableMessages { + empty?: string; + } + + interface GridGroupable { + enabled?: boolean; + showFooter?: boolean; + messages?: GridGroupableMessages; + } + + interface GridMessagesCommands { + cancel?: string; + canceledit?: string; + create?: string; + destroy?: string; + edit?: string; + excel?: string; + save?: string; + update?: string; + } + + interface GridMessages { + commands?: GridMessagesCommands; + noRecords?: string; + } + + interface GridNoRecords { + template?: string|Function; + } + + interface GridPageableMessages { + display?: string; + empty?: string; + page?: string; + of?: string; + itemsPerPage?: string; + first?: string; + last?: string; + next?: string; + previous?: string; + refresh?: string; + morePages?: string; + } + + interface GridPageable { + pageSize?: number; + previousNext?: boolean; + numeric?: boolean; + buttonCount?: number; + input?: boolean; + pageSizes?: boolean|any; + refresh?: boolean; + info?: boolean; + messages?: GridPageableMessages; + } + + interface GridPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface GridPdf { + allPages?: boolean; + author?: string; + avoidLinks?: boolean|string; + creator?: string; + date?: Date; + fileName?: string; + forceProxy?: boolean; + keywords?: string; + landscape?: boolean; + margin?: GridPdfMargin; + paperSize?: string|any; + template?: string; + repeatHeaders?: boolean; + scale?: number; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + } + + interface GridScrollable { + virtual?: boolean; + } + + interface GridSortable { + allowUnsort?: boolean; + mode?: string; + } + + interface GridToolbarItem { + name?: string; + template?: string|Function; + text?: string; + } + + interface GridOptions { + name?: string; + allowCopy?: boolean|GridAllowCopy; + altRowTemplate?: string|Function; + autoBind?: boolean; + columnResizeHandleWidth?: number; + columns?: GridColumn[]; + columnMenu?: boolean|GridColumnMenu; + dataSource?: any|any|kendo.data.DataSource; + detailTemplate?: string|Function; + editable?: boolean|GridEditable; + excel?: GridExcel; + filterable?: boolean|GridFilterable; + groupable?: boolean|GridGroupable; + height?: number|string; + messages?: GridMessages; + mobile?: boolean|string; + navigatable?: boolean; + noRecords?: boolean|GridNoRecords; + pageable?: boolean|GridPageable; + pdf?: GridPdf; + reorderable?: boolean; + resizable?: boolean; + rowTemplate?: string|Function; + scrollable?: boolean|GridScrollable; + selectable?: boolean|string; + sortable?: boolean|GridSortable; + toolbar?: GridToolbarItem[] | any; + cancel?(e: GridCancelEvent): void; + change?(e: GridChangeEvent): void; + columnHide?(e: GridColumnHideEvent): void; + columnMenuInit?(e: GridColumnMenuInitEvent): void; + columnReorder?(e: GridColumnReorderEvent): void; + columnResize?(e: GridColumnResizeEvent): void; + columnShow?(e: GridColumnShowEvent): void; + dataBinding?(e: GridDataBindingEvent): void; + dataBound?(e: GridDataBoundEvent): void; + detailCollapse?(e: GridDetailCollapseEvent): void; + detailExpand?(e: GridDetailExpandEvent): void; + detailInit?(e: GridDetailInitEvent): void; + edit?(e: GridEditEvent): void; + excelExport?(e: GridExcelExportEvent): void; + filter?(e: GridFilterEvent): void; + group?(e: GridGroupEvent): void; + page?(e: GridPageEvent): void; + pdfExport?(e: GridPdfExportEvent): void; + filterMenuInit?(e: GridFilterMenuInitEvent): void; + remove?(e: GridRemoveEvent): void; + save?(e: GridSaveEvent): void; + saveChanges?(e: GridSaveChangesEvent): void; + sort?(e: GridSortEvent): void; + columnLock?(e: GridColumnLockEvent): void; + columnUnlock?(e: GridColumnUnlockEvent): void; + navigate?(e: GridNavigateEvent): void; + } + interface GridEvent { + sender: Grid; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface GridCancelEvent extends GridEvent { + container?: JQuery; + model?: kendo.data.Model; + } + + interface GridChangeEvent extends GridEvent { + } + + interface GridColumnHideEvent extends GridEvent { + column?: any; + } + + interface GridColumnMenuInitEvent extends GridEvent { + container?: JQuery; + field?: string; + } + + interface GridColumnReorderEvent extends GridEvent { + column?: any; + newIndex?: number; + oldIndex?: number; + } + + interface GridColumnResizeEvent extends GridEvent { + column?: any; + newWidth?: number; + oldWidth?: number; + } + + interface GridColumnShowEvent extends GridEvent { + column?: any; + } + + interface GridDataBindingEvent extends GridEvent { + action?: string; + index?: number; + items?: any; + } + + interface GridDataBoundEvent extends GridEvent { + } + + interface GridDetailCollapseEvent extends GridEvent { + detailRow?: JQuery; + masterRow?: JQuery; + } + + interface GridDetailExpandEvent extends GridEvent { + detailRow?: JQuery; + masterRow?: JQuery; + } + + interface GridDetailInitEvent extends GridEvent { + data?: kendo.data.ObservableObject; + detailCell?: JQuery; + detailRow?: JQuery; + masterRow?: JQuery; + } + + interface GridEditEvent extends GridEvent { + container?: JQuery; + model?: kendo.data.Model; + } + + interface GridExcelExportEvent extends GridEvent { + data?: any; + workbook?: kendo.ooxml.Workbook; + } + + interface GridFilterEvent extends GridEvent { + filter?: any; + field?: string; + } + + interface GridGroupEvent extends GridEvent { + groups?: any; + } + + interface GridPageEvent extends GridEvent { + page?: number; + } + + interface GridPdfExportEvent extends GridEvent { + promise?: JQueryPromise; + } + + interface GridFilterMenuInitEvent extends GridEvent { + container?: JQuery; + field?: string; + } + + interface GridRemoveEvent extends GridEvent { + model?: kendo.data.Model; + row?: JQuery; + } + + interface GridSaveEvent extends GridEvent { + model?: kendo.data.Model; + container?: JQuery; + values?: any; + } + + interface GridSaveChangesEvent extends GridEvent { + } + + interface GridSortEvent extends GridEvent { + sort?: any; + } + + interface GridColumnLockEvent extends GridEvent { + column?: any; + } + + interface GridColumnUnlockEvent extends GridEvent { + column?: any; + } + + interface GridNavigateEvent extends GridEvent { + element?: JQuery; + } + + + class ListView extends kendo.ui.Widget { + + static fn: ListView; + + options: ListViewOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ListView; + + constructor(element: Element, options?: ListViewOptions); + + + add(): void; + cancel(): void; + clearSelection(): void; + dataItem(row: string): kendo.data.ObservableObject; + dataItem(row: Element): kendo.data.ObservableObject; + dataItem(row: JQuery): kendo.data.ObservableObject; + dataItems(): void; + destroy(): void; + edit(item: JQuery): void; + items(): any; + refresh(): void; + remove(item: any): void; + save(): void; + select(): JQuery; + select(items: JQuery): void; + select(items: any): void; + setDataSource(dataSource: kendo.data.DataSource): void; + + } + + interface ListViewOptions { + name?: string; + autoBind?: boolean; + dataSource?: any|any|kendo.data.DataSource; + editTemplate?: Function; + navigatable?: boolean; + selectable?: boolean|string; + template?: Function; + altTemplate?: Function; + cancel?(e: ListViewCancelEvent): void; + change?(e: ListViewEvent): void; + dataBound?(e: ListViewEvent): void; + dataBinding?(e: ListViewEvent): void; + edit?(e: ListViewEditEvent): void; + remove?(e: ListViewRemoveEvent): void; + save?(e: ListViewSaveEvent): void; + } + interface ListViewEvent { + sender: ListView; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ListViewCancelEvent extends ListViewEvent { + container?: JQuery; + model?: kendo.data.Model; + } + + interface ListViewEditEvent extends ListViewEvent { + item?: JQuery; + model?: kendo.data.Model; + } + + interface ListViewRemoveEvent extends ListViewEvent { + item?: JQuery; + model?: kendo.data.Model; + } + + interface ListViewSaveEvent extends ListViewEvent { + model?: kendo.data.Model; + item?: JQuery; + } + + + class MaskedTextBox extends kendo.ui.Widget { + + static fn: MaskedTextBox; + + options: MaskedTextBoxOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): MaskedTextBox; + + constructor(element: Element, options?: MaskedTextBoxOptions); + + + destroy(): void; + enable(enable: boolean): void; + readonly(readonly: boolean): void; + raw(): string; + value(): string; + value(value: string): void; + + } + + interface MaskedTextBoxOptions { + name?: string; + clearPromptChar?: boolean; + culture?: string; + mask?: string; + promptChar?: string; + rules?: any; + unmaskOnPost?: boolean; + value?: string; + change?(e: MaskedTextBoxChangeEvent): void; + } + interface MaskedTextBoxEvent { + sender: MaskedTextBox; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface MaskedTextBoxChangeEvent extends MaskedTextBoxEvent { + } + + + class MediaPlayer extends kendo.ui.Widget { + + static fn: MediaPlayer; + + options: MediaPlayerOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): MediaPlayer; + + constructor(element: Element, options?: MediaPlayerOptions); + + + fullScreen(): void; + fullScreen(value: boolean): void; + volume(): void; + volume(value: number): void; + mute(value: boolean): void; + isEnded(): void; + isPaused(): void; + isPlaying(): void; + pause(): void; + play(): void; + seek(milliseconds: number): void; + stop(): void; + titlebar(): void; + toolbar(): void; + + } + + interface MediaPlayerMedia { + source?: string; + title?: string; + } + + interface MediaPlayerMessages { + pause?: string; + play?: string; + mute?: string; + unmute?: string; + quality?: string; + fullscreen?: string; + } + + interface MediaPlayerOptions { + name?: string; + autoPlay?: boolean; + autoRepeat?: boolean; + forwardSeek?: boolean; + fullScreen?: boolean; + media?: MediaPlayerMedia; + messages?: MediaPlayerMessages; + mute?: boolean; + navigatable?: boolean; + volume?: number; + end?(e: MediaPlayerEvent): void; + pause?(e: MediaPlayerEvent): void; + play?(e: MediaPlayerEvent): void; + ready?(e: MediaPlayerEvent): void; + timeChange?(e: MediaPlayerEvent): void; + volumeChange?(e: MediaPlayerEvent): void; + } + interface MediaPlayerEvent { + sender: MediaPlayer; preventDefault: Function; isDefaultPrevented(): boolean; } - class Transformation extends Observable { + class Menu extends kendo.ui.Widget { + + static fn: Menu; + + options: MenuOptions; - options: TransformationOptions; + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Menu; + + constructor(element: Element, options?: MenuOptions); - - - clone(): kendo.geometry.Transformation; - equals(other: kendo.geometry.Transformation): boolean; - matrix(): kendo.geometry.Matrix; - multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; - rotate(angle: number, center: any): kendo.geometry.Transformation; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; - scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; - translate(x: number, y: number): kendo.geometry.Transformation; + append(item: any, referenceItem?: string): kendo.ui.Menu; + append(item: any, referenceItem?: JQuery): kendo.ui.Menu; + close(element: string): kendo.ui.Menu; + close(element: Element): kendo.ui.Menu; + close(element: JQuery): kendo.ui.Menu; + destroy(): void; + enable(element: string, enable: boolean): kendo.ui.Menu; + enable(element: Element, enable: boolean): kendo.ui.Menu; + enable(element: JQuery, enable: boolean): kendo.ui.Menu; + insertAfter(item: any, referenceItem: string): kendo.ui.Menu; + insertAfter(item: any, referenceItem: Element): kendo.ui.Menu; + insertAfter(item: any, referenceItem: JQuery): kendo.ui.Menu; + insertBefore(item: any, referenceItem: string): kendo.ui.Menu; + insertBefore(item: any, referenceItem: Element): kendo.ui.Menu; + insertBefore(item: any, referenceItem: JQuery): kendo.ui.Menu; + open(element: string): kendo.ui.Menu; + open(element: Element): kendo.ui.Menu; + open(element: JQuery): kendo.ui.Menu; + remove(element: string): kendo.ui.Menu; + remove(element: Element): kendo.ui.Menu; + remove(element: JQuery): kendo.ui.Menu; } - interface TransformationOptions { + interface MenuAnimationClose { + effects?: string; + duration?: number; + } + + interface MenuAnimationOpen { + effects?: string; + duration?: number; + } + + interface MenuAnimation { + close?: MenuAnimationClose; + open?: MenuAnimationOpen; + } + + interface MenuOptions { name?: string; + animation?: boolean|MenuAnimation; + closeOnClick?: boolean; + dataSource?: any|any; + direction?: string; + hoverDelay?: number; + openOnClick?: boolean; + orientation?: string; + popupCollision?: string; + close?(e: MenuCloseEvent): void; + open?(e: MenuOpenEvent): void; + activate?(e: MenuActivateEvent): void; + deactivate?(e: MenuDeactivateEvent): void; + select?(e: MenuSelectEvent): void; } - interface TransformationEvent { - sender: Transformation; + interface MenuEvent { + sender: Menu; preventDefault: Function; isDefaultPrevented(): boolean; } + interface MenuCloseEvent extends MenuEvent { + item?: HTMLElement; + } + + interface MenuOpenEvent extends MenuEvent { + item?: HTMLElement; + } + + interface MenuActivateEvent extends MenuEvent { + item?: HTMLElement; + } + + interface MenuDeactivateEvent extends MenuEvent { + item?: HTMLElement; + } + + interface MenuSelectEvent extends MenuEvent { + item?: HTMLElement; + } + + + class MultiSelect extends kendo.ui.Widget { + + static fn: MultiSelect; + + options: MultiSelectOptions; + + dataSource: kendo.data.DataSource; + input: JQuery; + list: JQuery; + ul: JQuery; + tagList: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): MultiSelect; + + constructor(element: Element, options?: MultiSelectOptions); + + + close(): void; + dataItems(): any; + destroy(): void; + enable(enable: boolean): void; + focus(): void; + items(): any; + open(): void; + readonly(readonly: boolean): void; + refresh(): void; + search(word: string): void; + setDataSource(dataSource: kendo.data.DataSource): void; + toggle(toggle?: boolean): void; + value(): any; + value(value: any): void; + value(value: string): void; + + } + + interface MultiSelectAnimationClose { + effects?: string; + duration?: number; + } + + interface MultiSelectAnimationOpen { + effects?: string; + duration?: number; + } + + interface MultiSelectAnimation { + close?: MultiSelectAnimationClose; + open?: MultiSelectAnimationOpen; + } + + interface MultiSelectPopup { + appendTo?: string; + origin?: string; + position?: string; + } + + interface MultiSelectVirtual { + itemHeight?: number; + mapValueTo?: string; + valueMapper?: Function; + } + + interface MultiSelectOptions { + name?: string; + animation?: boolean|MultiSelectAnimation; + autoBind?: boolean; + autoClose?: boolean; + clearButton?: boolean; + dataSource?: any|any|kendo.data.DataSource; + dataTextField?: string; + dataValueField?: string; + delay?: number; + enable?: boolean; + enforceMinLength?: boolean; + filter?: string; + fixedGroupTemplate?: string|Function; + footerTemplate?: string|Function; + groupTemplate?: string|Function; + height?: number; + highlightFirst?: boolean; + ignoreCase?: boolean; + minLength?: number; + maxSelectedItems?: number; + noDataTemplate?: string|Function; + placeholder?: string; + popup?: MultiSelectPopup; + headerTemplate?: string|Function; + itemTemplate?: string|Function; + tagTemplate?: string; + tagMode?: string; + value?: any; + valuePrimitive?: boolean; + virtual?: boolean|MultiSelectVirtual; + change?(e: MultiSelectChangeEvent): void; + close?(e: MultiSelectCloseEvent): void; + dataBound?(e: MultiSelectDataBoundEvent): void; + filtering?(e: MultiSelectFilteringEvent): void; + open?(e: MultiSelectOpenEvent): void; + select?(e: MultiSelectSelectEvent): void; + deselect?(e: MultiSelectDeselectEvent): void; + } + interface MultiSelectEvent { + sender: MultiSelect; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface MultiSelectChangeEvent extends MultiSelectEvent { + } + + interface MultiSelectCloseEvent extends MultiSelectEvent { + } + + interface MultiSelectDataBoundEvent extends MultiSelectEvent { + } + + interface MultiSelectFilteringEvent extends MultiSelectEvent { + filter?: any; + } + + interface MultiSelectOpenEvent extends MultiSelectEvent { + } + + interface MultiSelectSelectEvent extends MultiSelectEvent { + dataItem?: any; + item?: JQuery; + } + + interface MultiSelectDeselectEvent extends MultiSelectEvent { + dataItem?: any; + item?: JQuery; + } + + + class Notification extends kendo.ui.Widget { + + static fn: Notification; + + options: NotificationOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Notification; + + constructor(element: Element, options?: NotificationOptions); + + + error(data: any): void; + error(data: string): void; + error(data: Function): void; + getNotifications(): JQuery; + hide(): void; + info(data: any): void; + info(data: string): void; + info(data: Function): void; + show(data: any, type: string): void; + show(data: string, type: string): void; + show(data: Function, type: string): void; + showText(data: any, type: string): void; + showText(data: string, type: string): void; + showText(data: Function, type: string): void; + success(data: any): void; + success(data: string): void; + success(data: Function): void; + warning(data: any): void; + warning(data: string): void; + warning(data: Function): void; + + } + + interface NotificationPosition { + bottom?: number; + left?: number; + pinned?: boolean; + right?: number; + top?: number; + } + + interface NotificationTemplate { + type?: string; + template?: string; + } + + interface NotificationOptions { + name?: string; + allowHideAfter?: number; + animation?: any|boolean; + appendTo?: string|JQuery; + autoHideAfter?: number; + button?: boolean; + height?: number|string; + hideOnClick?: boolean; + position?: NotificationPosition; + stacking?: string; + templates?: NotificationTemplate[]; + width?: number|string; + hide?(e: NotificationHideEvent): void; + show?(e: NotificationShowEvent): void; + } + interface NotificationEvent { + sender: Notification; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface NotificationHideEvent extends NotificationEvent { + element?: JQuery; + } + + interface NotificationShowEvent extends NotificationEvent { + element?: JQuery; + } + + + class NumericTextBox extends kendo.ui.Widget { + + static fn: NumericTextBox; + + options: NumericTextBoxOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): NumericTextBox; + + constructor(element: Element, options?: NumericTextBoxOptions); + + + destroy(): void; + enable(enable: boolean): void; + readonly(readonly: boolean): void; + focus(): void; + max(): number; + max(value: number): void; + max(value: string): void; + min(): number; + min(value: number): void; + min(value: string): void; + step(): number; + step(value: number): void; + step(value: string): void; + value(): number; + value(value: number): void; + value(value: string): void; + + } + + interface NumericTextBoxOptions { + name?: string; + culture?: string; + decimals?: number; + downArrowText?: string; + format?: string; + max?: number; + min?: number; + placeholder?: string; + restrictDecimals?: boolean; + round?: boolean; + spinners?: boolean; + step?: number; + upArrowText?: string; + value?: number; + change?(e: NumericTextBoxChangeEvent): void; + spin?(e: NumericTextBoxSpinEvent): void; + } + interface NumericTextBoxEvent { + sender: NumericTextBox; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface NumericTextBoxChangeEvent extends NumericTextBoxEvent { + } + + interface NumericTextBoxSpinEvent extends NumericTextBoxEvent { + } + + + class Pager extends kendo.ui.Widget { + + static fn: Pager; + + options: PagerOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Pager; + + constructor(element: Element, options?: PagerOptions); + + + totalPages(): number; + pageSize(): number; + page(): number; + page(page: number): void; + refresh(): void; + destroy(): void; + + } + + interface PagerMessages { + display?: string; + empty?: string; + allPages?: string; + page?: string; + of?: string; + itemsPerPage?: string; + first?: string; + previous?: string; + next?: string; + last?: string; + refresh?: string; + } + + interface PagerOptions { + name?: string; + autoBind?: boolean; + buttonCount?: number; + dataSource?: any|kendo.data.DataSource; + selectTemplate?: string; + linkTemplate?: string; + info?: boolean; + input?: boolean; + numeric?: boolean; + pageSizes?: boolean|any; + previousNext?: boolean; + refresh?: boolean; + messages?: PagerMessages; + change?(e: PagerChangeEvent): void; + } + interface PagerEvent { + sender: Pager; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface PagerChangeEvent extends PagerEvent { + } + + + class PanelBar extends kendo.ui.Widget { + + static fn: PanelBar; + + options: PanelBarOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): PanelBar; + + constructor(element: Element, options?: PanelBarOptions); + + + append(item: string, referenceItem: string): kendo.ui.PanelBar; + append(item: string, referenceItem: Element): kendo.ui.PanelBar; + append(item: string, referenceItem: JQuery): kendo.ui.PanelBar; + append(item: Element, referenceItem: string): kendo.ui.PanelBar; + append(item: Element, referenceItem: Element): kendo.ui.PanelBar; + append(item: Element, referenceItem: JQuery): kendo.ui.PanelBar; + append(item: JQuery, referenceItem: string): kendo.ui.PanelBar; + append(item: JQuery, referenceItem: Element): kendo.ui.PanelBar; + append(item: JQuery, referenceItem: JQuery): kendo.ui.PanelBar; + append(item: any, referenceItem: string): kendo.ui.PanelBar; + append(item: any, referenceItem: Element): kendo.ui.PanelBar; + append(item: any, referenceItem: JQuery): kendo.ui.PanelBar; + clearSelection(): void; + collapse(element: string, useAnimation: boolean): kendo.ui.PanelBar; + collapse(element: Element, useAnimation: boolean): kendo.ui.PanelBar; + collapse(element: JQuery, useAnimation: boolean): kendo.ui.PanelBar; + destroy(): void; + enable(element: string, enable: boolean): void; + enable(element: Element, enable: boolean): void; + enable(element: JQuery, enable: boolean): void; + expand(element: string, useAnimation: boolean): kendo.ui.PanelBar; + expand(element: Element, useAnimation: boolean): kendo.ui.PanelBar; + expand(element: JQuery, useAnimation: boolean): kendo.ui.PanelBar; + insertAfter(item: string, referenceItem: string): void; + insertAfter(item: string, referenceItem: Element): void; + insertAfter(item: string, referenceItem: JQuery): void; + insertAfter(item: Element, referenceItem: string): void; + insertAfter(item: Element, referenceItem: Element): void; + insertAfter(item: Element, referenceItem: JQuery): void; + insertAfter(item: JQuery, referenceItem: string): void; + insertAfter(item: JQuery, referenceItem: Element): void; + insertAfter(item: JQuery, referenceItem: JQuery): void; + insertAfter(item: any, referenceItem: string): void; + insertAfter(item: any, referenceItem: Element): void; + insertAfter(item: any, referenceItem: JQuery): void; + insertBefore(item: string, referenceItem: string): kendo.ui.PanelBar; + insertBefore(item: string, referenceItem: Element): kendo.ui.PanelBar; + insertBefore(item: string, referenceItem: JQuery): kendo.ui.PanelBar; + insertBefore(item: Element, referenceItem: string): kendo.ui.PanelBar; + insertBefore(item: Element, referenceItem: Element): kendo.ui.PanelBar; + insertBefore(item: Element, referenceItem: JQuery): kendo.ui.PanelBar; + insertBefore(item: JQuery, referenceItem: string): kendo.ui.PanelBar; + insertBefore(item: JQuery, referenceItem: Element): kendo.ui.PanelBar; + insertBefore(item: JQuery, referenceItem: JQuery): kendo.ui.PanelBar; + insertBefore(item: any, referenceItem: string): kendo.ui.PanelBar; + insertBefore(item: any, referenceItem: Element): kendo.ui.PanelBar; + insertBefore(item: any, referenceItem: JQuery): kendo.ui.PanelBar; + reload(element: string): void; + reload(element: Element): void; + reload(element: JQuery): void; + remove(element: string): void; + remove(element: Element): void; + remove(element: JQuery): void; + select(): JQuery; + select(element?: string): void; + select(element?: Element): void; + select(element?: JQuery): void; + + } + + interface PanelBarAnimationCollapse { + duration?: number; + effects?: string; + } + + interface PanelBarAnimationExpand { + duration?: number; + effects?: string; + } + + interface PanelBarAnimation { + collapse?: PanelBarAnimationCollapse; + expand?: PanelBarAnimationExpand; + } + + interface PanelBarOptions { + name?: string; + animation?: boolean|PanelBarAnimation; + contentUrls?: any; + dataSource?: any|any; + expandMode?: string; + activate?(e: PanelBarActivateEvent): void; + collapse?(e: PanelBarCollapseEvent): void; + contentLoad?(e: PanelBarContentLoadEvent): void; + error?(e: PanelBarErrorEvent): void; + expand?(e: PanelBarExpandEvent): void; + select?(e: PanelBarSelectEvent): void; + } + interface PanelBarEvent { + sender: PanelBar; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface PanelBarActivateEvent extends PanelBarEvent { + item?: Element; + } + + interface PanelBarCollapseEvent extends PanelBarEvent { + item?: Element; + } + + interface PanelBarContentLoadEvent extends PanelBarEvent { + item?: Element; + contentElement?: Element; + } + + interface PanelBarErrorEvent extends PanelBarEvent { + xhr?: JQueryXHR; + status?: string; + } + + interface PanelBarExpandEvent extends PanelBarEvent { + item?: Element; + } + + interface PanelBarSelectEvent extends PanelBarEvent { + item?: Element; + } + + + class PivotConfigurator extends kendo.ui.Widget { + + static fn: PivotConfigurator; + + options: PivotConfiguratorOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): PivotConfigurator; + + constructor(element: Element, options?: PivotConfiguratorOptions); + + + destroy(): void; + refresh(): void; + setDataSource(dataSource: kendo.data.PivotDataSource): void; + + } + + interface PivotConfiguratorMessagesFieldMenuOperators { + contains?: string; + doesnotcontain?: string; + startswith?: string; + endswith?: string; + eq?: string; + neq?: string; + } + + interface PivotConfiguratorMessagesFieldMenu { + info?: string; + sortAscending?: string; + sortDescending?: string; + filterFields?: string; + filter?: string; + include?: string; + title?: string; + clear?: string; + ok?: string; + cancel?: string; + operators?: PivotConfiguratorMessagesFieldMenuOperators; + } + + interface PivotConfiguratorMessages { + measures?: string; + columns?: string; + rows?: string; + measuresLabel?: string; + rowsLabel?: string; + columnsLabel?: string; + fieldsLabel?: string; + fieldMenu?: PivotConfiguratorMessagesFieldMenu; + } + + interface PivotConfiguratorSortable { + allowUnsort?: boolean; + } + + interface PivotConfiguratorOptions { + name?: string; + dataSource?: any|kendo.data.PivotDataSource; + filterable?: boolean; + sortable?: boolean|PivotConfiguratorSortable; + height?: number|string; + messages?: PivotConfiguratorMessages; + } + interface PivotConfiguratorEvent { + sender: PivotConfigurator; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class PivotGrid extends kendo.ui.Widget { + + static fn: PivotGrid; + + options: PivotGridOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): PivotGrid; + + constructor(element: Element, options?: PivotGridOptions); + + + cellInfo(columnIndex: number, rowIndex: number): any; + cellInfoByElement(cell: string): any; + cellInfoByElement(cell: Element): any; + cellInfoByElement(cell: JQuery): any; + destroy(): void; + refresh(): void; + setDataSource(dataSource: kendo.data.PivotDataSource): void; + saveAsExcel(): void; + saveAsPDF(): JQueryPromise; + + } + + interface PivotGridExcel { + fileName?: string; + filterable?: boolean; + forceProxy?: boolean; + proxyURL?: string; + } + + interface PivotGridMessagesFieldMenuOperators { + contains?: string; + doesnotcontain?: string; + startswith?: string; + endswith?: string; + eq?: string; + neq?: string; + } + + interface PivotGridMessagesFieldMenu { + info?: string; + sortAscending?: string; + sortDescending?: string; + filterFields?: string; + filter?: string; + include?: string; + title?: string; + clear?: string; + ok?: string; + cancel?: string; + operators?: PivotGridMessagesFieldMenuOperators; + } + + interface PivotGridMessages { + measureFields?: string; + columnFields?: string; + rowFields?: string; + fieldMenu?: PivotGridMessagesFieldMenu; + } + + interface PivotGridPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface PivotGridPdf { + author?: string; + avoidLinks?: boolean|string; + creator?: string; + date?: Date; + fileName?: string; + forceProxy?: boolean; + keywords?: string; + landscape?: boolean; + margin?: PivotGridPdfMargin; + paperSize?: string|any; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + } + + interface PivotGridSortable { + allowUnsort?: boolean; + } + + interface PivotGridOptions { + name?: string; + dataSource?: any|kendo.data.PivotDataSource; + autoBind?: boolean; + reorderable?: boolean; + excel?: PivotGridExcel; + pdf?: PivotGridPdf; + filterable?: boolean; + sortable?: boolean|PivotGridSortable; + columnWidth?: number; + height?: number|string; + columnHeaderTemplate?: string|Function; + dataCellTemplate?: string|Function; + kpiStatusTemplate?: string|Function; + kpiTrendTemplate?: string|Function; + rowHeaderTemplate?: string|Function; + messages?: PivotGridMessages; + dataBinding?(e: PivotGridDataBindingEvent): void; + dataBound?(e: PivotGridDataBoundEvent): void; + expandMember?(e: PivotGridExpandMemberEvent): void; + collapseMember?(e: PivotGridCollapseMemberEvent): void; + excelExport?(e: PivotGridExcelExportEvent): void; + pdfExport?(e: PivotGridPdfExportEvent): void; + } + interface PivotGridEvent { + sender: PivotGrid; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface PivotGridDataBindingEvent extends PivotGridEvent { + } + + interface PivotGridDataBoundEvent extends PivotGridEvent { + } + + interface PivotGridExpandMemberEvent extends PivotGridEvent { + axis?: string; + path?: string; + } + + interface PivotGridCollapseMemberEvent extends PivotGridEvent { + axis?: string; + path?: string; + } + + interface PivotGridExcelExportEvent extends PivotGridEvent { + data?: any; + workbook?: any; + } + + interface PivotGridPdfExportEvent extends PivotGridEvent { + promise?: JQueryPromise; + } + + + class Popup extends kendo.ui.Widget { + + static fn: Popup; + + options: PopupOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Popup; + + constructor(element: Element, options?: PopupOptions); + + + close(): void; + open(): void; + position(): void; + setOptions(options: any): void; + visible(): boolean; + + } + + interface PopupAnimationClose { + effects?: string; + duration?: number; + } + + interface PopupAnimationOpen { + effects?: string; + duration?: number; + } + + interface PopupAnimation { + close?: PopupAnimationClose; + open?: PopupAnimationOpen; + } + + interface PopupOptions { + name?: string; + adjustSize?: any; + animation?: boolean|PopupAnimation; + anchor?: string|JQuery; + appendTo?: string|JQuery; + collision?: string; + origin?: string; + position?: string; + activate?(e: PopupActivateEvent): void; + close?(e: PopupCloseEvent): void; + deactivate?(e: PopupDeactivateEvent): void; + open?(e: PopupOpenEvent): void; + } + interface PopupEvent { + sender: Popup; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface PopupActivateEvent extends PopupEvent { + } + + interface PopupCloseEvent extends PopupEvent { + } + + interface PopupDeactivateEvent extends PopupEvent { + } + + interface PopupOpenEvent extends PopupEvent { + } + + + class ProgressBar extends kendo.ui.Widget { + + static fn: ProgressBar; + + options: ProgressBarOptions; + + progressStatus: JQuery; + progressWrapper: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ProgressBar; + + constructor(element: Element, options?: ProgressBarOptions); + + + enable(enable: boolean): void; + value(): number; + value(value: number): void; + + } + + interface ProgressBarAnimation { + duration?: number; + } + + interface ProgressBarOptions { + name?: string; + animation?: ProgressBarAnimation; + chunkCount?: number; + enable?: boolean; + max?: number; + min?: number; + orientation?: string; + reverse?: boolean; + showStatus?: boolean; + type?: string; + value?: number; + change?(e: ProgressBarChangeEvent): void; + complete?(e: ProgressBarCompleteEvent): void; + } + interface ProgressBarEvent { + sender: ProgressBar; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ProgressBarChangeEvent extends ProgressBarEvent { + value?: number; + } + + interface ProgressBarCompleteEvent extends ProgressBarEvent { + value?: number; + } + + + class Prompt extends kendo.ui.Widget { + + static fn: Prompt; + + options: PromptOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Prompt; + + constructor(element: Element, options?: PromptOptions); + + + + } + + interface PromptMessages { + okText?: string; + cancel?: string; + } + + interface PromptOptions { + name?: string; + messages?: PromptMessages; + } + interface PromptEvent { + sender: Prompt; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class RangeSlider extends kendo.ui.Widget { + + static fn: RangeSlider; + + options: RangeSliderOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): RangeSlider; + + constructor(element: Element, options?: RangeSliderOptions); + + + destroy(): void; + enable(enable: boolean): void; + value(): any; + value(selectionStart: number, selectionEnd: number): void; + values(): any; + resize(): void; + + } + + interface RangeSliderTooltip { + enabled?: boolean; + format?: string; + template?: string; + } + + interface RangeSliderOptions { + name?: string; + largeStep?: number; + leftDragHandleTitle?: string; + max?: number; + min?: number; + orientation?: string; + rightDragHandleTitle?: string; + selectionEnd?: number; + selectionStart?: number; + smallStep?: number; + tickPlacement?: string; + tooltip?: RangeSliderTooltip; + change?(e: RangeSliderChangeEvent): void; + slide?(e: RangeSliderSlideEvent): void; + } + interface RangeSliderEvent { + sender: RangeSlider; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface RangeSliderChangeEvent extends RangeSliderEvent { + value?: any; + } + + interface RangeSliderSlideEvent extends RangeSliderEvent { + value?: any; + } + + + class ResponsivePanel extends kendo.ui.Widget { + + static fn: ResponsivePanel; + + options: ResponsivePanelOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ResponsivePanel; + + constructor(element: Element, options?: ResponsivePanelOptions); + + + close(): void; + destroy(): void; + open(): void; + + } + + interface ResponsivePanelOptions { + name?: string; + autoClose?: boolean; + breakpoint?: number; + orientation?: string; + toggleButton?: string; + close?(e: ResponsivePanelEvent): void; + open?(e: ResponsivePanelEvent): void; + } + interface ResponsivePanelEvent { + sender: ResponsivePanel; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Scheduler extends kendo.ui.Widget { + + static fn: Scheduler; + + options: SchedulerOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Scheduler; + + constructor(element: Element, options?: SchedulerOptions); + + + addEvent(data: any): void; + cancelEvent(): void; + data(): void; + date(): Date; + date(value?: Date): void; + destroy(): void; + editEvent(event: string): void; + editEvent(event: kendo.data.SchedulerEvent): void; + items(): any; + occurrenceByUid(uid: string): kendo.data.SchedulerEvent; + occurrencesInRange(start: Date, end: Date): any; + refresh(): void; + removeEvent(event: string): void; + removeEvent(event: kendo.data.SchedulerEvent): void; + resourcesBySlot(slot: any): any; + saveAsPDF(): JQueryPromise; + saveEvent(): void; + select(): void; + select(events: any, options: any): void; + setDataSource(dataSource: kendo.data.SchedulerDataSource): void; + slotByPosition(xPosition: number, yPosition: number): any; + slotByElement(element: Element): any; + slotByElement(element: JQuery): any; + view(type?: string): void; + viewName(): string; + + } + + interface SchedulerCurrentTimeMarker { + updateInterval?: number; + useLocalTimezone?: boolean; + } + + interface SchedulerEditable { + confirmation?: boolean|string; + create?: boolean; + destroy?: boolean; + editRecurringMode?: string; + move?: boolean; + resize?: boolean; + template?: string|Function; + update?: boolean; + window?: any; + } + + interface SchedulerFooter { + command?: string|boolean; + } + + interface SchedulerGroup { + date?: boolean; + resources?: any; + orientation?: string; + } + + interface SchedulerMessagesEditable { + confirmation?: string; + } + + interface SchedulerMessagesEditor { + allDayEvent?: string; + description?: string; + editorTitle?: string; + end?: string; + endTimezone?: string; + repeat?: string; + separateTimezones?: string; + start?: string; + startTimezone?: string; + timezone?: string; + timezoneEditorButton?: string; + timezoneEditorTitle?: string; + title?: string; + } + + interface SchedulerMessagesRecurrenceEditorDaily { + interval?: string; + repeatEvery?: string; + } + + interface SchedulerMessagesRecurrenceEditorEnd { + after?: string; + occurrence?: string; + label?: string; + never?: string; + mobileLabel?: string; + on?: string; + } + + interface SchedulerMessagesRecurrenceEditorFrequencies { + daily?: string; + monthly?: string; + never?: string; + weekly?: string; + yearly?: string; + } + + interface SchedulerMessagesRecurrenceEditorMonthly { + day?: string; + interval?: string; + repeatEvery?: string; + repeatOn?: string; + } + + interface SchedulerMessagesRecurrenceEditorOffsetPositions { + first?: string; + second?: string; + third?: string; + fourth?: string; + last?: string; + } + + interface SchedulerMessagesRecurrenceEditorWeekdays { + day?: string; + weekday?: string; + weekend?: string; + } + + interface SchedulerMessagesRecurrenceEditorWeekly { + interval?: string; + repeatEvery?: string; + repeatOn?: string; + } + + interface SchedulerMessagesRecurrenceEditorYearly { + of?: string; + repeatEvery?: string; + repeatOn?: string; + interval?: string; + } + + interface SchedulerMessagesRecurrenceEditor { + daily?: SchedulerMessagesRecurrenceEditorDaily; + end?: SchedulerMessagesRecurrenceEditorEnd; + frequencies?: SchedulerMessagesRecurrenceEditorFrequencies; + monthly?: SchedulerMessagesRecurrenceEditorMonthly; + offsetPositions?: SchedulerMessagesRecurrenceEditorOffsetPositions; + weekly?: SchedulerMessagesRecurrenceEditorWeekly; + weekdays?: SchedulerMessagesRecurrenceEditorWeekdays; + yearly?: SchedulerMessagesRecurrenceEditorYearly; + } + + interface SchedulerMessagesRecurrenceMessages { + deleteRecurring?: string; + deleteWindowOccurrence?: string; + deleteWindowSeries?: string; + deleteWindowTitle?: string; + editRecurring?: string; + editWindowOccurrence?: string; + editWindowSeries?: string; + editWindowTitle?: string; + } + + interface SchedulerMessagesViews { + day?: string; + week?: string; + month?: string; + agenda?: string; + } + + interface SchedulerMessages { + allDay?: string; + ariaEventLabel?: string; + ariaSlotLabel?: string; + cancel?: string; + date?: string; + deleteWindowTitle?: string; + destroy?: string; + event?: string; + defaultRowText?: string; + pdf?: string; + save?: string; + showFullDay?: string; + showWorkDay?: string; + time?: string; + today?: string; + editable?: SchedulerMessagesEditable; + editor?: SchedulerMessagesEditor; + recurrenceEditor?: SchedulerMessagesRecurrenceEditor; + recurrenceMessages?: SchedulerMessagesRecurrenceMessages; + views?: SchedulerMessagesViews; + } + + interface SchedulerPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface SchedulerPdf { + author?: string; + avoidLinks?: boolean|string; + creator?: string; + date?: Date; + fileName?: string; + forceProxy?: boolean; + keywords?: string; + landscape?: boolean; + margin?: SchedulerPdfMargin; + paperSize?: string|any; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + } + + interface SchedulerResource { + dataColorField?: string; + dataSource?: any|any|kendo.data.DataSource; + dataTextField?: string; + dataValueField?: string; + field?: string; + multiple?: boolean; + name?: string; + title?: string; + valuePrimitive?: boolean; + } + + interface SchedulerToolbarItem { + name?: string; + } + + interface SchedulerViewEditable { + create?: boolean; + destroy?: boolean; + update?: boolean; + } + + interface SchedulerViewGroup { + date?: boolean; + orientation?: string; + } + + interface SchedulerView { + allDayEventTemplate?: string|Function; + allDaySlot?: boolean; + allDaySlotTemplate?: string|Function; + columnWidth?: number; + dateHeaderTemplate?: string|Function; + dayTemplate?: string|Function; + editable?: boolean|SchedulerViewEditable; + endTime?: Date; + eventHeight?: number; + eventTemplate?: string|Function; + eventTimeTemplate?: string|Function; + group?: SchedulerViewGroup; + majorTick?: number; + majorTimeHeaderTemplate?: string|Function; + minorTickCount?: number; + minorTimeHeaderTemplate?: string|Function; + selected?: boolean; + selectedDateFormat?: string; + showWorkHours?: boolean; + slotTemplate?: string|Function; + startTime?: Date; + title?: string; + type?: string; + workWeekStart?: number; + workWeekEnd?: number; + } + + interface SchedulerSelectOptions { + events?: any; + resources?: any; + start?: Date; + end?: Date; + isAllDay?: boolean; + } + + interface SchedulerOptions { + name?: string; + allDayEventTemplate?: string|Function; + allDaySlot?: boolean; + autoBind?: boolean; + currentTimeMarker?: boolean|SchedulerCurrentTimeMarker; + dataSource?: any|any|kendo.data.SchedulerDataSource; + date?: Date; + dateHeaderTemplate?: string|Function; + editable?: boolean|SchedulerEditable; + endTime?: Date; + eventTemplate?: string|Function; + footer?: boolean|SchedulerFooter; + group?: SchedulerGroup; + height?: number|string; + majorTick?: number; + majorTimeHeaderTemplate?: string|Function; + max?: Date; + messages?: SchedulerMessages; + min?: Date; + minorTickCount?: number; + minorTimeHeaderTemplate?: string|Function; + mobile?: boolean|string; + pdf?: SchedulerPdf; + resources?: SchedulerResource[]; + selectable?: boolean; + showWorkHours?: boolean; + snap?: boolean; + startTime?: Date; + timezone?: string; + toolbar?: SchedulerToolbarItem[]; + views?: SchedulerView[]; + groupHeaderTemplate?: string|Function; + width?: number|string; + workDayStart?: Date; + workDayEnd?: Date; + workWeekStart?: number; + workWeekEnd?: number; + add?(e: SchedulerAddEvent): void; + cancel?(e: SchedulerCancelEvent): void; + change?(e: SchedulerChangeEvent): void; + dataBinding?(e: SchedulerDataBindingEvent): void; + dataBound?(e: SchedulerDataBoundEvent): void; + edit?(e: SchedulerEditEvent): void; + moveStart?(e: SchedulerMoveStartEvent): void; + move?(e: SchedulerMoveEvent): void; + moveEnd?(e: SchedulerMoveEndEvent): void; + navigate?(e: SchedulerNavigateEvent): void; + pdfExport?(e: SchedulerPdfExportEvent): void; + remove?(e: SchedulerRemoveEvent): void; + resizeStart?(e: SchedulerResizeStartEvent): void; + resize?(e: SchedulerResizeEvent): void; + resizeEnd?(e: SchedulerResizeEndEvent): void; + save?(e: SchedulerSaveEvent): void; + } + interface SchedulerEvent { + sender: Scheduler; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SchedulerAddEvent extends SchedulerEvent { + event?: any; + } + + interface SchedulerCancelEvent extends SchedulerEvent { + container?: JQuery; + event?: kendo.data.SchedulerEvent; + } + + interface SchedulerChangeEvent extends SchedulerEvent { + start?: Date; + end?: Date; + events?: any; + slots?: any; + resources?: any; + } + + interface SchedulerDataBindingEvent extends SchedulerEvent { + } + + interface SchedulerDataBoundEvent extends SchedulerEvent { + } + + interface SchedulerEditEvent extends SchedulerEvent { + container?: JQuery; + event?: kendo.data.SchedulerEvent; + } + + interface SchedulerMoveStartEvent extends SchedulerEvent { + event?: kendo.data.SchedulerEvent; + } + + interface SchedulerMoveEvent extends SchedulerEvent { + event?: kendo.data.SchedulerEvent; + slot?: any; + } + + interface SchedulerMoveEndEvent extends SchedulerEvent { + start?: Date; + end?: Date; + event?: kendo.data.SchedulerEvent; + slot?: any; + resources?: any; + } + + interface SchedulerNavigateEvent extends SchedulerEvent { + action?: string; + date?: Date; + view?: string; + } + + interface SchedulerPdfExportEvent extends SchedulerEvent { + promise?: JQueryPromise; + } + + interface SchedulerRemoveEvent extends SchedulerEvent { + event?: kendo.data.SchedulerEvent; + } + + interface SchedulerResizeStartEvent extends SchedulerEvent { + event?: kendo.data.SchedulerEvent; + } + + interface SchedulerResizeEvent extends SchedulerEvent { + event?: kendo.data.SchedulerEvent; + slot?: any; + } + + interface SchedulerResizeEndEvent extends SchedulerEvent { + event?: kendo.data.SchedulerEvent; + slot?: any; + } + + interface SchedulerSaveEvent extends SchedulerEvent { + container?: JQuery; + event?: kendo.data.SchedulerEvent; + } + + + class Slider extends kendo.ui.Widget { + + static fn: Slider; + + options: SliderOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Slider; + + constructor(element: Element, options?: SliderOptions); + + + destroy(): void; + enable(enable: boolean): void; + value(): number; + value(value: number): void; + resize(): void; + + } + + interface SliderTooltip { + enabled?: boolean; + format?: string; + template?: string; + } + + interface SliderOptions { + name?: string; + decreaseButtonTitle?: string; + dragHandleTitle?: string; + increaseButtonTitle?: string; + largeStep?: number; + max?: number; + min?: number; + orientation?: string; + showButtons?: boolean; + smallStep?: number; + tickPlacement?: string; + tooltip?: SliderTooltip; + value?: number; + change?(e: SliderChangeEvent): void; + slide?(e: SliderSlideEvent): void; + } + interface SliderEvent { + sender: Slider; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SliderChangeEvent extends SliderEvent { + value?: number; + } + + interface SliderSlideEvent extends SliderEvent { + value?: number; + } + + + class Sortable extends kendo.ui.Widget { + + static fn: Sortable; + + options: SortableOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Sortable; + + constructor(element: Element, options?: SortableOptions); + + + indexOf(element: JQuery): number; + items(): JQuery; + + } + + interface SortableCursorOffset { + left?: number; + top?: number; + } + + interface SortableOptions { + name?: string; + axis?: string; + autoScroll?: boolean; + container?: string|JQuery; + connectWith?: string; + cursor?: string; + cursorOffset?: SortableCursorOffset; + disabled?: string; + filter?: string; + handler?: string; + hint?: Function|string|JQuery; + holdToDrag?: boolean; + ignore?: string; + placeholder?: Function|string|JQuery; + start?(e: SortableStartEvent): void; + move?(e: SortableMoveEvent): void; + end?(e: SortableEndEvent): void; + change?(e: SortableChangeEvent): void; + cancel?(e: SortableCancelEvent): void; + } + interface SortableEvent { + sender: Sortable; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SortableStartEvent extends SortableEvent { + draggableEvent?: any; + item?: JQuery; + } + + interface SortableMoveEvent extends SortableEvent { + item?: JQuery; + target?: JQuery; + list?: kendo.ui.Sortable; + draggableEvent?: any; + } + + interface SortableEndEvent extends SortableEvent { + action?: string; + item?: JQuery; + oldIndex?: number; + newIndex?: number; + draggableEvent?: any; + } + + interface SortableChangeEvent extends SortableEvent { + action?: string; + item?: JQuery; + oldIndex?: number; + newIndex?: number; + draggableEvent?: any; + } + + interface SortableCancelEvent extends SortableEvent { + item?: JQuery; + } + + + class Splitter extends kendo.ui.Widget { + + static fn: Splitter; + + options: SplitterOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Splitter; + + constructor(element: Element, options?: SplitterOptions); + + + ajaxRequest(pane: string, url: string, data: any): void; + ajaxRequest(pane: string, url: string, data: string): void; + ajaxRequest(pane: Element, url: string, data: any): void; + ajaxRequest(pane: Element, url: string, data: string): void; + ajaxRequest(pane: JQuery, url: string, data: any): void; + ajaxRequest(pane: JQuery, url: string, data: string): void; + append(config?: any): JQuery; + collapse(pane: string): void; + collapse(pane: Element): void; + collapse(pane: JQuery): void; + destroy(): void; + expand(pane: string): void; + expand(pane: Element): void; + expand(pane: JQuery): void; + insertAfter(config: any, referencePane: string): JQuery; + insertAfter(config: any, referencePane: Element): JQuery; + insertAfter(config: any, referencePane: JQuery): JQuery; + insertBefore(config: any, referencePane: string): JQuery; + insertBefore(config: any, referencePane: Element): JQuery; + insertBefore(config: any, referencePane: JQuery): JQuery; + max(pane: string, value: string): void; + max(pane: Element, value: string): void; + max(pane: JQuery, value: string): void; + min(pane: string, value: string): void; + min(pane: Element, value: string): void; + min(pane: JQuery, value: string): void; + remove(pane: string): void; + remove(pane: Element): void; + remove(pane: JQuery): void; + size(pane: string): any; + size(pane: Element): any; + size(pane: JQuery): any; + size(pane: string, value?: string): void; + size(pane: Element, value?: string): void; + size(pane: JQuery, value?: string): void; + toggle(pane: string, expand?: boolean): void; + toggle(pane: Element, expand?: boolean): void; + toggle(pane: JQuery, expand?: boolean): void; + + } + + interface SplitterPane { + collapsed?: boolean; + collapsedSize?: string; + collapsible?: boolean; + contentUrl?: string; + max?: string; + min?: string; + resizable?: boolean; + scrollable?: boolean; + size?: string; + } + + interface SplitterOptions { + name?: string; + orientation?: string; + panes?: SplitterPane[]; + collapse?(e: SplitterCollapseEvent): void; + contentLoad?(e: SplitterContentLoadEvent): void; + error?(e: SplitterErrorEvent): void; + expand?(e: SplitterExpandEvent): void; + layoutChange?(e: SplitterEvent): void; + resize?(e: SplitterEvent): void; + } + interface SplitterEvent { + sender: Splitter; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SplitterCollapseEvent extends SplitterEvent { + pane?: Element; + } + + interface SplitterContentLoadEvent extends SplitterEvent { + pane?: Element; + } + + interface SplitterErrorEvent extends SplitterEvent { + xhr?: JQueryXHR; + status?: string; + } + + interface SplitterExpandEvent extends SplitterEvent { + pane?: Element; + } + + + class Spreadsheet extends kendo.ui.Widget { + + static fn: Spreadsheet; + + options: SpreadsheetOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Spreadsheet; + + constructor(element: Element, options?: SpreadsheetOptions); + + + activeSheet(): kendo.spreadsheet.Sheet; + activeSheet(sheet?: kendo.spreadsheet.Sheet): void; + sheets(): any; + fromFile(blob: Blob): JQueryPromise; + fromFile(blob: File): JQueryPromise; + saveAsExcel(): void; + saveAsPDF(): JQueryPromise; + sheetByName(name: string): kendo.spreadsheet.Sheet; + sheetIndex(sheet: kendo.spreadsheet.Sheet): number; + sheetByIndex(index: number): kendo.spreadsheet.Sheet; + insertSheet(options: any): kendo.spreadsheet.Sheet; + moveSheetToIndex(sheet: kendo.spreadsheet.Sheet, index: number): void; + removeSheet(sheet: kendo.spreadsheet.Sheet): void; + renameSheet(sheet: kendo.spreadsheet.Sheet, newSheetName: string): kendo.spreadsheet.Sheet; + toJSON(): any; + fromJSON(data: any): void; + defineName(name: string, value: string, hidden: boolean): void; + undefineName(name: string): void; + + } + + interface SpreadsheetExcel { + fileName?: string; + forceProxy?: boolean; + proxyURL?: string; + } + + interface SpreadsheetPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface SpreadsheetPdf { + area?: string; + author?: string; + creator?: string; + date?: Date; + fileName?: string; + fitWidth?: boolean; + forceProxy?: boolean; + guidelines?: boolean; + hCenter?: boolean; + keywords?: string; + landscape?: boolean; + margin?: SpreadsheetPdfMargin; + paperSize?: string|any; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + vCenter?: boolean; + } + + interface SpreadsheetSheetColumn { + index?: number; + width?: number; + } + + interface SpreadsheetSheetFilterColumnCriteriaItem { + operator?: string; + value?: string; + } + + interface SpreadsheetSheetFilterColumn { + criteria?: SpreadsheetSheetFilterColumnCriteriaItem[]; + filter?: string; + index?: number; + logic?: string; + type?: string; + value?: number|string|Date; + values?: any; + } + + interface SpreadsheetSheetFilter { + columns?: SpreadsheetSheetFilterColumn[]; + ref?: string; + } + + interface SpreadsheetSheetRowCellBorderBottom { + color?: string; + size?: string; + } + + interface SpreadsheetSheetRowCellBorderLeft { + color?: string; + size?: string; + } + + interface SpreadsheetSheetRowCellBorderRight { + color?: string; + size?: string; + } + + interface SpreadsheetSheetRowCellBorderTop { + color?: string; + size?: string; + } + + interface SpreadsheetSheetRowCellValidation { + type?: string; + comparerType?: string; + dataType?: string; + from?: string; + to?: string; + allowNulls?: boolean; + messageTemplate?: string; + titleTemplate?: string; + } + + interface SpreadsheetSheetRowCell { + background?: string; + borderBottom?: SpreadsheetSheetRowCellBorderBottom; + borderLeft?: SpreadsheetSheetRowCellBorderLeft; + borderTop?: SpreadsheetSheetRowCellBorderTop; + borderRight?: SpreadsheetSheetRowCellBorderRight; + color?: string; + fontFamily?: string; + fontSize?: number; + italic?: boolean; + bold?: boolean; + enable?: boolean; + format?: string; + formula?: string; + index?: number; + link?: string; + textAlign?: string; + underline?: boolean; + value?: number|string|boolean|Date; + validation?: SpreadsheetSheetRowCellValidation; + verticalAlign?: string; + wrap?: boolean; + } + + interface SpreadsheetSheetRow { + cells?: SpreadsheetSheetRowCell[]; + height?: number; + index?: number; + } + + interface SpreadsheetSheetSortColumn { + ascending?: boolean; + index?: number; + } + + interface SpreadsheetSheetSort { + columns?: SpreadsheetSheetSortColumn[]; + ref?: string; + } + + interface SpreadsheetSheet { + activeCell?: string; + name?: string; + columns?: SpreadsheetSheetColumn[]; + dataSource?: kendo.data.DataSource; + filter?: SpreadsheetSheetFilter; + frozenColumns?: number; + frozenRows?: number; + mergedCells?: any; + rows?: SpreadsheetSheetRow[]; + selection?: string; + showGridLines?: boolean; + sort?: SpreadsheetSheetSort; + } + + interface SpreadsheetToolbar { + home?: boolean|any; + insert?: boolean|any; + data?: boolean|any; + } + + interface SpreadsheetInsertSheetOptions { + rows?: number; + columns?: number; + rowHeight?: number; + columnWidth?: number; + headerHeight?: number; + headerWidth?: number; + dataSource?: kendo.data.DataSource; + data?: any; + } + + interface SpreadsheetOptions { + name?: string; + activeSheet?: string; + columnWidth?: number; + columns?: number; + headerHeight?: number; + headerWidth?: number; + excel?: SpreadsheetExcel; + pdf?: SpreadsheetPdf; + rowHeight?: number; + rows?: number; + sheets?: SpreadsheetSheet[]; + sheetsbar?: boolean; + toolbar?: boolean|SpreadsheetToolbar; + change?(e: SpreadsheetChangeEvent): void; + render?(e: SpreadsheetRenderEvent): void; + excelExport?(e: SpreadsheetExcelExportEvent): void; + excelImport?(e: SpreadsheetExcelImportEvent): void; + pdfExport?(e: SpreadsheetPdfExportEvent): void; + } + interface SpreadsheetEvent { + sender: Spreadsheet; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface SpreadsheetChangeEvent extends SpreadsheetEvent { + range?: kendo.spreadsheet.Range; + } + + interface SpreadsheetRenderEvent extends SpreadsheetEvent { + } + + interface SpreadsheetExcelExportEvent extends SpreadsheetEvent { + data?: any; + workbook?: kendo.ooxml.Workbook; + } + + interface SpreadsheetExcelImportEvent extends SpreadsheetEvent { + file?: Blob|File; + progress?: JQueryPromise; + } + + interface SpreadsheetPdfExportEvent extends SpreadsheetEvent { + promise?: JQueryPromise; + } + + + class TabStrip extends kendo.ui.Widget { + + static fn: TabStrip; + + options: TabStripOptions; + + dataSource: kendo.data.DataSource; + tabGroup: JQuery; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): TabStrip; + + constructor(element: Element, options?: TabStripOptions); + + + activateTab(item: JQuery): void; + append(tab: any): kendo.ui.TabStrip; + contentElement(itemIndex: number): Element; + contentHolder(itemIndex: number): Element; + deactivateTab(item: JQuery): void; + destroy(): void; + disable(element: string): kendo.ui.TabStrip; + disable(element: Element): kendo.ui.TabStrip; + disable(element: JQuery): kendo.ui.TabStrip; + enable(element: string, enable?: boolean): kendo.ui.TabStrip; + enable(element: Element, enable?: boolean): kendo.ui.TabStrip; + enable(element: JQuery, enable?: boolean): kendo.ui.TabStrip; + insertAfter(item: any, referenceTab: string): kendo.ui.TabStrip; + insertAfter(item: any, referenceTab: Element): kendo.ui.TabStrip; + insertAfter(item: any, referenceTab: JQuery): kendo.ui.TabStrip; + insertAfter(item: string, referenceTab: string): kendo.ui.TabStrip; + insertAfter(item: string, referenceTab: Element): kendo.ui.TabStrip; + insertAfter(item: string, referenceTab: JQuery): kendo.ui.TabStrip; + insertAfter(item: Element, referenceTab: string): kendo.ui.TabStrip; + insertAfter(item: Element, referenceTab: Element): kendo.ui.TabStrip; + insertAfter(item: Element, referenceTab: JQuery): kendo.ui.TabStrip; + insertAfter(item: JQuery, referenceTab: string): kendo.ui.TabStrip; + insertAfter(item: JQuery, referenceTab: Element): kendo.ui.TabStrip; + insertAfter(item: JQuery, referenceTab: JQuery): kendo.ui.TabStrip; + insertBefore(item: any, referenceTab: string): kendo.ui.TabStrip; + insertBefore(item: any, referenceTab: Element): kendo.ui.TabStrip; + insertBefore(item: any, referenceTab: JQuery): kendo.ui.TabStrip; + insertBefore(item: string, referenceTab: string): kendo.ui.TabStrip; + insertBefore(item: string, referenceTab: Element): kendo.ui.TabStrip; + insertBefore(item: string, referenceTab: JQuery): kendo.ui.TabStrip; + insertBefore(item: Element, referenceTab: string): kendo.ui.TabStrip; + insertBefore(item: Element, referenceTab: Element): kendo.ui.TabStrip; + insertBefore(item: Element, referenceTab: JQuery): kendo.ui.TabStrip; + insertBefore(item: JQuery, referenceTab: string): kendo.ui.TabStrip; + insertBefore(item: JQuery, referenceTab: Element): kendo.ui.TabStrip; + insertBefore(item: JQuery, referenceTab: JQuery): kendo.ui.TabStrip; + items(): HTMLCollection; + reload(element: string): kendo.ui.TabStrip; + reload(element: Element): kendo.ui.TabStrip; + reload(element: JQuery): kendo.ui.TabStrip; + remove(element: string): kendo.ui.TabStrip; + remove(element: number): kendo.ui.TabStrip; + remove(element: JQuery): kendo.ui.TabStrip; + select(): JQuery; + select(element: string): void; + select(element: Element): void; + select(element: JQuery): void; + select(element: number): void; + setDataSource(dataSource: any): void; + setDataSource(dataSource: kendo.data.DataSource): void; + + } + + interface TabStripAnimationClose { + duration?: number; + effects?: string; + } + + interface TabStripAnimationOpen { + duration?: number; + effects?: string; + } + + interface TabStripAnimation { + close?: TabStripAnimationClose; + open?: TabStripAnimationOpen; + } + + interface TabStripScrollable { + distance?: number; + } + + interface TabStripOptions { + name?: string; + animation?: boolean|TabStripAnimation; + collapsible?: boolean; + contentUrls?: any; + dataContentField?: string; + dataContentUrlField?: string; + dataImageUrlField?: string; + dataSource?: any|any|kendo.data.DataSource; + dataSpriteCssClass?: string; + dataTextField?: string; + dataUrlField?: string; + navigatable?: boolean; + scrollable?: boolean|TabStripScrollable; + tabPosition?: string; + value?: string; + activate?(e: TabStripActivateEvent): void; + contentLoad?(e: TabStripContentLoadEvent): void; + error?(e: TabStripErrorEvent): void; + select?(e: TabStripSelectEvent): void; + show?(e: TabStripShowEvent): void; + } + interface TabStripEvent { + sender: TabStrip; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface TabStripActivateEvent extends TabStripEvent { + item?: Element; + contentElement?: Element; + } + + interface TabStripContentLoadEvent extends TabStripEvent { + item?: Element; + contentElement?: Element; + } + + interface TabStripErrorEvent extends TabStripEvent { + xhr?: JQueryXHR; + status?: string; + } + + interface TabStripSelectEvent extends TabStripEvent { + item?: Element; + contentElement?: Element; + } + + interface TabStripShowEvent extends TabStripEvent { + item?: Element; + contentElement?: Element; + } + + + class TimePicker extends kendo.ui.Widget { + + static fn: TimePicker; + + options: TimePickerOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): TimePicker; + + constructor(element: Element, options?: TimePickerOptions); + + + close(): void; + destroy(): void; + enable(enable: boolean): void; + readonly(readonly: boolean): void; + max(): Date; + max(value: Date): void; + max(value: string): void; + min(): Date; + min(value: Date): void; + min(value: string): void; + open(): void; + setOptions(options: any): void; + value(): Date; + value(value: Date): void; + value(value: string): void; + + } + + interface TimePickerAnimationClose { + effects?: string; + duration?: number; + } + + interface TimePickerAnimationOpen { + effects?: string; + duration?: number; + } + + interface TimePickerAnimation { + close?: TimePickerAnimationClose; + open?: TimePickerAnimationOpen; + } + + interface TimePickerOptions { + name?: string; + animation?: boolean|TimePickerAnimation; + culture?: string; + dates?: any; + format?: string; + interval?: number; + max?: Date; + min?: Date; + parseFormats?: any; + value?: Date; + change?(e: TimePickerChangeEvent): void; + close?(e: TimePickerCloseEvent): void; + open?(e: TimePickerOpenEvent): void; + } + interface TimePickerEvent { + sender: TimePicker; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface TimePickerChangeEvent extends TimePickerEvent { + } + + interface TimePickerCloseEvent extends TimePickerEvent { + } + + interface TimePickerOpenEvent extends TimePickerEvent { + } + + + class ToolBar extends kendo.ui.Widget { + + static fn: ToolBar; + + options: ToolBarOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): ToolBar; + + constructor(element: Element, options?: ToolBarOptions); + + + add(command: any): void; + destroy(): void; + enable(command: string, enable: boolean): void; + enable(command: Element, enable: boolean): void; + enable(command: JQuery, enable: boolean): void; + getSelectedFromGroup(groupName: string): void; + hide(command: string): void; + hide(command: Element): void; + hide(command: JQuery): void; + remove(command: string): void; + remove(command: Element): void; + remove(command: JQuery): void; + show(command: string): void; + show(command: Element): void; + show(command: JQuery): void; + toggle(command: string, state: boolean): void; + toggle(command: Element, state: boolean): void; + toggle(command: JQuery, state: boolean): void; + + } + + interface ToolBarItemButton { + attributes?: any; + click?: Function; + enable?: boolean; + group?: string; + hidden?: boolean; + icon?: string; + id?: string; + imageUrl?: string; + selected?: boolean; + showIcon?: string; + showText?: string; + spriteCssClass?: string; + toggle?: Function; + togglable?: boolean; + text?: string; + url?: string; + } + + interface ToolBarItemMenuButton { + attributes?: any; + enable?: boolean; + hidden?: boolean; + icon?: string; + id?: string; + imageUrl?: string; + spriteCssClass?: string; + text?: string; + url?: string; + } + + interface ToolBarItem { + attributes?: any; + buttons?: ToolBarItemButton[]; + click?: Function; + enable?: boolean; + group?: string; + hidden?: boolean; + icon?: string; + id?: string; + imageUrl?: string; + menuButtons?: ToolBarItemMenuButton[]; + overflow?: string; + overflowTemplate?: string|Function; + primary?: boolean; + selected?: boolean; + showIcon?: string; + showText?: string; + spriteCssClass?: string; + template?: string|Function; + text?: string; + togglable?: boolean; + toggle?: Function; + type?: string; + url?: string; + } + + interface ToolBarOptions { + name?: string; + resizable?: boolean; + items?: ToolBarItem[]; + click?(e: ToolBarClickEvent): void; + close?(e: ToolBarCloseEvent): void; + open?(e: ToolBarOpenEvent): void; + toggle?(e: ToolBarToggleEvent): void; + overflowClose?(e: ToolBarOverflowCloseEvent): void; + overflowOpen?(e: ToolBarOverflowOpenEvent): void; + } + interface ToolBarEvent { + sender: ToolBar; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ToolBarClickEvent extends ToolBarEvent { + target?: JQuery; + id?: string; + } + + interface ToolBarCloseEvent extends ToolBarEvent { + SplitButton?: JQuery; + } + + interface ToolBarOpenEvent extends ToolBarEvent { + SplitButton?: JQuery; + } + + interface ToolBarToggleEvent extends ToolBarEvent { + target?: JQuery; + checked?: boolean; + id?: string; + } + + interface ToolBarOverflowCloseEvent extends ToolBarEvent { + } + + interface ToolBarOverflowOpenEvent extends ToolBarEvent { + } + + + class Tooltip extends kendo.ui.Widget { + + static fn: Tooltip; + + options: TooltipOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Tooltip; + + constructor(element: Element, options?: TooltipOptions); + + + show(element: JQuery): void; + hide(): void; + refresh(): void; + target(): JQuery; + + } + + interface TooltipAnimationClose { + effects?: string; + duration?: number; + } + + interface TooltipAnimationOpen { + effects?: string; + duration?: number; + } + + interface TooltipAnimation { + close?: TooltipAnimationClose; + open?: TooltipAnimationOpen; + } + + interface TooltipContent { + url?: string; + } + + interface TooltipOptions { + name?: string; + autoHide?: boolean; + animation?: boolean|TooltipAnimation; + content?: TooltipContent; + callout?: boolean; + filter?: string; + iframe?: boolean; + height?: number; + width?: number; + position?: string; + showAfter?: number; + showOn?: string; + contentLoad?(e: TooltipEvent): void; + show?(e: TooltipEvent): void; + hide?(e: TooltipEvent): void; + requestStart?(e: TooltipRequestStartEvent): void; + error?(e: TooltipErrorEvent): void; + } + interface TooltipEvent { + sender: Tooltip; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface TooltipRequestStartEvent extends TooltipEvent { + target?: JQuery; + options?: any; + } + + interface TooltipErrorEvent extends TooltipEvent { + xhr?: JQueryXHR; + status?: string; + } + + + class Touch extends kendo.ui.Widget { + + static fn: Touch; + + options: TouchOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Touch; + + constructor(element: Element, options?: TouchOptions); + + + cancel(): void; + destroy(): void; + + } + + interface TouchOptions { + name?: string; + filter?: string; + surface?: JQuery; + multiTouch?: boolean; + enableSwipe?: boolean; + minXDelta?: number; + maxYDelta?: number; + maxDuration?: number; + minHold?: number; + doubleTapTimeout?: number; + touchstart?(e: TouchTouchstartEvent): void; + dragstart?(e: TouchDragstartEvent): void; + drag?(e: TouchDragEvent): void; + dragend?(e: TouchDragendEvent): void; + tap?(e: TouchTapEvent): void; + doubletap?(e: TouchDoubletapEvent): void; + hold?(e: TouchHoldEvent): void; + swipe?(e: TouchSwipeEvent): void; + gesturestart?(e: TouchGesturestartEvent): void; + gesturechange?(e: TouchGesturechangeEvent): void; + gestureend?(e: TouchGestureendEvent): void; + } + interface TouchEvent { + sender: Touch; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface TouchTouchstartEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchDragstartEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchDragEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchDragendEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchTapEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchDoubletapEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchHoldEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchSwipeEvent extends TouchEvent { + touch?: kendo.mobile.ui.TouchEventOptions; + event?: JQueryEventObject; + } + + interface TouchGesturestartEvent extends TouchEvent { + touches?: any; + event?: JQueryEventObject; + distance?: number; + center?: kendo.mobile.ui.Point; + } + + interface TouchGesturechangeEvent extends TouchEvent { + touches?: any; + event?: JQueryEventObject; + distance?: number; + center?: kendo.mobile.ui.Point; + } + + interface TouchGestureendEvent extends TouchEvent { + touches?: any; + event?: JQueryEventObject; + distance?: number; + center?: kendo.mobile.ui.Point; + } + + + class TreeList extends kendo.ui.Widget { + + static fn: TreeList; + + options: TreeListOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): TreeList; + + constructor(element: Element, options?: TreeListOptions); + + + addRow(parentRow: string): void; + addRow(parentRow: Element): void; + addRow(parentRow: JQuery): void; + autoFitColumn(column: number): void; + autoFitColumn(column: string): void; + autoFitColumn(column: any): void; + cancelRow(): void; + clearSelection(): void; + collapse(): void; + dataItem(row: string): kendo.data.TreeListModel; + dataItem(row: Element): kendo.data.TreeListModel; + dataItem(row: JQuery): kendo.data.TreeListModel; + destroy(): void; + editRow(row: JQuery): void; + expand(row: string): JQueryPromise; + expand(row: Element): JQueryPromise; + expand(row: JQuery): JQueryPromise; + itemFor(model: kendo.data.TreeListModel): JQuery; + itemFor(model: any): JQuery; + items(): any; + refresh(): void; + removeRow(row: string): void; + removeRow(row: Element): void; + removeRow(row: JQuery): void; + saveAsExcel(): void; + saveAsPDF(): JQueryPromise; + saveRow(): void; + select(): JQuery; + select(rows: Element): void; + select(rows: JQuery): void; + setDataSource(dataSource: kendo.data.TreeListDataSource): void; + showColumn(column: number): void; + showColumn(column: string): void; + hideColumn(column: number): void; + hideColumn(column: string): void; + lockColumn(column: number): void; + lockColumn(column: string): void; + unlockColumn(column: number): void; + unlockColumn(column: string): void; + reorderColumn(destIndex: number, column: any): void; + + } + + interface TreeListColumnMenuMessages { + columns?: string; + filter?: string; + sortAscending?: string; + sortDescending?: string; + } + + interface TreeListColumnMenu { + columns?: boolean; + filterable?: boolean; + sortable?: boolean; + messages?: TreeListColumnMenuMessages; + } + + interface TreeListColumnCommandItem { + className?: string; + click?: Function; + name?: string; + text?: string; + } + + interface TreeListColumnFilterable { + ui?: string|Function; + } + + interface TreeListColumnSortable { + compare?: Function; + } + + interface TreeListColumn { + attributes?: any; + command?: TreeListColumnCommandItem[]; + encoded?: boolean; + expandable?: boolean; + field?: string; + filterable?: boolean|TreeListColumnFilterable; + footerTemplate?: string|Function; + format?: string; + headerAttributes?: any; + headerTemplate?: string|Function; + minScreenWidth?: number; + sortable?: boolean|TreeListColumnSortable; + template?: string|Function; + title?: string; + width?: string|number; + hidden?: boolean; + menu?: boolean; + locked?: boolean; + lockable?: boolean; + } + + interface TreeListEditable { + mode?: string; + move?: boolean; + template?: string|Function; + window?: any; + } + + interface TreeListExcel { + fileName?: string; + filterable?: boolean; + forceProxy?: boolean; + proxyURL?: string; + } + + interface TreeListFilterableMessages { + and?: string; + clear?: string; + filter?: string; + info?: string; + isFalse?: string; + isTrue?: string; + or?: string; + selectValue?: string; + cancel?: string; + operator?: string; + } + + interface TreeListFilterable { + extra?: boolean; + messages?: TreeListFilterableMessages; + } + + interface TreeListMessagesCommands { + canceledit?: string; + create?: string; + createchild?: string; + destroy?: string; + edit?: string; + excel?: string; + pdf?: string; + update?: string; + } + + interface TreeListMessages { + commands?: TreeListMessagesCommands; + loading?: string; + noRows?: string; + requestFailed?: string; + retry?: string; + } + + interface TreeListPdfMargin { + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; + } + + interface TreeListPdf { + author?: string; + avoidLinks?: boolean|string; + creator?: string; + date?: Date; + fileName?: string; + forceProxy?: boolean; + keywords?: string; + landscape?: boolean; + margin?: TreeListPdfMargin; + paperSize?: string|any; + proxyURL?: string; + proxyTarget?: string; + subject?: string; + title?: string; + } + + interface TreeListSortable { + allowUnsort?: boolean; + mode?: string; + } + + interface TreeListToolbarItem { + click?: Function; + name?: string; + text?: string; + } + + interface TreeListOptions { + name?: string; + autoBind?: boolean; + columns?: TreeListColumn[]; + resizable?: boolean; + reorderable?: boolean; + columnMenu?: boolean|TreeListColumnMenu; + dataSource?: any|any|kendo.data.TreeListDataSource; + editable?: boolean|TreeListEditable; + excel?: TreeListExcel; + filterable?: boolean|TreeListFilterable; + height?: number|string; + messages?: TreeListMessages; + pdf?: TreeListPdf; + scrollable?: boolean|any; + selectable?: boolean|string; + sortable?: boolean|TreeListSortable; + toolbar?: TreeListToolbarItem[] | any; + cancel?(e: TreeListCancelEvent): void; + change?(e: TreeListChangeEvent): void; + collapse?(e: TreeListCollapseEvent): void; + dataBinding?(e: TreeListDataBindingEvent): void; + dataBound?(e: TreeListDataBoundEvent): void; + dragstart?(e: TreeListDragstartEvent): void; + drag?(e: TreeListDragEvent): void; + dragend?(e: TreeListDragendEvent): void; + drop?(e: TreeListDropEvent): void; + edit?(e: TreeListEditEvent): void; + excelExport?(e: TreeListExcelExportEvent): void; + expand?(e: TreeListExpandEvent): void; + filterMenuInit?(e: TreeListFilterMenuInitEvent): void; + pdfExport?(e: TreeListPdfExportEvent): void; + remove?(e: TreeListRemoveEvent): void; + save?(e: TreeListSaveEvent): void; + columnShow?(e: TreeListColumnShowEvent): void; + columnHide?(e: TreeListColumnHideEvent): void; + columnReorder?(e: TreeListColumnReorderEvent): void; + columnResize?(e: TreeListColumnResizeEvent): void; + columnMenuInit?(e: TreeListColumnMenuInitEvent): void; + columnLock?(e: TreeListColumnLockEvent): void; + columnUnlock?(e: TreeListColumnUnlockEvent): void; + } + interface TreeListEvent { + sender: TreeList; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface TreeListCancelEvent extends TreeListEvent { + container?: JQuery; + model?: kendo.data.TreeListModel; + } + + interface TreeListChangeEvent extends TreeListEvent { + } + + interface TreeListCollapseEvent extends TreeListEvent { + model?: kendo.data.TreeListModel; + } + + interface TreeListDataBindingEvent extends TreeListEvent { + } + + interface TreeListDataBoundEvent extends TreeListEvent { + } + + interface TreeListDragstartEvent extends TreeListEvent { + source?: kendo.data.TreeListModel; + } + + interface TreeListDragEvent extends TreeListEvent { + source?: kendo.data.TreeListModel; + target?: JQuery; + } + + interface TreeListDragendEvent extends TreeListEvent { + source?: kendo.data.TreeListModel; + destination?: kendo.data.TreeListModel; + } + + interface TreeListDropEvent extends TreeListEvent { + source?: kendo.data.TreeListModel; + destination?: kendo.data.TreeListModel; + dropTarget?: Element; + valid?: boolean; + setValid?: boolean; + } + + interface TreeListEditEvent extends TreeListEvent { + container?: JQuery; + model?: kendo.data.TreeListModel; + } + + interface TreeListExcelExportEvent extends TreeListEvent { + data?: any; + workbook?: any; + } + + interface TreeListExpandEvent extends TreeListEvent { + model?: kendo.data.TreeListModel; + } + + interface TreeListFilterMenuInitEvent extends TreeListEvent { + container?: JQuery; + field?: string; + } + + interface TreeListPdfExportEvent extends TreeListEvent { + promise?: JQueryPromise; + } + + interface TreeListRemoveEvent extends TreeListEvent { + model?: kendo.data.TreeListModel; + row?: JQuery; + } + + interface TreeListSaveEvent extends TreeListEvent { + model?: kendo.data.TreeListModel; + container?: JQuery; + } + + interface TreeListColumnShowEvent extends TreeListEvent { + column?: any; + } + + interface TreeListColumnHideEvent extends TreeListEvent { + column?: any; + } + + interface TreeListColumnReorderEvent extends TreeListEvent { + column?: any; + newIndex?: number; + oldIndex?: number; + } + + interface TreeListColumnResizeEvent extends TreeListEvent { + column?: any; + newWidth?: number; + oldWidth?: number; + } + + interface TreeListColumnMenuInitEvent extends TreeListEvent { + container?: JQuery; + field?: string; + } + + interface TreeListColumnLockEvent extends TreeListEvent { + column?: any; + } + + interface TreeListColumnUnlockEvent extends TreeListEvent { + column?: any; + } + + + class TreeView extends kendo.ui.Widget { + + static fn: TreeView; + + options: TreeViewOptions; + + dataSource: kendo.data.DataSource; + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): TreeView; + + constructor(element: Element, options?: TreeViewOptions); + + + append(nodeData: any, parentNode?: JQuery, success?: Function): JQuery; + append(nodeData: JQuery, parentNode?: JQuery, success?: Function): JQuery; + collapse(nodes: JQuery): void; + collapse(nodes: Element): void; + collapse(nodes: string): void; + dataItem(node: JQuery): kendo.data.Node; + dataItem(node: Element): kendo.data.Node; + dataItem(node: string): kendo.data.Node; + destroy(): void; + detach(node: JQuery): JQuery; + detach(node: Element): JQuery; + detach(node: string): JQuery; + enable(nodes: JQuery, enable?: boolean): void; + enable(nodes: Element, enable?: boolean): void; + enable(nodes: string, enable?: boolean): void; + expand(nodes: JQuery): void; + expand(nodes: Element): void; + expand(nodes: string): void; + expandPath(path: any, complete: Function): void; + expandTo(targetNode: kendo.data.Node): void; + expandTo(targetNode: any): void; + findByText(text: string): JQuery; + findByUid(text: string): JQuery; + insertAfter(nodeData: any, referenceNode: JQuery): void; + insertBefore(nodeData: any, referenceNode: JQuery): void; + items(): any; + parent(node: JQuery): JQuery; + parent(node: Element): JQuery; + parent(node: string): JQuery; + remove(node: JQuery): void; + remove(node: Element): void; + remove(node: string): void; + select(): JQuery; + select(node?: JQuery): void; + select(node?: Element): void; + select(node?: string): void; + setDataSource(dataSource: kendo.data.HierarchicalDataSource): void; + text(node: JQuery): string; + text(node: Element): string; + text(node: string): string; + text(node: JQuery, newText: string): void; + text(node: Element, newText: string): void; + text(node: string, newText: string): void; + toggle(node: JQuery): void; + toggle(node: Element): void; + toggle(node: string): void; + updateIndeterminate(node: JQuery): void; + + } + + interface TreeViewAnimationCollapse { + duration?: number; + effects?: string; + } + + interface TreeViewAnimationExpand { + duration?: number; + effects?: string; + } + + interface TreeViewAnimation { + collapse?: boolean|TreeViewAnimationCollapse; + expand?: boolean|TreeViewAnimationExpand; + } + + interface TreeViewCheckboxes { + checkChildren?: boolean; + name?: string; + template?: string|Function; + } + + interface TreeViewMessages { + loading?: string; + requestFailed?: string; + retry?: string; + } + + interface TreeViewOptions { + name?: string; + animation?: boolean|TreeViewAnimation; + autoBind?: boolean; + autoScroll?: boolean; + checkboxes?: boolean|TreeViewCheckboxes; + dataImageUrlField?: string; + dataSource?: any|any|kendo.data.HierarchicalDataSource; + dataSpriteCssClassField?: string; + dataTextField?: string|any; + dataUrlField?: string; + dragAndDrop?: boolean; + loadOnDemand?: boolean; + messages?: TreeViewMessages; + template?: string|Function; + change?(e: TreeViewEvent): void; + check?(e: TreeViewCheckEvent): void; + collapse?(e: TreeViewCollapseEvent): void; + dataBound?(e: TreeViewDataBoundEvent): void; + drag?(e: TreeViewDragEvent): void; + dragend?(e: TreeViewDragendEvent): void; + dragstart?(e: TreeViewDragstartEvent): void; + drop?(e: TreeViewDropEvent): void; + expand?(e: TreeViewExpandEvent): void; + navigate?(e: TreeViewNavigateEvent): void; + select?(e: TreeViewSelectEvent): void; + } + interface TreeViewEvent { + sender: TreeView; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface TreeViewCheckEvent extends TreeViewEvent { + node?: Element; + } + + interface TreeViewCollapseEvent extends TreeViewEvent { + node?: Element; + } + + interface TreeViewDataBoundEvent extends TreeViewEvent { + node?: JQuery; + } + + interface TreeViewDragEvent extends TreeViewEvent { + sourceNode?: Element; + dropTarget?: Element; + pageX?: number; + pageY?: number; + statusClass?: string; + setStatusClass?: Function; + } + + interface TreeViewDragendEvent extends TreeViewEvent { + sourceNode?: Element; + destinationNode?: Element; + dropPosition?: string; + } + + interface TreeViewDragstartEvent extends TreeViewEvent { + sourceNode?: Element; + } + + interface TreeViewDropEvent extends TreeViewEvent { + sourceNode?: Element; + destinationNode?: Element; + valid?: boolean; + setValid?: Function; + dropTarget?: Element; + dropPosition?: string; + } + + interface TreeViewExpandEvent extends TreeViewEvent { + node?: Element; + } + + interface TreeViewNavigateEvent extends TreeViewEvent { + node?: Element; + } + + interface TreeViewSelectEvent extends TreeViewEvent { + node?: Element; + } + + + class Upload extends kendo.ui.Widget { + + static fn: Upload; + + options: UploadOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Upload; + + constructor(element: Element, options?: UploadOptions); + + + clearAllFiles(): void; + clearFile(): void; + clearFileByUid(): void; + destroy(): void; + disable(): void; + enable(enable?: boolean): void; + getFiles(): void; + removeAllFiles(): void; + removeFile(): void; + removeFileByUid(): void; + toggle(enable: boolean): void; + upload(): void; + + } + + interface UploadAsync { + autoUpload?: boolean; + batch?: boolean; + removeField?: string; + removeUrl?: string; + removeVerb?: string; + saveField?: string; + saveUrl?: string; + withCredentials?: boolean; + } + + interface UploadFile { + extension?: string; + name?: string; + size?: number; + } + + interface UploadLocalization { + cancel?: string; + clearSelectedFiles?: string; + dropFilesHere?: string; + headerStatusUploaded?: string; + headerStatusUploading?: string; + invalidFileExtension?: string; + invalidMaxFileSize?: string; + invalidMinFileSize?: string; + remove?: string; + retry?: string; + select?: string; + statusFailed?: string; + statusUploaded?: string; + statusUploading?: string; + uploadSelectedFiles?: string; + } + + interface UploadValidation { + allowedExtensions?: any; + maxFileSize?: number; + minFileSize?: number; + } + + interface UploadOptions { + name?: string; + async?: UploadAsync; + dropZone?: string; + enabled?: boolean; + files?: UploadFile[]; + localization?: UploadLocalization; + multiple?: boolean; + showFileList?: boolean; + template?: string|Function; + validation?: UploadValidation; + cancel?(e: UploadCancelEvent): void; + complete?(e: UploadEvent): void; + error?(e: UploadErrorEvent): void; + progress?(e: UploadProgressEvent): void; + remove?(e: UploadRemoveEvent): void; + select?(e: UploadSelectEvent): void; + success?(e: UploadSuccessEvent): void; + upload?(e: UploadUploadEvent): void; + } + interface UploadEvent { + sender: Upload; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface UploadCancelEvent extends UploadEvent { + files?: UploadFile[]; + } + + interface UploadErrorEvent extends UploadEvent { + files?: UploadFile[]; + operation?: string; + XMLHttpRequest?: any; + } + + interface UploadProgressEvent extends UploadEvent { + files?: UploadFile[]; + percentComplete?: number; + } + + interface UploadRemoveEvent extends UploadEvent { + files?: UploadFile[]; + data?: any; + } + + interface UploadSelectEvent extends UploadEvent { + e?: any; + files?: UploadFile[]; + } + + interface UploadSuccessEvent extends UploadEvent { + files?: UploadFile[]; + operation?: string; + response?: any; + XMLHttpRequest?: any; + } + + interface UploadUploadEvent extends UploadEvent { + files?: UploadFile[]; + data?: any; + formData?: any; + XMLHttpRequest?: any; + } + + + class Validator extends kendo.ui.Widget { + + static fn: Validator; + + options: ValidatorOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Validator; + + constructor(element: Element, options?: ValidatorOptions); + + + errors(): any; + hideMessages(): void; + validate(): boolean; + validateInput(input: Element): boolean; + validateInput(input: JQuery): boolean; + + } + + interface ValidatorOptions { + name?: string; + errorTemplate?: string; + messages?: any; + rules?: any; + validateOnBlur?: boolean; + validate?(e: ValidatorValidateEvent): void; + } + interface ValidatorEvent { + sender: Validator; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface ValidatorValidateEvent extends ValidatorEvent { + valid?: boolean; + } + + + class Window extends kendo.ui.Widget { + + static fn: Window; + + options: WindowOptions; + + + element: JQuery; + wrapper: JQuery; + + static extend(proto: Object): Window; + + constructor(element: Element, options?: WindowOptions); + + + center(): kendo.ui.Window; + close(): kendo.ui.Window; + content(): string; + content(content?: string): kendo.ui.Window; + content(content?: JQuery): kendo.ui.Window; + destroy(): void; + maximize(): kendo.ui.Window; + minimize(): kendo.ui.Window; + open(): kendo.ui.Window; + pin(): void; + refresh(options: any): kendo.ui.Window; + restore(): kendo.ui.Window; + setOptions(options: any): void; + title(): string; + title(text?: string): kendo.ui.Window; + toFront(): kendo.ui.Window; + toggleMaximization(): kendo.ui.Window; + unpin(): void; + + } + + interface WindowAnimationClose { + effects?: string; + duration?: number; + } + + interface WindowAnimationOpen { + effects?: string; + duration?: number; + } + + interface WindowAnimation { + close?: WindowAnimationClose; + open?: WindowAnimationOpen; + } + + interface WindowContent { + template?: string; + } + + interface WindowPosition { + top?: number|string; + left?: number|string; + } + + interface WindowRefreshOptions { + url?: string; + cache?: boolean; + data?: any; + type?: string; + template?: string; + iframe?: boolean; + } + + interface WindowOptions { + name?: string; + actions?: any; + animation?: boolean|WindowAnimation; + appendTo?: any|string; + autoFocus?: boolean; + content?: WindowContent; + draggable?: boolean; + iframe?: boolean; + height?: number|string; + maxHeight?: number; + maxWidth?: number; + minHeight?: number; + minWidth?: number; + modal?: boolean; + pinned?: boolean; + position?: WindowPosition; + resizable?: boolean; + scrollable?: boolean; + title?: string|boolean; + visible?: boolean; + width?: number|string; + activate?(e: WindowEvent): void; + close?(e: WindowCloseEvent): void; + deactivate?(e: WindowEvent): void; + dragend?(e: WindowEvent): void; + dragstart?(e: WindowEvent): void; + error?(e: WindowErrorEvent): void; + maximize?(e: WindowEvent): void; + minimize?(e: WindowEvent): void; + open?(e: WindowEvent): void; + refresh?(e: WindowEvent): void; + resize?(e: WindowEvent): void; + } + interface WindowEvent { + sender: Window; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + interface WindowCloseEvent extends WindowEvent { + userTriggered?: boolean; + } + + interface WindowErrorEvent extends WindowEvent { + xhr?: JQueryXHR; + status?: string; + } + } declare namespace kendo.drawing { @@ -2579,5662 +8350,272 @@ declare namespace kendo.drawing { } -declare namespace kendo.ui { - class AutoComplete extends kendo.ui.Widget { - - static fn: AutoComplete; - - options: AutoCompleteOptions; - - dataSource: kendo.data.DataSource; - list: JQuery; - ul: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): AutoComplete; - - constructor(element: Element, options?: AutoCompleteOptions); +declare namespace kendo.geometry { + class Arc extends Observable { - close(): void; - dataItem(index: number): any; - destroy(): void; - enable(enable: boolean): void; - focus(): void; - items(): any; - readonly(readonly: boolean): void; - refresh(): void; - search(word: string): void; - select(item: string): void; - select(item: Element): void; - select(item: JQuery): void; - setDataSource(dataSource: kendo.data.DataSource): void; - suggest(value: string): void; - value(): string; - value(value: string): void; + options: ArcOptions; + + anticlockwise: boolean; + center: kendo.geometry.Point; + endAngle: number; + radiusX: number; + radiusY: number; + startAngle: number; + + constructor(center: any|kendo.geometry.Point, options?: ArcOptions); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + getAnticlockwise(): boolean; + getCenter(): kendo.geometry.Point; + getEndAngle(): number; + getRadiusX(): number; + getRadiusY(): number; + getStartAngle(): number; + pointAt(angle: number): kendo.geometry.Point; + setAnticlockwise(value: boolean): kendo.geometry.Arc; + setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; + setEndAngle(value: number): kendo.geometry.Arc; + setRadiusX(value: number): kendo.geometry.Arc; + setRadiusY(value: number): kendo.geometry.Arc; + setStartAngle(value: number): kendo.geometry.Arc; } - interface AutoCompleteAnimationClose { - duration?: number; - effects?: string; - } - - interface AutoCompleteAnimationOpen { - duration?: number; - effects?: string; - } - - interface AutoCompleteAnimation { - close?: AutoCompleteAnimationClose; - open?: AutoCompleteAnimationOpen; - } - - interface AutoCompleteVirtual { - itemHeight?: number; - valueMapper?: Function; - } - - interface AutoCompleteOptions { + interface ArcOptions { name?: string; - animation?: boolean|AutoCompleteAnimation; - dataSource?: any|any|kendo.data.DataSource; - dataTextField?: string; - delay?: number; - enable?: boolean; - filter?: string; - fixedGroupTemplate?: string|Function; - groupTemplate?: string|Function; - height?: number; - highlightFirst?: boolean; - ignoreCase?: boolean; - minLength?: number; - placeholder?: string; - popup?: any; - separator?: string; - suggest?: boolean; - headerTemplate?: string|Function; - template?: string | Function; - valuePrimitive?: boolean; - virtual?: boolean|AutoCompleteVirtual; - change?(e: AutoCompleteChangeEvent): void; - close?(e: AutoCompleteCloseEvent): void; - dataBound?(e: AutoCompleteDataBoundEvent): void; - filtering?(e: AutoCompleteFilteringEvent): void; - open?(e: AutoCompleteOpenEvent): void; - select?(e: AutoCompleteSelectEvent): void; } - interface AutoCompleteEvent { - sender: AutoComplete; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface AutoCompleteChangeEvent extends AutoCompleteEvent { - } - - interface AutoCompleteCloseEvent extends AutoCompleteEvent { - } - - interface AutoCompleteDataBoundEvent extends AutoCompleteEvent { - } - - interface AutoCompleteFilteringEvent extends AutoCompleteEvent { - filter?: any; - } - - interface AutoCompleteOpenEvent extends AutoCompleteEvent { - } - - interface AutoCompleteSelectEvent extends AutoCompleteEvent { - item?: JQuery; - } - - - class Button extends kendo.ui.Widget { - - static fn: Button; - - options: ButtonOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Button; - - constructor(element: Element, options?: ButtonOptions); - - - enable(toggle: boolean): void; - - } - - interface ButtonOptions { - name?: string; - enable?: boolean; - icon?: string; - imageUrl?: string; - spriteCssClass?: string; - click?(e: ButtonClickEvent): void; - } - interface ButtonEvent { - sender: Button; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ButtonClickEvent extends ButtonEvent { - event?: any; - } - - - class Calendar extends kendo.ui.Widget { - - static fn: Calendar; - - options: CalendarOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Calendar; - - constructor(element: Element, options?: CalendarOptions); - - - current(): Date; - destroy(): void; - max(): Date; - max(value: Date): void; - max(value: string): void; - min(): Date; - min(value: Date): void; - min(value: string): void; - navigate(value: Date, view: string): void; - navigateDown(value: Date): void; - navigateToFuture(): void; - navigateToPast(): void; - navigateUp(): void; - value(): Date; - value(value: Date): void; - value(value: string): void; - view(): any; - - } - - interface CalendarMonth { - content?: string; - empty?: string; - } - - interface CalendarOptions { - name?: string; - culture?: string; - dates?: any; - depth?: string; - disableDates?: any|Function; - footer?: string|Function; - format?: string; - max?: Date; - min?: Date; - month?: CalendarMonth; - start?: string; - value?: Date; - change?(e: CalendarEvent): void; - navigate?(e: CalendarEvent): void; - } - interface CalendarEvent { - sender: Calendar; + interface ArcEvent { + sender: Arc; preventDefault: Function; isDefaultPrevented(): boolean; } - class ColorPalette extends kendo.ui.Widget { - - static fn: ColorPalette; - - options: ColorPaletteOptions; + class Circle extends Observable { - element: JQuery; - wrapper: JQuery; + options: CircleOptions; - static extend(proto: Object): ColorPalette; + center: kendo.geometry.Point; + radius: number; - constructor(element: Element, options?: ColorPaletteOptions); + constructor(center: any|kendo.geometry.Point, radius: number); - value(): string; - value(color?: string): void; - color(): kendo.Color; - color(color?: kendo.Color): void; - enable(enable?: boolean): void; + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + clone(): kendo.geometry.Circle; + equals(other: kendo.geometry.Circle): boolean; + getCenter(): kendo.geometry.Point; + getRadius(): number; + pointAt(angle: number): kendo.geometry.Point; + setCenter(value: kendo.geometry.Point): kendo.geometry.Point; + setCenter(value: any): kendo.geometry.Point; + setRadius(value: number): kendo.geometry.Circle; } - interface ColorPaletteTileSize { - width?: number; - height?: number; - } - - interface ColorPaletteOptions { + interface CircleOptions { name?: string; - palette?: string|any; - columns?: number; - tileSize?: ColorPaletteTileSize; - value?: string; - change?(e: ColorPaletteEvent): void; } - interface ColorPaletteEvent { - sender: ColorPalette; + interface CircleEvent { + sender: Circle; preventDefault: Function; isDefaultPrevented(): boolean; } - class ColorPicker extends kendo.ui.Widget { - - static fn: ColorPicker; - - options: ColorPickerOptions; + class Matrix extends Observable { - element: JQuery; - wrapper: JQuery; + options: MatrixOptions; - static extend(proto: Object): ColorPicker; - - constructor(element: Element, options?: ColorPickerOptions); + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; - close(): void; - open(): void; - toggle(): void; - value(): string; - value(color?: string): void; - color(): kendo.Color; - color(color?: kendo.Color): void; - enable(enable?: boolean): void; + static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; + static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; + static translate(x: number, y: number): kendo.geometry.Matrix; + static unit(): kendo.geometry.Matrix; + + clone(): kendo.geometry.Matrix; + equals(other: kendo.geometry.Matrix): boolean; + round(digits: number): kendo.geometry.Matrix; + multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; + toArray(digits: number): any; + toString(digits: number, separator: string): string; } - interface ColorPickerMessages { - apply?: string; - cancel?: string; - } - - interface ColorPickerTileSize { - width?: number; - height?: number; - } - - interface ColorPickerOptions { + interface MatrixOptions { name?: string; - buttons?: boolean; - columns?: number; - tileSize?: ColorPickerTileSize; - messages?: ColorPickerMessages; - palette?: string|any; - opacity?: boolean; - preview?: boolean; - toolIcon?: string; - value?: string; - change?(e: ColorPickerChangeEvent): void; - select?(e: ColorPickerSelectEvent): void; - open?(e: ColorPickerEvent): void; - close?(e: ColorPickerEvent): void; } - interface ColorPickerEvent { - sender: ColorPicker; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ColorPickerChangeEvent extends ColorPickerEvent { - value?: string; - } - - interface ColorPickerSelectEvent extends ColorPickerEvent { - value?: string; - } - - - class ComboBox extends kendo.ui.Widget { - - static fn: ComboBox; - - options: ComboBoxOptions; - - dataSource: kendo.data.DataSource; - input: JQuery; - list: JQuery; - ul: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): ComboBox; - - constructor(element: Element, options?: ComboBoxOptions); - - - close(): void; - dataItem(index?: number): any; - destroy(): void; - enable(enable: boolean): void; - focus(): void; - items(): any; - open(): void; - readonly(readonly: boolean): void; - refresh(): void; - search(word: string): void; - select(): number; - select(li: JQuery): void; - select(li: number): void; - select(li: Function): void; - setDataSource(dataSource: kendo.data.DataSource): void; - suggest(value: string): void; - text(): string; - text(text: string): void; - toggle(toggle: boolean): void; - value(): string; - value(value: string): void; - - } - - interface ComboBoxAnimationClose { - effects?: string; - duration?: number; - } - - interface ComboBoxAnimationOpen { - effects?: string; - duration?: number; - } - - interface ComboBoxAnimation { - close?: ComboBoxAnimationClose; - open?: ComboBoxAnimationOpen; - } - - interface ComboBoxPopup { - appendTo?: string; - origin?: string; - position?: string; - } - - interface ComboBoxVirtual { - itemHeight?: number; - valueMapper?: Function; - } - - interface ComboBoxOptions { - name?: string; - animation?: ComboBoxAnimation; - autoBind?: boolean; - cascadeFrom?: string; - cascadeFromField?: string; - dataSource?: any|any|kendo.data.DataSource; - dataTextField?: string; - dataValueField?: string; - delay?: number; - enable?: boolean; - filter?: string; - fixedGroupTemplate?: string|Function; - groupTemplate?: string|Function; - height?: number; - highlightFirst?: boolean; - ignoreCase?: boolean; - index?: number; - minLength?: number; - placeholder?: string; - popup?: ComboBoxPopup; - suggest?: boolean; - headerTemplate?: string|Function; - template?: string|Function; - text?: string; - value?: string; - valuePrimitive?: boolean; - virtual?: boolean|ComboBoxVirtual; - change?(e: ComboBoxChangeEvent): void; - close?(e: ComboBoxCloseEvent): void; - dataBound?(e: ComboBoxDataBoundEvent): void; - filtering?(e: ComboBoxFilteringEvent): void; - open?(e: ComboBoxOpenEvent): void; - select?(e: ComboBoxSelectEvent): void; - cascade?(e: ComboBoxCascadeEvent): void; - } - interface ComboBoxEvent { - sender: ComboBox; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ComboBoxChangeEvent extends ComboBoxEvent { - } - - interface ComboBoxCloseEvent extends ComboBoxEvent { - } - - interface ComboBoxDataBoundEvent extends ComboBoxEvent { - } - - interface ComboBoxFilteringEvent extends ComboBoxEvent { - filter?: any; - } - - interface ComboBoxOpenEvent extends ComboBoxEvent { - } - - interface ComboBoxSelectEvent extends ComboBoxEvent { - item?: JQuery; - } - - interface ComboBoxCascadeEvent extends ComboBoxEvent { - } - - - class ContextMenu extends kendo.ui.Widget { - - static fn: ContextMenu; - - options: ContextMenuOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): ContextMenu; - - constructor(element: Element, options?: ContextMenuOptions); - - - append(item: any, referenceItem: string): kendo.ui.ContextMenu; - append(item: any, referenceItem: JQuery): kendo.ui.ContextMenu; - close(element: Element): kendo.ui.ContextMenu; - close(element: JQuery): kendo.ui.ContextMenu; - destroy(): void; - enable(element: string, enable: boolean): kendo.ui.ContextMenu; - enable(element: Element, enable: boolean): kendo.ui.ContextMenu; - enable(element: JQuery, enable: boolean): kendo.ui.ContextMenu; - insertAfter(item: any, referenceItem: string): kendo.ui.ContextMenu; - insertAfter(item: any, referenceItem: Element): kendo.ui.ContextMenu; - insertAfter(item: any, referenceItem: JQuery): kendo.ui.ContextMenu; - insertBefore(item: any, referenceItem: string): kendo.ui.ContextMenu; - insertBefore(item: any, referenceItem: Element): kendo.ui.ContextMenu; - insertBefore(item: any, referenceItem: JQuery): kendo.ui.ContextMenu; - open(x: number, y?: number): kendo.ui.ContextMenu; - open(x: Element, y?: number): kendo.ui.ContextMenu; - open(x: JQuery, y?: number): kendo.ui.ContextMenu; - remove(element: string): kendo.ui.ContextMenu; - remove(element: Element): kendo.ui.ContextMenu; - remove(element: JQuery): kendo.ui.ContextMenu; - - } - - interface ContextMenuAnimationClose { - effects?: string; - duration?: number; - } - - interface ContextMenuAnimationOpen { - effects?: string; - duration?: number; - } - - interface ContextMenuAnimation { - close?: ContextMenuAnimationClose; - open?: ContextMenuAnimationOpen; - } - - interface ContextMenuOptions { - name?: string; - alignToAnchor?: boolean; - animation?: boolean|ContextMenuAnimation; - closeOnClick?: boolean; - dataSource?: any|any; - direction?: string; - filter?: string; - hoverDelay?: number; - orientation?: string; - popupCollision?: string; - showOn?: string; - target?: string|JQuery; - close?(e: ContextMenuCloseEvent): void; - open?(e: ContextMenuOpenEvent): void; - activate?(e: ContextMenuActivateEvent): void; - deactivate?(e: ContextMenuDeactivateEvent): void; - select?(e: ContextMenuSelectEvent): void; - } - interface ContextMenuEvent { - sender: ContextMenu; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ContextMenuCloseEvent extends ContextMenuEvent { - item?: Element; - type?: string; - target?: Element; - event?: JQueryEventObject; - } - - interface ContextMenuOpenEvent extends ContextMenuEvent { - item?: Element; - type?: string; - target?: Element; - event?: JQueryEventObject; - } - - interface ContextMenuActivateEvent extends ContextMenuEvent { - item?: Element; - type?: string; - target?: Element; - } - - interface ContextMenuDeactivateEvent extends ContextMenuEvent { - item?: Element; - type?: string; - target?: Element; - } - - interface ContextMenuSelectEvent extends ContextMenuEvent { - item?: Element; - type?: string; - target?: Element; - } - - - class DatePicker extends kendo.ui.Widget { - - static fn: DatePicker; - - options: DatePickerOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): DatePicker; - - constructor(element: Element, options?: DatePickerOptions); - - - close(): void; - destroy(): void; - enable(enable: boolean): void; - readonly(readonly: boolean): void; - max(): Date; - max(value: Date): void; - max(value: string): void; - min(): Date; - min(value: Date): void; - min(value: string): void; - open(): void; - setOptions(options: any): void; - value(): Date; - value(value: Date): void; - value(value: string): void; - - } - - interface DatePickerAnimationClose { - effects?: string; - duration?: number; - } - - interface DatePickerAnimationOpen { - effects?: string; - duration?: number; - } - - interface DatePickerAnimation { - close?: DatePickerAnimationClose; - open?: DatePickerAnimationOpen; - } - - interface DatePickerMonth { - content?: string; - empty?: string; - } - - interface DatePickerOptions { - name?: string; - animation?: boolean|DatePickerAnimation; - ARIATemplate?: string; - culture?: string; - dates?: any; - depth?: string; - disableDates?: any|Function; - footer?: string|Function; - format?: string; - max?: Date; - min?: Date; - month?: DatePickerMonth; - parseFormats?: any; - start?: string; - value?: Date; - change?(e: DatePickerChangeEvent): void; - close?(e: DatePickerCloseEvent): void; - open?(e: DatePickerOpenEvent): void; - } - interface DatePickerEvent { - sender: DatePicker; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface DatePickerChangeEvent extends DatePickerEvent { - } - - interface DatePickerCloseEvent extends DatePickerEvent { - } - - interface DatePickerOpenEvent extends DatePickerEvent { - } - - - class DateTimePicker extends kendo.ui.Widget { - - static fn: DateTimePicker; - - options: DateTimePickerOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): DateTimePicker; - - constructor(element: Element, options?: DateTimePickerOptions); - - - close(view: string): void; - destroy(): void; - enable(enable: boolean): void; - readonly(readonly: boolean): void; - max(): Date; - max(value: Date): void; - max(value: string): void; - min(): Date; - min(value: Date): void; - min(value: string): void; - open(view: string): void; - setOptions(options: any): void; - toggle(view: string): void; - value(): Date; - value(value: Date): void; - value(value: string): void; - - } - - interface DateTimePickerAnimationClose { - effects?: string; - duration?: number; - } - - interface DateTimePickerAnimationOpen { - effects?: string; - duration?: number; - } - - interface DateTimePickerAnimation { - close?: DateTimePickerAnimationClose; - open?: DateTimePickerAnimationOpen; - } - - interface DateTimePickerMonth { - content?: string; - empty?: string; - } - - interface DateTimePickerOptions { - name?: string; - animation?: boolean|DateTimePickerAnimation; - ARIATemplate?: string; - culture?: string; - dates?: any; - depth?: string; - disableDates?: any|Function; - footer?: string; - format?: string; - interval?: number; - max?: Date; - min?: Date; - month?: DateTimePickerMonth; - parseFormats?: any; - start?: string; - timeFormat?: string; - value?: Date; - change?(e: DateTimePickerChangeEvent): void; - close?(e: DateTimePickerCloseEvent): void; - open?(e: DateTimePickerOpenEvent): void; - } - interface DateTimePickerEvent { - sender: DateTimePicker; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface DateTimePickerChangeEvent extends DateTimePickerEvent { - } - - interface DateTimePickerCloseEvent extends DateTimePickerEvent { - view?: string; - } - - interface DateTimePickerOpenEvent extends DateTimePickerEvent { - view?: string; - } - - - class DropDownList extends kendo.ui.Widget { - - static fn: DropDownList; - - options: DropDownListOptions; - popup: kendo.ui.Popup; - - dataSource: kendo.data.DataSource; - span: JQuery; - filterInput: JQuery; - list: JQuery; - ul: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): DropDownList; - - constructor(element: Element, options?: DropDownListOptions); - - - close(): void; - dataItem(index?: JQuery): any; - dataItem(index?: number): any; - destroy(): void; - focus(): void; - items(): any; - enable(enable: boolean): void; - open(): void; - readonly(readonly: boolean): void; - refresh(): void; - search(word: string): void; - select(): number; - select(li: JQuery): void; - select(li: number): void; - select(li: Function): void; - setDataSource(dataSource: kendo.data.DataSource): void; - text(): string; - text(text: string): void; - toggle(toggle: boolean): void; - value(): string; - value(value: string): void; - - } - - interface DropDownListAnimationClose { - effects?: string; - duration?: number; - } - - interface DropDownListAnimationOpen { - effects?: string; - duration?: number; - } - - interface DropDownListAnimation { - close?: DropDownListAnimationClose; - open?: DropDownListAnimationOpen; - } - - interface DropDownListPopup { - appendTo?: string; - origin?: string; - position?: string; - } - - interface DropDownListVirtual { - itemHeight?: number; - valueMapper?: Function; - } - - interface DropDownListOptions { - name?: string; - animation?: boolean|DropDownListAnimation; - autoBind?: boolean; - cascadeFrom?: string; - cascadeFromField?: string; - dataSource?: any|any|kendo.data.DataSource; - dataTextField?: string; - dataValueField?: string; - delay?: number; - enable?: boolean; - filter?: string; - fixedGroupTemplate?: string|Function; - groupTemplate?: string|Function; - height?: number; - ignoreCase?: boolean; - index?: number; - minLength?: number; - popup?: DropDownListPopup; - optionLabel?: string|any; - optionLabelTemplate?: string|Function; - headerTemplate?: string|Function; - template?: string|Function; - valueTemplate?: string|Function; - text?: string; - value?: string; - valuePrimitive?: boolean; - virtual?: boolean|DropDownListVirtual; - change?(e: DropDownListChangeEvent): void; - close?(e: DropDownListCloseEvent): void; - dataBound?(e: DropDownListDataBoundEvent): void; - filtering?(e: DropDownListFilteringEvent): void; - open?(e: DropDownListOpenEvent): void; - select?(e: DropDownListSelectEvent): void; - cascade?(e: DropDownListCascadeEvent): void; - } - interface DropDownListEvent { - sender: DropDownList; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface DropDownListChangeEvent extends DropDownListEvent { - } - - interface DropDownListCloseEvent extends DropDownListEvent { - } - - interface DropDownListDataBoundEvent extends DropDownListEvent { - } - - interface DropDownListFilteringEvent extends DropDownListEvent { - filter?: any; - } - - interface DropDownListOpenEvent extends DropDownListEvent { - } - - interface DropDownListSelectEvent extends DropDownListEvent { - item?: JQuery; - } - - interface DropDownListCascadeEvent extends DropDownListEvent { - } - - - class Editor extends kendo.ui.Widget { - - static fn: Editor; - - options: EditorOptions; - - body: Element; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Editor; - - constructor(element: Element, options?: EditorOptions); - - - createRange(document?: Document): Range; - destroy(): void; - encodedValue(): void; - exec(name: string, params: any): void; - focus(): void; - getRange(): Range; - getSelection(): Selection; - paste(html: string, options: any): void; - selectedHtml(): string; - refresh(): void; - saveAsPDF(): JQueryPromise; - selectRange(range: Range): void; - update(): void; - state(toolName: string): boolean; - value(): string; - value(value: string): void; - - } - - interface EditorDeserialization { - custom?: Function; - } - - interface EditorFileBrowserMessages { - uploadFile?: string; - orderBy?: string; - orderByName?: string; - orderBySize?: string; - directoryNotFound?: string; - emptyFolder?: string; - deleteFile?: string; - invalidFileType?: string; - overwriteFile?: string; - search?: string; - } - - interface EditorFileBrowserSchemaModelFieldsName { - field?: string; - parse?: Function; - } - - interface EditorFileBrowserSchemaModelFieldsSize { - field?: string; - parse?: Function; - } - - interface EditorFileBrowserSchemaModelFieldsType { - parse?: Function; - field?: string; - } - - interface EditorFileBrowserSchemaModelFields { - name?: EditorFileBrowserSchemaModelFieldsName; - type?: EditorFileBrowserSchemaModelFieldsType; - size?: EditorFileBrowserSchemaModelFieldsSize; - } - - interface EditorFileBrowserSchemaModel { - id?: string; - fields?: EditorFileBrowserSchemaModelFields; - } - - interface EditorFileBrowserSchema { - } - - interface EditorFileBrowserTransportCreate { - contentType?: string; - data?: any|string|Function; - dataType?: string; - type?: string; - url?: string|Function; - } - - interface EditorFileBrowserTransportDestroy { - contentType?: string; - data?: any|string|Function; - dataType?: string; - type?: string; - url?: string|Function; - } - - interface EditorFileBrowserTransportRead { - contentType?: string; - data?: any|string|Function; - dataType?: string; - type?: string; - url?: string|Function; - } - - interface EditorFileBrowserTransport { - read?: EditorFileBrowserTransportRead; - uploadUrl?: string; - fileUrl?: string|Function; - destroy?: EditorFileBrowserTransportDestroy; - create?: EditorFileBrowserTransportCreate; - } - - interface EditorFileBrowser { - fileTypes?: string; - path?: string; - transport?: EditorFileBrowserTransport; - schema?: EditorFileBrowserSchema; - messages?: EditorFileBrowserMessages; - } - - interface EditorImageBrowserMessages { - uploadFile?: string; - orderBy?: string; - orderByName?: string; - orderBySize?: string; - directoryNotFound?: string; - emptyFolder?: string; - deleteFile?: string; - invalidFileType?: string; - overwriteFile?: string; - search?: string; - } - - interface EditorImageBrowserSchemaModelFieldsName { - field?: string; - parse?: Function; - } - - interface EditorImageBrowserSchemaModelFieldsSize { - field?: string; - parse?: Function; - } - - interface EditorImageBrowserSchemaModelFieldsType { - parse?: Function; - field?: string; - } - - interface EditorImageBrowserSchemaModelFields { - name?: EditorImageBrowserSchemaModelFieldsName; - type?: EditorImageBrowserSchemaModelFieldsType; - size?: EditorImageBrowserSchemaModelFieldsSize; - } - - interface EditorImageBrowserSchemaModel { - id?: string; - fields?: EditorImageBrowserSchemaModelFields; - } - - interface EditorImageBrowserSchema { - } - - interface EditorImageBrowserTransportCreate { - contentType?: string; - data?: any|string|Function; - dataType?: string; - type?: string; - url?: string|Function; - } - - interface EditorImageBrowserTransportDestroy { - contentType?: string; - data?: any|string|Function; - dataType?: string; - type?: string; - url?: string|Function; - } - - interface EditorImageBrowserTransportRead { - contentType?: string; - data?: any|string|Function; - dataType?: string; - type?: string; - url?: string|Function; - } - - interface EditorImageBrowserTransport { - read?: EditorImageBrowserTransportRead; - thumbnailUrl?: string|Function; - uploadUrl?: string; - imageUrl?: string|Function; - destroy?: EditorImageBrowserTransportDestroy; - create?: EditorImageBrowserTransportCreate; - } - - interface EditorImageBrowser { - fileTypes?: string; - path?: string; - transport?: EditorImageBrowserTransport; - schema?: EditorImageBrowserSchema; - messages?: EditorImageBrowserMessages; - } - - interface EditorMessages { - bold?: string; - italic?: string; - underline?: string; - strikethrough?: string; - superscript?: string; - subscript?: string; - justifyCenter?: string; - justifyLeft?: string; - justifyRight?: string; - justifyFull?: string; - insertUnorderedList?: string; - insertOrderedList?: string; - indent?: string; - outdent?: string; - createLink?: string; - unlink?: string; - insertImage?: string; - insertFile?: string; - insertHtml?: string; - viewHtml?: string; - fontName?: string; - fontNameInherit?: string; - fontSize?: string; - fontSizeInherit?: string; - formatBlock?: string; - formatting?: string; - foreColor?: string; - backColor?: string; - style?: string; - emptyFolder?: string; - uploadFile?: string; - editAreaTitle?: string; - orderBy?: string; - orderBySize?: string; - orderByName?: string; - invalidFileType?: string; - deleteFile?: string; - overwriteFile?: string; - directoryNotFound?: string; - imageWebAddress?: string; - imageAltText?: string; - imageWidth?: string; - imageHeight?: string; - fileWebAddress?: string; - fileTitle?: string; - linkWebAddress?: string; - linkText?: string; - linkToolTip?: string; - linkOpenInNewWindow?: string; - dialogUpdate?: string; - dialogInsert?: string; - dialogCancel?: string; - createTable?: string; - createTableHint?: string; - addColumnLeft?: string; - addColumnRight?: string; - addRowAbove?: string; - addRowBelow?: string; - deleteRow?: string; - deleteColumn?: string; - } - - interface EditorPasteCleanup { - all?: boolean; - css?: boolean; - custom?: Function; - keepNewLines?: boolean; - msAllFormatting?: boolean; - msConvertLists?: boolean; - msTags?: boolean; - none?: boolean; - span?: boolean; - } - - interface EditorPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface EditorPdf { - author?: string; - avoidLinks?: boolean|string; - creator?: string; - date?: Date; - fileName?: string; - forceProxy?: boolean; - keywords?: string; - landscape?: boolean; - margin?: EditorPdfMargin; - paperSize?: string|any; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - } - - interface EditorResizable { - content?: boolean; - min?: number; - max?: number; - toolbar?: boolean; - } - - interface EditorSerialization { - custom?: Function; - entities?: boolean; - scripts?: boolean; - semantic?: boolean; - } - - interface EditorToolItem { - text?: string; - value?: string; - context?: string; - } - - interface EditorTool { - name?: string; - tooltip?: string; - exec?: Function; - items?: EditorToolItem[]; - template?: string; - } - - interface EditorExecParams { - value?: any; - } - - interface EditorPasteOptions { - split?: boolean; - } - - interface EditorOptions { - name?: string; - deserialization?: EditorDeserialization; - domain?: string; - encoded?: boolean; - messages?: EditorMessages; - pasteCleanup?: EditorPasteCleanup; - pdf?: EditorPdf; - resizable?: boolean|EditorResizable; - serialization?: EditorSerialization; - stylesheets?: any; - tools?: EditorTool[]; - imageBrowser?: EditorImageBrowser; - fileBrowser?: EditorFileBrowser; - change?(e: EditorEvent): void; - execute?(e: EditorExecuteEvent): void; - keydown?(e: EditorEvent): void; - keyup?(e: EditorEvent): void; - paste?(e: EditorPasteEvent): void; - pdfExport?(e: EditorPdfExportEvent): void; - select?(e: EditorEvent): void; - } - interface EditorEvent { - sender: Editor; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface EditorExecuteEvent extends EditorEvent { - name?: string; - command?: any; - } - - interface EditorPasteEvent extends EditorEvent { - html?: any; - } - - interface EditorPdfExportEvent extends EditorEvent { - promise?: JQueryPromise; - } - - - class FilterMenu extends kendo.ui.Widget { - - static fn: FilterMenu; - - options: FilterMenuOptions; - - field: string; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): FilterMenu; - - constructor(element: Element, options?: FilterMenuOptions); - - - clear(): void; - - } - - interface FilterMenuMessages { - and?: string; - clear?: string; - filter?: string; - info?: string; - isFalse?: string; - isTrue?: string; - or?: string; - selectValue?: string; - } - - interface FilterMenuOperatorsDate { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - gte?: string; - gt?: string; - lte?: string; - lt?: string; - } - - interface FilterMenuOperatorsEnums { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - } - - interface FilterMenuOperatorsNumber { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - gte?: string; - gt?: string; - lte?: string; - lt?: string; - } - - interface FilterMenuOperatorsString { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - isempty?: string; - isnotempty?: string; - startswith?: string; - contains?: string; - doesnotcontain?: string; - endswith?: string; - } - - interface FilterMenuOperators { - string?: FilterMenuOperatorsString; - number?: FilterMenuOperatorsNumber; - date?: FilterMenuOperatorsDate; - enums?: FilterMenuOperatorsEnums; - } - - interface FilterMenuOptions { - name?: string; - dataSource?: any|any|kendo.data.DataSource; - extra?: boolean; - field?: string; - messages?: FilterMenuMessages; - operators?: FilterMenuOperators; - } - interface FilterMenuEvent { - sender: FilterMenu; + interface MatrixEvent { + sender: Matrix; preventDefault: Function; isDefaultPrevented(): boolean; } - class FlatColorPicker extends kendo.ui.Widget { - - static fn: FlatColorPicker; - - options: FlatColorPickerOptions; + class Point extends Observable { - element: JQuery; - wrapper: JQuery; + options: PointOptions; - static extend(proto: Object): FlatColorPicker; + x: number; + y: number; - constructor(element: Element, options?: FlatColorPickerOptions); + constructor(x: number, y: number); + static create(x: number, y: number): kendo.geometry.Point; + static create(x: any, y: number): kendo.geometry.Point; + static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; + static min(): kendo.geometry.Point; + static max(): kendo.geometry.Point; + static minPoint(): kendo.geometry.Point; + static maxPoint(): kendo.geometry.Point; - focus(): void; - value(): string; - value(color?: string): void; - color(): kendo.Color; - color(color?: kendo.Color): void; - enable(enable?: boolean): void; + clone(): kendo.geometry.Point; + distanceTo(point: kendo.geometry.Point): number; + equals(other: kendo.geometry.Point): boolean; + getX(): number; + getY(): number; + move(x: number, y: number): kendo.geometry.Point; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; + rotate(angle: number, center: any): kendo.geometry.Point; + round(digits: number): kendo.geometry.Point; + scale(scaleX: number, scaleY: number): kendo.geometry.Point; + scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; + setX(value: number): kendo.geometry.Point; + setY(value: number): kendo.geometry.Point; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + translate(dx: number, dy: number): kendo.geometry.Point; + translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; + translateWith(vector: any): kendo.geometry.Point; } - interface FlatColorPickerMessages { - apply?: string; - cancel?: string; - } - - interface FlatColorPickerOptions { + interface PointOptions { name?: string; - opacity?: boolean; - buttons?: boolean; - value?: string; - preview?: boolean; - autoupdate?: boolean; - messages?: FlatColorPickerMessages; - change?(e: FlatColorPickerChangeEvent): void; } - interface FlatColorPickerEvent { - sender: FlatColorPicker; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface FlatColorPickerChangeEvent extends FlatColorPickerEvent { - value?: string; - } - - - class Gantt extends kendo.ui.Widget { - - static fn: Gantt; - - options: GanttOptions; - - dataSource: kendo.data.DataSource; - dependencies: kendo.data.GanttDependencyDataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Gantt; - - constructor(element: Element, options?: GanttOptions); - - - clearSelection(): void; - dataItem(row: string): kendo.data.GanttTask; - dataItem(row: Element): kendo.data.GanttTask; - dataItem(row: JQuery): kendo.data.GanttTask; - destroy(): void; - refresh(): void; - refreshDependencies(): void; - removeDependency(dependency: string): void; - removeDependency(dependency: kendo.data.GanttDependency): void; - removeTask(task: string): void; - removeTask(task: kendo.data.GanttTask): void; - saveAsPDF(): JQueryPromise; - select(): JQuery; - select(row: string): void; - select(row: Element): void; - select(row: JQuery): void; - setDataSource(dataSource: kendo.data.GanttDataSource): void; - setDependenciesDataSource(dataSource: kendo.data.GanttDependencyDataSource): void; - view(): kendo.ui.GanttView; - view(type?: string): void; - - } - - interface GanttAssignments { - dataSource?: any|any|kendo.data.DataSource; - dataResourceIdField?: string; - dataTaskIdField?: string; - dataValueField?: string; - } - - interface GanttColumn { - field?: string; - title?: string; - format?: string; - width?: string|number; - editable?: boolean; - sortable?: boolean; - } - - interface GanttCurrentTimeMarker { - updateInterval?: number; - } - - interface GanttEditable { - confirmation?: boolean; - template?: string|Function; - } - - interface GanttMessagesActions { - addChild?: string; - append?: string; - insertAfter?: string; - insertBefore?: string; - pdf?: string; - } - - interface GanttMessagesEditor { - assignButton?: string; - editorTitle?: string; - end?: string; - percentComplete?: string; - resources?: string; - resourcesEditorTitle?: string; - resourcesHeader?: string; - start?: string; - title?: string; - unitsHeader?: string; - } - - interface GanttMessagesViews { - day?: string; - end?: string; - month?: string; - start?: string; - week?: string; - year?: string; - } - - interface GanttMessages { - actions?: GanttMessagesActions; - cancel?: string; - deleteDependencyConfirmation?: string; - deleteDependencyWindowTitle?: string; - deleteTaskConfirmation?: string; - deleteTaskWindowTitle?: string; - destroy?: string; - editor?: GanttMessagesEditor; - save?: string; - views?: GanttMessagesViews; - } - - interface GanttPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface GanttPdf { - author?: string; - avoidLinks?: boolean|string; - creator?: string; - date?: Date; - fileName?: string; - forceProxy?: boolean; - keywords?: string; - landscape?: boolean; - margin?: GanttPdfMargin; - paperSize?: string|any; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - } - - interface GanttResources { - dataFormatField?: string; - dataColorField?: string; - dataSource?: any|any|kendo.data.DataSource; - dataTextField?: string; - field?: string; - } - - interface GanttToolbarItem { - name?: string; - template?: string|Function; - text?: string; - } - - interface GanttTooltip { - template?: string|Function; - visible?: boolean; - } - - interface GanttView { - type?: string; - selected?: boolean; - slotSize?: number|string; - timeHeaderTemplate?: string|Function; - dayHeaderTemplate?: string|Function; - weekHeaderTemplate?: string|Function; - monthHeaderTemplate?: string|Function; - yearHeaderTemplate?: string|Function; - resizeTooltipFormat?: string; - } - - interface GanttOptions { - name?: string; - assignments?: GanttAssignments; - autoBind?: boolean; - columnResizeHandleWidth?: number; - columns?: GanttColumn[]; - currentTimeMarker?: boolean|GanttCurrentTimeMarker; - dataSource?: any|any|kendo.data.GanttDataSource; - dependencies?: any|any|kendo.data.GanttDependencyDataSource; - editable?: boolean|GanttEditable; - navigatable?: boolean; - workDayStart?: Date; - workDayEnd?: Date; - workWeekStart?: number; - workWeekEnd?: number; - hourSpan?: number; - snap?: boolean; - height?: number|string; - listWidth?: string|number; - messages?: GanttMessages; - pdf?: GanttPdf; - resizable?: boolean; - selectable?: boolean; - showWorkDays?: boolean; - showWorkHours?: boolean; - taskTemplate?: string|Function; - toolbar?: GanttToolbarItem[]; - tooltip?: GanttTooltip; - views?: GanttView[]; - resources?: GanttResources; - rowHeight?: number|string; - dataBinding?(e: GanttDataBindingEvent): void; - dataBound?(e: GanttDataBoundEvent): void; - add?(e: GanttAddEvent): void; - edit?(e: GanttEditEvent): void; - remove?(e: GanttRemoveEvent): void; - cancel?(e: GanttCancelEvent): void; - save?(e: GanttSaveEvent): void; - change?(e: GanttChangeEvent): void; - columnResize?(e: GanttColumnResizeEvent): void; - navigate?(e: GanttNavigateEvent): void; - moveStart?(e: GanttMoveStartEvent): void; - move?(e: GanttMoveEvent): void; - moveEnd?(e: GanttMoveEndEvent): void; - pdfExport?(e: GanttPdfExportEvent): void; - resizeStart?(e: GanttResizeStartEvent): void; - resize?(e: GanttResizeEvent): void; - resizeEnd?(e: GanttResizeEndEvent): void; - } - interface GanttEvent { - sender: Gantt; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface GanttDataBindingEvent extends GanttEvent { - } - - interface GanttDataBoundEvent extends GanttEvent { - } - - interface GanttAddEvent extends GanttEvent { - task?: kendo.data.GanttTask; - dependency?: kendo.data.GanttDependency; - } - - interface GanttEditEvent extends GanttEvent { - container?: JQuery; - task?: kendo.data.GanttTask; - } - - interface GanttRemoveEvent extends GanttEvent { - task?: kendo.data.GanttTask; - dependencies?: any; - } - - interface GanttCancelEvent extends GanttEvent { - container?: JQuery; - task?: kendo.data.GanttTask; - } - - interface GanttSaveEvent extends GanttEvent { - task?: kendo.data.GanttTask; - values?: any; - } - - interface GanttChangeEvent extends GanttEvent { - } - - interface GanttColumnResizeEvent extends GanttEvent { - column?: any; - newWidth?: number; - oldWidth?: number; - } - - interface GanttNavigateEvent extends GanttEvent { - view?: string; - } - - interface GanttMoveStartEvent extends GanttEvent { - task?: kendo.data.GanttTask; - } - - interface GanttMoveEvent extends GanttEvent { - task?: kendo.data.GanttTask; - start?: Date; - end?: Date; - } - - interface GanttMoveEndEvent extends GanttEvent { - task?: kendo.data.GanttTask; - start?: Date; - end?: Date; - } - - interface GanttPdfExportEvent extends GanttEvent { - promise?: JQueryPromise; - } - - interface GanttResizeStartEvent extends GanttEvent { - task?: kendo.data.GanttTask; - } - - interface GanttResizeEvent extends GanttEvent { - task?: kendo.data.GanttTask; - start?: Date; - end?: Date; - } - - interface GanttResizeEndEvent extends GanttEvent { - task?: kendo.data.GanttTask; - start?: Date; - end?: Date; - } - - - class Grid extends kendo.ui.Widget { - - static fn: Grid; - - options: GridOptions; - - dataSource: kendo.data.DataSource; - columns: GridColumn[]; - footer: JQuery; - pager: kendo.ui.Pager; - table: JQuery; - tbody: JQuery; - thead: JQuery; - content: JQuery; - lockedHeader: JQuery; - lockedTable: JQuery; - lockedContent: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Grid; - - constructor(element: Element, options?: GridOptions); - - - addRow(): void; - autoFitColumn(column: number): void; - autoFitColumn(column: string): void; - autoFitColumn(column: any): void; - cancelChanges(): void; - cancelRow(): void; - cellIndex(cell: string): number; - cellIndex(cell: Element): number; - cellIndex(cell: JQuery): number; - clearSelection(): void; - closeCell(isCancel?: boolean): void; - collapseGroup(row: string): void; - collapseGroup(row: Element): void; - collapseGroup(row: JQuery): void; - collapseRow(row: string): void; - collapseRow(row: Element): void; - collapseRow(row: JQuery): void; - current(): JQuery; - current(cell: JQuery): void; - dataItem(row: string): kendo.data.ObservableObject; - dataItem(row: Element): kendo.data.ObservableObject; - dataItem(row: JQuery): kendo.data.ObservableObject; - destroy(): void; - editCell(cell: JQuery): void; - editRow(row: JQuery): void; - expandGroup(row: string): void; - expandGroup(row: Element): void; - expandGroup(row: JQuery): void; - expandRow(row: string): void; - expandRow(row: Element): void; - expandRow(row: JQuery): void; - getOptions(): GridOptions; - hideColumn(column: number): void; - hideColumn(column: string): void; - hideColumn(column: any): void; - items(): any; - lockColumn(column: number): void; - lockColumn(column: string): void; - refresh(): void; - removeRow(row: string): void; - removeRow(row: Element): void; - removeRow(row: JQuery): void; - reorderColumn(destIndex: number, column: any): void; - saveAsExcel(): void; - saveAsPDF(): JQueryPromise; - saveChanges(): void; - saveRow(): void; - select(): JQuery; - select(rows: string): void; - select(rows: Element): void; - select(rows: JQuery): void; - setDataSource(dataSource: kendo.data.DataSource): void; - setOptions(options: any): void; - showColumn(column: number): void; - showColumn(column: string): void; - showColumn(column: any): void; - unlockColumn(column: number): void; - unlockColumn(column: string): void; - - } - - interface GridAllowCopy { - delimeter?: string|any; - } - - interface GridColumnMenuMessages { - columns?: string; - filter?: string; - sortAscending?: string; - sortDescending?: string; - settings?: string; - done?: string; - lock?: string; - unlock?: string; - } - - interface GridColumnMenu { - columns?: boolean; - filterable?: boolean; - sortable?: boolean; - messages?: GridColumnMenuMessages; - } - - interface GridColumnCommandItemText { - edit?: string; - cancel?: string; - update?: string; - } - - interface GridColumnCommandItem { - name?: string; - text?: GridColumnCommandItemText; - className?: string; - template?: string; - imageClass?: string; - click?: Function; - } - - interface GridColumnFilterableCell { - dataSource?: any|kendo.data.DataSource; - dataTextField?: string; - delay?: number; - inputWidth?: number; - suggestionOperator?: string; - minLength?: number; - enabled?: boolean; - operator?: string; - showOperators?: boolean; - template?: Function; - } - - interface GridColumnFilterable { - cell?: GridColumnFilterableCell; - multi?: boolean; - dataSource?: any|any|kendo.data.DataSource; - checkAll?: boolean; - itemTemplate?: Function; - operators?: any; - search?: boolean; - ignoreCase?: boolean; - ui?: string|Function; - } - - interface GridColumnSortable { - compare?: Function; - } - - interface GridColumn { - aggregates?: any; - attributes?: any; - columns?: any; - command?: GridColumnCommandItem[]; - encoded?: boolean; - field?: string; - filterable?: boolean|GridColumnFilterable; - footerAttributes?: any; - footerTemplate?: string|Function; - format?: string; - groupable?: boolean; - groupHeaderTemplate?: string|Function; - groupFooterTemplate?: string|Function; - headerAttributes?: any; - headerTemplate?: string|Function; - hidden?: boolean; - locked?: boolean; - lockable?: boolean; - minScreenWidth?: number; - sortable?: boolean|GridColumnSortable; - template?: string|Function; - title?: string; - width?: string|number; - values?: any; - menu?: boolean; - type?: any; - } - - interface GridEditable { - confirmation?: boolean|string|Function; - cancelDelete?: string; - confirmDelete?: string; - createAt?: string; - destroy?: boolean; - mode?: string; - template?: string|Function; - update?: boolean; - window?: any; - } - - interface GridExcel { - allPages?: boolean; - fileName?: string; - filterable?: boolean; - forceProxy?: boolean; - proxyURL?: string; - } - - interface GridFilterableMessages { - and?: string; - clear?: string; - filter?: string; - info?: string; - isFalse?: string; - isTrue?: string; - or?: string; - search?: string; - selectValue?: string; - cancel?: string; - selectedItemsFormat?: string; - operator?: string; - value?: string; - checkAll?: string; - } - - interface GridFilterableOperatorsDate { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - gte?: string; - gt?: string; - lte?: string; - lt?: string; - } - - interface GridFilterableOperatorsEnums { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - } - - interface GridFilterableOperatorsNumber { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - gte?: string; - gt?: string; - lte?: string; - lt?: string; - } - - interface GridFilterableOperatorsString { - eq?: string; - neq?: string; - isnull?: string; - isnotnull?: string; - isempty?: string; - isnotempty?: string; - startswith?: string; - contains?: string; - doesnotcontain?: string; - endswith?: string; - } - - interface GridFilterableOperators { - string?: GridFilterableOperatorsString; - number?: GridFilterableOperatorsNumber; - date?: GridFilterableOperatorsDate; - enums?: GridFilterableOperatorsEnums; - } - - interface GridFilterable { - extra?: boolean; - messages?: GridFilterableMessages; - operators?: GridFilterableOperators; - mode?: string; - } - - interface GridGroupableMessages { - empty?: string; - } - - interface GridGroupable { - enabled?: boolean; - showFooter?: boolean; - messages?: GridGroupableMessages; - } - - interface GridMessagesCommands { - cancel?: string; - canceledit?: string; - create?: string; - destroy?: string; - edit?: string; - excel?: string; - save?: string; - update?: string; - } - - interface GridMessages { - commands?: GridMessagesCommands; - noRecords?: string; - } - - interface GridNoRecords { - template?: string|Function; - } - - interface GridPageableMessages { - display?: string; - empty?: string; - page?: string; - of?: string; - itemsPerPage?: string; - first?: string; - last?: string; - next?: string; - previous?: string; - refresh?: string; - morePages?: string; - } - - interface GridPageable { - pageSize?: number; - previousNext?: boolean; - numeric?: boolean; - buttonCount?: number; - input?: boolean; - pageSizes?: boolean|any; - refresh?: boolean; - info?: boolean; - messages?: GridPageableMessages; - } - - interface GridPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface GridPdf { - allPages?: boolean; - author?: string; - avoidLinks?: boolean|string; - creator?: string; - date?: Date; - fileName?: string; - forceProxy?: boolean; - keywords?: string; - landscape?: boolean; - margin?: GridPdfMargin; - paperSize?: string|any; - template?: string; - repeatHeaders?: boolean; - scale?: number; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - } - - interface GridScrollable { - virtual?: boolean; - } - - interface GridSortable { - allowUnsort?: boolean; - mode?: string; - } - - interface GridToolbarItem { - name?: string; - template?: string|Function; - text?: string; - } - - interface GridOptions { - name?: string; - allowCopy?: boolean|GridAllowCopy; - altRowTemplate?: string|Function; - autoBind?: boolean; - columnResizeHandleWidth?: number; - columns?: GridColumn[]; - columnMenu?: boolean|GridColumnMenu; - dataSource?: any|any|kendo.data.DataSource; - detailTemplate?: string|Function; - editable?: boolean|GridEditable; - excel?: GridExcel; - filterable?: boolean|GridFilterable; - groupable?: boolean|GridGroupable; - height?: number|string; - messages?: GridMessages; - mobile?: boolean|string; - navigatable?: boolean; - noRecords?: boolean|GridNoRecords; - pageable?: boolean|GridPageable; - pdf?: GridPdf; - reorderable?: boolean; - resizable?: boolean; - rowTemplate?: string|Function; - scrollable?: boolean|GridScrollable; - selectable?: boolean|string; - sortable?: boolean|GridSortable; - toolbar?: string | ((...args:any[]) => string) | GridToolbarItem[]; - cancel?(e: GridCancelEvent): void; - change?(e: GridChangeEvent): void; - columnHide?(e: GridColumnHideEvent): void; - columnMenuInit?(e: GridColumnMenuInitEvent): void; - columnReorder?(e: GridColumnReorderEvent): void; - columnResize?(e: GridColumnResizeEvent): void; - columnShow?(e: GridColumnShowEvent): void; - dataBinding?(e: GridDataBindingEvent): void; - dataBound?(e: GridDataBoundEvent): void; - detailCollapse?(e: GridDetailCollapseEvent): void; - detailExpand?(e: GridDetailExpandEvent): void; - detailInit?(e: GridDetailInitEvent): void; - edit?(e: GridEditEvent): void; - excelExport?(e: GridExcelExportEvent): void; - pdfExport?(e: GridPdfExportEvent): void; - filterMenuInit?(e: GridFilterMenuInitEvent): void; - remove?(e: GridRemoveEvent): void; - save?(e: GridSaveEvent): void; - saveChanges?(e: GridSaveChangesEvent): void; - columnLock?(e: GridColumnLockEvent): void; - columnUnlock?(e: GridColumnUnlockEvent): void; - navigate?(e: GridNavigateEvent): void; - } - interface GridEvent { - sender: Grid; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface GridCancelEvent extends GridEvent { - container?: JQuery; - model?: kendo.data.Model; - } - - interface GridChangeEvent extends GridEvent { - } - - interface GridColumnHideEvent extends GridEvent { - column?: any; - } - - interface GridColumnMenuInitEvent extends GridEvent { - container?: JQuery; - field?: string; - } - - interface GridColumnReorderEvent extends GridEvent { - column?: any; - newIndex?: number; - oldIndex?: number; - } - - interface GridColumnResizeEvent extends GridEvent { - column?: any; - newWidth?: number; - oldWidth?: number; - } - - interface GridColumnShowEvent extends GridEvent { - column?: any; - } - - interface GridDataBindingEvent extends GridEvent { - action?: string; - index?: number; - items?: any; - } - - interface GridDataBoundEvent extends GridEvent { - } - - interface GridDetailCollapseEvent extends GridEvent { - detailRow?: JQuery; - masterRow?: JQuery; - } - - interface GridDetailExpandEvent extends GridEvent { - detailRow?: JQuery; - masterRow?: JQuery; - } - - interface GridDetailInitEvent extends GridEvent { - data?: kendo.data.ObservableObject; - detailCell?: JQuery; - detailRow?: JQuery; - masterRow?: JQuery; - } - - interface GridEditEvent extends GridEvent { - container?: JQuery; - model?: kendo.data.Model; - } - - interface GridExcelExportEvent extends GridEvent { - data?: any; - workbook?: kendo.ooxml.Workbook; - } - - interface GridPdfExportEvent extends GridEvent { - promise?: JQueryPromise; - } - - interface GridFilterMenuInitEvent extends GridEvent { - container?: JQuery; - field?: string; - } - - interface GridRemoveEvent extends GridEvent { - model?: kendo.data.Model; - row?: JQuery; - } - - interface GridSaveEvent extends GridEvent { - model?: kendo.data.Model; - container?: JQuery; - values?: any; - } - - interface GridSaveChangesEvent extends GridEvent { - } - - interface GridColumnLockEvent extends GridEvent { - column?: any; - } - - interface GridColumnUnlockEvent extends GridEvent { - column?: any; - } - - interface GridNavigateEvent extends GridEvent { - element?: JQuery; - } - - - class ListView extends kendo.ui.Widget { - - static fn: ListView; - - options: ListViewOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): ListView; - - constructor(element: Element, options?: ListViewOptions); - - - add(): void; - cancel(): void; - clearSelection(): void; - dataItem(row: string): kendo.data.ObservableObject; - dataItem(row: Element): kendo.data.ObservableObject; - dataItem(row: JQuery): kendo.data.ObservableObject; - dataItems(): void; - destroy(): void; - edit(item: JQuery): void; - items(): any; - refresh(): void; - remove(item: any): void; - save(): void; - select(): JQuery; - select(items: JQuery): void; - select(items: any): void; - setDataSource(dataSource: kendo.data.DataSource): void; - - } - - interface ListViewOptions { - name?: string; - autoBind?: boolean; - dataSource?: any|any|kendo.data.DataSource; - editTemplate?: Function; - navigatable?: boolean; - selectable?: boolean|string; - template?: Function; - altTemplate?: Function; - cancel?(e: ListViewCancelEvent): void; - change?(e: ListViewEvent): void; - dataBound?(e: ListViewEvent): void; - dataBinding?(e: ListViewEvent): void; - edit?(e: ListViewEditEvent): void; - remove?(e: ListViewRemoveEvent): void; - save?(e: ListViewSaveEvent): void; - } - interface ListViewEvent { - sender: ListView; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ListViewCancelEvent extends ListViewEvent { - container?: JQuery; - model?: kendo.data.Model; - } - - interface ListViewEditEvent extends ListViewEvent { - item?: JQuery; - model?: kendo.data.Model; - } - - interface ListViewRemoveEvent extends ListViewEvent { - item?: JQuery; - model?: kendo.data.Model; - } - - interface ListViewSaveEvent extends ListViewEvent { - model?: kendo.data.Model; - item?: JQuery; - } - - - class MaskedTextBox extends kendo.ui.Widget { - - static fn: MaskedTextBox; - - options: MaskedTextBoxOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): MaskedTextBox; - - constructor(element: Element, options?: MaskedTextBoxOptions); - - - destroy(): void; - enable(enable: boolean): void; - readonly(readonly: boolean): void; - raw(): string; - value(): string; - value(value: string): void; - - } - - interface MaskedTextBoxOptions { - name?: string; - clearPromptChar?: boolean; - culture?: string; - mask?: string; - promptChar?: string; - rules?: any; - unmaskOnPost?: boolean; - value?: string; - change?(e: MaskedTextBoxChangeEvent): void; - } - interface MaskedTextBoxEvent { - sender: MaskedTextBox; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface MaskedTextBoxChangeEvent extends MaskedTextBoxEvent { - } - - - class Menu extends kendo.ui.Widget { - - static fn: Menu; - - options: MenuOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Menu; - - constructor(element: Element, options?: MenuOptions); - - - append(item: any, referenceItem: string): kendo.ui.Menu; - append(item: any, referenceItem: JQuery): kendo.ui.Menu; - close(element: string): kendo.ui.Menu; - close(element: Element): kendo.ui.Menu; - close(element: JQuery): kendo.ui.Menu; - destroy(): void; - enable(element: string, enable: boolean): kendo.ui.Menu; - enable(element: Element, enable: boolean): kendo.ui.Menu; - enable(element: JQuery, enable: boolean): kendo.ui.Menu; - insertAfter(item: any, referenceItem: string): kendo.ui.Menu; - insertAfter(item: any, referenceItem: Element): kendo.ui.Menu; - insertAfter(item: any, referenceItem: JQuery): kendo.ui.Menu; - insertBefore(item: any, referenceItem: string): kendo.ui.Menu; - insertBefore(item: any, referenceItem: Element): kendo.ui.Menu; - insertBefore(item: any, referenceItem: JQuery): kendo.ui.Menu; - open(element: string): kendo.ui.Menu; - open(element: Element): kendo.ui.Menu; - open(element: JQuery): kendo.ui.Menu; - remove(element: string): kendo.ui.Menu; - remove(element: Element): kendo.ui.Menu; - remove(element: JQuery): kendo.ui.Menu; - - } - - interface MenuAnimationClose { - effects?: string; - duration?: number; - } - - interface MenuAnimationOpen { - effects?: string; - duration?: number; - } - - interface MenuAnimation { - close?: MenuAnimationClose; - open?: MenuAnimationOpen; - } - - interface MenuOptions { - name?: string; - animation?: boolean|MenuAnimation; - closeOnClick?: boolean; - dataSource?: any|any; - direction?: string; - hoverDelay?: number; - openOnClick?: boolean; - orientation?: string; - popupCollision?: string; - close?(e: MenuCloseEvent): void; - open?(e: MenuOpenEvent): void; - activate?(e: MenuActivateEvent): void; - deactivate?(e: MenuDeactivateEvent): void; - select?(e: MenuSelectEvent): void; - } - interface MenuEvent { - sender: Menu; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface MenuCloseEvent extends MenuEvent { - item?: HTMLElement; - } - - interface MenuOpenEvent extends MenuEvent { - item?: HTMLElement; - } - - interface MenuActivateEvent extends MenuEvent { - item?: HTMLElement; - } - - interface MenuDeactivateEvent extends MenuEvent { - item?: HTMLElement; - } - - interface MenuSelectEvent extends MenuEvent { - item?: HTMLElement; - } - - - class MultiSelect extends kendo.ui.Widget { - - static fn: MultiSelect; - - options: MultiSelectOptions; - - dataSource: kendo.data.DataSource; - input: JQuery; - list: JQuery; - ul: JQuery; - tagList: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): MultiSelect; - - constructor(element: Element, options?: MultiSelectOptions); - - - close(): void; - dataItems(): any; - destroy(): void; - enable(enable: boolean): void; - focus(): void; - items(): any; - open(): void; - readonly(readonly: boolean): void; - refresh(): void; - search(word: string): void; - setDataSource(dataSource: kendo.data.DataSource): void; - toggle(toggle: boolean): void; - value(): any; - value(value: any): void; - value(value: string): void; - - } - - interface MultiSelectAnimationClose { - effects?: string; - duration?: number; - } - - interface MultiSelectAnimationOpen { - effects?: string; - duration?: number; - } - - interface MultiSelectAnimation { - close?: MultiSelectAnimationClose; - open?: MultiSelectAnimationOpen; - } - - interface MultiSelectPopup { - appendTo?: string; - origin?: string; - position?: string; - } - - interface MultiSelectVirtual { - itemHeight?: number; - valueMapper?: Function; - } - - interface MultiSelectOptions { - name?: string; - animation?: boolean|MultiSelectAnimation; - autoBind?: boolean; - autoClose?: boolean; - dataSource?: any|any|kendo.data.DataSource; - dataTextField?: string; - dataValueField?: string; - delay?: number; - enable?: boolean; - filter?: string; - fixedGroupTemplate?: string|Function; - groupTemplate?: string|Function; - height?: number; - highlightFirst?: boolean; - ignoreCase?: boolean; - minLength?: number; - maxSelectedItems?: number; - placeholder?: string; - popup?: MultiSelectPopup; - headerTemplate?: string|Function; - itemTemplate?: string|Function; - tagTemplate?: string; - tagMode?: string; - value?: any; - valuePrimitive?: boolean; - virtual?: boolean|MultiSelectVirtual; - change?(e: MultiSelectChangeEvent): void; - close?(e: MultiSelectCloseEvent): void; - dataBound?(e: MultiSelectDataBoundEvent): void; - filtering?(e: MultiSelectFilteringEvent): void; - open?(e: MultiSelectOpenEvent): void; - select?(e: MultiSelectSelectEvent): void; - } - interface MultiSelectEvent { - sender: MultiSelect; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface MultiSelectChangeEvent extends MultiSelectEvent { - } - - interface MultiSelectCloseEvent extends MultiSelectEvent { - } - - interface MultiSelectDataBoundEvent extends MultiSelectEvent { - } - - interface MultiSelectFilteringEvent extends MultiSelectEvent { - filter?: any; - } - - interface MultiSelectOpenEvent extends MultiSelectEvent { - } - - interface MultiSelectSelectEvent extends MultiSelectEvent { - item?: JQuery; - } - - - class Notification extends kendo.ui.Widget { - - static fn: Notification; - - options: NotificationOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Notification; - - constructor(element: Element, options?: NotificationOptions); - - - error(data: any): void; - error(data: string): void; - error(data: Function): void; - getNotifications(): JQuery; - hide(): void; - info(data: any): void; - info(data: string): void; - info(data: Function): void; - show(data: any, type: string): void; - show(data: string, type: string): void; - show(data: Function, type: string): void; - showText(data: any, type: string): void; - showText(data: string, type: string): void; - showText(data: Function, type: string): void; - success(data: any): void; - success(data: string): void; - success(data: Function): void; - warning(data: any): void; - warning(data: string): void; - warning(data: Function): void; - - } - - interface NotificationPosition { - bottom?: number; - left?: number; - pinned?: boolean; - right?: number; - top?: number; - } - - interface NotificationTemplate { - type?: string; - template?: string; - } - - interface NotificationOptions { - name?: string; - allowHideAfter?: number; - animation?: any|boolean; - appendTo?: string|JQuery; - autoHideAfter?: number; - button?: boolean; - height?: number|string; - hideOnClick?: boolean; - position?: NotificationPosition; - stacking?: string; - templates?: NotificationTemplate[]; - width?: number|string; - hide?(e: NotificationHideEvent): void; - show?(e: NotificationShowEvent): void; - } - interface NotificationEvent { - sender: Notification; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface NotificationHideEvent extends NotificationEvent { - element?: JQuery; - } - - interface NotificationShowEvent extends NotificationEvent { - element?: JQuery; - } - - - class NumericTextBox extends kendo.ui.Widget { - - static fn: NumericTextBox; - - options: NumericTextBoxOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): NumericTextBox; - - constructor(element: Element, options?: NumericTextBoxOptions); - - - destroy(): void; - enable(enable: boolean): void; - readonly(readonly: boolean): void; - focus(): void; - max(): number; - max(value: number): void; - max(value: string): void; - min(): number; - min(value: number): void; - min(value: string): void; - step(): number; - step(value: number): void; - step(value: string): void; - value(): number; - value(value: number): void; - value(value: string): void; - - } - - interface NumericTextBoxOptions { - name?: string; - culture?: string; - decimals?: number; - downArrowText?: string; - format?: string; - max?: number; - min?: number; - placeholder?: string; - spinners?: boolean; - step?: number; - upArrowText?: string; - value?: number; - change?(e: NumericTextBoxChangeEvent): void; - spin?(e: NumericTextBoxSpinEvent): void; - } - interface NumericTextBoxEvent { - sender: NumericTextBox; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface NumericTextBoxChangeEvent extends NumericTextBoxEvent { - } - - interface NumericTextBoxSpinEvent extends NumericTextBoxEvent { - } - - - class Pager extends kendo.ui.Widget { - - static fn: Pager; - - options: PagerOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Pager; - - constructor(element: Element, options?: PagerOptions); - - - totalPages(): number; - pageSize(): number; - page(): number; - page(page: number): void; - refresh(): void; - destroy(): void; - - } - - interface PagerMessages { - display?: string; - empty?: string; - allPages?: string; - page?: string; - of?: string; - itemsPerPage?: string; - first?: string; - previous?: string; - next?: string; - last?: string; - refresh?: string; - } - - interface PagerOptions { - name?: string; - autoBind?: boolean; - buttonCount?: number; - dataSource?: any|kendo.data.DataSource; - selectTemplate?: string; - linkTemplate?: string; - info?: boolean; - input?: boolean; - numeric?: boolean; - pageSizes?: boolean|any; - previousNext?: boolean; - refresh?: boolean; - messages?: PagerMessages; - change?(e: PagerChangeEvent): void; - } - interface PagerEvent { - sender: Pager; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface PagerChangeEvent extends PagerEvent { - } - - - class PanelBar extends kendo.ui.Widget { - - static fn: PanelBar; - - options: PanelBarOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): PanelBar; - - constructor(element: Element, options?: PanelBarOptions); - - - append(item: string, referenceItem: string): kendo.ui.PanelBar; - append(item: string, referenceItem: Element): kendo.ui.PanelBar; - append(item: string, referenceItem: JQuery): kendo.ui.PanelBar; - append(item: Element, referenceItem: string): kendo.ui.PanelBar; - append(item: Element, referenceItem: Element): kendo.ui.PanelBar; - append(item: Element, referenceItem: JQuery): kendo.ui.PanelBar; - append(item: JQuery, referenceItem: string): kendo.ui.PanelBar; - append(item: JQuery, referenceItem: Element): kendo.ui.PanelBar; - append(item: JQuery, referenceItem: JQuery): kendo.ui.PanelBar; - append(item: any, referenceItem: string): kendo.ui.PanelBar; - append(item: any, referenceItem: Element): kendo.ui.PanelBar; - append(item: any, referenceItem: JQuery): kendo.ui.PanelBar; - clearSelection(): void; - collapse(element: string, useAnimation: boolean): kendo.ui.PanelBar; - collapse(element: Element, useAnimation: boolean): kendo.ui.PanelBar; - collapse(element: JQuery, useAnimation: boolean): kendo.ui.PanelBar; - destroy(): void; - enable(element: string, enable: boolean): void; - enable(element: Element, enable: boolean): void; - enable(element: JQuery, enable: boolean): void; - expand(element: string, useAnimation: boolean): kendo.ui.PanelBar; - expand(element: Element, useAnimation: boolean): kendo.ui.PanelBar; - expand(element: JQuery, useAnimation: boolean): kendo.ui.PanelBar; - insertAfter(item: string, referenceItem: string): void; - insertAfter(item: string, referenceItem: Element): void; - insertAfter(item: string, referenceItem: JQuery): void; - insertAfter(item: Element, referenceItem: string): void; - insertAfter(item: Element, referenceItem: Element): void; - insertAfter(item: Element, referenceItem: JQuery): void; - insertAfter(item: JQuery, referenceItem: string): void; - insertAfter(item: JQuery, referenceItem: Element): void; - insertAfter(item: JQuery, referenceItem: JQuery): void; - insertAfter(item: any, referenceItem: string): void; - insertAfter(item: any, referenceItem: Element): void; - insertAfter(item: any, referenceItem: JQuery): void; - insertBefore(item: string, referenceItem: string): kendo.ui.PanelBar; - insertBefore(item: string, referenceItem: Element): kendo.ui.PanelBar; - insertBefore(item: string, referenceItem: JQuery): kendo.ui.PanelBar; - insertBefore(item: Element, referenceItem: string): kendo.ui.PanelBar; - insertBefore(item: Element, referenceItem: Element): kendo.ui.PanelBar; - insertBefore(item: Element, referenceItem: JQuery): kendo.ui.PanelBar; - insertBefore(item: JQuery, referenceItem: string): kendo.ui.PanelBar; - insertBefore(item: JQuery, referenceItem: Element): kendo.ui.PanelBar; - insertBefore(item: JQuery, referenceItem: JQuery): kendo.ui.PanelBar; - insertBefore(item: any, referenceItem: string): kendo.ui.PanelBar; - insertBefore(item: any, referenceItem: Element): kendo.ui.PanelBar; - insertBefore(item: any, referenceItem: JQuery): kendo.ui.PanelBar; - reload(element: string): void; - reload(element: Element): void; - reload(element: JQuery): void; - remove(element: string): void; - remove(element: Element): void; - remove(element: JQuery): void; - select(): JQuery; - select(element?: string): void; - select(element?: Element): void; - select(element?: JQuery): void; - - } - - interface PanelBarAnimationCollapse { - duration?: number; - effects?: string; - } - - interface PanelBarAnimationExpand { - duration?: number; - effects?: string; - } - - interface PanelBarAnimation { - collapse?: PanelBarAnimationCollapse; - expand?: PanelBarAnimationExpand; - } - - interface PanelBarOptions { - name?: string; - animation?: boolean|PanelBarAnimation; - contentUrls?: any; - dataSource?: any|any; - expandMode?: string; - activate?(e: PanelBarActivateEvent): void; - collapse?(e: PanelBarCollapseEvent): void; - contentLoad?(e: PanelBarContentLoadEvent): void; - error?(e: PanelBarErrorEvent): void; - expand?(e: PanelBarExpandEvent): void; - select?(e: PanelBarSelectEvent): void; - } - interface PanelBarEvent { - sender: PanelBar; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface PanelBarActivateEvent extends PanelBarEvent { - item?: Element; - } - - interface PanelBarCollapseEvent extends PanelBarEvent { - item?: Element; - } - - interface PanelBarContentLoadEvent extends PanelBarEvent { - item?: Element; - contentElement?: Element; - } - - interface PanelBarErrorEvent extends PanelBarEvent { - xhr?: JQueryXHR; - status?: string; - } - - interface PanelBarExpandEvent extends PanelBarEvent { - item?: Element; - } - - interface PanelBarSelectEvent extends PanelBarEvent { - item?: Element; - } - - - class PivotConfigurator extends kendo.ui.Widget { - - static fn: PivotConfigurator; - - options: PivotConfiguratorOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): PivotConfigurator; - - constructor(element: Element, options?: PivotConfiguratorOptions); - - - destroy(): void; - refresh(): void; - setDataSource(dataSource: kendo.data.PivotDataSource): void; - - } - - interface PivotConfiguratorMessagesFieldMenuOperators { - contains?: string; - doesnotcontain?: string; - startswith?: string; - endswith?: string; - eq?: string; - neq?: string; - } - - interface PivotConfiguratorMessagesFieldMenu { - info?: string; - sortAscending?: string; - sortDescending?: string; - filterFields?: string; - filter?: string; - include?: string; - title?: string; - clear?: string; - ok?: string; - cancel?: string; - operators?: PivotConfiguratorMessagesFieldMenuOperators; - } - - interface PivotConfiguratorMessages { - measures?: string; - columns?: string; - rows?: string; - measuresLabel?: string; - rowsLabel?: string; - columnsLabel?: string; - fieldsLabel?: string; - fieldMenu?: PivotConfiguratorMessagesFieldMenu; - } - - interface PivotConfiguratorSortable { - allowUnsort?: boolean; - } - - interface PivotConfiguratorOptions { - name?: string; - dataSource?: any|kendo.data.PivotDataSource; - filterable?: boolean; - sortable?: boolean|PivotConfiguratorSortable; - height?: number|string; - messages?: PivotConfiguratorMessages; - } - interface PivotConfiguratorEvent { - sender: PivotConfigurator; + interface PointEvent { + sender: Point; preventDefault: Function; isDefaultPrevented(): boolean; } - class PivotGrid extends kendo.ui.Widget { - - static fn: PivotGrid; - - options: PivotGridOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): PivotGrid; - - constructor(element: Element, options?: PivotGridOptions); + class Rect extends Observable { - cellInfo(columnIndex: number, rowIndex: number): any; - cellInfoByElement(cell: string): any; - cellInfoByElement(cell: Element): any; - cellInfoByElement(cell: JQuery): any; - destroy(): void; - refresh(): void; - setDataSource(dataSource: kendo.data.PivotDataSource): void; - saveAsExcel(): void; - saveAsPDF(): JQueryPromise; + options: RectOptions; + + origin: kendo.geometry.Point; + size: kendo.geometry.Size; + + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); + + static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; + static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + bottomLeft(): kendo.geometry.Point; + bottomRight(): kendo.geometry.Point; + center(): kendo.geometry.Point; + clone(): kendo.geometry.Rect; + equals(other: kendo.geometry.Rect): boolean; + getOrigin(): kendo.geometry.Point; + getSize(): kendo.geometry.Size; + height(): number; + setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; + setOrigin(value: any): kendo.geometry.Rect; + setSize(value: kendo.geometry.Size): kendo.geometry.Rect; + setSize(value: any): kendo.geometry.Rect; + topLeft(): kendo.geometry.Point; + topRight(): kendo.geometry.Point; + width(): number; } - interface PivotGridExcel { - fileName?: string; - filterable?: boolean; - forceProxy?: boolean; - proxyURL?: string; - } - - interface PivotGridMessagesFieldMenuOperators { - contains?: string; - doesnotcontain?: string; - startswith?: string; - endswith?: string; - eq?: string; - neq?: string; - } - - interface PivotGridMessagesFieldMenu { - info?: string; - sortAscending?: string; - sortDescending?: string; - filterFields?: string; - filter?: string; - include?: string; - title?: string; - clear?: string; - ok?: string; - cancel?: string; - operators?: PivotGridMessagesFieldMenuOperators; - } - - interface PivotGridMessages { - measureFields?: string; - columnFields?: string; - rowFields?: string; - fieldMenu?: PivotGridMessagesFieldMenu; - } - - interface PivotGridPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface PivotGridPdf { - author?: string; - avoidLinks?: boolean|string; - creator?: string; - date?: Date; - fileName?: string; - forceProxy?: boolean; - keywords?: string; - landscape?: boolean; - margin?: PivotGridPdfMargin; - paperSize?: string|any; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - } - - interface PivotGridSortable { - allowUnsort?: boolean; - } - - interface PivotGridOptions { + interface RectOptions { name?: string; - dataSource?: any|kendo.data.PivotDataSource; - autoBind?: boolean; - reorderable?: boolean; - excel?: PivotGridExcel; - pdf?: PivotGridPdf; - filterable?: boolean; - sortable?: boolean|PivotGridSortable; - columnWidth?: number; - height?: number|string; - columnHeaderTemplate?: string|Function; - dataCellTemplate?: string|Function; - kpiStatusTemplate?: string|Function; - kpiTrendTemplate?: string|Function; - rowHeaderTemplate?: string|Function; - messages?: PivotGridMessages; - dataBinding?(e: PivotGridDataBindingEvent): void; - dataBound?(e: PivotGridDataBoundEvent): void; - expandMember?(e: PivotGridExpandMemberEvent): void; - collapseMember?(e: PivotGridCollapseMemberEvent): void; - excelExport?(e: PivotGridExcelExportEvent): void; - pdfExport?(e: PivotGridPdfExportEvent): void; } - interface PivotGridEvent { - sender: PivotGrid; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface PivotGridDataBindingEvent extends PivotGridEvent { - } - - interface PivotGridDataBoundEvent extends PivotGridEvent { - } - - interface PivotGridExpandMemberEvent extends PivotGridEvent { - axis?: string; - path?: string; - } - - interface PivotGridCollapseMemberEvent extends PivotGridEvent { - axis?: string; - path?: string; - } - - interface PivotGridExcelExportEvent extends PivotGridEvent { - data?: any; - workbook?: any; - } - - interface PivotGridPdfExportEvent extends PivotGridEvent { - promise?: JQueryPromise; - } - - - class Popup extends kendo.ui.Widget { - - static fn: Popup; - - options: PopupOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Popup; - - constructor(element: Element, options?: PopupOptions); - - - close(): void; - open(): void; - position(): void; - setOptions(options: any): void; - visible(): boolean; - - } - - interface PopupAnimationClose { - effects?: string; - duration?: number; - } - - interface PopupAnimationOpen { - effects?: string; - duration?: number; - } - - interface PopupAnimation { - close?: PopupAnimationClose; - open?: PopupAnimationOpen; - } - - interface PopupOptions { - name?: string; - adjustSize?: any; - animation?: boolean|PopupAnimation; - anchor?: string|JQuery; - appendTo?: string|JQuery; - collision?: string; - origin?: string; - position?: string; - activate?(e: PopupActivateEvent): void; - close?(e: PopupCloseEvent): void; - deactivate?(e: PopupDeactivateEvent): void; - open?(e: PopupOpenEvent): void; - } - interface PopupEvent { - sender: Popup; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface PopupActivateEvent extends PopupEvent { - } - - interface PopupCloseEvent extends PopupEvent { - } - - interface PopupDeactivateEvent extends PopupEvent { - } - - interface PopupOpenEvent extends PopupEvent { - } - - - class ProgressBar extends kendo.ui.Widget { - - static fn: ProgressBar; - - options: ProgressBarOptions; - - progressStatus: JQuery; - progressWrapper: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): ProgressBar; - - constructor(element: Element, options?: ProgressBarOptions); - - - enable(enable: boolean): void; - value(): number; - value(value: number): void; - - } - - interface ProgressBarAnimation { - duration?: number; - } - - interface ProgressBarOptions { - name?: string; - animation?: ProgressBarAnimation; - chunkCount?: number; - enable?: boolean; - max?: number; - min?: number; - orientation?: string; - reverse?: boolean; - showStatus?: boolean; - type?: string; - value?: number; - change?(e: ProgressBarChangeEvent): void; - complete?(e: ProgressBarCompleteEvent): void; - } - interface ProgressBarEvent { - sender: ProgressBar; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ProgressBarChangeEvent extends ProgressBarEvent { - value?: number; - } - - interface ProgressBarCompleteEvent extends ProgressBarEvent { - value?: number; - } - - - class RangeSlider extends kendo.ui.Widget { - - static fn: RangeSlider; - - options: RangeSliderOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): RangeSlider; - - constructor(element: Element, options?: RangeSliderOptions); - - - destroy(): void; - enable(enable: boolean): void; - value(): any; - values(): any; - value(selectionStart: number, selectionEnd: number): void; - resize(): void; - - } - - interface RangeSliderTooltip { - enabled?: boolean; - format?: string; - template?: string; - } - - interface RangeSliderOptions { - name?: string; - largeStep?: number; - max?: number; - min?: number; - orientation?: string; - selectionEnd?: number; - selectionStart?: number; - smallStep?: number; - tickPlacement?: string; - tooltip?: RangeSliderTooltip; - change?(e: RangeSliderChangeEvent): void; - slide?(e: RangeSliderSlideEvent): void; - } - interface RangeSliderEvent { - sender: RangeSlider; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface RangeSliderChangeEvent extends RangeSliderEvent { - value?: any; - } - - interface RangeSliderSlideEvent extends RangeSliderEvent { - value?: any; - } - - - class ResponsivePanel extends kendo.ui.Widget { - - static fn: ResponsivePanel; - - options: ResponsivePanelOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): ResponsivePanel; - - constructor(element: Element, options?: ResponsivePanelOptions); - - - close(): void; - destroy(): void; - open(): void; - - } - - interface ResponsivePanelOptions { - name?: string; - autoClose?: boolean; - breakpoint?: number; - orientation?: string; - toggleButton?: string; - close?(e: ResponsivePanelEvent): void; - open?(e: ResponsivePanelEvent): void; - } - interface ResponsivePanelEvent { - sender: ResponsivePanel; + interface RectEvent { + sender: Rect; preventDefault: Function; isDefaultPrevented(): boolean; } - class Scheduler extends kendo.ui.Widget { - - static fn: Scheduler; - - options: SchedulerOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Scheduler; - - constructor(element: Element, options?: SchedulerOptions); + class Size extends Observable { - addEvent(data: any): void; - cancelEvent(): void; - data(): void; - date(): Date; - date(value?: Date): void; - destroy(): void; - editEvent(event: string): void; - editEvent(event: kendo.data.SchedulerEvent): void; - items(): any; - occurrenceByUid(uid: string): kendo.data.SchedulerEvent; - occurrencesInRange(start: Date, end: Date): any; - refresh(): void; - removeEvent(event: string): void; - removeEvent(event: kendo.data.SchedulerEvent): void; - resourcesBySlot(slot: any): any; - saveAsPDF(): JQueryPromise; - saveEvent(): void; - select(): void; - select(events: any, options: any): void; - setDataSource(dataSource: kendo.data.SchedulerDataSource): void; - slotByPosition(xPosition: number, yPosition: number): any; - slotByElement(element: Element): any; - slotByElement(element: JQuery): any; - view(): kendo.ui.SchedulerView; - view(type?: string): void; - viewName(): string; + options: SizeOptions; + + width: number; + height: number; + + + static create(width: number, height: number): kendo.geometry.Size; + static create(width: any, height: number): kendo.geometry.Size; + static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; + + clone(): kendo.geometry.Size; + equals(other: kendo.geometry.Size): boolean; + getWidth(): number; + getHeight(): number; + setWidth(value: number): kendo.geometry.Size; + setHeight(value: number): kendo.geometry.Size; } - interface SchedulerCurrentTimeMarker { - updateInterval?: number; - useLocalTimezone?: boolean; - } - - interface SchedulerEditable { - confirmation?: boolean|string; - create?: boolean; - destroy?: boolean; - editRecurringMode?: string; - move?: boolean; - resize?: boolean; - template?: string|Function; - update?: boolean; - window?: any; - } - - interface SchedulerFooter { - command?: string|boolean; - } - - interface SchedulerGroup { - resources?: any; - orientation?: string; - } - - interface SchedulerMessagesEditable { - confirmation?: string; - } - - interface SchedulerMessagesEditor { - allDayEvent?: string; - description?: string; - editorTitle?: string; - end?: string; - endTimezone?: string; - repeat?: string; - separateTimezones?: string; - start?: string; - startTimezone?: string; - timezone?: string; - timezoneEditorButton?: string; - timezoneEditorTitle?: string; - title?: string; - } - - interface SchedulerMessagesRecurrenceEditorDaily { - interval?: string; - repeatEvery?: string; - } - - interface SchedulerMessagesRecurrenceEditorEnd { - after?: string; - occurrence?: string; - label?: string; - never?: string; - mobileLabel?: string; - on?: string; - } - - interface SchedulerMessagesRecurrenceEditorFrequencies { - daily?: string; - monthly?: string; - never?: string; - weekly?: string; - yearly?: string; - } - - interface SchedulerMessagesRecurrenceEditorMonthly { - day?: string; - interval?: string; - repeatEvery?: string; - repeatOn?: string; - } - - interface SchedulerMessagesRecurrenceEditorOffsetPositions { - first?: string; - second?: string; - third?: string; - fourth?: string; - last?: string; - } - - interface SchedulerMessagesRecurrenceEditorWeekdays { - day?: string; - weekday?: string; - weekend?: string; - } - - interface SchedulerMessagesRecurrenceEditorWeekly { - interval?: string; - repeatEvery?: string; - repeatOn?: string; - } - - interface SchedulerMessagesRecurrenceEditorYearly { - of?: string; - repeatEvery?: string; - repeatOn?: string; - interval?: string; - } - - interface SchedulerMessagesRecurrenceEditor { - daily?: SchedulerMessagesRecurrenceEditorDaily; - end?: SchedulerMessagesRecurrenceEditorEnd; - frequencies?: SchedulerMessagesRecurrenceEditorFrequencies; - monthly?: SchedulerMessagesRecurrenceEditorMonthly; - offsetPositions?: SchedulerMessagesRecurrenceEditorOffsetPositions; - weekly?: SchedulerMessagesRecurrenceEditorWeekly; - weekdays?: SchedulerMessagesRecurrenceEditorWeekdays; - yearly?: SchedulerMessagesRecurrenceEditorYearly; - } - - interface SchedulerMessagesRecurrenceMessages { - deleteRecurring?: string; - deleteWindowOccurrence?: string; - deleteWindowSeries?: string; - deleteWindowTitle?: string; - editRecurring?: string; - editWindowOccurrence?: string; - editWindowSeries?: string; - editWindowTitle?: string; - } - - interface SchedulerMessagesViews { - day?: string; - week?: string; - month?: string; - agenda?: string; - } - - interface SchedulerMessages { - allDay?: string; - ariaEventLabel?: string; - ariaSlotLabel?: string; - cancel?: string; - date?: string; - deleteWindowTitle?: string; - destroy?: string; - event?: string; - defaultRowText?: string; - pdf?: string; - save?: string; - showFullDay?: string; - showWorkDay?: string; - time?: string; - today?: string; - editable?: SchedulerMessagesEditable; - editor?: SchedulerMessagesEditor; - recurrenceEditor?: SchedulerMessagesRecurrenceEditor; - recurrenceMessages?: SchedulerMessagesRecurrenceMessages; - views?: SchedulerMessagesViews; - } - - interface SchedulerPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface SchedulerPdf { - author?: string; - avoidLinks?: boolean|string; - creator?: string; - date?: Date; - fileName?: string; - forceProxy?: boolean; - keywords?: string; - landscape?: boolean; - margin?: SchedulerPdfMargin; - paperSize?: string|any; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - } - - interface SchedulerResource { - dataColorField?: string; - dataSource?: any|any|kendo.data.DataSource; - dataTextField?: string; - dataValueField?: string; - field?: string; - multiple?: boolean; - name?: string; - title?: string; - valuePrimitive?: boolean; - } - - interface SchedulerToolbarItem { + interface SizeOptions { name?: string; } - - interface SchedulerViewEditable { - create?: boolean; - destroy?: boolean; - update?: boolean; - } - - interface SchedulerViewGroup { - orientation?: string; - } - - interface SchedulerView { - allDayEventTemplate?: string|Function; - allDaySlot?: boolean; - allDaySlotTemplate?: string|Function; - columnWidth?: number; - dateHeaderTemplate?: string|Function; - dayTemplate?: string|Function; - editable?: boolean|SchedulerViewEditable; - endTime?: Date; - eventHeight?: number; - eventTemplate?: string|Function; - eventTimeTemplate?: string|Function; - group?: SchedulerViewGroup; - majorTick?: number; - majorTimeHeaderTemplate?: string|Function; - minorTickCount?: number; - minorTimeHeaderTemplate?: string|Function; - selected?: boolean; - selectedDateFormat?: string; - showWorkHours?: boolean; - slotTemplate?: string|Function; - startTime?: Date; - title?: string; - type?: string; - workWeekStart?: number; - workWeekEnd?: number; - } - - interface SchedulerSelectOptions { - events?: any; - resources?: any; - start?: Date; - end?: Date; - isAllDay?: boolean; - } - - interface SchedulerOptions { - name?: string; - allDayEventTemplate?: string|Function; - allDaySlot?: boolean; - autoBind?: boolean; - currentTimeMarker?: boolean|SchedulerCurrentTimeMarker; - dataSource?: any|any|kendo.data.SchedulerDataSource; - date?: Date; - dateHeaderTemplate?: string|Function; - editable?: boolean|SchedulerEditable; - endTime?: Date; - eventTemplate?: string|Function; - footer?: boolean|SchedulerFooter; - group?: SchedulerGroup; - height?: number|string; - majorTick?: number; - majorTimeHeaderTemplate?: string|Function; - max?: Date; - messages?: SchedulerMessages; - min?: Date; - minorTickCount?: number; - minorTimeHeaderTemplate?: string|Function; - mobile?: boolean|string; - pdf?: SchedulerPdf; - resources?: SchedulerResource[]; - selectable?: boolean; - showWorkHours?: boolean; - snap?: boolean; - startTime?: Date; - timezone?: string; - toolbar?: SchedulerToolbarItem[]; - views?: SchedulerView[]; - groupHeaderTemplate?: string|Function; - width?: number|string; - workDayStart?: Date; - workDayEnd?: Date; - workWeekStart?: number; - workWeekEnd?: number; - add?(e: SchedulerAddEvent): void; - cancel?(e: SchedulerCancelEvent): void; - change?(e: SchedulerChangeEvent): void; - dataBinding?(e: SchedulerDataBindingEvent): void; - dataBound?(e: SchedulerDataBoundEvent): void; - edit?(e: SchedulerEditEvent): void; - moveStart?(e: SchedulerMoveStartEvent): void; - move?(e: SchedulerMoveEvent): void; - moveEnd?(e: SchedulerMoveEndEvent): void; - navigate?(e: SchedulerNavigateEvent): void; - pdfExport?(e: SchedulerPdfExportEvent): void; - remove?(e: SchedulerRemoveEvent): void; - resizeStart?(e: SchedulerResizeStartEvent): void; - resize?(e: SchedulerResizeEvent): void; - resizeEnd?(e: SchedulerResizeEndEvent): void; - save?(e: SchedulerSaveEvent): void; - } - interface SchedulerEvent { - sender: Scheduler; + interface SizeEvent { + sender: Size; preventDefault: Function; isDefaultPrevented(): boolean; } - interface SchedulerAddEvent extends SchedulerEvent { - event?: any; - } - interface SchedulerCancelEvent extends SchedulerEvent { - container?: JQuery; - event?: kendo.data.SchedulerEvent; - } - - interface SchedulerChangeEvent extends SchedulerEvent { - start?: Date; - end?: Date; - events?: any; - slots?: any; - resources?: any; - } - - interface SchedulerDataBindingEvent extends SchedulerEvent { - } - - interface SchedulerDataBoundEvent extends SchedulerEvent { - } - - interface SchedulerEditEvent extends SchedulerEvent { - container?: JQuery; - event?: kendo.data.SchedulerEvent; - } - - interface SchedulerMoveStartEvent extends SchedulerEvent { - event?: kendo.data.SchedulerEvent; - } - - interface SchedulerMoveEvent extends SchedulerEvent { - event?: kendo.data.SchedulerEvent; - slot?: any; - } - - interface SchedulerMoveEndEvent extends SchedulerEvent { - start?: Date; - end?: Date; - event?: kendo.data.SchedulerEvent; - slot?: any; - resources?: any; - } - - interface SchedulerNavigateEvent extends SchedulerEvent { - action?: string; - date?: Date; - view?: string; - } - - interface SchedulerPdfExportEvent extends SchedulerEvent { - promise?: JQueryPromise; - } - - interface SchedulerRemoveEvent extends SchedulerEvent { - event?: kendo.data.SchedulerEvent; - } - - interface SchedulerResizeStartEvent extends SchedulerEvent { - event?: kendo.data.SchedulerEvent; - } - - interface SchedulerResizeEvent extends SchedulerEvent { - event?: kendo.data.SchedulerEvent; - slot?: any; - } - - interface SchedulerResizeEndEvent extends SchedulerEvent { - event?: kendo.data.SchedulerEvent; - slot?: any; - } - - interface SchedulerSaveEvent extends SchedulerEvent { - container?: JQuery; - event?: kendo.data.SchedulerEvent; - } + class Transformation extends Observable { - class Slider extends kendo.ui.Widget { - - static fn: Slider; - - options: SliderOptions; + options: TransformationOptions; - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Slider; - - constructor(element: Element, options?: SliderOptions); - destroy(): void; - enable(enable: boolean): void; - value(): number; - value(value: number): void; - resize(): void; + clone(): kendo.geometry.Transformation; + equals(other: kendo.geometry.Transformation): boolean; + matrix(): kendo.geometry.Matrix; + multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; + rotate(angle: number, center: any): kendo.geometry.Transformation; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; + scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; + translate(x: number, y: number): kendo.geometry.Transformation; } - interface SliderTooltip { - enabled?: boolean; - format?: string; - template?: string; - } - - interface SliderOptions { + interface TransformationOptions { name?: string; - decreaseButtonTitle?: string; - increaseButtonTitle?: string; - largeStep?: number; - max?: number; - min?: number; - orientation?: string; - showButtons?: boolean; - smallStep?: number; - tickPlacement?: string; - tooltip?: SliderTooltip; - value?: number; - change?(e: SliderChangeEvent): void; - slide?(e: SliderSlideEvent): void; } - interface SliderEvent { - sender: Slider; + interface TransformationEvent { + sender: Transformation; preventDefault: Function; isDefaultPrevented(): boolean; } - interface SliderChangeEvent extends SliderEvent { - value?: number; - } - - interface SliderSlideEvent extends SliderEvent { - value?: number; - } - - - class Sortable extends kendo.ui.Widget { - - static fn: Sortable; - - options: SortableOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Sortable; - - constructor(element: Element, options?: SortableOptions); - - - indexOf(element: JQuery): number; - items(): JQuery; - - } - - interface SortableCursorOffset { - left?: number; - top?: number; - } - - interface SortableOptions { - name?: string; - axis?: string; - autoScroll?: boolean; - container?: string|JQuery; - connectWith?: string; - cursor?: string; - cursorOffset?: SortableCursorOffset; - disabled?: string; - filter?: string; - handler?: string; - hint?: Function|string|JQuery; - holdToDrag?: boolean; - ignore?: string; - placeholder?: Function|string|JQuery; - start?(e: SortableStartEvent): void; - move?(e: SortableMoveEvent): void; - end?(e: SortableEndEvent): void; - change?(e: SortableChangeEvent): void; - cancel?(e: SortableCancelEvent): void; - } - interface SortableEvent { - sender: Sortable; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface SortableStartEvent extends SortableEvent { - draggableEvent?: any; - item?: JQuery; - } - - interface SortableMoveEvent extends SortableEvent { - item?: JQuery; - target?: JQuery; - list?: kendo.ui.Sortable; - draggableEvent?: any; - } - - interface SortableEndEvent extends SortableEvent { - action?: string; - item?: JQuery; - oldIndex?: number; - newIndex?: number; - draggableEvent?: any; - } - - interface SortableChangeEvent extends SortableEvent { - action?: string; - item?: JQuery; - oldIndex?: number; - newIndex?: number; - draggableEvent?: any; - } - - interface SortableCancelEvent extends SortableEvent { - item?: JQuery; - } - - - class Splitter extends kendo.ui.Widget { - - static fn: Splitter; - - options: SplitterOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Splitter; - - constructor(element: Element, options?: SplitterOptions); - - - ajaxRequest(pane: string, url: string, data: any): void; - ajaxRequest(pane: string, url: string, data: string): void; - ajaxRequest(pane: Element, url: string, data: any): void; - ajaxRequest(pane: Element, url: string, data: string): void; - ajaxRequest(pane: JQuery, url: string, data: any): void; - ajaxRequest(pane: JQuery, url: string, data: string): void; - append(config?: any): JQuery; - collapse(pane: string): void; - collapse(pane: Element): void; - collapse(pane: JQuery): void; - destroy(): void; - expand(pane: string): void; - expand(pane: Element): void; - expand(pane: JQuery): void; - insertAfter(config: any, referencePane: string): JQuery; - insertAfter(config: any, referencePane: Element): JQuery; - insertAfter(config: any, referencePane: JQuery): JQuery; - insertBefore(config: any, referencePane: string): JQuery; - insertBefore(config: any, referencePane: Element): JQuery; - insertBefore(config: any, referencePane: JQuery): JQuery; - max(pane: string, value: string): void; - max(pane: Element, value: string): void; - max(pane: JQuery, value: string): void; - min(pane: string, value: string): void; - min(pane: Element, value: string): void; - min(pane: JQuery, value: string): void; - remove(pane: string): void; - remove(pane: Element): void; - remove(pane: JQuery): void; - size(pane: string, value: string): void; - size(pane: Element, value: string): void; - size(pane: JQuery, value: string): void; - toggle(pane: string, expand?: boolean): void; - toggle(pane: Element, expand?: boolean): void; - toggle(pane: JQuery, expand?: boolean): void; - - } - - interface SplitterPane { - collapsed?: boolean; - collapsedSize?: string; - collapsible?: boolean; - contentUrl?: string; - max?: string; - min?: string; - resizable?: boolean; - scrollable?: boolean; - size?: string; - } - - interface SplitterOptions { - name?: string; - orientation?: string; - panes?: SplitterPane[]; - collapse?(e: SplitterCollapseEvent): void; - contentLoad?(e: SplitterContentLoadEvent): void; - error?(e: SplitterErrorEvent): void; - expand?(e: SplitterExpandEvent): void; - layoutChange?(e: SplitterEvent): void; - resize?(e: SplitterEvent): void; - } - interface SplitterEvent { - sender: Splitter; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface SplitterCollapseEvent extends SplitterEvent { - pane?: Element; - } - - interface SplitterContentLoadEvent extends SplitterEvent { - pane?: Element; - } - - interface SplitterErrorEvent extends SplitterEvent { - xhr?: JQueryXHR; - status?: string; - } - - interface SplitterExpandEvent extends SplitterEvent { - pane?: Element; - } - - - class Spreadsheet extends kendo.ui.Widget { - - static fn: Spreadsheet; - - options: SpreadsheetOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Spreadsheet; - - constructor(element: Element, options?: SpreadsheetOptions); - - - activeSheet(): kendo.spreadsheet.Sheet; - activeSheet(sheet?: kendo.spreadsheet.Sheet): void; - sheets(): any; - fromFile(blob: Blob): JQueryPromise; - fromFile(blob: File): JQueryPromise; - saveAsExcel(): void; - saveAsPDF(): JQueryPromise; - sheetByName(name: string): kendo.spreadsheet.Sheet; - sheetIndex(sheet: kendo.spreadsheet.Sheet): number; - sheetByIndex(index: number): kendo.spreadsheet.Sheet; - insertSheet(options: any): kendo.spreadsheet.Sheet; - moveSheetToIndex(sheet: kendo.spreadsheet.Sheet, index: number): void; - removeSheet(sheet: kendo.spreadsheet.Sheet): void; - renameSheet(sheet: kendo.spreadsheet.Sheet, newSheetName: string): kendo.spreadsheet.Sheet; - toJSON(): any; - fromJSON(data: any): void; - - } - - interface SpreadsheetExcel { - fileName?: string; - forceProxy?: boolean; - proxyURL?: string; - } - - interface SpreadsheetPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface SpreadsheetPdf { - area?: string; - author?: string; - creator?: string; - date?: Date; - fileName?: string; - fitWidth?: boolean; - forceProxy?: boolean; - guidelines?: boolean; - hCenter?: boolean; - keywords?: string; - landscape?: boolean; - margin?: SpreadsheetPdfMargin; - paperSize?: string|any; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - vCenter?: boolean; - } - - interface SpreadsheetSheetColumn { - index?: number; - width?: number; - } - - interface SpreadsheetSheetFilterColumnCriteriaItem { - operator?: string; - value?: string; - } - - interface SpreadsheetSheetFilterColumn { - criteria?: SpreadsheetSheetFilterColumnCriteriaItem[]; - filter?: string; - index?: number; - logic?: string; - type?: string; - value?: number|string|Date; - values?: any; - } - - interface SpreadsheetSheetFilter { - columns?: SpreadsheetSheetFilterColumn[]; - ref?: string; - } - - interface SpreadsheetSheetRowCellBorderBottom { - color?: string; - size?: string; - } - - interface SpreadsheetSheetRowCellBorderLeft { - color?: string; - size?: string; - } - - interface SpreadsheetSheetRowCellBorderRight { - color?: string; - size?: string; - } - - interface SpreadsheetSheetRowCellBorderTop { - color?: string; - size?: string; - } - - interface SpreadsheetSheetRowCellValidation { - type?: string; - comparerType?: string; - dataType?: string; - from?: string; - to?: string; - allowNulls?: boolean; - messageTemplate?: string; - titleTemplate?: string; - } - - interface SpreadsheetSheetRowCell { - background?: string; - borderBottom?: SpreadsheetSheetRowCellBorderBottom; - borderLeft?: SpreadsheetSheetRowCellBorderLeft; - borderTop?: SpreadsheetSheetRowCellBorderTop; - borderRight?: SpreadsheetSheetRowCellBorderRight; - color?: string; - fontFamily?: string; - fontSize?: number; - italic?: boolean; - bold?: boolean; - enable?: boolean; - format?: string; - formula?: string; - index?: number; - link?: string; - textAlign?: string; - underline?: boolean; - value?: number|string|boolean|Date; - validation?: SpreadsheetSheetRowCellValidation; - verticalAlign?: string; - wrap?: boolean; - } - - interface SpreadsheetSheetRow { - cells?: SpreadsheetSheetRowCell[]; - height?: number; - index?: number; - } - - interface SpreadsheetSheetSortColumn { - ascending?: boolean; - index?: number; - } - - interface SpreadsheetSheetSort { - columns?: SpreadsheetSheetSortColumn[]; - ref?: string; - } - - interface SpreadsheetSheet { - activeCell?: string; - name?: string; - columns?: SpreadsheetSheetColumn[]; - dataSource?: kendo.data.DataSource; - filter?: SpreadsheetSheetFilter; - frozenColumns?: number; - frozenRows?: number; - mergedCells?: any; - rows?: SpreadsheetSheetRow[]; - selection?: string; - showGridLines?: boolean; - sort?: SpreadsheetSheetSort; - } - - interface SpreadsheetToolbar { - home?: boolean|any; - insert?: boolean|any; - data?: boolean|any; - } - - interface SpreadsheetInsertSheetOptions { - rows?: number; - columns?: number; - rowHeight?: number; - columnWidth?: number; - headerHeight?: number; - headerWidth?: number; - dataSource?: kendo.data.DataSource; - data?: any; - } - - interface SpreadsheetOptions { - name?: string; - activeSheet?: string; - columnWidth?: number; - columns?: number; - headerHeight?: number; - headerWidth?: number; - excel?: SpreadsheetExcel; - pdf?: SpreadsheetPdf; - rowHeight?: number; - rows?: number; - sheets?: SpreadsheetSheet[]; - sheetsbar?: boolean; - toolbar?: boolean|SpreadsheetToolbar; - change?(e: SpreadsheetChangeEvent): void; - render?(e: SpreadsheetRenderEvent): void; - excelExport?(e: SpreadsheetExcelExportEvent): void; - excelImport?(e: SpreadsheetExcelImportEvent): void; - pdfExport?(e: SpreadsheetPdfExportEvent): void; - } - interface SpreadsheetEvent { - sender: Spreadsheet; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface SpreadsheetChangeEvent extends SpreadsheetEvent { - range?: kendo.spreadsheet.Range; - } - - interface SpreadsheetRenderEvent extends SpreadsheetEvent { - } - - interface SpreadsheetExcelExportEvent extends SpreadsheetEvent { - data?: any; - workbook?: kendo.ooxml.Workbook; - } - - interface SpreadsheetExcelImportEvent extends SpreadsheetEvent { - file?: Blob|File; - progress?: JQueryPromise; - } - - interface SpreadsheetPdfExportEvent extends SpreadsheetEvent { - promise?: JQueryPromise; - } - - - class TabStrip extends kendo.ui.Widget { - - static fn: TabStrip; - - options: TabStripOptions; - - dataSource: kendo.data.DataSource; - tabGroup: JQuery; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): TabStrip; - - constructor(element: Element, options?: TabStripOptions); - - - activateTab(item: JQuery): void; - append(tab: any): kendo.ui.TabStrip; - contentElement(itemIndex: number): Element; - contentHolder(itemIndex: number): Element; - deactivateTab(item: JQuery): void; - destroy(): void; - disable(element: string): kendo.ui.TabStrip; - disable(element: Element): kendo.ui.TabStrip; - disable(element: JQuery): kendo.ui.TabStrip; - enable(element: string, enable?: boolean): kendo.ui.TabStrip; - enable(element: Element, enable?: boolean): kendo.ui.TabStrip; - enable(element: JQuery, enable?: boolean): kendo.ui.TabStrip; - insertAfter(item: any, referenceTab: string): kendo.ui.TabStrip; - insertAfter(item: any, referenceTab: Element): kendo.ui.TabStrip; - insertAfter(item: any, referenceTab: JQuery): kendo.ui.TabStrip; - insertAfter(item: string, referenceTab: string): kendo.ui.TabStrip; - insertAfter(item: string, referenceTab: Element): kendo.ui.TabStrip; - insertAfter(item: string, referenceTab: JQuery): kendo.ui.TabStrip; - insertAfter(item: Element, referenceTab: string): kendo.ui.TabStrip; - insertAfter(item: Element, referenceTab: Element): kendo.ui.TabStrip; - insertAfter(item: Element, referenceTab: JQuery): kendo.ui.TabStrip; - insertAfter(item: JQuery, referenceTab: string): kendo.ui.TabStrip; - insertAfter(item: JQuery, referenceTab: Element): kendo.ui.TabStrip; - insertAfter(item: JQuery, referenceTab: JQuery): kendo.ui.TabStrip; - insertBefore(item: any, referenceTab: string): kendo.ui.TabStrip; - insertBefore(item: any, referenceTab: Element): kendo.ui.TabStrip; - insertBefore(item: any, referenceTab: JQuery): kendo.ui.TabStrip; - insertBefore(item: string, referenceTab: string): kendo.ui.TabStrip; - insertBefore(item: string, referenceTab: Element): kendo.ui.TabStrip; - insertBefore(item: string, referenceTab: JQuery): kendo.ui.TabStrip; - insertBefore(item: Element, referenceTab: string): kendo.ui.TabStrip; - insertBefore(item: Element, referenceTab: Element): kendo.ui.TabStrip; - insertBefore(item: Element, referenceTab: JQuery): kendo.ui.TabStrip; - insertBefore(item: JQuery, referenceTab: string): kendo.ui.TabStrip; - insertBefore(item: JQuery, referenceTab: Element): kendo.ui.TabStrip; - insertBefore(item: JQuery, referenceTab: JQuery): kendo.ui.TabStrip; - items(): HTMLCollection; - reload(element: string): kendo.ui.TabStrip; - reload(element: Element): kendo.ui.TabStrip; - reload(element: JQuery): kendo.ui.TabStrip; - remove(element: string): kendo.ui.TabStrip; - remove(element: number): kendo.ui.TabStrip; - remove(element: JQuery): kendo.ui.TabStrip; - select(): JQuery; - select(element: string): void; - select(element: Element): void; - select(element: JQuery): void; - select(element: number): void; - setDataSource(dataSource: any): void; - setDataSource(dataSource: kendo.data.DataSource): void; - - } - - interface TabStripAnimationClose { - duration?: number; - effects?: string; - } - - interface TabStripAnimationOpen { - duration?: number; - effects?: string; - } - - interface TabStripAnimation { - close?: TabStripAnimationClose; - open?: TabStripAnimationOpen; - } - - interface TabStripScrollable { - distance?: number; - } - - interface TabStripOptions { - name?: string; - animation?: boolean|TabStripAnimation; - collapsible?: boolean; - contentUrls?: any; - dataContentField?: string; - dataContentUrlField?: string; - dataImageUrlField?: string; - dataSource?: any|any|kendo.data.DataSource; - dataSpriteCssClass?: string; - dataTextField?: string; - dataUrlField?: string; - navigatable?: boolean; - scrollable?: boolean|TabStripScrollable; - tabPosition?: string; - value?: string; - activate?(e: TabStripActivateEvent): void; - contentLoad?(e: TabStripContentLoadEvent): void; - error?(e: TabStripErrorEvent): void; - select?(e: TabStripSelectEvent): void; - show?(e: TabStripShowEvent): void; - } - interface TabStripEvent { - sender: TabStrip; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface TabStripActivateEvent extends TabStripEvent { - item?: Element; - contentElement?: Element; - } - - interface TabStripContentLoadEvent extends TabStripEvent { - item?: Element; - contentElement?: Element; - } - - interface TabStripErrorEvent extends TabStripEvent { - xhr?: JQueryXHR; - status?: string; - } - - interface TabStripSelectEvent extends TabStripEvent { - item?: Element; - contentElement?: Element; - } - - interface TabStripShowEvent extends TabStripEvent { - item?: Element; - contentElement?: Element; - } - - - class TimePicker extends kendo.ui.Widget { - - static fn: TimePicker; - - options: TimePickerOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): TimePicker; - - constructor(element: Element, options?: TimePickerOptions); - - - close(): void; - destroy(): void; - enable(enable: boolean): void; - readonly(readonly: boolean): void; - max(): Date; - max(value: Date): void; - max(value: string): void; - min(): Date; - min(value: Date): void; - min(value: string): void; - open(): void; - setOptions(options: any): void; - value(): Date; - value(value: Date): void; - value(value: string): void; - - } - - interface TimePickerAnimationClose { - effects?: string; - duration?: number; - } - - interface TimePickerAnimationOpen { - effects?: string; - duration?: number; - } - - interface TimePickerAnimation { - close?: TimePickerAnimationClose; - open?: TimePickerAnimationOpen; - } - - interface TimePickerOptions { - name?: string; - animation?: boolean|TimePickerAnimation; - culture?: string; - dates?: any; - format?: string; - interval?: number; - max?: Date; - min?: Date; - parseFormats?: any; - value?: Date; - change?(e: TimePickerChangeEvent): void; - close?(e: TimePickerCloseEvent): void; - open?(e: TimePickerOpenEvent): void; - } - interface TimePickerEvent { - sender: TimePicker; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface TimePickerChangeEvent extends TimePickerEvent { - } - - interface TimePickerCloseEvent extends TimePickerEvent { - } - - interface TimePickerOpenEvent extends TimePickerEvent { - } - - - class ToolBar extends kendo.ui.Widget { - - static fn: ToolBar; - - options: ToolBarOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): ToolBar; - - constructor(element: Element, options?: ToolBarOptions); - - - add(command: any): void; - destroy(): void; - enable(command: string, enable: boolean): void; - enable(command: Element, enable: boolean): void; - enable(command: JQuery, enable: boolean): void; - getSelectedFromGroup(groupName: string): void; - hide(command: string): void; - hide(command: Element): void; - hide(command: JQuery): void; - remove(command: string): void; - remove(command: Element): void; - remove(command: JQuery): void; - show(command: string): void; - show(command: Element): void; - show(command: JQuery): void; - toggle(): void; - - } - - interface ToolBarItemButton { - attributes?: any; - click?: Function; - enable?: boolean; - group?: string; - hidden?: boolean; - icon?: string; - id?: string; - imageUrl?: string; - selected?: boolean; - showIcon?: string; - showText?: string; - spriteCssClass?: string; - toggle?: Function; - togglable?: boolean; - text?: string; - url?: string; - } - - interface ToolBarItemMenuButton { - attributes?: any; - enable?: boolean; - hidden?: boolean; - icon?: string; - id?: string; - imageUrl?: string; - spriteCssClass?: string; - text?: string; - url?: string; - } - - interface ToolBarItem { - attributes?: any; - buttons?: ToolBarItemButton[]; - click?: Function; - enable?: boolean; - group?: string; - hidden?: boolean; - icon?: string; - id?: string; - imageUrl?: string; - menuButtons?: ToolBarItemMenuButton[]; - overflow?: string; - overflowTemplate?: string|Function; - primary?: boolean; - selected?: boolean; - showIcon?: string; - showText?: string; - spriteCssClass?: string; - template?: string|Function; - text?: string; - togglable?: boolean; - toggle?: Function; - type?: string; - url?: string; - } - - interface ToolBarOptions { - name?: string; - resizable?: boolean; - items?: ToolBarItem[]; - click?(e: ToolBarClickEvent): void; - close?(e: ToolBarCloseEvent): void; - open?(e: ToolBarOpenEvent): void; - toggle?(e: ToolBarToggleEvent): void; - overflowClose?(e: ToolBarOverflowCloseEvent): void; - overflowOpen?(e: ToolBarOverflowOpenEvent): void; - } - interface ToolBarEvent { - sender: ToolBar; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ToolBarClickEvent extends ToolBarEvent { - target?: JQuery; - id?: string; - } - - interface ToolBarCloseEvent extends ToolBarEvent { - SplitButton?: JQuery; - } - - interface ToolBarOpenEvent extends ToolBarEvent { - SplitButton?: JQuery; - } - - interface ToolBarToggleEvent extends ToolBarEvent { - target?: JQuery; - checked?: boolean; - id?: string; - } - - interface ToolBarOverflowCloseEvent extends ToolBarEvent { - } - - interface ToolBarOverflowOpenEvent extends ToolBarEvent { - } - - - class Tooltip extends kendo.ui.Widget { - - static fn: Tooltip; - - options: TooltipOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Tooltip; - - constructor(element: Element, options?: TooltipOptions); - - - show(element: JQuery): void; - hide(): void; - refresh(): void; - target(): JQuery; - - } - - interface TooltipAnimationClose { - effects?: string; - duration?: number; - } - - interface TooltipAnimationOpen { - effects?: string; - duration?: number; - } - - interface TooltipAnimation { - close?: TooltipAnimationClose; - open?: TooltipAnimationOpen; - } - - interface TooltipContent { - url?: string; - } - - interface TooltipOptions { - name?: string; - autoHide?: boolean; - animation?: boolean|TooltipAnimation; - content?: TooltipContent; - callout?: boolean; - filter?: string; - iframe?: boolean; - height?: number; - width?: number; - position?: string; - showAfter?: number; - showOn?: string; - contentLoad?(e: TooltipEvent): void; - show?(e: TooltipEvent): void; - hide?(e: TooltipEvent): void; - requestStart?(e: TooltipRequestStartEvent): void; - error?(e: TooltipErrorEvent): void; - } - interface TooltipEvent { - sender: Tooltip; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface TooltipRequestStartEvent extends TooltipEvent { - target?: JQuery; - options?: any; - } - - interface TooltipErrorEvent extends TooltipEvent { - xhr?: JQueryXHR; - status?: string; - } - - - class Touch extends kendo.ui.Widget { - - static fn: Touch; - - options: TouchOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Touch; - - constructor(element: Element, options?: TouchOptions); - - - cancel(): void; - destroy(): void; - - } - - interface TouchOptions { - name?: string; - filter?: string; - surface?: JQuery; - multiTouch?: boolean; - enableSwipe?: boolean; - minXDelta?: number; - maxYDelta?: number; - maxDuration?: number; - minHold?: number; - doubleTapTimeout?: number; - touchstart?(e: TouchTouchstartEvent): void; - dragstart?(e: TouchDragstartEvent): void; - drag?(e: TouchDragEvent): void; - dragend?(e: TouchDragendEvent): void; - tap?(e: TouchTapEvent): void; - doubletap?(e: TouchDoubletapEvent): void; - hold?(e: TouchHoldEvent): void; - swipe?(e: TouchSwipeEvent): void; - gesturestart?(e: TouchGesturestartEvent): void; - gesturechange?(e: TouchGesturechangeEvent): void; - gestureend?(e: TouchGestureendEvent): void; - } - interface TouchEvent { - sender: Touch; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface TouchTouchstartEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchDragstartEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchDragEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchDragendEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchTapEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchDoubletapEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchHoldEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchSwipeEvent extends TouchEvent { - touch?: kendo.mobile.ui.TouchEventOptions; - event?: JQueryEventObject; - } - - interface TouchGesturestartEvent extends TouchEvent { - touches?: any; - event?: JQueryEventObject; - distance?: number; - center?: kendo.mobile.ui.Point; - } - - interface TouchGesturechangeEvent extends TouchEvent { - touches?: any; - event?: JQueryEventObject; - distance?: number; - center?: kendo.mobile.ui.Point; - } - - interface TouchGestureendEvent extends TouchEvent { - touches?: any; - event?: JQueryEventObject; - distance?: number; - center?: kendo.mobile.ui.Point; - } - - - class TreeList extends kendo.ui.Widget { - - static fn: TreeList; - - options: TreeListOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): TreeList; - - constructor(element: Element, options?: TreeListOptions); - - - addRow(parentRow: string): void; - addRow(parentRow: Element): void; - addRow(parentRow: JQuery): void; - autoFitColumn(column: number): void; - autoFitColumn(column: string): void; - autoFitColumn(column: any): void; - cancelRow(): void; - clearSelection(): void; - collapse(): void; - dataItem(row: string): kendo.data.TreeListModel; - dataItem(row: Element): kendo.data.TreeListModel; - dataItem(row: JQuery): kendo.data.TreeListModel; - destroy(): void; - editRow(row: JQuery): void; - expand(row: string): void; - expand(row: Element): void; - expand(row: JQuery): void; - itemFor(model: kendo.data.TreeListModel): JQuery; - itemFor(model: any): JQuery; - items(): any; - refresh(): void; - removeRow(row: string): void; - removeRow(row: Element): void; - removeRow(row: JQuery): void; - saveAsExcel(): void; - saveAsPDF(): JQueryPromise; - saveRow(): void; - select(): JQuery; - select(rows: Element): void; - select(rows: JQuery): void; - setDataSource(dataSource: kendo.data.TreeListDataSource): void; - showColumn(column: number): void; - showColumn(column: string): void; - hideColumn(column: number): void; - hideColumn(column: string): void; - lockColumn(column: number): void; - lockColumn(column: string): void; - unlockColumn(column: number): void; - unlockColumn(column: string): void; - reorderColumn(destIndex: number, column: any): void; - - } - - interface TreeListColumnMenuMessages { - columns?: string; - filter?: string; - sortAscending?: string; - sortDescending?: string; - } - - interface TreeListColumnMenu { - columns?: boolean; - filterable?: boolean; - sortable?: boolean; - messages?: TreeListColumnMenuMessages; - } - - interface TreeListColumnCommandItem { - className?: string; - click?: Function; - name?: string; - text?: string; - } - - interface TreeListColumnFilterable { - ui?: string|Function; - } - - interface TreeListColumnSortable { - compare?: Function; - } - - interface TreeListColumn { - attributes?: any; - command?: TreeListColumnCommandItem[]; - encoded?: boolean; - expandable?: boolean; - field?: string; - filterable?: boolean|TreeListColumnFilterable; - footerTemplate?: string|Function; - format?: string; - headerAttributes?: any; - headerTemplate?: string|Function; - minScreenWidth?: number; - sortable?: boolean|TreeListColumnSortable; - template?: string|Function; - title?: string; - width?: string|number; - hidden?: boolean; - menu?: boolean; - locked?: boolean; - lockable?: boolean; - } - - interface TreeListEditable { - mode?: string; - move?: boolean; - template?: string|Function; - window?: any; - } - - interface TreeListExcel { - fileName?: string; - filterable?: boolean; - forceProxy?: boolean; - proxyURL?: string; - } - - interface TreeListFilterableMessages { - and?: string; - clear?: string; - filter?: string; - info?: string; - isFalse?: string; - isTrue?: string; - or?: string; - selectValue?: string; - cancel?: string; - operator?: string; - } - - interface TreeListFilterable { - extra?: boolean; - messages?: TreeListFilterableMessages; - } - - interface TreeListMessagesCommands { - canceledit?: string; - create?: string; - createchild?: string; - destroy?: string; - edit?: string; - excel?: string; - pdf?: string; - update?: string; - } - - interface TreeListMessages { - commands?: TreeListMessagesCommands; - loading?: string; - noRows?: string; - requestFailed?: string; - retry?: string; - } - - interface TreeListPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; - } - - interface TreeListPdf { - author?: string; - avoidLinks?: boolean|string; - creator?: string; - date?: Date; - fileName?: string; - forceProxy?: boolean; - keywords?: string; - landscape?: boolean; - margin?: TreeListPdfMargin; - paperSize?: string|any; - proxyURL?: string; - proxyTarget?: string; - subject?: string; - title?: string; - } - - interface TreeListSortable { - allowUnsort?: boolean; - mode?: string; - } - - interface TreeListToolbarItem { - name?: string; - text?: string; - } - - interface TreeListOptions { - name?: string; - autoBind?: boolean; - columns?: TreeListColumn[]; - resizable?: boolean; - reorderable?: boolean; - columnMenu?: boolean|TreeListColumnMenu; - dataSource?: any|any|kendo.data.TreeListDataSource; - editable?: boolean|TreeListEditable; - excel?: TreeListExcel; - filterable?: boolean|TreeListFilterable; - height?: number|string; - messages?: TreeListMessages; - pdf?: TreeListPdf; - scrollable?: boolean|any; - selectable?: boolean|string; - sortable?: boolean|TreeListSortable; - toolbar?: TreeListToolbarItem[]; - cancel?(e: TreeListCancelEvent): void; - change?(e: TreeListChangeEvent): void; - collapse?(e: TreeListCollapseEvent): void; - dataBinding?(e: TreeListDataBindingEvent): void; - dataBound?(e: TreeListDataBoundEvent): void; - dragstart?(e: TreeListDragstartEvent): void; - drag?(e: TreeListDragEvent): void; - dragend?(e: TreeListDragendEvent): void; - drop?(e: TreeListDropEvent): void; - edit?(e: TreeListEditEvent): void; - excelExport?(e: TreeListExcelExportEvent): void; - expand?(e: TreeListExpandEvent): void; - filterMenuInit?(e: TreeListFilterMenuInitEvent): void; - pdfExport?(e: TreeListPdfExportEvent): void; - remove?(e: TreeListRemoveEvent): void; - save?(e: TreeListSaveEvent): void; - columnShow?(e: TreeListColumnShowEvent): void; - columnHide?(e: TreeListColumnHideEvent): void; - columnReorder?(e: TreeListColumnReorderEvent): void; - columnResize?(e: TreeListColumnResizeEvent): void; - columnMenuInit?(e: TreeListColumnMenuInitEvent): void; - columnLock?(e: TreeListColumnLockEvent): void; - columnUnlock?(e: TreeListColumnUnlockEvent): void; - } - interface TreeListEvent { - sender: TreeList; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface TreeListCancelEvent extends TreeListEvent { - container?: JQuery; - model?: kendo.data.TreeListModel; - } - - interface TreeListChangeEvent extends TreeListEvent { - } - - interface TreeListCollapseEvent extends TreeListEvent { - model?: kendo.data.TreeListModel; - } - - interface TreeListDataBindingEvent extends TreeListEvent { - } - - interface TreeListDataBoundEvent extends TreeListEvent { - } - - interface TreeListDragstartEvent extends TreeListEvent { - source?: kendo.data.TreeListModel; - } - - interface TreeListDragEvent extends TreeListEvent { - source?: kendo.data.TreeListModel; - target?: JQuery; - } - - interface TreeListDragendEvent extends TreeListEvent { - source?: kendo.data.TreeListModel; - destination?: kendo.data.TreeListModel; - } - - interface TreeListDropEvent extends TreeListEvent { - source?: kendo.data.TreeListModel; - destination?: kendo.data.TreeListModel; - valid?: boolean; - setValid?: boolean; - } - - interface TreeListEditEvent extends TreeListEvent { - container?: JQuery; - model?: kendo.data.TreeListModel; - } - - interface TreeListExcelExportEvent extends TreeListEvent { - data?: any; - workbook?: any; - } - - interface TreeListExpandEvent extends TreeListEvent { - model?: kendo.data.TreeListModel; - } - - interface TreeListFilterMenuInitEvent extends TreeListEvent { - container?: JQuery; - field?: string; - } - - interface TreeListPdfExportEvent extends TreeListEvent { - promise?: JQueryPromise; - } - - interface TreeListRemoveEvent extends TreeListEvent { - model?: kendo.data.TreeListModel; - row?: JQuery; - } - - interface TreeListSaveEvent extends TreeListEvent { - model?: kendo.data.TreeListModel; - container?: JQuery; - } - - interface TreeListColumnShowEvent extends TreeListEvent { - column?: any; - } - - interface TreeListColumnHideEvent extends TreeListEvent { - column?: any; - } - - interface TreeListColumnReorderEvent extends TreeListEvent { - column?: any; - newIndex?: number; - oldIndex?: number; - } - - interface TreeListColumnResizeEvent extends TreeListEvent { - column?: any; - newWidth?: number; - oldWidth?: number; - } - - interface TreeListColumnMenuInitEvent extends TreeListEvent { - container?: JQuery; - field?: string; - } - - interface TreeListColumnLockEvent extends TreeListEvent { - column?: any; - } - - interface TreeListColumnUnlockEvent extends TreeListEvent { - column?: any; - } - - - class TreeView extends kendo.ui.Widget { - - static fn: TreeView; - - options: TreeViewOptions; - - dataSource: kendo.data.DataSource; - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): TreeView; - - constructor(element: Element, options?: TreeViewOptions); - - - append(nodeData: any, parentNode?: JQuery, success?: Function): JQuery; - append(nodeData: JQuery, parentNode?: JQuery, success?: Function): JQuery; - collapse(nodes: JQuery): void; - collapse(nodes: Element): void; - collapse(nodes: string): void; - dataItem(node: JQuery): kendo.data.Node; - dataItem(node: Element): kendo.data.Node; - dataItem(node: string): kendo.data.Node; - destroy(): void; - detach(node: JQuery): JQuery; - detach(node: Element): JQuery; - detach(node: string): JQuery; - enable(nodes: JQuery, enable?: boolean): void; - enable(nodes: Element, enable?: boolean): void; - enable(nodes: string, enable?: boolean): void; - expand(nodes: JQuery): void; - expand(nodes: Element): void; - expand(nodes: string): void; - expandPath(path: any, complete: Function): void; - expandTo(targetNode: kendo.data.Node): void; - expandTo(targetNode: any): void; - findByText(text: string): JQuery; - findByUid(text: string): JQuery; - insertAfter(nodeData: any, referenceNode: JQuery): void; - insertBefore(nodeData: any, referenceNode: JQuery): void; - items(): any; - parent(node: JQuery): JQuery; - parent(node: Element): JQuery; - parent(node: string): JQuery; - remove(node: JQuery): void; - remove(node: Element): void; - remove(node: string): void; - select(): JQuery; - select(node?: JQuery): void; - select(node?: Element): void; - select(node?: string): void; - setDataSource(dataSource: kendo.data.HierarchicalDataSource): void; - text(node: JQuery): string; - text(node: Element): string; - text(node: string): string; - text(node: JQuery, newText: string): void; - text(node: Element, newText: string): void; - text(node: string, newText: string): void; - toggle(node: JQuery): void; - toggle(node: Element): void; - toggle(node: string): void; - updateIndeterminate(node: JQuery): void; - - } - - interface TreeViewAnimationCollapse { - duration?: number; - effects?: string; - } - - interface TreeViewAnimationExpand { - duration?: number; - effects?: string; - } - - interface TreeViewAnimation { - collapse?: boolean|TreeViewAnimationCollapse; - expand?: boolean|TreeViewAnimationExpand; - } - - interface TreeViewCheckboxes { - checkChildren?: boolean; - name?: string; - template?: string|Function; - } - - interface TreeViewMessages { - loading?: string; - requestFailed?: string; - retry?: string; - } - - interface TreeViewOptions { - name?: string; - animation?: boolean|TreeViewAnimation; - autoBind?: boolean; - autoScroll?: boolean; - checkboxes?: boolean|TreeViewCheckboxes; - dataImageUrlField?: string; - dataSource?: any|any|kendo.data.HierarchicalDataSource; - dataSpriteCssClassField?: string; - dataTextField?: string|any; - dataUrlField?: string; - dragAndDrop?: boolean; - loadOnDemand?: boolean; - messages?: TreeViewMessages; - template?: string|Function; - change?(e: TreeViewEvent): void; - check?(e: TreeViewCheckEvent): void; - collapse?(e: TreeViewCollapseEvent): void; - dataBound?(e: TreeViewDataBoundEvent): void; - drag?(e: TreeViewDragEvent): void; - dragend?(e: TreeViewDragendEvent): void; - dragstart?(e: TreeViewDragstartEvent): void; - drop?(e: TreeViewDropEvent): void; - expand?(e: TreeViewExpandEvent): void; - navigate?(e: TreeViewNavigateEvent): void; - select?(e: TreeViewSelectEvent): void; - } - interface TreeViewEvent { - sender: TreeView; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface TreeViewCheckEvent extends TreeViewEvent { - node?: Element; - } - - interface TreeViewCollapseEvent extends TreeViewEvent { - node?: Element; - } - - interface TreeViewDataBoundEvent extends TreeViewEvent { - node?: JQuery; - } - - interface TreeViewDragEvent extends TreeViewEvent { - sourceNode?: Element; - dropTarget?: Element; - pageX?: number; - pageY?: number; - statusClass?: string; - setStatusClass?: Function; - } - - interface TreeViewDragendEvent extends TreeViewEvent { - sourceNode?: Element; - destinationNode?: Element; - dropPosition?: string; - } - - interface TreeViewDragstartEvent extends TreeViewEvent { - sourceNode?: Element; - } - - interface TreeViewDropEvent extends TreeViewEvent { - sourceNode?: Element; - destinationNode?: Element; - valid?: boolean; - setValid?: Function; - dropTarget?: Element; - dropPosition?: string; - } - - interface TreeViewExpandEvent extends TreeViewEvent { - node?: Element; - } - - interface TreeViewNavigateEvent extends TreeViewEvent { - node?: Element; - } - - interface TreeViewSelectEvent extends TreeViewEvent { - node?: Element; - } - - - class Upload extends kendo.ui.Widget { - - static fn: Upload; - - options: UploadOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Upload; - - constructor(element: Element, options?: UploadOptions); - - - destroy(): void; - disable(): void; - enable(enable?: boolean): void; - toggle(enable: boolean): void; - - } - - interface UploadAsync { - autoUpload?: boolean; - batch?: boolean; - removeField?: string; - removeUrl?: string; - removeVerb?: string; - saveField?: string; - saveUrl?: string; - withCredentials?: boolean; - } - - interface UploadFile { - extension?: string; - name?: string; - size?: number; - } - - interface UploadLocalization { - cancel?: string; - dropFilesHere?: string; - headerStatusUploaded?: string; - headerStatusUploading?: string; - remove?: string; - retry?: string; - select?: string; - statusFailed?: string; - statusUploaded?: string; - statusUploading?: string; - uploadSelectedFiles?: string; - } - - interface UploadOptions { - name?: string; - async?: UploadAsync; - enabled?: boolean; - files?: UploadFile[]; - localization?: UploadLocalization; - multiple?: boolean; - showFileList?: boolean; - template?: string|Function; - cancel?(e: UploadCancelEvent): void; - complete?(e: UploadEvent): void; - error?(e: UploadErrorEvent): void; - progress?(e: UploadProgressEvent): void; - remove?(e: UploadRemoveEvent): void; - select?(e: UploadSelectEvent): void; - success?(e: UploadSuccessEvent): void; - upload?(e: UploadUploadEvent): void; - } - interface UploadEvent { - sender: Upload; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface UploadCancelEvent extends UploadEvent { - files?: UploadFile[]; - } - - interface UploadErrorEvent extends UploadEvent { - files?: UploadFile[]; - operation?: string; - XMLHttpRequest?: any; - } - - interface UploadProgressEvent extends UploadEvent { - files?: UploadFile[]; - percentComplete?: number; - } - - interface UploadRemoveEvent extends UploadEvent { - files?: UploadFile[]; - data?: any; - } - - interface UploadSelectEvent extends UploadEvent { - e?: any; - files?: UploadFile[]; - } - - interface UploadSuccessEvent extends UploadEvent { - files?: UploadFile[]; - operation?: string; - response?: any; - XMLHttpRequest?: any; - } - - interface UploadUploadEvent extends UploadEvent { - files?: UploadFile[]; - data?: any; - formData?: any; - XMLHttpRequest?: any; - } - - - class Validator extends kendo.ui.Widget { - - static fn: Validator; - - options: ValidatorOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Validator; - - constructor(element: Element, options?: ValidatorOptions); - - - errors(): any; - hideMessages(): void; - validate(): boolean; - validateInput(input: Element): boolean; - validateInput(input: JQuery): boolean; - - } - - interface ValidatorOptions { - name?: string; - errorTemplate?: string; - messages?: any; - rules?: any; - validateOnBlur?: boolean; - validate?(e: ValidatorValidateEvent): void; - } - interface ValidatorEvent { - sender: Validator; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface ValidatorValidateEvent extends ValidatorEvent { - valid?: boolean; - } - - - class Window extends kendo.ui.Widget { - - static fn: Window; - - options: WindowOptions; - - - element: JQuery; - wrapper: JQuery; - - static extend(proto: Object): Window; - - constructor(element: Element, options?: WindowOptions); - - - center(): kendo.ui.Window; - close(): kendo.ui.Window; - content(): string; - content(content?: string): kendo.ui.Window; - content(content?: JQuery): kendo.ui.Window; - destroy(): void; - maximize(): kendo.ui.Window; - minimize(): kendo.ui.Window; - open(): kendo.ui.Window; - pin(): void; - refresh(options: any): kendo.ui.Window; - restore(): kendo.ui.Window; - setOptions(options: any): void; - title(): string; - title(text?: string): kendo.ui.Window; - toFront(): kendo.ui.Window; - toggleMaximization(): kendo.ui.Window; - unpin(): void; - - } - - interface WindowAnimationClose { - effects?: string; - duration?: number; - } - - interface WindowAnimationOpen { - effects?: string; - duration?: number; - } - - interface WindowAnimation { - close?: WindowAnimationClose; - open?: WindowAnimationOpen; - } - - interface WindowContent { - template?: string; - } - - interface WindowPosition { - top?: number|string; - left?: number|string; - } - - interface WindowRefreshOptions { - url?: string; - cache?: boolean; - data?: any; - type?: string; - template?: string; - iframe?: boolean; - } - - interface WindowOptions { - name?: string; - actions?: any; - animation?: boolean|WindowAnimation; - appendTo?: any|string; - autoFocus?: boolean; - content?: WindowContent; - draggable?: boolean; - iframe?: boolean; - height?: number|string; - maxHeight?: number; - maxWidth?: number; - minHeight?: number; - minWidth?: number; - modal?: boolean; - pinned?: boolean; - position?: WindowPosition; - resizable?: boolean; - scrollable?: boolean; - title?: string|boolean; - visible?: boolean; - width?: number|string; - activate?(e: WindowEvent): void; - close?(e: WindowCloseEvent): void; - deactivate?(e: WindowEvent): void; - dragend?(e: WindowEvent): void; - dragstart?(e: WindowEvent): void; - error?(e: WindowErrorEvent): void; - maximize?(e: WindowEvent): void; - minimize?(e: WindowEvent): void; - open?(e: WindowEvent): void; - refresh?(e: WindowEvent): void; - resize?(e: WindowEvent): void; - } - interface WindowEvent { - sender: Window; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - interface WindowCloseEvent extends WindowEvent { - userTriggered?: boolean; - } - - interface WindowErrorEvent extends WindowEvent { - xhr?: JQueryXHR; - status?: string; - } - } declare namespace kendo.dataviz.ui { @@ -8344,13 +8725,25 @@ declare namespace kendo.dataviz.ui { exportImage(options: any): JQueryPromise; exportPDF(options?: kendo.drawing.PDFOptions): JQueryPromise; exportSVG(options: any): JQueryPromise; + findAxisByName(name: string): kendo.dataviz.ChartAxis; + findPaneByIndex(index: number): kendo.dataviz.ChartPane; + findPaneByName(name: string): kendo.dataviz.ChartPane; + findSeries(callback: Function): kendo.dataviz.ChartSeries; + findSeriesByIndex(index: number): kendo.dataviz.ChartSeries; + findSeriesByName(name: string): kendo.dataviz.ChartSeries; getAxis(name: string): kendo.dataviz.ChartAxis; + hideTooltip(): void; + plotArea(): void; redraw(): void; refresh(): void; resize(force?: boolean): void; saveAsPDF(): void; setDataSource(dataSource: kendo.data.DataSource): void; setOptions(options: any): void; + showTooltip(filter: Function): void; + showTooltip(filter: number): void; + showTooltip(filter: Date): void; + showTooltip(filter: string): void; svg(): string; imageDataURL(): string; toggleHighlight(show: boolean, options: any): void; @@ -8383,6 +8776,7 @@ declare namespace kendo.dataviz.ui { interface ChartAxisDefaultsCrosshair { color?: string; + dashType?: string; opacity?: number; tooltip?: ChartAxisDefaultsCrosshairTooltip; visible?: boolean; @@ -8526,6 +8920,7 @@ declare namespace kendo.dataviz.ui { } interface ChartCategoryAxisItemAutoBaseUnitSteps { + milliseconds?: any; seconds?: any; minutes?: any; hours?: any; @@ -8561,6 +8956,7 @@ declare namespace kendo.dataviz.ui { interface ChartCategoryAxisItemCrosshair { color?: string; + dashType?: string; opacity?: number; tooltip?: ChartCategoryAxisItemCrosshairTooltip; visible?: boolean; @@ -8740,6 +9136,7 @@ declare namespace kendo.dataviz.ui { } interface ChartCategoryAxisItemNotesLine { + dashType?: string; width?: number; color?: string; length?: number; @@ -9061,7 +9458,7 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemConnectors { - color?: string; + color?: string|Function; padding?: number; width?: number; } @@ -9101,6 +9498,7 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemHighlightLine { + dashType?: string; color?: string; opacity?: number; width?: number; @@ -9286,6 +9684,7 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemNotesLine { + dashType?: string; width?: number; color?: string; length?: number; @@ -9579,6 +9978,7 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesDefaultsNotesLine { + dashType?: string; width?: number; color?: string; length?: number; @@ -9903,6 +10303,7 @@ declare namespace kendo.dataviz.ui { } interface ChartValueAxisItemNotesLine { + dashType?: string; width?: number; color?: string; length?: number; @@ -10189,6 +10590,7 @@ declare namespace kendo.dataviz.ui { } interface ChartXAxisItemNotesLine { + dashType?: string; width?: number; color?: string; length?: number; @@ -10477,6 +10879,7 @@ declare namespace kendo.dataviz.ui { } interface ChartYAxisItemNotesLine { + dashType?: string; width?: number; color?: string; length?: number; @@ -10625,17 +11028,17 @@ declare namespace kendo.dataviz.ui { yAxis?: ChartYAxisItem[]; zoomable?: boolean|ChartZoomable; axisLabelClick?(e: ChartAxisLabelClickEvent): void; - legendItemClick?(e: ChartLegendItemClickEvent): void; - legendItemHover?(e: ChartLegendItemHoverEvent): void; dataBound?(e: ChartDataBoundEvent): void; drag?(e: ChartDragEvent): void; dragEnd?(e: ChartDragEndEvent): void; dragStart?(e: ChartDragStartEvent): void; + legendItemClick?(e: ChartLegendItemClickEvent): void; + legendItemHover?(e: ChartLegendItemHoverEvent): void; noteClick?(e: ChartNoteClickEvent): void; noteHover?(e: ChartNoteHoverEvent): void; plotAreaClick?(e: ChartPlotAreaClickEvent): void; plotAreaHover?(e: ChartPlotAreaHoverEvent): void; - render?(e: ChartEvent): void; + render?(e: ChartRenderEvent): void; select?(e: ChartSelectEvent): void; selectEnd?(e: ChartSelectEndEvent): void; selectStart?(e: ChartSelectStartEvent): void; @@ -10660,22 +11063,6 @@ declare namespace kendo.dataviz.ui { value?: any; } - interface ChartLegendItemClickEvent extends ChartEvent { - text?: string; - series?: any; - seriesIndex?: number; - pointIndex?: number; - element?: any; - } - - interface ChartLegendItemHoverEvent extends ChartEvent { - text?: string; - series?: any; - seriesIndex?: number; - pointIndex?: number; - element?: any; - } - interface ChartDataBoundEvent extends ChartEvent { } @@ -10694,21 +11081,37 @@ declare namespace kendo.dataviz.ui { originalEvent?: any; } + interface ChartLegendItemClickEvent extends ChartEvent { + pointIndex?: number; + series?: any; + seriesIndex?: number; + text?: string; + element?: any; + } + + interface ChartLegendItemHoverEvent extends ChartEvent { + element?: any; + pointIndex?: number; + series?: any; + seriesIndex?: number; + text?: string; + } + interface ChartNoteClickEvent extends ChartEvent { category?: any; - element?: any; - value?: any; - series?: any; dataItem?: any; + element?: any; + series?: any; + value?: any; visual?: any; } interface ChartNoteHoverEvent extends ChartEvent { category?: any; - element?: any; - value?: any; - series?: any; dataItem?: any; + element?: any; + series?: any; + value?: any; visual?: any; } @@ -10730,6 +11133,9 @@ declare namespace kendo.dataviz.ui { y?: any; } + interface ChartRenderEvent extends ChartEvent { + } + interface ChartSelectEvent extends ChartEvent { axis?: any; from?: any; @@ -10750,23 +11156,25 @@ declare namespace kendo.dataviz.ui { interface ChartSeriesClickEvent extends ChartEvent { category?: any; + dataItem?: any; element?: any; originalEvent?: any; - series?: ChartSeriesClickEventSeries; - dataItem?: any; - value?: any; percentage?: any; + series?: ChartSeriesClickEventSeries; + stackValue?: any; + value?: any; } interface ChartSeriesHoverEvent extends ChartEvent { category?: any; categoryPoints?: any; + dataItem?: any; element?: any; originalEvent?: any; - series?: ChartSeriesHoverEventSeries; - dataItem?: any; - value?: any; percentage?: any; + series?: ChartSeriesHoverEventSeries; + stackValue?: any; + value?: any; } interface ChartZoomEvent extends ChartEvent { @@ -11219,6 +11627,7 @@ declare namespace kendo.dataviz.ui { interface DiagramSelectable { key?: string; + multiple?: boolean; stroke?: DiagramSelectableStroke; } @@ -12401,7 +12810,7 @@ declare namespace kendo.dataviz.ui { constructor(element: Element, options?: RadialGaugeOptions); - allValues(values: any): any; + allValues(values?: any): any; destroy(): void; exportImage(options: any): JQueryPromise; exportPDF(options?: kendo.drawing.PDFOptions): JQueryPromise; @@ -13467,6 +13876,7 @@ declare namespace kendo.dataviz.ui { options: StockChartOptions; dataSource: kendo.data.DataSource; + navigator: kendo.dataviz.Navigator; element: JQuery; wrapper: JQuery; @@ -13484,6 +13894,7 @@ declare namespace kendo.dataviz.ui { refresh(): void; resize(force?: boolean): void; setDataSource(dataSource: kendo.data.DataSource): void; + setOptions(options: any): void; svg(): string; imageDataURL(): string; @@ -13694,8 +14105,8 @@ declare namespace kendo.dataviz.ui { } interface StockChartCategoryAxisItemSelect { - from?: any; - to?: any; + from?: string|Date; + to?: string|Date; min?: any; max?: any; mousewheel?: StockChartCategoryAxisItemSelectMousewheel; @@ -14165,8 +14576,14 @@ declare namespace kendo.dataviz.ui { title?: StockChartNavigatorPaneTitle; } + interface StockChartNavigatorSelectMousewheel { + reverse?: boolean; + zoom?: string; + } + interface StockChartNavigatorSelect { from?: Date; + mousewheel?: boolean|StockChartNavigatorSelectMousewheel; to?: Date; } @@ -14940,25 +15357,25 @@ declare namespace kendo.dataviz.ui { transitions?: boolean; valueAxis?: StockChartValueAxisItem[]; axisLabelClick?(e: StockChartAxisLabelClickEvent): void; - legendItemClick?(e: StockChartLegendItemClickEvent): void; - legendItemHover?(e: StockChartLegendItemHoverEvent): void; dataBound?(e: StockChartEvent): void; dragStart?(e: StockChartDragStartEvent): void; drag?(e: StockChartDragEvent): void; dragEnd?(e: StockChartDragEndEvent): void; + legendItemClick?(e: StockChartLegendItemClickEvent): void; + legendItemHover?(e: StockChartLegendItemHoverEvent): void; noteClick?(e: StockChartNoteClickEvent): void; noteHover?(e: StockChartNoteHoverEvent): void; plotAreaClick?(e: StockChartPlotAreaClickEvent): void; plotAreaHover?(e: StockChartPlotAreaHoverEvent): void; - render?(e: StockChartEvent): void; + render?(e: StockChartRenderEvent): void; + select?(e: StockChartSelectEvent): void; + selectEnd?(e: StockChartSelectEndEvent): void; + selectStart?(e: StockChartSelectStartEvent): void; seriesClick?(e: StockChartSeriesClickEvent): void; seriesHover?(e: StockChartSeriesHoverEvent): void; zoomStart?(e: StockChartZoomStartEvent): void; zoom?(e: StockChartZoomEvent): void; zoomEnd?(e: StockChartZoomEndEvent): void; - selectStart?(e: StockChartSelectStartEvent): void; - select?(e: StockChartSelectEvent): void; - selectEnd?(e: StockChartSelectEndEvent): void; } interface StockChartEvent { sender: StockChart; @@ -14975,6 +15392,21 @@ declare namespace kendo.dataviz.ui { element?: any; } + interface StockChartDragStartEvent extends StockChartEvent { + axisRanges?: any; + originalEvent?: any; + } + + interface StockChartDragEvent extends StockChartEvent { + axisRanges?: any; + originalEvent?: any; + } + + interface StockChartDragEndEvent extends StockChartEvent { + axisRanges?: any; + originalEvent?: any; + } + interface StockChartLegendItemClickEvent extends StockChartEvent { text?: string; series?: any; @@ -14991,21 +15423,6 @@ declare namespace kendo.dataviz.ui { element?: any; } - interface StockChartDragStartEvent extends StockChartEvent { - axisRanges?: any; - originalEvent?: any; - } - - interface StockChartDragEvent extends StockChartEvent { - axisRanges?: any; - originalEvent?: any; - } - - interface StockChartDragEndEvent extends StockChartEvent { - axisRanges?: any; - originalEvent?: any; - } - interface StockChartNoteClickEvent extends StockChartEvent { category?: any; element?: any; @@ -15039,6 +15456,27 @@ declare namespace kendo.dataviz.ui { y?: any; } + interface StockChartRenderEvent extends StockChartEvent { + } + + interface StockChartSelectEvent extends StockChartEvent { + axis?: any; + from?: Date; + to?: Date; + } + + interface StockChartSelectEndEvent extends StockChartEvent { + axis?: any; + from?: Date; + to?: Date; + } + + interface StockChartSelectStartEvent extends StockChartEvent { + axis?: any; + from?: Date; + to?: Date; + } + interface StockChartSeriesClickEvent extends StockChartEvent { value?: any; category?: any; @@ -15073,24 +15511,6 @@ declare namespace kendo.dataviz.ui { originalEvent?: any; } - interface StockChartSelectStartEvent extends StockChartEvent { - axis?: any; - from?: any; - to?: any; - } - - interface StockChartSelectEvent extends StockChartEvent { - axis?: any; - from?: any; - to?: any; - } - - interface StockChartSelectEndEvent extends StockChartEvent { - axis?: any; - from?: any; - to?: any; - } - class TreeMap extends kendo.ui.Widget { @@ -15433,6 +15853,8 @@ declare namespace kendo.dataviz { slot(from: Date, to?: string, limit?: boolean): kendo.geometry.Rect; slot(from: Date, to?: number, limit?: boolean): kendo.geometry.Rect; slot(from: Date, to?: Date, limit?: boolean): kendo.geometry.Rect; + value(point: kendo.geometry.Point): void; + valueRange(): void; } @@ -15446,6 +15868,133 @@ declare namespace kendo.dataviz { } + class ChartPane extends Observable { + + + options: ChartPaneOptions; + + chartsVisual: kendo.drawing.Group; + visual: kendo.drawing.Group; + + + + series(): any; + + } + + interface ChartPaneOptions { + name?: string; + } + interface ChartPaneEvent { + sender: ChartPane; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class ChartPlotArea extends Observable { + + + options: ChartPlotAreaOptions; + + backgroundVisual: kendo.drawing.MultiPath; + visual: kendo.drawing.Group; + + + + + } + + interface ChartPlotAreaOptions { + name?: string; + } + interface ChartPlotAreaEvent { + sender: ChartPlotArea; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class ChartPoint extends Observable { + + + options: ChartPointOptions; + + category: string|Date|number; + dataItem: any; + percentage: number; + runningTotal: number; + total: number; + value: number; + visual: kendo.drawing.Element; + + + + + } + + interface ChartPointOptions { + name?: string; + } + interface ChartPointEvent { + sender: ChartPoint; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class ChartSeries extends Observable { + + + options: ChartSeriesOptions; + + + + + data(): any; + data(data: any): void; + findPoint(callback: Function): kendo.dataviz.ChartPoint; + points(): any; + points(filter: Function): void; + toggleHighlight(show: boolean, filter: Function): void; + toggleHighlight(show: boolean, filter: any): void; + toggleVisibility(show: boolean, filter: Function): void; + + } + + interface ChartSeriesOptions { + name?: string; + } + interface ChartSeriesEvent { + sender: ChartSeries; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Navigator extends kendo.Observable { + + + options: NavigatorOptions; + + + + + select(): any; + select(): void; + + } + + interface NavigatorOptions { + name?: string; + } + interface NavigatorEvent { + sender: Navigator; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + } declare namespace kendo.dataviz.diagram { class Circle extends Observable { @@ -16361,6 +16910,7 @@ declare namespace kendo { function transformOrigin(firstElement: HTMLElement, secondElement: HTMLElement): any; } + function alert(text: string): void; function antiForgeryTokens(): any; function bind(element: string, viewModel: any, namespace?: any): void; function bind(element: string, viewModel: kendo.data.ObservableObject, namespace?: any): void; @@ -16369,6 +16919,7 @@ declare namespace kendo { function bind(element: Element, viewModel: any, namespace?: any): void; function bind(element: Element, viewModel: kendo.data.ObservableObject, namespace?: any): void; function observableHierarchy(array: any): void; + function confirm(text: string): void; function culture(culture: string): void; function destroy(element: string): void; function destroy(element: JQuery): void; @@ -16379,6 +16930,7 @@ declare namespace kendo { function parseFloat(value: string, culture?: string): number; function parseInt(value: string, culture?: string): number; function parseColor(color: string, noerror: boolean): kendo.Color; + function prompt(text: string, defaultValue: string): void; function proxyModelSetters(): void; function proxyModelSetters(data: kendo.data.Model): void; function resize(element: string, force: boolean): void; @@ -16557,7 +17109,7 @@ declare namespace kendo.spreadsheet { selection(): kendo.spreadsheet.Range; setDataSource(dataSource: kendo.data.DataSource, columns?: any): void; showGridLines(): boolean; - showGridLines(showGridLiens?: boolean): void; + showGridLines(showGridLines?: boolean): void; toJSON(): void; unhideColumn(index: number): void; unhideRow(index: number): void; @@ -17712,272 +18264,6 @@ declare namespace kendo.ooxml { } -declare namespace kendo.dataviz.geometry { - class Arc extends Observable { - - - options: ArcOptions; - - anticlockwise: boolean; - center: kendo.geometry.Point; - endAngle: number; - radiusX: number; - radiusY: number; - startAngle: number; - - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - getAnticlockwise(): boolean; - getCenter(): kendo.geometry.Point; - getEndAngle(): number; - getRadiusX(): number; - getRadiusY(): number; - getStartAngle(): number; - pointAt(angle: number): kendo.geometry.Point; - setAnticlockwise(value: boolean): kendo.geometry.Arc; - setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; - setEndAngle(value: number): kendo.geometry.Arc; - setRadiusX(value: number): kendo.geometry.Arc; - setRadiusY(value: number): kendo.geometry.Arc; - setStartAngle(value: number): kendo.geometry.Arc; - - } - - interface ArcOptions { - name?: string; - } - interface ArcEvent { - sender: Arc; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Circle extends Observable { - - - options: CircleOptions; - - center: kendo.geometry.Point; - radius: number; - - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - clone(): kendo.geometry.Circle; - equals(other: kendo.geometry.Circle): boolean; - getCenter(): kendo.geometry.Point; - getRadius(): number; - pointAt(angle: number): kendo.geometry.Point; - setCenter(value: kendo.geometry.Point): kendo.geometry.Point; - setCenter(value: any): kendo.geometry.Point; - setRadius(value: number): kendo.geometry.Circle; - - } - - interface CircleOptions { - name?: string; - } - interface CircleEvent { - sender: Circle; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Matrix extends Observable { - - - options: MatrixOptions; - - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - - - static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; - static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; - static translate(x: number, y: number): kendo.geometry.Matrix; - static unit(): kendo.geometry.Matrix; - - clone(): kendo.geometry.Matrix; - equals(other: kendo.geometry.Matrix): boolean; - round(digits: number): kendo.geometry.Matrix; - multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - - } - - interface MatrixOptions { - name?: string; - } - interface MatrixEvent { - sender: Matrix; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Point extends Observable { - - - options: PointOptions; - - x: number; - y: number; - - constructor(x: number, y: number); - - static create(x: number, y: number): kendo.geometry.Point; - static create(x: any, y: number): kendo.geometry.Point; - static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; - static min(): kendo.geometry.Point; - static max(): kendo.geometry.Point; - static minPoint(): kendo.geometry.Point; - static maxPoint(): kendo.geometry.Point; - - clone(): kendo.geometry.Point; - distanceTo(point: kendo.geometry.Point): number; - equals(other: kendo.geometry.Point): boolean; - getX(): number; - getY(): number; - move(x: number, y: number): kendo.geometry.Point; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; - rotate(angle: number, center: any): kendo.geometry.Point; - round(digits: number): kendo.geometry.Point; - scale(scaleX: number, scaleY: number): kendo.geometry.Point; - scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; - setX(value: number): kendo.geometry.Point; - setY(value: number): kendo.geometry.Point; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - translate(dx: number, dy: number): kendo.geometry.Point; - translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; - translateWith(vector: any): kendo.geometry.Point; - - } - - interface PointOptions { - name?: string; - } - interface PointEvent { - sender: Point; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Rect extends Observable { - - - options: RectOptions; - - origin: kendo.geometry.Point; - size: kendo.geometry.Size; - - constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); - - static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; - static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - bottomLeft(): kendo.geometry.Point; - bottomRight(): kendo.geometry.Point; - center(): kendo.geometry.Point; - clone(): kendo.geometry.Rect; - equals(other: kendo.geometry.Rect): boolean; - getOrigin(): kendo.geometry.Point; - getSize(): kendo.geometry.Size; - height(): number; - setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; - setOrigin(value: any): kendo.geometry.Rect; - setSize(value: kendo.geometry.Size): kendo.geometry.Rect; - setSize(value: any): kendo.geometry.Rect; - topLeft(): kendo.geometry.Point; - topRight(): kendo.geometry.Point; - width(): number; - - } - - interface RectOptions { - name?: string; - } - interface RectEvent { - sender: Rect; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Size extends Observable { - - - options: SizeOptions; - - width: number; - height: number; - - - static create(width: number, height: number): kendo.geometry.Size; - static create(width: any, height: number): kendo.geometry.Size; - static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; - - clone(): kendo.geometry.Size; - equals(other: kendo.geometry.Size): boolean; - getWidth(): number; - getHeight(): number; - setWidth(value: number): kendo.geometry.Size; - setHeight(value: number): kendo.geometry.Size; - - } - - interface SizeOptions { - name?: string; - } - interface SizeEvent { - sender: Size; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Transformation extends Observable { - - - options: TransformationOptions; - - - - - clone(): kendo.geometry.Transformation; - equals(other: kendo.geometry.Transformation): boolean; - matrix(): kendo.geometry.Matrix; - multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; - rotate(angle: number, center: any): kendo.geometry.Transformation; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; - scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; - translate(x: number, y: number): kendo.geometry.Transformation; - - } - - interface TransformationOptions { - name?: string; - } - interface TransformationEvent { - sender: Transformation; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - -} declare namespace kendo.dataviz.drawing { class Arc extends kendo.drawing.Element { @@ -18767,12 +19053,283 @@ declare namespace kendo.dataviz.drawing { +} +declare namespace kendo.dataviz.geometry { + class Arc extends Observable { + + + options: ArcOptions; + + anticlockwise: boolean; + center: kendo.geometry.Point; + endAngle: number; + radiusX: number; + radiusY: number; + startAngle: number; + + constructor(center: any|kendo.geometry.Point, options?: ArcOptions); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + getAnticlockwise(): boolean; + getCenter(): kendo.geometry.Point; + getEndAngle(): number; + getRadiusX(): number; + getRadiusY(): number; + getStartAngle(): number; + pointAt(angle: number): kendo.geometry.Point; + setAnticlockwise(value: boolean): kendo.geometry.Arc; + setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; + setEndAngle(value: number): kendo.geometry.Arc; + setRadiusX(value: number): kendo.geometry.Arc; + setRadiusY(value: number): kendo.geometry.Arc; + setStartAngle(value: number): kendo.geometry.Arc; + + } + + interface ArcOptions { + name?: string; + } + interface ArcEvent { + sender: Arc; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Circle extends Observable { + + + options: CircleOptions; + + center: kendo.geometry.Point; + radius: number; + + constructor(center: any|kendo.geometry.Point, radius: number); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + clone(): kendo.geometry.Circle; + equals(other: kendo.geometry.Circle): boolean; + getCenter(): kendo.geometry.Point; + getRadius(): number; + pointAt(angle: number): kendo.geometry.Point; + setCenter(value: kendo.geometry.Point): kendo.geometry.Point; + setCenter(value: any): kendo.geometry.Point; + setRadius(value: number): kendo.geometry.Circle; + + } + + interface CircleOptions { + name?: string; + } + interface CircleEvent { + sender: Circle; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Matrix extends Observable { + + + options: MatrixOptions; + + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + + + static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; + static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; + static translate(x: number, y: number): kendo.geometry.Matrix; + static unit(): kendo.geometry.Matrix; + + clone(): kendo.geometry.Matrix; + equals(other: kendo.geometry.Matrix): boolean; + round(digits: number): kendo.geometry.Matrix; + multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + + } + + interface MatrixOptions { + name?: string; + } + interface MatrixEvent { + sender: Matrix; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Point extends Observable { + + + options: PointOptions; + + x: number; + y: number; + + constructor(x: number, y: number); + + static create(x: number, y: number): kendo.geometry.Point; + static create(x: any, y: number): kendo.geometry.Point; + static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; + static min(): kendo.geometry.Point; + static max(): kendo.geometry.Point; + static minPoint(): kendo.geometry.Point; + static maxPoint(): kendo.geometry.Point; + + clone(): kendo.geometry.Point; + distanceTo(point: kendo.geometry.Point): number; + equals(other: kendo.geometry.Point): boolean; + getX(): number; + getY(): number; + move(x: number, y: number): kendo.geometry.Point; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; + rotate(angle: number, center: any): kendo.geometry.Point; + round(digits: number): kendo.geometry.Point; + scale(scaleX: number, scaleY: number): kendo.geometry.Point; + scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; + setX(value: number): kendo.geometry.Point; + setY(value: number): kendo.geometry.Point; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + translate(dx: number, dy: number): kendo.geometry.Point; + translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; + translateWith(vector: any): kendo.geometry.Point; + + } + + interface PointOptions { + name?: string; + } + interface PointEvent { + sender: Point; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Rect extends Observable { + + + options: RectOptions; + + origin: kendo.geometry.Point; + size: kendo.geometry.Size; + + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); + + static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; + static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + bottomLeft(): kendo.geometry.Point; + bottomRight(): kendo.geometry.Point; + center(): kendo.geometry.Point; + clone(): kendo.geometry.Rect; + equals(other: kendo.geometry.Rect): boolean; + getOrigin(): kendo.geometry.Point; + getSize(): kendo.geometry.Size; + height(): number; + setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; + setOrigin(value: any): kendo.geometry.Rect; + setSize(value: kendo.geometry.Size): kendo.geometry.Rect; + setSize(value: any): kendo.geometry.Rect; + topLeft(): kendo.geometry.Point; + topRight(): kendo.geometry.Point; + width(): number; + + } + + interface RectOptions { + name?: string; + } + interface RectEvent { + sender: Rect; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Size extends Observable { + + + options: SizeOptions; + + width: number; + height: number; + + + static create(width: number, height: number): kendo.geometry.Size; + static create(width: any, height: number): kendo.geometry.Size; + static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; + + clone(): kendo.geometry.Size; + equals(other: kendo.geometry.Size): boolean; + getWidth(): number; + getHeight(): number; + setWidth(value: number): kendo.geometry.Size; + setHeight(value: number): kendo.geometry.Size; + + } + + interface SizeOptions { + name?: string; + } + interface SizeEvent { + sender: Size; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Transformation extends Observable { + + + options: TransformationOptions; + + + + + clone(): kendo.geometry.Transformation; + equals(other: kendo.geometry.Transformation): boolean; + matrix(): kendo.geometry.Matrix; + multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; + rotate(angle: number, center: any): kendo.geometry.Transformation; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; + scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; + translate(x: number, y: number): kendo.geometry.Transformation; + + } + + interface TransformationOptions { + name?: string; + } + interface TransformationEvent { + sender: Transformation; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + } interface HTMLElement { kendoBindingTarget: kendo.data.BindingTarget; } +interface JQueryAjaxSettings { +} + interface JQueryXHR { } @@ -18795,6 +19352,10 @@ interface JQuery { data(key: any): any; + kendoAlert(): JQuery; + kendoAlert(options: kendo.ui.AlertOptions): JQuery; + data(key: "kendoAlert"): kendo.ui.Alert; + kendoAutoComplete(): JQuery; kendoAutoComplete(options: kendo.ui.AutoCompleteOptions): JQuery; data(key: "kendoAutoComplete"): kendo.ui.AutoComplete; @@ -18827,6 +19388,10 @@ interface JQuery { kendoComboBox(options: kendo.ui.ComboBoxOptions): JQuery; data(key: "kendoComboBox"): kendo.ui.ComboBox; + kendoConfirm(): JQuery; + kendoConfirm(options: kendo.ui.ConfirmOptions): JQuery; + data(key: "kendoConfirm"): kendo.ui.Confirm; + kendoContextMenu(): JQuery; kendoContextMenu(options: kendo.ui.ContextMenuOptions): JQuery; data(key: "kendoContextMenu"): kendo.ui.ContextMenu; @@ -18843,6 +19408,10 @@ interface JQuery { kendoDiagram(options: kendo.dataviz.ui.DiagramOptions): JQuery; data(key: "kendoDiagram"): kendo.dataviz.ui.Diagram; + kendoDialog(): JQuery; + kendoDialog(options: kendo.ui.DialogOptions): JQuery; + data(key: "kendoDialog"): kendo.ui.Dialog; + kendoDropDownList(): JQuery; kendoDropDownList(options: kendo.ui.DropDownListOptions): JQuery; data(key: "kendoDropDownList"): kendo.ui.DropDownList; @@ -18883,6 +19452,10 @@ interface JQuery { kendoMaskedTextBox(options: kendo.ui.MaskedTextBoxOptions): JQuery; data(key: "kendoMaskedTextBox"): kendo.ui.MaskedTextBox; + kendoMediaPlayer(): JQuery; + kendoMediaPlayer(options: kendo.ui.MediaPlayerOptions): JQuery; + data(key: "kendoMediaPlayer"): kendo.ui.MediaPlayer; + kendoMenu(): JQuery; kendoMenu(options: kendo.ui.MenuOptions): JQuery; data(key: "kendoMenu"): kendo.ui.Menu; @@ -19003,6 +19576,10 @@ interface JQuery { kendoProgressBar(options: kendo.ui.ProgressBarOptions): JQuery; data(key: "kendoProgressBar"): kendo.ui.ProgressBar; + kendoPrompt(): JQuery; + kendoPrompt(options: kendo.ui.PromptOptions): JQuery; + data(key: "kendoPrompt"): kendo.ui.Prompt; + kendoQRCode(): JQuery; kendoQRCode(options: kendo.dataviz.ui.QRCodeOptions): JQuery; data(key: "kendoQRCode"): kendo.dataviz.ui.QRCode; From 31615b47bb65add19c9e249d46d96fce349627b7 Mon Sep 17 00:00:00 2001 From: jmvtrinidad Date: Fri, 23 Sep 2016 19:53:38 +0800 Subject: [PATCH 05/28] add ko es5 methods. (#11369) * add ko es5 methods. * Specify return type --- knockout.es5/knockout.es5.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/knockout.es5/knockout.es5.d.ts b/knockout.es5/knockout.es5.d.ts index 10e0054bf6..2f0576868d 100644 --- a/knockout.es5/knockout.es5.d.ts +++ b/knockout.es5/knockout.es5.d.ts @@ -12,6 +12,13 @@ interface KnockoutStatic { defineProperty(obj: T, propertyName: string, options: KnockoutDefinePropertyOptions): T; getObservable(obj: any, propertyName: string): KnockoutObservable; valueHasMutated(obj: any, propertyName: string): void; + es5: KnockoutEs5; +} + +interface KnockoutEs5 { + getAllObservablesForObject(obj: T, createIfNotDefined?: boolean): T; + notifyWhenPresentOrFutureArrayValuesMutate(ko: KnockoutStatic, observable: KnockoutObservable): void; + isTracked(obj: T, propertyName: string): boolean; } interface KnockoutDefinePropertyOptions { From 1d3e9d0851c1524c5c0d919b208dd93def1ae3f7 Mon Sep 17 00:00:00 2001 From: Gert Braspenning Date: Fri, 23 Sep 2016 14:26:57 +0200 Subject: [PATCH 06/28] Added typings for d3-tip (#11420) --- d3-tip/d3-tip-tests.ts | 53 ++++++++++++++++++++++++++++++++++++++++++ d3-tip/d3-tip.d.ts | 40 +++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 d3-tip/d3-tip-tests.ts create mode 100644 d3-tip/d3-tip.d.ts diff --git a/d3-tip/d3-tip-tests.ts b/d3-tip/d3-tip-tests.ts new file mode 100644 index 0000000000..aa5e9b179c --- /dev/null +++ b/d3-tip/d3-tip-tests.ts @@ -0,0 +1,53 @@ +/// +/// + +// test variables + +interface dataType { + Title: string, + Number: number +} + +let data: dataType[] = [ { Title: "one", Number: 1 }, { Title: "two", Number: 2} ]; +let svgElement: SVGElement; +let root: HTMLElement; + +// start tests + +let d3tip: d3.Tooltip = d3.tip(); + +d3tip = d3tip.hide(); + +d3tip = d3tip.show(); +d3tip = d3tip.show(data); +d3tip = d3tip.show(svgElement); +d3tip = d3tip.show(data, svgElement); + +let attributeValue: string = d3tip.attr("library"); +d3tip = d3tip.attr("library","d3"); +d3tip = d3tip.attr("library", (d, i, o) => (d as dataType).Title); +d3tip = d3tip.attr("library", (d, i, o) => d.Title); + +let styleValue: string = d3tip.style("library"); +d3tip = d3tip.style("library","d3"); +d3tip = d3tip.style("library", (d, i, o) => (d as dataType).Title); +d3tip = d3tip.style("library", (d, i, o) => d.Title); + +let offsetValue: [number, number] = d3tip.offset(); +d3tip = d3tip.offset([-1, -1]); +d3tip = d3tip.offset((d, i, o) => [-1, -1]); + +let directionValue: ("n" | "s" | "e" | "w" | "nw" | "ne" | "sw" | "se") = d3tip.direction(); +d3tip = d3tip.direction("n"); +d3tip = d3tip.direction((d, i ,o) => "n"); + +let htmlValue: string = d3tip.html(); +d3tip = d3tip.html(""); +d3tip = d3tip.html((d, i ,o) => ""); + +let rootElementValue: HTMLElement = d3tip.rootElement(); +d3tip = d3tip.rootElement(root); +d3tip = d3tip.rootElement((d, i ,o) => root); + +d3tip = d3tip.destroy(); + diff --git a/d3-tip/d3-tip.d.ts b/d3-tip/d3-tip.d.ts new file mode 100644 index 0000000000..08f0d37f5f --- /dev/null +++ b/d3-tip/d3-tip.d.ts @@ -0,0 +1,40 @@ +// Type definitions for d3-tip +// Project: https://github.com/Caged/d3-tip +// Definitions by: Gert Braspenning +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace d3 { + type TooltipDirection = ("n" | "s" | "e" | "w" | "nw" | "ne" | "sw" | "se"); + interface Tooltip { + hide(): Tooltip; + show(): Tooltip; + show(data: Datum[]): Tooltip; + show(target: SVGElement): Tooltip; + show(data: Datum[], target: SVGElement): Tooltip; + attr(name: string): string; + attr(name: string, value: Primitive): Tooltip; + attr(name: string, value: (datum: Datum, index: number, outerIndex: number) => Primitive): Tooltip; + attr(obj: { [key: string]: Primitive | ((datum: Datum, index: number, outerIndex: number) => Primitive) }): Tooltip; + style(name: string): string; + style(name: string, value: Primitive, priority?: string): Tooltip; + style(name: string, value: (datum: Datum, index: number, outerIndex: number) => Primitive, priority?: string): Tooltip; + style(obj: { [key: string]: Primitive | ((datum: Datum, index: number, outerIndex: number) => Primitive) }, priority?: string): Tooltip; + offset(): [number, number]; + offset(tuple: [number, number]): Tooltip; + offset(func: (datum: Datum, index: number, outerIndex: number) => [number, number]): Tooltip; + direction(): TooltipDirection; + direction(direction: TooltipDirection): Tooltip; + direction(func: (datum: Datum, index: number, outerIndex: number) => TooltipDirection): Tooltip; + html(): string; + html(content: string): Tooltip; + html(func: (datum: Datum, index: number, outerIndex: number) => string): Tooltip; + rootElement(): HTMLElement; + rootElement(element: HTMLElement): Tooltip; + rootElement(func: (datum: Datum, index: number, outerIndex: number) => HTMLElement): Tooltip; + destroy(): Tooltip; + } + export function tip(): Tooltip; +} + From 964424bd7eb46b382a4661f5e62c6b242d17a99f Mon Sep 17 00:00:00 2001 From: Artur Eshenbrener Date: Fri, 23 Sep 2016 16:27:31 +0400 Subject: [PATCH 07/28] knex: add `withSchema` method definition (#11421) As documented here: http://knexjs.org/#Schema-withSchema, this commit adds `withSchema` method to `SchemaBuilder` interface --- knex/knex-tests.ts | 2 ++ knex/knex.d.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/knex/knex-tests.ts b/knex/knex-tests.ts index e811e417cd..a822149821 100644 --- a/knex/knex-tests.ts +++ b/knex/knex-tests.ts @@ -414,6 +414,8 @@ knex.transaction(function(trx) { console.error(error); }); +knex.schema.withSchema("public").hasTable("table") as Promise; + knex.schema.createTable('users', function (table) { table.increments(); table.string('name'); diff --git a/knex/knex.d.ts b/knex/knex.d.ts index 67dbfb17d7..6fd81b455f 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -347,6 +347,7 @@ declare module "knex" { table(tableName: string, callback: (tableBuilder: AlterTableBuilder) => any): Promise; dropTableIfExists(tableName: string): Promise; raw(statement: string): SchemaBuilder; + withSchema(schemaName: string): SchemaBuilder; } interface TableBuilder { From 1bd8a1e36603d8c021c54f7ac3e8935e9a2cdc45 Mon Sep 17 00:00:00 2001 From: Artur Eshenbrener Date: Fri, 23 Sep 2016 16:41:17 +0400 Subject: [PATCH 08/28] knex: type knex.fn helper (#11422) As stated in sources, knex.fn contains only one function, `now()`, which returns `Raw`. As stated in documentation, `Raw` could be used as any value in query builder, so, this commit includes 2 changes: 1. Add `Raw` as one of case for type `Value`; 2. Introduce `FunctionHelper` interface (as in original source), which is returned by `knex.fn`. https://github.com/tgriesser/knex/blob/master/src/functionhelper.js http://knexjs.org/#Schema-timestamp (see Example section) --- knex/knex-tests.ts | 1 + knex/knex.d.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/knex/knex-tests.ts b/knex/knex-tests.ts index a822149821..7ec53cbe3b 100644 --- a/knex/knex-tests.ts +++ b/knex/knex-tests.ts @@ -421,6 +421,7 @@ knex.schema.createTable('users', function (table) { table.string('name'); table.enu('favorite_color', ['red', 'blue', 'green']); table.timestamps(); + table.timestamp('created_at').defaultTo(knex.fn.now()); }); knex.schema.renameTable('users', 'old_users'); diff --git a/knex/knex.d.ts b/knex/knex.d.ts index 6fd81b455f..9a16d3afc0 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -12,7 +12,7 @@ declare module "knex" { type Callback = Function; type Client = Function; - type Value = string|number|boolean|Date|Array|Array|Array|Array|Buffer; + type Value = string|number|boolean|Date|Array|Array|Array|Array|Buffer|Knex.Raw; type ColumnName = string|Knex.Raw|Knex.QueryBuilder; type TableName = string|Knex.Raw|Knex.QueryBuilder; @@ -31,7 +31,7 @@ declare module "knex" { client: any; migrate: Knex.Migrator; seed: any; - fn: any; + fn: Knex.FunctionHelper; on(eventName: string, callback: Function): Knex.QueryBuilder; } @@ -546,6 +546,10 @@ declare module "knex" { status(config?: MigratorConfig):Promise; currentVersion(config?: MigratorConfig):Promise; } + + interface FunctionHelper { + now(): Raw; + } } export = Knex; From e971807506704d71ef6edaf10c09d96d77965a90 Mon Sep 17 00:00:00 2001 From: Arman Dezfuli-Arjomandi Date: Fri, 23 Sep 2016 08:42:21 -0400 Subject: [PATCH 09/28] Add strokeLinejoin prop to in react.d.ts (#11418) * Add strokeLinejoin prop to in react.d.ts * String literal types for strokeLinecap and strokeLinejoin --- react/react.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/react/react.d.ts b/react/react.d.ts index 30ab2db256..2f762e0974 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -2104,7 +2104,8 @@ declare namespace __React { stopOpacity?: number | string; stroke?: string; strokeDasharray?: string; - strokeLinecap?: string; + strokeLinecap?: "butt" | "round" | "square" | "inherit"; + strokeLinejoin?: "miter" | "round" | "bevel" | "inherit"; strokeMiterlimit?: string; strokeOpacity?: number | string; strokeWidth?: number | string; From 7007fddc5efd6573eee2bbb6ed526ff967e814c8 Mon Sep 17 00:00:00 2001 From: Artur Eshenbrener Date: Fri, 23 Sep 2016 16:43:52 +0400 Subject: [PATCH 10/28] [express]: RequestHandler's 3rd argument fix (#11288) * [express]: RequestHandler's 3rd argument fix It is hot optional. Btw, express instance itself is a request handler, which can be invoked without 3rd argument, so, as for now it has call signature with only 2 arguments: request and response. Fixes #11164 * Move 2-args call signature to Application interface --- express-serve-static-core/express-serve-static-core.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/express-serve-static-core/express-serve-static-core.d.ts b/express-serve-static-core/express-serve-static-core.d.ts index 624ed5ae5d..0371c2bb6a 100644 --- a/express-serve-static-core/express-serve-static-core.d.ts +++ b/express-serve-static-core/express-serve-static-core.d.ts @@ -22,7 +22,7 @@ declare module "express-serve-static-core" { } interface RequestHandler { - (req: Request, res: Response, next?: NextFunction): any; + (req: Request, res: Response, next: NextFunction): any; } interface ErrorRequestHandler { @@ -822,6 +822,12 @@ declare module "express-serve-static-core" { } interface Application extends IRouter, Express.Application { + /** + * Express instance itself is a request handler, which could be invoked without + * third argument. + */ + (req: Request, res: Response): any; + /** * Initialize the server. * From 132ad0d95937168cecd75c4f77f69541d7d9e013 Mon Sep 17 00:00:00 2001 From: Jonny Stoten Date: Fri, 23 Sep 2016 13:46:26 +0100 Subject: [PATCH 11/28] Add timingSafeEqual typings (#11426) --- node/node-tests.ts | 9 +++++++++ node/node.d.ts | 1 + 2 files changed, 10 insertions(+) diff --git a/node/node-tests.ts b/node/node-tests.ts index 4fea9ff750..30ea4bcaa3 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -542,6 +542,15 @@ namespace crypto_tests { assert.deepEqual(clearText2, clearText); } + + { + let buffer1: Buffer = new Buffer([1, 2, 3, 4, 5]); + let buffer2: Buffer = new Buffer([1, 2, 3, 4, 5]); + let buffer3: Buffer = new Buffer([5, 4, 3, 2, 1]); + + assert(crypto.timingSafeEqual(buffer1, buffer2)) + assert(!crypto.timingSafeEqual(buffer1, buffer3)) + } } ////////////////////////////////////////////////// diff --git a/node/node.d.ts b/node/node.d.ts index c5415271bf..f3657db4a5 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -2814,6 +2814,7 @@ declare module "crypto" { setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void; } export function createECDH(curve_name: string): ECDH; + export function timingSafeEqual(a: Buffer, b: Buffer): boolean; export var DEFAULT_ENCODING: string; } From 6ff3ac5f001f960c1434f29b11a2c7e8f968c29c Mon Sep 17 00:00:00 2001 From: Jason Grout Date: Fri, 23 Sep 2016 09:06:14 -0400 Subject: [PATCH 12/28] Add CommonHTML to MathJax type definitions (#11419) * Add CommonHTML to MathJax type definitions * Make CommonHTML option optional * Add CommonHTML test --- mathjax/mathjax-tests.ts | 1 + mathjax/mathjax.d.ts | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/mathjax/mathjax-tests.ts b/mathjax/mathjax-tests.ts index 482f779894..41e77adf29 100644 --- a/mathjax/mathjax-tests.ts +++ b/mathjax/mathjax-tests.ts @@ -56,5 +56,6 @@ MathJax.Hub.Config({ MathJax.Hub.Config({ "HTML-CSS": { linebreaks: { automatic: true } }, + CommonHTML: { linebreaks: { automatic: true } }, SVG: { linebreaks: { automatic: true } } }); \ No newline at end of file diff --git a/mathjax/mathjax.d.ts b/mathjax/mathjax.d.ts index 37ea2bc188..47796e3113 100644 --- a/mathjax/mathjax.d.ts +++ b/mathjax/mathjax.d.ts @@ -578,6 +578,7 @@ declare namespace jax { MMLorHTML?:IMMLorHTMLConfiguration; NativeMML?:INativeMMLOutputProcessor; "HTML-CSS"?:IHTMLCSSOutputProcessor; + CommonHTML?: ICommonHTMLOutputProcessor; AsciiMath?:IAsciiMathInputProcessor; MathML?:IMathMLInputProcessor; TeX?:ITeXInputProcessor; @@ -1228,6 +1229,29 @@ declare namespace jax { tooltip?:IToolTip; } + export interface ICommonHTMLOutputProcessor { + /*The scaling factor (as a percentage) of math with respect to the surrounding text. The CommonHTML output + * processor tries to match the ex-size of the mathematics with that of the text where it is placed, but you may + * want to adjust the results using this scaling factor. The user can also adjust this value using the contextual + * menu item associated with the typeset mathematics. + */ + scale?:number; + /*This gives a minimum scale (as a percent) for the scaling used by MathJax to match the equation to the + * surrounding text. This will prevent MathJax from making the mathematics too small. + */ + minScaleAdjust?:number; + /*This setting controls whether elements will be typeset using the math fonts or the font of the + * surrounding text. When false, the font for mathvariant="normal" will be used; when true, the font will be + * inherited from the surrounding paragraph. + */ + mtextFontInherit?:boolean; + /*This is an object that configures automatic linebreaking in the CommonHTML output. In order to be backward + * compatible with earlier versions of MathJax, only explicit line breaks are performed by default, so you must + * enable line breaks if you want automatic ones. + */ + linebreaks?:ILineBreaks; + } + export interface IAsciiMathInputProcessor { /*Determines whether operators like summation symbols will have their limits above and below the operators * (true) or to their right (false). The former is how they would appear in displayed equations that appear on From f78cd0458a791667764d543d6c777c1439b946e9 Mon Sep 17 00:00:00 2001 From: panoti Date: Fri, 23 Sep 2016 20:10:19 +0700 Subject: [PATCH 13/28] add parent field into DeleteDocumentParams (#11436) --- elasticsearch/elasticsearch.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/elasticsearch/elasticsearch.d.ts b/elasticsearch/elasticsearch.d.ts index a73dfe1406..2816a0dee0 100644 --- a/elasticsearch/elasticsearch.d.ts +++ b/elasticsearch/elasticsearch.d.ts @@ -313,6 +313,7 @@ declare module Elasticsearch { index: string; type: string; id: string; + parent?: string; refresh?: boolean; } From 9ddf1314e4b35ba340c2df2208bce0e144f33161 Mon Sep 17 00:00:00 2001 From: StephaneMourgues Date: Fri, 23 Sep 2016 15:13:55 +0200 Subject: [PATCH 14/28] Addes some missing methods in ol.source.Vector (#11315) Addes some missing methods in ol.source.Vector --- openlayers/openlayers.d.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index 346a9edef6..fe83bebdf1 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -5012,11 +5012,23 @@ declare namespace ol { * @param Skip dispatching of removefeature events. */ clear(fast?: boolean): void; + /** * Get the extent of the features currently in the source. */ getExtent(): ol.Extent; + /** + * Get all features whose geometry intersects the provided coordinate. + */ + getFeaturesAtCoordinate(coordinate: ol.Coordinate): ol.Feature[]; + + /** + * Get a feature by its identifier (the value returned by feature.getId()). Note that the index treats + * string and numeric identifiers as the same. + */ + getFeatureById(id: string | number): ol.Feature; + /** * Get all features in the provided extent. Note that this returns all features whose bounding boxes * intersect the given extent (so it may include features whose geometries do not intersect the extent). @@ -5033,6 +5045,12 @@ declare namespace ol { * Get all features whose geometry intersects the provided coordinate. */ getFeaturesAtCoordinate(coordinate: ol.Coordinate): ol.Feature[]; + + /** + * Remove a single feature from the source. If you want to remove all features at once, use the source.clear() + * method instead. + */ + removeFeature(feature: ol.Feature): void; } class VectorEvent extends ol.events.Event { From e39fc38eaf8c67925b2bb03417a0245079c76f92 Mon Sep 17 00:00:00 2001 From: Firenter Date: Fri, 23 Sep 2016 15:14:11 +0200 Subject: [PATCH 15/28] Added missing classes and functions (#11400) * Added missing classes and functions -Added SelectEvent and DrawEvent -Updated GML format definitions * Added missing return type to readFeatures function --- openlayers/openlayers.d.ts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index fe83bebdf1..0b9e1b41f4 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -1255,6 +1255,7 @@ declare namespace olx { fill?: ol.style.Fill; image?: ol.style.Image; stroke?: ol.style.Stroke; + circle?: ol.style.Circle; text?: ol.style.Text; zIndex?: number; } @@ -3092,6 +3093,13 @@ declare namespace ol { preventDefault(): void; stopPropagation(): void; } + class SelectEvent extends Event { + mapBrowserEvent: ol.MapBrowserEvent; + } + class DrawEvent extends Event { + feature: ol.Feature; + coordinate: ol.Coordinate; + } } namespace extent { @@ -3366,16 +3374,17 @@ declare namespace ol { writeGeometryObject(geometry: ol.geom.Geometry, options?: olx.format.WriteOptions): JSON; } - class GML { + class GML extends GMLBase { } - class GML2 { + class GML2 extends GMLBase { } - class GML3 { + class GML3 extends GMLBase{ } - class GMLBase { + class GMLBase extends ol.format.XMLFeature { + readFeatures(source: ol.source.Source, options?: olx.format.ReadOptions): Array; } class GPX { @@ -4089,6 +4098,8 @@ declare namespace ol { * @param layout Layout. */ setCoordinates(coordinates: Array>, layout?: ol.geom.GeometryLayout): void; + + static fromCircle(circle: ol.geom.Circle, sides?: number, angle?: number): ol.geom.Polygon; } /** * Abstract base class; only used for creating subclasses; do not instantiate @@ -4207,6 +4218,8 @@ declare namespace ol { */ class Draw extends ol.interaction.Pointer { constructor(opt_options?: olx.interaction.DrawOptions); + + static createRegularPolygon(sides?: number, angle?: number): ol.interaction.DrawGeometryFunctionType; } /** * Events emitted by ol.interaction.Draw instances are instances of this type. From 47d3b90d02cd2e80b534e7f0c66e1873f4f3424c Mon Sep 17 00:00:00 2001 From: Alex Kankov Date: Fri, 23 Sep 2016 20:14:51 +0700 Subject: [PATCH 16/28] fix return types (#11368) * fix return types * tests update * test update * more tests * more tests --- dropzone/dropzone-commonjs-tests.ts | 90 ++++++++++++++++++++ dropzone/dropzone-tests.ts | 89 ++++++++++++++++++++ dropzone/dropzone.d.ts | 122 ++++++++++++++-------------- 3 files changed, 240 insertions(+), 61 deletions(-) diff --git a/dropzone/dropzone-commonjs-tests.ts b/dropzone/dropzone-commonjs-tests.ts index 8b5fd0a693..98c16bc185 100644 --- a/dropzone/dropzone-commonjs-tests.ts +++ b/dropzone/dropzone-commonjs-tests.ts @@ -189,4 +189,94 @@ dropzone.processFiles(addedFiles); dropzone.processQueue(); dropzone.removeAllFiles(true); +dropzone + .on("drop", () => { + console.count('drop'); + }) + .on("dragstart", () => { + console.count('dragstart'); + }) + .on("dragend", () => { + console.count('dragend'); + }) + .on("dragenter", () => { + console.count('dragenter'); + }) + .on("dragover", () => { + console.count('dragover'); + }) + .on("dragleave", () => { + console.count('dragleave'); + }) + .on("paste", () => { + console.count('paste'); + }) + .on("reset", () => { + console.count('reset'); + }) + .on("addedfile", () => { + console.count('addedfile'); + }) + .on("addedfiles", () => { + console.count('addedfiles'); + }) + .on("removedfile", () => { + console.count('removedfile'); + }) + .on("thumbnail", () => { + console.count('thumbnail'); + }) + .on("error", () => { + console.count('error'); + }) + .on("errormultiple", () => { + console.count('errormultiple'); + }) + .on("processing", () => { + console.count('processing'); + }) + .on("processingmultiple", () => { + console.count('processingmultiple'); + }) + .on("uploadprogress", () => { + console.count('uploadprogress'); + }) + .on("totaluploadprogress", () => { + console.count('totaluploadprogress'); + }) + .on("sending", () => { + console.count('sending'); + }) + .on("sendingmultiple", () => { + console.count('sendingmultiple'); + }) + .on("success", () => { + console.count('success'); + }) + .on("successmultiple", () => { + console.count('successmultiple'); + }) + .on("canceled", () => { + console.count('canceled'); + }) + .on("canceledmultiple", () => { + console.count('canceledmultiple'); + }) + .on("complete", () => { + console.count('complete'); + }) + .on("completemultiple", () => { + console.count('completemultiple'); + }) + .on("maxfilesexceeded", () => { + console.count('maxfilesexceeded'); + }) + .on("maxfilesreached", () => { + console.count('maxfilesreached'); + }) + .on("queuecomplete", () => { + console.count('queuecomplete'); + }); + + dropzone.destroy(); diff --git a/dropzone/dropzone-tests.ts b/dropzone/dropzone-tests.ts index 249d90a707..bde33458bb 100644 --- a/dropzone/dropzone-tests.ts +++ b/dropzone/dropzone-tests.ts @@ -197,4 +197,93 @@ dropzone.processFiles(addedFiles); dropzone.processQueue(); dropzone.removeAllFiles(true); +dropzone + .on("drop", () => { + console.count('drop'); + }) + .on("dragstart", () => { + console.count('dragstart'); + }) + .on("dragend", () => { + console.count('dragend'); + }) + .on("dragenter", () => { + console.count('dragenter'); + }) + .on("dragover", () => { + console.count('dragover'); + }) + .on("dragleave", () => { + console.count('dragleave'); + }) + .on("paste", () => { + console.count('paste'); + }) + .on("reset", () => { + console.count('reset'); + }) + .on("addedfile", () => { + console.count('addedfile'); + }) + .on("addedfiles", () => { + console.count('addedfiles'); + }) + .on("removedfile", () => { + console.count('removedfile'); + }) + .on("thumbnail", () => { + console.count('thumbnail'); + }) + .on("error", () => { + console.count('error'); + }) + .on("errormultiple", () => { + console.count('errormultiple'); + }) + .on("processing", () => { + console.count('processing'); + }) + .on("processingmultiple", () => { + console.count('processingmultiple'); + }) + .on("uploadprogress", () => { + console.count('uploadprogress'); + }) + .on("totaluploadprogress", () => { + console.count('totaluploadprogress'); + }) + .on("sending", () => { + console.count('sending'); + }) + .on("sendingmultiple", () => { + console.count('sendingmultiple'); + }) + .on("success", () => { + console.count('success'); + }) + .on("successmultiple", () => { + console.count('successmultiple'); + }) + .on("canceled", () => { + console.count('canceled'); + }) + .on("canceledmultiple", () => { + console.count('canceledmultiple'); + }) + .on("complete", () => { + console.count('complete'); + }) + .on("completemultiple", () => { + console.count('completemultiple'); + }) + .on("maxfilesexceeded", () => { + console.count('maxfilesexceeded'); + }) + .on("maxfilesreached", () => { + console.count('maxfilesreached'); + }) + .on("queuecomplete", () => { + console.count('queuecomplete'); + }); + dropzone.destroy(); diff --git a/dropzone/dropzone.d.ts b/dropzone/dropzone.d.ts index ff8412b0e8..b8c784505b 100644 --- a/dropzone/dropzone.d.ts +++ b/dropzone/dropzone.d.ts @@ -176,91 +176,91 @@ declare class Dropzone { createThumbnailFromUrl(file:DropzoneFile, url:string, callback?:(...args:any[]) => void):any; - on(eventName:string, callback:(...args:any[]) => void):void; + on(eventName:string, callback:(...args:any[]) => void):Dropzone; - off(eventName:string):void; + off(eventName:string):Dropzone; - emit(eventName:string, ...args:any[]):void; + emit(eventName:string, ...args:any[]):Dropzone; - on(eventName:"drop", callback:(e:DragEvent) => any):void; - on(eventName:"dragstart", callback:(e:DragEvent) => any):void; - on(eventName:"dragend", callback:(e:DragEvent) => any):void; - on(eventName:"dragenter", callback:(e:DragEvent) => any):void; - on(eventName:"dragover", callback:(e:DragEvent) => any):void; - on(eventName:"dragleave", callback:(e:DragEvent) => any):void; - on(eventName:"paste", callback:(e:DragEvent) => any):void; + on(eventName:"drop", callback:(e:DragEvent) => any):Dropzone; + on(eventName:"dragstart", callback:(e:DragEvent) => any):Dropzone; + on(eventName:"dragend", callback:(e:DragEvent) => any):Dropzone; + on(eventName:"dragenter", callback:(e:DragEvent) => any):Dropzone; + on(eventName:"dragover", callback:(e:DragEvent) => any):Dropzone; + on(eventName:"dragleave", callback:(e:DragEvent) => any):Dropzone; + on(eventName:"paste", callback:(e:DragEvent) => any):Dropzone; - on(eventName:"reset"):void; + on(eventName:"reset"):Dropzone; - on(eventName:"addedfile", callback:(file:DropzoneFile) => any):void; - on(eventName:"addedfiles", callback:(files:DropzoneFile[]) => any):void; - on(eventName:"removedfile", callback:(file:DropzoneFile) => any):void; - on(eventName:"thumbnail", callback:(file:DropzoneFile, dataUrl:string) => any):void; + on(eventName:"addedfile", callback:(file:DropzoneFile) => any):Dropzone; + on(eventName:"addedfiles", callback:(files:DropzoneFile[]) => any):Dropzone; + on(eventName:"removedfile", callback:(file:DropzoneFile) => any):Dropzone; + on(eventName:"thumbnail", callback:(file:DropzoneFile, dataUrl:string) => any):Dropzone; - on(eventName:"error", callback:(file:DropzoneFile, message:string|Error) => any):void; - on(eventName:"errormultiple", callback:(files:DropzoneFile[], message:string|Error) => any):void; + on(eventName:"error", callback:(file:DropzoneFile, message:string|Error) => any):Dropzone; + on(eventName:"errormultiple", callback:(files:DropzoneFile[], message:string|Error) => any):Dropzone; - on(eventName:"processing", callback:(file:DropzoneFile) => any):void; - on(eventName:"processingmultiple", callback:(files:DropzoneFile[]) => any):void; + on(eventName:"processing", callback:(file:DropzoneFile) => any):Dropzone; + on(eventName:"processingmultiple", callback:(files:DropzoneFile[]) => any):Dropzone; - on(eventName:"uploadprogress", callback:(file:DropzoneFile, progress:number, bytesSent:number) => any):void; - on(eventName:"totaluploadprogress", callback:(totalProgress:number, totalBytes:number, totalBytesSent:number) => any):void; + on(eventName:"uploadprogress", callback:(file:DropzoneFile, progress:number, bytesSent:number) => any):Dropzone; + on(eventName:"totaluploadprogress", callback:(totalProgress:number, totalBytes:number, totalBytesSent:number) => any):Dropzone; - on(eventName:"sending", callback:(file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData) => any):void; - on(eventName:"sendingmultiple", callback:(files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData) => any):void; + on(eventName:"sending", callback:(file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData) => any):Dropzone; + on(eventName:"sendingmultiple", callback:(files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData) => any):Dropzone; - on(eventName:"success", callback:(file:DropzoneFile) => any):void; - on(eventName:"successmultiple", callback:(files:DropzoneFile[]) => any):void; + on(eventName:"success", callback:(file:DropzoneFile) => any):Dropzone; + on(eventName:"successmultiple", callback:(files:DropzoneFile[]) => any):Dropzone; - on(eventName:"canceled", callback:(file:DropzoneFile) => any):void; - on(eventName:"canceledmultiple", callback:(file:DropzoneFile[]) => any):void; + on(eventName:"canceled", callback:(file:DropzoneFile) => any):Dropzone; + on(eventName:"canceledmultiple", callback:(file:DropzoneFile[]) => any):Dropzone; - on(eventName:"complete", callback:(file:DropzoneFile) => any):void; - on(eventName:"completemultiple", callback:(file:DropzoneFile[]) => any):void; + on(eventName:"complete", callback:(file:DropzoneFile) => any):Dropzone; + on(eventName:"completemultiple", callback:(file:DropzoneFile[]) => any):Dropzone; - on(eventName:"maxfilesexceeded", callback:(file:DropzoneFile) => any):void; - on(eventName:"maxfilesreached", callback:(files:DropzoneFile[]) => any):void; - on(eventName:"queuecomplete"):void; + on(eventName:"maxfilesexceeded", callback:(file:DropzoneFile) => any):Dropzone; + on(eventName:"maxfilesreached", callback:(files:DropzoneFile[]) => any):Dropzone; + on(eventName:"queuecomplete"):Dropzone; - emit(eventName:"drop", e:DragEvent):void; - emit(eventName:"dragstart", e:DragEvent):void; - emit(eventName:"dragend", e:DragEvent):void; - emit(eventName:"dragenter", e:DragEvent):void; - emit(eventName:"dragover", e:DragEvent):void; - emit(eventName:"dragleave", e:DragEvent):void; - emit(eventName:"paste", e:DragEvent):void; + emit(eventName:"drop", e:DragEvent):Dropzone; + emit(eventName:"dragstart", e:DragEvent):Dropzone; + emit(eventName:"dragend", e:DragEvent):Dropzone; + emit(eventName:"dragenter", e:DragEvent):Dropzone; + emit(eventName:"dragover", e:DragEvent):Dropzone; + emit(eventName:"dragleave", e:DragEvent):Dropzone; + emit(eventName:"paste", e:DragEvent):Dropzone; - emit(eventName:"reset"):void; + emit(eventName:"reset"):Dropzone; - emit(eventName:"addedfile", file:DropzoneFile):void; - emit(eventName:"addedfiles", files:DropzoneFile[]):void; - emit(eventName:"removedfile", file:DropzoneFile):void; - emit(eventName:"thumbnail", file:DropzoneFile, dataUrl:string):void; + emit(eventName:"addedfile", file:DropzoneFile):Dropzone; + emit(eventName:"addedfiles", files:DropzoneFile[]):Dropzone; + emit(eventName:"removedfile", file:DropzoneFile):Dropzone; + emit(eventName:"thumbnail", file:DropzoneFile, dataUrl:string):Dropzone; - emit(eventName:"error", file:DropzoneFile, message:string|Error):void; - emit(eventName:"errormultiple", files:DropzoneFile[], message:string|Error):void; + emit(eventName:"error", file:DropzoneFile, message:string|Error):Dropzone; + emit(eventName:"errormultiple", files:DropzoneFile[], message:string|Error):Dropzone; - emit(eventName:"processing", file:DropzoneFile):void; - emit(eventName:"processingmultiple", files:DropzoneFile[]):void; + emit(eventName:"processing", file:DropzoneFile):Dropzone; + emit(eventName:"processingmultiple", files:DropzoneFile[]):Dropzone; - emit(eventName:"uploadprogress", file:DropzoneFile, progress:number, bytesSent:number):void; - emit(eventName:"totaluploadprogress", totalProgress:number, totalBytes:number, totalBytesSent:number):void; + emit(eventName:"uploadprogress", file:DropzoneFile, progress:number, bytesSent:number):Dropzone; + emit(eventName:"totaluploadprogress", totalProgress:number, totalBytes:number, totalBytesSent:number):Dropzone; - emit(eventName:"sending", file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData):void; - emit(eventName:"sendingmultiple", files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):void; + emit(eventName:"sending", file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData):Dropzone; + emit(eventName:"sendingmultiple", files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):Dropzone; - emit(eventName:"success", file:DropzoneFile):void; - emit(eventName:"successmultiple", files:DropzoneFile[]):void; + emit(eventName:"success", file:DropzoneFile):Dropzone; + emit(eventName:"successmultiple", files:DropzoneFile[]):Dropzone; - emit(eventName:"canceled", file:DropzoneFile):void; - emit(eventName:"canceledmultiple", file:DropzoneFile[]):void; + emit(eventName:"canceled", file:DropzoneFile):Dropzone; + emit(eventName:"canceledmultiple", file:DropzoneFile[]):Dropzone; - emit(eventName:"complete", file:DropzoneFile):void; - emit(eventName:"completemultiple", file:DropzoneFile[]):void; + emit(eventName:"complete", file:DropzoneFile):Dropzone; + emit(eventName:"completemultiple", file:DropzoneFile[]):Dropzone; - emit(eventName:"maxfilesexceeded", file:DropzoneFile):void; - emit(eventName:"maxfilesreached", files:DropzoneFile[]):void; - emit(eventName:"queuecomplete"):void; + emit(eventName:"maxfilesexceeded", file:DropzoneFile):Dropzone; + emit(eventName:"maxfilesreached", files:DropzoneFile[]):Dropzone; + emit(eventName:"queuecomplete"):Dropzone; } From b06d7f0dd9c6e8ab416dbcf019728796995ad6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1nchez?= Date: Fri, 23 Sep 2016 09:46:10 -0600 Subject: [PATCH 17/28] Added more definitions --- leaflet/leaflet.d.ts | 213 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 209 insertions(+), 4 deletions(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 87f33576e6..debcf9fee4 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -199,8 +199,27 @@ declare namespace L { export function bounds(points: BoundsLiteral): Bounds; - export interface Evented { + export type EventHandlerFn = (event: Event) => void; + export type EventHandlerFnMap = {[type: string]: EventHandlerFn}; + + export interface Evented { + on(type: string, fn: EventHandlerFn, context?: Object): this; + on(eventMap: EventHandlerFnMap): this; + off(type: string, fn?: EventHandlerFn, context?: Object): this; + off(eventMap: EventHandlerFnMap): this; + off(): this; + fire(type: string, data?: Object, propagate?: boolean): this; + listens(type: string): boolean; + once(type: string, fn: EventHandlerFn, context?: Object): this; + addEventParnet(obj: Evented): this; + removeEventParent(obj: Evented): this; + addEventListener(type: string, fn: EventHandlerFn, context?: Object): this; + removeEventListener(type: string, fn: EventHandlerFn, context?: Object): this; + clearAllEventListeners(): this; + addOneTimeEventListener(type: string, fn: EventHandlerFn, context?: Object): this; + fireEvent(type: string, data?: Object, propagate?: boolean): this; + hasEventListeners(type: string): boolean; } interface LayerOptions { @@ -355,7 +374,7 @@ declare namespace L { export interface PathOptions extends InteractiveLayerOptions { stroke?: boolean; color?: string; - wight?: number; + weight?: number; opacity?: number; lineCap?: LineCapShape; lineJoin?: LineJoinShape; @@ -366,7 +385,7 @@ declare namespace L { fillOpacity?: number; fillRule?: FillRule; renderer?: Renderer; - className: string; + className?: string; } export interface Path extends Layer { @@ -485,6 +504,72 @@ declare namespace L { export interface SVG extends Renderer {} + export namespace SVG { + export function create(name: string): SVGElement; + + export function pointsToPath(rings: Array, close: boolean): string; + + export function pointsToPath(rings: Array, close: boolean): string; + } + + export function svg(options?: RendererOptions): SVG; + + export interface Canvas extends Renderer {} + + export function canvas(options?: RendererOptions): Canvas; + + export interface LayerGroup extends Layer { + toGeoJSON(): Object; // should import GeoJSON typings + addLayer(layer: Layer): this; + removeLayer(layer: Layer): this; + removeLayer(id: number): this; + hasLayer(layer: Layer): boolean; + clearLayers(): this; + invoke(methodName: string, ...params: Array): this; + eachLayer(fn: (layer: Layer) => void, context?: Object): this; + getLayer(id: number): Layer; + getLayers(): Array; + setZIndex(zIndex: number): this; + getLayerId(layer: Layer): number; + } + + export function layerGroup(layers: Array): LayerGroup; + + export interface FeatureGroup extends LayerGroup { + setStyle(style: PathOptions): this; + bringToFront(): this; + bringToBack(): this; + getBounds(): LatLngBounds; + } + + export function featureGroup(layers: Array): FeatureGroup; + + export interface GeoJSONOptions extends LayerOptions { + pointToLayer?: (geoJsonPoint: Object, latlng: LatLng) => Layer; // should import GeoJSON typings + style?: (geoJsonFeature: Object) => PathOptions; + onEachFeature?: (feaure: Object, layer: Layer) => void; + filter?: (geoJsonFeature: Object) => boolean; + coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng; // check if LatLng has an altitude property + } + + export interface GeoJSON extends FeatureGroup {} + + export namespace GeoJSON { + export function addData(data: Object): Layer; + + export function resetStyle(layer: Layer): Layer; + + export function setStyle(style: (geoJsonFeature: Object) => PathOptions): Layer; // not sure about this one, docs don't provide enough detail + + export function geometryToLayer(featureData: Object, options?: GeoJSONOptions): Layer; + + export function coordsToLatLng(coords: [number, number]): LatLng; + + export function coordsToLatLng(coords: [number, number, number]): LatLng; // check if LatLng has an altitude property + } + + export function geoJSON(geojson?: Object, options?: GeoJSONOptions): GeoJSON; + type Zoom = boolean | 'center'; export interface MapOptions { @@ -544,8 +629,78 @@ declare namespace L { bounceAtZoomLimits?: boolean; } - export interface Control { + export type ControlPosition = 'topleft' | 'topright' | 'bottomleft' | 'bottomright'; + export interface ControlOptions { + position?: ControlPosition; + } + + export interface Control { + getPosition(): ControlPosition; + setPosition(position: ControlPosition): this; + getContainer(): HTMLElement; + addTo(map: Map): this; + remove(): this; + + // Extension methods + onAdd(map: Map): HTMLElement; + onRemove(map: Map): void; + } + + export namespace Control { + export interface ZoomOptions extends ControlOptions { + zoomInText?: string; + zoomInTitle?: string; + zoomOutText?: string; + zoomOutTitle?: string; + } + + export interface Zoom extends Control {} + + export interface AttributionOptions extends ControlOptions { + prefix?: string | boolean; + } + + export interface Attribution extends Control { + setPrefix(prefix: string): this; + addAttribution(text: string): this; + removeAttribution(text: string): this; + } + + export interface LayersOptions extends ControlOptions { + collapsed?: boolean; + autoZIndex?: boolean; + hideSingleBase?: boolean; + } + + export interface Layers extends Control { + addBaseLayer(layer: Layer, name: string): this; + addOverlay(layer: Layer, name: string): this; + removeLayer(layer: Layer): this; + expand(): this; + collapse(): this; + } + + export interface ScaleOptions extends ControlOptions { + maxWidth?: number; + metric?: boolean; + imperial?: boolean; + updateWhenIdle?: boolean; + } + + export interface Scale extends Control {} + } + + export namespace control { + export function zoom(options: Control.ZoomOptions): Control.Zoom; + + export function attribution(options: Control.AttributionOptions): Control.Attribution; + + type LayersObject = {[name: string]: Layer}; + + export function layers(baseLayers?: LayersObject, overlays?: LayersObject, options?: Control.LayersOptions): Control.Layers; + + export function scale(options?: Control.ScaleOptions): Control.Scale; } interface DivOverlayOptions { @@ -920,6 +1075,56 @@ declare namespace L { export function marker(latlng: LatLngLiteral, options?: MarkerOptions): Marker; export function marker(latlng: LatLngTuple, options?: MarkerOptions): Marker; + + export namespace Browser { + export const ie: boolean; + export const ielt9: boolean; + export const edge: boolean; + export const webkit: boolean; + export const gecko: boolean; + export const android: boolean; + export const android23: boolean; + + export const chrome: boolean; + + export const safari: boolean; + + export const win: boolean; + + export const ie3d: boolean; + + export const webkit3d: boolean; + + export const gecko3d: boolean; + + export const opera12: boolean; + + export const any3d: boolean; + + export const mobile: boolean; + + export const mobileWebkit: boolean; + + export const mobiWebkit3d: boolean; + + export const mobileOpera: boolean; + + export const mobileGecko: boolean; + + export const touch: boolean; + + export const msPointer: boolean; + + export const pointer: boolean; + + export const retina: boolean; + + export const canvas: boolean; + + export const vml: boolean; + + export const svg: boolean; + } } declare module 'leaflet' { From 44e251d9b76d9c52273c037ce585ca2ccc8a15db Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sat, 24 Sep 2016 01:15:22 +0900 Subject: [PATCH 18/28] TypeScript-STL v1.1 --- typescript-stl/typescript-stl.d.ts | 13260 ++++++++++++++------------- 1 file changed, 6715 insertions(+), 6545 deletions(-) diff --git a/typescript-stl/typescript-stl.d.ts b/typescript-stl/typescript-stl.d.ts index 36ad79e4a1..06edc79bec 100644 --- a/typescript-stl/typescript-stl.d.ts +++ b/typescript-stl/typescript-stl.d.ts @@ -1,11 +1,11 @@ -// Type definitions for TypeScript-STL v1.0.8 +// Type definitions for TypeScript-STL v1.1.0 // Project: https://github.com/samchon/typescript-stl // Definitions by: Jeongho Nam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "typescript-stl" { - export = std; + export = std; } /** @@ -129,10 +129,21 @@ declare namespace std { * first but not the element pointed by last. * @param fn Unary function that accepts an element in the range as argument. This can either be a function p * ointer or a move constructible function object. Its return value, if any, is ignored. - * - * @return Returns fn. */ function for_each, Func extends (val: T) => any>(first: InputIterator, last: InputIterator, fn: Func): Func; + /** + * Apply function to range. + * + * Applies function *fn* to each of the elements in the range [*first*, *first + n*). + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param n the number of elements to apply the function to + * @param fn Unary function that accepts an element in the range as argument. This can either be a function p + * ointer or a move constructible function object. Its return value, if any, is ignored. + * + * @return first + n + */ + function for_each_n>(first: InputIterator, n: number, fn: (val: T) => any): InputIterator; /** *

    Test condition on all elements in range.

    * @@ -210,7 +221,7 @@ declare namespace std { * @return true if all the elements in the range [first1, last1) compare equal to those * of the range starting at first2, and false otherwise. */ - function equal>(first1: Iterator1, last1: Iterator1, first2: Iterator): boolean; + function equal>(first1: InputIterator, last1: InputIterator, first2: Iterator): boolean; /** *

    Test whether the elements in two ranges are equal.

    * @@ -230,7 +241,7 @@ declare namespace std { * @return true if all the elements in the range [first1, last1) compare equal to those * of the range starting at first2, and false otherwise. */ - function equal>(first1: Iterator1, last1: Iterator1, first2: Iterator, pred: (x: T, y: T) => boolean): boolean; + function equal>(first1: InputIterator, last1: InputIterator, first2: Iterator, pred: (x: T, y: T) => boolean): boolean; /** *

    Test whether range is permutation of another.

    * @@ -2740,6 +2751,46 @@ declare namespace std { */ function minmax_element>(first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): Pair; } +declare namespace std.base { + /** + *

    Static class holding enumeration codes of color of Red-black tree.

    + * + *

    Color codes imposed to nodes of RB-Tree are following those rules:

    + * + *
      + *
    1. A node is either red or black.
    2. + *
    3. The root is black. This rule is sometimes omitted. Since the root can + * always be changed from red to black, but not + * necessarily vice versa, this rule has little effect on analysis.
    4. + *
    5. All leaves (NIL; null) are black.
    6. + *
    7. If a node is red, then both its children are + * black.
    8. + *
    9. Every path from a given node to any of its descendant NIL nodes contains the same number of + * black nodes. Some definitions: the number of + * black nodes from the root to a node is the node's + * black depth; the uniform number of black + * nodes in all paths from root to the leaves is called the black-height of + * the red-black tree.
    10. + *
    + * + * @author Migrated by Jeongho Nam + */ + enum Color { + /** + *

    Code of color black.

    + * + *
      + *
    • Those are clearly black: root, leaf nodes or children nodes of red.
    • + *
    • Every path from a given nodes containes the same number of black nodes exclude NIL(s).
    • + *
    + */ + BLACK = 0, + /** + *

    Code of color red.

    + */ + RED = 1, + } +} declare namespace std.base { /** *

    An abstract container.

    @@ -2852,4856 +2903,6 @@ declare namespace std.base { swap(obj: IContainer): void; } } -declare namespace std { - /** - *

    Bi-directional iterator.

    - * - *

    {@link Iterator Bidirectional iterators} are iterators that can be used to access the sequence of elements - * in a range in both directions (towards the end and towards the beginning).

    - * - *

    All {@link IArrayIterator random-access iterators} are also valid {@link Iterrator bidirectional iterators}. - *

    - * - *

    There is not a single type of {@link Iterator bidirectional iterator}: {@link IContainer Each container} - * may define its own specific iterator type able to iterate through it and access its elements.

    - * - *

    - * - *

    - * - * @reference http://www.cplusplus.com/reference/iterator/BidirectionalIterator - * @author Jeongho Nam - */ - abstract class Iterator { - /** - * Source container of the iterator is directing for. - */ - protected source_: base.IContainer; - /** - * Construct from the source {@link IContainer container}. - * - * @param source The source - */ - constructor(source: base.IContainer); - /** - *

    Get iterator to previous element.

    - *

    If current iterator is the first item(equal with {@link IContainer.begin IContainer.begin()}), - * returns {@link IContainer.end IContainer.end()}.

    - * - * @return An iterator of the previous item. - */ - abstract prev(): Iterator; - /** - *

    Get iterator to next element.

    - *

    If current iterator is the last item, returns {@link IContainer.end IContainer.end()}.

    - * - * @return An iterator of the next item. - */ - abstract next(): Iterator; - /** - * Advances the {@link Iterator} by n element positions. - * - * @param n Number of element positions to advance. - * @return An advanced iterator. - */ - advance(n: number): Iterator; - /** - * Get source - */ - get_source(): base.IContainer; - /** - *

    Whether an iterator is equal with the iterator.

    - * - *

    Compare two iterators and returns whether they are equal or not.

    - * - *

    Note

    - *

    Iterator's equal_to() only compare souce container and index number.

    - * - *

    Although elements in a pair, key and value are equal_to, if the source map or - * index number is different, then the {@link equal_to equal_to()} will return false. If you want to - * compare the elements of a pair, compare them directly by yourself.

    - * - * @param obj An iterator to compare - * @return Indicates whether equal or not. - */ - equal_to(obj: Iterator): boolean; - /** - *

    Get value of the iterator is pointing.

    - * - * @return A value of the iterator. - */ - value: T; - abstract swap(obj: Iterator): void; - } -} -declare namespace std { - /** - *

    This class reverses the direction in which a bidirectional or random-access iterator iterates through a range. - *

    - * - *

    A copy of the original iterator (the {@link Iterator base iterator}) is kept internally and used to reflect - * the operations performed on the {@link ReverseIterator}: whenever the {@link ReverseIterator} is incremented, its - * {@link Iterator base iterator} is decreased, and vice versa. A copy of the {@link Iterator base iterator} with the - * current state can be obtained at any time by calling member {@link base}.

    - * - *

    Notice however that when an iterator is reversed, the reversed version does not point to the same element in - * the range, but to the one preceding it. This is so, in order to arrange for the past-the-end element of a - * range: An iterator pointing to a past-the-end element in a range, when reversed, is pointing to the last element - * (not past it) of the range (this would be the first element of the reversed range). And if an iterator to the - * first element in a range is reversed, the reversed iterator points to the element before the first element (this - * would be the past-the-end element of the reversed range).

    - * - *

    - * - *

    - * - * @reference http://www.cplusplus.com/reference/iterator/reverse_iterator - * @author Jeongho Nam - */ - abstract class ReverseIterator, This extends ReverseIterator> extends Iterator { - /** - * @hidden - */ - protected base_: Base; - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: Base); - /** - *

    Return base iterator.

    - * - *

    Return a reference of the base iteraotr.

    - * - *

    The base iterator is an iterator of the same type as the one used to construct the {@link ReverseIterator}, - * but pointing to the element next to the one the {@link ReverseIterator} is currently pointing to - * (a {@link ReverseIterator} has always an offset of -1 with respect to its base iterator). - * - * @return A reference of the base iterator, which iterates in the opposite direction. - */ - base(): Base; - /** - * @hidden - */ - protected abstract create_neighbor(base: Base): This; - /** - *

    Get value of the iterator is pointing.

    - * - * @return A value of the reverse iterator. - */ - value: T; - /** - * @inheritdoc - */ - prev(): This; - /** - * @inheritdoc - */ - next(): This; - /** - * @inheritdoc - */ - advance(n: number): This; - /** - * @inheritdoc - */ - equal_to(obj: This): boolean; - /** - * @inheritdoc - */ - swap(obj: This): void; - } - /** - *

    Return distance between {@link Iterator iterators}.

    - * - *

    Calculates the number of elements between first and last.

    - * - *

    If it is a {@link IArrayIterator random-access iterator}, the function uses operator- to calculate this. - * Otherwise, the function uses the increase operator {@link Iterator.next next()} repeatedly.

    - * - * @param first Iterator pointing to the initial element. - * @param last Iterator pointing to the final element. This must be reachable from first. - * - * @return The number of elements between first and last. - */ - function distance>(first: InputIterator, last: InputIterator): number; - /** - *

    Advance iterator.

    - * - *

    Advances the iterator it by n elements positions.

    - * - * @param it Iterator to be advanced. - * @param n Number of element positions to advance. - * - * @return An iterator to the element n positions before it. - */ - function advance>(it: InputIterator, n: number): InputIterator; - /** - *

    Get iterator to previous element.

    - * - *

    Returns an iterator pointing to the element that it would be pointing to if advanced -n positions.

    - * - * @param it Iterator to base position. - * @param n Number of element positions offset (1 by default). - * - * @return An iterator to the element n positions before it. - */ - function prev>(it: BidirectionalIterator, n?: number): BidirectionalIterator; - /** - *

    Get iterator to next element.

    - * - *

    Returns an iterator pointing to the element that it would be pointing to if advanced n positions.

    - * - * @param it Iterator to base position. - * @param n Number of element positions offset (1 by default). - * - * @return An iterator to the element n positions away from it. - */ - function next>(it: ForwardIterator, n?: number): ForwardIterator; - /** - *

    Iterator to beginning.

    - * - *

    Returns an iterator pointing to the first element in the sequence.

    - * - *

    If the sequence is empty, the returned value shall not be dereferenced.

    - * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: Vector): VectorIterator; - /** - *

    Iterator to beginning.

    - * - *

    Returns an iterator pointing to the first element in the sequence.

    - * - *

    If the sequence is empty, the returned value shall not be dereferenced.

    - * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: List): ListIterator; - /** - *

    Iterator to beginning.

    - * - *

    Returns an iterator pointing to the first element in the sequence.

    - * - *

    If the sequence is empty, the returned value shall not be dereferenced.

    - * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: Deque): DequeIterator; - /** - *

    Iterator to beginning.

    - * - *

    Returns an iterator pointing to the first element in the sequence.

    - * - *

    If the sequence is empty, the returned value shall not be dereferenced.

    - * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: base.SetContainer): SetIterator; - /** - *

    Iterator to beginning.

    - * - *

    Returns an iterator pointing to the first element in the sequence.

    - * - *

    If the sequence is empty, the returned value shall not be dereferenced.

    - * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: base.MapContainer): MapIterator; - /** - *

    Iterator to end.

    - * - *

    Returns an iterator pointing to the past-the-end element in the sequence.

    - * - *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    - * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: Vector): VectorIterator; - /** - *

    Iterator to end.

    - * - *

    Returns an iterator pointing to the past-the-end element in the sequence.

    - * - *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    - * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: List): ListIterator; - /** - *

    Iterator to end.

    - * - *

    Returns an iterator pointing to the past-the-end element in the sequence.

    - * - *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    - * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: Deque): DequeIterator; - /** - *

    Iterator to end.

    - * - *

    Returns an iterator pointing to the past-the-end element in the sequence.

    - * - *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    - * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: base.SetContainer): SetIterator; - /** - *

    Iterator to end.

    - * - *

    Returns an iterator pointing to the past-the-end element in the sequence.

    - * - *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    - * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: base.MapContainer): MapIterator; -} -declare namespace std.Deque { - type iterator = std.DequeIterator; - type reverse_iterator = std.DequeReverseIterator; -} -declare namespace std { - /** - *

    Double ended queue.

    - * - *

    {@link Deque} (usually pronounced like "deck") is an irregular acronym of - * double-ended queue. Double-ended queues are sequence containers with dynamic sizes that can be - * expanded or contracted on both ends (either its front or its back).

    - * - *

    Specific libraries may implement deques in different ways, generally as some form of dynamic array. But in any - * case, they allow for the individual elements to be accessed directly through random access iterators, with storage - * handled automatically by expanding and contracting the container as needed.

    - * - *

    Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of - * elements also at the beginning of the sequence, and not only at its end. But, unlike {@link Vector Vectors}, - * {@link Deque Deques} are not guaranteed to store all its elements in contiguous storage locations: accessing - * elements in a deque by offsetting a pointer to another element causes undefined behavior.

    - * - *

    Both {@link Vector}s and {@link Deque}s provide a very similar interface and can be used for similar purposes, - * but internally both work in quite different ways: While {@link Vector}s use a single array that needs to be - * occasionally reallocated for growth, the elements of a {@link Deque} can be scattered in different chunks of - * storage, with the container keeping the necessary information internally to provide direct access to any of its - * elements in constant time and with a uniform sequential interface (through iterators). Therefore, - * {@link Deque Deques} are a little more complex internally than {@link Vector}s, but this allows them to grow more - * efficiently under certain circumstances, especially with very long sequences, where reallocations become more - * expensive.

    - * - *

    For operations that involve frequent insertion or removals of elements at positions other than the beginning or - * the end, {@link Deque Deques} perform worse and have less consistent iterators and references than - * {@link List Lists}.

    - * - *

    - * - *

    - * - *

    Container properties

    - *
    - *
    Sequence
    - *
    Elements in sequence containers are ordered in a strict linear sequence. Individual elements - * are accessed by their position in this sequence.
    - * - *
    Dynamic array
    - *
    Generally implemented as a dynamic array, it allows direct access to any element in the - * sequence and provides relatively fast addition/removal of elements at the beginning or the end - * of the sequence.
    - *
    - * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/deque/deque/ - * @author Jeongho Nam - */ - class Deque extends base.Container implements base.IArrayContainer, base.IDequeContainer { - /** - * @hidden - */ - private static ROW; - /** - * @hidden - */ - private static MIN_CAPACITY; - /** - * @hidden - */ - private matrix_; - /** - * @hidden - */ - private size_; - /** - * @hidden - */ - private capacity_; - /** - * @hidden - */ - private get_col_size(); - /** - *

    Default Constructor.

    - * - *

    Constructs an empty container, with no elements.

    - */ - constructor(); - /** - *

    Initializer list Constructor.

    - * - *

    Constructs a container with a copy of each of the elements in array, in the same order.

    - * - * @param array An array containing elements to be copied and contained. - */ - constructor(items: Array); - /** - *

    Fill Constructor.

    - * - *

    Constructs a container with n elements. Each element is a copy of val (if provided).

    - * - * @param n Initial container size (i.e., the number of elements in the container at construction). - * @param val Value to fill the container with. Each of the n elements in the container is - * initialized to a copy of this value. - */ - constructor(size: number, val: T); - /** - *

    Copy Constructor.

    - * - *

    Constructs a container with a copy of each of the elements in container, in the same order.

    - * - * @param container Another container object of the same type (with the same class template - * arguments T), whose contents are either copied or acquired. - */ - constructor(container: Deque); - /** - *

    Range Constructor.

    - * - *

    Constructs a container with as many elements as the range (begin, end), with each - * element emplace-constructed from its corresponding element in that range, in the same order.

    - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - assign>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - assign(n: number, val: T): void; - /** - * @inheritdoc - */ - reserve(capacity: number): void; - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - begin(): DequeIterator; - /** - * @inheritdoc - */ - end(): DequeIterator; - /** - * @inheritdoc - */ - rbegin(): DequeReverseIterator; - /** - * @inheritdoc - */ - rend(): DequeReverseIterator; - /** - * @inheritdoc - */ - size(): number; - /** - * @inheritdoc - */ - empty(): boolean; - /** - * @inheritdoc - */ - capacity(): number; - /** - * @inheritdoc - */ - at(index: number): T; - /** - * @inheritdoc - */ - set(index: number, val: T): void; - /** - * @inheritdoc - */ - front(): T; - /** - * @inheritdoc - */ - back(): T; - /** - // Fetch row and column's index. - /** - * @hidden - */ - private fetch_index(index); - /** - * @inheritdoc - */ - push(...items: T[]): number; - /** - * @inheritdoc - */ - push_front(val: T): void; - /** - * @inheritdoc - */ - push_back(val: T): void; - /** - * @inheritdoc - */ - pop_front(): void; - /** - * @inheritdoc - */ - pop_back(): void; - /** - * @inheritdoc - */ - insert(position: DequeIterator, val: T): DequeIterator; - /** - * @inheritdoc - */ - insert(position: DequeIterator, n: number, val: T): DequeIterator; - /** - * @inheritdoc - */ - insert>(position: DequeIterator, begin: InputIterator, end: InputIterator): DequeIterator; - /** - * @inheritdoc - */ - insert(position: DequeReverseIterator, val: T): DequeReverseIterator; - /** - * @inheritdoc - */ - insert(position: DequeReverseIterator, n: number, val: T): DequeReverseIterator; - /** - * @inheritdoc - */ - insert>(position: DequeReverseIterator, begin: InputIterator, end: InputIterator): DequeReverseIterator; - /** - * @hidden - */ - private insert_by_val(position, val); - /** - * @hidden - */ - protected _Insert_by_repeating_val(position: DequeIterator, n: number, val: T): DequeIterator; - /** - * @hidden - */ - protected _Insert_by_range>(position: DequeIterator, begin: InputIterator, end: InputIterator): DequeIterator; - /** - * @hidden - */ - private insert_by_items(position, items); - /** - * @inheritdoc - */ - erase(position: DequeIterator): DequeIterator; - /** - * @inheritdoc - */ - erase(first: DequeIterator, last: DequeIterator): DequeIterator; - /** - * @inheritdoc - */ - erase(position: DequeReverseIterator): DequeReverseIterator; - /** - * @inheritdoc - */ - erase(first: DequeReverseIterator, last: DequeReverseIterator): DequeReverseIterator; - /** - * @hidden - */ - protected _Erase_by_range(first: DequeIterator, last: DequeIterator): DequeIterator; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link Deque container} object with same type of elements. Sizes and container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were in obj - * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link Deque container} of the same type of elements (i.e., instantiated - * with the same template parameter, T) whose content is swapped with that of this - * {@link container Deque}. - */ - swap(obj: Deque): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std { - /** - *

    An iterator of {@link Deque}.

    - * - *

    - * - *

    - * - * @author Jeongho Nam - */ - class DequeIterator extends Iterator implements base.IArrayIterator { - /** - * Sequence number of iterator in the source {@link Deque}. - */ - private index_; - /** - *

    Construct from the source {@link Deque container}.

    - * - *

    Note

    - *

    Do not create the iterator directly, by yourself.

    - *

    Use {@link Deque.begin begin()}, {@link Deque.end end()} in {@link Deque container} instead.

    - * - * @param source The source {@link Deque container} to reference. - * @param index Sequence number of the element in the source {@link Deque}. - */ - constructor(source: Deque, index: number); - /** - * @hidden - */ - private deque; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * @inheritdoc - */ - index: number; - /** - * @inheritdoc - */ - prev(): DequeIterator; - /** - * @inheritdoc - */ - next(): DequeIterator; - /** - * @inheritdoc - */ - advance(n: number): DequeIterator; - /** - *

    Whether an iterator is equal with the iterator.

    - * - *

    Compare two iterators and returns whether they are equal or not.

    - * - *

    Note

    - *

    Iterator's equal_to() only compare souce container and index number.

    - * - *

    Although elements in a pair, key and value are equal_to, if the source map or - * index number is different, then the {@link equal_to equal_to()} will return false. If you want to - * compare the elements of a pair, compare them directly by yourself.

    - * - * @param obj An iterator to compare - * @return Indicates whether equal or not. - */ - equal_to(obj: DequeIterator): boolean; - /** - * @inheritdoc - */ - swap(obj: DequeIterator): void; - } -} -declare namespace std { - /** - *

    A reverse-iterator of Deque.

    - * - *

    - * - *

    - * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class DequeReverseIterator extends ReverseIterator, DequeReverseIterator> implements base.IArrayIterator { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: DequeIterator); - /** - * @hidden - */ - protected create_neighbor(base: DequeIterator): DequeReverseIterator; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * Get index. - */ - index: number; - } -} -declare namespace std { - /** - *

    Function handling termination on exception

    - * - *

    Calls the current terminate handler.

    - * - *

    By default, the terminate handler calls abort. But this behavior can be redefined by calling - * {@link set_terminate}.

    - * - *

    This function is automatically called when no catch handler can be found for a thrown exception, - * or for some other exceptional circumstance that makes impossible to continue the exception handling process.

    - * - *

    This function is provided so that the terminate handler can be explicitly called by a program that needs to - * abnormally terminate, and works even if {@link set_terminate} has not been used to set a custom terminate handler - * (calling abort in this case).

    - */ - function terminate(): void; - /** - *

    Set terminate handler function.

    - * - *

    A terminate handler function is a function automatically called when the exception handling process has - * to be abandoned for some reason. This happens when no catch handler can be found for a thrown exception, or for - * some other exceptional circumstance that makes impossible to continue the exception handling process.

    - * - *

    Before this function is called by the program for the first time, the default behavior is to call abort.

    - * - *

    A program may explicitly call the current terminate handler function by calling {@link terminate}.

    - * - * @param f Function that takes no parameters and returns no value (void). - */ - function set_terminate(f: () => void): void; - /** - *

    Get terminate handler function.

    - * - *

    The terminate handler function is automatically called when no catch handler can be found - * for a thrown exception, or for some other exceptional circumstance that makes impossible to continue the exception - * handling process.

    - * - *

    If no such function has been set by a previous call to {@link set_terminate}, the function returns a - * null-pointer.

    - * - * @return If {@link set_terminate} has previously been called by the program, the function returns the current - * terminate handler function. Otherwise, it returns a null-pointer. - */ - function get_terminate(): () => void; - /** - *

    Standard exception class.

    - * - *

    Base class for standard exceptions.

    - * - *

    All objects thrown by components of the standard library are derived from this class. - * Therefore, all standard exceptions can be caught by catching this type by reference.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/exception/exception - * @author Jeongho Nam - */ - class Exception extends Error { - /** - * A message representing specification about the Exception. - */ - private description; - /** - * Default Constructor. - */ - constructor(); - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - /** - *

    Get string identifying exception.

    - *

    Returns a string that may be used to identify the exception.

    - * - *

    The particular representation pointed by the returned value is implementation-defined. - * As a virtual function, derived classes may redefine this function so that specify value are - * returned.

    - */ - what(): string; - /** - * @inheritdoc - */ - message: string; - /** - * @inheritdoc - */ - name: string; - } - /** - *

    Logic error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report errors in the internal - * logical of the program, such as violation of logical preconditions or class invariants.

    - * - *

    These errors are presumably detectable before the program executes.

    - * - *

    It is used as a base class for several logical error exceptions.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/logic_error - * @author Jeongho Nam - */ - class LogicError extends Exception { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Domain error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report domain errors.

    - * - *

    Generally, the domain of a mathematical function is the subset of values that it is defined for. - * For example, the square root function is only defined for non-negative numbers. Thus, a negative number - * for such a function would qualify as a domain error.

    - * - *

    No component of the standard library throws exceptions of this type. It is designed as a standard - * exception to be thrown by programs.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/domain_error - * @author Jeongho Nam - */ - class DomainError extends LogicError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Invalid argument exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report an invalid argument.

    - * - *

    It is a standard exception that can be thrown by programs. Some components of the standard library - * also throw exceptions of this type to signal invalid arguments.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/invalid_argument - * @author Jeongho Nam - */ - class InvalidArgument extends LogicError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Length error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report a length error.

    - * - *

    It is a standard exception that can be thrown by programs. Some components of the standard library, - * such as vector and string also throw exceptions of this type to signal errors resizing.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/length_error - * @author Jeongho Nam - */ - class LengthError extends LogicError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Out-of-range exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report an out-of-range error.

    - * - *

    It is a standard exception that can be thrown by programs. Some components of the standard library, - * such as vector, deque, string and bitset also throw exceptions of this type to signal arguments - * out of range.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/out_of_range - * @author Jeongho Nam - */ - class OutOfRange extends LogicError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Runtime error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report errors that can only be - * detected during runtime.

    - * - *

    It is used as a base class for several runtime error exceptions.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/runtime_error - * @author Jeongho Nam - */ - class RuntimeError extends Exception { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Overflow error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to arithmetic overflow errors.

    - * - *

    It is a standard exception that can be thrown by programs. Some components of the standard library - * also throw exceptions of this type to signal range errors.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/overflow_error - * @author Jeongho Nam - */ - class OverflowError extends RuntimeError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Underflow error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to arithmetic underflow errors.

    - * - *

    No component of the standard library throws exceptions of this type. It is designed as a standard - * exception to be thrown by programs.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/underflow_error - * @author Jeongho Nam - */ - class UnderflowError extends RuntimeError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Range error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report range errors in internal - * computations.

    - * - *

    It is a standard exception that can be thrown by programs. Some components of the standard library - * also throw exceptions of this type to signal range errors.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/range_error - * @author Jeongho Nam - */ - class RangeError extends RuntimeError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } -} -declare namespace std { - /** - *

    Function object class for equality comparison.

    - * - *

    Binary function object class whose call returns whether its two arguments compare equal (as returned by - * operator ==).

    - * - *

    Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} - * defined. This member function allows the object to be used with the same syntax as a function call.

    - * - * @param x First element to compare. - * @param y Second element to compare. - * - * @return Whether the arguments are equal. - */ - function equal_to(x: T, y: T): boolean; - /** - *

    Function object class for non-equality comparison.

    - * - *

    Binary function object class whose call returns whether its two arguments compare not equal (as returned - * by operator operator!=).

    - * - *

    Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} - * defined. This member function allows the object to be used with the same syntax as a function call.

    - * - * @param x First element to compare. - * @param y Second element to compare. - * - * @return Whether the arguments are not equal. - */ - function not_equal_to(x: T, y: T): boolean; - /** - *

    Function for less-than inequality comparison.

    - * - *

    Binary function returns whether the its first argument compares less than the second.

    - * - *

    Generically, function objects are instances of a class with member function {@link IComparable.less less} - * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. - * This member function allows the object to be used with the same syntax as a function call.

    - * - *

    Objects of this class can be used on standard algorithms such as {@link sort sort()}, - * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.

    - * - * @param Type of arguments to compare by the function call. The type shall supporrt the operation - * operator<() or method {@link IComparable.less less}. - * - * @param x First element, the standard of comparison. - * @param y Second element compare with the first. - * - * @return Whether the first parameter is less than the second. - */ - function less(x: T, y: T): boolean; - /** - *

    Function object class for less-than-or-equal-to comparison.

    - * - *

    Binary function object class whose call returns whether the its first argument compares {@link less less than} or - * {@link equal_to equal to} the second (as returned by operator <=).

    - * - *

    Generically, function objects are instances of a class with member function {@link IComparable.less less} - * and {@link IComparable.equal_to equal_to} defined. This member function allows the object to be used with the same - * syntax as a function call.

    - * - * @param x First element, the standard of comparison. - * @param y Second element compare with the first. - * - * @return Whether the x is {@link less less than} or {@link equal_to equal to} the y. - */ - function less_equal(x: T, y: T): boolean; - /** - *

    Function for greater-than inequality comparison.

    - * - *

    Binary function returns whether the its first argument compares greater than the second.

    - * - *

    Generically, function objects are instances of a class with member function {@link less} and - * {@link equal_to equal_to()} defined. If an object doesn't have those methods, then its own uid will be used - * to compare insteadly. This member function allows the object to be used with the same syntax as a function - * call.

    - * - *

    Objects of this class can be used on standard algorithms such as {@link sort sort()}, - * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.

    - * - * @param Type of arguments to compare by the function call. The type shall supporrt the operation - * operator>() or method {@link IComparable.greater greater}. - * - * @return Whether the x is greater than the y. - */ - function greater(x: T, y: T): boolean; - /** - *

    Function object class for greater-than-or-equal-to comparison.

    - * - *

    Binary function object class whose call returns whether the its first argument compares - * {@link greater greater than} or {@link equal_to equal to} the second (as returned by operator >=).

    - * - *

    Generically, function objects are instances of a class with member function {@link IComparable.less less} - * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. - * This member function allows the object to be used with the same syntax as a function call.

    - * - * @param x First element, the standard of comparison. - * @param y Second element compare with the first. - * - * @return Whether the x is {@link greater greater than} or {@link equal_to equal to} the y. - */ - function greater_equal(x: T, y: T): boolean; - /** - *

    Logical AND function object class.

    - * - *

    Binary function object class whose call returns the result of the logical "and" operation between its two - * arguments (as returned by operator &&).

    - * - *

    Generically, function objects are instances of a class with member function operator() defined. This member - * function allows the object to be used with the same syntax as a function call.

    - * - * @param x First element. - * @param y Second element. - * - * @return Result of logical AND operation. - */ - function logical_and(x: T, y: T): boolean; - /** - *

    Logical OR function object class.

    - * - *

    Binary function object class whose call returns the result of the logical "or" operation between its two - * arguments (as returned by operator ||).

    - * - *

    Generically, function objects are instances of a class with member function operator() defined. This member - * function allows the object to be used with the same syntax as a function call.

    - * - * @param x First element. - * @param y Second element. - * - * @return Result of logical OR operation. - */ - function logical_or(x: T, y: T): boolean; - /** - *

    Logical NOT function object class.

    - * - *

    Unary function object class whose call returns the result of the logical "not" operation on its argument - * (as returned by operator !).

    - * - *

    Generically, function objects are instances of a class with member function operator() defined. This member - * function allows the object to be used with the same syntax as a function call.

    - * - * @param x Target element. - * - * @return Result of logical NOT operation. - */ - function logical_not(x: T): boolean; - /** - *

    Bitwise AND function object class.

    - * - *

    Binary function object class whose call returns the result of applying the bitwise "and" operation between - * its two arguments (as returned by operator &).

    - * - * @param x First element. - * @param y Second element. - * - * @return Result of bitwise AND operation. - */ - function bit_and(x: number, y: number): number; - /** - *

    Bitwise OR function object class.

    - * - *

    Binary function object class whose call returns the result of applying the bitwise "and" operation between - * its two arguments (as returned by operator &).

    - * - * @param x First element. - * @param y Second element. - * - * @return Result of bitwise OR operation. - */ - function bit_or(x: number, y: number): number; - /** - *

    Bitwise XOR function object class.

    - * - *

    Binary function object class whose call returns the result of applying the bitwise "exclusive or" - * operation between its two arguments (as returned by operator ^).

    - * - * @param x First element. - * @param y Second element. - * - * @return Result of bitwise XOR operation. - */ - function bit_xor(x: number, y: number): number; - /** - *

    Comparable instance.

    - * - *

    {@link IComparable} is a common interface for objects who can compare each other.

    - * - * @reference https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html - * @author Jeongho Nam - */ - interface IComparable extends Object { - /** - *

    Indicates whether some other object is "equal to" this one.

    - * - *

    The {@link equal_to} method implements an equivalence relation on non-null object references:

    - * - *
      - *
    • - * It is reflexive: for any non-null reference value x, x.equal_to(x) - * should return true. - *
    • - *
    • - * It is symmetric: for any non-null reference values x and y, - * x.equal_to(y) should return true if and only if y.equal_to(x) - * returns true.
    • - *
    • - * It is transitive: for any non-null reference values x, y, and - * z, if x.equal_to(y) returns true and y.equal_to(z) - * returns true, then x.equal_to(z) should return true. - *
    • - *
    • - * It is consistent: for any non-null reference values x and y, multiple - * invocations of x.equal_to(y) consistently return true or consistently return - * false, provided no information used in equal_to comparisons on the objects is modified. - *
    • - *
    • - * For any non-null reference value x, x.equal_to(null) should return - * false. - *
    • - *
    - * - *

    The {@link equal_to} method for interface {@link IComparable} implements the most discriminating possible - * equivalence relation on objects; that is, for any non-null reference values x and - * y, this method returns true if and only if x and y - * refer to the same object (x == y has the value true).

    - * - *

    Note that it is generally necessary to override the {@link hash_code} method whenever this method is - * overridden, so as to maintain the general contract for the {@link hash_code} method, which states that - * equal objects must have equal hash codes.

    - * - *
      - *
    • {@link IComparable.equal_to} is called by {@link std.equal_to}.
    • - *
    - * - * @param obj the reference object with which to compare. - * - * @return true if this object is the same as the obj argument; false otherwise. - */ - equal_to(obj: T): boolean; - /** - *

    Less-than inequality comparison.

    - * - *

    Binary method returns whether the the instance compares less than the obj.

    - * - *
      - *
    • - * {@link IComparable.less} is called by {@link std.less}. Also, this method can be used on standard - * algorithms such as {@link sort sort()}, {@link merge merge()} or - * {@link TreeMap.lower_bound lower_bound()}. - *
    • - *
    - * - * @param obj the reference object with which to compare. - * - * @return Whether the first parameter is less than the second. - */ - less(obj: T): boolean; - /** - *

    Issue a hash code.

    - * - *

    Returns a hash code value for the object. This method is supported for the benefit of hash tables such - * as those provided by hash containers; {@link HashSet}, {@link HashMap}, {@link MultiHashSet} and - * {@link MultiHashMap}.

    - * - *

    As much as is reasonably practical, the {@link hash_code} method defined by interface - * {@link IComparable} does return distinct integers for distinct objects. (This is typically implemented by - * converting the internal address of the object into an integer, but this implementation technique is not - * required by the JavaScript programming language.)

    - * - *
      - *
    • - * {@link IComparable.hash_code} is called by {@link std.hash_code}. If you want to keep basically - * provided hash function, then returns {@link std.Hash.code}; return std.Hash.code(this); - *
    • - *
    - * - * @return An hash code who represents the object. - */ - hash(): number; - } - /** - *

    Default hash function for number.

    - * - *

    Unary function that defines the default hash function used by the standard library.

    - * - *

    The functional call returns a hash value of its argument: A hash value is a value that depends solely on - * its argument, returning always the same value for the same argument (for a given execution of a program). The - * value returned shall have a small likelihood of being the same as the one returned for a different argument. - *

    - * - * @param val Value to be hashed. - * - * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. - */ - function hash(val: number): number; - /** - *

    Default hash function for string.

    - * - *

    Unary function that defines the default hash function used by the standard library.

    - * - *

    The functional call returns a hash value of its argument: A hash value is a value that depends solely on - * its argument, returning always the same value for the same argument (for a given execution of a program). The - * value returned shall have a small likelihood of being the same as the one returned for a different argument. - *

    - * - * @param str A string to be hashed. - * - * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. - */ - function hash(str: string): number; - /** - *

    Default hash function for Object.

    - * - *

    Unary function that defines the default hash function used by the standard library.

    - * - *

    The functional call returns a hash value of its argument: A hash value is a value that depends solely on - * its argument, returning always the same value for the same argument (for a given execution of a program). The - * value returned shall have a small likelihood of being the same as the one returned for a different argument. - *

    - * - *

    The default {@link hash} function of Object returns a value returned from {@link hash hash(number)} with - * an unique id of each Object. If you want to specify {@link hash} function of a specific class, then - * define a member function public hash(): number in the class.

    - * - * @param obj Object to be hashed. - * - * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. - */ - function hash(obj: Object): number; - /** - *

    Exchange contents of {@link IContainers containers}.

    - * - *

    The contents of container left are exchanged with those of right. Both container objects must have - * same type of elements (same template parameters), although sizes may differ.

    - * - *

    After the call to this member function, the elements in left are those which were in right before - * the call, and the elements of right are those which were in left. All iterators, references and - * pointers remain valid for the swapped objects.

    - * - *

    This is an overload of the generic algorithm swap that improves its performance by mutually transferring - * ownership over their assets to the other container (i.e., the containers exchange references to their data, without - * actually performing any element copy or movement): It behaves as if left. - * {@link IContainer.swap swap}(right) was called.

    - * - * @param left A {@link IContainer container} to swap its contents. - * @param right A {@link IContainer container} to swap its contents. - */ - function swap(left: base.IContainer, right: base.IContainer): void; - /** - *

    Exchange contents of queues.

    - * - *

    Exchanges the contents of left and right.

    - * - * @param left A {@link Queue} container of the same type. Size may differ. - * @param right A {@link Queue} container of the same type. Size may differ. - */ - function swap(left: Queue, right: Queue): void; - /** - *

    Exchange contents of {@link PriorityQueue PriorityQueues}.

    - * - *

    Exchanges the contents of left and right.

    - * - * @param left A {@link PriorityQueue} container of the same type. Size may differ. - * @param right A {@link PriorityQueue} container of the same type. Size may differ. - */ - function swap(left: PriorityQueue, right: PriorityQueue): void; - /** - *

    Exchange contents of {@link Stack Stacks}.

    - * - *

    Exchanges the contents of left and right.

    - * - * @param left A {@link Stack} container of the same type. Size may differ. - * @param right A {@link Stack} container of the same type. Size may differ. - */ - function swap(left: Stack, right: Stack): void; - /** - *

    Exchanges the contents of two {@link UniqueMap unique maps}.

    - * - *

    The contents of container left are exchanged with those of right. Both container objects must - * be of the same type (same template parameters), although sizes may differ.

    - * - *

    After the call to this member function, the elements in left are those which were in right - * before the call, and the elements of right are those which were in left. All iterators, references - * and pointers remain valid for the swapped objects.

    - * - *

    This is an overload of the generic algorithm swap that improves its performance by mutually transferring - * ownership over their assets to the other container (i.e., the containers exchange references to their data, - * without actually performing any element copy or movement): It behaves as if - * left.{@link UniqueMap.swap swap}(right) was called.

    - * - * @param left An {@link UniqueMap unique map} to swap its conents. - * @param right An {@link UniqueMap unique map} to swap its conents. - */ - function swap(left: base.UniqueMap, right: base.UniqueMap): void; - /** - *

    Exchanges the contents of two {@link MultiMap multi maps}.

    - * - *

    The contents of container left are exchanged with those of right. Both container objects must - * be of the same type (same template parameters), although sizes may differ.

    - * - *

    After the call to this member function, the elements in left are those which were in right - * before the call, and the elements of right are those which were in left. All iterators, references - * and pointers remain valid for the swapped objects.

    - * - *

    This is an overload of the generic algorithm swap that improves its performance by mutually transferring - * ownership over their assets to the other container (i.e., the containers exchange references to their data, - * without actually performing any element copy or movement): It behaves as if - * left.{@link MultiMap.swap swap}(right) was called.

    - * - * @param left A {@link MultiMap multi map} to swap its conents. - * @param right A {@link MultiMap multi map} to swap its conents. - */ - function swap(left: base.MultiMap, right: base.MultiMap): void; -} -declare namespace std { - /** - *

    Bind function arguments.

    - * - *

    Returns a function object based on fn, but with its arguments bound to args.

    - * - *

    Each argument may either be bound to a value or be a {@link placeholders placeholder}:

    - *
      - *
    • If bound to a value, calling the returned function object will always use that value as argument.
    • - *
    • - * If a {@link placeholders placeholder}, calling the returned function object forwards an argument passed to the - * call (the one whose order number is specified by the placeholder). - *
    • - *
    - * - *

    Calling the returned object returns the same type as fn.

    - * - * @param fn A function object, pointer to function or pointer to member. - * @param args List of arguments to bind: either values, or {@link placeholders}. - * - * @return A function object that, when called, calls fn with its arguments bound to args. If fn is - * a pointer to member, the first argument expected by the returned function is an object of the class fn - * is a member. - */ - function bind(fn: (...args: any[]) => Ret, ...args: any[]): (...args: any[]) => Ret; - /** - *

    Bind function arguments.

    - * - *

    Returns a function object based on fn, but with its arguments bound to args.

    - * - *

    Each argument may either be bound to a value or be a {@link placeholders placeholder}:

    - *
      - *
    • If bound to a value, calling the returned function object will always use that value as argument.
    • - *
    • - * If a {@link placeholders placeholder}, calling the returned function object forwards an argument passed to the - * call (the one whose order number is specified by the placeholder). - *
    • - *
    - * - *

    Calling the returned object returns the same type as fn.

    - * - * @param fn A function object, pointer to function or pointer to member. - * @param thisArg This argument, owner object of the member method fn. - * @param args List of arguments to bind: either values, or {@link placeholders}. - * - * @return A function object that, when called, calls fn with its arguments bound to args. If fn is - * a pointer to member, the first argument expected by the returned function is an object of the class fn - * is a member. - */ - function bind(fn: (...args: any[]) => Ret, thisArg: T, ...args: any[]): (...args: any[]) => Ret; -} -/** - *

    Bind argument placeholders.

    - * - *
    - * - *

    When the function object returned by bind is called, an argument with placeholder {@link _1} is replaced by the - * first argument in the call, {@link _2} is replaced by the second argument in the call, and so on... For example:

    - * - * - * let vec: Vector = new Vector(); - * - * let bind = std.bind(Vector.insert, _1, vec.end(), _2, _3); - * bind.apply(vec, 5, 1); // vec.insert(vec.end(), 5, 1); - * // [1, 1, 1, 1, 1] - * - * - *

    When a call to {@link bind} is used as a subexpression in another call to bind, the {@link placeholders} - * are relative to the outermost {@link bind} expression.

    - * - * @reference http://www.cplusplus.com/reference/functional/placeholders/ - * @author Jeongho Nam - */ -declare namespace std.placeholders { - /** - * @hidden - */ - class PlaceHolder { - private index_; - constructor(index: number); - index: number; - } - /** - * Replaced by the first argument in the function call. - */ - const _1: PlaceHolder; - /** - * Replaced by the second argument in the function call. - */ - const _2: PlaceHolder; - /** - * Replaced by the third argument in the function call. - */ - const _3: PlaceHolder; - const _4: PlaceHolder; - const _5: PlaceHolder; - const _6: PlaceHolder; - const _7: PlaceHolder; - const _8: PlaceHolder; - const _9: PlaceHolder; - const _10: PlaceHolder; - const _11: PlaceHolder; - const _12: PlaceHolder; - const _13: PlaceHolder; - const _14: PlaceHolder; - const _15: PlaceHolder; - const _16: PlaceHolder; - const _17: PlaceHolder; - const _18: PlaceHolder; - const _19: PlaceHolder; - const _20: PlaceHolder; -} -declare namespace std.base { - /** - *

    An abstract map.

    - * - *

    {@link MapContainer MapContainers} are associative containers that store elements formed by a combination - * of a key value (Key) and a mapped value (T), and which allows for fast retrieval - * of individual elements based on their keys.

    - * - *

    In a {@link MapContainer}, the key values are generally used to identify the elements, while the - * mapped values store the content associated to this key. The types of key and - * mapped value may differ, and are grouped together in member type value_type, which is a - * {@link Pair} type combining both:

    - * - *

    typedef pair value_type;

    - * - *

    {@link MapContainer} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute position - * in the container. - *
    - * - *
    Map
    - *
    - * Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value. - *
    - *
    - * - * @param Type of the keys. Each element in a map is identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @author Jeongho Nam - */ - abstract class MapContainer extends Container> { - /** - *

    {@link List} storing elements.

    - * - *

    Storing elements and keeping those sequence of the {@link MapContainer} are implemented by - * {@link data_ this list container}. Implementing index-table is also related with {@link data_ this list} - * by storing {@link ListIterator iterators} ({@link MapIterator} references {@link ListIterator}) who are - * created from {@link data_ here}.

    - */ - private data_; - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - assign>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - clear(): void; - /** - *

    Get iterator to element.

    - * - *

    Searches the container for an element with a identifier equivalent to key and returns an - * iterator to it if found, otherwise it returns an iterator to {@link end end()}.

    - * - *

    Two keys are considered equivalent if the container's comparison object returns false reflexively - * (i.e., no matter the order in which the elements are passed as arguments).

    - * - *

    Another member functions, {@link has has()} and {@link count count()}, can be used to just check - * whether a particular key exists.

    - * - * @param key Key to be searched for - * @return An iterator to the element, if an element with specified key is found, or - * {@link end end()} otherwise. - */ - abstract find(key: Key): MapIterator; - /** - *

    Return iterator to beginning.

    - * - *

    Returns an iterator referring the first element in the

    - * - *

    Note

    - *

    If the container is {@link empty}, the returned iterator is same with {@link end end()}.

    - * - * @return An iterator to the first element in the The iterator containes the first element's value. - */ - begin(): MapIterator; - /** - *

    Return iterator to end.

    - *

    Returns an iterator referring to the past-the-end element in the

    - * - *

    The past-the-end element is the theoretical element that would follow the last element in the - * It does not point to any element, and thus shall not be dereferenced.

    - * - *

    Because the ranges used by functions of the container do not include the element reference by their - * closing iterator, this function is often used in combination with {@link MapContainer}.{@link begin} to - * specify a range including all the elements in the

    - * - *

    Note

    - *

    Returned iterator from {@link MapContainer}.{@link end} does not refer any element. Trying to accessing - * element by the iterator will cause throwing exception ({@link OutOfRange}).

    - * - *

    If the container is {@link empty}, this function returns the same as {@link begin}.

    - * - * @return An iterator to the end element in the - */ - end(): MapIterator; - /** - *

    Return {@link MapReverseIterator reverse iterator} to reverse beginning.

    - * - *

    Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in the container - * (i.e., its reverse beginning).

    - * - * {@link MapReverseIterator Reverse iterators} iterate backwards: increasing them moves them towards the - * beginning of the container.

    - * - *

    {@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}. - *

    - * - * @return A {@link MapReverseIterator reverse iterator} to the reverse beginning of the sequence - * - */ - rbegin(): MapReverseIterator; - /** - *

    Return {@link MapReverseIterator reverse iterator} to reverse end.

    - * - *

    Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before - * the first element in the {@link MapContainer map container} (which is considered its reverse end). - *

    - * - *

    The range between {@link MapContainer}.{@link rbegin} and {@link MapContainer}.{@link rend} contains - * all the elements of the container (in reverse order).

    - * - * @return A {@link MapReverseIterator reverse iterator} to the reverse end of the sequence - */ - rend(): MapReverseIterator; - /** - *

    Whether have the item or not.

    - * - *

    Indicates whether a map has an item having the specified identifier.

    - * - * @param key Key value of the element whose mapped value is accessed. - * - * @return Whether the map has an item having the specified identifier. - */ - has(key: Key): boolean; - /** - *

    Count elements with a specific key.

    - * - *

    Searches the container for elements whose key is key and returns the number of elements found.

    - * - * @param key Key value to be searched for. - * - * @return The number of elements in the container with a key. - */ - abstract count(key: Key): number; - /** - * Return the number of elements in the map. - */ - size(): number; - protected _Get_data(): List>; - /** - * @inheritdoc - */ - push(...args: Pair[]): number; - /** - * @inheritdoc - */ - push(...args: [Key, T][]): number; - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting a new element, effectively increasing the container {@link size} - * by the number of element inserted (zero or one).

    - * - * @param hint Hint for the position where the element can be inserted. - * @param pair {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapIterator, pair: Pair): MapIterator; - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting a new element, effectively increasing the container {@link size} - * by the number of element inserted (zero or one).

    - * - * @param hint Hint for the position where the element can be inserted. - * @param pair {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} - * by the number of elements inserted.

    - * - * @param hint Hint for the position where the element can be inserted. - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapIterator, tuple: [L, U]): MapIterator; - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} - * by the number of elements inserted.

    - * - * @param hint Hint for the position where the element can be inserted. - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; - /** - *

    Insert elements from range iterators.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

    - * - * @param begin Input iterator specifying initial position of a range of elements. - * @param end Input iterator specifying final position of a range of elements. - * Notice that the range includes all the elements between begin and end, - * including the element pointed by begin but not the one pointed by end. - */ - insert>>(first: InputIterator, last: InputIterator): void; - /** - * @hidden - */ - protected abstract _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - private insert_by_tuple(tuple); - /** - * @hidden - */ - protected abstract _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - private insert_by_hint_with_tuple(hint, tuple); - /** - * @hidden - */ - protected abstract _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - *

    Erase an elemet by key.

    - * - *

    Removes from the {@link MapContainer map container} a single element.

    - * - *

    This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.

    - * - * @param key Key of the element to be removed from the {@link MapContainer}. - */ - erase(key: Key): number; - /** - *

    Erase an elemet by iterator.

    - * - *

    Removes from the {@link MapContainer map container} a single element.

    - * - *

    This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.

    - * - * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. - */ - erase(it: MapIterator): MapIterator; - /** - *

    Erase elements by range iterators.

    - * - *

    Removes from the {@link MapContainer map container} a range of elements.

    - * - *

    This effectively reduces the container {@link size} by the number of elements removed, which are - * destroyed.

    - * - * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * @param end An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * Notice that the range includes all the elements between begin and end, - * including the element pointed by begin but not the one pointed by end. - */ - erase(begin: MapIterator, end: MapIterator): MapIterator; - /** - *

    Erase an elemet by iterator.

    - * - *

    Removes from the {@link MapContainer map container} a single element.

    - * - *

    This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.

    - * - * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. - */ - erase(it: MapReverseIterator): MapReverseIterator; - /** - *

    Erase elements by range iterators.

    - * - *

    Removes from the {@link MapContainer map container} a range of elements.

    - * - *

    This effectively reduces the container {@link size} by the number of elements removed, which are - * destroyed.

    - * - * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * @param end An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * Notice that the range includes all the elements between begin and end, - * including the element pointed by begin but not the one pointed by end. - */ - erase(begin: MapReverseIterator, end: MapReverseIterator): MapReverseIterator; - /** - * @hidden - */ - private erase_by_key(key); - /** - * @hidden - */ - private erase_by_iterator(first, last?); - /** - * @hidden - */ - private erase_by_range(begin, end); - /** - *

    Abstract method handling insertions for indexing.

    - * - *

    This method, {@link handle_insert} is designed to register the first to last to somewhere storing - * those {@link MapIterator iterators} for indexing, fast accessment and retrievalance.

    - * - *

    When {@link insert} is called, new elements will be inserted into the {@link data_ list container} and new - * {@link MapIterator iterators} first to last, pointing the inserted elements, will be created and the - * newly created iterators first to last will be shifted into this method {@link handle_insert} after the - * insertions.

    - * - *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators} - * will be registered into the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * registered into the {@link HashSet.hash_buckets_ hash bucket}.

    - * - * @param first An {@link MapIterator} to the initial position in a sequence. - * @param last An {@link MapIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - */ - protected abstract _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - *

    Abstract method handling deletions for indexing.

    - * - *

    This method, {@link handle_insert} is designed to unregister the first to last to somewhere storing - * those {@link MapIterator iterators} for indexing, fast accessment and retrievalance.

    - * - *

    When {@link erase} is called with first to last, {@link MapIterator iterators} positioning somewhere - * place to be deleted, is memorized and shifted to this method {@link handle_erase} after the deletion process is - * terminated.

    - * - *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators} - * will be unregistered from the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * unregistered from the {@link HashSet.hash_buckets_ hash bucket}.

    - * - * @param first An {@link MapIterator} to the initial position in a sequence. - * @param last An {@link MapIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - */ - protected abstract _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - * @hidden - */ - protected _Swap(obj: MapContainer): void; - } -} -declare namespace std { - /** - *

    An iterator of {@link MapContainer map container}.

    - * - *

    - *

    - * - * @author Jeongho Nam - */ - class MapIterator extends Iterator> implements IComparable> { - /** - * A {@link ListIterator} pointing {@link Pair} of key and value. - */ - private list_iterator_; - /** - * Construct from the {@link MapContainer source map} and {@link ListIterator list iterator}. - * - * @param source The source {@link MapContainer}. - * @param list_iterator A {@link ListIterator} pointing {@link Pair} of key and value. - */ - constructor(source: base.MapContainer, list_iterator: ListIterator>); - /** - * Get iterator to previous element. - */ - prev(): MapIterator; - /** - * Get iterator to next element. - */ - next(): MapIterator; - /** - * Advances the Iterator by n element positions. - * - * @param step Number of element positions to advance. - * @return An advanced Iterator. - */ - advance(step: number): MapIterator; - /** - * @hidden - */ - private map; - /** - * Get ListIterator. - */ - get_list_iterator(): ListIterator>; - /** - * @inheritdoc - */ - value: Pair; - /** - * Get first, key element. - */ - first: Key; - /** - * Get second, value element. - */ - /** - * Set second value. - */ - second: T; - /** - *

    Whether an iterator is equal with the iterator.

    - * - *

    Compare two iterators and returns whether they are equal or not.

    - * - * @param obj An iterator to compare - * @return Indicates whether equal or not. - */ - equal_to(obj: MapIterator): boolean; - less(obj: MapIterator): boolean; - hash(): number; - swap(obj: MapIterator): void; - } - /** - *

    A reverse-iterator of {@link MapContainer map container}.

    - * - *

    - *

    - * - * @author Jeongho Nam - */ - class MapReverseIterator extends ReverseIterator, MapIterator, MapReverseIterator> { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: MapIterator); - /** - * @hidden - */ - protected create_neighbor(base: MapIterator): MapReverseIterator; - /** - * Get first, key element. - */ - first: Key; - /** - * Get second, value element. - */ - /** - * Set second value. - */ - second: T; - } -} -declare namespace std.base { - /** - *

    An abstract unique-map.

    - * - *

    {@link UniqueMap UniqueMaps} are associative containers that store elements formed by a combination of a - * key value (Key) and a mapped value (T), and which allows for fast retrieval of - * individual elements based on their keys.

    - * - *

    In a {@link MapContainer}, the key values are generally used to uniquely identify the elements, - * while the mapped values store the content associated to this key. The types of key and - * mapped value may differ, and are grouped together in member type value_type, which is a - * {@link Pair} type combining both:

    - * - *

    typedef pair value_type;

    - * - *

    {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute position - * in the container. - *
    - * - *
    Map
    - *
    - * Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value. - *
    - * - *
    Unique keys
    - *
    No two elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the keys. Each element in a map is uniquely identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @author Jeongho Nam - */ - abstract class UniqueMap extends MapContainer { - /** - * @inheritdoc - */ - count(key: Key): number; - /** - *

    Get an element

    - * - *

    Returns a reference to the mapped value of the element identified with key.

    - * - * @param key Key value of the element whose mapped value is accessed. - * - * @throw exception out of range - * - * @return A reference object of the mapped value (_Ty) - */ - get(key: Key): T; - /** - *

    Set an item as the specified identifier.

    - * - *

    If the identifier is already in map, change value of the identifier. If not, then insert the object - * with the identifier.

    - * - * @param key Key value of the element whose mapped value is accessed. - * @param val Value, the item. - */ - set(key: Key, val: T): void; - /** - *

    Extract an element.

    - * - *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    - * - * @param key Key value of the element whose mapped value is accessed. - * - * @return A {@link Pair} containing the value pointed to by key. - */ - extract(key: Key): Pair; - /** - *

    Extract an element.

    - * - *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    - * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: MapIterator): MapIterator; - /** - *

    Extract an element.

    - * - *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    - * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: MapReverseIterator): MapReverseIterator; - /** - * @hidden - */ - private extract_by_key(key); - /** - * @hidden - */ - private extract_by_iterator(it); - /** - * @hidden - */ - private extract_by_reverse_iterator(it); - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by - * one.

    - * - *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is not inserted, returning an iterator to this existing element (if the function - * returns a value).

    - * - *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    - * - * @param pair {@link Pair} to be inserted as an element. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent key already existed. - */ - insert(pair: Pair): Pair, boolean>; - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting a new element, effectively increasing the container size by the - * number of elements inserted.

    - * - *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is not inserted, returning an iterator to this existing element (if the function - * returns a value).

    - * - *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    - * - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent key already existed. - */ - insert(tuple: [L, U]): Pair, boolean>; - /** - * @inheritdoc - */ - insert(hint: MapIterator, pair: Pair): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; - /** - * @inheritdoc - */ - insert(hint: MapIterator, tuple: [L, U]): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; - /** - * @inheritdoc - */ - insert>>(first: InputIterator, last: InputIterator): void; - /** - *

    Insert or assign an element.

    - * - *

    Inserts an element or assigns to the current element if the key already exists.

    - * - *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).

    - * - *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    - * - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent key already existed so the value is assigned. - */ - insert_or_assign(key: Key, value: T): Pair, boolean>; - /** - *

    Insert or assign an element.

    - * - *

    Inserts an element or assigns to the current element if the key already exists.

    - * - *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).

    - * - *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    - * - * @param hint Hint for the position where the element can be inserted. - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link UniqueMap}. - */ - insert_or_assign(hint: MapIterator, key: Key, value: T): MapIterator; - /** - *

    Insert or assign an element.

    - * - *

    Inserts an element or assigns to the current element if the key already exists.

    - * - *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).

    - * - *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    - * - * @param hint Hint for the position where the element can be inserted. - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link UniqueMap}. - */ - insert_or_assign(hint: MapReverseIterator, key: Key, value: T): MapReverseIterator; - /** - * @hidden - */ - private insert_or_assign_with_key_value(key, value); - /** - * @hidden - */ - private insert_or_assign_with_hint(hint, key, value); - } -} -declare namespace std.base { - /** - *

    An abstract multi-map.

    - * - *

    {@link MultiMap MultiMaps} are associative containers that store elements formed by a combination of a - * key value (Key) and a mapped value (T), and which allows for fast retrieval of - * individual elements based on their keys.

    - * - *

    In a {@link MapContainer}, the key values are generally used to identify the elements, while the - * mapped values store the content associated to this key. The types of key and - * mapped value may differ, and are grouped together in member type value_type, which is a - * {@link Pair} type combining both:

    - * - *

    typedef pair value_type;

    - * - *

    {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute position - * in the container. - *
    - * - *
    Map
    - *
    - * Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value. - *
    - * - *
    Multiple equivalent keys
    - *
    Multiple elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the keys. Each element in a map is identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @author Jeongho Nam - */ - abstract class MultiMap extends MapContainer { - /** - *

    Insert elements.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

    - * - * @param pair {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to the newly inserted element. - */ - insert(pair: Pair): MapIterator; - /** - *

    Insert elements.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

    - * - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to the newly inserted element. - */ - insert(tuple: [L, U]): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapIterator, pair: Pair): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; - /** - * @inheritdoc - */ - insert(hint: MapIterator, tuple: [L, U]): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; - /** - * @inheritdoc - */ - insert>>(first: InputIterator, last: InputIterator): void; - } -} -declare namespace std.HashMap { - type iterator = std.MapIterator; - type reverse_iterator = std.MapReverseIterator; -} -declare namespace std { - /** - *

    Hashed, unordered map.

    - * - *

    {@link HashMap}s are associative containers that store elements formed by the combination of a key value - * and a mapped value, and which allows for fast retrieval of individual elements based on their keys. - *

    - * - *

    In an {@link HashMap}, the key value is generally used to uniquely identify the element, while the - * mapped value is an object with the content associated to this key. Types of key and - * mapped value may differ.

    - * - *

    Internally, the elements in the {@link HashMap} are not sorted in any particular order with respect to either - * their key or mapped values, but organized into buckets depending on their hash values to allow - * for fast access to individual elements directly by their key values (with a constant average time complexity - * on average).

    - * - *

    {@link HashMap} containers are faster than {@link TreeMap} containers to access individual elements by their - * key, although they are generally less efficient for range iteration through a subset of their elements.

    - * - *

    - * - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
    - * - *
    Hashed
    - *
    Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
    - * - *
    Map
    - *
    Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value.
    - * - *
    Unique keys
    - *
    No two elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the key values. - * Each element in an {@link HashMap} is uniquely identified by its key value. - * @param Type of the mapped value. - * Each element in an {@link HashMap} is used to store some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/unordered_map/unordered_map - * @author Jeongho Nam - */ - class HashMap extends base.UniqueMap implements base.IHashMap { - /** - * @hidden - */ - private hash_buckets_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from elements. - */ - constructor(items: Pair[]); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - */ - constructor(array: [Key, T][]); - /** - * Copy Constructor. - */ - constructor(container: HashMap); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator>, end: Iterator>); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: Key): MapIterator; - /** - * @inheritdoc - */ - begin(): MapIterator; - /** - * @inheritdoc - */ - begin(index: number): MapIterator; - /** - * @inheritdoc - */ - end(): MapIterator; - /** - * @inheritdoc - */ - end(index: number): MapIterator; - /** - * @inheritdoc - */ - rbegin(): MapReverseIterator; - /** - * @inheritdoc - */ - rbegin(index: number): MapReverseIterator; - /** - * @inheritdoc - */ - rend(): MapReverseIterator; - /** - * @inheritdoc - */ - rend(index: number): MapReverseIterator; - /** - * @inheritdoc - */ - bucket_count(): number; - /** - * @inheritdoc - */ - bucket_size(index: number): number; - /** - * @inheritdoc - */ - max_load_factor(): number; - /** - * @inheritdoc - */ - max_load_factor(z: number): void; - /** - * @inheritdoc - */ - bucket(key: Key): number; - /** - * @inheritdoc - */ - reserve(n: number): void; - /** - * @inheritdoc - */ - rehash(n: number): void; - /** - * @hidden - */ - protected _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link HashMap map} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link HashMap map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashMap container}. - */ - swap(obj: HashMap): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer>): void; - } -} -declare namespace std.HashMultiMap { - type iterator = std.MapIterator; - type reverse_iterator = std.MapReverseIterator; -} -declare namespace std { - /** - *

    Hashed, unordered Multimap.

    - * - *

    {@link HashMultiMap}s are associative containers that store elements formed by the combination of - * a key value and a mapped value, much like {@link HashMultiMap} containers, but allowing - * different elements to have equivalent keys.

    - * - *

    In an {@link HashMultiMap}, the key value is generally used to uniquely identify the - * element, while the mapped value is an object with the content associated to this key. - * Types of key and mapped value may differ.

    - * - *

    Internally, the elements in the {@link HashMultiMap} are not sorted in any particular order with - * respect to either their key or mapped values, but organized into buckets depending on - * their hash values to allow for fast access to individual elements directly by their key values - * (with a constant average time complexity on average).

    - * - *

    Elements with equivalent keys are grouped together in the same bucket and in such a way that - * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

    - * - *

    - * - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
    - * - *
    Hashed
    - *
    Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
    - * - *
    Map
    - *
    Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value.
    - * - *
    Multiple equivalent keys
    - *
    The container can hold multiple elements with equivalent keys.
    - *
    - * - * @param Type of the key values. - * Each element in an {@link HashMultiMap} is identified by a key value. - * @param Type of the mapped value. - * Each element in an {@link HashMultiMap} is used to store some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/unordered_map/unordered_multimap - * @author Jeongho Nam - */ - class HashMultiMap extends base.MultiMap { - /** - * @hidden - */ - private hash_buckets_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from elements. - */ - constructor(items: Pair[]); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - */ - constructor(array: [Key, T][]); - /** - * Copy Constructor. - */ - constructor(container: HashMultiMap); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator>, end: Iterator>); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: Key): MapIterator; - /** - * @inheritdoc - */ - count(key: Key): number; - /** - * @inheritdoc - */ - begin(): MapIterator; - /** - * @inheritdoc - */ - begin(index: number): MapIterator; - /** - * @inheritdoc - */ - end(): MapIterator; - /** - * @inheritdoc - */ - end(index: number): MapIterator; - /** - * @inheritdoc - */ - rbegin(): MapReverseIterator; - /** - * @inheritdoc - */ - rbegin(index: number): MapReverseIterator; - /** - * @inheritdoc - */ - rend(): MapReverseIterator; - /** - * @inheritdoc - */ - rend(index: number): MapReverseIterator; - /** - * @inheritdoc - */ - bucket_count(): number; - /** - * @inheritdoc - */ - bucket_size(n: number): number; - /** - * @inheritdoc - */ - max_load_factor(): number; - /** - * @inheritdoc - */ - max_load_factor(z: number): void; - /** - * @inheritdoc - */ - bucket(key: Key): number; - /** - * @inheritdoc - */ - reserve(n: number): void; - /** - * @inheritdoc - */ - rehash(n: number): void; - /** - * @hidden - */ - protected _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link HashMultiMap map} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link HashMultiMap map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashMultiMap container}. - */ - swap(obj: HashMultiMap): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer>): void; - } -} -declare namespace std.base { - /** - *

    An abstract set.

    - * - *

    {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.

    - * - *

    In an {@link SetContainer}, the value of an element is at the same time its key, used to - * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be - * modified once in the container - they can be inserted and removed, though.

    - * - *

    {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - *
    - * - * @param Type of the elements. Each element in a {@link SetContainer} container is also identified - * by this value (each value is itself also the element's key). - * - * @author Jeongho Nam - */ - abstract class SetContainer extends Container { - /** - *

    {@link List} storing elements.

    - * - *

    Storing elements and keeping those sequence of the {@link SetContainer} are implemented by - * {@link data_ this list container}. Implementing index-table is also related with {@link data_ this list} - * by storing {@link ListIterator iterators} ({@link SetIterator} references {@link ListIterator}) who are - * created from {@link data_ here}.

    - */ - private data_; - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - assign>(begin: Iterator, end: Iterator): void; - /** - * @inheritdoc - */ - clear(): void; - /** - *

    Get iterator to element.

    - * - *

    Searches the container for an element with key as value and returns an iterator to it if found, - * otherwise it returns an iterator to {@link end end()} (the element past the end of the container).

    - * - *

    Another member function, {@link count count()}, can be used to just check whether a particular element - * exists.

    - * - * @param key Key to be searched for. - * - * @return An iterator to the element, if the specified value is found, or {@link end end()} if it is not - * found in the - */ - abstract find(val: T): SetIterator; - /** - * @inheritdoc - */ - begin(): SetIterator; - /** - * @inheritdoc - */ - end(): SetIterator; - /** - * @inheritdoc - */ - rbegin(): SetReverseIterator; - /** - * @inheritdoc - */ - rend(): SetReverseIterator; - /** - *

    Whether have the item or not.

    - * - *

    Indicates whether a set has an item having the specified identifier.

    - * - * @param key Key value of the element whose mapped value is accessed. - * - * @return Whether the set has an item having the specified identifier. - */ - has(val: T): boolean; - /** - *

    Count elements with a specific key.

    - * - *

    Searches the container for elements with a value of k and returns the number of elements found.

    - * - * @param key Value of the elements to be counted. - * - * @return The number of elements in the container with a key. - */ - abstract count(val: T): number; - /** - * @inheritdoc - */ - size(): number; - /** - * @hidden - */ - _Get_data(): List; - /** - * @inheritdoc - */ - push(...args: U[]): number; - /** - *

    Insert an element with hint.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.

    - * - * @param hint Hint for the position where the element can be inserted. - * @param val Value to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had its - * same value in the {@link SetContainer}. - */ - insert(hint: SetIterator, val: T): SetIterator; - /** - *

    Insert an element with hint.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.

    - * - * @param hint Hint for the position where the element can be inserted. - * @param val Value to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had its - * same value in the {@link SetContainer}. - */ - insert(hint: SetReverseIterator, val: T): SetReverseIterator; - /** - *

    Insert elements with a range of a

    - * - *

    Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.

    - * - * @param begin An iterator specifying range of the begining element. - * @param end An iterator specifying range of the ending element. - */ - insert>(begin: InputIterator, end: InputIterator): void; - /** - * @hidden - */ - protected abstract _Insert_by_val(val: T): any; - /** - * @hidden - */ - protected abstract _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected abstract _Insert_by_range>(begin: InputIterator, end: InputIterator): void; - /** - *

    Erase an element.

    - *

    Removes from the set container the elements whose value is key.

    - * - *

    This effectively reduces the container size by the number of elements removed.

    - * - * @param key Value of the elements to be erased. - * - * @return Number of elements erased. - */ - erase(val: T): number; - /** - * @inheritdoc - */ - erase(it: SetIterator): SetIterator; - /** - *

    Erase elements.

    - *

    Removes from the set container a range of elements..

    - * - *

    This effectively reduces the container size by the number of elements removed.

    - * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - */ - erase(begin: SetIterator, end: SetIterator): SetIterator; - /** - * @inheritdoc - */ - erase(it: SetReverseIterator): SetReverseIterator; - /** - *

    Erase elements.

    - *

    Removes from the set container a range of elements..

    - * - *

    This effectively reduces the container size by the number of elements removed.

    - * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - */ - erase(begin: SetReverseIterator, end: SetReverseIterator): SetReverseIterator; - /** - * @hidden - */ - private erase_by_iterator(first, last?); - /** - * @hidden - */ - private erase_by_val(val); - /** - * @hidden - */ - private erase_by_range(begin, end); - /** - *

    Abstract method handling insertions for indexing.

    - * - *

    This method, {@link handle_insert} is designed to register the first to last to somewhere storing - * those {@link SetIterator iterators} for indexing, fast accessment and retrievalance.

    - * - *

    When {@link insert} is called, new elements will be inserted into the {@link data_ list container} and new - * {@link SetIterator iterators} first to last, pointing the inserted elements, will be created and the - * newly created iterators first to last will be shifted into this method {@link handle_insert} after the - * insertions.

    - * - *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link SetIterator iterators} - * will be registered into the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * registered into the {@link HashSet.hash_buckets_ hash bucket}.

    - * - * @param first An {@link SetIterator} to the initial position in a sequence. - * @param last An {@link SetIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - */ - protected abstract _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - *

    Abstract method handling deletions for indexing.

    - * - *

    This method, {@link handle_insert} is designed to unregister the first to last to somewhere storing - * those {@link SetIterator iterators} for indexing, fast accessment and retrievalance.

    - * - *

    When {@link erase} is called with first to last, {@link SetIterator iterators} positioning somewhere - * place to be deleted, is memorized and shifted to this method {@link handle_erase} after the deletion process is - * terminated.

    - * - *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link SetIterator iterators} - * will be unregistered from the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * unregistered from the {@link HashSet.hash_buckets_ hash bucket}.

    - * - * @param first An {@link SetIterator} to the initial position in a sequence. - * @param last An {@link SetIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - */ - protected abstract _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - * @hidden - */ - protected _Swap(obj: SetContainer): void; - } -} -declare namespace std { - /** - *

    An iterator of a Set.

    - * - *

    - *

    - * - * @author Jeongho Nam - */ - class SetIterator extends Iterator implements IComparable> { - private list_iterator_; - /** - *

    Construct from source and index number.

    - * - *

    Note

    - *

    Do not create iterator directly.

    - *

    Use begin(), find() or end() in Map instead.

    - * - * @param map The source Set to reference. - * @param index Sequence number of the element in the source Set. - */ - constructor(source: base.SetContainer, it: ListIterator); - /** - * @inheritdoc - */ - prev(): SetIterator; - /** - * @inheritdoc - */ - next(): SetIterator; - /** - * @inheritdoc - */ - advance(size: number): SetIterator; - /** - * @hidden - */ - private set; - get_list_iterator(): ListIterator; - /** - * @inheritdoc - */ - value: T; - /** - * @inheritdoc - */ - equal_to(obj: SetIterator): boolean; - /** - * @inheritdoc - */ - less(obj: SetIterator): boolean; - /** - * @inheritdoc - */ - hash(): number; - /** - * @inheritdoc - */ - swap(obj: SetIterator): void; - } - /** - *

    A reverse-iterator of Set.

    - * - *

    - *

    - * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class SetReverseIterator extends ReverseIterator, SetReverseIterator> { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: SetIterator); - /** - * @hidden - */ - protected create_neighbor(base: SetIterator): SetReverseIterator; - } -} -declare namespace std.base { - /** - *

    An abstract set.

    - * - *

    {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.

    - * - *

    In an {@link SetContainer}, the value of an element is at the same time its key, used to - * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be - * modified once in the container - they can be inserted and removed, though.

    - * - *

    {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - * - *
    Multiple equivalent keys
    - *
    Multiple elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the elements. Each element in a {@link SetContainer} container is also identified - * by this value (each value is itself also the element's key). - * - * @author Jeongho Nam - */ - abstract class MultiSet extends SetContainer { - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

    - * - * @param key Value to be inserted as an element. - * - * @return An iterator to the newly inserted element. - */ - insert(val: T): SetIterator; - /** - * @inheritdoc - */ - insert(hint: SetIterator, val: T): SetIterator; - /** - * @inheritdoc - */ - insert(hint: SetReverseIterator, val: T): SetReverseIterator; - /** - * @inheritdoc - */ - insert>(begin: InputIterator, end: InputIterator): void; - } -} -declare namespace std.HashMultiSet { - type iterator = std.SetIterator; - type reverse_iterator = std.SetReverseIterator; -} -declare namespace std { - /** - *

    Hashed, unordered Multiset.

    - * - *

    {@link HashMultiSet HashMultiSets} are containers that store elements in no particular order, allowing fast - * retrieval of individual elements based on their value, much like {@link HashMultiSet} containers, - * but allowing different elements to have equivalent values.

    - * - *

    In an {@link HashMultiSet}, the value of an element is at the same time its key, used to - * identify it. Keys are immutable, therefore, the elements in an {@link HashMultiSet} cannot be - * modified once in the container - they can be inserted and removed, though.

    - * - *

    Internally, the elements in the {@link HashMultiSet} are not sorted in any particular, but - * organized into buckets depending on their hash values to allow for fast access to individual - * elements directly by their values (with a constant average time complexity on average).

    - * - *

    Elements with equivalent values are grouped together in the same bucket and in such a way that an - * iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
    - * - *
    Hashed
    - *
    Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - * - *
    Multiple equivalent keys
    - *
    The container can hold multiple elements with equivalent keys.
    - *
    - * - * @param Type of the elements. - * Each element in an {@link UnorderedMultiSet} is also identified by this value.. - * - * @reference http://www.cplusplus.com/reference/unordered_set/unordered_multiset - * @author Jeongho Nam - */ - class HashMultiSet extends base.MultiSet { - /** - * @hidden - */ - private hash_buckets_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from elements. - */ - constructor(items: T[]); - /** - * Copy Constructor. - */ - constructor(container: HashMultiSet); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: T): SetIterator; - /** - * @inheritdoc - */ - count(key: T): number; - /** - * @inheritdoc - */ - begin(): SetIterator; - /** - * @inheritdoc - */ - begin(index: number): SetIterator; - /** - * @inheritdoc - */ - end(): SetIterator; - /** - * @inheritdoc - */ - end(index: number): SetIterator; - /** - * @inheritdoc - */ - rbegin(): SetReverseIterator; - /** - * @inheritdoc - */ - rbegin(index: number): SetReverseIterator; - /** - * @inheritdoc - */ - rend(): SetReverseIterator; - /** - * @inheritdoc - */ - rend(index: number): SetReverseIterator; - /** - * @inheritdoc - */ - bucket_count(): number; - /** - * @inheritdoc - */ - bucket_size(n: number): number; - /** - * @inheritdoc - */ - max_load_factor(): number; - /** - * @inheritdoc - */ - max_load_factor(z: number): void; - /** - * @inheritdoc - */ - bucket(key: T): number; - /** - * @inheritdoc - */ - reserve(n: number): void; - /** - * @inheritdoc - */ - rehash(n: number): void; - /** - * @hidden - */ - protected _Insert_by_val(val: T): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link HashMultiSet set} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link HashMultiSet set container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashMultiSet container}. - */ - swap(obj: HashMultiSet): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std.base { - /** - *

    An abstract set.

    - * - *

    {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.

    - * - *

    In an {@link SetContainer}, the value of an element is at the same time its key, used to uniquely - * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be modified - * once in the container - they can be inserted and removed, though.

    - * - *

    {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - * - *
    Unique keys
    - *
    No two elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the elements. Each element in a {@link SetContainer} container is also identified - * by this value (each value is itself also the element's key). - * - * @author Jeongho Nam - */ - abstract class UniqueSet extends SetContainer { - /** - * @inheritdoc - */ - count(key: T): number; - /** - *

    Extract an element.

    - * - *

    Extracts the element pointed to by val and erases it from the {@link UniqueSet}.

    - * - * @param val Value to be extracted. - * - * @return A value. - */ - extract(val: T): T; - /** - *

    Extract an element.

    - * - *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    - * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: SetIterator): SetIterator; - /** - *

    Extract an element.

    - * - *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    - * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: SetReverseIterator): SetReverseIterator; - /** - * @hidden - */ - private extract_by_key(val); - /** - * @hidden - */ - private extract_by_iterator(it); - /** - * @hidden - */ - private extract_by_reverse_iterator(it); - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of element inserted (zero or one).

    - * - *

    Because elements in a {@link UniqueSet UniqueSets} are unique, the insertion operation checks whether - * each inserted element is equivalent to an element already in the container, and if so, the element is not - * inserted, returning an iterator to this existing element (if the function returns a value).

    - * - *

    For a similar container allowing for duplicate elements, see {@link MultiSet}.

    - * - * @param key Value to be inserted as an element. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the equivalent element already in the {@link UniqueSet}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent element already existed. - */ - insert(val: T): Pair, boolean>; - /** - * @inheritdoc - */ - insert(hint: SetIterator, val: T): SetIterator; - /** - * @inheritdoc - */ - insert(hint: SetReverseIterator, val: T): SetReverseIterator; - /** - * @inheritdoc - */ - insert>(begin: InputIterator, end: InputIterator): void; - } -} -declare namespace std.HashSet { - type iterator = std.SetIterator; - type reverse_iterator = std.SetReverseIterator; -} -declare namespace std { - /** - *

    Hashed, unordered set.

    - * - *

    {@link HashSet}s are containers that store unique elements in no particular order, and which - * allow for fast retrieval of individual elements based on their value.

    - * - *

    In an {@link HashSet}, the value of an element is at the same time its key, that - * identifies it uniquely. Keys are immutable, therefore, the elements in an {@link HashSet} cannot be - * modified once in the container - they can be inserted and removed, though.

    - * - *

    Internally, the elements in the {@link HashSet} are not sorted in any particular order, but - * organized into buckets depending on their hash values to allow for fast access to individual elements - * directly by their values (with a constant average time complexity on average).

    - * - *

    {@link HashSet} containers are faster than {@link TreeSet} containers to access individual - * elements by their key, although they are generally less efficient for range iteration through a - * subset of their elements.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
    - * - *
    Hashed
    - *
    Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - * - *
    Unique keys
    - *
    No two elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the elements. - * Each element in an {@link HashSet} is also uniquely identified by this value. - * - * @reference http://www.cplusplus.com/reference/unordered_set/unordered_set - * @author Jeongho Nam - */ - class HashSet extends base.UniqueSet implements base.IHashSet { - /** - * @hidden - */ - private hash_buckets_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from elements. - */ - constructor(items: T[]); - /** - * Copy Constructor. - */ - constructor(container: HashSet); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: T): SetIterator; - /** - * @inheritdoc - */ - begin(): SetIterator; - /** - * @inheritdoc - */ - begin(index: number): SetIterator; - /** - * @inheritdoc - */ - end(): SetIterator; - /** - * @inheritdoc - */ - end(index: number): SetIterator; - /** - * @inheritdoc - */ - rbegin(): SetReverseIterator; - /** - * @inheritdoc - */ - rbegin(index: number): SetReverseIterator; - /** - * @inheritdoc - */ - rend(): SetReverseIterator; - /** - * @inheritdoc - */ - rend(index: number): SetReverseIterator; - /** - * @inheritdoc - */ - bucket_count(): number; - /** - * @inheritdoc - */ - bucket_size(n: number): number; - /** - * @inheritdoc - */ - max_load_factor(): number; - /** - * @inheritdoc - */ - max_load_factor(z: number): void; - /** - * @inheritdoc - */ - bucket(key: T): number; - /** - * @inheritdoc - */ - reserve(n: number): void; - /** - * @inheritdoc - */ - rehash(n: number): void; - /** - * @hidden - */ - protected _Insert_by_val(val: T): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link HashSet set} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link HashSet set container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashSet container}. - */ - swap(obj: HashSet): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std.List { - type iterator = std.ListIterator; - type reverse_iterator = std.ListReverseIterator; -} -declare namespace std { - /** - *

    Doubly linked list.

    - * - *

    {@link List}s are sequence containers that allow constant time insert and erase operations anywhere within the - * sequence, and iteration in both directions.

    - * - *

    List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements they - * contain in different and unrelated storage locations. The ordering is kept internally by the association to each - * element of a link to the element preceding it and a link to the element following it.

    - * - *

    They are very similar to forward_list: The main difference being that forward_list objects are single-linked - * lists, and thus they can only be iterated forwards, in exchange for being somewhat smaller and more efficient.

    - * - *

    Compared to other base standard sequence containers (array, vector and deque), lists perform generally better - * in inserting, extracting and moving elements in any position within the container for which an iterator has already - * been obtained, and therefore also in algorithms that make intensive use of these, like sorting algorithms.

    - * - *

    The main drawback of lists and forward_lists compared to these other sequence containers is that they lack - * direct access to the elements by their position; For example, to access the sixth element in a list, one has to - * iterate from a known position (like the beginning or the end) to that position, which takes linear time in the - * distance between these. They also consume some extra memory to keep the linking information associated to each - * element (which may be an important factor for large lists of small-sized elements).

    - * - *

    - * - *

    - * - *

    Container properties

    - *
    - *
    Sequence
    - *
    Elements in sequence containers are ordered in a strict linear sequence. Individual elements are accessed by - * their position in this sequence.
    - * - *
    Doubly-linked list
    - *
    Each element keeps information on how to locate the next and the previous elements, allowing constant time - * insert and erase operations before or after a specific element (even of entire ranges), but no direct random - * access.
    - *
    - * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/list/list/ - * @author Jeongho Nam - */ - class List extends base.Container implements base.IDequeContainer { - /** - * @hidden - */ - private begin_; - /** - * @hidden - */ - private end_; - /** - * @hidden - */ - private size_; - /** - *

    Default Constructor.

    - * - *

    Constructs an empty container, with no elements.

    - */ - constructor(); - /** - *

    Initializer list Constructor.

    - * - *

    Constructs a container with a copy of each of the elements in array, in the same order.

    - * - * @param array An array containing elements to be copied and contained. - */ - constructor(items: Array); - /** - *

    Fill Constructor.

    - * - *

    Constructs a container with n elements. Each element is a copy of val (if provided).

    - * - * @param n Initial container size (i.e., the number of elements in the container at construction). - * @param val Value to fill the container with. Each of the n elements in the container is - * initialized to a copy of this value. - */ - constructor(size: number, val: T); - /** - *

    Copy Constructor.

    - * - *

    Constructs a container with a copy of each of the elements in container, in the same order.

    - * - * @param container Another container object of the same type (with the same class template - * arguments T), whose contents are either copied or acquired. - */ - constructor(container: List); - /** - *

    Range Constructor.

    - * - *

    Constructs a container with as many elements as the range (begin, end), with each - * element emplace-constructed from its corresponding element in that range, in the same order.

    - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - assign(n: number, val: T): void; - /** - * @inheritdoc - */ - assign>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - begin(): ListIterator; - /** - * @inheritdoc - */ - end(): ListIterator; - /** - * @inheritdoc - */ - rbegin(): ListReverseIterator; - /** - * @inheritdoc - */ - rend(): ListReverseIterator; - /** - * @inheritdoc - */ - size(): number; - /** - * @inheritdoc - */ - front(): T; - /** - * @inheritdoc - */ - back(): T; - /** - * @inheritdoc - */ - push(...items: U[]): number; - /** - * @inheritdoc - */ - push_front(val: T): void; - /** - * @inheritdoc - */ - push_back(val: T): void; - /** - * @inheritdoc - */ - pop_front(): void; - /** - * @inheritdoc - */ - pop_back(): void; - /** - *

    Insert an element.

    - * - *

    The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    - * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Position in the container where the new element is inserted. - * {@link iterator}> is a member type, defined as a - * {@link ListIterator bidirectional iterator} type that points to elements. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the newly inserted element; val. - */ - insert(position: ListIterator, val: T): ListIterator; - /** - *

    Insert elements by repeated filling.

    - * - *

    The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    - * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListIterator bidirectional iterator} type that points to - * elements. - * @param size Number of elements to insert. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: ListIterator, size: number, val: T): ListIterator; - /** - *

    Insert elements by range iterators.

    - * - *

    The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    - * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListIterator bidirectional iterator} type that points to - * elements. - * @param begin An iterator specifying range of the begining element. - * @param end An iterator specifying range of the ending element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; - /** - *

    Insert an element.

    - * - *

    The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    - * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Position in the container where the new element is inserted. - * {@link iterator}> is a member type, defined as a - * {@link ListReverseIterator bidirectional iterator} type that points to elements. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the newly inserted element; val. - */ - insert(position: ListReverseIterator, val: T): ListReverseIterator; - /** - *

    Insert elements by repeated filling.

    - * - *

    The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    - * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to - * elements. - * @param size Number of elements to insert. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: ListReverseIterator, size: number, val: T): ListReverseIterator; - /** - *

    Insert elements by range iterators.

    - * - *

    The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    - * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to - * elements. - * @param begin An iterator specifying range of the begining element. - * @param end An iterator specifying range of the ending element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: ListReverseIterator, begin: InputIterator, end: InputIterator): ListReverseIterator; - /** - * @hidden - */ - private insert_by_val(position, val); - /** - * @hidden - */ - protected _Insert_by_repeating_val(position: ListIterator, size: number, val: T): ListIterator; - /** - * @hidden - */ - protected _Insert_by_range>(position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; - /** - *

    Erase an element.

    - * - *

    Removes from the {@link List} either a single element; position.

    - * - *

    This effectively reduces the container size by the number of element removed.

    - * - *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Iterator pointing to a single element to be removed from the {@link List}. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link end end()} if the operation erased the last element in the sequence. - */ - erase(position: ListIterator): ListIterator; - /** - *

    Erase elements.

    - * - *

    Removes from the {@link List} container a range of elements.

    - * - *

    This effectively reduces the container {@link size} by the number of elements removed.

    - * - *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link end end()} if the operation erased the last element in the sequence. - */ - erase(begin: ListIterator, end: ListIterator): ListIterator; - /** - *

    Erase an element.

    - * - *

    Removes from the {@link List} either a single element; position.

    - * - *

    This effectively reduces the container size by the number of element removed.

    - * - *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Iterator pointing to a single element to be removed from the {@link List}. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link rend rend()} if the operation erased the last element in the sequence. - */ - erase(position: ListReverseIterator): ListReverseIterator; - /** - *

    Erase elements.

    - * - *

    Removes from the {@link List} container a range of elements.

    - * - *

    This effectively reduces the container {@link size} by the number of elements removed.

    - * - *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link rend rend()} if the operation erased the last element in the sequence. - */ - erase(begin: ListReverseIterator, end: ListReverseIterator): ListReverseIterator; - /** - * @hidden - */ - protected _Erase_by_range(first: ListIterator, last: ListIterator): ListIterator; - /** - *

    Remove duplicate values.

    - * - *

    Removes all but the first element from every consecutive group of equal elements in the

    - * - *

    Notice that an element is only removed from the {@link List} container if it compares equal to the - * element immediately preceding it. Thus, this function is especially useful for sorted lists.

    - */ - unique(): void; - /** - *

    Remove duplicate values.

    - * - *

    Removes all but the first element from every consecutive group of equal elements in the

    - * - *

    The argument binary_pred is a specific comparison function that determine the uniqueness - * of an element. In fact, any behavior can be implemented (and not only an equality comparison), but notice - * that the function will call binary_pred(it.value, it.prev().value) for all pairs of elements - * (where it is an iterator to an element, starting from the second) and remove it - * from the {@link List} if the predicate returns true. - * - *

    Notice that an element is only removed from the {@link List} container if it compares equal to the - * element immediately preceding it. Thus, this function is especially useful for sorted lists.

    - * - * @param binary_pred Binary predicate that, taking two values of the same type than those contained in the - * {@link List}, returns true to remove the element passed as first argument - * from the container, and false otherwise. This shall be a function pointer - * or a function object. - */ - unique(binary_pred: (left: T, right: T) => boolean): void; - /** - *

    Remove elements with specific value.

    - * - *

    Removes from the container all the elements that compare equal to val. This calls the - * destructor of these objects and reduces the container {@link size} by the number of elements removed.

    - * - *

    Unlike member function {@link List.erase}, which erases elements by their position (using an - * iterator), this function ({@link List.remove}) removes elements by their value.

    - * - *

    A similar function, {@link List.remove_if}, exists, which allows for a condition other than an - * equality comparison to determine whether an element is removed.

    - * - * @param val Value of the elements to be removed. - */ - remove(val: T): void; - /** - *

    Remove elements fulfilling condition.

    - * - *

    Removes from the container all the elements for which pred returns true. This - * calls the destructor of these objects and reduces the container {@link size} by the number of elements - * removed.

    - * - *

    The function calls pred(it.value) for each element (where it is an iterator - * to that element). Any of the elements in the list for which this returns true, are removed - * from the

    - * - * @param pred Unary predicate that, taking a value of the same type as those contained in the forward_list - * object, returns true for those values to be removed from the container, and - * false for those remaining. This can either be a function pointer or a function - * object. - */ - remove_if(pred: (val: T) => boolean): void; - /** - *

    Merge sorted {@link List Lists}.

    - * - *

    Merges obj into the {@link List} by transferring all of its elements at their respective - * ordered positions into the container (both containers shall already be ordered). - *

    - * - *

    This effectively removes all the elements in obj (which becomes {@link empty}), and inserts - * them into their ordered position within container (which expands in {@link size} by the number of elements - * transferred). The operation is performed without constructing nor destroying any element: they are - * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports - * move-construction or not.

    - * - *

    This function requires that the {@link List} containers have their elements already ordered by value - * ({@link less}) before the call. For an alternative on unordered {@link List Lists}, see - * {@link List.splice}.

    - * - *

    Assuming such ordering, each element of obj is inserted at the position that corresponds to its - * value according to the strict weak ordering defined by {@link less}. The resulting order of equivalent - * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and - * existing elements precede those equivalent inserted from obj).

    - * - * The function does nothing if this == obj. - * - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - * Note that this function modifies obj no matter whether an lvalue or rvalue reference is - * passed. - */ - merge(obj: List): void; - /** - *

    Merge sorted {@link List Lists}.

    - * - *

    Merges obj into the {@link List} by transferring all of its elements at their respective - * ordered positions into the container (both containers shall already be ordered). - *

    - * - *

    This effectively removes all the elements in obj (which becomes {@link empty}), and inserts - * them into their ordered position within container (which expands in {@link size} by the number of elements - * transferred). The operation is performed without constructing nor destroying any element: they are - * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports - * move-construction or not.

    - * - *

    The argument compare is a specific predicate to perform the comparison operation between - * elements. This comparison shall produce a strict weak ordering of the elements (i.e., a consistent - * transitive comparison, without considering its reflexiveness). - * - *

    This function requires that the {@link List} containers have their elements already ordered by - * compare before the call. For an alternative on unordered {@link List Lists}, see - * {@link List.splice}.

    - * - *

    Assuming such ordering, each element of obj is inserted at the position that corresponds to its - * value according to the strict weak ordering defined by compare. The resulting order of equivalent - * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and - * existing elements precede those equivalent inserted from obj).

    - * - * The function does nothing if this == obj. - * - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - * Note that this function modifies obj no matter whether an lvalue or rvalue reference is - * passed. - * @param compare Binary predicate that, taking two values of the same type than those contained in the - * {@link list}, returns true if the first argument is considered to go before - * the second in the strict weak ordering it defines, and false otherwise. - * This shall be a function pointer or a function object. - */ - merge(obj: List, compare: (left: T, right: T) => boolean): void; - /** - *

    Transfer elements from {@link List} to {@link List}.

    - * - *

    Transfers elements from obj into the container, inserting them at position.

    - * - *

    This effectively inserts all elements into the container and removes them from obj, altering - * the sizes of both containers. The operation does not involve the construction or destruction of any - * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the - * value_type supports move-construction or not.

    - * - *

    This first version (1) transfers all the elements of obj into the

    - * - * @param position Position within the container where the elements of obj are inserted. - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - */ - splice(position: ListIterator, obj: List): void; - /** - *

    Transfer an element from {@link List} to {@link List}.

    - * - *

    Transfers an element from obj, which is pointed by an {@link ListIterator iterator} it, - * into the container, inserting the element at specified position.

    - * - *

    This effectively inserts an element into the container and removes it from obj, altering the - * sizes of both containers. The operation does not involve the construction or destruction of any element. - * They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type - * supports move-construction or not.

    - * - *

    This second version (2) transfers only the element pointed by it from obj into the - *

    - * - * @param position Position within the container where the element of obj is inserted. - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - * This parameter may be this if position points to an element not actually - * being spliced. - * @param it {@link ListIterator Iterator} to an element in obj. Only this single element is - * transferred. - */ - splice(position: ListIterator, obj: List, it: ListIterator): void; - /** - *

    Transfer elements from {@link List} to {@link List}.

    - * - *

    Transfers elements from obj into the container, inserting them at position.

    - * - *

    This effectively inserts those elements into the container and removes them from obj, altering - * the sizes of both containers. The operation does not involve the construction or destruction of any - * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the - * value_type supports move-construction or not.

    - * - *

    This third version (3) transfers the range [begin, end) from obj into the - *

    - * - * @param position Position within the container where the elements of obj are inserted. - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - * This parameter may be this if position points to an element not actually - * being spliced. - * @param begin {@link ListIterator An Iterator} specifying initial position of a range of elements in - * obj. Transfers the elements in the range [begin, end) to - * position. - * @param end {@link ListIterator An Iterator} specifying final position of a range of elements in - * obj. Transfers the elements in the range [begin, end) to - * position. Notice that the range includes all the elements between begin and - * end, including the element pointed by begin but not the one pointed by end. - */ - splice(position: ListIterator, obj: List, begin: ListIterator, end: ListIterator): void; - /** - *

    Sort elements in

    - * - *

    Sorts the elements in the {@link List}, altering their position within the

    - * - *

    The sorting is performed by applying an algorithm that uses {@link less}. This comparison shall - * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without - * considering its reflexiveness).

    - * - *

    The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative - * order they had before the call.

    - * - *

    The entire operation does not involve the construction, destruction or copy of any element object. - * Elements are moved within the

    - */ - sort(): void; - /** - *

    Sort elements in

    - * - *

    Sorts the elements in the {@link List}, altering their position within the

    - * - *

    The sorting is performed by applying an algorithm that uses compare. This comparison shall - * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without - * considering its reflexiveness).

    - * - *

    The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative - * order they had before the call.

    - * - *

    The entire operation does not involve the construction, destruction or copy of any element object. - * Elements are moved within the

    - * - * @param compare Binary predicate that, taking two values of the same type of those contained in the - * {@link List}, returns true if the first argument goes before the second - * argument in the strict weak ordering it defines, and false otherwise. This - * shall be a function pointer or a function object. - */ - sort(compare: (left: T, right: T) => boolean): void; - /** - * @hidden - */ - private qsort(first, last, compare); - /** - * @hidden - */ - private partition(first, last, compare); - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link List container} object with same type of elements. Sizes and container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were in obj - * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link List container} of the same type of elements (i.e., instantiated - * with the same template parameter, T) whose content is swapped with that of this - * {@link container List}. - */ - swap(obj: List): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std { - /** - *

    An iterator, node of a List.

    - * - *

    - * - *

    - * - * @author Jeongho Nam - */ - class ListIterator extends Iterator { - private prev_; - private next_; - private value_; - /** - *

    Construct from the source {@link List container}.

    - * - *

    Note

    - *

    Do not create the iterator directly, by yourself.

    - *

    Use {@link List.begin begin()}, {@link List.end end()} in {@link List container} instead.

    - * - * @param source The source {@link List container} to reference. - * @param prev A refenrece of previous node ({@link ListIterator iterator}). - * @param next A refenrece of next node ({@link ListIterator iterator}). - * @param value Value to be stored in the node (iterator). - */ - constructor(source: List, prev: ListIterator, next: ListIterator, value: T); - private list(); - /** - * @inheritdoc - */ - prev(): ListIterator; - /** - * @inheritdoc - */ - next(): ListIterator; - /** - * @inheritdoc - */ - advance(step: number): ListIterator; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * @hidden - */ - _Set_prev(it: ListIterator): void; - /** - * @hidden - */ - _Set_next(it: ListIterator): void; - /** - * @inheritdoc - */ - equal_to(obj: ListIterator): boolean; - /** - * @inheritdoc - */ - swap(obj: ListIterator): void; - } -} -declare namespace std { - /** - *

    A reverse-iterator of List.

    - * - *

    - * - *

    - * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class ListReverseIterator extends ReverseIterator, ListReverseIterator> { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: ListIterator); - /** - * @hidden - */ - protected create_neighbor(base: ListIterator): ListReverseIterator; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - } -} -declare namespace std { - /** - *

    Priority queue.

    - * - *

    {@link PriorityQueue Priority queues} are a type of container adaptors, specifically designed such that its - * first element is always the greatest of the elements it contains, according to some strict weak ordering - * criterion.

    - * - *

    This context is similar to a heap, where elements can be inserted at any moment, and only the - * max heap element can be retrieved (the one at the top in the {@link PriorityQueue priority queue}).

    - * - *

    {@link PriorityQueue Priority queues} are implemented as container adaptors, which are classes that - * use an encapsulated object of a specific container class as its {@link container_ underlying container}, - * providing a specific set of member functions to access its elements. Elements are popped from the "back" - * of the specific container, which is known as the top of the {@link PriorityQueue Priority queue}.

    - * - *

    The {@link container_ underlying container} may be any of the standard container class templates or some - * other specifically designed container class. The container shall be accessible through - * {@link IArrayIterator random access iterators} and support the following operations:

    - * - *
      - *
    • empty()
    • - *
    • size()
    • - *
    • front()
    • - *
    • push_back()
    • - *
    • pop_back()
    • - *
    - * - *

    The standard container classes {@link Vector} and {@link Deque} fulfill these requirements. By default, if - * no container class is specified for a particular {@link PriorityQueue} class instantiation, the standard - * container {@link Vector} is used.

    - * - *

    Support of {@link IArrayIterator random access iterators} is required to keep a heap structure internally - * at all times. This is done automatically by the container adaptor by automatically calling the algorithm - * functions make_heap, push_heap and pop_heap when needed.

    - * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/queue/priority_queue/ - * @author Jeongho Nam - */ - class PriorityQueue { - /** - *

    The underlying container for implementing the priority queue.

    - * - *

    Following standard definition from the C++ committee, the underlying container should be one of - * {@link Vector} or {@link Deque}, however, I've adopted {@link TreeMultiSet} instead of them. Of course, - * there are proper reasons for adapting the {@link TreeMultiSet} even violating standard advice.

    - * - *

    Underlying container of {@link PriorityQueue} must keep a condition; the highest (or lowest) - * element must be placed on the terminal node for fast retrieval and deletion. To keep the condition with - * {@link Vector} or {@link Deque}, lots of times will only be spent for re-arranging elements. It calls - * rearrangement functions like make_heap, push_heap and pop_head for rearrangement.

    - * - *

    However, the {@link TreeMultiSet} container always keeps arrangment automatically without additional - * operations and it even meets full criteria of {@link PriorityQueue}. Those are the reason why I've adopted - * {@link TreeMultiSet} as the underlying container of {@link PriorityQueue}.

    - */ - private container_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (left: T, right: T) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array); - /** - * Contruct from elements with compare. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array, compare: (left: T, right: T) => boolean); - /** - * Copy Constructor. - */ - constructor(container: base.IContainer); - /** - * Copy Constructor with compare. - * - * @param container A container to be copied. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: base.IContainer, compare: (left: T, right: T) => boolean); - /** - * Range Constructor. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * Range Constructor with compare. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator, end: Iterator, compare: (left: T, right: T) => boolean); - /** - *

    Return size.

    - * - *

    Returns the number of elements in the {@link PriorityQueue}.

    - * - *

    This member function effectively calls member {@link IArray.size size} of the - * {@link container_ underlying container} object.

    - * - * @return The number of elements in the underlying - */ - size(): number; - /** - *

    Test whether container is empty.

    - * - *

    Returns whether the {@link PriorityQueue} is empty: i.e. whether its {@link size} is zero.

    - * - *

    This member function effectively calls member {@link IARray.empty empty} of the - * {@link container_ underlying container} object.

    - */ - empty(): boolean; - /** - *

    Access top element.

    - * - *

    Returns a constant reference to the top element in the {@link PriorityQueue}.

    - * - *

    The top element is the element that compares higher in the {@link PriorityQueue}, and the next that is - * removed from the container when {@link PriorityQueue.pop} is called.

    - * - *

    This member function effectively calls member {@link IArray.front front} of the - * {@link container_ underlying container} object.

    - * - * @return A reference to the top element in the {@link PriorityQueue}. - */ - top(): T; - /** - *

    Insert element.

    - * - *

    Inserts a new element in the {@link PriorityQueue}. The content of this new element is initialized to - * val. - * - *

    This member function effectively calls the member function {@link IArray.push_back push_back} of the - * {@link container_ underlying container} object, and then reorders it to its location in the heap by calling - * the push_heap algorithm on the range that includes all the elements of the

    - * - * @param val Value to which the inserted element is initialized. - */ - push(val: T): void; - /** - *

    Remove top element.

    - * - *

    Removes the element on top of the {@link PriorityQueue}, effectively reducing its {@link size} by one. - * The element removed is the one with the highest (or lowest) value.

    - * - *

    The value of this element can be retrieved before being popped by calling member - * {@link PriorityQueue.top}.

    - * - *

    This member function effectively calls the pop_heap algorithm to keep the heap property of - * {@link PriorityQueue PriorityQueues} and then calls the member function {@link IArray.pop_back pop_back} of - * the {@link container_ underlying container} object to remove the element.

    - */ - pop(): void; - /** - *

    Swap contents.

    - * - *

    Exchanges the contents of the container adaptor by those of obj, swapping both the - * {@link container_ underlying container} value and their comparison function using the corresponding - * {@link std.swap swap} non-member functions (unqualified).

    - * - *

    This member function has a noexcept specifier that matches the combined noexcept of the - * {@link IArray.swap swap} operations on the {@link container_ underlying container} and the comparison - * functions.

    - * - * @param obj {@link PriorityQueue} container adaptor of the same type (i.e., instantiated with the same - * template parameters, T). Sizes may differ. - */ - swap(obj: PriorityQueue): void; - } -} -declare namespace std { - /** - *

    FIFO queue.

    - * - *

    {@link Queue}s are a type of container adaptor, specifically designed to operate in a FIFO context - * (first-in first-out), where elements are inserted into one end of the container and extracted from the other. - *

    - * - *

    {@link Queue}s are implemented as containers adaptors, which are classes that use an encapsulated object of - * a specific container class as its underlying container, providing a specific set of member functions to access - * its elements. Elements are pushed into the {@link IDeque.back back()} of the specific container and popped from - * its {@link IDeque.front front()}.

    - * - *

    {@link container_ The underlying container} may be one of the standard container class template or some - * other specifically designed container class. This underlying container shall support at least the following - * operations:

    - * - *
      - *
    • empty
    • - *
    • size
    • - *
    • front
    • - *
    • back
    • - *
    • push_back
    • - *
    • pop_front
    • - *
    - * - *

    The standard container classes {@link Deque} and {@link List} fulfill these requirements. - * By default, if no container class is specified for a particular {@link Queue} class instantiation, the standard - * container {@link List} is used.

    - * - *

    - * - *

    - * - * @param Type of elements. - * - * @reference http://www.cplusplus.com/reference/queue/queue - * @author Jeongho Nam - */ - class Queue { - /** - * The underlying object for implementing the FIFO - */ - private container_; - /** - * Default Constructor. - */ - constructor(); - /** - * Copy Constructor. - */ - constructor(container: Queue); - /** - *

    Return size.

    - *

    Returns the number of elements in the {@link Queue}.

    - * - *

    This member function effectively calls member {@link IDeque.size size()} of the - * {@link container_ underlying container} object.

    - * - * @return The number of elements in the {@link container_ underlying container}. - */ - size(): number; - /** - *

    Test whether container is empty.

    - *

    returns whether the {@link Queue} is empty: i.e. whether its size is zero.

    - * - *

    This member function efeectively calls member {@link IDeque.empty empty()} of the - * {@link container_ underlying container} object.

    - * - * @return true if the {@link container_ underlying container}'s size is 0, - * false otherwise.

    - */ - empty(): boolean; - /** - *

    Access next element.

    - *

    Returns a value of the next element in the {@link Queue}.

    - * - *

    The next element is the "oldest" element in the {@link Queue} and the same element that is popped out - * from the queue when {@link pop Queue.pop()} is called.

    - * - *

    This member function effectively calls member {@link IDeque.front front()} of the - * {@link container_ underlying container} object.

    - * - * @return A value of the next element in the {@link Queue}. - */ - front(): T; - /** - *

    Access last element.

    - * - *

    Returns a vaue of the last element in the queue. This is the "newest" element in the queue (i.e. the - * last element pushed into the queue).

    - * - *

    This member function effectively calls the member function {@link IDeque.back back()} of the - * {@link container_ underlying container} object.

    - * - * @return A value of the last element in the {@link Queue}. - */ - back(): T; - /** - *

    Insert element.

    - * - *

    Inserts a new element at the end of the {@link Queue}, after its current last element. - * The content of this new element is initialized to val.

    - * - *

    This member function effectively calls the member function {@link IDeque.push_back push_back()} of the - * {@link container_ underlying container} object.

    - * - * @param val Value to which the inserted element is initialized. - */ - push(val: T): void; - /** - *

    Remove next element.

    - * - *

    Removes the next element in the {@link Queue}, effectively reducing its size by one.

    - * - *

    The element removed is the "oldest" element in the {@link Queue} whose value can be retrieved by calling - * member {@link front Queue.front()}

    . - * - *

    This member function effectively calls the member function {@link IDeque.pop_front pop_front()} of the - * {@link container_ underlying container} object.

    - */ - pop(): void; - /** - *

    Swap contents.

    - * - *

    Exchanges the contents of the container adaptor (this) by those of obj.

    - * - *

    This member function calls the non-member function {@link IContainer.swap swap} (unqualified) to swap - * the {@link container_ underlying containers}.

    - * - * @param obj Another {@link Queue} container adaptor of the same type (i.e., instantiated with the same - * template parameter, T). Sizes may differ.

    - */ - swap(obj: Queue): void; - } -} -declare namespace std { - /** - *

    LIFO stack.

    - * - *

    {@link Stack}s are a type of container adaptor, specifically designed to operate in a LIFO context - * (last-in first-out), where elements are inserted and extracted only from one end of the

    - * - *

    {@link Stack}s are implemented as containers adaptors, which are classes that use an encapsulated object of - * a specific container class as its underlying container, providing a specific set of member functions to - * access its elements. Elements are pushed/popped from the {@link ILinearContainer.back back()} of the - * {@link ILinearContainer specific container}, which is known as the top of the {@link Stack}.

    - * - *

    {@link container_ The underlying container} may be any of the standard container class templates or some - * other specifically designed container class. The container shall support the following operations:

    - * - *
      - *
    • empty
    • - *
    • size
    • - *
    • front
    • - *
    • back
    • - *
    • push_back
    • - *
    • pop_back
    • - *
    - * - *

    The standard container classes {@link Vector}, {@link Deque} and {@link List} fulfill these requirements. - * By default, if no container class is specified for a particular {@link Stack} class instantiation, the standard - * container {@link List} is used.

    - * - *

    - * - *

    - * - * @param Type of elements. - * - * @reference http://www.cplusplus.com/reference/stack/stack - * @author Jeongho Nam - */ - class Stack { - /** - * The underlying object for implementing the LIFO - */ - private container_; - /** - * Default Constructor. - */ - constructor(); - /** - * Copy Constructor. - */ - constructor(stack: Stack); - /** - *

    Return size.

    - * - *

    Returns the number of elements in the {@link Stack}.

    - * - *

    This member function effectively calls member {@link ILinearContainer.size size()} of the - * {@link container_ underlying container} object.

    - * - * @return The number of elements in the {@link container_ underlying container}. - */ - size(): number; - /** - *

    Test whether container is empty.

    - * - *

    returns whether the {@link Stack} is empty: i.e. whether its size is zero.

    - * - *

    This member function effectively calls member {@link ILinearContainer.empty empty()} of the - * {@link container_ underlying container} object.

    - * - * @return true if the underlying container's size is 0, - * false otherwise.

    - */ - empty(): boolean; - /** - *

    Access next element.

    - * - *

    Returns a value of the top element in the {@link Stack}

    . - * - *

    Since {@link Stack}s are last-in first-out containers, the top element is the last element inserted into - * the {@link Stack}.

    - * - *

    This member function effectively calls member {@link ILinearContainer.back back()} of the - * {@link container_ underlying container} object.

    - * - * @return A value of the top element in the {@link Stack}. - */ - top(): T; - /** - *

    Insert element.

    - * - *

    Inserts a new element at the top of the {@link Stack}, above its current top element.

    - * - *

    This member function effectively calls the member function - * {@link ILinearContainer.push_back push_back()} of the {@link container_ underlying container} object.

    - * - * @param val Value to which the inserted element is initialized. - */ - push(val: T): void; - /** - *

    Remove top element.

    - * - *

    Removes the element on top of the {@link Stack}, effectively reducing its size by one.

    - * - *

    The element removed is the latest element inserted into the {@link Stack}, whose value can be retrieved - * by calling member {@link top Stack.top()}

    . - * - *

    This member function effectively calls the member function {@link ILinearContainer.pop_back pop_back()} - * of the {@link container_ underlying container} object.

    - */ - pop(): void; - /** - *

    Swap contents.

    - * - *

    Exchanges the contents of the container adaptor (this) by those of obj.

    - * - *

    This member function calls the non-member function {@link IContainer.swap swap} (unqualified) to swap - * the {@link container_ underlying containers}.

    - * - * @param obj Another {@link Stack} container adaptor of the same type (i.e., instantiated with the same - * template parameter, T). Sizes may differ.

    - */ - swap(obj: Stack): void; - } -} declare namespace std.base { /** *

    An abstract error instance.

    @@ -7816,1690 +3017,6 @@ declare namespace std.base { to_bool(): boolean; } } -declare namespace std { - /** - *

    System error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report conditions originating during - * runtime from the operating system or other low-level application program interfaces which have an - * associated {@link ErrorCode}.

    - * - *

    The class inherits from {@link RuntimeError}, to which it adds an {@link ErrorCode} as - * member code (and defines a specialized what member).

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/system_error/system_error - * @author Jeongho Nam - */ - class SystemError extends RuntimeError { - /** - * @hidden - */ - protected code_: ErrorCode; - /** - * Construct from an error code. - * - * @param code An {@link ErrorCode} object. - */ - constructor(code: ErrorCode); - /** - * Construct from an error code and message. - * - * @param code An {@link ErrorCode} object. - * @param message A message incorporated in the string returned by member {@link what what()}. - */ - constructor(code: ErrorCode, message: string); - /** - * Construct from a numeric value and error category. - * - * @param val A numerical value identifying an error code. - * @param category A reference to an {@link ErrorCode} object. - */ - constructor(val: number, category: ErrorCategory); - /** - * Construct from a numeric value, error category and message. - * - * @param val A numerical value identifying an error code. - * @param category A reference to an {@link ErrorCode} object. - * @param message A message incorporated in the string returned by member {@link what what()}. - */ - constructor(val: number, category: ErrorCategory, message: string); - /** - *

    Get error code.

    - * - *

    Returns the {@link ErrorCode} object associated with the exception.

    - * - *

    This value is either the {@link ErrorCode} passed to the construction or its equivalent - * (if constructed with a value and a {@link category}.

    - * - * @return The {@link ErrorCode} associated with the object. - */ - code(): ErrorCode; - } -} -declare namespace std { - /** - *

    Error category.

    - * - *

    This type serves as a base class for specific category types.

    - * - *

    Category types are used to identify the source of an error. They also define the relation between - * {@link ErrorCode} and {@link ErrorCondition}objects of its category, as well as the message set for {@link ErrorCode} - * objects. - * - *

    Objects of these types have no distinct values and are not-copyable and not-assignable, and thus can only be - * passed by reference. As such, only one object of each of these types shall exist, each uniquely identifying its own - * category: all error codes and conditions of a same category shall return a reference to same object.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/system_error/error_category - * @author Jeongho Nam - */ - abstract class ErrorCategory { - /** - * Default Constructor. - */ - constructor(); - /** - *

    Return category name.

    - * - *

    In derived classes, the function returns a string naming the category.

    - * - *

    In {@link ErrorCategory}, it is a pure virtual member function.

    - * - *
      - *
    • In the {@link GenericCategory} object, it returns "generic".
    • - *
    • In the {@link SystemCategory} object, it returns "system".
    • - *
    • In the {@link IOStreamCategory} object, it returns "iostream".
    • - *
    - * - * @return The category name. - */ - abstract name(): string; - /** - *

    Error message.

    - * - *

    In derived classes, the function returns a string object with a message describing the error condition - * denoted by val.

    - * - *

    In {@link ErrorCategory}, it is a pure virtual member function.

    - * - *

    This function is called both by {@link ErrorCode.message ErrorCode.message()} and - * {@link ErrorCondition.message ErrorCondition.message()} to obtain the corresponding message in the - * {@link category}. Therefore, numerical values used by custom error codes and - * {@link ErrorCondition error conditions} should only match for a category if they describe the same error.

    - * - * @param val A numerical value identifying an error condition. - * If the {@link ErrorCategory} object is the {@link GenericCategory}, this argument is equivalent to an - * {@link errno} value. - * - * @return A string object with the message. - */ - abstract message(val: number): string; - /** - *

    Default error condition.

    - * - *

    Returns the default {@link ErrorCondition}object of this category that is associated with the - * {@link ErrorCode} identified by a value of val.

    - * - *

    Its definition in the base class {@link ErrorCategory} returns the same as constructing an - * {@link ErrorCondition} object with: - * - *

    new ErrorCondition(val, *this);

    - * - *

    As a virtual member function, this behavior can be overriden in derived classes.

    - * - *

    This function is called by the default definition of member {@link equivalent equivalent()}, which is used to - * compare {@link ErrorCondition error conditions} with error codes.

    - * - * @param val A numerical value identifying an error condition. - * - * @return The default {@link ErrorCondition}object associated with condition value val for this category. - */ - default_error_condition(val: number): ErrorCondition; - /** - *

    Check error code equivalence.

    - * - *

    Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an - * {@link ErrorCondition error condition.

    - * - *

    This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is - * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' - * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered - * equivalent by the operator.

    - * - *

    As a virtual member function, this behavior can be overridden in derived classes to define a different - * correspondence mechanism for each {@link ErrorCategory} type.

    - * - * @param val_code A numerical value identifying an error code. - * @param cond An object of an {@link ErrorCondition} type. - * - * @return true if the arguments are considered equivalent. false otherwise. - */ - equivalent(val_code: number, cond: ErrorCondition): boolean; - /** - *

    Check error code equivalence.

    - * - *

    Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an - * {@link ErrorCondition error condition.

    - * - *

    This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is - * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' - * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered - * equivalent by the operator.

    - * - *

    As a virtual member function, this behavior can be overridden in derived classes to define a different - * correspondence mechanism for each {@link ErrorCategory} type.

    - * - * @param code An object of an {@link ErrorCode} type. - * @param val_cond A numerical value identifying an error code. - * - * @return true if the arguments are considered equivalent. false otherwise. - */ - equivalent(code: ErrorCode, val_cond: number): boolean; - } -} -declare namespace std { - /** - *

    Error condition.

    - * - *

    Objects of this type hold a condition {@link value} associated with a {@link category}.

    - * - *

    Objects of this type describe errors in a generic way so that they may be portable across different - * systems. This is in contrast with {@link ErrorCode} objects, that may contain system-specific - * information.

    - * - *

    Because {@link ErrorCondition}objects can be compared with error_code objects directly by using - * relational operators, {@link ErrorCondition}objects are generally used to check whether - * a particular {@link ErrorCode} obtained from the system matches a specific error condition no matter - * the system.

    - * - *

    The {@link ErrorCategory categories} associated with the {@link ErrorCondition} and the - * {@link ErrorCode} define the equivalences between them.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/system_error/error_condition - * @author Jeongho Nam - */ - class ErrorCondition extends base.ErrorInstance { - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from a numeric value and error category. - * - * @param val A numerical value identifying an error condition. - * @param category A reference to an {@link ErrorCategory} object. - */ - constructor(val: number, category: ErrorCategory); - } -} -declare namespace std { - /** - *

    Error code.

    - * - *

    Objects of this type hold an error code {@link value} associated with a {@link category}.

    - * - *

    The operating system and other low-level applications and libraries generate numerical error codes to - * represent possible results. These numerical values may carry essential information for a specific platform, - * but be non-portable from one platform to another.

    - * - *

    Objects of this class associate such numerical codes to {@link ErrorCategory error categories}, so that they - * can be interpreted when needed as more abstract (and portable) {@link ErrorCondition error conditions}.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/system_error/error_code - * @author Jeongho Nam - */ - class ErrorCode extends base.ErrorInstance { - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from a numeric value and error category. - * - * @param val A numerical value identifying an error code. - * @param category A reference to an {@link ErrorCategory} object. - */ - constructor(val: number, category: ErrorCategory); - } -} -declare namespace std.TreeMap { - type iterator = std.MapIterator; - type reverse_iterator = std.MapReverseIterator; -} -declare namespace std { - /** - *

    Tree-structured map, std::map of STL.

    - * - *

    {@link TreeMap TreeMaps} are associative containers that store elements formed by a combination of a - * key value (Key) and a mapped value (T), following order.

    - * - *

    In a {@link TreeMap}, the key values are generally used to sort and uniquely identify the elements, - * while the mapped values store the content associated to this key. The types of key and - * mapped value may differ, and are grouped together in member type value_type, which is a {@link Pair} - * type combining both:

    - * - *

    typedef Pair value_type;

    - * - *

    Internally, the elements in a {@link TreeMap} are always sorted by its key following a - * strict weak ordering criterion indicated by its internal comparison method {@link less}. - * - *

    {@link TreeMap} containers are generally slower than {@link HashMap HashMap} containers to access individual - * elements by their key, but they allow the direct iteration on subsets based on their order.

    - * - *

    {@link TreeMap}s are typically implemented as binary search trees.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
    - * - *
    Ordered
    - *
    The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order.
    - * - *
    Map
    - *
    Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value.
    - * - *
    Unique keys
    - *
    No two elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the keys. Each element in a map is uniquely identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/map/map - * @author Jeongho Nam - */ - class TreeMap extends base.UniqueMap implements base.ITreeMap { - /** - * @hidden - */ - private tree_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (x: Key, y: Key) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array>); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array>, compare: (x: Key, y: Key) => boolean); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - */ - constructor(array: Array<[Key, T]>); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array<[Key, T]>, compare: (x: Key, y: Key) => boolean); - /** - * Copy Constructor. - * - * @param container Another map to copy. - */ - constructor(container: TreeMap); - /** - * Copy Constructor. - * - * @param container Another map to copy. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: TreeMap, compare: (x: Key, y: Key) => boolean); - /** - * Range Constructor. - * - * @param begin nput interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator>, end: Iterator>); - /** - * Range Constructor. - * - * @param begin nput interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator>, end: Iterator>, compare: (x: Key, y: Key) => boolean); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: Key): MapIterator; - /** - * @inheritdoc - */ - key_comp(): (x: Key, y: Key) => boolean; - /** - * @inheritdoc - */ - value_comp(): (x: Pair, y: Pair) => boolean; - /** - * @inheritdoc - */ - lower_bound(key: Key): MapIterator; - /** - * @inheritdoc - */ - upper_bound(key: Key): MapIterator; - /** - * @inheritdoc - */ - equal_range(key: Key): Pair, MapIterator>; - /** - * @hidden - */ - protected _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link TreeMap map} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link TreeMap map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link TreeMap container}. - */ - swap(obj: TreeMap): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer>): void; - } -} -declare namespace std.TreeMultiMap { - type iterator = std.MapIterator; - type reverse_iterator = std.MapReverseIterator; -} -declare namespace std { - /** - *

    Tree-structured multiple-key map.

    - * - *

    {@link TreeMultiMap TreeMultiMaps} are associative containers that store elements formed by a combination of - * a key value and a mapped value, following a specific order, and where multiple elements can - * have equivalent keys.

    - * - *

    In a {@link TreeMultiMap}, the key values are generally used to sort and uniquely identify - * the elements, while the mapped values store the content associated to this key. The types of - * key and mapped value may differ, and are grouped together in member type - * value_type, which is a {@link Pair} type combining both:

    - * - *

    typedef Pair value_type;

    - * - *

    Internally, the elements in a {@link TreeMultiMap}are always sorted by its key following a - * strict weak ordering criterion indicated by its internal comparison method (of {@link less}).

    - * - *

    {@link TreeMultiMap}containers are generally slower than {@link HashMap} containers - * to access individual elements by their key, but they allow the direct iteration on subsets based - * on their order.

    - * - *

    {@link TreeMultiMap TreeMultiMaps} are typically implemented as binary search trees.

    - * - *

    < - * img src="http://samchon.github.io/typescript-stl/images/design/class_diagram/map_containers.png" style="max-width: 100%" />

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
    - * - *
    Ordered
    - *
    - * The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order. - *
    - * - *
    Map
    - *
    - * Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value. - *
    - * - *
    Multiple equivalent keys
    - *
    Multiple elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the keys. Each element in a map is uniquely identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/map/multimap - * @author Jeongho Nam - */ - class TreeMultiMap extends base.MultiMap implements base.ITreeMap { - /** - * @hidden - */ - private tree_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (x: Key, y: Key) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array>); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array>, compare: (x: Key, y: Key) => boolean); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - */ - constructor(array: Array<[Key, T]>); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array<[Key, T]>, compare: (x: Key, y: Key) => boolean); - /** - * Copy Constructor. - * - * @param container Another map to copy. - */ - constructor(container: TreeMultiMap); - /** - * Copy Constructor. - * - * @param container Another map to copy. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: TreeMultiMap, compare: (x: Key, y: Key) => boolean); - /** - * Range Constructor. - * - * @param begin nput interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator>, end: Iterator>); - /** - * Range Constructor. - * - * @param begin nput interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator>, end: Iterator>, compare: (x: Key, y: Key) => boolean); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: Key): MapIterator; - /** - * @inheritdoc - */ - count(key: Key): number; - /** - * @inheritdoc - */ - key_comp(): (x: Key, y: Key) => boolean; - /** - * @inheritdoc - */ - value_comp(): (x: Pair, y: Pair) => boolean; - /** - * @inheritdoc - */ - lower_bound(key: Key): MapIterator; - /** - * @inheritdoc - */ - upper_bound(key: Key): MapIterator; - /** - * @inheritdoc - */ - equal_range(key: Key): Pair, MapIterator>; - /** - * @hidden - */ - protected _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link TreeMapMulti map} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link TreeMapMulti map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link TreeMapMulti container}. - */ - swap(obj: TreeMultiMap): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer>): void; - } -} -declare namespace std.TreeMultiSet { - type iterator = std.SetIterator; - type reverse_iterator = std.SetReverseIterator; -} -declare namespace std { - /** - *

    Tree-structured multiple-key set.

    - * - *

    {@link TreeMultiSet TreeMultiSets} are containers that store elements following a specific order, and - * where multiple elements can have equivalent values.

    - * - *

    In a {@link TreeMultiSet}, the value of an element also identifies it (the value is itself - * the key, of type T). The value of the elements in a {@link TreeMultiSet} cannot - * be modified once in the container (the elements are always const), but they can be inserted or removed - * from the

    - * - *

    Internally, the elements in a {@link TreeMultiSet TreeMultiSets} are always sorted following a strict - * weak ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}).

    - * - *

    {@link TreeMultiSet} containers are generally slower than {@link HashMultiSet} containers - * to access individual elements by their key, but they allow the direct iteration on subsets based on - * their order.

    - * - *

    {@link TreeMultiSet TreeMultiSets} are typically implemented as binary search trees.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
    - * - *
    Ordered
    - *
    - * The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order. - *
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - * - *
    Multiple equivalent keys
    - *
    Multiple elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the elements. Each element in a {@link TreeMultiSet} container is also identified - * by this value (each value is itself also the element's key). - * - * @reference http://www.cplusplus.com/reference/set/multiset - * @author Jeongho Nam - */ - class TreeMultiSet extends base.MultiSet implements base.ITreeSet { - /** - * @hidden - */ - private tree_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (x: T, y: T) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array); - /** - * Contruct from elements with compare. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array, compare: (x: T, y: T) => boolean); - /** - * Copy Constructor. - */ - constructor(container: TreeMultiSet); - /** - * Copy Constructor with compare. - * - * @param container A container to be copied. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); - /** - * Range Constructor. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * Construct from range and compare. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator, end: Iterator, compare: (x: T, y: T) => boolean); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(val: T): SetIterator; - /** - * @inheritdoc - */ - count(val: T): number; - /** - * @inheritdoc - */ - key_comp(): (x: T, y: T) => boolean; - /** - * @inheritdoc - */ - value_comp(): (x: T, y: T) => boolean; - /** - * @inheritdoc - */ - lower_bound(val: T): SetIterator; - /** - * @inheritdoc - */ - upper_bound(val: T): SetIterator; - /** - * @inheritdoc - */ - equal_range(val: T): Pair, SetIterator>; - /** - * @hidden - */ - _Get_tree(): base.AtomicTree; - /** - * @hidden - */ - protected _Insert_by_val(val: T): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link TreeMultiSet set} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link TreeMultiSet set container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link TreeMultiSet container}. - */ - swap(obj: TreeMultiSet): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std.TreeSet { - type iterator = std.SetIterator; - type reverse_iterator = std.SetReverseIterator; -} -declare namespace std { - /** - *

    Tree-structured set, std::set of STL.

    - * - *

    {@link TreeSet}s are containers that store unique elements following a specific order.

    - * - *

    In a {@link TreeSet}, the value of an element also identifies it (the value is itself the - * key, of type T), and each value must be unique. The value of the elements in a - * {@link TreeSet} cannot be modified once in the container (the elements are always const), but they - * can be inserted or removed from the

    - * - *

    Internally, the elements in a {@link TreeSet} are always sorted following a specific strict weak - * ordering criterion indicated by its internal comparison method (of {@link less}).

    - * - *

    {@link TreeSet} containers are generally slower than {@link HashSet} containers to access - * individual elements by their key, but they allow the direct iteration on subsets based on their - * order.

    - * - *

    {@link TreeSet}s are typically implemented as binary search trees.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
    - * - *
    Ordered
    - *
    - * The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order. - *
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - * - *
    Unique keys
    - *
    No two elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the elements. - * Each element in an {@link TreeSet} is also uniquely identified by this value. - * - * @reference http://www.cplusplus.com/reference/set/set - * @author Jeongho Nam - */ - class TreeSet extends base.UniqueSet implements base.ITreeSet { - /** - * @hidden - */ - private tree_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (x: T, y: T) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array); - /** - * Contruct from elements with compare. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array, compare: (x: T, y: T) => boolean); - /** - * Copy Constructor. - */ - constructor(container: TreeMultiSet); - /** - * Copy Constructor with compare. - * - * @param container A container to be copied. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); - /** - * Range Constructor. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * Construct from range and compare. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator, end: Iterator, compare: (x: T, y: T) => boolean); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(val: T): SetIterator; - /** - * @inheritdoc - */ - key_comp(): (x: T, y: T) => boolean; - /** - * @inheritdoc - */ - value_comp(): (x: T, y: T) => boolean; - /** - * @inheritdoc - */ - lower_bound(val: T): SetIterator; - /** - * @inheritdoc - */ - upper_bound(val: T): SetIterator; - /** - * @inheritdoc - */ - equal_range(val: T): Pair, SetIterator>; - /** - * @hidden - */ - protected _Insert_by_val(val: T): any; - protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link TreeSet set} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link TreeSet set container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link TreeSet container}. - */ - swap(obj: TreeSet): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std { - /** - *

    Running on Node.

    - * - *

    Test whether the JavaScript is running on Node.

    - * - * @references http://stackoverflow.com/questions/17575790/environment-detection-node-js-or-browser - */ - function is_node(): boolean; - /** - *

    Pair of values.

    - * - *

    This class couples together a pair of values, which may be of different types (T1 and - * T2). The individual values can be accessed through its public members {@link first} and - * {@link second}.

    - * - * @param Type of member {@link first}. - * @param Type of member {@link second}. - * - * @reference http://www.cplusplus.com/reference/utility/pair - * @author Jeongho Nam - */ - class Pair { - /** - *

    A first value in the Pair.

    - */ - first: T1; - /** - *

    A second value in the Pair.

    - */ - second: T2; - /** - *

    Construct from pair values.

    - * - * @param first The first value of the Pair - * @param second The second value of the Pair - */ - constructor(first: T1, second: T2); - /** - *

    Whether a Pair is equal with the Pair.

    - *

    Compare each first and second value of two Pair(s) and returns whether they are equal or not.

    - * - *

    If stored key and value in a Pair are not number or string but an object like a class or struct, - * the comparison will be executed by a member method (SomeObject)::equal_to(). If the object does not have - * the member method equal_to(), only address of pointer will be compared.

    - * - * @param obj A Map to compare - * @return Indicates whether equal or not. - */ - equal_to(pair: Pair): boolean; - less(pair: Pair): boolean; - } - /** - *

    Construct {@link Pair} object.

    - * - *

    Constructs a {@link Pair} object with its {@link Pair.first first} element set to x and its - * {@link Pair.second second} element set to y.

    - * - *

    The template types can be implicitly deduced from the arguments passed to {@link make_pair}.

    - * - *

    {@link Pair} objects can be constructed from other {@link Pair} objects containing different types, if the - * respective types are implicitly convertible.

    - * - * @param x Value for member {@link Pair.first first}. - * @param y Value for member {@link Pair.second second}. - * - * @return A {@link Pair} object whose elements {@link Pair.first first} and {@link Pair.second second} are set to - * x and y respectivelly. - */ - function make_pair(x: T1, y: T2): Pair; -} -declare namespace std.Vector { - type iterator = std.VectorIterator; - type reverse_iterator = std.VectorReverseIterator; -} -declare namespace std { - /** - *

    Vector, the dynamic array.

    - * - *

    {@link Vector}s are sequence containers representing arrays that can change in size.

    - * - *

    Just like arrays, {@link Vector}s use contiguous storage locations for their elements, which means that - * their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently - * as in arrays. But unlike arrays, their size can change dynamically, with their storage being handled - * automatically by the

    - * - *

    Internally, {@link Vector}s use a dynamically allocated array to store their elements. This array may need - * to be reallocated in order to grow in size when new elements are inserted, which implies allocating a new - * array and moving all elements to it. This is a relatively expensive task in terms of processing time, and - * thus, {@link Vector}s do not reallocate each time an element is added to the

    - * - *

    Instead, {@link Vector} containers may allocate some extra storage to accommodate for possible growth, and - * thus the container may have an actual {@link capacity} greater than the storage strictly needed to contain its - * elements (i.e., its {@link size}). Libraries can implement different strategies for growth to balance between - * memory usage and reallocations, but in any case, reallocations should only happen at logarithmically growing - * intervals of {@link size} so that the insertion of individual elements at the end of the {@link Vector} can be - * provided with amortized constant time complexity (see {@link push_back push_back()}).

    - * - *

    Therefore, compared to arrays, {@link Vector}s consume more memory in exchange for the ability to manage - * storage and grow dynamically in an efficient way.

    - * - *

    Compared to the other dynamic sequence containers ({@link Deque}s, {@link List}s), {@link Vector Vectors} - * are very efficient accessing its elements (just like arrays) and relatively efficient adding or removing - * elements from its end. For operations that involve inserting or removing elements at positions other than the - * end, they perform worse than the others, and have less consistent iterators and references than {@link List}s. - *

    - * - *

    - * - *

    - * - *

    Container properties

    - *
    - *
    Sequence
    - *
    - * Elements in sequence containers are ordered in a strict linear sequence. Individual elements are - * accessed by their position in this sequence. - *
    - * - *
    Dynamic array
    - *
    - * Allows direct access to any element in the sequence, even through pointer arithmetics, and provides - * relatively fast addition/removal of elements at the end of the sequence. - *
    - *
    - * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/vector/vector - * @author Jeongho Nam - */ - class Vector extends Array implements base.IContainer, base.IArrayContainer { - /** - *

    Default Constructor.

    - * - *

    Constructs an empty container, with no elements.

    - */ - constructor(); - /** - * @inheritdoc - */ - constructor(array: Array); - /** - *

    Initializer list Constructor.

    - * - *

    Constructs a container with a copy of each of the elements in array, in the same order.

    - * - * @param array An array containing elements to be copied and contained. - */ - constructor(n: number); - /** - *

    Fill Constructor.

    - * - *

    Constructs a container with n elements. Each element is a copy of val (if provided).

    - * - * @param n Initial container size (i.e., the number of elements in the container at construction). - * @param val Value to fill the container with. Each of the n elements in the container is - * initialized to a copy of this value. - */ - constructor(n: number, val: T); - /** - *

    Copy Constructor.

    - * - *

    Constructs a container with a copy of each of the elements in container, in the same order.

    - * - * @param container Another container object of the same type (with the same class template - * arguments T), whose contents are either copied or acquired. - */ - constructor(container: Vector); - /** - *

    Range Constructor.

    - * - *

    Constructs a container with as many elements as the range (begin, end), with each - * element emplace-constructed from its corresponding element in that range, in the same order.

    - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - assign>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - assign(n: number, val: T): void; - /** - * @inheritdoc - */ - reserve(size: number): void; - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - begin(): VectorIterator; - /** - * @inheritdoc - */ - end(): VectorIterator; - /** - * @inheritdoc - */ - rbegin(): VectorReverseIterator; - /** - * @inheritdoc - */ - rend(): VectorReverseIterator; - /** - * @inheritdoc - */ - size(): number; - /** - * @inheritdoc - */ - capacity(): number; - /** - * @inheritdoc - */ - empty(): boolean; - /** - * @inheritdoc - */ - at(index: number): T; - /** - * @inheritdoc - */ - set(index: number, val: T): T; - /** - * @inheritdoc - */ - front(): T; - /** - * @inheritdoc - */ - back(): T; - /** - * @inheritdoc - */ - push_back(val: T): void; - /** - *

    Insert an element.

    - * - *

    The {@link Vector} is extended by inserting new element before the element at the specified - * position, effectively increasing the container size by one.

    - * - *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, inserting element in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to its new position. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    - * - * @param position Position in the {@link Vector} where the new element is inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param val Value to be copied to the inserted element. - * - * @return An iterator that points to the newly inserted element. - */ - insert(position: VectorIterator, val: T): VectorIterator; - /** - *

    Insert elements by repeated filling.

    - * - *

    The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted.

    - * - *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to their new positions. This is generally an inefficient operation compared to the - * one performed for the same operation by other kinds of sequence containers (such as {@link List}). - * - * @param position Position in the {@link Vector} where the new elements are inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param n Number of elements to insert. Each element is initialized to a copy of val. - * @param val Value to be copied (or moved) to the inserted elements. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: VectorIterator, n: number, val: T): VectorIterator; - /** - *

    Insert elements by range iterators.

    - * - *

    The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted by range - * iterators.

    - * - *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to their new positions. This is generally an inefficient operation compared to the - * one performed for the same operation by other kinds of sequence containers (such as {@link List}). - * - * @param position Position in the {@link Vector} where the new elements are inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: VectorIterator, begin: InputIterator, end: InputIterator): VectorIterator; - /** - *

    Insert an element.

    - * - *

    The {@link Vector} is extended by inserting new element before the element at the specified - * position, effectively increasing the container size by one.

    - * - *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, inserting element in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to its new position. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    - * - * @param position Position in the {@link Vector} where the new element is inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param val Value to be copied to the inserted element. - * - * @return An iterator that points to the newly inserted element. - */ - insert(position: VectorReverseIterator, val: T): VectorReverseIterator; - /** - *

    Insert elements by repeated filling.

    - * - *

    The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted.

    - * - *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to their new positions. This is generally an inefficient operation compared to the - * one performed for the same operation by other kinds of sequence containers (such as {@link List}). - * - * @param position Position in the {@link Vector} where the new elements are inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param n Number of elements to insert. Each element is initialized to a copy of val. - * @param val Value to be copied (or moved) to the inserted elements. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: VectorReverseIterator, n: number, val: T): VectorReverseIterator; - /** - *

    Insert elements by range iterators.

    - * - *

    The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted by range - * iterators.

    - * - *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to their new positions. This is generally an inefficient operation compared to the - * one performed for the same operation by other kinds of sequence containers (such as {@link List}). - * - * @param position Position in the {@link Vector} where the new elements are inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: VectorReverseIterator, begin: InputIterator, end: InputIterator): VectorReverseIterator; - /** - * @hidden - */ - private insert_by_val(position, val); - /** - * @hidden - */ - protected _Insert_by_repeating_val(position: VectorIterator, n: number, val: T): VectorIterator; - /** - * @hidden - */ - protected _Insert_by_range>(position: VectorIterator, first: InputIterator, last: InputIterator): VectorIterator; - /** - * @inheritdoc - */ - pop_back(): void; - /** - *

    Erase element.

    - * - *

    Removes from the {@link Vector} either a single element; position.

    - * - *

    This effectively reduces the container size by the number of element removed.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, erasing an element in - * position other than the {@link end end()} causes the container to relocate all the elements after the - * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    - * - * @param position Iterator pointing to a single element to be removed from the {@link Vector}. - * - * @return An iterator pointing to the new location of the element that followed the last element erased by - * the function call. This is the {@link end end()} if the operation erased the last element in the - * sequence. - */ - erase(position: VectorIterator): VectorIterator; - /** - *

    Erase element.

    - * - *

    Removes from the Vector either a single element; position.

    - * - *

    This effectively reduces the container size by the number of elements removed.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, erasing elements in - * position other than the {@link end end()} causes the container to relocate all the elements after the - * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    - * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the new location of the element that followed the last element erased by - * the function call. This is the {@link rend rend()} if the operation erased the last element in the - * sequence. - */ - erase(first: VectorIterator, last: VectorIterator): VectorIterator; - /** - *

    Erase element.

    - * - *

    Removes from the {@link Vector} either a single element; position.

    - * - *

    This effectively reduces the container size by the number of element removed.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, erasing an element in - * position other than the {@link end end()} causes the container to relocate all the elements after the - * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    - * - * @param position Iterator pointing to a single element to be removed from the {@link Vector}. - * - * @return An iterator pointing to the new location of the element that followed the last element erased by - * the function call. This is the {@link rend rend()} if the operation erased the last element in the - * sequence. - */ - erase(position: VectorReverseIterator): VectorReverseIterator; - /** - *

    Erase element.

    - * - *

    Removes from the Vector either a single element; position.

    - * - *

    This effectively reduces the container size by the number of elements removed.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, erasing elements in - * position other than the {@link end end()} causes the container to relocate all the elements after the - * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    - * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the new location of the element that followed the last element erased by - * the function call. This is the {@link end end()} if the operation erased the last element in the - * sequence. - */ - erase(first: VectorReverseIterator, last: VectorReverseIterator): VectorReverseIterator; - /** - * @hidden - */ - protected _Erase_by_range(first: VectorIterator, last: VectorIterator): VectorIterator; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link Vector container} object with same type of elements. Sizes and container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were in obj - * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link Vector container} of the same type of elements (i.e., instantiated - * with the same template parameter, T) whose content is swapped with that of this - * {@link container Vector}. - */ - obj(obj: Vector): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std { - /** - *

    An iterator of Vector.

    - * - *

    - * - *

    - * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class VectorIterator extends Iterator implements base.IArrayIterator { - /** - * Sequence number of iterator in the source {@link Vector}. - */ - private index_; - /** - *

    Construct from the source {@link Vector container}.

    - * - *

    Note

    - *

    Do not create the iterator directly, by yourself.

    - *

    Use {@link Vector.begin begin()}, {@link Vector.end end()} in {@link Vector container} instead.

    - * - * @param source The source {@link Vector container} to reference. - * @param index Sequence number of the element in the source {@link Vector}. - */ - constructor(source: Vector, index: number); - /** - * @hidden - */ - private vector; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * Get index. - */ - index: number; - /** - * @inheritdoc - */ - prev(): VectorIterator; - /** - * @inheritdoc - */ - next(): VectorIterator; - /** - * @inheritdoc - */ - advance(n: number): VectorIterator; - /** - *

    Whether an iterator is equal with the iterator.

    - * - *

    Compare two iterators and returns whether they are equal or not.

    - * - *

    Note

    - *

    Iterator's equal_to() only compare souce container and index number.

    - * - *

    Although elements in a pair, key and value are equal_to, if the source map or - * index number is different, then the {@link equal_to equal_to()} will return false. If you want to - * compare the elements of a pair, compare them directly by yourself.

    - * - * @param obj An iterator to compare - * @return Indicates whether equal or not. - */ - equal_to(obj: VectorIterator): boolean; - /** - * @inheritdoc - */ - swap(obj: VectorIterator): void; - } -} -declare namespace std { - /** - *

    A reverse-iterator of Vector.

    - * - *

    - * - *

    - * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class VectorReverseIterator extends ReverseIterator, VectorReverseIterator> implements base.IArrayIterator { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: VectorIterator); - /** - * @hidden - */ - protected create_neighbor(base: VectorIterator): VectorReverseIterator; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * Get index. - */ - index: number; - } -} -declare namespace std.base { - /** - *

    Static class holding enumeration codes of color of Red-black tree.

    - * - *

    Color codes imposed to nodes of RB-Tree are following those rules:

    - * - *
      - *
    1. A node is either red or black.
    2. - *
    3. The root is black. This rule is sometimes omitted. Since the root can - * always be changed from red to black, but not - * necessarily vice versa, this rule has little effect on analysis.
    4. - *
    5. All leaves (NIL; null) are black.
    6. - *
    7. If a node is red, then both its children are - * black.
    8. - *
    9. Every path from a given node to any of its descendant NIL nodes contains the same number of - * black nodes. Some definitions: the number of - * black nodes from the root to a node is the node's - * black depth; the uniform number of black - * nodes in all paths from root to the leaves is called the black-height of - * the red-black tree.
    10. - *
    - * - * @author Migrated by Jeongho Nam - */ - enum Color { - /** - *

    Code of color black.

    - * - *
      - *
    • Those are clearly black: root, leaf nodes or children nodes of red.
    • - *
    • Every path from a given nodes containes the same number of black nodes exclude NIL(s).
    • - *
    - */ - BLACK = 0, - /** - *

    Code of color red.

    - */ - RED = 1, - } -} declare namespace std.base { enum Hash { MIN_SIZE = 10, @@ -10636,6 +4153,1440 @@ declare namespace std.base { insert>(position: Iterator, begin: InputIterator, end: InputIterator): Iterator; } } +declare namespace std { + /** + *

    Bi-directional iterator.

    + * + *

    {@link Iterator Bidirectional iterators} are iterators that can be used to access the sequence of elements + * in a range in both directions (towards the end and towards the beginning).

    + * + *

    All {@link IArrayIterator random-access iterators} are also valid {@link Iterrator bidirectional iterators}. + *

    + * + *

    There is not a single type of {@link Iterator bidirectional iterator}: {@link IContainer Each container} + * may define its own specific iterator type able to iterate through it and access its elements.

    + * + *

    + * + *

    + * + * @reference http://www.cplusplus.com/reference/iterator/BidirectionalIterator + * @author Jeongho Nam + */ + abstract class Iterator { + /** + * Source container of the iterator is directing for. + */ + protected source_: base.IContainer; + /** + * Construct from the source {@link IContainer container}. + * + * @param source The source + */ + constructor(source: base.IContainer); + /** + *

    Get iterator to previous element.

    + *

    If current iterator is the first item(equal with {@link IContainer.begin IContainer.begin()}), + * returns {@link IContainer.end IContainer.end()}.

    + * + * @return An iterator of the previous item. + */ + abstract prev(): Iterator; + /** + *

    Get iterator to next element.

    + *

    If current iterator is the last item, returns {@link IContainer.end IContainer.end()}.

    + * + * @return An iterator of the next item. + */ + abstract next(): Iterator; + /** + * Advances the {@link Iterator} by n element positions. + * + * @param n Number of element positions to advance. + * @return An advanced iterator. + */ + advance(n: number): Iterator; + /** + * Get source + */ + get_source(): base.IContainer; + /** + *

    Whether an iterator is equal with the iterator.

    + * + *

    Compare two iterators and returns whether they are equal or not.

    + * + *

    Note

    + *

    Iterator's equal_to() only compare souce container and index number.

    + * + *

    Although elements in a pair, key and value are equal_to, if the source map or + * index number is different, then the {@link equal_to equal_to()} will return false. If you want to + * compare the elements of a pair, compare them directly by yourself.

    + * + * @param obj An iterator to compare + * @return Indicates whether equal or not. + */ + equal_to(obj: Iterator): boolean; + /** + *

    Get value of the iterator is pointing.

    + * + * @return A value of the iterator. + */ + readonly value: T; + abstract swap(obj: Iterator): void; + } +} +declare namespace std { + /** + *

    This class reverses the direction in which a bidirectional or random-access iterator iterates through a range. + *

    + * + *

    A copy of the original iterator (the {@link Iterator base iterator}) is kept internally and used to reflect + * the operations performed on the {@link ReverseIterator}: whenever the {@link ReverseIterator} is incremented, its + * {@link Iterator base iterator} is decreased, and vice versa. A copy of the {@link Iterator base iterator} with the + * current state can be obtained at any time by calling member {@link base}.

    + * + *

    Notice however that when an iterator is reversed, the reversed version does not point to the same element in + * the range, but to the one preceding it. This is so, in order to arrange for the past-the-end element of a + * range: An iterator pointing to a past-the-end element in a range, when reversed, is pointing to the last element + * (not past it) of the range (this would be the first element of the reversed range). And if an iterator to the + * first element in a range is reversed, the reversed iterator points to the element before the first element (this + * would be the past-the-end element of the reversed range).

    + * + *

    + * + *

    + * + * @reference http://www.cplusplus.com/reference/iterator/reverse_iterator + * @author Jeongho Nam + */ + abstract class ReverseIterator, This extends ReverseIterator> extends Iterator { + /** + * @hidden + */ + protected base_: Base; + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: Base); + /** + *

    Return base iterator.

    + * + *

    Return a reference of the base iteraotr.

    + * + *

    The base iterator is an iterator of the same type as the one used to construct the {@link ReverseIterator}, + * but pointing to the element next to the one the {@link ReverseIterator} is currently pointing to + * (a {@link ReverseIterator} has always an offset of -1 with respect to its base iterator). + * + * @return A reference of the base iterator, which iterates in the opposite direction. + */ + base(): Base; + /** + * @hidden + */ + protected abstract create_neighbor(base: Base): This; + /** + *

    Get value of the iterator is pointing.

    + * + * @return A value of the reverse iterator. + */ + readonly value: T; + /** + * @inheritdoc + */ + prev(): This; + /** + * @inheritdoc + */ + next(): This; + /** + * @inheritdoc + */ + advance(n: number): This; + /** + * @inheritdoc + */ + equal_to(obj: This): boolean; + /** + * @inheritdoc + */ + swap(obj: This): void; + } + /** + *

    Return distance between {@link Iterator iterators}.

    + * + *

    Calculates the number of elements between first and last.

    + * + *

    If it is a {@link IArrayIterator random-access iterator}, the function uses operator- to calculate this. + * Otherwise, the function uses the increase operator {@link Iterator.next next()} repeatedly.

    + * + * @param first Iterator pointing to the initial element. + * @param last Iterator pointing to the final element. This must be reachable from first. + * + * @return The number of elements between first and last. + */ + function distance>(first: InputIterator, last: InputIterator): number; + /** + *

    Advance iterator.

    + * + *

    Advances the iterator it by n elements positions.

    + * + * @param it Iterator to be advanced. + * @param n Number of element positions to advance. + * + * @return An iterator to the element n positions before it. + */ + function advance>(it: InputIterator, n: number): InputIterator; + /** + *

    Get iterator to previous element.

    + * + *

    Returns an iterator pointing to the element that it would be pointing to if advanced -n positions.

    + * + * @param it Iterator to base position. + * @param n Number of element positions offset (1 by default). + * + * @return An iterator to the element n positions before it. + */ + function prev>(it: BidirectionalIterator, n?: number): BidirectionalIterator; + /** + *

    Get iterator to next element.

    + * + *

    Returns an iterator pointing to the element that it would be pointing to if advanced n positions.

    + * + * @param it Iterator to base position. + * @param n Number of element positions offset (1 by default). + * + * @return An iterator to the element n positions away from it. + */ + function next>(it: ForwardIterator, n?: number): ForwardIterator; + /** + *

    Iterator to beginning.

    + * + *

    Returns an iterator pointing to the first element in the sequence.

    + * + *

    If the sequence is empty, the returned value shall not be dereferenced.

    + * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. + */ + function begin(container: Vector): VectorIterator; + /** + *

    Iterator to beginning.

    + * + *

    Returns an iterator pointing to the first element in the sequence.

    + * + *

    If the sequence is empty, the returned value shall not be dereferenced.

    + * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. + */ + function begin(container: List): ListIterator; + /** + *

    Iterator to beginning.

    + * + *

    Returns an iterator pointing to the first element in the sequence.

    + * + *

    If the sequence is empty, the returned value shall not be dereferenced.

    + * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. + */ + function begin(container: Deque): DequeIterator; + /** + *

    Iterator to beginning.

    + * + *

    Returns an iterator pointing to the first element in the sequence.

    + * + *

    If the sequence is empty, the returned value shall not be dereferenced.

    + * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. + */ + function begin(container: base.SetContainer): SetIterator; + /** + *

    Iterator to beginning.

    + * + *

    Returns an iterator pointing to the first element in the sequence.

    + * + *

    If the sequence is empty, the returned value shall not be dereferenced.

    + * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. + */ + function begin(container: base.MapContainer): MapIterator; + /** + *

    Iterator to end.

    + * + *

    Returns an iterator pointing to the past-the-end element in the sequence.

    + * + *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    + * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function end(container: Vector): VectorIterator; + /** + *

    Iterator to end.

    + * + *

    Returns an iterator pointing to the past-the-end element in the sequence.

    + * + *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    + * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function end(container: List): ListIterator; + /** + *

    Iterator to end.

    + * + *

    Returns an iterator pointing to the past-the-end element in the sequence.

    + * + *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    + * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function end(container: Deque): DequeIterator; + /** + *

    Iterator to end.

    + * + *

    Returns an iterator pointing to the past-the-end element in the sequence.

    + * + *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    + * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function end(container: base.SetContainer): SetIterator; + /** + *

    Iterator to end.

    + * + *

    Returns an iterator pointing to the past-the-end element in the sequence.

    + * + *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    + * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function end(container: base.MapContainer): MapIterator; +} +declare namespace std.base { + /** + *

    An abstract map.

    + * + *

    {@link MapContainer MapContainers} are associative containers that store elements formed by a combination + * of a key value (Key) and a mapped value (T), and which allows for fast retrieval + * of individual elements based on their keys.

    + * + *

    In a {@link MapContainer}, the key values are generally used to identify the elements, while the + * mapped values store the content associated to this key. The types of key and + * mapped value may differ, and are grouped together in member type value_type, which is a + * {@link Pair} type combining both:

    + * + *

    typedef pair value_type;

    + * + *

    {@link MapContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute position + * in the container. + *
    + * + *
    Map
    + *
    + * Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value. + *
    + *
    + * + * @param Type of the keys. Each element in a map is identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @author Jeongho Nam + */ + abstract class MapContainer extends Container> { + /** + *

    {@link List} storing elements.

    + * + *

    Storing elements and keeping those sequence of the {@link MapContainer} are implemented by + * {@link data_ this list container}. Implementing index-table is also related with {@link data_ this list} + * by storing {@link ListIterator iterators} ({@link MapIterator} references {@link ListIterator}) who are + * created from {@link data_ here}.

    + */ + private data_; + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + assign>>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + clear(): void; + /** + *

    Get iterator to element.

    + * + *

    Searches the container for an element with a identifier equivalent to key and returns an + * iterator to it if found, otherwise it returns an iterator to {@link end end()}.

    + * + *

    Two keys are considered equivalent if the container's comparison object returns false reflexively + * (i.e., no matter the order in which the elements are passed as arguments).

    + * + *

    Another member functions, {@link has has()} and {@link count count()}, can be used to just check + * whether a particular key exists.

    + * + * @param key Key to be searched for + * @return An iterator to the element, if an element with specified key is found, or + * {@link end end()} otherwise. + */ + abstract find(key: Key): MapIterator; + /** + *

    Return iterator to beginning.

    + * + *

    Returns an iterator referring the first element in the

    + * + *

    Note

    + *

    If the container is {@link empty}, the returned iterator is same with {@link end end()}.

    + * + * @return An iterator to the first element in the The iterator containes the first element's value. + */ + begin(): MapIterator; + /** + *

    Return iterator to end.

    + *

    Returns an iterator referring to the past-the-end element in the

    + * + *

    The past-the-end element is the theoretical element that would follow the last element in the + * It does not point to any element, and thus shall not be dereferenced.

    + * + *

    Because the ranges used by functions of the container do not include the element reference by their + * closing iterator, this function is often used in combination with {@link MapContainer}.{@link begin} to + * specify a range including all the elements in the

    + * + *

    Note

    + *

    Returned iterator from {@link MapContainer}.{@link end} does not refer any element. Trying to accessing + * element by the iterator will cause throwing exception ({@link OutOfRange}).

    + * + *

    If the container is {@link empty}, this function returns the same as {@link begin}.

    + * + * @return An iterator to the end element in the + */ + end(): MapIterator; + /** + *

    Return {@link MapReverseIterator reverse iterator} to reverse beginning.

    + * + *

    Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in the container + * (i.e., its reverse beginning).

    + * + * {@link MapReverseIterator Reverse iterators} iterate backwards: increasing them moves them towards the + * beginning of the container.

    + * + *

    {@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}. + *

    + * + * @return A {@link MapReverseIterator reverse iterator} to the reverse beginning of the sequence + * + */ + rbegin(): MapReverseIterator; + /** + *

    Return {@link MapReverseIterator reverse iterator} to reverse end.

    + * + *

    Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before + * the first element in the {@link MapContainer map container} (which is considered its reverse end). + *

    + * + *

    The range between {@link MapContainer}.{@link rbegin} and {@link MapContainer}.{@link rend} contains + * all the elements of the container (in reverse order).

    + * + * @return A {@link MapReverseIterator reverse iterator} to the reverse end of the sequence + */ + rend(): MapReverseIterator; + /** + *

    Whether have the item or not.

    + * + *

    Indicates whether a map has an item having the specified identifier.

    + * + * @param key Key value of the element whose mapped value is accessed. + * + * @return Whether the map has an item having the specified identifier. + */ + has(key: Key): boolean; + /** + *

    Count elements with a specific key.

    + * + *

    Searches the container for elements whose key is key and returns the number of elements found.

    + * + * @param key Key value to be searched for. + * + * @return The number of elements in the container with a key. + */ + abstract count(key: Key): number; + /** + * Return the number of elements in the map. + */ + size(): number; + /** + * @inheritdoc + */ + push(...args: Pair[]): number; + /** + * @inheritdoc + */ + push(...args: [Key, T][]): number; + /** + * Construct and insert element with hint + * + * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in + * place using *args* as the arguments for the element's constructor. *hint* points to a location in the + * container suggested as a hint on where to start the search for its insertion point (the container may or + * may not use this suggestion to optimize the insertion operation). + * + * A similar member function exists, {@link insert}, which either copies or moves an existing object into + * the container, and may also take a position *hint*. + * + * @param hint Hint for the position where the element can be inserted. + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + emplace_hint(hint: MapIterator, key: Key, val: T): MapIterator; + /** + * Construct and insert element with hint + * + * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in + * place using *args* as the arguments for the element's constructor. *hint* points to a location in the + * container suggested as a hint on where to start the search for its insertion point (the container may or + * may not use this suggestion to optimize the insertion operation). + * + * A similar member function exists, {@link insert}, which either copies or moves an existing object into + * the container, and may also take a position *hint*. + * + * @param hint Hint for the position where the element can be inserted. + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An {@link MapIterator iterator} pointing to either the newly inserted element or to the element + * that already had an equivalent key in the {@link MapContainer}. + */ + emplace_hint(hint: MapReverseIterator, key: Key, val: T): MapReverseIterator; + /** + * Construct and insert element with hint + * + * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in + * place using *args* as the arguments for the element's constructor. *hint* points to a location in the + * container suggested as a hint on where to start the search for its insertion point (the container may or + * may not use this suggestion to optimize the insertion operation). + * + * A similar member function exists, {@link insert}, which either copies or moves an existing object into + * the container, and may also take a position *hint*. + * + * @param hint Hint for the position where the element can be inserted. + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + emplace_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * Construct and insert element with hint + * + * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in + * place using *args* as the arguments for the element's constructor. *hint* points to a location in the + * container suggested as a hint on where to start the search for its insertion point (the container may or + * may not use this suggestion to optimize the insertion operation). + * + * A similar member function exists, {@link insert}, which either copies or moves an existing object into + * the container, and may also take a position *hint*. + * + * @param hint Hint for the position where the element can be inserted. + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An {@link MapIterator iterator} pointing to either the newly inserted element or to the element + * that already had an equivalent key in the {@link MapContainer}. + */ + emplace_hint(hint: MapReverseIterator, pair: Pair): MapReverseIterator; + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting a new element, effectively increasing the container {@link size} + * by the number of element inserted (zero or one).

    + * + * @param hint Hint for the position where the element can be inserted. + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + insert(hint: MapIterator, pair: Pair): MapIterator; + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting a new element, effectively increasing the container {@link size} + * by the number of element inserted (zero or one).

    + * + * @param hint Hint for the position where the element can be inserted. + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} + * by the number of elements inserted.

    + * + * @param hint Hint for the position where the element can be inserted. + * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + insert(hint: MapIterator, tuple: [L, U]): MapIterator; + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} + * by the number of elements inserted.

    + * + * @param hint Hint for the position where the element can be inserted. + * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; + /** + *

    Insert elements from range iterators.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted.

    + * + * @param begin Input iterator specifying initial position of a range of elements. + * @param end Input iterator specifying final position of a range of elements. + * Notice that the range includes all the elements between begin and end, + * including the element pointed by begin but not the one pointed by end. + */ + insert>>(first: InputIterator, last: InputIterator): void; + /** + * @hidden + */ + protected abstract _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + private insert_by_tuple(tuple); + /** + * @hidden + */ + protected abstract _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + private insert_by_hint_with_tuple(hint, tuple); + /** + * @hidden + */ + protected abstract _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + *

    Erase an elemet by key.

    + * + *

    Removes from the {@link MapContainer map container} a single element.

    + * + *

    This effectively reduces the container {@link size} by the number of element removed (zero or one), + * which are destroyed.

    + * + * @param key Key of the element to be removed from the {@link MapContainer}. + */ + erase(key: Key): number; + /** + *

    Erase an elemet by iterator.

    + * + *

    Removes from the {@link MapContainer map container} a single element.

    + * + *

    This effectively reduces the container {@link size} by the number of element removed (zero or one), + * which are destroyed.

    + * + * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. + */ + erase(it: MapIterator): MapIterator; + /** + *

    Erase elements by range iterators.

    + * + *

    Removes from the {@link MapContainer map container} a range of elements.

    + * + *

    This effectively reduces the container {@link size} by the number of elements removed, which are + * destroyed.

    + * + * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} + * to be removed. + * @param end An iterator specifying initial position of a range within {@link MApContainer map container} + * to be removed. + * Notice that the range includes all the elements between begin and end, + * including the element pointed by begin but not the one pointed by end. + */ + erase(begin: MapIterator, end: MapIterator): MapIterator; + /** + *

    Erase an elemet by iterator.

    + * + *

    Removes from the {@link MapContainer map container} a single element.

    + * + *

    This effectively reduces the container {@link size} by the number of element removed (zero or one), + * which are destroyed.

    + * + * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. + */ + erase(it: MapReverseIterator): MapReverseIterator; + /** + *

    Erase elements by range iterators.

    + * + *

    Removes from the {@link MapContainer map container} a range of elements.

    + * + *

    This effectively reduces the container {@link size} by the number of elements removed, which are + * destroyed.

    + * + * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} + * to be removed. + * @param end An iterator specifying initial position of a range within {@link MApContainer map container} + * to be removed. + * Notice that the range includes all the elements between begin and end, + * including the element pointed by begin but not the one pointed by end. + */ + erase(begin: MapReverseIterator, end: MapReverseIterator): MapReverseIterator; + /** + * @hidden + */ + private erase_by_key(key); + /** + * @hidden + */ + private erase_by_iterator(first, last?); + /** + * @hidden + */ + private erase_by_range(begin, end); + /** + *

    Abstract method handling insertions for indexing.

    + * + *

    This method, {@link _Handle_insert} is designed to register the first to last to somewhere storing + * those {@link MapIterator iterators} for indexing, fast accessment and retrievalance.

    + * + *

    When {@link insert} is called, new elements will be inserted into the {@link data_ list container} and new + * {@link MapIterator iterators} first to last, pointing the inserted elements, will be created and the + * newly created iterators first to last will be shifted into this method {@link _Handle_insert} after the + * insertions.

    + * + *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators} + * will be registered into the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the + * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be + * registered into the {@link HashSet.hash_buckets_ hash bucket}.

    + * + * @param first An {@link MapIterator} to the initial position in a sequence. + * @param last An {@link MapIterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + */ + protected abstract _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + *

    Abstract method handling deletions for indexing.

    + * + *

    This method, {@link _Handle_erase} is designed to unregister the first to last to somewhere storing + * those {@link MapIterator iterators} for indexing, fast accessment and retrievalance.

    + * + *

    When {@link erase} is called with first to last, {@link MapIterator iterators} positioning somewhere + * place to be deleted, is memorized and shifted to this method {@link _Handle_erase} after the deletion process is + * terminated.

    + * + *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators} + * will be unregistered from the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the + * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be + * unregistered from the {@link HashSet.hash_buckets_ hash bucket}.

    + * + * @param first An {@link MapIterator} to the initial position in a sequence. + * @param last An {@link MapIterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + */ + protected abstract _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + * @hidden + */ + protected _Swap(obj: MapContainer): void; + } +} +declare namespace std { + /** + *

    An iterator of {@link MapContainer map container}.

    + * + *

    + *

    + * + * @author Jeongho Nam + */ + class MapIterator extends Iterator> implements IComparable> { + /** + * A {@link ListIterator} pointing {@link Pair} of key and value. + */ + private list_iterator_; + /** + * Construct from the {@link MapContainer source map} and {@link ListIterator list iterator}. + * + * @param source The source {@link MapContainer}. + * @param list_iterator A {@link ListIterator} pointing {@link Pair} of key and value. + */ + constructor(source: base.MapContainer, list_iterator: ListIterator>); + /** + * Get iterator to previous element. + */ + prev(): MapIterator; + /** + * Get iterator to next element. + */ + next(): MapIterator; + /** + * Advances the Iterator by n element positions. + * + * @param step Number of element positions to advance. + * @return An advanced Iterator. + */ + advance(step: number): MapIterator; + /** + * @hidden + */ + private readonly map; + /** + * Get ListIterator. + */ + get_list_iterator(): ListIterator>; + /** + * @inheritdoc + */ + readonly value: Pair; + /** + * Get first, key element. + */ + readonly first: Key; + /** + * Get second, value element. + */ + /** + * Set second value. + */ + second: T; + /** + *

    Whether an iterator is equal with the iterator.

    + * + *

    Compare two iterators and returns whether they are equal or not.

    + * + * @param obj An iterator to compare + * @return Indicates whether equal or not. + */ + equal_to(obj: MapIterator): boolean; + less(obj: MapIterator): boolean; + hash(): number; + swap(obj: MapIterator): void; + } + /** + *

    A reverse-iterator of {@link MapContainer map container}.

    + * + *

    + *

    + * + * @author Jeongho Nam + */ + class MapReverseIterator extends ReverseIterator, MapIterator, MapReverseIterator> { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: MapIterator); + /** + * @hidden + */ + protected create_neighbor(base: MapIterator): MapReverseIterator; + /** + * Get first, key element. + */ + readonly first: Key; + /** + * Get second, value element. + */ + /** + * Set second value. + */ + second: T; + } +} +declare namespace std.base { + /** + *

    An abstract multi-map.

    + * + *

    {@link MultiMap MultiMaps} are associative containers that store elements formed by a combination of a + * key value (Key) and a mapped value (T), and which allows for fast retrieval of + * individual elements based on their keys.

    + * + *

    In a {@link MapContainer}, the key values are generally used to identify the elements, while the + * mapped values store the content associated to this key. The types of key and + * mapped value may differ, and are grouped together in member type value_type, which is a + * {@link Pair} type combining both:

    + * + *

    typedef pair value_type;

    + * + *

    {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute position + * in the container. + *
    + * + *
    Map
    + *
    + * Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value. + *
    + * + *
    Multiple equivalent keys
    + *
    Multiple elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the keys. Each element in a map is identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @author Jeongho Nam + */ + abstract class MultiMap extends MapContainer { + /** + * Construct and insert element. + * + * Inserts a new element in the {@link MultiMap}. This new element is constructed in place using args + * as the arguments for the element's constructor. + * + * This effectively increases the container {@link size} by one. + * + * A similar member function exists, {@link insert}, which either copies or moves existing objects into the + * container. + * + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An {@link MapIterator iterator} to the newly inserted element. + */ + emplace(key: Key, value: T): MapIterator; + /** + * Construct and insert element. + * + * Inserts a new element in the {@link MultiMap}. This new element is constructed in place using args + * as the arguments for the element's constructor. + * + * This effectively increases the container {@link size} by one. + * + * A similar member function exists, {@link insert}, which either copies or moves existing objects into the + * container. + * + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * @return An {@link MapIterator iterator} to the newly inserted element. + */ + emplace(pair: Pair): MapIterator; + /** + *

    Insert elements.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted.

    + * + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An iterator pointing to the newly inserted element. + */ + insert(pair: Pair): MapIterator; + /** + *

    Insert elements.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted.

    + * + * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. + * + * @return An iterator pointing to the newly inserted element. + */ + insert(tuple: [L, U]): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapIterator, pair: Pair): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; + /** + * @inheritdoc + */ + insert(hint: MapIterator, tuple: [L, U]): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; + /** + * @inheritdoc + */ + insert>>(first: InputIterator, last: InputIterator): void; + } +} +declare namespace std.base { + /** + *

    An abstract set.

    + * + *

    {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of + * individual elements based on their value.

    + * + *

    In an {@link SetContainer}, the value of an element is at the same time its key, used to + * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be + * modified once in the container - they can be inserted and removed, though.

    + * + *

    {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + *
    + * + * @param Type of the elements. Each element in a {@link SetContainer} container is also identified + * by this value (each value is itself also the element's key). + * + * @author Jeongho Nam + */ + abstract class SetContainer extends Container { + /** + *

    {@link List} storing elements.

    + * + *

    Storing elements and keeping those sequence of the {@link SetContainer} are implemented by + * {@link data_ this list container}. Implementing index-table is also related with {@link data_ this list} + * by storing {@link ListIterator iterators} ({@link SetIterator} references {@link ListIterator}) who are + * created from {@link data_ here}.

    + */ + private data_; + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + assign>(begin: Iterator, end: Iterator): void; + /** + * @inheritdoc + */ + clear(): void; + /** + *

    Get iterator to element.

    + * + *

    Searches the container for an element with key as value and returns an iterator to it if found, + * otherwise it returns an iterator to {@link end end()} (the element past the end of the container).

    + * + *

    Another member function, {@link count count()}, can be used to just check whether a particular element + * exists.

    + * + * @param key Key to be searched for. + * + * @return An iterator to the element, if the specified value is found, or {@link end end()} if it is not + * found in the + */ + abstract find(val: T): SetIterator; + /** + * @inheritdoc + */ + begin(): SetIterator; + /** + * @inheritdoc + */ + end(): SetIterator; + /** + * @inheritdoc + */ + rbegin(): SetReverseIterator; + /** + * @inheritdoc + */ + rend(): SetReverseIterator; + /** + *

    Whether have the item or not.

    + * + *

    Indicates whether a set has an item having the specified identifier.

    + * + * @param key Key value of the element whose mapped value is accessed. + * + * @return Whether the set has an item having the specified identifier. + */ + has(val: T): boolean; + /** + *

    Count elements with a specific key.

    + * + *

    Searches the container for elements with a value of k and returns the number of elements found.

    + * + * @param key Value of the elements to be counted. + * + * @return The number of elements in the container with a key. + */ + abstract count(val: T): number; + /** + * @inheritdoc + */ + size(): number; + /** + * @inheritdoc + */ + push(...args: U[]): number; + /** + *

    Insert an element with hint.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container size by the + * number of elements inserted.

    + * + * @param hint Hint for the position where the element can be inserted. + * @param val Value to be inserted as an element. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had its + * same value in the {@link SetContainer}. + */ + insert(hint: SetIterator, val: T): SetIterator; + /** + *

    Insert an element with hint.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container size by the + * number of elements inserted.

    + * + * @param hint Hint for the position where the element can be inserted. + * @param val Value to be inserted as an element. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had its + * same value in the {@link SetContainer}. + */ + insert(hint: SetReverseIterator, val: T): SetReverseIterator; + /** + *

    Insert elements with a range of a

    + * + *

    Extends the container by inserting new elements, effectively increasing the container size by the + * number of elements inserted.

    + * + * @param begin An iterator specifying range of the begining element. + * @param end An iterator specifying range of the ending element. + */ + insert>(begin: InputIterator, end: InputIterator): void; + /** + * @hidden + */ + protected abstract _Insert_by_val(val: T): any; + /** + * @hidden + */ + protected abstract _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected abstract _Insert_by_range>(begin: InputIterator, end: InputIterator): void; + /** + *

    Erase an element.

    + *

    Removes from the set container the elements whose value is key.

    + * + *

    This effectively reduces the container size by the number of elements removed.

    + * + * @param key Value of the elements to be erased. + * + * @return Number of elements erased. + */ + erase(val: T): number; + /** + * @inheritdoc + */ + erase(it: SetIterator): SetIterator; + /** + *

    Erase elements.

    + *

    Removes from the set container a range of elements..

    + * + *

    This effectively reduces the container size by the number of elements removed.

    + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + */ + erase(begin: SetIterator, end: SetIterator): SetIterator; + /** + * @inheritdoc + */ + erase(it: SetReverseIterator): SetReverseIterator; + /** + *

    Erase elements.

    + *

    Removes from the set container a range of elements..

    + * + *

    This effectively reduces the container size by the number of elements removed.

    + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + */ + erase(begin: SetReverseIterator, end: SetReverseIterator): SetReverseIterator; + /** + * @hidden + */ + private erase_by_iterator(first, last?); + /** + * @hidden + */ + private erase_by_val(val); + /** + * @hidden + */ + private erase_by_range(begin, end); + /** + *

    Abstract method handling insertions for indexing.

    + * + *

    This method, {@link _Handle_insert} is designed to register the first to last to somewhere storing + * those {@link SetIterator iterators} for indexing, fast accessment and retrievalance.

    + * + *

    When {@link insert} is called, new elements will be inserted into the {@link data_ list container} and new + * {@link SetIterator iterators} first to last, pointing the inserted elements, will be created and the + * newly created iterators first to last will be shifted into this method {@link _Handle_insert} after the + * insertions.

    + * + *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link SetIterator iterators} + * will be registered into the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the + * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be + * registered into the {@link HashSet.hash_buckets_ hash bucket}.

    + * + * @param first An {@link SetIterator} to the initial position in a sequence. + * @param last An {@link SetIterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + */ + protected abstract _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + *

    Abstract method handling deletions for indexing.

    + * + *

    This method, {@link _Handle_erase} is designed to unregister the first to last to somewhere storing + * those {@link SetIterator iterators} for indexing, fast accessment and retrievalance.

    + * + *

    When {@link erase} is called with first to last, {@link SetIterator iterators} positioning somewhere + * place to be deleted, is memorized and shifted to this method {@link _Handle_erase} after the deletion process is + * terminated.

    + * + *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link SetIterator iterators} + * will be unregistered from the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the + * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be + * unregistered from the {@link HashSet.hash_buckets_ hash bucket}.

    + * + * @param first An {@link SetIterator} to the initial position in a sequence. + * @param last An {@link SetIterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + */ + protected abstract _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + * @hidden + */ + protected _Swap(obj: SetContainer): void; + } +} +declare namespace std { + /** + *

    An iterator of a Set.

    + * + *

    + *

    + * + * @author Jeongho Nam + */ + class SetIterator extends Iterator implements IComparable> { + private list_iterator_; + /** + *

    Construct from source and index number.

    + * + *

    Note

    + *

    Do not create iterator directly.

    + *

    Use begin(), find() or end() in Map instead.

    + * + * @param map The source Set to reference. + * @param index Sequence number of the element in the source Set. + */ + constructor(source: base.SetContainer, it: ListIterator); + /** + * @inheritdoc + */ + prev(): SetIterator; + /** + * @inheritdoc + */ + next(): SetIterator; + /** + * @inheritdoc + */ + advance(size: number): SetIterator; + /** + * @hidden + */ + private readonly set; + get_list_iterator(): ListIterator; + /** + * @inheritdoc + */ + readonly value: T; + /** + * @inheritdoc + */ + equal_to(obj: SetIterator): boolean; + /** + * @inheritdoc + */ + less(obj: SetIterator): boolean; + /** + * @inheritdoc + */ + hash(): number; + /** + * @inheritdoc + */ + swap(obj: SetIterator): void; + } + /** + *

    A reverse-iterator of Set.

    + * + *

    + *

    + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class SetReverseIterator extends ReverseIterator, SetReverseIterator> { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: SetIterator); + /** + * @hidden + */ + protected create_neighbor(base: SetIterator): SetReverseIterator; + } +} +declare namespace std.base { + /** + *

    An abstract set.

    + * + *

    {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of + * individual elements based on their value.

    + * + *

    In an {@link SetContainer}, the value of an element is at the same time its key, used to + * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be + * modified once in the container - they can be inserted and removed, though.

    + * + *

    {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + * + *
    Multiple equivalent keys
    + *
    Multiple elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the elements. Each element in a {@link SetContainer} container is also identified + * by this value (each value is itself also the element's key). + * + * @author Jeongho Nam + */ + abstract class MultiSet extends SetContainer { + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted.

    + * + * @param key Value to be inserted as an element. + * + * @return An iterator to the newly inserted element. + */ + insert(val: T): SetIterator; + /** + * @inheritdoc + */ + insert(hint: SetIterator, val: T): SetIterator; + /** + * @inheritdoc + */ + insert(hint: SetReverseIterator, val: T): SetReverseIterator; + /** + * @inheritdoc + */ + insert>(begin: InputIterator, end: InputIterator): void; + } +} declare namespace std.base { /** *

    Red-black Tree.

    @@ -11440,7 +6391,6 @@ declare namespace std.base { * Default Constructor. */ constructor(map: TreeMap | TreeMultiMap, compare?: (x: Key, y: Key) => boolean); - _Set_compare(val: (x: Key, y: Key) => boolean): void; find(key: Key): XTreeNode>; find(it: MapIterator): XTreeNode>; /** @@ -11741,7 +6691,6 @@ declare namespace std.base { * Default Constructor. */ constructor(set: TreeSet | TreeMultiSet, compare?: (x: T, y: T) => boolean); - _Set_compare(val: (x: T, y: T) => boolean): void; find(val: T): XTreeNode>; find(it: SetIterator): XTreeNode>; /** @@ -11866,6 +6815,427 @@ declare namespace std.base { is_less(left: SetIterator, right: SetIterator): boolean; } } +declare namespace std.base { + /** + *

    An abstract unique-map.

    + * + *

    {@link UniqueMap UniqueMaps} are associative containers that store elements formed by a combination of a + * key value (Key) and a mapped value (T), and which allows for fast retrieval of + * individual elements based on their keys.

    + * + *

    In a {@link MapContainer}, the key values are generally used to uniquely identify the elements, + * while the mapped values store the content associated to this key. The types of key and + * mapped value may differ, and are grouped together in member type value_type, which is a + * {@link Pair} type combining both:

    + * + *

    typedef pair value_type;

    + * + *

    {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute position + * in the container. + *
    + * + *
    Map
    + *
    + * Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value. + *
    + * + *
    Unique keys
    + *
    No two elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the keys. Each element in a map is uniquely identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @author Jeongho Nam + */ + abstract class UniqueMap extends MapContainer { + /** + * @inheritdoc + */ + count(key: Key): number; + /** + *

    Get an element

    + * + *

    Returns a reference to the mapped value of the element identified with key.

    + * + * @param key Key value of the element whose mapped value is accessed. + * + * @throw exception out of range + * + * @return A reference object of the mapped value (_Ty) + */ + get(key: Key): T; + /** + *

    Set an item as the specified identifier.

    + * + *

    If the identifier is already in map, change value of the identifier. If not, then insert the object + * with the identifier.

    + * + * @param key Key value of the element whose mapped value is accessed. + * @param val Value, the item. + */ + set(key: Key, val: T): void; + /** + *

    Extract an element.

    + * + *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    + * + * @param key Key value of the element whose mapped value is accessed. + * + * @return A {@link Pair} containing the value pointed to by key. + */ + extract(key: Key): Pair; + /** + *

    Extract an element.

    + * + *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    + * + * @param it An iterator pointing an element to extract. + * + * @return An iterator pointing to the element immediately following it prior to the element being + * erased. If no such element exists,returns {@link end end()}. + */ + extract(it: MapIterator): MapIterator; + /** + *

    Extract an element.

    + * + *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    + * + * @param it An iterator pointing an element to extract. + * + * @return An iterator pointing to the element immediately following it prior to the element being + * erased. If no such element exists,returns {@link end end()}. + */ + extract(it: MapReverseIterator): MapReverseIterator; + /** + * @hidden + */ + private extract_by_key(key); + /** + * @hidden + */ + private extract_by_iterator(it); + /** + * @hidden + */ + private extract_by_reverse_iterator(it); + /** + * Construct and insert element. + * + * Inserts a new element in the {@link UniqueMap} if its *key* is unique. This new element is constructed in + * place using args as the arguments for the construction of a *value_type* (which is an object of a + * {@link Pair} type). + * + * The insertion only takes place if no other element in the container has a *key equivalent* to the one + * being emplaced (*keys* in a {@link UniqueMap} container are unique). + * + * If inserted, this effectively increases the container {@link size} by one. + * + * A similar member function exists, {@link insert}, which either copies or moves existing objects into the + * container. + * + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return If the function successfully inserts the element (because no equivalent element existed already in + * the {@link UniqueMap}), the function returns a {@link Pair} of an {@link MapIterator iterator} to + * the newly inserted element and a value of true. Otherwise, it returns an + * {@link MapIterator iterator} to the equivalent element within the container and a value of false. + */ + emplace(key: Key, value: T): Pair, boolean>; + /** + * Construct and insert element. + * + * Inserts a new element in the {@link UniqueMap} if its *key* is unique. This new element is constructed in + * place using args as the arguments for the construction of a *value_type* (which is an object of a + * {@link Pair} type). + * + * The insertion only takes place if no other element in the container has a *key equivalent* to the one + * being emplaced (*keys* in a {@link UniqueMap} container are unique). + * + * If inserted, this effectively increases the container {@link size} by one. + * + * A similar member function exists, {@link insert}, which either copies or moves existing objects into the + * container. + * + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return If the function successfully inserts the element (because no equivalent element existed already in + * the {@link UniqueMap}), the function returns a {@link Pair} of an {@link MapIterator iterator} to + * the newly inserted element and a value of true. Otherwise, it returns an + * {@link MapIterator iterator} to the equivalent element within the container and a value of false. + */ + emplace(pair: Pair): Pair, boolean>; + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by + * one.

    + * + *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is not inserted, returning an iterator to this existing element (if the function + * returns a value).

    + * + *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    + * + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly + * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The + * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or + * false if an equivalent key already existed. + */ + insert(pair: Pair): Pair, boolean>; + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting a new element, effectively increasing the container size by the + * number of elements inserted.

    + * + *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is not inserted, returning an iterator to this existing element (if the function + * returns a value).

    + * + *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    + * + * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. + * + * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly + * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The + * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or + * false if an equivalent key already existed. + */ + insert(tuple: [L, U]): Pair, boolean>; + /** + * @inheritdoc + */ + insert(hint: MapIterator, pair: Pair): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; + /** + * @inheritdoc + */ + insert(hint: MapIterator, tuple: [L, U]): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; + /** + * @inheritdoc + */ + insert>>(first: InputIterator, last: InputIterator): void; + /** + *

    Insert or assign an element.

    + * + *

    Inserts an element or assigns to the current element if the key already exists.

    + * + *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is assigned, returning an iterator to this existing element (if the function returns a + * value).

    + * + *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    + * + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly + * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The + * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or + * false if an equivalent key already existed so the value is assigned. + */ + insert_or_assign(key: Key, value: T): Pair, boolean>; + /** + *

    Insert or assign an element.

    + * + *

    Inserts an element or assigns to the current element if the key already exists.

    + * + *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is assigned, returning an iterator to this existing element (if the function returns a + * value).

    + * + *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    + * + * @param hint Hint for the position where the element can be inserted. + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link UniqueMap}. + */ + insert_or_assign(hint: MapIterator, key: Key, value: T): MapIterator; + /** + *

    Insert or assign an element.

    + * + *

    Inserts an element or assigns to the current element if the key already exists.

    + * + *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is assigned, returning an iterator to this existing element (if the function returns a + * value).

    + * + *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    + * + * @param hint Hint for the position where the element can be inserted. + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link UniqueMap}. + */ + insert_or_assign(hint: MapReverseIterator, key: Key, value: T): MapReverseIterator; + /** + * @hidden + */ + private insert_or_assign_with_key_value(key, value); + /** + * @hidden + */ + private insert_or_assign_with_hint(hint, key, value); + } +} +declare namespace std.base { + /** + *

    An abstract set.

    + * + *

    {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of + * individual elements based on their value.

    + * + *

    In an {@link SetContainer}, the value of an element is at the same time its key, used to uniquely + * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be modified + * once in the container - they can be inserted and removed, though.

    + * + *

    {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + * + *
    Unique keys
    + *
    No two elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the elements. Each element in a {@link SetContainer} container is also identified + * by this value (each value is itself also the element's key). + * + * @author Jeongho Nam + */ + abstract class UniqueSet extends SetContainer { + /** + * @inheritdoc + */ + count(key: T): number; + /** + *

    Extract an element.

    + * + *

    Extracts the element pointed to by val and erases it from the {@link UniqueSet}.

    + * + * @param val Value to be extracted. + * + * @return A value. + */ + extract(val: T): T; + /** + *

    Extract an element.

    + * + *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    + * + * @param it An iterator pointing an element to extract. + * + * @return An iterator pointing to the element immediately following it prior to the element being + * erased. If no such element exists,returns {@link end end()}. + */ + extract(it: SetIterator): SetIterator; + /** + *

    Extract an element.

    + * + *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    + * + * @param it An iterator pointing an element to extract. + * + * @return An iterator pointing to the element immediately following it prior to the element being + * erased. If no such element exists,returns {@link end end()}. + */ + extract(it: SetReverseIterator): SetReverseIterator; + /** + * @hidden + */ + private extract_by_key(val); + /** + * @hidden + */ + private extract_by_iterator(it); + /** + * @hidden + */ + private extract_by_reverse_iterator(it); + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of element inserted (zero or one).

    + * + *

    Because elements in a {@link UniqueSet UniqueSets} are unique, the insertion operation checks whether + * each inserted element is equivalent to an element already in the container, and if so, the element is not + * inserted, returning an iterator to this existing element (if the function returns a value).

    + * + *

    For a similar container allowing for duplicate elements, see {@link MultiSet}.

    + * + * @param key Value to be inserted as an element. + * + * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly + * inserted element or to the equivalent element already in the {@link UniqueSet}. The + * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or + * false if an equivalent element already existed. + */ + insert(val: T): Pair, boolean>; + /** + * @inheritdoc + */ + insert(hint: SetIterator, val: T): SetIterator; + /** + * @inheritdoc + */ + insert(hint: SetReverseIterator, val: T): SetReverseIterator; + /** + * @inheritdoc + */ + insert>(begin: InputIterator, end: InputIterator): void; + } +} declare namespace std.base { /** *

    A node in an XTree.

    @@ -11906,14 +7276,4814 @@ declare namespace std.base { /** * Get grand-parent. */ - grand_parent: XTreeNode; + readonly grand_parent: XTreeNode; /** * Get sibling, opposite side node in same parent. */ - sibling: XTreeNode; + readonly sibling: XTreeNode; /** * Get uncle, parent's sibling. */ - uncle: XTreeNode; + readonly uncle: XTreeNode; + } +} +declare namespace std.Deque { + type iterator = std.DequeIterator; + type reverse_iterator = std.DequeReverseIterator; +} +declare namespace std { + /** + *

    Double ended queue.

    + * + *

    {@link Deque} (usually pronounced like "deck") is an irregular acronym of + * double-ended queue. Double-ended queues are sequence containers with dynamic sizes that can be + * expanded or contracted on both ends (either its front or its back).

    + * + *

    Specific libraries may implement deques in different ways, generally as some form of dynamic array. But in any + * case, they allow for the individual elements to be accessed directly through random access iterators, with storage + * handled automatically by expanding and contracting the container as needed.

    + * + *

    Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of + * elements also at the beginning of the sequence, and not only at its end. But, unlike {@link Vector Vectors}, + * {@link Deque Deques} are not guaranteed to store all its elements in contiguous storage locations: accessing + * elements in a deque by offsetting a pointer to another element causes undefined behavior.

    + * + *

    Both {@link Vector}s and {@link Deque}s provide a very similar interface and can be used for similar purposes, + * but internally both work in quite different ways: While {@link Vector}s use a single array that needs to be + * occasionally reallocated for growth, the elements of a {@link Deque} can be scattered in different chunks of + * storage, with the container keeping the necessary information internally to provide direct access to any of its + * elements in constant time and with a uniform sequential interface (through iterators). Therefore, + * {@link Deque Deques} are a little more complex internally than {@link Vector}s, but this allows them to grow more + * efficiently under certain circumstances, especially with very long sequences, where reallocations become more + * expensive.

    + * + *

    For operations that involve frequent insertion or removals of elements at positions other than the beginning or + * the end, {@link Deque Deques} perform worse and have less consistent iterators and references than + * {@link List Lists}.

    + * + *

    + * + *

    + * + *

    Container properties

    + *
    + *
    Sequence
    + *
    Elements in sequence containers are ordered in a strict linear sequence. Individual elements + * are accessed by their position in this sequence.
    + * + *
    Dynamic array
    + *
    Generally implemented as a dynamic array, it allows direct access to any element in the + * sequence and provides relatively fast addition/removal of elements at the beginning or the end + * of the sequence.
    + *
    + * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/deque/deque/ + * @author Jeongho Nam + */ + class Deque extends base.Container implements base.IArrayContainer, base.IDequeContainer { + /** + * @hidden + */ + private static readonly ROW; + /** + * @hidden + */ + private static readonly MIN_CAPACITY; + /** + * @hidden + */ + private matrix_; + /** + * @hidden + */ + private size_; + /** + * @hidden + */ + private capacity_; + /** + * @hidden + */ + private get_col_size(); + /** + *

    Default Constructor.

    + * + *

    Constructs an empty container, with no elements.

    + */ + constructor(); + /** + *

    Initializer list Constructor.

    + * + *

    Constructs a container with a copy of each of the elements in array, in the same order.

    + * + * @param array An array containing elements to be copied and contained. + */ + constructor(items: Array); + /** + *

    Fill Constructor.

    + * + *

    Constructs a container with n elements. Each element is a copy of val (if provided).

    + * + * @param n Initial container size (i.e., the number of elements in the container at construction). + * @param val Value to fill the container with. Each of the n elements in the container is + * initialized to a copy of this value. + */ + constructor(size: number, val: T); + /** + *

    Copy Constructor.

    + * + *

    Constructs a container with a copy of each of the elements in container, in the same order.

    + * + * @param container Another container object of the same type (with the same class template + * arguments T), whose contents are either copied or acquired. + */ + constructor(container: Deque); + /** + *

    Range Constructor.

    + * + *

    Constructs a container with as many elements as the range (begin, end), with each + * element emplace-constructed from its corresponding element in that range, in the same order.

    + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + assign>(begin: InputIterator, end: InputIterator): void; + /** + * @inheritdoc + */ + assign(n: number, val: T): void; + /** + * @inheritdoc + */ + reserve(capacity: number): void; + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + begin(): DequeIterator; + /** + * @inheritdoc + */ + end(): DequeIterator; + /** + * @inheritdoc + */ + rbegin(): DequeReverseIterator; + /** + * @inheritdoc + */ + rend(): DequeReverseIterator; + /** + * @inheritdoc + */ + size(): number; + /** + * @inheritdoc + */ + empty(): boolean; + /** + * @inheritdoc + */ + capacity(): number; + /** + * @inheritdoc + */ + at(index: number): T; + /** + * @inheritdoc + */ + set(index: number, val: T): void; + /** + * @inheritdoc + */ + front(): T; + /** + * @inheritdoc + */ + back(): T; + /** + // Fetch row and column's index. + /** + * @hidden + */ + private fetch_index(index); + /** + * @inheritdoc + */ + push(...items: T[]): number; + /** + * @inheritdoc + */ + push_front(val: T): void; + /** + * @inheritdoc + */ + push_back(val: T): void; + /** + * @inheritdoc + */ + pop_front(): void; + /** + * @inheritdoc + */ + pop_back(): void; + /** + * @inheritdoc + */ + insert(position: DequeIterator, val: T): DequeIterator; + /** + * @inheritdoc + */ + insert(position: DequeIterator, n: number, val: T): DequeIterator; + /** + * @inheritdoc + */ + insert>(position: DequeIterator, begin: InputIterator, end: InputIterator): DequeIterator; + /** + * @inheritdoc + */ + insert(position: DequeReverseIterator, val: T): DequeReverseIterator; + /** + * @inheritdoc + */ + insert(position: DequeReverseIterator, n: number, val: T): DequeReverseIterator; + /** + * @inheritdoc + */ + insert>(position: DequeReverseIterator, begin: InputIterator, end: InputIterator): DequeReverseIterator; + /** + * @hidden + */ + private insert_by_val(position, val); + /** + * @hidden + */ + protected _Insert_by_repeating_val(position: DequeIterator, n: number, val: T): DequeIterator; + /** + * @hidden + */ + protected _Insert_by_range>(position: DequeIterator, begin: InputIterator, end: InputIterator): DequeIterator; + /** + * @hidden + */ + private insert_by_items(position, items); + /** + * @inheritdoc + */ + erase(position: DequeIterator): DequeIterator; + /** + * @inheritdoc + */ + erase(first: DequeIterator, last: DequeIterator): DequeIterator; + /** + * @inheritdoc + */ + erase(position: DequeReverseIterator): DequeReverseIterator; + /** + * @inheritdoc + */ + erase(first: DequeReverseIterator, last: DequeReverseIterator): DequeReverseIterator; + /** + * @hidden + */ + protected _Erase_by_range(first: DequeIterator, last: DequeIterator): DequeIterator; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link Deque container} object with same type of elements. Sizes and container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link Deque container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link container Deque}. + */ + swap(obj: Deque): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std { + /** + *

    An iterator of {@link Deque}.

    + * + *

    + * + *

    + * + * @author Jeongho Nam + */ + class DequeIterator extends Iterator implements base.IArrayIterator { + /** + * Sequence number of iterator in the source {@link Deque}. + */ + private index_; + /** + *

    Construct from the source {@link Deque container}.

    + * + *

    Note

    + *

    Do not create the iterator directly, by yourself.

    + *

    Use {@link Deque.begin begin()}, {@link Deque.end end()} in {@link Deque container} instead.

    + * + * @param source The source {@link Deque container} to reference. + * @param index Sequence number of the element in the source {@link Deque}. + */ + constructor(source: Deque, index: number); + /** + * @hidden + */ + private readonly deque; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + /** + * @inheritdoc + */ + readonly index: number; + /** + * @inheritdoc + */ + prev(): DequeIterator; + /** + * @inheritdoc + */ + next(): DequeIterator; + /** + * @inheritdoc + */ + advance(n: number): DequeIterator; + /** + *

    Whether an iterator is equal with the iterator.

    + * + *

    Compare two iterators and returns whether they are equal or not.

    + * + *

    Note

    + *

    Iterator's equal_to() only compare souce container and index number.

    + * + *

    Although elements in a pair, key and value are equal_to, if the source map or + * index number is different, then the {@link equal_to equal_to()} will return false. If you want to + * compare the elements of a pair, compare them directly by yourself.

    + * + * @param obj An iterator to compare + * @return Indicates whether equal or not. + */ + equal_to(obj: DequeIterator): boolean; + /** + * @inheritdoc + */ + swap(obj: DequeIterator): void; + } +} +declare namespace std { + /** + *

    A reverse-iterator of Deque.

    + * + *

    + * + *

    + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class DequeReverseIterator extends ReverseIterator, DequeReverseIterator> implements base.IArrayIterator { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: DequeIterator); + /** + * @hidden + */ + protected create_neighbor(base: DequeIterator): DequeReverseIterator; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + /** + * Get index. + */ + readonly index: number; + } +} +declare namespace std { + /** + *

    Function handling termination on exception

    + * + *

    Calls the current terminate handler.

    + * + *

    By default, the terminate handler calls abort. But this behavior can be redefined by calling + * {@link set_terminate}.

    + * + *

    This function is automatically called when no catch handler can be found for a thrown exception, + * or for some other exceptional circumstance that makes impossible to continue the exception handling process.

    + * + *

    This function is provided so that the terminate handler can be explicitly called by a program that needs to + * abnormally terminate, and works even if {@link set_terminate} has not been used to set a custom terminate handler + * (calling abort in this case).

    + */ + function terminate(): void; + /** + *

    Set terminate handler function.

    + * + *

    A terminate handler function is a function automatically called when the exception handling process has + * to be abandoned for some reason. This happens when no catch handler can be found for a thrown exception, or for + * some other exceptional circumstance that makes impossible to continue the exception handling process.

    + * + *

    Before this function is called by the program for the first time, the default behavior is to call abort.

    + * + *

    A program may explicitly call the current terminate handler function by calling {@link terminate}.

    + * + * @param f Function that takes no parameters and returns no value (void). + */ + function set_terminate(f: () => void): void; + /** + *

    Get terminate handler function.

    + * + *

    The terminate handler function is automatically called when no catch handler can be found + * for a thrown exception, or for some other exceptional circumstance that makes impossible to continue the exception + * handling process.

    + * + *

    If no such function has been set by a previous call to {@link set_terminate}, the function returns a + * null-pointer.

    + * + * @return If {@link set_terminate} has previously been called by the program, the function returns the current + * terminate handler function. Otherwise, it returns a null-pointer. + */ + function get_terminate(): () => void; + /** + *

    Standard exception class.

    + * + *

    Base class for standard exceptions.

    + * + *

    All objects thrown by components of the standard library are derived from this class. + * Therefore, all standard exceptions can be caught by catching this type by reference.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/exception/exception + * @author Jeongho Nam + */ + class Exception extends Error { + /** + * A message representing specification about the Exception. + */ + private description; + /** + * Default Constructor. + */ + constructor(); + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + /** + *

    Get string identifying exception.

    + *

    Returns a string that may be used to identify the exception.

    + * + *

    The particular representation pointed by the returned value is implementation-defined. + * As a virtual function, derived classes may redefine this function so that specify value are + * returned.

    + */ + what(): string; + /** + * @inheritdoc + */ + readonly message: string; + /** + * @inheritdoc + */ + readonly name: string; + } + /** + *

    Logic error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report errors in the internal + * logical of the program, such as violation of logical preconditions or class invariants.

    + * + *

    These errors are presumably detectable before the program executes.

    + * + *

    It is used as a base class for several logical error exceptions.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/logic_error + * @author Jeongho Nam + */ + class LogicError extends Exception { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Domain error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report domain errors.

    + * + *

    Generally, the domain of a mathematical function is the subset of values that it is defined for. + * For example, the square root function is only defined for non-negative numbers. Thus, a negative number + * for such a function would qualify as a domain error.

    + * + *

    No component of the standard library throws exceptions of this type. It is designed as a standard + * exception to be thrown by programs.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/domain_error + * @author Jeongho Nam + */ + class DomainError extends LogicError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Invalid argument exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report an invalid argument.

    + * + *

    It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal invalid arguments.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/invalid_argument + * @author Jeongho Nam + */ + class InvalidArgument extends LogicError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Length error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report a length error.

    + * + *

    It is a standard exception that can be thrown by programs. Some components of the standard library, + * such as vector and string also throw exceptions of this type to signal errors resizing.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/length_error + * @author Jeongho Nam + */ + class LengthError extends LogicError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Out-of-range exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report an out-of-range error.

    + * + *

    It is a standard exception that can be thrown by programs. Some components of the standard library, + * such as vector, deque, string and bitset also throw exceptions of this type to signal arguments + * out of range.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/out_of_range + * @author Jeongho Nam + */ + class OutOfRange extends LogicError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Runtime error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report errors that can only be + * detected during runtime.

    + * + *

    It is used as a base class for several runtime error exceptions.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/runtime_error + * @author Jeongho Nam + */ + class RuntimeError extends Exception { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Overflow error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to arithmetic overflow errors.

    + * + *

    It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal range errors.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/overflow_error + * @author Jeongho Nam + */ + class OverflowError extends RuntimeError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Underflow error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to arithmetic underflow errors.

    + * + *

    No component of the standard library throws exceptions of this type. It is designed as a standard + * exception to be thrown by programs.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/underflow_error + * @author Jeongho Nam + */ + class UnderflowError extends RuntimeError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Range error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report range errors in internal + * computations.

    + * + *

    It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal range errors.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/range_error + * @author Jeongho Nam + */ + class RangeError extends RuntimeError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } +} +declare namespace std { + /** + *

    Function object class for equality comparison.

    + * + *

    Binary function object class whose call returns whether its two arguments compare equal (as returned by + * operator ==).

    + * + *

    Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} + * defined. This member function allows the object to be used with the same syntax as a function call.

    + * + * @param x First element to compare. + * @param y Second element to compare. + * + * @return Whether the arguments are equal. + */ + function equal_to(x: T, y: T): boolean; + /** + *

    Function object class for non-equality comparison.

    + * + *

    Binary function object class whose call returns whether its two arguments compare not equal (as returned + * by operator operator!=).

    + * + *

    Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} + * defined. This member function allows the object to be used with the same syntax as a function call.

    + * + * @param x First element to compare. + * @param y Second element to compare. + * + * @return Whether the arguments are not equal. + */ + function not_equal_to(x: T, y: T): boolean; + /** + *

    Function for less-than inequality comparison.

    + * + *

    Binary function returns whether the its first argument compares less than the second.

    + * + *

    Generically, function objects are instances of a class with member function {@link IComparable.less less} + * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. + * This member function allows the object to be used with the same syntax as a function call.

    + * + *

    Objects of this class can be used on standard algorithms such as {@link sort sort()}, + * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.

    + * + * @param Type of arguments to compare by the function call. The type shall supporrt the operation + * operator<() or method {@link IComparable.less less}. + * + * @param x First element, the standard of comparison. + * @param y Second element compare with the first. + * + * @return Whether the first parameter is less than the second. + */ + function less(x: T, y: T): boolean; + /** + *

    Function object class for less-than-or-equal-to comparison.

    + * + *

    Binary function object class whose call returns whether the its first argument compares {@link less less than} or + * {@link equal_to equal to} the second (as returned by operator <=).

    + * + *

    Generically, function objects are instances of a class with member function {@link IComparable.less less} + * and {@link IComparable.equal_to equal_to} defined. This member function allows the object to be used with the same + * syntax as a function call.

    + * + * @param x First element, the standard of comparison. + * @param y Second element compare with the first. + * + * @return Whether the x is {@link less less than} or {@link equal_to equal to} the y. + */ + function less_equal(x: T, y: T): boolean; + /** + *

    Function for greater-than inequality comparison.

    + * + *

    Binary function returns whether the its first argument compares greater than the second.

    + * + *

    Generically, function objects are instances of a class with member function {@link less} and + * {@link equal_to equal_to()} defined. If an object doesn't have those methods, then its own uid will be used + * to compare insteadly. This member function allows the object to be used with the same syntax as a function + * call.

    + * + *

    Objects of this class can be used on standard algorithms such as {@link sort sort()}, + * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.

    + * + * @param Type of arguments to compare by the function call. The type shall supporrt the operation + * operator>() or method {@link IComparable.greater greater}. + * + * @return Whether the x is greater than the y. + */ + function greater(x: T, y: T): boolean; + /** + *

    Function object class for greater-than-or-equal-to comparison.

    + * + *

    Binary function object class whose call returns whether the its first argument compares + * {@link greater greater than} or {@link equal_to equal to} the second (as returned by operator >=).

    + * + *

    Generically, function objects are instances of a class with member function {@link IComparable.less less} + * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. + * This member function allows the object to be used with the same syntax as a function call.

    + * + * @param x First element, the standard of comparison. + * @param y Second element compare with the first. + * + * @return Whether the x is {@link greater greater than} or {@link equal_to equal to} the y. + */ + function greater_equal(x: T, y: T): boolean; + /** + *

    Logical AND function object class.

    + * + *

    Binary function object class whose call returns the result of the logical "and" operation between its two + * arguments (as returned by operator &&).

    + * + *

    Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call.

    + * + * @param x First element. + * @param y Second element. + * + * @return Result of logical AND operation. + */ + function logical_and(x: T, y: T): boolean; + /** + *

    Logical OR function object class.

    + * + *

    Binary function object class whose call returns the result of the logical "or" operation between its two + * arguments (as returned by operator ||).

    + * + *

    Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call.

    + * + * @param x First element. + * @param y Second element. + * + * @return Result of logical OR operation. + */ + function logical_or(x: T, y: T): boolean; + /** + *

    Logical NOT function object class.

    + * + *

    Unary function object class whose call returns the result of the logical "not" operation on its argument + * (as returned by operator !).

    + * + *

    Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call.

    + * + * @param x Target element. + * + * @return Result of logical NOT operation. + */ + function logical_not(x: T): boolean; + /** + *

    Bitwise AND function object class.

    + * + *

    Binary function object class whose call returns the result of applying the bitwise "and" operation between + * its two arguments (as returned by operator &).

    + * + * @param x First element. + * @param y Second element. + * + * @return Result of bitwise AND operation. + */ + function bit_and(x: number, y: number): number; + /** + *

    Bitwise OR function object class.

    + * + *

    Binary function object class whose call returns the result of applying the bitwise "and" operation between + * its two arguments (as returned by operator &).

    + * + * @param x First element. + * @param y Second element. + * + * @return Result of bitwise OR operation. + */ + function bit_or(x: number, y: number): number; + /** + *

    Bitwise XOR function object class.

    + * + *

    Binary function object class whose call returns the result of applying the bitwise "exclusive or" + * operation between its two arguments (as returned by operator ^).

    + * + * @param x First element. + * @param y Second element. + * + * @return Result of bitwise XOR operation. + */ + function bit_xor(x: number, y: number): number; + /** + *

    Comparable instance.

    + * + *

    {@link IComparable} is a common interface for objects who can compare each other.

    + * + * @reference https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html + * @author Jeongho Nam + */ + interface IComparable extends Object { + /** + *

    Indicates whether some other object is "equal to" this one.

    + * + *

    The {@link equal_to} method implements an equivalence relation on non-null object references:

    + * + *
      + *
    • + * It is reflexive: for any non-null reference value x, x.equal_to(x) + * should return true. + *
    • + *
    • + * It is symmetric: for any non-null reference values x and y, + * x.equal_to(y) should return true if and only if y.equal_to(x) + * returns true.
    • + *
    • + * It is transitive: for any non-null reference values x, y, and + * z, if x.equal_to(y) returns true and y.equal_to(z) + * returns true, then x.equal_to(z) should return true. + *
    • + *
    • + * It is consistent: for any non-null reference values x and y, multiple + * invocations of x.equal_to(y) consistently return true or consistently return + * false, provided no information used in equal_to comparisons on the objects is modified. + *
    • + *
    • + * For any non-null reference value x, x.equal_to(null) should return + * false. + *
    • + *
    + * + *

    The {@link equal_to} method for interface {@link IComparable} implements the most discriminating possible + * equivalence relation on objects; that is, for any non-null reference values x and + * y, this method returns true if and only if x and y + * refer to the same object (x == y has the value true).

    + * + *

    Note that it is generally necessary to override the {@link hash_code} method whenever this method is + * overridden, so as to maintain the general contract for the {@link hash_code} method, which states that + * equal objects must have equal hash codes.

    + * + *
      + *
    • {@link IComparable.equal_to} is called by {@link std.equal_to}.
    • + *
    + * + * @param obj the reference object with which to compare. + * + * @return true if this object is the same as the obj argument; false otherwise. + */ + equal_to(obj: T): boolean; + /** + *

    Less-than inequality comparison.

    + * + *

    Binary method returns whether the the instance compares less than the obj.

    + * + *
      + *
    • + * {@link IComparable.less} is called by {@link std.less}. Also, this method can be used on standard + * algorithms such as {@link sort sort()}, {@link merge merge()} or + * {@link TreeMap.lower_bound lower_bound()}. + *
    • + *
    + * + * @param obj the reference object with which to compare. + * + * @return Whether the first parameter is less than the second. + */ + less(obj: T): boolean; + /** + *

    Issue a hash code.

    + * + *

    Returns a hash code value for the object. This method is supported for the benefit of hash tables such + * as those provided by hash containers; {@link HashSet}, {@link HashMap}, {@link MultiHashSet} and + * {@link MultiHashMap}.

    + * + *

    As much as is reasonably practical, the {@link hash_code} method defined by interface + * {@link IComparable} does return distinct integers for distinct objects. (This is typically implemented by + * converting the internal address of the object into an integer, but this implementation technique is not + * required by the JavaScript programming language.)

    + * + *
      + *
    • + * {@link IComparable.hash_code} is called by {@link std.hash_code}. If you want to keep basically + * provided hash function, then returns {@link std.Hash.code}; return std.Hash.code(this); + *
    • + *
    + * + * @return An hash code who represents the object. + */ + hash(): number; + } + /** + *

    Default hash function for number.

    + * + *

    Unary function that defines the default hash function used by the standard library.

    + * + *

    The functional call returns a hash value of its argument: A hash value is a value that depends solely on + * its argument, returning always the same value for the same argument (for a given execution of a program). The + * value returned shall have a small likelihood of being the same as the one returned for a different argument. + *

    + * + * @param val Value to be hashed. + * + * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. + */ + function hash(val: number): number; + /** + *

    Default hash function for string.

    + * + *

    Unary function that defines the default hash function used by the standard library.

    + * + *

    The functional call returns a hash value of its argument: A hash value is a value that depends solely on + * its argument, returning always the same value for the same argument (for a given execution of a program). The + * value returned shall have a small likelihood of being the same as the one returned for a different argument. + *

    + * + * @param str A string to be hashed. + * + * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. + */ + function hash(str: string): number; + /** + *

    Default hash function for Object.

    + * + *

    Unary function that defines the default hash function used by the standard library.

    + * + *

    The functional call returns a hash value of its argument: A hash value is a value that depends solely on + * its argument, returning always the same value for the same argument (for a given execution of a program). The + * value returned shall have a small likelihood of being the same as the one returned for a different argument. + *

    + * + *

    The default {@link hash} function of Object returns a value returned from {@link hash hash(number)} with + * an unique id of each Object. If you want to specify {@link hash} function of a specific class, then + * define a member function public hash(): number in the class.

    + * + * @param obj Object to be hashed. + * + * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. + */ + function hash(obj: Object): number; + /** + *

    Exchange contents of {@link IContainers containers}.

    + * + *

    The contents of container left are exchanged with those of right. Both container objects must have + * same type of elements (same template parameters), although sizes may differ.

    + * + *

    After the call to this member function, the elements in left are those which were in right before + * the call, and the elements of right are those which were in left. All iterators, references and + * pointers remain valid for the swapped objects.

    + * + *

    This is an overload of the generic algorithm swap that improves its performance by mutually transferring + * ownership over their assets to the other container (i.e., the containers exchange references to their data, without + * actually performing any element copy or movement): It behaves as if left. + * {@link IContainer.swap swap}(right) was called.

    + * + * @param left A {@link IContainer container} to swap its contents. + * @param right A {@link IContainer container} to swap its contents. + */ + function swap(left: base.IContainer, right: base.IContainer): void; + /** + *

    Exchange contents of queues.

    + * + *

    Exchanges the contents of left and right.

    + * + * @param left A {@link Queue} container of the same type. Size may differ. + * @param right A {@link Queue} container of the same type. Size may differ. + */ + function swap(left: Queue, right: Queue): void; + /** + *

    Exchange contents of {@link PriorityQueue PriorityQueues}.

    + * + *

    Exchanges the contents of left and right.

    + * + * @param left A {@link PriorityQueue} container of the same type. Size may differ. + * @param right A {@link PriorityQueue} container of the same type. Size may differ. + */ + function swap(left: PriorityQueue, right: PriorityQueue): void; + /** + *

    Exchange contents of {@link Stack Stacks}.

    + * + *

    Exchanges the contents of left and right.

    + * + * @param left A {@link Stack} container of the same type. Size may differ. + * @param right A {@link Stack} container of the same type. Size may differ. + */ + function swap(left: Stack, right: Stack): void; + /** + *

    Exchanges the contents of two {@link UniqueMap unique maps}.

    + * + *

    The contents of container left are exchanged with those of right. Both container objects must + * be of the same type (same template parameters), although sizes may differ.

    + * + *

    After the call to this member function, the elements in left are those which were in right + * before the call, and the elements of right are those which were in left. All iterators, references + * and pointers remain valid for the swapped objects.

    + * + *

    This is an overload of the generic algorithm swap that improves its performance by mutually transferring + * ownership over their assets to the other container (i.e., the containers exchange references to their data, + * without actually performing any element copy or movement): It behaves as if + * left.{@link UniqueMap.swap swap}(right) was called.

    + * + * @param left An {@link UniqueMap unique map} to swap its conents. + * @param right An {@link UniqueMap unique map} to swap its conents. + */ + function swap(left: base.UniqueMap, right: base.UniqueMap): void; + /** + *

    Exchanges the contents of two {@link MultiMap multi maps}.

    + * + *

    The contents of container left are exchanged with those of right. Both container objects must + * be of the same type (same template parameters), although sizes may differ.

    + * + *

    After the call to this member function, the elements in left are those which were in right + * before the call, and the elements of right are those which were in left. All iterators, references + * and pointers remain valid for the swapped objects.

    + * + *

    This is an overload of the generic algorithm swap that improves its performance by mutually transferring + * ownership over their assets to the other container (i.e., the containers exchange references to their data, + * without actually performing any element copy or movement): It behaves as if + * left.{@link MultiMap.swap swap}(right) was called.

    + * + * @param left A {@link MultiMap multi map} to swap its conents. + * @param right A {@link MultiMap multi map} to swap its conents. + */ + function swap(left: base.MultiMap, right: base.MultiMap): void; +} +declare namespace std { + /** + *

    Bind function arguments.

    + * + *

    Returns a function object based on fn, but with its arguments bound to args.

    + * + *

    Each argument may either be bound to a value or be a {@link placeholders placeholder}:

    + *
      + *
    • If bound to a value, calling the returned function object will always use that value as argument.
    • + *
    • + * If a {@link placeholders placeholder}, calling the returned function object forwards an argument passed to the + * call (the one whose order number is specified by the placeholder). + *
    • + *
    + * + *

    Calling the returned object returns the same type as fn.

    + * + * @param fn A function object, pointer to function or pointer to member. + * @param args List of arguments to bind: either values, or {@link placeholders}. + * + * @return A function object that, when called, calls fn with its arguments bound to args. If fn is + * a pointer to member, the first argument expected by the returned function is an object of the class fn + * is a member. + */ + function bind(fn: (...args: any[]) => Ret, ...args: any[]): (...args: any[]) => Ret; + /** + *

    Bind function arguments.

    + * + *

    Returns a function object based on fn, but with its arguments bound to args.

    + * + *

    Each argument may either be bound to a value or be a {@link placeholders placeholder}:

    + *
      + *
    • If bound to a value, calling the returned function object will always use that value as argument.
    • + *
    • + * If a {@link placeholders placeholder}, calling the returned function object forwards an argument passed to the + * call (the one whose order number is specified by the placeholder). + *
    • + *
    + * + *

    Calling the returned object returns the same type as fn.

    + * + * @param fn A function object, pointer to function or pointer to member. + * @param thisArg This argument, owner object of the member method fn. + * @param args List of arguments to bind: either values, or {@link placeholders}. + * + * @return A function object that, when called, calls fn with its arguments bound to args. If fn is + * a pointer to member, the first argument expected by the returned function is an object of the class fn + * is a member. + */ + function bind(fn: (...args: any[]) => Ret, thisArg: T, ...args: any[]): (...args: any[]) => Ret; +} +/** + *

    Bind argument placeholders.

    + * + *
    + * + *

    When the function object returned by bind is called, an argument with placeholder {@link _1} is replaced by the + * first argument in the call, {@link _2} is replaced by the second argument in the call, and so on... For example:

    + * + * + * let vec: Vector = new Vector(); + * + * let bind = std.bind(Vector.insert, _1, vec.end(), _2, _3); + * bind.apply(vec, 5, 1); // vec.insert(vec.end(), 5, 1); + * // [1, 1, 1, 1, 1] + * + * + *

    When a call to {@link bind} is used as a subexpression in another call to bind, the {@link placeholders} + * are relative to the outermost {@link bind} expression.

    + * + * @reference http://www.cplusplus.com/reference/functional/placeholders/ + * @author Jeongho Nam + */ +declare namespace std.placeholders { + /** + * @hidden + */ + class PlaceHolder { + private index_; + constructor(index: number); + readonly index: number; + } + /** + * Replaced by the first argument in the function call. + */ + const _1: PlaceHolder; + /** + * Replaced by the second argument in the function call. + */ + const _2: PlaceHolder; + /** + * Replaced by the third argument in the function call. + */ + const _3: PlaceHolder; + const _4: PlaceHolder; + const _5: PlaceHolder; + const _6: PlaceHolder; + const _7: PlaceHolder; + const _8: PlaceHolder; + const _9: PlaceHolder; + const _10: PlaceHolder; + const _11: PlaceHolder; + const _12: PlaceHolder; + const _13: PlaceHolder; + const _14: PlaceHolder; + const _15: PlaceHolder; + const _16: PlaceHolder; + const _17: PlaceHolder; + const _18: PlaceHolder; + const _19: PlaceHolder; + const _20: PlaceHolder; +} +declare namespace std.HashMap { + type iterator = std.MapIterator; + type reverse_iterator = std.MapReverseIterator; +} +declare namespace std { + /** + *

    Hashed, unordered map.

    + * + *

    {@link HashMap}s are associative containers that store elements formed by the combination of a key value + * and a mapped value, and which allows for fast retrieval of individual elements based on their keys. + *

    + * + *

    In an {@link HashMap}, the key value is generally used to uniquely identify the element, while the + * mapped value is an object with the content associated to this key. Types of key and + * mapped value may differ.

    + * + *

    Internally, the elements in the {@link HashMap} are not sorted in any particular order with respect to either + * their key or mapped values, but organized into buckets depending on their hash values to allow + * for fast access to individual elements directly by their key values (with a constant average time complexity + * on average).

    + * + *

    {@link HashMap} containers are faster than {@link TreeMap} containers to access individual elements by their + * key, although they are generally less efficient for range iteration through a subset of their elements.

    + * + *

    + * + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
    + * + *
    Hashed
    + *
    Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
    + * + *
    Map
    + *
    Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value.
    + * + *
    Unique keys
    + *
    No two elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the key values. + * Each element in an {@link HashMap} is uniquely identified by its key value. + * @param Type of the mapped value. + * Each element in an {@link HashMap} is used to store some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/unordered_map/unordered_map + * @author Jeongho Nam + */ + class HashMap extends base.UniqueMap implements base.IHashMap { + /** + * @hidden + */ + private hash_buckets_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from elements. + */ + constructor(items: Pair[]); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: [Key, T][]); + /** + * Copy Constructor. + */ + constructor(container: HashMap); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator>, end: Iterator>); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: Key): MapIterator; + /** + * @inheritdoc + */ + begin(): MapIterator; + /** + * @inheritdoc + */ + begin(index: number): MapIterator; + /** + * @inheritdoc + */ + end(): MapIterator; + /** + * @inheritdoc + */ + end(index: number): MapIterator; + /** + * @inheritdoc + */ + rbegin(): MapReverseIterator; + /** + * @inheritdoc + */ + rbegin(index: number): MapReverseIterator; + /** + * @inheritdoc + */ + rend(): MapReverseIterator; + /** + * @inheritdoc + */ + rend(index: number): MapReverseIterator; + /** + * @inheritdoc + */ + bucket_count(): number; + /** + * @inheritdoc + */ + bucket_size(index: number): number; + /** + * @inheritdoc + */ + max_load_factor(): number; + /** + * @inheritdoc + */ + max_load_factor(z: number): void; + /** + * @inheritdoc + */ + bucket(key: Key): number; + /** + * @inheritdoc + */ + reserve(n: number): void; + /** + * @inheritdoc + */ + rehash(n: number): void; + /** + * @hidden + */ + protected _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link HashMap map} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link HashMap map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashMap container}. + */ + swap(obj: HashMap): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer>): void; + } +} +declare namespace std.HashMultiMap { + type iterator = std.MapIterator; + type reverse_iterator = std.MapReverseIterator; +} +declare namespace std { + /** + *

    Hashed, unordered Multimap.

    + * + *

    {@link HashMultiMap}s are associative containers that store elements formed by the combination of + * a key value and a mapped value, much like {@link HashMultiMap} containers, but allowing + * different elements to have equivalent keys.

    + * + *

    In an {@link HashMultiMap}, the key value is generally used to uniquely identify the + * element, while the mapped value is an object with the content associated to this key. + * Types of key and mapped value may differ.

    + * + *

    Internally, the elements in the {@link HashMultiMap} are not sorted in any particular order with + * respect to either their key or mapped values, but organized into buckets depending on + * their hash values to allow for fast access to individual elements directly by their key values + * (with a constant average time complexity on average).

    + * + *

    Elements with equivalent keys are grouped together in the same bucket and in such a way that + * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

    + * + *

    + * + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
    + * + *
    Hashed
    + *
    Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
    + * + *
    Map
    + *
    Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value.
    + * + *
    Multiple equivalent keys
    + *
    The container can hold multiple elements with equivalent keys.
    + *
    + * + * @param Type of the key values. + * Each element in an {@link HashMultiMap} is identified by a key value. + * @param Type of the mapped value. + * Each element in an {@link HashMultiMap} is used to store some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/unordered_map/unordered_multimap + * @author Jeongho Nam + */ + class HashMultiMap extends base.MultiMap { + /** + * @hidden + */ + private hash_buckets_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from elements. + */ + constructor(items: Pair[]); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: [Key, T][]); + /** + * Copy Constructor. + */ + constructor(container: HashMultiMap); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator>, end: Iterator>); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: Key): MapIterator; + /** + * @inheritdoc + */ + count(key: Key): number; + /** + * @inheritdoc + */ + begin(): MapIterator; + /** + * @inheritdoc + */ + begin(index: number): MapIterator; + /** + * @inheritdoc + */ + end(): MapIterator; + /** + * @inheritdoc + */ + end(index: number): MapIterator; + /** + * @inheritdoc + */ + rbegin(): MapReverseIterator; + /** + * @inheritdoc + */ + rbegin(index: number): MapReverseIterator; + /** + * @inheritdoc + */ + rend(): MapReverseIterator; + /** + * @inheritdoc + */ + rend(index: number): MapReverseIterator; + /** + * @inheritdoc + */ + bucket_count(): number; + /** + * @inheritdoc + */ + bucket_size(n: number): number; + /** + * @inheritdoc + */ + max_load_factor(): number; + /** + * @inheritdoc + */ + max_load_factor(z: number): void; + /** + * @inheritdoc + */ + bucket(key: Key): number; + /** + * @inheritdoc + */ + reserve(n: number): void; + /** + * @inheritdoc + */ + rehash(n: number): void; + /** + * @hidden + */ + protected _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link HashMultiMap map} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link HashMultiMap map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashMultiMap container}. + */ + swap(obj: HashMultiMap): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer>): void; + } +} +declare namespace std.HashMultiSet { + type iterator = std.SetIterator; + type reverse_iterator = std.SetReverseIterator; +} +declare namespace std { + /** + *

    Hashed, unordered Multiset.

    + * + *

    {@link HashMultiSet HashMultiSets} are containers that store elements in no particular order, allowing fast + * retrieval of individual elements based on their value, much like {@link HashMultiSet} containers, + * but allowing different elements to have equivalent values.

    + * + *

    In an {@link HashMultiSet}, the value of an element is at the same time its key, used to + * identify it. Keys are immutable, therefore, the elements in an {@link HashMultiSet} cannot be + * modified once in the container - they can be inserted and removed, though.

    + * + *

    Internally, the elements in the {@link HashMultiSet} are not sorted in any particular, but + * organized into buckets depending on their hash values to allow for fast access to individual + * elements directly by their values (with a constant average time complexity on average).

    + * + *

    Elements with equivalent values are grouped together in the same bucket and in such a way that an + * iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
    + * + *
    Hashed
    + *
    Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + * + *
    Multiple equivalent keys
    + *
    The container can hold multiple elements with equivalent keys.
    + *
    + * + * @param Type of the elements. + * Each element in an {@link UnorderedMultiSet} is also identified by this value.. + * + * @reference http://www.cplusplus.com/reference/unordered_set/unordered_multiset + * @author Jeongho Nam + */ + class HashMultiSet extends base.MultiSet { + /** + * @hidden + */ + private hash_buckets_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from elements. + */ + constructor(items: T[]); + /** + * Copy Constructor. + */ + constructor(container: HashMultiSet); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: T): SetIterator; + /** + * @inheritdoc + */ + count(key: T): number; + /** + * @inheritdoc + */ + begin(): SetIterator; + /** + * @inheritdoc + */ + begin(index: number): SetIterator; + /** + * @inheritdoc + */ + end(): SetIterator; + /** + * @inheritdoc + */ + end(index: number): SetIterator; + /** + * @inheritdoc + */ + rbegin(): SetReverseIterator; + /** + * @inheritdoc + */ + rbegin(index: number): SetReverseIterator; + /** + * @inheritdoc + */ + rend(): SetReverseIterator; + /** + * @inheritdoc + */ + rend(index: number): SetReverseIterator; + /** + * @inheritdoc + */ + bucket_count(): number; + /** + * @inheritdoc + */ + bucket_size(n: number): number; + /** + * @inheritdoc + */ + max_load_factor(): number; + /** + * @inheritdoc + */ + max_load_factor(z: number): void; + /** + * @inheritdoc + */ + bucket(key: T): number; + /** + * @inheritdoc + */ + reserve(n: number): void; + /** + * @inheritdoc + */ + rehash(n: number): void; + /** + * @hidden + */ + protected _Insert_by_val(val: T): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link HashMultiSet set} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link HashMultiSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashMultiSet container}. + */ + swap(obj: HashMultiSet): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std.HashSet { + type iterator = std.SetIterator; + type reverse_iterator = std.SetReverseIterator; +} +declare namespace std { + /** + *

    Hashed, unordered set.

    + * + *

    {@link HashSet}s are containers that store unique elements in no particular order, and which + * allow for fast retrieval of individual elements based on their value.

    + * + *

    In an {@link HashSet}, the value of an element is at the same time its key, that + * identifies it uniquely. Keys are immutable, therefore, the elements in an {@link HashSet} cannot be + * modified once in the container - they can be inserted and removed, though.

    + * + *

    Internally, the elements in the {@link HashSet} are not sorted in any particular order, but + * organized into buckets depending on their hash values to allow for fast access to individual elements + * directly by their values (with a constant average time complexity on average).

    + * + *

    {@link HashSet} containers are faster than {@link TreeSet} containers to access individual + * elements by their key, although they are generally less efficient for range iteration through a + * subset of their elements.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
    + * + *
    Hashed
    + *
    Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + * + *
    Unique keys
    + *
    No two elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the elements. + * Each element in an {@link HashSet} is also uniquely identified by this value. + * + * @reference http://www.cplusplus.com/reference/unordered_set/unordered_set + * @author Jeongho Nam + */ + class HashSet extends base.UniqueSet implements base.IHashSet { + /** + * @hidden + */ + private hash_buckets_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from elements. + */ + constructor(items: T[]); + /** + * Copy Constructor. + */ + constructor(container: HashSet); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: T): SetIterator; + /** + * @inheritdoc + */ + begin(): SetIterator; + /** + * @inheritdoc + */ + begin(index: number): SetIterator; + /** + * @inheritdoc + */ + end(): SetIterator; + /** + * @inheritdoc + */ + end(index: number): SetIterator; + /** + * @inheritdoc + */ + rbegin(): SetReverseIterator; + /** + * @inheritdoc + */ + rbegin(index: number): SetReverseIterator; + /** + * @inheritdoc + */ + rend(): SetReverseIterator; + /** + * @inheritdoc + */ + rend(index: number): SetReverseIterator; + /** + * @inheritdoc + */ + bucket_count(): number; + /** + * @inheritdoc + */ + bucket_size(n: number): number; + /** + * @inheritdoc + */ + max_load_factor(): number; + /** + * @inheritdoc + */ + max_load_factor(z: number): void; + /** + * @inheritdoc + */ + bucket(key: T): number; + /** + * @inheritdoc + */ + reserve(n: number): void; + /** + * @inheritdoc + */ + rehash(n: number): void; + /** + * @hidden + */ + protected _Insert_by_val(val: T): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link HashSet set} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link HashSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashSet container}. + */ + swap(obj: HashSet): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std.List { + type iterator = std.ListIterator; + type reverse_iterator = std.ListReverseIterator; +} +declare namespace std { + /** + *

    Doubly linked list.

    + * + *

    {@link List}s are sequence containers that allow constant time insert and erase operations anywhere within the + * sequence, and iteration in both directions.

    + * + *

    List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements they + * contain in different and unrelated storage locations. The ordering is kept internally by the association to each + * element of a link to the element preceding it and a link to the element following it.

    + * + *

    They are very similar to forward_list: The main difference being that forward_list objects are single-linked + * lists, and thus they can only be iterated forwards, in exchange for being somewhat smaller and more efficient.

    + * + *

    Compared to other base standard sequence containers (array, vector and deque), lists perform generally better + * in inserting, extracting and moving elements in any position within the container for which an iterator has already + * been obtained, and therefore also in algorithms that make intensive use of these, like sorting algorithms.

    + * + *

    The main drawback of lists and forward_lists compared to these other sequence containers is that they lack + * direct access to the elements by their position; For example, to access the sixth element in a list, one has to + * iterate from a known position (like the beginning or the end) to that position, which takes linear time in the + * distance between these. They also consume some extra memory to keep the linking information associated to each + * element (which may be an important factor for large lists of small-sized elements).

    + * + *

    + * + *

    + * + *

    Container properties

    + *
    + *
    Sequence
    + *
    Elements in sequence containers are ordered in a strict linear sequence. Individual elements are accessed by + * their position in this sequence.
    + * + *
    Doubly-linked list
    + *
    Each element keeps information on how to locate the next and the previous elements, allowing constant time + * insert and erase operations before or after a specific element (even of entire ranges), but no direct random + * access.
    + *
    + * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/list/list/ + * @author Jeongho Nam + */ + class List extends base.Container implements base.IDequeContainer { + /** + * @hidden + */ + private begin_; + /** + * @hidden + */ + private end_; + /** + * @hidden + */ + private size_; + /** + *

    Default Constructor.

    + * + *

    Constructs an empty container, with no elements.

    + */ + constructor(); + /** + *

    Initializer list Constructor.

    + * + *

    Constructs a container with a copy of each of the elements in array, in the same order.

    + * + * @param array An array containing elements to be copied and contained. + */ + constructor(items: Array); + /** + *

    Fill Constructor.

    + * + *

    Constructs a container with n elements. Each element is a copy of val (if provided).

    + * + * @param n Initial container size (i.e., the number of elements in the container at construction). + * @param val Value to fill the container with. Each of the n elements in the container is + * initialized to a copy of this value. + */ + constructor(size: number, val: T); + /** + *

    Copy Constructor.

    + * + *

    Constructs a container with a copy of each of the elements in container, in the same order.

    + * + * @param container Another container object of the same type (with the same class template + * arguments T), whose contents are either copied or acquired. + */ + constructor(container: List); + /** + *

    Range Constructor.

    + * + *

    Constructs a container with as many elements as the range (begin, end), with each + * element emplace-constructed from its corresponding element in that range, in the same order.

    + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + assign(n: number, val: T): void; + /** + * @inheritdoc + */ + assign>(begin: InputIterator, end: InputIterator): void; + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + begin(): ListIterator; + /** + * @inheritdoc + */ + end(): ListIterator; + /** + * @inheritdoc + */ + rbegin(): ListReverseIterator; + /** + * @inheritdoc + */ + rend(): ListReverseIterator; + /** + * @inheritdoc + */ + size(): number; + /** + * @inheritdoc + */ + front(): T; + /** + * @inheritdoc + */ + back(): T; + /** + * @inheritdoc + */ + push(...items: U[]): number; + /** + * @inheritdoc + */ + push_front(val: T): void; + /** + * @inheritdoc + */ + push_back(val: T): void; + /** + * @inheritdoc + */ + pop_front(): void; + /** + * @inheritdoc + */ + pop_back(): void; + /** + *

    Insert an element.

    + * + *

    The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

    + * + *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Position in the container where the new element is inserted. + * {@link iterator}> is a member type, defined as a + * {@link ListIterator bidirectional iterator} type that points to elements. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the newly inserted element; val. + */ + insert(position: ListIterator, val: T): ListIterator; + /** + *

    Insert elements by repeated filling.

    + * + *

    The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

    + * + *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListIterator bidirectional iterator} type that points to + * elements. + * @param size Number of elements to insert. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: ListIterator, size: number, val: T): ListIterator; + /** + *

    Insert elements by range iterators.

    + * + *

    The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

    + * + *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListIterator bidirectional iterator} type that points to + * elements. + * @param begin An iterator specifying range of the begining element. + * @param end An iterator specifying range of the ending element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; + /** + *

    Insert an element.

    + * + *

    The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

    + * + *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Position in the container where the new element is inserted. + * {@link iterator}> is a member type, defined as a + * {@link ListReverseIterator bidirectional iterator} type that points to elements. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the newly inserted element; val. + */ + insert(position: ListReverseIterator, val: T): ListReverseIterator; + /** + *

    Insert elements by repeated filling.

    + * + *

    The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

    + * + *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to + * elements. + * @param size Number of elements to insert. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: ListReverseIterator, size: number, val: T): ListReverseIterator; + /** + *

    Insert elements by range iterators.

    + * + *

    The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

    + * + *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to + * elements. + * @param begin An iterator specifying range of the begining element. + * @param end An iterator specifying range of the ending element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: ListReverseIterator, begin: InputIterator, end: InputIterator): ListReverseIterator; + /** + * @hidden + */ + private insert_by_val(position, val); + /** + * @hidden + */ + protected _Insert_by_repeating_val(position: ListIterator, size: number, val: T): ListIterator; + /** + * @hidden + */ + protected _Insert_by_range>(position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; + /** + *

    Erase an element.

    + * + *

    Removes from the {@link List} either a single element; position.

    + * + *

    This effectively reduces the container size by the number of element removed.

    + * + *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Iterator pointing to a single element to be removed from the {@link List}. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link end end()} if the operation erased the last element in the sequence. + */ + erase(position: ListIterator): ListIterator; + /** + *

    Erase elements.

    + * + *

    Removes from the {@link List} container a range of elements.

    + * + *

    This effectively reduces the container {@link size} by the number of elements removed.

    + * + *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link end end()} if the operation erased the last element in the sequence. + */ + erase(begin: ListIterator, end: ListIterator): ListIterator; + /** + *

    Erase an element.

    + * + *

    Removes from the {@link List} either a single element; position.

    + * + *

    This effectively reduces the container size by the number of element removed.

    + * + *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Iterator pointing to a single element to be removed from the {@link List}. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link rend rend()} if the operation erased the last element in the sequence. + */ + erase(position: ListReverseIterator): ListReverseIterator; + /** + *

    Erase elements.

    + * + *

    Removes from the {@link List} container a range of elements.

    + * + *

    This effectively reduces the container {@link size} by the number of elements removed.

    + * + *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link rend rend()} if the operation erased the last element in the sequence. + */ + erase(begin: ListReverseIterator, end: ListReverseIterator): ListReverseIterator; + /** + * @hidden + */ + protected _Erase_by_range(first: ListIterator, last: ListIterator): ListIterator; + /** + *

    Remove duplicate values.

    + * + *

    Removes all but the first element from every consecutive group of equal elements in the

    + * + *

    Notice that an element is only removed from the {@link List} container if it compares equal to the + * element immediately preceding it. Thus, this function is especially useful for sorted lists.

    + */ + unique(): void; + /** + *

    Remove duplicate values.

    + * + *

    Removes all but the first element from every consecutive group of equal elements in the

    + * + *

    The argument binary_pred is a specific comparison function that determine the uniqueness + * of an element. In fact, any behavior can be implemented (and not only an equality comparison), but notice + * that the function will call binary_pred(it.value, it.prev().value) for all pairs of elements + * (where it is an iterator to an element, starting from the second) and remove it + * from the {@link List} if the predicate returns true. + * + *

    Notice that an element is only removed from the {@link List} container if it compares equal to the + * element immediately preceding it. Thus, this function is especially useful for sorted lists.

    + * + * @param binary_pred Binary predicate that, taking two values of the same type than those contained in the + * {@link List}, returns true to remove the element passed as first argument + * from the container, and false otherwise. This shall be a function pointer + * or a function object. + */ + unique(binary_pred: (left: T, right: T) => boolean): void; + /** + *

    Remove elements with specific value.

    + * + *

    Removes from the container all the elements that compare equal to val. This calls the + * destructor of these objects and reduces the container {@link size} by the number of elements removed.

    + * + *

    Unlike member function {@link List.erase}, which erases elements by their position (using an + * iterator), this function ({@link List.remove}) removes elements by their value.

    + * + *

    A similar function, {@link List.remove_if}, exists, which allows for a condition other than an + * equality comparison to determine whether an element is removed.

    + * + * @param val Value of the elements to be removed. + */ + remove(val: T): void; + /** + *

    Remove elements fulfilling condition.

    + * + *

    Removes from the container all the elements for which pred returns true. This + * calls the destructor of these objects and reduces the container {@link size} by the number of elements + * removed.

    + * + *

    The function calls pred(it.value) for each element (where it is an iterator + * to that element). Any of the elements in the list for which this returns true, are removed + * from the

    + * + * @param pred Unary predicate that, taking a value of the same type as those contained in the forward_list + * object, returns true for those values to be removed from the container, and + * false for those remaining. This can either be a function pointer or a function + * object. + */ + remove_if(pred: (val: T) => boolean): void; + /** + *

    Merge sorted {@link List Lists}.

    + * + *

    Merges obj into the {@link List} by transferring all of its elements at their respective + * ordered positions into the container (both containers shall already be ordered). + *

    + * + *

    This effectively removes all the elements in obj (which becomes {@link empty}), and inserts + * them into their ordered position within container (which expands in {@link size} by the number of elements + * transferred). The operation is performed without constructing nor destroying any element: they are + * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports + * move-construction or not.

    + * + *

    This function requires that the {@link List} containers have their elements already ordered by value + * ({@link less}) before the call. For an alternative on unordered {@link List Lists}, see + * {@link List.splice}.

    + * + *

    Assuming such ordering, each element of obj is inserted at the position that corresponds to its + * value according to the strict weak ordering defined by {@link less}. The resulting order of equivalent + * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and + * existing elements precede those equivalent inserted from obj).

    + * + * The function does nothing if this == obj. + * + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + * Note that this function modifies obj no matter whether an lvalue or rvalue reference is + * passed. + */ + merge(obj: List): void; + /** + *

    Merge sorted {@link List Lists}.

    + * + *

    Merges obj into the {@link List} by transferring all of its elements at their respective + * ordered positions into the container (both containers shall already be ordered). + *

    + * + *

    This effectively removes all the elements in obj (which becomes {@link empty}), and inserts + * them into their ordered position within container (which expands in {@link size} by the number of elements + * transferred). The operation is performed without constructing nor destroying any element: they are + * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports + * move-construction or not.

    + * + *

    The argument compare is a specific predicate to perform the comparison operation between + * elements. This comparison shall produce a strict weak ordering of the elements (i.e., a consistent + * transitive comparison, without considering its reflexiveness). + * + *

    This function requires that the {@link List} containers have their elements already ordered by + * compare before the call. For an alternative on unordered {@link List Lists}, see + * {@link List.splice}.

    + * + *

    Assuming such ordering, each element of obj is inserted at the position that corresponds to its + * value according to the strict weak ordering defined by compare. The resulting order of equivalent + * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and + * existing elements precede those equivalent inserted from obj).

    + * + * The function does nothing if this == obj. + * + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + * Note that this function modifies obj no matter whether an lvalue or rvalue reference is + * passed. + * @param compare Binary predicate that, taking two values of the same type than those contained in the + * {@link list}, returns true if the first argument is considered to go before + * the second in the strict weak ordering it defines, and false otherwise. + * This shall be a function pointer or a function object. + */ + merge(obj: List, compare: (left: T, right: T) => boolean): void; + /** + *

    Transfer elements from {@link List} to {@link List}.

    + * + *

    Transfers elements from obj into the container, inserting them at position.

    + * + *

    This effectively inserts all elements into the container and removes them from obj, altering + * the sizes of both containers. The operation does not involve the construction or destruction of any + * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the + * value_type supports move-construction or not.

    + * + *

    This first version (1) transfers all the elements of obj into the

    + * + * @param position Position within the container where the elements of obj are inserted. + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + */ + splice(position: ListIterator, obj: List): void; + /** + *

    Transfer an element from {@link List} to {@link List}.

    + * + *

    Transfers an element from obj, which is pointed by an {@link ListIterator iterator} it, + * into the container, inserting the element at specified position.

    + * + *

    This effectively inserts an element into the container and removes it from obj, altering the + * sizes of both containers. The operation does not involve the construction or destruction of any element. + * They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type + * supports move-construction or not.

    + * + *

    This second version (2) transfers only the element pointed by it from obj into the + *

    + * + * @param position Position within the container where the element of obj is inserted. + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + * This parameter may be this if position points to an element not actually + * being spliced. + * @param it {@link ListIterator Iterator} to an element in obj. Only this single element is + * transferred. + */ + splice(position: ListIterator, obj: List, it: ListIterator): void; + /** + *

    Transfer elements from {@link List} to {@link List}.

    + * + *

    Transfers elements from obj into the container, inserting them at position.

    + * + *

    This effectively inserts those elements into the container and removes them from obj, altering + * the sizes of both containers. The operation does not involve the construction or destruction of any + * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the + * value_type supports move-construction or not.

    + * + *

    This third version (3) transfers the range [begin, end) from obj into the + *

    + * + * @param position Position within the container where the elements of obj are inserted. + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + * This parameter may be this if position points to an element not actually + * being spliced. + * @param begin {@link ListIterator An Iterator} specifying initial position of a range of elements in + * obj. Transfers the elements in the range [begin, end) to + * position. + * @param end {@link ListIterator An Iterator} specifying final position of a range of elements in + * obj. Transfers the elements in the range [begin, end) to + * position. Notice that the range includes all the elements between begin and + * end, including the element pointed by begin but not the one pointed by end. + */ + splice(position: ListIterator, obj: List, begin: ListIterator, end: ListIterator): void; + /** + *

    Sort elements in

    + * + *

    Sorts the elements in the {@link List}, altering their position within the

    + * + *

    The sorting is performed by applying an algorithm that uses {@link less}. This comparison shall + * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without + * considering its reflexiveness).

    + * + *

    The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative + * order they had before the call.

    + * + *

    The entire operation does not involve the construction, destruction or copy of any element object. + * Elements are moved within the

    + */ + sort(): void; + /** + *

    Sort elements in

    + * + *

    Sorts the elements in the {@link List}, altering their position within the

    + * + *

    The sorting is performed by applying an algorithm that uses compare. This comparison shall + * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without + * considering its reflexiveness).

    + * + *

    The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative + * order they had before the call.

    + * + *

    The entire operation does not involve the construction, destruction or copy of any element object. + * Elements are moved within the

    + * + * @param compare Binary predicate that, taking two values of the same type of those contained in the + * {@link List}, returns true if the first argument goes before the second + * argument in the strict weak ordering it defines, and false otherwise. This + * shall be a function pointer or a function object. + */ + sort(compare: (left: T, right: T) => boolean): void; + /** + * @hidden + */ + private qsort(first, last, compare); + /** + * @hidden + */ + private partition(first, last, compare); + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link List container} object with same type of elements. Sizes and container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link List container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link container List}. + */ + swap(obj: List): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std { + /** + *

    An iterator, node of a List.

    + * + *

    + * + *

    + * + * @author Jeongho Nam + */ + class ListIterator extends Iterator { + /** + * @hidden + */ + private prev_; + /** + * @hidden + */ + private next_; + /** + * @hidden + */ + private value_; + /** + *

    Construct from the source {@link List container}.

    + * + *

    Note

    + *

    Do not create the iterator directly, by yourself.

    + *

    Use {@link List.begin begin()}, {@link List.end end()} in {@link List container} instead.

    + * + * @param source The source {@link List container} to reference. + * @param prev A refenrece of previous node ({@link ListIterator iterator}). + * @param next A refenrece of next node ({@link ListIterator iterator}). + * @param value Value to be stored in the node (iterator). + */ + constructor(source: List, prev: ListIterator, next: ListIterator, value: T); + private list(); + /** + * @inheritdoc + */ + prev(): ListIterator; + /** + * @inheritdoc + */ + next(): ListIterator; + /** + * @inheritdoc + */ + advance(step: number): ListIterator; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + /** + * @inheritdoc + */ + equal_to(obj: ListIterator): boolean; + /** + * @inheritdoc + */ + swap(obj: ListIterator): void; + } +} +declare namespace std { + /** + *

    A reverse-iterator of List.

    + * + *

    + * + *

    + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class ListReverseIterator extends ReverseIterator, ListReverseIterator> { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: ListIterator); + /** + * @hidden + */ + protected create_neighbor(base: ListIterator): ListReverseIterator; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + } +} +declare namespace std.Vector { + type iterator = std.VectorIterator; + type reverse_iterator = std.VectorReverseIterator; +} +declare namespace std { + /** + *

    Vector, the dynamic array.

    + * + *

    {@link Vector}s are sequence containers representing arrays that can change in size.

    + * + *

    Just like arrays, {@link Vector}s use contiguous storage locations for their elements, which means that + * their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently + * as in arrays. But unlike arrays, their size can change dynamically, with their storage being handled + * automatically by the

    + * + *

    Internally, {@link Vector}s use a dynamically allocated array to store their elements. This array may need + * to be reallocated in order to grow in size when new elements are inserted, which implies allocating a new + * array and moving all elements to it. This is a relatively expensive task in terms of processing time, and + * thus, {@link Vector}s do not reallocate each time an element is added to the

    + * + *

    Instead, {@link Vector} containers may allocate some extra storage to accommodate for possible growth, and + * thus the container may have an actual {@link capacity} greater than the storage strictly needed to contain its + * elements (i.e., its {@link size}). Libraries can implement different strategies for growth to balance between + * memory usage and reallocations, but in any case, reallocations should only happen at logarithmically growing + * intervals of {@link size} so that the insertion of individual elements at the end of the {@link Vector} can be + * provided with amortized constant time complexity (see {@link push_back push_back()}).

    + * + *

    Therefore, compared to arrays, {@link Vector}s consume more memory in exchange for the ability to manage + * storage and grow dynamically in an efficient way.

    + * + *

    Compared to the other dynamic sequence containers ({@link Deque}s, {@link List}s), {@link Vector Vectors} + * are very efficient accessing its elements (just like arrays) and relatively efficient adding or removing + * elements from its end. For operations that involve inserting or removing elements at positions other than the + * end, they perform worse than the others, and have less consistent iterators and references than {@link List}s. + *

    + * + *

    + * + *

    + * + *

    Container properties

    + *
    + *
    Sequence
    + *
    + * Elements in sequence containers are ordered in a strict linear sequence. Individual elements are + * accessed by their position in this sequence. + *
    + * + *
    Dynamic array
    + *
    + * Allows direct access to any element in the sequence, even through pointer arithmetics, and provides + * relatively fast addition/removal of elements at the end of the sequence. + *
    + *
    + * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/vector/vector + * @author Jeongho Nam + */ + class Vector extends Array implements base.IContainer, base.IArrayContainer { + /** + *

    Default Constructor.

    + * + *

    Constructs an empty container, with no elements.

    + */ + constructor(); + /** + * @inheritdoc + */ + constructor(array: Array); + /** + *

    Initializer list Constructor.

    + * + *

    Constructs a container with a copy of each of the elements in array, in the same order.

    + * + * @param array An array containing elements to be copied and contained. + */ + constructor(n: number); + /** + *

    Fill Constructor.

    + * + *

    Constructs a container with n elements. Each element is a copy of val (if provided).

    + * + * @param n Initial container size (i.e., the number of elements in the container at construction). + * @param val Value to fill the container with. Each of the n elements in the container is + * initialized to a copy of this value. + */ + constructor(n: number, val: T); + /** + *

    Copy Constructor.

    + * + *

    Constructs a container with a copy of each of the elements in container, in the same order.

    + * + * @param container Another container object of the same type (with the same class template + * arguments T), whose contents are either copied or acquired. + */ + constructor(container: Vector); + /** + *

    Range Constructor.

    + * + *

    Constructs a container with as many elements as the range (begin, end), with each + * element emplace-constructed from its corresponding element in that range, in the same order.

    + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + assign>(begin: InputIterator, end: InputIterator): void; + /** + * @inheritdoc + */ + assign(n: number, val: T): void; + /** + * @inheritdoc + */ + reserve(size: number): void; + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + begin(): VectorIterator; + /** + * @inheritdoc + */ + end(): VectorIterator; + /** + * @inheritdoc + */ + rbegin(): VectorReverseIterator; + /** + * @inheritdoc + */ + rend(): VectorReverseIterator; + /** + * @inheritdoc + */ + size(): number; + /** + * @inheritdoc + */ + capacity(): number; + /** + * @inheritdoc + */ + empty(): boolean; + /** + * @inheritdoc + */ + at(index: number): T; + /** + * @inheritdoc + */ + set(index: number, val: T): T; + /** + * @inheritdoc + */ + front(): T; + /** + * @inheritdoc + */ + back(): T; + /** + * @inheritdoc + */ + push_back(val: T): void; + /** + *

    Insert an element.

    + * + *

    The {@link Vector} is extended by inserting new element before the element at the specified + * position, effectively increasing the container size by one.

    + * + *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new + * {@link size} surpasses the current {@link capacity}.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, inserting element in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to its new position. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    + * + * @param position Position in the {@link Vector} where the new element is inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param val Value to be copied to the inserted element. + * + * @return An iterator that points to the newly inserted element. + */ + insert(position: VectorIterator, val: T): VectorIterator; + /** + *

    Insert elements by repeated filling.

    + * + *

    The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted.

    + * + *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new + * {@link size} surpasses the current {@link capacity}.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to their new positions. This is generally an inefficient operation compared to the + * one performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new elements are inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param n Number of elements to insert. Each element is initialized to a copy of val. + * @param val Value to be copied (or moved) to the inserted elements. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: VectorIterator, n: number, val: T): VectorIterator; + /** + *

    Insert elements by range iterators.

    + * + *

    The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted by range + * iterators.

    + * + *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new + * {@link size} surpasses the current {@link capacity}.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to their new positions. This is generally an inefficient operation compared to the + * one performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new elements are inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: VectorIterator, begin: InputIterator, end: InputIterator): VectorIterator; + /** + *

    Insert an element.

    + * + *

    The {@link Vector} is extended by inserting new element before the element at the specified + * position, effectively increasing the container size by one.

    + * + *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new + * {@link size} surpasses the current {@link capacity}.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, inserting element in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to its new position. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    + * + * @param position Position in the {@link Vector} where the new element is inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param val Value to be copied to the inserted element. + * + * @return An iterator that points to the newly inserted element. + */ + insert(position: VectorReverseIterator, val: T): VectorReverseIterator; + /** + *

    Insert elements by repeated filling.

    + * + *

    The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted.

    + * + *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new + * {@link size} surpasses the current {@link capacity}.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to their new positions. This is generally an inefficient operation compared to the + * one performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new elements are inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param n Number of elements to insert. Each element is initialized to a copy of val. + * @param val Value to be copied (or moved) to the inserted elements. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: VectorReverseIterator, n: number, val: T): VectorReverseIterator; + /** + *

    Insert elements by range iterators.

    + * + *

    The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted by range + * iterators.

    + * + *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new + * {@link size} surpasses the current {@link capacity}.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to their new positions. This is generally an inefficient operation compared to the + * one performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new elements are inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: VectorReverseIterator, begin: InputIterator, end: InputIterator): VectorReverseIterator; + /** + * @hidden + */ + private insert_by_val(position, val); + /** + * @hidden + */ + protected _Insert_by_repeating_val(position: VectorIterator, n: number, val: T): VectorIterator; + /** + * @hidden + */ + protected _Insert_by_range>(position: VectorIterator, first: InputIterator, last: InputIterator): VectorIterator; + /** + * @inheritdoc + */ + pop_back(): void; + /** + *

    Erase element.

    + * + *

    Removes from the {@link Vector} either a single element; position.

    + * + *

    This effectively reduces the container size by the number of element removed.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, erasing an element in + * position other than the {@link end end()} causes the container to relocate all the elements after the + * segment erased to their new positions. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    + * + * @param position Iterator pointing to a single element to be removed from the {@link Vector}. + * + * @return An iterator pointing to the new location of the element that followed the last element erased by + * the function call. This is the {@link end end()} if the operation erased the last element in the + * sequence. + */ + erase(position: VectorIterator): VectorIterator; + /** + *

    Erase element.

    + * + *

    Removes from the Vector either a single element; position.

    + * + *

    This effectively reduces the container size by the number of elements removed.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, erasing elements in + * position other than the {@link end end()} causes the container to relocate all the elements after the + * segment erased to their new positions. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the new location of the element that followed the last element erased by + * the function call. This is the {@link rend rend()} if the operation erased the last element in the + * sequence. + */ + erase(first: VectorIterator, last: VectorIterator): VectorIterator; + /** + *

    Erase element.

    + * + *

    Removes from the {@link Vector} either a single element; position.

    + * + *

    This effectively reduces the container size by the number of element removed.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, erasing an element in + * position other than the {@link end end()} causes the container to relocate all the elements after the + * segment erased to their new positions. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    + * + * @param position Iterator pointing to a single element to be removed from the {@link Vector}. + * + * @return An iterator pointing to the new location of the element that followed the last element erased by + * the function call. This is the {@link rend rend()} if the operation erased the last element in the + * sequence. + */ + erase(position: VectorReverseIterator): VectorReverseIterator; + /** + *

    Erase element.

    + * + *

    Removes from the Vector either a single element; position.

    + * + *

    This effectively reduces the container size by the number of elements removed.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, erasing elements in + * position other than the {@link end end()} causes the container to relocate all the elements after the + * segment erased to their new positions. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the new location of the element that followed the last element erased by + * the function call. This is the {@link end end()} if the operation erased the last element in the + * sequence. + */ + erase(first: VectorReverseIterator, last: VectorReverseIterator): VectorReverseIterator; + /** + * @hidden + */ + protected _Erase_by_range(first: VectorIterator, last: VectorIterator): VectorIterator; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link Vector container} object with same type of elements. Sizes and container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link Vector container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link container Vector}. + */ + obj(obj: Vector): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std { + /** + *

    An iterator of Vector.

    + * + *

    + * + *

    + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class VectorIterator extends Iterator implements base.IArrayIterator { + /** + * Sequence number of iterator in the source {@link Vector}. + */ + private index_; + /** + *

    Construct from the source {@link Vector container}.

    + * + *

    Note

    + *

    Do not create the iterator directly, by yourself.

    + *

    Use {@link Vector.begin begin()}, {@link Vector.end end()} in {@link Vector container} instead.

    + * + * @param source The source {@link Vector container} to reference. + * @param index Sequence number of the element in the source {@link Vector}. + */ + constructor(source: Vector, index: number); + /** + * @hidden + */ + private readonly vector; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + /** + * Get index. + */ + readonly index: number; + /** + * @inheritdoc + */ + prev(): VectorIterator; + /** + * @inheritdoc + */ + next(): VectorIterator; + /** + * @inheritdoc + */ + advance(n: number): VectorIterator; + /** + *

    Whether an iterator is equal with the iterator.

    + * + *

    Compare two iterators and returns whether they are equal or not.

    + * + *

    Note

    + *

    Iterator's equal_to() only compare souce container and index number.

    + * + *

    Although elements in a pair, key and value are equal_to, if the source map or + * index number is different, then the {@link equal_to equal_to()} will return false. If you want to + * compare the elements of a pair, compare them directly by yourself.

    + * + * @param obj An iterator to compare + * @return Indicates whether equal or not. + */ + equal_to(obj: VectorIterator): boolean; + /** + * @inheritdoc + */ + swap(obj: VectorIterator): void; + } +} +declare namespace std { + /** + *

    A reverse-iterator of Vector.

    + * + *

    + * + *

    + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class VectorReverseIterator extends ReverseIterator, VectorReverseIterator> implements base.IArrayIterator { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: VectorIterator); + /** + * @hidden + */ + protected create_neighbor(base: VectorIterator): VectorReverseIterator; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + /** + * Get index. + */ + readonly index: number; + } +} +declare namespace std { + /** + *

    FIFO queue.

    + * + *

    {@link Queue}s are a type of container adaptor, specifically designed to operate in a FIFO context + * (first-in first-out), where elements are inserted into one end of the container and extracted from the other. + *

    + * + *

    {@link Queue}s are implemented as containers adaptors, which are classes that use an encapsulated object of + * a specific container class as its underlying container, providing a specific set of member functions to access + * its elements. Elements are pushed into the {@link IDeque.back back()} of the specific container and popped from + * its {@link IDeque.front front()}.

    + * + *

    {@link container_ The underlying container} may be one of the standard container class template or some + * other specifically designed container class. This underlying container shall support at least the following + * operations:

    + * + *
      + *
    • empty
    • + *
    • size
    • + *
    • front
    • + *
    • back
    • + *
    • push_back
    • + *
    • pop_front
    • + *
    + * + *

    The standard container classes {@link Deque} and {@link List} fulfill these requirements. + * By default, if no container class is specified for a particular {@link Queue} class instantiation, the standard + * container {@link List} is used.

    + * + *

    + * + *

    + * + * @param Type of elements. + * + * @reference http://www.cplusplus.com/reference/queue/queue + * @author Jeongho Nam + */ + class Queue { + /** + * The underlying object for implementing the FIFO + */ + private container_; + /** + * Default Constructor. + */ + constructor(); + /** + * Copy Constructor. + */ + constructor(container: Queue); + /** + *

    Return size.

    + *

    Returns the number of elements in the {@link Queue}.

    + * + *

    This member function effectively calls member {@link IDeque.size size()} of the + * {@link container_ underlying container} object.

    + * + * @return The number of elements in the {@link container_ underlying container}. + */ + size(): number; + /** + *

    Test whether container is empty.

    + *

    returns whether the {@link Queue} is empty: i.e. whether its size is zero.

    + * + *

    This member function efeectively calls member {@link IDeque.empty empty()} of the + * {@link container_ underlying container} object.

    + * + * @return true if the {@link container_ underlying container}'s size is 0, + * false otherwise.

    + */ + empty(): boolean; + /** + *

    Access next element.

    + *

    Returns a value of the next element in the {@link Queue}.

    + * + *

    The next element is the "oldest" element in the {@link Queue} and the same element that is popped out + * from the queue when {@link pop Queue.pop()} is called.

    + * + *

    This member function effectively calls member {@link IDeque.front front()} of the + * {@link container_ underlying container} object.

    + * + * @return A value of the next element in the {@link Queue}. + */ + front(): T; + /** + *

    Access last element.

    + * + *

    Returns a vaue of the last element in the queue. This is the "newest" element in the queue (i.e. the + * last element pushed into the queue).

    + * + *

    This member function effectively calls the member function {@link IDeque.back back()} of the + * {@link container_ underlying container} object.

    + * + * @return A value of the last element in the {@link Queue}. + */ + back(): T; + /** + *

    Insert element.

    + * + *

    Inserts a new element at the end of the {@link Queue}, after its current last element. + * The content of this new element is initialized to val.

    + * + *

    This member function effectively calls the member function {@link IDeque.push_back push_back()} of the + * {@link container_ underlying container} object.

    + * + * @param val Value to which the inserted element is initialized. + */ + push(val: T): void; + /** + *

    Remove next element.

    + * + *

    Removes the next element in the {@link Queue}, effectively reducing its size by one.

    + * + *

    The element removed is the "oldest" element in the {@link Queue} whose value can be retrieved by calling + * member {@link front Queue.front()}

    . + * + *

    This member function effectively calls the member function {@link IDeque.pop_front pop_front()} of the + * {@link container_ underlying container} object.

    + */ + pop(): void; + /** + *

    Swap contents.

    + * + *

    Exchanges the contents of the container adaptor (this) by those of obj.

    + * + *

    This member function calls the non-member function {@link IContainer.swap swap} (unqualified) to swap + * the {@link container_ underlying containers}.

    + * + * @param obj Another {@link Queue} container adaptor of the same type (i.e., instantiated with the same + * template parameter, T). Sizes may differ.

    + */ + swap(obj: Queue): void; + } +} +declare namespace std { + /** + *

    LIFO stack.

    + * + *

    {@link Stack}s are a type of container adaptor, specifically designed to operate in a LIFO context + * (last-in first-out), where elements are inserted and extracted only from one end of the

    + * + *

    {@link Stack}s are implemented as containers adaptors, which are classes that use an encapsulated object of + * a specific container class as its underlying container, providing a specific set of member functions to + * access its elements. Elements are pushed/popped from the {@link ILinearContainer.back back()} of the + * {@link ILinearContainer specific container}, which is known as the top of the {@link Stack}.

    + * + *

    {@link container_ The underlying container} may be any of the standard container class templates or some + * other specifically designed container class. The container shall support the following operations:

    + * + *
      + *
    • empty
    • + *
    • size
    • + *
    • front
    • + *
    • back
    • + *
    • push_back
    • + *
    • pop_back
    • + *
    + * + *

    The standard container classes {@link Vector}, {@link Deque} and {@link List} fulfill these requirements. + * By default, if no container class is specified for a particular {@link Stack} class instantiation, the standard + * container {@link List} is used.

    + * + *

    + * + *

    + * + * @param Type of elements. + * + * @reference http://www.cplusplus.com/reference/stack/stack + * @author Jeongho Nam + */ + class Stack { + /** + * The underlying object for implementing the LIFO + */ + private container_; + /** + * Default Constructor. + */ + constructor(); + /** + * Copy Constructor. + */ + constructor(stack: Stack); + /** + *

    Return size.

    + * + *

    Returns the number of elements in the {@link Stack}.

    + * + *

    This member function effectively calls member {@link ILinearContainer.size size()} of the + * {@link container_ underlying container} object.

    + * + * @return The number of elements in the {@link container_ underlying container}. + */ + size(): number; + /** + *

    Test whether container is empty.

    + * + *

    returns whether the {@link Stack} is empty: i.e. whether its size is zero.

    + * + *

    This member function effectively calls member {@link ILinearContainer.empty empty()} of the + * {@link container_ underlying container} object.

    + * + * @return true if the underlying container's size is 0, + * false otherwise.

    + */ + empty(): boolean; + /** + *

    Access next element.

    + * + *

    Returns a value of the top element in the {@link Stack}

    . + * + *

    Since {@link Stack}s are last-in first-out containers, the top element is the last element inserted into + * the {@link Stack}.

    + * + *

    This member function effectively calls member {@link ILinearContainer.back back()} of the + * {@link container_ underlying container} object.

    + * + * @return A value of the top element in the {@link Stack}. + */ + top(): T; + /** + *

    Insert element.

    + * + *

    Inserts a new element at the top of the {@link Stack}, above its current top element.

    + * + *

    This member function effectively calls the member function + * {@link ILinearContainer.push_back push_back()} of the {@link container_ underlying container} object.

    + * + * @param val Value to which the inserted element is initialized. + */ + push(val: T): void; + /** + *

    Remove top element.

    + * + *

    Removes the element on top of the {@link Stack}, effectively reducing its size by one.

    + * + *

    The element removed is the latest element inserted into the {@link Stack}, whose value can be retrieved + * by calling member {@link top Stack.top()}

    . + * + *

    This member function effectively calls the member function {@link ILinearContainer.pop_back pop_back()} + * of the {@link container_ underlying container} object.

    + */ + pop(): void; + /** + *

    Swap contents.

    + * + *

    Exchanges the contents of the container adaptor (this) by those of obj.

    + * + *

    This member function calls the non-member function {@link IContainer.swap swap} (unqualified) to swap + * the {@link container_ underlying containers}.

    + * + * @param obj Another {@link Stack} container adaptor of the same type (i.e., instantiated with the same + * template parameter, T). Sizes may differ.

    + */ + swap(obj: Stack): void; + } +} +declare namespace std.TreeSet { + type iterator = std.SetIterator; + type reverse_iterator = std.SetReverseIterator; +} +declare namespace std { + /** + *

    Tree-structured set, std::set of STL.

    + * + *

    {@link TreeSet}s are containers that store unique elements following a specific order.

    + * + *

    In a {@link TreeSet}, the value of an element also identifies it (the value is itself the + * key, of type T), and each value must be unique. The value of the elements in a + * {@link TreeSet} cannot be modified once in the container (the elements are always const), but they + * can be inserted or removed from the

    + * + *

    Internally, the elements in a {@link TreeSet} are always sorted following a specific strict weak + * ordering criterion indicated by its internal comparison method (of {@link less}).

    + * + *

    {@link TreeSet} containers are generally slower than {@link HashSet} containers to access + * individual elements by their key, but they allow the direct iteration on subsets based on their + * order.

    + * + *

    {@link TreeSet}s are typically implemented as binary search trees.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
    + * + *
    Ordered
    + *
    + * The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order. + *
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + * + *
    Unique keys
    + *
    No two elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the elements. + * Each element in an {@link TreeSet} is also uniquely identified by this value. + * + * @reference http://www.cplusplus.com/reference/set/set + * @author Jeongho Nam + */ + class TreeSet extends base.UniqueSet implements base.ITreeSet { + /** + * @hidden + */ + private tree_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (x: T, y: T) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array); + /** + * Contruct from elements with compare. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array, compare: (x: T, y: T) => boolean); + /** + * Copy Constructor. + */ + constructor(container: TreeMultiSet); + /** + * Copy Constructor with compare. + * + * @param container A container to be copied. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); + /** + * Range Constructor. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * Construct from range and compare. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator, end: Iterator, compare: (x: T, y: T) => boolean); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(val: T): SetIterator; + /** + * @inheritdoc + */ + key_comp(): (x: T, y: T) => boolean; + /** + * @inheritdoc + */ + value_comp(): (x: T, y: T) => boolean; + /** + * @inheritdoc + */ + lower_bound(val: T): SetIterator; + /** + * @inheritdoc + */ + upper_bound(val: T): SetIterator; + /** + * @inheritdoc + */ + equal_range(val: T): Pair, SetIterator>; + /** + * @hidden + */ + protected _Insert_by_val(val: T): any; + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link TreeSet set} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link TreeSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeSet container}. + */ + swap(obj: TreeSet): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std.TreeMap { + type iterator = std.MapIterator; + type reverse_iterator = std.MapReverseIterator; +} +declare namespace std { + /** + *

    Tree-structured map, std::map of STL.

    + * + *

    {@link TreeMap TreeMaps} are associative containers that store elements formed by a combination of a + * key value (Key) and a mapped value (T), following order.

    + * + *

    In a {@link TreeMap}, the key values are generally used to sort and uniquely identify the elements, + * while the mapped values store the content associated to this key. The types of key and + * mapped value may differ, and are grouped together in member type value_type, which is a {@link Pair} + * type combining both:

    + * + *

    typedef Pair value_type;

    + * + *

    Internally, the elements in a {@link TreeMap} are always sorted by its key following a + * strict weak ordering criterion indicated by its internal comparison method {@link less}. + * + *

    {@link TreeMap} containers are generally slower than {@link HashMap HashMap} containers to access individual + * elements by their key, but they allow the direct iteration on subsets based on their order.

    + * + *

    {@link TreeMap}s are typically implemented as binary search trees.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
    + * + *
    Ordered
    + *
    The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order.
    + * + *
    Map
    + *
    Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value.
    + * + *
    Unique keys
    + *
    No two elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the keys. Each element in a map is uniquely identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/map/map + * @author Jeongho Nam + */ + class TreeMap extends base.UniqueMap implements base.ITreeMap { + /** + * @hidden + */ + private tree_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (x: Key, y: Key) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array>); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array>, compare: (x: Key, y: Key) => boolean); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: Array<[Key, T]>); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array<[Key, T]>, compare: (x: Key, y: Key) => boolean); + /** + * Copy Constructor. + * + * @param container Another map to copy. + */ + constructor(container: TreeMap); + /** + * Copy Constructor. + * + * @param container Another map to copy. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: TreeMap, compare: (x: Key, y: Key) => boolean); + /** + * Range Constructor. + * + * @param begin nput interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator>, end: Iterator>); + /** + * Range Constructor. + * + * @param begin nput interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator>, end: Iterator>, compare: (x: Key, y: Key) => boolean); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: Key): MapIterator; + /** + * @inheritdoc + */ + key_comp(): (x: Key, y: Key) => boolean; + /** + * @inheritdoc + */ + value_comp(): (x: Pair, y: Pair) => boolean; + /** + * @inheritdoc + */ + lower_bound(key: Key): MapIterator; + /** + * @inheritdoc + */ + upper_bound(key: Key): MapIterator; + /** + * @inheritdoc + */ + equal_range(key: Key): Pair, MapIterator>; + /** + * @hidden + */ + protected _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link TreeMap map} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link TreeMap map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeMap container}. + */ + swap(obj: TreeMap): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer>): void; + } +} +declare namespace std.TreeMultiSet { + type iterator = std.SetIterator; + type reverse_iterator = std.SetReverseIterator; +} +declare namespace std { + /** + *

    Tree-structured multiple-key set.

    + * + *

    {@link TreeMultiSet TreeMultiSets} are containers that store elements following a specific order, and + * where multiple elements can have equivalent values.

    + * + *

    In a {@link TreeMultiSet}, the value of an element also identifies it (the value is itself + * the key, of type T). The value of the elements in a {@link TreeMultiSet} cannot + * be modified once in the container (the elements are always const), but they can be inserted or removed + * from the

    + * + *

    Internally, the elements in a {@link TreeMultiSet TreeMultiSets} are always sorted following a strict + * weak ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}).

    + * + *

    {@link TreeMultiSet} containers are generally slower than {@link HashMultiSet} containers + * to access individual elements by their key, but they allow the direct iteration on subsets based on + * their order.

    + * + *

    {@link TreeMultiSet TreeMultiSets} are typically implemented as binary search trees.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
    + * + *
    Ordered
    + *
    + * The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order. + *
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + * + *
    Multiple equivalent keys
    + *
    Multiple elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the elements. Each element in a {@link TreeMultiSet} container is also identified + * by this value (each value is itself also the element's key). + * + * @reference http://www.cplusplus.com/reference/set/multiset + * @author Jeongho Nam + */ + class TreeMultiSet extends base.MultiSet implements base.ITreeSet { + /** + * @hidden + */ + private tree_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (x: T, y: T) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array); + /** + * Contruct from elements with compare. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array, compare: (x: T, y: T) => boolean); + /** + * Copy Constructor. + */ + constructor(container: TreeMultiSet); + /** + * Copy Constructor with compare. + * + * @param container A container to be copied. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); + /** + * Range Constructor. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * Construct from range and compare. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator, end: Iterator, compare: (x: T, y: T) => boolean); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(val: T): SetIterator; + /** + * @inheritdoc + */ + count(val: T): number; + /** + * @inheritdoc + */ + key_comp(): (x: T, y: T) => boolean; + /** + * @inheritdoc + */ + value_comp(): (x: T, y: T) => boolean; + /** + * @inheritdoc + */ + lower_bound(val: T): SetIterator; + /** + * @inheritdoc + */ + upper_bound(val: T): SetIterator; + /** + * @inheritdoc + */ + equal_range(val: T): Pair, SetIterator>; + /** + * @hidden + */ + protected _Insert_by_val(val: T): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link TreeMultiSet set} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link TreeMultiSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeMultiSet container}. + */ + swap(obj: TreeMultiSet): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std.TreeMultiMap { + type iterator = std.MapIterator; + type reverse_iterator = std.MapReverseIterator; +} +declare namespace std { + /** + *

    Tree-structured multiple-key map.

    + * + *

    {@link TreeMultiMap TreeMultiMaps} are associative containers that store elements formed by a combination of + * a key value and a mapped value, following a specific order, and where multiple elements can + * have equivalent keys.

    + * + *

    In a {@link TreeMultiMap}, the key values are generally used to sort and uniquely identify + * the elements, while the mapped values store the content associated to this key. The types of + * key and mapped value may differ, and are grouped together in member type + * value_type, which is a {@link Pair} type combining both:

    + * + *

    typedef Pair value_type;

    + * + *

    Internally, the elements in a {@link TreeMultiMap}are always sorted by its key following a + * strict weak ordering criterion indicated by its internal comparison method (of {@link less}).

    + * + *

    {@link TreeMultiMap}containers are generally slower than {@link HashMap} containers + * to access individual elements by their key, but they allow the direct iteration on subsets based + * on their order.

    + * + *

    {@link TreeMultiMap TreeMultiMaps} are typically implemented as binary search trees.

    + * + *

    < + * img src="http://samchon.github.io/typescript-stl/images/design/class_diagram/map_containers.png" style="max-width: 100%" />

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
    + * + *
    Ordered
    + *
    + * The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order. + *
    + * + *
    Map
    + *
    + * Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value. + *
    + * + *
    Multiple equivalent keys
    + *
    Multiple elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the keys. Each element in a map is uniquely identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/map/multimap + * @author Jeongho Nam + */ + class TreeMultiMap extends base.MultiMap implements base.ITreeMap { + /** + * @hidden + */ + private tree_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (x: Key, y: Key) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array>); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array>, compare: (x: Key, y: Key) => boolean); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: Array<[Key, T]>); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array<[Key, T]>, compare: (x: Key, y: Key) => boolean); + /** + * Copy Constructor. + * + * @param container Another map to copy. + */ + constructor(container: TreeMultiMap); + /** + * Copy Constructor. + * + * @param container Another map to copy. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: TreeMultiMap, compare: (x: Key, y: Key) => boolean); + /** + * Range Constructor. + * + * @param begin nput interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator>, end: Iterator>); + /** + * Range Constructor. + * + * @param begin nput interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator>, end: Iterator>, compare: (x: Key, y: Key) => boolean); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: Key): MapIterator; + /** + * @inheritdoc + */ + count(key: Key): number; + /** + * @inheritdoc + */ + key_comp(): (x: Key, y: Key) => boolean; + /** + * @inheritdoc + */ + value_comp(): (x: Pair, y: Pair) => boolean; + /** + * @inheritdoc + */ + lower_bound(key: Key): MapIterator; + /** + * @inheritdoc + */ + upper_bound(key: Key): MapIterator; + /** + * @inheritdoc + */ + equal_range(key: Key): Pair, MapIterator>; + /** + * @hidden + */ + protected _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link TreeMapMulti map} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link TreeMapMulti map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeMapMulti container}. + */ + swap(obj: TreeMultiMap): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer>): void; + } +} +declare namespace std { + /** + *

    System error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report conditions originating during + * runtime from the operating system or other low-level application program interfaces which have an + * associated {@link ErrorCode}.

    + * + *

    The class inherits from {@link RuntimeError}, to which it adds an {@link ErrorCode} as + * member code (and defines a specialized what member).

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/system_error/system_error + * @author Jeongho Nam + */ + class SystemError extends RuntimeError { + /** + * @hidden + */ + protected code_: ErrorCode; + /** + * Construct from an error code. + * + * @param code An {@link ErrorCode} object. + */ + constructor(code: ErrorCode); + /** + * Construct from an error code and message. + * + * @param code An {@link ErrorCode} object. + * @param message A message incorporated in the string returned by member {@link what what()}. + */ + constructor(code: ErrorCode, message: string); + /** + * Construct from a numeric value and error category. + * + * @param val A numerical value identifying an error code. + * @param category A reference to an {@link ErrorCode} object. + */ + constructor(val: number, category: ErrorCategory); + /** + * Construct from a numeric value, error category and message. + * + * @param val A numerical value identifying an error code. + * @param category A reference to an {@link ErrorCode} object. + * @param message A message incorporated in the string returned by member {@link what what()}. + */ + constructor(val: number, category: ErrorCategory, message: string); + /** + *

    Get error code.

    + * + *

    Returns the {@link ErrorCode} object associated with the exception.

    + * + *

    This value is either the {@link ErrorCode} passed to the construction or its equivalent + * (if constructed with a value and a {@link category}.

    + * + * @return The {@link ErrorCode} associated with the object. + */ + code(): ErrorCode; + } +} +declare namespace std { + /** + *

    Error category.

    + * + *

    This type serves as a base class for specific category types.

    + * + *

    Category types are used to identify the source of an error. They also define the relation between + * {@link ErrorCode} and {@link ErrorCondition}objects of its category, as well as the message set for {@link ErrorCode} + * objects. + * + *

    Objects of these types have no distinct values and are not-copyable and not-assignable, and thus can only be + * passed by reference. As such, only one object of each of these types shall exist, each uniquely identifying its own + * category: all error codes and conditions of a same category shall return a reference to same object.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/system_error/error_category + * @author Jeongho Nam + */ + abstract class ErrorCategory { + /** + * Default Constructor. + */ + constructor(); + /** + *

    Return category name.

    + * + *

    In derived classes, the function returns a string naming the category.

    + * + *

    In {@link ErrorCategory}, it is a pure virtual member function.

    + * + *
      + *
    • In the {@link GenericCategory} object, it returns "generic".
    • + *
    • In the {@link SystemCategory} object, it returns "system".
    • + *
    • In the {@link IOStreamCategory} object, it returns "iostream".
    • + *
    + * + * @return The category name. + */ + abstract name(): string; + /** + *

    Error message.

    + * + *

    In derived classes, the function returns a string object with a message describing the error condition + * denoted by val.

    + * + *

    In {@link ErrorCategory}, it is a pure virtual member function.

    + * + *

    This function is called both by {@link ErrorCode.message ErrorCode.message()} and + * {@link ErrorCondition.message ErrorCondition.message()} to obtain the corresponding message in the + * {@link category}. Therefore, numerical values used by custom error codes and + * {@link ErrorCondition error conditions} should only match for a category if they describe the same error.

    + * + * @param val A numerical value identifying an error condition. + * If the {@link ErrorCategory} object is the {@link GenericCategory}, this argument is equivalent to an + * {@link errno} value. + * + * @return A string object with the message. + */ + abstract message(val: number): string; + /** + *

    Default error condition.

    + * + *

    Returns the default {@link ErrorCondition}object of this category that is associated with the + * {@link ErrorCode} identified by a value of val.

    + * + *

    Its definition in the base class {@link ErrorCategory} returns the same as constructing an + * {@link ErrorCondition} object with: + * + *

    new ErrorCondition(val, *this);

    + * + *

    As a virtual member function, this behavior can be overriden in derived classes.

    + * + *

    This function is called by the default definition of member {@link equivalent equivalent()}, which is used to + * compare {@link ErrorCondition error conditions} with error codes.

    + * + * @param val A numerical value identifying an error condition. + * + * @return The default {@link ErrorCondition}object associated with condition value val for this category. + */ + default_error_condition(val: number): ErrorCondition; + /** + *

    Check error code equivalence.

    + * + *

    Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an + * {@link ErrorCondition error condition.

    + * + *

    This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is + * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' + * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered + * equivalent by the operator.

    + * + *

    As a virtual member function, this behavior can be overridden in derived classes to define a different + * correspondence mechanism for each {@link ErrorCategory} type.

    + * + * @param val_code A numerical value identifying an error code. + * @param cond An object of an {@link ErrorCondition} type. + * + * @return true if the arguments are considered equivalent. false otherwise. + */ + equivalent(val_code: number, cond: ErrorCondition): boolean; + /** + *

    Check error code equivalence.

    + * + *

    Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an + * {@link ErrorCondition error condition.

    + * + *

    This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is + * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' + * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered + * equivalent by the operator.

    + * + *

    As a virtual member function, this behavior can be overridden in derived classes to define a different + * correspondence mechanism for each {@link ErrorCategory} type.

    + * + * @param code An object of an {@link ErrorCode} type. + * @param val_cond A numerical value identifying an error code. + * + * @return true if the arguments are considered equivalent. false otherwise. + */ + equivalent(code: ErrorCode, val_cond: number): boolean; + } +} +declare namespace std { + /** + *

    Error condition.

    + * + *

    Objects of this type hold a condition {@link value} associated with a {@link category}.

    + * + *

    Objects of this type describe errors in a generic way so that they may be portable across different + * systems. This is in contrast with {@link ErrorCode} objects, that may contain system-specific + * information.

    + * + *

    Because {@link ErrorCondition}objects can be compared with error_code objects directly by using + * relational operators, {@link ErrorCondition}objects are generally used to check whether + * a particular {@link ErrorCode} obtained from the system matches a specific error condition no matter + * the system.

    + * + *

    The {@link ErrorCategory categories} associated with the {@link ErrorCondition} and the + * {@link ErrorCode} define the equivalences between them.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/system_error/error_condition + * @author Jeongho Nam + */ + class ErrorCondition extends base.ErrorInstance { + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from a numeric value and error category. + * + * @param val A numerical value identifying an error condition. + * @param category A reference to an {@link ErrorCategory} object. + */ + constructor(val: number, category: ErrorCategory); + } +} +declare namespace std { + /** + *

    Error code.

    + * + *

    Objects of this type hold an error code {@link value} associated with a {@link category}.

    + * + *

    The operating system and other low-level applications and libraries generate numerical error codes to + * represent possible results. These numerical values may carry essential information for a specific platform, + * but be non-portable from one platform to another.

    + * + *

    Objects of this class associate such numerical codes to {@link ErrorCategory error categories}, so that they + * can be interpreted when needed as more abstract (and portable) {@link ErrorCondition error conditions}.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/system_error/error_code + * @author Jeongho Nam + */ + class ErrorCode extends base.ErrorInstance { + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from a numeric value and error category. + * + * @param val A numerical value identifying an error code. + * @param category A reference to an {@link ErrorCategory} object. + */ + constructor(val: number, category: ErrorCategory); + } +} +declare namespace std { + /** + *

    Running on Node.

    + * + *

    Test whether the JavaScript is running on Node.

    + * + * @references http://stackoverflow.com/questions/17575790/environment-detection-node-js-or-browser + */ + function is_node(): boolean; + /** + *

    Pair of values.

    + * + *

    This class couples together a pair of values, which may be of different types (T1 and + * T2). The individual values can be accessed through its public members {@link first} and + * {@link second}.

    + * + * @param Type of member {@link first}. + * @param Type of member {@link second}. + * + * @reference http://www.cplusplus.com/reference/utility/pair + * @author Jeongho Nam + */ + class Pair { + /** + *

    A first value in the Pair.

    + */ + first: T1; + /** + *

    A second value in the Pair.

    + */ + second: T2; + /** + *

    Construct from pair values.

    + * + * @param first The first value of the Pair + * @param second The second value of the Pair + */ + constructor(first: T1, second: T2); + /** + *

    Whether a Pair is equal with the Pair.

    + *

    Compare each first and second value of two Pair(s) and returns whether they are equal or not.

    + * + *

    If stored key and value in a Pair are not number or string but an object like a class or struct, + * the comparison will be executed by a member method (SomeObject)::equal_to(). If the object does not have + * the member method equal_to(), only address of pointer will be compared.

    + * + * @param obj A Map to compare + * @return Indicates whether equal or not. + */ + equal_to(pair: Pair): boolean; + less(pair: Pair): boolean; + } + /** + *

    Construct {@link Pair} object.

    + * + *

    Constructs a {@link Pair} object with its {@link Pair.first first} element set to x and its + * {@link Pair.second second} element set to y.

    + * + *

    The template types can be implicitly deduced from the arguments passed to {@link make_pair}.

    + * + *

    {@link Pair} objects can be constructed from other {@link Pair} objects containing different types, if the + * respective types are implicitly convertible.

    + * + * @param x Value for member {@link Pair.first first}. + * @param y Value for member {@link Pair.second second}. + * + * @return A {@link Pair} object whose elements {@link Pair.first first} and {@link Pair.second second} are set to + * x and y respectivelly. + */ + function make_pair(x: T1, y: T2): Pair; +} +declare namespace std { + /** + *

    Priority queue.

    + * + *

    {@link PriorityQueue Priority queues} are a type of container adaptors, specifically designed such that its + * first element is always the greatest of the elements it contains, according to some strict weak ordering + * criterion.

    + * + *

    This context is similar to a heap, where elements can be inserted at any moment, and only the + * max heap element can be retrieved (the one at the top in the {@link PriorityQueue priority queue}).

    + * + *

    {@link PriorityQueue Priority queues} are implemented as container adaptors, which are classes that + * use an encapsulated object of a specific container class as its {@link container_ underlying container}, + * providing a specific set of member functions to access its elements. Elements are popped from the "back" + * of the specific container, which is known as the top of the {@link PriorityQueue Priority queue}.

    + * + *

    The {@link container_ underlying container} may be any of the standard container class templates or some + * other specifically designed container class. The container shall be accessible through + * {@link IArrayIterator random access iterators} and support the following operations:

    + * + *
      + *
    • empty()
    • + *
    • size()
    • + *
    • front()
    • + *
    • push_back()
    • + *
    • pop_back()
    • + *
    + * + *

    The standard container classes {@link Vector} and {@link Deque} fulfill these requirements. By default, if + * no container class is specified for a particular {@link PriorityQueue} class instantiation, the standard + * container {@link Vector} is used.

    + * + *

    Support of {@link IArrayIterator random access iterators} is required to keep a heap structure internally + * at all times. This is done automatically by the container adaptor by automatically calling the algorithm + * functions make_heap, push_heap and pop_heap when needed.

    + * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/queue/priority_queue/ + * @author Jeongho Nam + */ + class PriorityQueue { + /** + *

    The underlying container for implementing the priority queue.

    + * + *

    Following standard definition from the C++ committee, the underlying container should be one of + * {@link Vector} or {@link Deque}, however, I've adopted {@link TreeMultiSet} instead of them. Of course, + * there are proper reasons for adapting the {@link TreeMultiSet} even violating standard advice.

    + * + *

    Underlying container of {@link PriorityQueue} must keep a condition; the highest (or lowest) + * element must be placed on the terminal node for fast retrieval and deletion. To keep the condition with + * {@link Vector} or {@link Deque}, lots of times will only be spent for re-arranging elements. It calls + * rearrangement functions like make_heap, push_heap and pop_head for rearrangement.

    + * + *

    However, the {@link TreeMultiSet} container always keeps arrangment automatically without additional + * operations and it even meets full criteria of {@link PriorityQueue}. Those are the reason why I've adopted + * {@link TreeMultiSet} as the underlying container of {@link PriorityQueue}.

    + */ + private container_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (left: T, right: T) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array); + /** + * Contruct from elements with compare. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array, compare: (left: T, right: T) => boolean); + /** + * Copy Constructor. + */ + constructor(container: base.IContainer); + /** + * Copy Constructor with compare. + * + * @param container A container to be copied. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: base.IContainer, compare: (left: T, right: T) => boolean); + /** + * Range Constructor. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * Range Constructor with compare. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator, end: Iterator, compare: (left: T, right: T) => boolean); + /** + *

    Return size.

    + * + *

    Returns the number of elements in the {@link PriorityQueue}.

    + * + *

    This member function effectively calls member {@link IArray.size size} of the + * {@link container_ underlying container} object.

    + * + * @return The number of elements in the underlying + */ + size(): number; + /** + *

    Test whether container is empty.

    + * + *

    Returns whether the {@link PriorityQueue} is empty: i.e. whether its {@link size} is zero.

    + * + *

    This member function effectively calls member {@link IARray.empty empty} of the + * {@link container_ underlying container} object.

    + */ + empty(): boolean; + /** + *

    Access top element.

    + * + *

    Returns a constant reference to the top element in the {@link PriorityQueue}.

    + * + *

    The top element is the element that compares higher in the {@link PriorityQueue}, and the next that is + * removed from the container when {@link PriorityQueue.pop} is called.

    + * + *

    This member function effectively calls member {@link IArray.front front} of the + * {@link container_ underlying container} object.

    + * + * @return A reference to the top element in the {@link PriorityQueue}. + */ + top(): T; + /** + *

    Insert element.

    + * + *

    Inserts a new element in the {@link PriorityQueue}. The content of this new element is initialized to + * val. + * + *

    This member function effectively calls the member function {@link IArray.push_back push_back} of the + * {@link container_ underlying container} object, and then reorders it to its location in the heap by calling + * the push_heap algorithm on the range that includes all the elements of the

    + * + * @param val Value to which the inserted element is initialized. + */ + push(val: T): void; + /** + *

    Remove top element.

    + * + *

    Removes the element on top of the {@link PriorityQueue}, effectively reducing its {@link size} by one. + * The element removed is the one with the highest (or lowest) value.

    + * + *

    The value of this element can be retrieved before being popped by calling member + * {@link PriorityQueue.top}.

    + * + *

    This member function effectively calls the pop_heap algorithm to keep the heap property of + * {@link PriorityQueue PriorityQueues} and then calls the member function {@link IArray.pop_back pop_back} of + * the {@link container_ underlying container} object to remove the element.

    + */ + pop(): void; + /** + *

    Swap contents.

    + * + *

    Exchanges the contents of the container adaptor by those of obj, swapping both the + * {@link container_ underlying container} value and their comparison function using the corresponding + * {@link std.swap swap} non-member functions (unqualified).

    + * + *

    This member function has a noexcept specifier that matches the combined noexcept of the + * {@link IArray.swap swap} operations on the {@link container_ underlying container} and the comparison + * functions.

    + * + * @param obj {@link PriorityQueue} container adaptor of the same type (i.e., instantiated with the same + * template parameters, T). Sizes may differ. + */ + swap(obj: PriorityQueue): void; } } From c85958917708d9a396100687719e47671e43be66 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sat, 24 Sep 2016 01:46:55 +0900 Subject: [PATCH 19/28] TypeScript-STL v1.1 for TS1.8 --- typescript-stl/typescript-stl.d.ts | 13396 +++++++++++++-------------- 1 file changed, 6698 insertions(+), 6698 deletions(-) diff --git a/typescript-stl/typescript-stl.d.ts b/typescript-stl/typescript-stl.d.ts index 06edc79bec..35bd397459 100644 --- a/typescript-stl/typescript-stl.d.ts +++ b/typescript-stl/typescript-stl.d.ts @@ -2751,46 +2751,6 @@ declare namespace std { */ function minmax_element>(first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): Pair; } -declare namespace std.base { - /** - *

    Static class holding enumeration codes of color of Red-black tree.

    - * - *

    Color codes imposed to nodes of RB-Tree are following those rules:

    - * - *
      - *
    1. A node is either red or black.
    2. - *
    3. The root is black. This rule is sometimes omitted. Since the root can - * always be changed from red to black, but not - * necessarily vice versa, this rule has little effect on analysis.
    4. - *
    5. All leaves (NIL; null) are black.
    6. - *
    7. If a node is red, then both its children are - * black.
    8. - *
    9. Every path from a given node to any of its descendant NIL nodes contains the same number of - * black nodes. Some definitions: the number of - * black nodes from the root to a node is the node's - * black depth; the uniform number of black - * nodes in all paths from root to the leaves is called the black-height of - * the red-black tree.
    10. - *
    - * - * @author Migrated by Jeongho Nam - */ - enum Color { - /** - *

    Code of color black.

    - * - *
      - *
    • Those are clearly black: root, leaf nodes or children nodes of red.
    • - *
    • Every path from a given nodes containes the same number of black nodes exclude NIL(s).
    • - *
    - */ - BLACK = 0, - /** - *

    Code of color red.

    - */ - RED = 1, - } -} declare namespace std.base { /** *

    An abstract container.

    @@ -2903,6 +2863,5021 @@ declare namespace std.base { swap(obj: IContainer): void; } } +declare namespace std { + /** + *

    Bi-directional iterator.

    + * + *

    {@link Iterator Bidirectional iterators} are iterators that can be used to access the sequence of elements + * in a range in both directions (towards the end and towards the beginning).

    + * + *

    All {@link IArrayIterator random-access iterators} are also valid {@link Iterrator bidirectional iterators}. + *

    + * + *

    There is not a single type of {@link Iterator bidirectional iterator}: {@link IContainer Each container} + * may define its own specific iterator type able to iterate through it and access its elements.

    + * + *

    + * + *

    + * + * @reference http://www.cplusplus.com/reference/iterator/BidirectionalIterator + * @author Jeongho Nam + */ + abstract class Iterator { + /** + * Source container of the iterator is directing for. + */ + protected source_: base.IContainer; + /** + * Construct from the source {@link IContainer container}. + * + * @param source The source + */ + constructor(source: base.IContainer); + /** + *

    Get iterator to previous element.

    + *

    If current iterator is the first item(equal with {@link IContainer.begin IContainer.begin()}), + * returns {@link IContainer.end IContainer.end()}.

    + * + * @return An iterator of the previous item. + */ + abstract prev(): Iterator; + /** + *

    Get iterator to next element.

    + *

    If current iterator is the last item, returns {@link IContainer.end IContainer.end()}.

    + * + * @return An iterator of the next item. + */ + abstract next(): Iterator; + /** + * Advances the {@link Iterator} by n element positions. + * + * @param n Number of element positions to advance. + * @return An advanced iterator. + */ + advance(n: number): Iterator; + /** + * Get source + */ + get_source(): base.IContainer; + /** + *

    Whether an iterator is equal with the iterator.

    + * + *

    Compare two iterators and returns whether they are equal or not.

    + * + *

    Note

    + *

    Iterator's equal_to() only compare souce container and index number.

    + * + *

    Although elements in a pair, key and value are equal_to, if the source map or + * index number is different, then the {@link equal_to equal_to()} will return false. If you want to + * compare the elements of a pair, compare them directly by yourself.

    + * + * @param obj An iterator to compare + * @return Indicates whether equal or not. + */ + equal_to(obj: Iterator): boolean; + /** + *

    Get value of the iterator is pointing.

    + * + * @return A value of the iterator. + */ + value: T; + abstract swap(obj: Iterator): void; + } +} +declare namespace std { + /** + *

    This class reverses the direction in which a bidirectional or random-access iterator iterates through a range. + *

    + * + *

    A copy of the original iterator (the {@link Iterator base iterator}) is kept internally and used to reflect + * the operations performed on the {@link ReverseIterator}: whenever the {@link ReverseIterator} is incremented, its + * {@link Iterator base iterator} is decreased, and vice versa. A copy of the {@link Iterator base iterator} with the + * current state can be obtained at any time by calling member {@link base}.

    + * + *

    Notice however that when an iterator is reversed, the reversed version does not point to the same element in + * the range, but to the one preceding it. This is so, in order to arrange for the past-the-end element of a + * range: An iterator pointing to a past-the-end element in a range, when reversed, is pointing to the last element + * (not past it) of the range (this would be the first element of the reversed range). And if an iterator to the + * first element in a range is reversed, the reversed iterator points to the element before the first element (this + * would be the past-the-end element of the reversed range).

    + * + *

    + * + *

    + * + * @reference http://www.cplusplus.com/reference/iterator/reverse_iterator + * @author Jeongho Nam + */ + abstract class ReverseIterator, This extends ReverseIterator> extends Iterator { + /** + * @hidden + */ + protected base_: Base; + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: Base); + /** + *

    Return base iterator.

    + * + *

    Return a reference of the base iteraotr.

    + * + *

    The base iterator is an iterator of the same type as the one used to construct the {@link ReverseIterator}, + * but pointing to the element next to the one the {@link ReverseIterator} is currently pointing to + * (a {@link ReverseIterator} has always an offset of -1 with respect to its base iterator). + * + * @return A reference of the base iterator, which iterates in the opposite direction. + */ + base(): Base; + /** + * @hidden + */ + protected abstract create_neighbor(base: Base): This; + /** + *

    Get value of the iterator is pointing.

    + * + * @return A value of the reverse iterator. + */ + value: T; + /** + * @inheritdoc + */ + prev(): This; + /** + * @inheritdoc + */ + next(): This; + /** + * @inheritdoc + */ + advance(n: number): This; + /** + * @inheritdoc + */ + equal_to(obj: This): boolean; + /** + * @inheritdoc + */ + swap(obj: This): void; + } + /** + *

    Return distance between {@link Iterator iterators}.

    + * + *

    Calculates the number of elements between first and last.

    + * + *

    If it is a {@link IArrayIterator random-access iterator}, the function uses operator- to calculate this. + * Otherwise, the function uses the increase operator {@link Iterator.next next()} repeatedly.

    + * + * @param first Iterator pointing to the initial element. + * @param last Iterator pointing to the final element. This must be reachable from first. + * + * @return The number of elements between first and last. + */ + function distance>(first: InputIterator, last: InputIterator): number; + /** + *

    Advance iterator.

    + * + *

    Advances the iterator it by n elements positions.

    + * + * @param it Iterator to be advanced. + * @param n Number of element positions to advance. + * + * @return An iterator to the element n positions before it. + */ + function advance>(it: InputIterator, n: number): InputIterator; + /** + *

    Get iterator to previous element.

    + * + *

    Returns an iterator pointing to the element that it would be pointing to if advanced -n positions.

    + * + * @param it Iterator to base position. + * @param n Number of element positions offset (1 by default). + * + * @return An iterator to the element n positions before it. + */ + function prev>(it: BidirectionalIterator, n?: number): BidirectionalIterator; + /** + *

    Get iterator to next element.

    + * + *

    Returns an iterator pointing to the element that it would be pointing to if advanced n positions.

    + * + * @param it Iterator to base position. + * @param n Number of element positions offset (1 by default). + * + * @return An iterator to the element n positions away from it. + */ + function next>(it: ForwardIterator, n?: number): ForwardIterator; + /** + *

    Iterator to beginning.

    + * + *

    Returns an iterator pointing to the first element in the sequence.

    + * + *

    If the sequence is empty, the returned value shall not be dereferenced.

    + * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. + */ + function begin(container: Vector): VectorIterator; + /** + *

    Iterator to beginning.

    + * + *

    Returns an iterator pointing to the first element in the sequence.

    + * + *

    If the sequence is empty, the returned value shall not be dereferenced.

    + * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. + */ + function begin(container: List): ListIterator; + /** + *

    Iterator to beginning.

    + * + *

    Returns an iterator pointing to the first element in the sequence.

    + * + *

    If the sequence is empty, the returned value shall not be dereferenced.

    + * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. + */ + function begin(container: Deque): DequeIterator; + /** + *

    Iterator to beginning.

    + * + *

    Returns an iterator pointing to the first element in the sequence.

    + * + *

    If the sequence is empty, the returned value shall not be dereferenced.

    + * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. + */ + function begin(container: base.SetContainer): SetIterator; + /** + *

    Iterator to beginning.

    + * + *

    Returns an iterator pointing to the first element in the sequence.

    + * + *

    If the sequence is empty, the returned value shall not be dereferenced.

    + * + * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. + * + * @return The same as returned by {@link IContainer.begin container.begin()}. + */ + function begin(container: base.MapContainer): MapIterator; + /** + *

    Iterator to end.

    + * + *

    Returns an iterator pointing to the past-the-end element in the sequence.

    + * + *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    + * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function end(container: Vector): VectorIterator; + /** + *

    Iterator to end.

    + * + *

    Returns an iterator pointing to the past-the-end element in the sequence.

    + * + *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    + * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function end(container: List): ListIterator; + /** + *

    Iterator to end.

    + * + *

    Returns an iterator pointing to the past-the-end element in the sequence.

    + * + *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    + * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function end(container: Deque): DequeIterator; + /** + *

    Iterator to end.

    + * + *

    Returns an iterator pointing to the past-the-end element in the sequence.

    + * + *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    + * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function end(container: base.SetContainer): SetIterator; + /** + *

    Iterator to end.

    + * + *

    Returns an iterator pointing to the past-the-end element in the sequence.

    + * + *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    + * + * @param container A container of a class type for which member {@link IContainer.end end} is defined. + * + * @return The same as returned by {@link IContainer.end container.end()}. + */ + function end(container: base.MapContainer): MapIterator; +} +declare namespace std.Deque { + type iterator = std.DequeIterator; + type reverse_iterator = std.DequeReverseIterator; +} +declare namespace std { + /** + *

    Double ended queue.

    + * + *

    {@link Deque} (usually pronounced like "deck") is an irregular acronym of + * double-ended queue. Double-ended queues are sequence containers with dynamic sizes that can be + * expanded or contracted on both ends (either its front or its back).

    + * + *

    Specific libraries may implement deques in different ways, generally as some form of dynamic array. But in any + * case, they allow for the individual elements to be accessed directly through random access iterators, with storage + * handled automatically by expanding and contracting the container as needed.

    + * + *

    Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of + * elements also at the beginning of the sequence, and not only at its end. But, unlike {@link Vector Vectors}, + * {@link Deque Deques} are not guaranteed to store all its elements in contiguous storage locations: accessing + * elements in a deque by offsetting a pointer to another element causes undefined behavior.

    + * + *

    Both {@link Vector}s and {@link Deque}s provide a very similar interface and can be used for similar purposes, + * but internally both work in quite different ways: While {@link Vector}s use a single array that needs to be + * occasionally reallocated for growth, the elements of a {@link Deque} can be scattered in different chunks of + * storage, with the container keeping the necessary information internally to provide direct access to any of its + * elements in constant time and with a uniform sequential interface (through iterators). Therefore, + * {@link Deque Deques} are a little more complex internally than {@link Vector}s, but this allows them to grow more + * efficiently under certain circumstances, especially with very long sequences, where reallocations become more + * expensive.

    + * + *

    For operations that involve frequent insertion or removals of elements at positions other than the beginning or + * the end, {@link Deque Deques} perform worse and have less consistent iterators and references than + * {@link List Lists}.

    + * + *

    + * + *

    + * + *

    Container properties

    + *
    + *
    Sequence
    + *
    Elements in sequence containers are ordered in a strict linear sequence. Individual elements + * are accessed by their position in this sequence.
    + * + *
    Dynamic array
    + *
    Generally implemented as a dynamic array, it allows direct access to any element in the + * sequence and provides relatively fast addition/removal of elements at the beginning or the end + * of the sequence.
    + *
    + * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/deque/deque/ + * @author Jeongho Nam + */ + class Deque extends base.Container implements base.IArrayContainer, base.IDequeContainer { + /** + * @hidden + */ + private static ROW; + /** + * @hidden + */ + private static MIN_CAPACITY; + /** + * @hidden + */ + private matrix_; + /** + * @hidden + */ + private size_; + /** + * @hidden + */ + private capacity_; + /** + * @hidden + */ + private get_col_size(); + /** + *

    Default Constructor.

    + * + *

    Constructs an empty container, with no elements.

    + */ + constructor(); + /** + *

    Initializer list Constructor.

    + * + *

    Constructs a container with a copy of each of the elements in array, in the same order.

    + * + * @param array An array containing elements to be copied and contained. + */ + constructor(items: Array); + /** + *

    Fill Constructor.

    + * + *

    Constructs a container with n elements. Each element is a copy of val (if provided).

    + * + * @param n Initial container size (i.e., the number of elements in the container at construction). + * @param val Value to fill the container with. Each of the n elements in the container is + * initialized to a copy of this value. + */ + constructor(size: number, val: T); + /** + *

    Copy Constructor.

    + * + *

    Constructs a container with a copy of each of the elements in container, in the same order.

    + * + * @param container Another container object of the same type (with the same class template + * arguments T), whose contents are either copied or acquired. + */ + constructor(container: Deque); + /** + *

    Range Constructor.

    + * + *

    Constructs a container with as many elements as the range (begin, end), with each + * element emplace-constructed from its corresponding element in that range, in the same order.

    + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + assign>(begin: InputIterator, end: InputIterator): void; + /** + * @inheritdoc + */ + assign(n: number, val: T): void; + /** + * @inheritdoc + */ + reserve(capacity: number): void; + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + begin(): DequeIterator; + /** + * @inheritdoc + */ + end(): DequeIterator; + /** + * @inheritdoc + */ + rbegin(): DequeReverseIterator; + /** + * @inheritdoc + */ + rend(): DequeReverseIterator; + /** + * @inheritdoc + */ + size(): number; + /** + * @inheritdoc + */ + empty(): boolean; + /** + * @inheritdoc + */ + capacity(): number; + /** + * @inheritdoc + */ + at(index: number): T; + /** + * @inheritdoc + */ + set(index: number, val: T): void; + /** + * @inheritdoc + */ + front(): T; + /** + * @inheritdoc + */ + back(): T; + /** + // Fetch row and column's index. + /** + * @hidden + */ + private fetch_index(index); + /** + * @inheritdoc + */ + push(...items: T[]): number; + /** + * @inheritdoc + */ + push_front(val: T): void; + /** + * @inheritdoc + */ + push_back(val: T): void; + /** + * @inheritdoc + */ + pop_front(): void; + /** + * @inheritdoc + */ + pop_back(): void; + /** + * @inheritdoc + */ + insert(position: DequeIterator, val: T): DequeIterator; + /** + * @inheritdoc + */ + insert(position: DequeIterator, n: number, val: T): DequeIterator; + /** + * @inheritdoc + */ + insert>(position: DequeIterator, begin: InputIterator, end: InputIterator): DequeIterator; + /** + * @inheritdoc + */ + insert(position: DequeReverseIterator, val: T): DequeReverseIterator; + /** + * @inheritdoc + */ + insert(position: DequeReverseIterator, n: number, val: T): DequeReverseIterator; + /** + * @inheritdoc + */ + insert>(position: DequeReverseIterator, begin: InputIterator, end: InputIterator): DequeReverseIterator; + /** + * @hidden + */ + private insert_by_val(position, val); + /** + * @hidden + */ + protected _Insert_by_repeating_val(position: DequeIterator, n: number, val: T): DequeIterator; + /** + * @hidden + */ + protected _Insert_by_range>(position: DequeIterator, begin: InputIterator, end: InputIterator): DequeIterator; + /** + * @hidden + */ + private insert_by_items(position, items); + /** + * @inheritdoc + */ + erase(position: DequeIterator): DequeIterator; + /** + * @inheritdoc + */ + erase(first: DequeIterator, last: DequeIterator): DequeIterator; + /** + * @inheritdoc + */ + erase(position: DequeReverseIterator): DequeReverseIterator; + /** + * @inheritdoc + */ + erase(first: DequeReverseIterator, last: DequeReverseIterator): DequeReverseIterator; + /** + * @hidden + */ + protected _Erase_by_range(first: DequeIterator, last: DequeIterator): DequeIterator; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link Deque container} object with same type of elements. Sizes and container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link Deque container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link container Deque}. + */ + swap(obj: Deque): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std { + /** + *

    An iterator of {@link Deque}.

    + * + *

    + * + *

    + * + * @author Jeongho Nam + */ + class DequeIterator extends Iterator implements base.IArrayIterator { + /** + * Sequence number of iterator in the source {@link Deque}. + */ + private index_; + /** + *

    Construct from the source {@link Deque container}.

    + * + *

    Note

    + *

    Do not create the iterator directly, by yourself.

    + *

    Use {@link Deque.begin begin()}, {@link Deque.end end()} in {@link Deque container} instead.

    + * + * @param source The source {@link Deque container} to reference. + * @param index Sequence number of the element in the source {@link Deque}. + */ + constructor(source: Deque, index: number); + /** + * @hidden + */ + private deque; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + /** + * @inheritdoc + */ + index: number; + /** + * @inheritdoc + */ + prev(): DequeIterator; + /** + * @inheritdoc + */ + next(): DequeIterator; + /** + * @inheritdoc + */ + advance(n: number): DequeIterator; + /** + *

    Whether an iterator is equal with the iterator.

    + * + *

    Compare two iterators and returns whether they are equal or not.

    + * + *

    Note

    + *

    Iterator's equal_to() only compare souce container and index number.

    + * + *

    Although elements in a pair, key and value are equal_to, if the source map or + * index number is different, then the {@link equal_to equal_to()} will return false. If you want to + * compare the elements of a pair, compare them directly by yourself.

    + * + * @param obj An iterator to compare + * @return Indicates whether equal or not. + */ + equal_to(obj: DequeIterator): boolean; + /** + * @inheritdoc + */ + swap(obj: DequeIterator): void; + } +} +declare namespace std { + /** + *

    A reverse-iterator of Deque.

    + * + *

    + * + *

    + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class DequeReverseIterator extends ReverseIterator, DequeReverseIterator> implements base.IArrayIterator { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: DequeIterator); + /** + * @hidden + */ + protected create_neighbor(base: DequeIterator): DequeReverseIterator; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + /** + * Get index. + */ + index: number; + } +} +declare namespace std { + /** + *

    Function handling termination on exception

    + * + *

    Calls the current terminate handler.

    + * + *

    By default, the terminate handler calls abort. But this behavior can be redefined by calling + * {@link set_terminate}.

    + * + *

    This function is automatically called when no catch handler can be found for a thrown exception, + * or for some other exceptional circumstance that makes impossible to continue the exception handling process.

    + * + *

    This function is provided so that the terminate handler can be explicitly called by a program that needs to + * abnormally terminate, and works even if {@link set_terminate} has not been used to set a custom terminate handler + * (calling abort in this case).

    + */ + function terminate(): void; + /** + *

    Set terminate handler function.

    + * + *

    A terminate handler function is a function automatically called when the exception handling process has + * to be abandoned for some reason. This happens when no catch handler can be found for a thrown exception, or for + * some other exceptional circumstance that makes impossible to continue the exception handling process.

    + * + *

    Before this function is called by the program for the first time, the default behavior is to call abort.

    + * + *

    A program may explicitly call the current terminate handler function by calling {@link terminate}.

    + * + * @param f Function that takes no parameters and returns no value (void). + */ + function set_terminate(f: () => void): void; + /** + *

    Get terminate handler function.

    + * + *

    The terminate handler function is automatically called when no catch handler can be found + * for a thrown exception, or for some other exceptional circumstance that makes impossible to continue the exception + * handling process.

    + * + *

    If no such function has been set by a previous call to {@link set_terminate}, the function returns a + * null-pointer.

    + * + * @return If {@link set_terminate} has previously been called by the program, the function returns the current + * terminate handler function. Otherwise, it returns a null-pointer. + */ + function get_terminate(): () => void; + /** + *

    Standard exception class.

    + * + *

    Base class for standard exceptions.

    + * + *

    All objects thrown by components of the standard library are derived from this class. + * Therefore, all standard exceptions can be caught by catching this type by reference.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/exception/exception + * @author Jeongho Nam + */ + class Exception extends Error { + /** + * A message representing specification about the Exception. + */ + private description; + /** + * Default Constructor. + */ + constructor(); + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + /** + *

    Get string identifying exception.

    + *

    Returns a string that may be used to identify the exception.

    + * + *

    The particular representation pointed by the returned value is implementation-defined. + * As a virtual function, derived classes may redefine this function so that specify value are + * returned.

    + */ + what(): string; + /** + * @inheritdoc + */ + message: string; + /** + * @inheritdoc + */ + name: string; + } + /** + *

    Logic error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report errors in the internal + * logical of the program, such as violation of logical preconditions or class invariants.

    + * + *

    These errors are presumably detectable before the program executes.

    + * + *

    It is used as a base class for several logical error exceptions.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/logic_error + * @author Jeongho Nam + */ + class LogicError extends Exception { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Domain error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report domain errors.

    + * + *

    Generally, the domain of a mathematical function is the subset of values that it is defined for. + * For example, the square root function is only defined for non-negative numbers. Thus, a negative number + * for such a function would qualify as a domain error.

    + * + *

    No component of the standard library throws exceptions of this type. It is designed as a standard + * exception to be thrown by programs.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/domain_error + * @author Jeongho Nam + */ + class DomainError extends LogicError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Invalid argument exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report an invalid argument.

    + * + *

    It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal invalid arguments.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/invalid_argument + * @author Jeongho Nam + */ + class InvalidArgument extends LogicError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Length error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report a length error.

    + * + *

    It is a standard exception that can be thrown by programs. Some components of the standard library, + * such as vector and string also throw exceptions of this type to signal errors resizing.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/length_error + * @author Jeongho Nam + */ + class LengthError extends LogicError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Out-of-range exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report an out-of-range error.

    + * + *

    It is a standard exception that can be thrown by programs. Some components of the standard library, + * such as vector, deque, string and bitset also throw exceptions of this type to signal arguments + * out of range.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/out_of_range + * @author Jeongho Nam + */ + class OutOfRange extends LogicError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Runtime error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report errors that can only be + * detected during runtime.

    + * + *

    It is used as a base class for several runtime error exceptions.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/runtime_error + * @author Jeongho Nam + */ + class RuntimeError extends Exception { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Overflow error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to arithmetic overflow errors.

    + * + *

    It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal range errors.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/overflow_error + * @author Jeongho Nam + */ + class OverflowError extends RuntimeError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Underflow error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to arithmetic underflow errors.

    + * + *

    No component of the standard library throws exceptions of this type. It is designed as a standard + * exception to be thrown by programs.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/underflow_error + * @author Jeongho Nam + */ + class UnderflowError extends RuntimeError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + *

    Range error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report range errors in internal + * computations.

    + * + *

    It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal range errors.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/stdexcept/range_error + * @author Jeongho Nam + */ + class RangeError extends RuntimeError { + /** + *

    Construct from a message.

    + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } +} +declare namespace std { + /** + *

    Function object class for equality comparison.

    + * + *

    Binary function object class whose call returns whether its two arguments compare equal (as returned by + * operator ==).

    + * + *

    Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} + * defined. This member function allows the object to be used with the same syntax as a function call.

    + * + * @param x First element to compare. + * @param y Second element to compare. + * + * @return Whether the arguments are equal. + */ + function equal_to(x: T, y: T): boolean; + /** + *

    Function object class for non-equality comparison.

    + * + *

    Binary function object class whose call returns whether its two arguments compare not equal (as returned + * by operator operator!=).

    + * + *

    Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} + * defined. This member function allows the object to be used with the same syntax as a function call.

    + * + * @param x First element to compare. + * @param y Second element to compare. + * + * @return Whether the arguments are not equal. + */ + function not_equal_to(x: T, y: T): boolean; + /** + *

    Function for less-than inequality comparison.

    + * + *

    Binary function returns whether the its first argument compares less than the second.

    + * + *

    Generically, function objects are instances of a class with member function {@link IComparable.less less} + * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. + * This member function allows the object to be used with the same syntax as a function call.

    + * + *

    Objects of this class can be used on standard algorithms such as {@link sort sort()}, + * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.

    + * + * @param Type of arguments to compare by the function call. The type shall supporrt the operation + * operator<() or method {@link IComparable.less less}. + * + * @param x First element, the standard of comparison. + * @param y Second element compare with the first. + * + * @return Whether the first parameter is less than the second. + */ + function less(x: T, y: T): boolean; + /** + *

    Function object class for less-than-or-equal-to comparison.

    + * + *

    Binary function object class whose call returns whether the its first argument compares {@link less less than} or + * {@link equal_to equal to} the second (as returned by operator <=).

    + * + *

    Generically, function objects are instances of a class with member function {@link IComparable.less less} + * and {@link IComparable.equal_to equal_to} defined. This member function allows the object to be used with the same + * syntax as a function call.

    + * + * @param x First element, the standard of comparison. + * @param y Second element compare with the first. + * + * @return Whether the x is {@link less less than} or {@link equal_to equal to} the y. + */ + function less_equal(x: T, y: T): boolean; + /** + *

    Function for greater-than inequality comparison.

    + * + *

    Binary function returns whether the its first argument compares greater than the second.

    + * + *

    Generically, function objects are instances of a class with member function {@link less} and + * {@link equal_to equal_to()} defined. If an object doesn't have those methods, then its own uid will be used + * to compare insteadly. This member function allows the object to be used with the same syntax as a function + * call.

    + * + *

    Objects of this class can be used on standard algorithms such as {@link sort sort()}, + * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.

    + * + * @param Type of arguments to compare by the function call. The type shall supporrt the operation + * operator>() or method {@link IComparable.greater greater}. + * + * @return Whether the x is greater than the y. + */ + function greater(x: T, y: T): boolean; + /** + *

    Function object class for greater-than-or-equal-to comparison.

    + * + *

    Binary function object class whose call returns whether the its first argument compares + * {@link greater greater than} or {@link equal_to equal to} the second (as returned by operator >=).

    + * + *

    Generically, function objects are instances of a class with member function {@link IComparable.less less} + * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. + * This member function allows the object to be used with the same syntax as a function call.

    + * + * @param x First element, the standard of comparison. + * @param y Second element compare with the first. + * + * @return Whether the x is {@link greater greater than} or {@link equal_to equal to} the y. + */ + function greater_equal(x: T, y: T): boolean; + /** + *

    Logical AND function object class.

    + * + *

    Binary function object class whose call returns the result of the logical "and" operation between its two + * arguments (as returned by operator &&).

    + * + *

    Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call.

    + * + * @param x First element. + * @param y Second element. + * + * @return Result of logical AND operation. + */ + function logical_and(x: T, y: T): boolean; + /** + *

    Logical OR function object class.

    + * + *

    Binary function object class whose call returns the result of the logical "or" operation between its two + * arguments (as returned by operator ||).

    + * + *

    Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call.

    + * + * @param x First element. + * @param y Second element. + * + * @return Result of logical OR operation. + */ + function logical_or(x: T, y: T): boolean; + /** + *

    Logical NOT function object class.

    + * + *

    Unary function object class whose call returns the result of the logical "not" operation on its argument + * (as returned by operator !).

    + * + *

    Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call.

    + * + * @param x Target element. + * + * @return Result of logical NOT operation. + */ + function logical_not(x: T): boolean; + /** + *

    Bitwise AND function object class.

    + * + *

    Binary function object class whose call returns the result of applying the bitwise "and" operation between + * its two arguments (as returned by operator &).

    + * + * @param x First element. + * @param y Second element. + * + * @return Result of bitwise AND operation. + */ + function bit_and(x: number, y: number): number; + /** + *

    Bitwise OR function object class.

    + * + *

    Binary function object class whose call returns the result of applying the bitwise "and" operation between + * its two arguments (as returned by operator &).

    + * + * @param x First element. + * @param y Second element. + * + * @return Result of bitwise OR operation. + */ + function bit_or(x: number, y: number): number; + /** + *

    Bitwise XOR function object class.

    + * + *

    Binary function object class whose call returns the result of applying the bitwise "exclusive or" + * operation between its two arguments (as returned by operator ^).

    + * + * @param x First element. + * @param y Second element. + * + * @return Result of bitwise XOR operation. + */ + function bit_xor(x: number, y: number): number; + /** + *

    Comparable instance.

    + * + *

    {@link IComparable} is a common interface for objects who can compare each other.

    + * + * @reference https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html + * @author Jeongho Nam + */ + interface IComparable extends Object { + /** + *

    Indicates whether some other object is "equal to" this one.

    + * + *

    The {@link equal_to} method implements an equivalence relation on non-null object references:

    + * + *
      + *
    • + * It is reflexive: for any non-null reference value x, x.equal_to(x) + * should return true. + *
    • + *
    • + * It is symmetric: for any non-null reference values x and y, + * x.equal_to(y) should return true if and only if y.equal_to(x) + * returns true.
    • + *
    • + * It is transitive: for any non-null reference values x, y, and + * z, if x.equal_to(y) returns true and y.equal_to(z) + * returns true, then x.equal_to(z) should return true. + *
    • + *
    • + * It is consistent: for any non-null reference values x and y, multiple + * invocations of x.equal_to(y) consistently return true or consistently return + * false, provided no information used in equal_to comparisons on the objects is modified. + *
    • + *
    • + * For any non-null reference value x, x.equal_to(null) should return + * false. + *
    • + *
    + * + *

    The {@link equal_to} method for interface {@link IComparable} implements the most discriminating possible + * equivalence relation on objects; that is, for any non-null reference values x and + * y, this method returns true if and only if x and y + * refer to the same object (x == y has the value true).

    + * + *

    Note that it is generally necessary to override the {@link hash_code} method whenever this method is + * overridden, so as to maintain the general contract for the {@link hash_code} method, which states that + * equal objects must have equal hash codes.

    + * + *
      + *
    • {@link IComparable.equal_to} is called by {@link std.equal_to}.
    • + *
    + * + * @param obj the reference object with which to compare. + * + * @return true if this object is the same as the obj argument; false otherwise. + */ + equal_to(obj: T): boolean; + /** + *

    Less-than inequality comparison.

    + * + *

    Binary method returns whether the the instance compares less than the obj.

    + * + *
      + *
    • + * {@link IComparable.less} is called by {@link std.less}. Also, this method can be used on standard + * algorithms such as {@link sort sort()}, {@link merge merge()} or + * {@link TreeMap.lower_bound lower_bound()}. + *
    • + *
    + * + * @param obj the reference object with which to compare. + * + * @return Whether the first parameter is less than the second. + */ + less(obj: T): boolean; + /** + *

    Issue a hash code.

    + * + *

    Returns a hash code value for the object. This method is supported for the benefit of hash tables such + * as those provided by hash containers; {@link HashSet}, {@link HashMap}, {@link MultiHashSet} and + * {@link MultiHashMap}.

    + * + *

    As much as is reasonably practical, the {@link hash_code} method defined by interface + * {@link IComparable} does return distinct integers for distinct objects. (This is typically implemented by + * converting the internal address of the object into an integer, but this implementation technique is not + * required by the JavaScript programming language.)

    + * + *
      + *
    • + * {@link IComparable.hash_code} is called by {@link std.hash_code}. If you want to keep basically + * provided hash function, then returns {@link std.Hash.code}; return std.Hash.code(this); + *
    • + *
    + * + * @return An hash code who represents the object. + */ + hash(): number; + } + /** + *

    Default hash function for number.

    + * + *

    Unary function that defines the default hash function used by the standard library.

    + * + *

    The functional call returns a hash value of its argument: A hash value is a value that depends solely on + * its argument, returning always the same value for the same argument (for a given execution of a program). The + * value returned shall have a small likelihood of being the same as the one returned for a different argument. + *

    + * + * @param val Value to be hashed. + * + * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. + */ + function hash(val: number): number; + /** + *

    Default hash function for string.

    + * + *

    Unary function that defines the default hash function used by the standard library.

    + * + *

    The functional call returns a hash value of its argument: A hash value is a value that depends solely on + * its argument, returning always the same value for the same argument (for a given execution of a program). The + * value returned shall have a small likelihood of being the same as the one returned for a different argument. + *

    + * + * @param str A string to be hashed. + * + * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. + */ + function hash(str: string): number; + /** + *

    Default hash function for Object.

    + * + *

    Unary function that defines the default hash function used by the standard library.

    + * + *

    The functional call returns a hash value of its argument: A hash value is a value that depends solely on + * its argument, returning always the same value for the same argument (for a given execution of a program). The + * value returned shall have a small likelihood of being the same as the one returned for a different argument. + *

    + * + *

    The default {@link hash} function of Object returns a value returned from {@link hash hash(number)} with + * an unique id of each Object. If you want to specify {@link hash} function of a specific class, then + * define a member function public hash(): number in the class.

    + * + * @param obj Object to be hashed. + * + * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. + */ + function hash(obj: Object): number; + /** + *

    Exchange contents of {@link IContainers containers}.

    + * + *

    The contents of container left are exchanged with those of right. Both container objects must have + * same type of elements (same template parameters), although sizes may differ.

    + * + *

    After the call to this member function, the elements in left are those which were in right before + * the call, and the elements of right are those which were in left. All iterators, references and + * pointers remain valid for the swapped objects.

    + * + *

    This is an overload of the generic algorithm swap that improves its performance by mutually transferring + * ownership over their assets to the other container (i.e., the containers exchange references to their data, without + * actually performing any element copy or movement): It behaves as if left. + * {@link IContainer.swap swap}(right) was called.

    + * + * @param left A {@link IContainer container} to swap its contents. + * @param right A {@link IContainer container} to swap its contents. + */ + function swap(left: base.IContainer, right: base.IContainer): void; + /** + *

    Exchange contents of queues.

    + * + *

    Exchanges the contents of left and right.

    + * + * @param left A {@link Queue} container of the same type. Size may differ. + * @param right A {@link Queue} container of the same type. Size may differ. + */ + function swap(left: Queue, right: Queue): void; + /** + *

    Exchange contents of {@link PriorityQueue PriorityQueues}.

    + * + *

    Exchanges the contents of left and right.

    + * + * @param left A {@link PriorityQueue} container of the same type. Size may differ. + * @param right A {@link PriorityQueue} container of the same type. Size may differ. + */ + function swap(left: PriorityQueue, right: PriorityQueue): void; + /** + *

    Exchange contents of {@link Stack Stacks}.

    + * + *

    Exchanges the contents of left and right.

    + * + * @param left A {@link Stack} container of the same type. Size may differ. + * @param right A {@link Stack} container of the same type. Size may differ. + */ + function swap(left: Stack, right: Stack): void; + /** + *

    Exchanges the contents of two {@link UniqueMap unique maps}.

    + * + *

    The contents of container left are exchanged with those of right. Both container objects must + * be of the same type (same template parameters), although sizes may differ.

    + * + *

    After the call to this member function, the elements in left are those which were in right + * before the call, and the elements of right are those which were in left. All iterators, references + * and pointers remain valid for the swapped objects.

    + * + *

    This is an overload of the generic algorithm swap that improves its performance by mutually transferring + * ownership over their assets to the other container (i.e., the containers exchange references to their data, + * without actually performing any element copy or movement): It behaves as if + * left.{@link UniqueMap.swap swap}(right) was called.

    + * + * @param left An {@link UniqueMap unique map} to swap its conents. + * @param right An {@link UniqueMap unique map} to swap its conents. + */ + function swap(left: base.UniqueMap, right: base.UniqueMap): void; + /** + *

    Exchanges the contents of two {@link MultiMap multi maps}.

    + * + *

    The contents of container left are exchanged with those of right. Both container objects must + * be of the same type (same template parameters), although sizes may differ.

    + * + *

    After the call to this member function, the elements in left are those which were in right + * before the call, and the elements of right are those which were in left. All iterators, references + * and pointers remain valid for the swapped objects.

    + * + *

    This is an overload of the generic algorithm swap that improves its performance by mutually transferring + * ownership over their assets to the other container (i.e., the containers exchange references to their data, + * without actually performing any element copy or movement): It behaves as if + * left.{@link MultiMap.swap swap}(right) was called.

    + * + * @param left A {@link MultiMap multi map} to swap its conents. + * @param right A {@link MultiMap multi map} to swap its conents. + */ + function swap(left: base.MultiMap, right: base.MultiMap): void; +} +declare namespace std { + /** + *

    Bind function arguments.

    + * + *

    Returns a function object based on fn, but with its arguments bound to args.

    + * + *

    Each argument may either be bound to a value or be a {@link placeholders placeholder}:

    + *
      + *
    • If bound to a value, calling the returned function object will always use that value as argument.
    • + *
    • + * If a {@link placeholders placeholder}, calling the returned function object forwards an argument passed to the + * call (the one whose order number is specified by the placeholder). + *
    • + *
    + * + *

    Calling the returned object returns the same type as fn.

    + * + * @param fn A function object, pointer to function or pointer to member. + * @param args List of arguments to bind: either values, or {@link placeholders}. + * + * @return A function object that, when called, calls fn with its arguments bound to args. If fn is + * a pointer to member, the first argument expected by the returned function is an object of the class fn + * is a member. + */ + function bind(fn: (...args: any[]) => Ret, ...args: any[]): (...args: any[]) => Ret; + /** + *

    Bind function arguments.

    + * + *

    Returns a function object based on fn, but with its arguments bound to args.

    + * + *

    Each argument may either be bound to a value or be a {@link placeholders placeholder}:

    + *
      + *
    • If bound to a value, calling the returned function object will always use that value as argument.
    • + *
    • + * If a {@link placeholders placeholder}, calling the returned function object forwards an argument passed to the + * call (the one whose order number is specified by the placeholder). + *
    • + *
    + * + *

    Calling the returned object returns the same type as fn.

    + * + * @param fn A function object, pointer to function or pointer to member. + * @param thisArg This argument, owner object of the member method fn. + * @param args List of arguments to bind: either values, or {@link placeholders}. + * + * @return A function object that, when called, calls fn with its arguments bound to args. If fn is + * a pointer to member, the first argument expected by the returned function is an object of the class fn + * is a member. + */ + function bind(fn: (...args: any[]) => Ret, thisArg: T, ...args: any[]): (...args: any[]) => Ret; +} +/** + *

    Bind argument placeholders.

    + * + *
    + * + *

    When the function object returned by bind is called, an argument with placeholder {@link _1} is replaced by the + * first argument in the call, {@link _2} is replaced by the second argument in the call, and so on... For example:

    + * + * + * let vec: Vector = new Vector(); + * + * let bind = std.bind(Vector.insert, _1, vec.end(), _2, _3); + * bind.apply(vec, 5, 1); // vec.insert(vec.end(), 5, 1); + * // [1, 1, 1, 1, 1] + * + * + *

    When a call to {@link bind} is used as a subexpression in another call to bind, the {@link placeholders} + * are relative to the outermost {@link bind} expression.

    + * + * @reference http://www.cplusplus.com/reference/functional/placeholders/ + * @author Jeongho Nam + */ +declare namespace std.placeholders { + /** + * @hidden + */ + class PlaceHolder { + private index_; + constructor(index: number); + index: number; + } + /** + * Replaced by the first argument in the function call. + */ + const _1: PlaceHolder; + /** + * Replaced by the second argument in the function call. + */ + const _2: PlaceHolder; + /** + * Replaced by the third argument in the function call. + */ + const _3: PlaceHolder; + const _4: PlaceHolder; + const _5: PlaceHolder; + const _6: PlaceHolder; + const _7: PlaceHolder; + const _8: PlaceHolder; + const _9: PlaceHolder; + const _10: PlaceHolder; + const _11: PlaceHolder; + const _12: PlaceHolder; + const _13: PlaceHolder; + const _14: PlaceHolder; + const _15: PlaceHolder; + const _16: PlaceHolder; + const _17: PlaceHolder; + const _18: PlaceHolder; + const _19: PlaceHolder; + const _20: PlaceHolder; +} +declare namespace std.base { + /** + *

    An abstract map.

    + * + *

    {@link MapContainer MapContainers} are associative containers that store elements formed by a combination + * of a key value (Key) and a mapped value (T), and which allows for fast retrieval + * of individual elements based on their keys.

    + * + *

    In a {@link MapContainer}, the key values are generally used to identify the elements, while the + * mapped values store the content associated to this key. The types of key and + * mapped value may differ, and are grouped together in member type value_type, which is a + * {@link Pair} type combining both:

    + * + *

    typedef pair value_type;

    + * + *

    {@link MapContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute position + * in the container. + *
    + * + *
    Map
    + *
    + * Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value. + *
    + *
    + * + * @param Type of the keys. Each element in a map is identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @author Jeongho Nam + */ + abstract class MapContainer extends Container> { + /** + *

    {@link List} storing elements.

    + * + *

    Storing elements and keeping those sequence of the {@link MapContainer} are implemented by + * {@link data_ this list container}. Implementing index-table is also related with {@link data_ this list} + * by storing {@link ListIterator iterators} ({@link MapIterator} references {@link ListIterator}) who are + * created from {@link data_ here}.

    + */ + private data_; + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + assign>>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + clear(): void; + /** + *

    Get iterator to element.

    + * + *

    Searches the container for an element with a identifier equivalent to key and returns an + * iterator to it if found, otherwise it returns an iterator to {@link end end()}.

    + * + *

    Two keys are considered equivalent if the container's comparison object returns false reflexively + * (i.e., no matter the order in which the elements are passed as arguments).

    + * + *

    Another member functions, {@link has has()} and {@link count count()}, can be used to just check + * whether a particular key exists.

    + * + * @param key Key to be searched for + * @return An iterator to the element, if an element with specified key is found, or + * {@link end end()} otherwise. + */ + abstract find(key: Key): MapIterator; + /** + *

    Return iterator to beginning.

    + * + *

    Returns an iterator referring the first element in the

    + * + *

    Note

    + *

    If the container is {@link empty}, the returned iterator is same with {@link end end()}.

    + * + * @return An iterator to the first element in the The iterator containes the first element's value. + */ + begin(): MapIterator; + /** + *

    Return iterator to end.

    + *

    Returns an iterator referring to the past-the-end element in the

    + * + *

    The past-the-end element is the theoretical element that would follow the last element in the + * It does not point to any element, and thus shall not be dereferenced.

    + * + *

    Because the ranges used by functions of the container do not include the element reference by their + * closing iterator, this function is often used in combination with {@link MapContainer}.{@link begin} to + * specify a range including all the elements in the

    + * + *

    Note

    + *

    Returned iterator from {@link MapContainer}.{@link end} does not refer any element. Trying to accessing + * element by the iterator will cause throwing exception ({@link OutOfRange}).

    + * + *

    If the container is {@link empty}, this function returns the same as {@link begin}.

    + * + * @return An iterator to the end element in the + */ + end(): MapIterator; + /** + *

    Return {@link MapReverseIterator reverse iterator} to reverse beginning.

    + * + *

    Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in the container + * (i.e., its reverse beginning).

    + * + * {@link MapReverseIterator Reverse iterators} iterate backwards: increasing them moves them towards the + * beginning of the container.

    + * + *

    {@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}. + *

    + * + * @return A {@link MapReverseIterator reverse iterator} to the reverse beginning of the sequence + * + */ + rbegin(): MapReverseIterator; + /** + *

    Return {@link MapReverseIterator reverse iterator} to reverse end.

    + * + *

    Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before + * the first element in the {@link MapContainer map container} (which is considered its reverse end). + *

    + * + *

    The range between {@link MapContainer}.{@link rbegin} and {@link MapContainer}.{@link rend} contains + * all the elements of the container (in reverse order).

    + * + * @return A {@link MapReverseIterator reverse iterator} to the reverse end of the sequence + */ + rend(): MapReverseIterator; + /** + *

    Whether have the item or not.

    + * + *

    Indicates whether a map has an item having the specified identifier.

    + * + * @param key Key value of the element whose mapped value is accessed. + * + * @return Whether the map has an item having the specified identifier. + */ + has(key: Key): boolean; + /** + *

    Count elements with a specific key.

    + * + *

    Searches the container for elements whose key is key and returns the number of elements found.

    + * + * @param key Key value to be searched for. + * + * @return The number of elements in the container with a key. + */ + abstract count(key: Key): number; + /** + * Return the number of elements in the map. + */ + size(): number; + /** + * @inheritdoc + */ + push(...args: Pair[]): number; + /** + * @inheritdoc + */ + push(...args: [Key, T][]): number; + /** + * Construct and insert element with hint + * + * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in + * place using *args* as the arguments for the element's constructor. *hint* points to a location in the + * container suggested as a hint on where to start the search for its insertion point (the container may or + * may not use this suggestion to optimize the insertion operation). + * + * A similar member function exists, {@link insert}, which either copies or moves an existing object into + * the container, and may also take a position *hint*. + * + * @param hint Hint for the position where the element can be inserted. + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + emplace_hint(hint: MapIterator, key: Key, val: T): MapIterator; + /** + * Construct and insert element with hint + * + * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in + * place using *args* as the arguments for the element's constructor. *hint* points to a location in the + * container suggested as a hint on where to start the search for its insertion point (the container may or + * may not use this suggestion to optimize the insertion operation). + * + * A similar member function exists, {@link insert}, which either copies or moves an existing object into + * the container, and may also take a position *hint*. + * + * @param hint Hint for the position where the element can be inserted. + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An {@link MapIterator iterator} pointing to either the newly inserted element or to the element + * that already had an equivalent key in the {@link MapContainer}. + */ + emplace_hint(hint: MapReverseIterator, key: Key, val: T): MapReverseIterator; + /** + * Construct and insert element with hint + * + * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in + * place using *args* as the arguments for the element's constructor. *hint* points to a location in the + * container suggested as a hint on where to start the search for its insertion point (the container may or + * may not use this suggestion to optimize the insertion operation). + * + * A similar member function exists, {@link insert}, which either copies or moves an existing object into + * the container, and may also take a position *hint*. + * + * @param hint Hint for the position where the element can be inserted. + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + emplace_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * Construct and insert element with hint + * + * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in + * place using *args* as the arguments for the element's constructor. *hint* points to a location in the + * container suggested as a hint on where to start the search for its insertion point (the container may or + * may not use this suggestion to optimize the insertion operation). + * + * A similar member function exists, {@link insert}, which either copies or moves an existing object into + * the container, and may also take a position *hint*. + * + * @param hint Hint for the position where the element can be inserted. + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An {@link MapIterator iterator} pointing to either the newly inserted element or to the element + * that already had an equivalent key in the {@link MapContainer}. + */ + emplace_hint(hint: MapReverseIterator, pair: Pair): MapReverseIterator; + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting a new element, effectively increasing the container {@link size} + * by the number of element inserted (zero or one).

    + * + * @param hint Hint for the position where the element can be inserted. + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + insert(hint: MapIterator, pair: Pair): MapIterator; + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting a new element, effectively increasing the container {@link size} + * by the number of element inserted (zero or one).

    + * + * @param hint Hint for the position where the element can be inserted. + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} + * by the number of elements inserted.

    + * + * @param hint Hint for the position where the element can be inserted. + * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + insert(hint: MapIterator, tuple: [L, U]): MapIterator; + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} + * by the number of elements inserted.

    + * + * @param hint Hint for the position where the element can be inserted. + * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; + /** + *

    Insert elements from range iterators.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted.

    + * + * @param begin Input iterator specifying initial position of a range of elements. + * @param end Input iterator specifying final position of a range of elements. + * Notice that the range includes all the elements between begin and end, + * including the element pointed by begin but not the one pointed by end. + */ + insert>>(first: InputIterator, last: InputIterator): void; + /** + * @hidden + */ + protected abstract _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + private insert_by_tuple(tuple); + /** + * @hidden + */ + protected abstract _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + private insert_by_hint_with_tuple(hint, tuple); + /** + * @hidden + */ + protected abstract _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + *

    Erase an elemet by key.

    + * + *

    Removes from the {@link MapContainer map container} a single element.

    + * + *

    This effectively reduces the container {@link size} by the number of element removed (zero or one), + * which are destroyed.

    + * + * @param key Key of the element to be removed from the {@link MapContainer}. + */ + erase(key: Key): number; + /** + *

    Erase an elemet by iterator.

    + * + *

    Removes from the {@link MapContainer map container} a single element.

    + * + *

    This effectively reduces the container {@link size} by the number of element removed (zero or one), + * which are destroyed.

    + * + * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. + */ + erase(it: MapIterator): MapIterator; + /** + *

    Erase elements by range iterators.

    + * + *

    Removes from the {@link MapContainer map container} a range of elements.

    + * + *

    This effectively reduces the container {@link size} by the number of elements removed, which are + * destroyed.

    + * + * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} + * to be removed. + * @param end An iterator specifying initial position of a range within {@link MApContainer map container} + * to be removed. + * Notice that the range includes all the elements between begin and end, + * including the element pointed by begin but not the one pointed by end. + */ + erase(begin: MapIterator, end: MapIterator): MapIterator; + /** + *

    Erase an elemet by iterator.

    + * + *

    Removes from the {@link MapContainer map container} a single element.

    + * + *

    This effectively reduces the container {@link size} by the number of element removed (zero or one), + * which are destroyed.

    + * + * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. + */ + erase(it: MapReverseIterator): MapReverseIterator; + /** + *

    Erase elements by range iterators.

    + * + *

    Removes from the {@link MapContainer map container} a range of elements.

    + * + *

    This effectively reduces the container {@link size} by the number of elements removed, which are + * destroyed.

    + * + * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} + * to be removed. + * @param end An iterator specifying initial position of a range within {@link MApContainer map container} + * to be removed. + * Notice that the range includes all the elements between begin and end, + * including the element pointed by begin but not the one pointed by end. + */ + erase(begin: MapReverseIterator, end: MapReverseIterator): MapReverseIterator; + /** + * @hidden + */ + private erase_by_key(key); + /** + * @hidden + */ + private erase_by_iterator(first, last?); + /** + * @hidden + */ + private erase_by_range(begin, end); + /** + *

    Abstract method handling insertions for indexing.

    + * + *

    This method, {@link _Handle_insert} is designed to register the first to last to somewhere storing + * those {@link MapIterator iterators} for indexing, fast accessment and retrievalance.

    + * + *

    When {@link insert} is called, new elements will be inserted into the {@link data_ list container} and new + * {@link MapIterator iterators} first to last, pointing the inserted elements, will be created and the + * newly created iterators first to last will be shifted into this method {@link _Handle_insert} after the + * insertions.

    + * + *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators} + * will be registered into the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the + * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be + * registered into the {@link HashSet.hash_buckets_ hash bucket}.

    + * + * @param first An {@link MapIterator} to the initial position in a sequence. + * @param last An {@link MapIterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + */ + protected abstract _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + *

    Abstract method handling deletions for indexing.

    + * + *

    This method, {@link _Handle_erase} is designed to unregister the first to last to somewhere storing + * those {@link MapIterator iterators} for indexing, fast accessment and retrievalance.

    + * + *

    When {@link erase} is called with first to last, {@link MapIterator iterators} positioning somewhere + * place to be deleted, is memorized and shifted to this method {@link _Handle_erase} after the deletion process is + * terminated.

    + * + *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators} + * will be unregistered from the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the + * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be + * unregistered from the {@link HashSet.hash_buckets_ hash bucket}.

    + * + * @param first An {@link MapIterator} to the initial position in a sequence. + * @param last An {@link MapIterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + */ + protected abstract _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + * @hidden + */ + protected _Swap(obj: MapContainer): void; + } +} +declare namespace std { + /** + *

    An iterator of {@link MapContainer map container}.

    + * + *

    + *

    + * + * @author Jeongho Nam + */ + class MapIterator extends Iterator> implements IComparable> { + /** + * A {@link ListIterator} pointing {@link Pair} of key and value. + */ + private list_iterator_; + /** + * Construct from the {@link MapContainer source map} and {@link ListIterator list iterator}. + * + * @param source The source {@link MapContainer}. + * @param list_iterator A {@link ListIterator} pointing {@link Pair} of key and value. + */ + constructor(source: base.MapContainer, list_iterator: ListIterator>); + /** + * Get iterator to previous element. + */ + prev(): MapIterator; + /** + * Get iterator to next element. + */ + next(): MapIterator; + /** + * Advances the Iterator by n element positions. + * + * @param step Number of element positions to advance. + * @return An advanced Iterator. + */ + advance(step: number): MapIterator; + /** + * @hidden + */ + private map; + /** + * Get ListIterator. + */ + get_list_iterator(): ListIterator>; + /** + * @inheritdoc + */ + value: Pair; + /** + * Get first, key element. + */ + first: Key; + /** + * Get second, value element. + */ + /** + * Set second value. + */ + second: T; + /** + *

    Whether an iterator is equal with the iterator.

    + * + *

    Compare two iterators and returns whether they are equal or not.

    + * + * @param obj An iterator to compare + * @return Indicates whether equal or not. + */ + equal_to(obj: MapIterator): boolean; + less(obj: MapIterator): boolean; + hash(): number; + swap(obj: MapIterator): void; + } + /** + *

    A reverse-iterator of {@link MapContainer map container}.

    + * + *

    + *

    + * + * @author Jeongho Nam + */ + class MapReverseIterator extends ReverseIterator, MapIterator, MapReverseIterator> { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: MapIterator); + /** + * @hidden + */ + protected create_neighbor(base: MapIterator): MapReverseIterator; + /** + * Get first, key element. + */ + first: Key; + /** + * Get second, value element. + */ + /** + * Set second value. + */ + second: T; + } +} +declare namespace std.base { + /** + *

    An abstract unique-map.

    + * + *

    {@link UniqueMap UniqueMaps} are associative containers that store elements formed by a combination of a + * key value (Key) and a mapped value (T), and which allows for fast retrieval of + * individual elements based on their keys.

    + * + *

    In a {@link MapContainer}, the key values are generally used to uniquely identify the elements, + * while the mapped values store the content associated to this key. The types of key and + * mapped value may differ, and are grouped together in member type value_type, which is a + * {@link Pair} type combining both:

    + * + *

    typedef pair value_type;

    + * + *

    {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute position + * in the container. + *
    + * + *
    Map
    + *
    + * Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value. + *
    + * + *
    Unique keys
    + *
    No two elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the keys. Each element in a map is uniquely identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @author Jeongho Nam + */ + abstract class UniqueMap extends MapContainer { + /** + * @inheritdoc + */ + count(key: Key): number; + /** + *

    Get an element

    + * + *

    Returns a reference to the mapped value of the element identified with key.

    + * + * @param key Key value of the element whose mapped value is accessed. + * + * @throw exception out of range + * + * @return A reference object of the mapped value (_Ty) + */ + get(key: Key): T; + /** + *

    Set an item as the specified identifier.

    + * + *

    If the identifier is already in map, change value of the identifier. If not, then insert the object + * with the identifier.

    + * + * @param key Key value of the element whose mapped value is accessed. + * @param val Value, the item. + */ + set(key: Key, val: T): void; + /** + *

    Extract an element.

    + * + *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    + * + * @param key Key value of the element whose mapped value is accessed. + * + * @return A {@link Pair} containing the value pointed to by key. + */ + extract(key: Key): Pair; + /** + *

    Extract an element.

    + * + *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    + * + * @param it An iterator pointing an element to extract. + * + * @return An iterator pointing to the element immediately following it prior to the element being + * erased. If no such element exists,returns {@link end end()}. + */ + extract(it: MapIterator): MapIterator; + /** + *

    Extract an element.

    + * + *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    + * + * @param it An iterator pointing an element to extract. + * + * @return An iterator pointing to the element immediately following it prior to the element being + * erased. If no such element exists,returns {@link end end()}. + */ + extract(it: MapReverseIterator): MapReverseIterator; + /** + * @hidden + */ + private extract_by_key(key); + /** + * @hidden + */ + private extract_by_iterator(it); + /** + * @hidden + */ + private extract_by_reverse_iterator(it); + /** + * Construct and insert element. + * + * Inserts a new element in the {@link UniqueMap} if its *key* is unique. This new element is constructed in + * place using args as the arguments for the construction of a *value_type* (which is an object of a + * {@link Pair} type). + * + * The insertion only takes place if no other element in the container has a *key equivalent* to the one + * being emplaced (*keys* in a {@link UniqueMap} container are unique). + * + * If inserted, this effectively increases the container {@link size} by one. + * + * A similar member function exists, {@link insert}, which either copies or moves existing objects into the + * container. + * + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return If the function successfully inserts the element (because no equivalent element existed already in + * the {@link UniqueMap}), the function returns a {@link Pair} of an {@link MapIterator iterator} to + * the newly inserted element and a value of true. Otherwise, it returns an + * {@link MapIterator iterator} to the equivalent element within the container and a value of false. + */ + emplace(key: Key, value: T): Pair, boolean>; + /** + * Construct and insert element. + * + * Inserts a new element in the {@link UniqueMap} if its *key* is unique. This new element is constructed in + * place using args as the arguments for the construction of a *value_type* (which is an object of a + * {@link Pair} type). + * + * The insertion only takes place if no other element in the container has a *key equivalent* to the one + * being emplaced (*keys* in a {@link UniqueMap} container are unique). + * + * If inserted, this effectively increases the container {@link size} by one. + * + * A similar member function exists, {@link insert}, which either copies or moves existing objects into the + * container. + * + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return If the function successfully inserts the element (because no equivalent element existed already in + * the {@link UniqueMap}), the function returns a {@link Pair} of an {@link MapIterator iterator} to + * the newly inserted element and a value of true. Otherwise, it returns an + * {@link MapIterator iterator} to the equivalent element within the container and a value of false. + */ + emplace(pair: Pair): Pair, boolean>; + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by + * one.

    + * + *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is not inserted, returning an iterator to this existing element (if the function + * returns a value).

    + * + *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    + * + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly + * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The + * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or + * false if an equivalent key already existed. + */ + insert(pair: Pair): Pair, boolean>; + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting a new element, effectively increasing the container size by the + * number of elements inserted.

    + * + *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is not inserted, returning an iterator to this existing element (if the function + * returns a value).

    + * + *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    + * + * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. + * + * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly + * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The + * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or + * false if an equivalent key already existed. + */ + insert(tuple: [L, U]): Pair, boolean>; + /** + * @inheritdoc + */ + insert(hint: MapIterator, pair: Pair): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; + /** + * @inheritdoc + */ + insert(hint: MapIterator, tuple: [L, U]): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; + /** + * @inheritdoc + */ + insert>>(first: InputIterator, last: InputIterator): void; + /** + *

    Insert or assign an element.

    + * + *

    Inserts an element or assigns to the current element if the key already exists.

    + * + *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is assigned, returning an iterator to this existing element (if the function returns a + * value).

    + * + *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    + * + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly + * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The + * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or + * false if an equivalent key already existed so the value is assigned. + */ + insert_or_assign(key: Key, value: T): Pair, boolean>; + /** + *

    Insert or assign an element.

    + * + *

    Inserts an element or assigns to the current element if the key already exists.

    + * + *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is assigned, returning an iterator to this existing element (if the function returns a + * value).

    + * + *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    + * + * @param hint Hint for the position where the element can be inserted. + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link UniqueMap}. + */ + insert_or_assign(hint: MapIterator, key: Key, value: T): MapIterator; + /** + *

    Insert or assign an element.

    + * + *

    Inserts an element or assigns to the current element if the key already exists.

    + * + *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is assigned, returning an iterator to this existing element (if the function returns a + * value).

    + * + *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    + * + * @param hint Hint for the position where the element can be inserted. + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link UniqueMap}. + */ + insert_or_assign(hint: MapReverseIterator, key: Key, value: T): MapReverseIterator; + /** + * @hidden + */ + private insert_or_assign_with_key_value(key, value); + /** + * @hidden + */ + private insert_or_assign_with_hint(hint, key, value); + } +} +declare namespace std.base { + /** + *

    An abstract multi-map.

    + * + *

    {@link MultiMap MultiMaps} are associative containers that store elements formed by a combination of a + * key value (Key) and a mapped value (T), and which allows for fast retrieval of + * individual elements based on their keys.

    + * + *

    In a {@link MapContainer}, the key values are generally used to identify the elements, while the + * mapped values store the content associated to this key. The types of key and + * mapped value may differ, and are grouped together in member type value_type, which is a + * {@link Pair} type combining both:

    + * + *

    typedef pair value_type;

    + * + *

    {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute position + * in the container. + *
    + * + *
    Map
    + *
    + * Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value. + *
    + * + *
    Multiple equivalent keys
    + *
    Multiple elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the keys. Each element in a map is identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @author Jeongho Nam + */ + abstract class MultiMap extends MapContainer { + /** + * Construct and insert element. + * + * Inserts a new element in the {@link MultiMap}. This new element is constructed in place using args + * as the arguments for the element's constructor. + * + * This effectively increases the container {@link size} by one. + * + * A similar member function exists, {@link insert}, which either copies or moves existing objects into the + * container. + * + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An {@link MapIterator iterator} to the newly inserted element. + */ + emplace(key: Key, value: T): MapIterator; + /** + * Construct and insert element. + * + * Inserts a new element in the {@link MultiMap}. This new element is constructed in place using args + * as the arguments for the element's constructor. + * + * This effectively increases the container {@link size} by one. + * + * A similar member function exists, {@link insert}, which either copies or moves existing objects into the + * container. + * + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * @return An {@link MapIterator iterator} to the newly inserted element. + */ + emplace(pair: Pair): MapIterator; + /** + *

    Insert elements.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted.

    + * + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An iterator pointing to the newly inserted element. + */ + insert(pair: Pair): MapIterator; + /** + *

    Insert elements.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted.

    + * + * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. + * + * @return An iterator pointing to the newly inserted element. + */ + insert(tuple: [L, U]): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapIterator, pair: Pair): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; + /** + * @inheritdoc + */ + insert(hint: MapIterator, tuple: [L, U]): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; + /** + * @inheritdoc + */ + insert>>(first: InputIterator, last: InputIterator): void; + } +} +declare namespace std.HashMap { + type iterator = std.MapIterator; + type reverse_iterator = std.MapReverseIterator; +} +declare namespace std { + /** + *

    Hashed, unordered map.

    + * + *

    {@link HashMap}s are associative containers that store elements formed by the combination of a key value + * and a mapped value, and which allows for fast retrieval of individual elements based on their keys. + *

    + * + *

    In an {@link HashMap}, the key value is generally used to uniquely identify the element, while the + * mapped value is an object with the content associated to this key. Types of key and + * mapped value may differ.

    + * + *

    Internally, the elements in the {@link HashMap} are not sorted in any particular order with respect to either + * their key or mapped values, but organized into buckets depending on their hash values to allow + * for fast access to individual elements directly by their key values (with a constant average time complexity + * on average).

    + * + *

    {@link HashMap} containers are faster than {@link TreeMap} containers to access individual elements by their + * key, although they are generally less efficient for range iteration through a subset of their elements.

    + * + *

    + * + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
    + * + *
    Hashed
    + *
    Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
    + * + *
    Map
    + *
    Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value.
    + * + *
    Unique keys
    + *
    No two elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the key values. + * Each element in an {@link HashMap} is uniquely identified by its key value. + * @param Type of the mapped value. + * Each element in an {@link HashMap} is used to store some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/unordered_map/unordered_map + * @author Jeongho Nam + */ + class HashMap extends base.UniqueMap implements base.IHashMap { + /** + * @hidden + */ + private hash_buckets_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from elements. + */ + constructor(items: Pair[]); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: [Key, T][]); + /** + * Copy Constructor. + */ + constructor(container: HashMap); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator>, end: Iterator>); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: Key): MapIterator; + /** + * @inheritdoc + */ + begin(): MapIterator; + /** + * @inheritdoc + */ + begin(index: number): MapIterator; + /** + * @inheritdoc + */ + end(): MapIterator; + /** + * @inheritdoc + */ + end(index: number): MapIterator; + /** + * @inheritdoc + */ + rbegin(): MapReverseIterator; + /** + * @inheritdoc + */ + rbegin(index: number): MapReverseIterator; + /** + * @inheritdoc + */ + rend(): MapReverseIterator; + /** + * @inheritdoc + */ + rend(index: number): MapReverseIterator; + /** + * @inheritdoc + */ + bucket_count(): number; + /** + * @inheritdoc + */ + bucket_size(index: number): number; + /** + * @inheritdoc + */ + max_load_factor(): number; + /** + * @inheritdoc + */ + max_load_factor(z: number): void; + /** + * @inheritdoc + */ + bucket(key: Key): number; + /** + * @inheritdoc + */ + reserve(n: number): void; + /** + * @inheritdoc + */ + rehash(n: number): void; + /** + * @hidden + */ + protected _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link HashMap map} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link HashMap map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashMap container}. + */ + swap(obj: HashMap): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer>): void; + } +} +declare namespace std.HashMultiMap { + type iterator = std.MapIterator; + type reverse_iterator = std.MapReverseIterator; +} +declare namespace std { + /** + *

    Hashed, unordered Multimap.

    + * + *

    {@link HashMultiMap}s are associative containers that store elements formed by the combination of + * a key value and a mapped value, much like {@link HashMultiMap} containers, but allowing + * different elements to have equivalent keys.

    + * + *

    In an {@link HashMultiMap}, the key value is generally used to uniquely identify the + * element, while the mapped value is an object with the content associated to this key. + * Types of key and mapped value may differ.

    + * + *

    Internally, the elements in the {@link HashMultiMap} are not sorted in any particular order with + * respect to either their key or mapped values, but organized into buckets depending on + * their hash values to allow for fast access to individual elements directly by their key values + * (with a constant average time complexity on average).

    + * + *

    Elements with equivalent keys are grouped together in the same bucket and in such a way that + * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

    + * + *

    + * + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
    + * + *
    Hashed
    + *
    Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
    + * + *
    Map
    + *
    Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value.
    + * + *
    Multiple equivalent keys
    + *
    The container can hold multiple elements with equivalent keys.
    + *
    + * + * @param Type of the key values. + * Each element in an {@link HashMultiMap} is identified by a key value. + * @param Type of the mapped value. + * Each element in an {@link HashMultiMap} is used to store some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/unordered_map/unordered_multimap + * @author Jeongho Nam + */ + class HashMultiMap extends base.MultiMap { + /** + * @hidden + */ + private hash_buckets_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from elements. + */ + constructor(items: Pair[]); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: [Key, T][]); + /** + * Copy Constructor. + */ + constructor(container: HashMultiMap); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator>, end: Iterator>); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: Key): MapIterator; + /** + * @inheritdoc + */ + count(key: Key): number; + /** + * @inheritdoc + */ + begin(): MapIterator; + /** + * @inheritdoc + */ + begin(index: number): MapIterator; + /** + * @inheritdoc + */ + end(): MapIterator; + /** + * @inheritdoc + */ + end(index: number): MapIterator; + /** + * @inheritdoc + */ + rbegin(): MapReverseIterator; + /** + * @inheritdoc + */ + rbegin(index: number): MapReverseIterator; + /** + * @inheritdoc + */ + rend(): MapReverseIterator; + /** + * @inheritdoc + */ + rend(index: number): MapReverseIterator; + /** + * @inheritdoc + */ + bucket_count(): number; + /** + * @inheritdoc + */ + bucket_size(n: number): number; + /** + * @inheritdoc + */ + max_load_factor(): number; + /** + * @inheritdoc + */ + max_load_factor(z: number): void; + /** + * @inheritdoc + */ + bucket(key: Key): number; + /** + * @inheritdoc + */ + reserve(n: number): void; + /** + * @inheritdoc + */ + rehash(n: number): void; + /** + * @hidden + */ + protected _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link HashMultiMap map} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link HashMultiMap map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashMultiMap container}. + */ + swap(obj: HashMultiMap): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer>): void; + } +} +declare namespace std.base { + /** + *

    An abstract set.

    + * + *

    {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of + * individual elements based on their value.

    + * + *

    In an {@link SetContainer}, the value of an element is at the same time its key, used to + * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be + * modified once in the container - they can be inserted and removed, though.

    + * + *

    {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + *
    + * + * @param Type of the elements. Each element in a {@link SetContainer} container is also identified + * by this value (each value is itself also the element's key). + * + * @author Jeongho Nam + */ + abstract class SetContainer extends Container { + /** + *

    {@link List} storing elements.

    + * + *

    Storing elements and keeping those sequence of the {@link SetContainer} are implemented by + * {@link data_ this list container}. Implementing index-table is also related with {@link data_ this list} + * by storing {@link ListIterator iterators} ({@link SetIterator} references {@link ListIterator}) who are + * created from {@link data_ here}.

    + */ + private data_; + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + assign>(begin: Iterator, end: Iterator): void; + /** + * @inheritdoc + */ + clear(): void; + /** + *

    Get iterator to element.

    + * + *

    Searches the container for an element with key as value and returns an iterator to it if found, + * otherwise it returns an iterator to {@link end end()} (the element past the end of the container).

    + * + *

    Another member function, {@link count count()}, can be used to just check whether a particular element + * exists.

    + * + * @param key Key to be searched for. + * + * @return An iterator to the element, if the specified value is found, or {@link end end()} if it is not + * found in the + */ + abstract find(val: T): SetIterator; + /** + * @inheritdoc + */ + begin(): SetIterator; + /** + * @inheritdoc + */ + end(): SetIterator; + /** + * @inheritdoc + */ + rbegin(): SetReverseIterator; + /** + * @inheritdoc + */ + rend(): SetReverseIterator; + /** + *

    Whether have the item or not.

    + * + *

    Indicates whether a set has an item having the specified identifier.

    + * + * @param key Key value of the element whose mapped value is accessed. + * + * @return Whether the set has an item having the specified identifier. + */ + has(val: T): boolean; + /** + *

    Count elements with a specific key.

    + * + *

    Searches the container for elements with a value of k and returns the number of elements found.

    + * + * @param key Value of the elements to be counted. + * + * @return The number of elements in the container with a key. + */ + abstract count(val: T): number; + /** + * @inheritdoc + */ + size(): number; + /** + * @inheritdoc + */ + push(...args: U[]): number; + /** + *

    Insert an element with hint.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container size by the + * number of elements inserted.

    + * + * @param hint Hint for the position where the element can be inserted. + * @param val Value to be inserted as an element. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had its + * same value in the {@link SetContainer}. + */ + insert(hint: SetIterator, val: T): SetIterator; + /** + *

    Insert an element with hint.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container size by the + * number of elements inserted.

    + * + * @param hint Hint for the position where the element can be inserted. + * @param val Value to be inserted as an element. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had its + * same value in the {@link SetContainer}. + */ + insert(hint: SetReverseIterator, val: T): SetReverseIterator; + /** + *

    Insert elements with a range of a

    + * + *

    Extends the container by inserting new elements, effectively increasing the container size by the + * number of elements inserted.

    + * + * @param begin An iterator specifying range of the begining element. + * @param end An iterator specifying range of the ending element. + */ + insert>(begin: InputIterator, end: InputIterator): void; + /** + * @hidden + */ + protected abstract _Insert_by_val(val: T): any; + /** + * @hidden + */ + protected abstract _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected abstract _Insert_by_range>(begin: InputIterator, end: InputIterator): void; + /** + *

    Erase an element.

    + *

    Removes from the set container the elements whose value is key.

    + * + *

    This effectively reduces the container size by the number of elements removed.

    + * + * @param key Value of the elements to be erased. + * + * @return Number of elements erased. + */ + erase(val: T): number; + /** + * @inheritdoc + */ + erase(it: SetIterator): SetIterator; + /** + *

    Erase elements.

    + *

    Removes from the set container a range of elements..

    + * + *

    This effectively reduces the container size by the number of elements removed.

    + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + */ + erase(begin: SetIterator, end: SetIterator): SetIterator; + /** + * @inheritdoc + */ + erase(it: SetReverseIterator): SetReverseIterator; + /** + *

    Erase elements.

    + *

    Removes from the set container a range of elements..

    + * + *

    This effectively reduces the container size by the number of elements removed.

    + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + */ + erase(begin: SetReverseIterator, end: SetReverseIterator): SetReverseIterator; + /** + * @hidden + */ + private erase_by_iterator(first, last?); + /** + * @hidden + */ + private erase_by_val(val); + /** + * @hidden + */ + private erase_by_range(begin, end); + /** + *

    Abstract method handling insertions for indexing.

    + * + *

    This method, {@link _Handle_insert} is designed to register the first to last to somewhere storing + * those {@link SetIterator iterators} for indexing, fast accessment and retrievalance.

    + * + *

    When {@link insert} is called, new elements will be inserted into the {@link data_ list container} and new + * {@link SetIterator iterators} first to last, pointing the inserted elements, will be created and the + * newly created iterators first to last will be shifted into this method {@link _Handle_insert} after the + * insertions.

    + * + *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link SetIterator iterators} + * will be registered into the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the + * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be + * registered into the {@link HashSet.hash_buckets_ hash bucket}.

    + * + * @param first An {@link SetIterator} to the initial position in a sequence. + * @param last An {@link SetIterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + */ + protected abstract _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + *

    Abstract method handling deletions for indexing.

    + * + *

    This method, {@link _Handle_erase} is designed to unregister the first to last to somewhere storing + * those {@link SetIterator iterators} for indexing, fast accessment and retrievalance.

    + * + *

    When {@link erase} is called with first to last, {@link SetIterator iterators} positioning somewhere + * place to be deleted, is memorized and shifted to this method {@link _Handle_erase} after the deletion process is + * terminated.

    + * + *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link SetIterator iterators} + * will be unregistered from the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the + * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be + * unregistered from the {@link HashSet.hash_buckets_ hash bucket}.

    + * + * @param first An {@link SetIterator} to the initial position in a sequence. + * @param last An {@link SetIterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + */ + protected abstract _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + * @hidden + */ + protected _Swap(obj: SetContainer): void; + } +} +declare namespace std { + /** + *

    An iterator of a Set.

    + * + *

    + *

    + * + * @author Jeongho Nam + */ + class SetIterator extends Iterator implements IComparable> { + private list_iterator_; + /** + *

    Construct from source and index number.

    + * + *

    Note

    + *

    Do not create iterator directly.

    + *

    Use begin(), find() or end() in Map instead.

    + * + * @param map The source Set to reference. + * @param index Sequence number of the element in the source Set. + */ + constructor(source: base.SetContainer, it: ListIterator); + /** + * @inheritdoc + */ + prev(): SetIterator; + /** + * @inheritdoc + */ + next(): SetIterator; + /** + * @inheritdoc + */ + advance(size: number): SetIterator; + /** + * @hidden + */ + private set; + get_list_iterator(): ListIterator; + /** + * @inheritdoc + */ + value: T; + /** + * @inheritdoc + */ + equal_to(obj: SetIterator): boolean; + /** + * @inheritdoc + */ + less(obj: SetIterator): boolean; + /** + * @inheritdoc + */ + hash(): number; + /** + * @inheritdoc + */ + swap(obj: SetIterator): void; + } + /** + *

    A reverse-iterator of Set.

    + * + *

    + *

    + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class SetReverseIterator extends ReverseIterator, SetReverseIterator> { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: SetIterator); + /** + * @hidden + */ + protected create_neighbor(base: SetIterator): SetReverseIterator; + } +} +declare namespace std.base { + /** + *

    An abstract set.

    + * + *

    {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of + * individual elements based on their value.

    + * + *

    In an {@link SetContainer}, the value of an element is at the same time its key, used to + * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be + * modified once in the container - they can be inserted and removed, though.

    + * + *

    {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + * + *
    Multiple equivalent keys
    + *
    Multiple elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the elements. Each element in a {@link SetContainer} container is also identified + * by this value (each value is itself also the element's key). + * + * @author Jeongho Nam + */ + abstract class MultiSet extends SetContainer { + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted.

    + * + * @param key Value to be inserted as an element. + * + * @return An iterator to the newly inserted element. + */ + insert(val: T): SetIterator; + /** + * @inheritdoc + */ + insert(hint: SetIterator, val: T): SetIterator; + /** + * @inheritdoc + */ + insert(hint: SetReverseIterator, val: T): SetReverseIterator; + /** + * @inheritdoc + */ + insert>(begin: InputIterator, end: InputIterator): void; + } +} +declare namespace std.HashMultiSet { + type iterator = std.SetIterator; + type reverse_iterator = std.SetReverseIterator; +} +declare namespace std { + /** + *

    Hashed, unordered Multiset.

    + * + *

    {@link HashMultiSet HashMultiSets} are containers that store elements in no particular order, allowing fast + * retrieval of individual elements based on their value, much like {@link HashMultiSet} containers, + * but allowing different elements to have equivalent values.

    + * + *

    In an {@link HashMultiSet}, the value of an element is at the same time its key, used to + * identify it. Keys are immutable, therefore, the elements in an {@link HashMultiSet} cannot be + * modified once in the container - they can be inserted and removed, though.

    + * + *

    Internally, the elements in the {@link HashMultiSet} are not sorted in any particular, but + * organized into buckets depending on their hash values to allow for fast access to individual + * elements directly by their values (with a constant average time complexity on average).

    + * + *

    Elements with equivalent values are grouped together in the same bucket and in such a way that an + * iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
    + * + *
    Hashed
    + *
    Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + * + *
    Multiple equivalent keys
    + *
    The container can hold multiple elements with equivalent keys.
    + *
    + * + * @param Type of the elements. + * Each element in an {@link UnorderedMultiSet} is also identified by this value.. + * + * @reference http://www.cplusplus.com/reference/unordered_set/unordered_multiset + * @author Jeongho Nam + */ + class HashMultiSet extends base.MultiSet { + /** + * @hidden + */ + private hash_buckets_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from elements. + */ + constructor(items: T[]); + /** + * Copy Constructor. + */ + constructor(container: HashMultiSet); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: T): SetIterator; + /** + * @inheritdoc + */ + count(key: T): number; + /** + * @inheritdoc + */ + begin(): SetIterator; + /** + * @inheritdoc + */ + begin(index: number): SetIterator; + /** + * @inheritdoc + */ + end(): SetIterator; + /** + * @inheritdoc + */ + end(index: number): SetIterator; + /** + * @inheritdoc + */ + rbegin(): SetReverseIterator; + /** + * @inheritdoc + */ + rbegin(index: number): SetReverseIterator; + /** + * @inheritdoc + */ + rend(): SetReverseIterator; + /** + * @inheritdoc + */ + rend(index: number): SetReverseIterator; + /** + * @inheritdoc + */ + bucket_count(): number; + /** + * @inheritdoc + */ + bucket_size(n: number): number; + /** + * @inheritdoc + */ + max_load_factor(): number; + /** + * @inheritdoc + */ + max_load_factor(z: number): void; + /** + * @inheritdoc + */ + bucket(key: T): number; + /** + * @inheritdoc + */ + reserve(n: number): void; + /** + * @inheritdoc + */ + rehash(n: number): void; + /** + * @hidden + */ + protected _Insert_by_val(val: T): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link HashMultiSet set} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link HashMultiSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashMultiSet container}. + */ + swap(obj: HashMultiSet): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std.base { + /** + *

    An abstract set.

    + * + *

    {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of + * individual elements based on their value.

    + * + *

    In an {@link SetContainer}, the value of an element is at the same time its key, used to uniquely + * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be modified + * once in the container - they can be inserted and removed, though.

    + * + *

    {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + * + *
    Unique keys
    + *
    No two elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the elements. Each element in a {@link SetContainer} container is also identified + * by this value (each value is itself also the element's key). + * + * @author Jeongho Nam + */ + abstract class UniqueSet extends SetContainer { + /** + * @inheritdoc + */ + count(key: T): number; + /** + *

    Extract an element.

    + * + *

    Extracts the element pointed to by val and erases it from the {@link UniqueSet}.

    + * + * @param val Value to be extracted. + * + * @return A value. + */ + extract(val: T): T; + /** + *

    Extract an element.

    + * + *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    + * + * @param it An iterator pointing an element to extract. + * + * @return An iterator pointing to the element immediately following it prior to the element being + * erased. If no such element exists,returns {@link end end()}. + */ + extract(it: SetIterator): SetIterator; + /** + *

    Extract an element.

    + * + *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    + * + * @param it An iterator pointing an element to extract. + * + * @return An iterator pointing to the element immediately following it prior to the element being + * erased. If no such element exists,returns {@link end end()}. + */ + extract(it: SetReverseIterator): SetReverseIterator; + /** + * @hidden + */ + private extract_by_key(val); + /** + * @hidden + */ + private extract_by_iterator(it); + /** + * @hidden + */ + private extract_by_reverse_iterator(it); + /** + *

    Insert an element.

    + * + *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of element inserted (zero or one).

    + * + *

    Because elements in a {@link UniqueSet UniqueSets} are unique, the insertion operation checks whether + * each inserted element is equivalent to an element already in the container, and if so, the element is not + * inserted, returning an iterator to this existing element (if the function returns a value).

    + * + *

    For a similar container allowing for duplicate elements, see {@link MultiSet}.

    + * + * @param key Value to be inserted as an element. + * + * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly + * inserted element or to the equivalent element already in the {@link UniqueSet}. The + * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or + * false if an equivalent element already existed. + */ + insert(val: T): Pair, boolean>; + /** + * @inheritdoc + */ + insert(hint: SetIterator, val: T): SetIterator; + /** + * @inheritdoc + */ + insert(hint: SetReverseIterator, val: T): SetReverseIterator; + /** + * @inheritdoc + */ + insert>(begin: InputIterator, end: InputIterator): void; + } +} +declare namespace std.HashSet { + type iterator = std.SetIterator; + type reverse_iterator = std.SetReverseIterator; +} +declare namespace std { + /** + *

    Hashed, unordered set.

    + * + *

    {@link HashSet}s are containers that store unique elements in no particular order, and which + * allow for fast retrieval of individual elements based on their value.

    + * + *

    In an {@link HashSet}, the value of an element is at the same time its key, that + * identifies it uniquely. Keys are immutable, therefore, the elements in an {@link HashSet} cannot be + * modified once in the container - they can be inserted and removed, though.

    + * + *

    Internally, the elements in the {@link HashSet} are not sorted in any particular order, but + * organized into buckets depending on their hash values to allow for fast access to individual elements + * directly by their values (with a constant average time complexity on average).

    + * + *

    {@link HashSet} containers are faster than {@link TreeSet} containers to access individual + * elements by their key, although they are generally less efficient for range iteration through a + * subset of their elements.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
    + * + *
    Hashed
    + *
    Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + * + *
    Unique keys
    + *
    No two elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the elements. + * Each element in an {@link HashSet} is also uniquely identified by this value. + * + * @reference http://www.cplusplus.com/reference/unordered_set/unordered_set + * @author Jeongho Nam + */ + class HashSet extends base.UniqueSet implements base.IHashSet { + /** + * @hidden + */ + private hash_buckets_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from elements. + */ + constructor(items: T[]); + /** + * Copy Constructor. + */ + constructor(container: HashSet); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: T): SetIterator; + /** + * @inheritdoc + */ + begin(): SetIterator; + /** + * @inheritdoc + */ + begin(index: number): SetIterator; + /** + * @inheritdoc + */ + end(): SetIterator; + /** + * @inheritdoc + */ + end(index: number): SetIterator; + /** + * @inheritdoc + */ + rbegin(): SetReverseIterator; + /** + * @inheritdoc + */ + rbegin(index: number): SetReverseIterator; + /** + * @inheritdoc + */ + rend(): SetReverseIterator; + /** + * @inheritdoc + */ + rend(index: number): SetReverseIterator; + /** + * @inheritdoc + */ + bucket_count(): number; + /** + * @inheritdoc + */ + bucket_size(n: number): number; + /** + * @inheritdoc + */ + max_load_factor(): number; + /** + * @inheritdoc + */ + max_load_factor(z: number): void; + /** + * @inheritdoc + */ + bucket(key: T): number; + /** + * @inheritdoc + */ + reserve(n: number): void; + /** + * @inheritdoc + */ + rehash(n: number): void; + /** + * @hidden + */ + protected _Insert_by_val(val: T): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link HashSet set} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link HashSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashSet container}. + */ + swap(obj: HashSet): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std.List { + type iterator = std.ListIterator; + type reverse_iterator = std.ListReverseIterator; +} +declare namespace std { + /** + *

    Doubly linked list.

    + * + *

    {@link List}s are sequence containers that allow constant time insert and erase operations anywhere within the + * sequence, and iteration in both directions.

    + * + *

    List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements they + * contain in different and unrelated storage locations. The ordering is kept internally by the association to each + * element of a link to the element preceding it and a link to the element following it.

    + * + *

    They are very similar to forward_list: The main difference being that forward_list objects are single-linked + * lists, and thus they can only be iterated forwards, in exchange for being somewhat smaller and more efficient.

    + * + *

    Compared to other base standard sequence containers (array, vector and deque), lists perform generally better + * in inserting, extracting and moving elements in any position within the container for which an iterator has already + * been obtained, and therefore also in algorithms that make intensive use of these, like sorting algorithms.

    + * + *

    The main drawback of lists and forward_lists compared to these other sequence containers is that they lack + * direct access to the elements by their position; For example, to access the sixth element in a list, one has to + * iterate from a known position (like the beginning or the end) to that position, which takes linear time in the + * distance between these. They also consume some extra memory to keep the linking information associated to each + * element (which may be an important factor for large lists of small-sized elements).

    + * + *

    + * + *

    + * + *

    Container properties

    + *
    + *
    Sequence
    + *
    Elements in sequence containers are ordered in a strict linear sequence. Individual elements are accessed by + * their position in this sequence.
    + * + *
    Doubly-linked list
    + *
    Each element keeps information on how to locate the next and the previous elements, allowing constant time + * insert and erase operations before or after a specific element (even of entire ranges), but no direct random + * access.
    + *
    + * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/list/list/ + * @author Jeongho Nam + */ + class List extends base.Container implements base.IDequeContainer { + /** + * @hidden + */ + private begin_; + /** + * @hidden + */ + private end_; + /** + * @hidden + */ + private size_; + /** + *

    Default Constructor.

    + * + *

    Constructs an empty container, with no elements.

    + */ + constructor(); + /** + *

    Initializer list Constructor.

    + * + *

    Constructs a container with a copy of each of the elements in array, in the same order.

    + * + * @param array An array containing elements to be copied and contained. + */ + constructor(items: Array); + /** + *

    Fill Constructor.

    + * + *

    Constructs a container with n elements. Each element is a copy of val (if provided).

    + * + * @param n Initial container size (i.e., the number of elements in the container at construction). + * @param val Value to fill the container with. Each of the n elements in the container is + * initialized to a copy of this value. + */ + constructor(size: number, val: T); + /** + *

    Copy Constructor.

    + * + *

    Constructs a container with a copy of each of the elements in container, in the same order.

    + * + * @param container Another container object of the same type (with the same class template + * arguments T), whose contents are either copied or acquired. + */ + constructor(container: List); + /** + *

    Range Constructor.

    + * + *

    Constructs a container with as many elements as the range (begin, end), with each + * element emplace-constructed from its corresponding element in that range, in the same order.

    + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + assign(n: number, val: T): void; + /** + * @inheritdoc + */ + assign>(begin: InputIterator, end: InputIterator): void; + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + begin(): ListIterator; + /** + * @inheritdoc + */ + end(): ListIterator; + /** + * @inheritdoc + */ + rbegin(): ListReverseIterator; + /** + * @inheritdoc + */ + rend(): ListReverseIterator; + /** + * @inheritdoc + */ + size(): number; + /** + * @inheritdoc + */ + front(): T; + /** + * @inheritdoc + */ + back(): T; + /** + * @inheritdoc + */ + push(...items: U[]): number; + /** + * @inheritdoc + */ + push_front(val: T): void; + /** + * @inheritdoc + */ + push_back(val: T): void; + /** + * @inheritdoc + */ + pop_front(): void; + /** + * @inheritdoc + */ + pop_back(): void; + /** + *

    Insert an element.

    + * + *

    The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

    + * + *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Position in the container where the new element is inserted. + * {@link iterator}> is a member type, defined as a + * {@link ListIterator bidirectional iterator} type that points to elements. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the newly inserted element; val. + */ + insert(position: ListIterator, val: T): ListIterator; + /** + *

    Insert elements by repeated filling.

    + * + *

    The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

    + * + *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListIterator bidirectional iterator} type that points to + * elements. + * @param size Number of elements to insert. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: ListIterator, size: number, val: T): ListIterator; + /** + *

    Insert elements by range iterators.

    + * + *

    The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

    + * + *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListIterator bidirectional iterator} type that points to + * elements. + * @param begin An iterator specifying range of the begining element. + * @param end An iterator specifying range of the ending element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; + /** + *

    Insert an element.

    + * + *

    The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

    + * + *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Position in the container where the new element is inserted. + * {@link iterator}> is a member type, defined as a + * {@link ListReverseIterator bidirectional iterator} type that points to elements. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the newly inserted element; val. + */ + insert(position: ListReverseIterator, val: T): ListReverseIterator; + /** + *

    Insert elements by repeated filling.

    + * + *

    The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

    + * + *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to + * elements. + * @param size Number of elements to insert. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: ListReverseIterator, size: number, val: T): ListReverseIterator; + /** + *

    Insert elements by range iterators.

    + * + *

    The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted.

    + * + *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to + * elements. + * @param begin An iterator specifying range of the begining element. + * @param end An iterator specifying range of the ending element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: ListReverseIterator, begin: InputIterator, end: InputIterator): ListReverseIterator; + /** + * @hidden + */ + private insert_by_val(position, val); + /** + * @hidden + */ + protected _Insert_by_repeating_val(position: ListIterator, size: number, val: T): ListIterator; + /** + * @hidden + */ + protected _Insert_by_range>(position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; + /** + *

    Erase an element.

    + * + *

    Removes from the {@link List} either a single element; position.

    + * + *

    This effectively reduces the container size by the number of element removed.

    + * + *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Iterator pointing to a single element to be removed from the {@link List}. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link end end()} if the operation erased the last element in the sequence. + */ + erase(position: ListIterator): ListIterator; + /** + *

    Erase elements.

    + * + *

    Removes from the {@link List} container a range of elements.

    + * + *

    This effectively reduces the container {@link size} by the number of elements removed.

    + * + *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link end end()} if the operation erased the last element in the sequence. + */ + erase(begin: ListIterator, end: ListIterator): ListIterator; + /** + *

    Erase an element.

    + * + *

    Removes from the {@link List} either a single element; position.

    + * + *

    This effectively reduces the container size by the number of element removed.

    + * + *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param position Iterator pointing to a single element to be removed from the {@link List}. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link rend rend()} if the operation erased the last element in the sequence. + */ + erase(position: ListReverseIterator): ListReverseIterator; + /** + *

    Erase elements.

    + * + *

    Removes from the {@link List} container a range of elements.

    + * + *

    This effectively reduces the container {@link size} by the number of elements removed.

    + * + *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence.

    + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link rend rend()} if the operation erased the last element in the sequence. + */ + erase(begin: ListReverseIterator, end: ListReverseIterator): ListReverseIterator; + /** + * @hidden + */ + protected _Erase_by_range(first: ListIterator, last: ListIterator): ListIterator; + /** + *

    Remove duplicate values.

    + * + *

    Removes all but the first element from every consecutive group of equal elements in the

    + * + *

    Notice that an element is only removed from the {@link List} container if it compares equal to the + * element immediately preceding it. Thus, this function is especially useful for sorted lists.

    + */ + unique(): void; + /** + *

    Remove duplicate values.

    + * + *

    Removes all but the first element from every consecutive group of equal elements in the

    + * + *

    The argument binary_pred is a specific comparison function that determine the uniqueness + * of an element. In fact, any behavior can be implemented (and not only an equality comparison), but notice + * that the function will call binary_pred(it.value, it.prev().value) for all pairs of elements + * (where it is an iterator to an element, starting from the second) and remove it + * from the {@link List} if the predicate returns true. + * + *

    Notice that an element is only removed from the {@link List} container if it compares equal to the + * element immediately preceding it. Thus, this function is especially useful for sorted lists.

    + * + * @param binary_pred Binary predicate that, taking two values of the same type than those contained in the + * {@link List}, returns true to remove the element passed as first argument + * from the container, and false otherwise. This shall be a function pointer + * or a function object. + */ + unique(binary_pred: (left: T, right: T) => boolean): void; + /** + *

    Remove elements with specific value.

    + * + *

    Removes from the container all the elements that compare equal to val. This calls the + * destructor of these objects and reduces the container {@link size} by the number of elements removed.

    + * + *

    Unlike member function {@link List.erase}, which erases elements by their position (using an + * iterator), this function ({@link List.remove}) removes elements by their value.

    + * + *

    A similar function, {@link List.remove_if}, exists, which allows for a condition other than an + * equality comparison to determine whether an element is removed.

    + * + * @param val Value of the elements to be removed. + */ + remove(val: T): void; + /** + *

    Remove elements fulfilling condition.

    + * + *

    Removes from the container all the elements for which pred returns true. This + * calls the destructor of these objects and reduces the container {@link size} by the number of elements + * removed.

    + * + *

    The function calls pred(it.value) for each element (where it is an iterator + * to that element). Any of the elements in the list for which this returns true, are removed + * from the

    + * + * @param pred Unary predicate that, taking a value of the same type as those contained in the forward_list + * object, returns true for those values to be removed from the container, and + * false for those remaining. This can either be a function pointer or a function + * object. + */ + remove_if(pred: (val: T) => boolean): void; + /** + *

    Merge sorted {@link List Lists}.

    + * + *

    Merges obj into the {@link List} by transferring all of its elements at their respective + * ordered positions into the container (both containers shall already be ordered). + *

    + * + *

    This effectively removes all the elements in obj (which becomes {@link empty}), and inserts + * them into their ordered position within container (which expands in {@link size} by the number of elements + * transferred). The operation is performed without constructing nor destroying any element: they are + * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports + * move-construction or not.

    + * + *

    This function requires that the {@link List} containers have their elements already ordered by value + * ({@link less}) before the call. For an alternative on unordered {@link List Lists}, see + * {@link List.splice}.

    + * + *

    Assuming such ordering, each element of obj is inserted at the position that corresponds to its + * value according to the strict weak ordering defined by {@link less}. The resulting order of equivalent + * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and + * existing elements precede those equivalent inserted from obj).

    + * + * The function does nothing if this == obj. + * + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + * Note that this function modifies obj no matter whether an lvalue or rvalue reference is + * passed. + */ + merge(obj: List): void; + /** + *

    Merge sorted {@link List Lists}.

    + * + *

    Merges obj into the {@link List} by transferring all of its elements at their respective + * ordered positions into the container (both containers shall already be ordered). + *

    + * + *

    This effectively removes all the elements in obj (which becomes {@link empty}), and inserts + * them into their ordered position within container (which expands in {@link size} by the number of elements + * transferred). The operation is performed without constructing nor destroying any element: they are + * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports + * move-construction or not.

    + * + *

    The argument compare is a specific predicate to perform the comparison operation between + * elements. This comparison shall produce a strict weak ordering of the elements (i.e., a consistent + * transitive comparison, without considering its reflexiveness). + * + *

    This function requires that the {@link List} containers have their elements already ordered by + * compare before the call. For an alternative on unordered {@link List Lists}, see + * {@link List.splice}.

    + * + *

    Assuming such ordering, each element of obj is inserted at the position that corresponds to its + * value according to the strict weak ordering defined by compare. The resulting order of equivalent + * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and + * existing elements precede those equivalent inserted from obj).

    + * + * The function does nothing if this == obj. + * + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + * Note that this function modifies obj no matter whether an lvalue or rvalue reference is + * passed. + * @param compare Binary predicate that, taking two values of the same type than those contained in the + * {@link list}, returns true if the first argument is considered to go before + * the second in the strict weak ordering it defines, and false otherwise. + * This shall be a function pointer or a function object. + */ + merge(obj: List, compare: (left: T, right: T) => boolean): void; + /** + *

    Transfer elements from {@link List} to {@link List}.

    + * + *

    Transfers elements from obj into the container, inserting them at position.

    + * + *

    This effectively inserts all elements into the container and removes them from obj, altering + * the sizes of both containers. The operation does not involve the construction or destruction of any + * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the + * value_type supports move-construction or not.

    + * + *

    This first version (1) transfers all the elements of obj into the

    + * + * @param position Position within the container where the elements of obj are inserted. + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + */ + splice(position: ListIterator, obj: List): void; + /** + *

    Transfer an element from {@link List} to {@link List}.

    + * + *

    Transfers an element from obj, which is pointed by an {@link ListIterator iterator} it, + * into the container, inserting the element at specified position.

    + * + *

    This effectively inserts an element into the container and removes it from obj, altering the + * sizes of both containers. The operation does not involve the construction or destruction of any element. + * They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type + * supports move-construction or not.

    + * + *

    This second version (2) transfers only the element pointed by it from obj into the + *

    + * + * @param position Position within the container where the element of obj is inserted. + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + * This parameter may be this if position points to an element not actually + * being spliced. + * @param it {@link ListIterator Iterator} to an element in obj. Only this single element is + * transferred. + */ + splice(position: ListIterator, obj: List, it: ListIterator): void; + /** + *

    Transfer elements from {@link List} to {@link List}.

    + * + *

    Transfers elements from obj into the container, inserting them at position.

    + * + *

    This effectively inserts those elements into the container and removes them from obj, altering + * the sizes of both containers. The operation does not involve the construction or destruction of any + * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the + * value_type supports move-construction or not.

    + * + *

    This third version (3) transfers the range [begin, end) from obj into the + *

    + * + * @param position Position within the container where the elements of obj are inserted. + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + * This parameter may be this if position points to an element not actually + * being spliced. + * @param begin {@link ListIterator An Iterator} specifying initial position of a range of elements in + * obj. Transfers the elements in the range [begin, end) to + * position. + * @param end {@link ListIterator An Iterator} specifying final position of a range of elements in + * obj. Transfers the elements in the range [begin, end) to + * position. Notice that the range includes all the elements between begin and + * end, including the element pointed by begin but not the one pointed by end. + */ + splice(position: ListIterator, obj: List, begin: ListIterator, end: ListIterator): void; + /** + *

    Sort elements in

    + * + *

    Sorts the elements in the {@link List}, altering their position within the

    + * + *

    The sorting is performed by applying an algorithm that uses {@link less}. This comparison shall + * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without + * considering its reflexiveness).

    + * + *

    The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative + * order they had before the call.

    + * + *

    The entire operation does not involve the construction, destruction or copy of any element object. + * Elements are moved within the

    + */ + sort(): void; + /** + *

    Sort elements in

    + * + *

    Sorts the elements in the {@link List}, altering their position within the

    + * + *

    The sorting is performed by applying an algorithm that uses compare. This comparison shall + * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without + * considering its reflexiveness).

    + * + *

    The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative + * order they had before the call.

    + * + *

    The entire operation does not involve the construction, destruction or copy of any element object. + * Elements are moved within the

    + * + * @param compare Binary predicate that, taking two values of the same type of those contained in the + * {@link List}, returns true if the first argument goes before the second + * argument in the strict weak ordering it defines, and false otherwise. This + * shall be a function pointer or a function object. + */ + sort(compare: (left: T, right: T) => boolean): void; + /** + * @hidden + */ + private qsort(first, last, compare); + /** + * @hidden + */ + private partition(first, last, compare); + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link List container} object with same type of elements. Sizes and container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link List container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link container List}. + */ + swap(obj: List): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std { + /** + *

    An iterator, node of a List.

    + * + *

    + * + *

    + * + * @author Jeongho Nam + */ + class ListIterator extends Iterator { + /** + * @hidden + */ + private prev_; + /** + * @hidden + */ + private next_; + /** + * @hidden + */ + private value_; + /** + *

    Construct from the source {@link List container}.

    + * + *

    Note

    + *

    Do not create the iterator directly, by yourself.

    + *

    Use {@link List.begin begin()}, {@link List.end end()} in {@link List container} instead.

    + * + * @param source The source {@link List container} to reference. + * @param prev A refenrece of previous node ({@link ListIterator iterator}). + * @param next A refenrece of next node ({@link ListIterator iterator}). + * @param value Value to be stored in the node (iterator). + */ + constructor(source: List, prev: ListIterator, next: ListIterator, value: T); + private list(); + /** + * @inheritdoc + */ + prev(): ListIterator; + /** + * @inheritdoc + */ + next(): ListIterator; + /** + * @inheritdoc + */ + advance(step: number): ListIterator; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + /** + * @inheritdoc + */ + equal_to(obj: ListIterator): boolean; + /** + * @inheritdoc + */ + swap(obj: ListIterator): void; + } +} +declare namespace std { + /** + *

    A reverse-iterator of List.

    + * + *

    + * + *

    + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class ListReverseIterator extends ReverseIterator, ListReverseIterator> { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: ListIterator); + /** + * @hidden + */ + protected create_neighbor(base: ListIterator): ListReverseIterator; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + } +} +declare namespace std { + /** + *

    Priority queue.

    + * + *

    {@link PriorityQueue Priority queues} are a type of container adaptors, specifically designed such that its + * first element is always the greatest of the elements it contains, according to some strict weak ordering + * criterion.

    + * + *

    This context is similar to a heap, where elements can be inserted at any moment, and only the + * max heap element can be retrieved (the one at the top in the {@link PriorityQueue priority queue}).

    + * + *

    {@link PriorityQueue Priority queues} are implemented as container adaptors, which are classes that + * use an encapsulated object of a specific container class as its {@link container_ underlying container}, + * providing a specific set of member functions to access its elements. Elements are popped from the "back" + * of the specific container, which is known as the top of the {@link PriorityQueue Priority queue}.

    + * + *

    The {@link container_ underlying container} may be any of the standard container class templates or some + * other specifically designed container class. The container shall be accessible through + * {@link IArrayIterator random access iterators} and support the following operations:

    + * + *
      + *
    • empty()
    • + *
    • size()
    • + *
    • front()
    • + *
    • push_back()
    • + *
    • pop_back()
    • + *
    + * + *

    The standard container classes {@link Vector} and {@link Deque} fulfill these requirements. By default, if + * no container class is specified for a particular {@link PriorityQueue} class instantiation, the standard + * container {@link Vector} is used.

    + * + *

    Support of {@link IArrayIterator random access iterators} is required to keep a heap structure internally + * at all times. This is done automatically by the container adaptor by automatically calling the algorithm + * functions make_heap, push_heap and pop_heap when needed.

    + * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/queue/priority_queue/ + * @author Jeongho Nam + */ + class PriorityQueue { + /** + *

    The underlying container for implementing the priority queue.

    + * + *

    Following standard definition from the C++ committee, the underlying container should be one of + * {@link Vector} or {@link Deque}, however, I've adopted {@link TreeMultiSet} instead of them. Of course, + * there are proper reasons for adapting the {@link TreeMultiSet} even violating standard advice.

    + * + *

    Underlying container of {@link PriorityQueue} must keep a condition; the highest (or lowest) + * element must be placed on the terminal node for fast retrieval and deletion. To keep the condition with + * {@link Vector} or {@link Deque}, lots of times will only be spent for re-arranging elements. It calls + * rearrangement functions like make_heap, push_heap and pop_head for rearrangement.

    + * + *

    However, the {@link TreeMultiSet} container always keeps arrangment automatically without additional + * operations and it even meets full criteria of {@link PriorityQueue}. Those are the reason why I've adopted + * {@link TreeMultiSet} as the underlying container of {@link PriorityQueue}.

    + */ + private container_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (left: T, right: T) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array); + /** + * Contruct from elements with compare. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array, compare: (left: T, right: T) => boolean); + /** + * Copy Constructor. + */ + constructor(container: base.IContainer); + /** + * Copy Constructor with compare. + * + * @param container A container to be copied. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: base.IContainer, compare: (left: T, right: T) => boolean); + /** + * Range Constructor. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * Range Constructor with compare. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator, end: Iterator, compare: (left: T, right: T) => boolean); + /** + *

    Return size.

    + * + *

    Returns the number of elements in the {@link PriorityQueue}.

    + * + *

    This member function effectively calls member {@link IArray.size size} of the + * {@link container_ underlying container} object.

    + * + * @return The number of elements in the underlying + */ + size(): number; + /** + *

    Test whether container is empty.

    + * + *

    Returns whether the {@link PriorityQueue} is empty: i.e. whether its {@link size} is zero.

    + * + *

    This member function effectively calls member {@link IARray.empty empty} of the + * {@link container_ underlying container} object.

    + */ + empty(): boolean; + /** + *

    Access top element.

    + * + *

    Returns a constant reference to the top element in the {@link PriorityQueue}.

    + * + *

    The top element is the element that compares higher in the {@link PriorityQueue}, and the next that is + * removed from the container when {@link PriorityQueue.pop} is called.

    + * + *

    This member function effectively calls member {@link IArray.front front} of the + * {@link container_ underlying container} object.

    + * + * @return A reference to the top element in the {@link PriorityQueue}. + */ + top(): T; + /** + *

    Insert element.

    + * + *

    Inserts a new element in the {@link PriorityQueue}. The content of this new element is initialized to + * val. + * + *

    This member function effectively calls the member function {@link IArray.push_back push_back} of the + * {@link container_ underlying container} object, and then reorders it to its location in the heap by calling + * the push_heap algorithm on the range that includes all the elements of the

    + * + * @param val Value to which the inserted element is initialized. + */ + push(val: T): void; + /** + *

    Remove top element.

    + * + *

    Removes the element on top of the {@link PriorityQueue}, effectively reducing its {@link size} by one. + * The element removed is the one with the highest (or lowest) value.

    + * + *

    The value of this element can be retrieved before being popped by calling member + * {@link PriorityQueue.top}.

    + * + *

    This member function effectively calls the pop_heap algorithm to keep the heap property of + * {@link PriorityQueue PriorityQueues} and then calls the member function {@link IArray.pop_back pop_back} of + * the {@link container_ underlying container} object to remove the element.

    + */ + pop(): void; + /** + *

    Swap contents.

    + * + *

    Exchanges the contents of the container adaptor by those of obj, swapping both the + * {@link container_ underlying container} value and their comparison function using the corresponding + * {@link std.swap swap} non-member functions (unqualified).

    + * + *

    This member function has a noexcept specifier that matches the combined noexcept of the + * {@link IArray.swap swap} operations on the {@link container_ underlying container} and the comparison + * functions.

    + * + * @param obj {@link PriorityQueue} container adaptor of the same type (i.e., instantiated with the same + * template parameters, T). Sizes may differ. + */ + swap(obj: PriorityQueue): void; + } +} +declare namespace std { + /** + *

    FIFO queue.

    + * + *

    {@link Queue}s are a type of container adaptor, specifically designed to operate in a FIFO context + * (first-in first-out), where elements are inserted into one end of the container and extracted from the other. + *

    + * + *

    {@link Queue}s are implemented as containers adaptors, which are classes that use an encapsulated object of + * a specific container class as its underlying container, providing a specific set of member functions to access + * its elements. Elements are pushed into the {@link IDeque.back back()} of the specific container and popped from + * its {@link IDeque.front front()}.

    + * + *

    {@link container_ The underlying container} may be one of the standard container class template or some + * other specifically designed container class. This underlying container shall support at least the following + * operations:

    + * + *
      + *
    • empty
    • + *
    • size
    • + *
    • front
    • + *
    • back
    • + *
    • push_back
    • + *
    • pop_front
    • + *
    + * + *

    The standard container classes {@link Deque} and {@link List} fulfill these requirements. + * By default, if no container class is specified for a particular {@link Queue} class instantiation, the standard + * container {@link List} is used.

    + * + *

    + * + *

    + * + * @param Type of elements. + * + * @reference http://www.cplusplus.com/reference/queue/queue + * @author Jeongho Nam + */ + class Queue { + /** + * The underlying object for implementing the FIFO + */ + private container_; + /** + * Default Constructor. + */ + constructor(); + /** + * Copy Constructor. + */ + constructor(container: Queue); + /** + *

    Return size.

    + *

    Returns the number of elements in the {@link Queue}.

    + * + *

    This member function effectively calls member {@link IDeque.size size()} of the + * {@link container_ underlying container} object.

    + * + * @return The number of elements in the {@link container_ underlying container}. + */ + size(): number; + /** + *

    Test whether container is empty.

    + *

    returns whether the {@link Queue} is empty: i.e. whether its size is zero.

    + * + *

    This member function efeectively calls member {@link IDeque.empty empty()} of the + * {@link container_ underlying container} object.

    + * + * @return true if the {@link container_ underlying container}'s size is 0, + * false otherwise.

    + */ + empty(): boolean; + /** + *

    Access next element.

    + *

    Returns a value of the next element in the {@link Queue}.

    + * + *

    The next element is the "oldest" element in the {@link Queue} and the same element that is popped out + * from the queue when {@link pop Queue.pop()} is called.

    + * + *

    This member function effectively calls member {@link IDeque.front front()} of the + * {@link container_ underlying container} object.

    + * + * @return A value of the next element in the {@link Queue}. + */ + front(): T; + /** + *

    Access last element.

    + * + *

    Returns a vaue of the last element in the queue. This is the "newest" element in the queue (i.e. the + * last element pushed into the queue).

    + * + *

    This member function effectively calls the member function {@link IDeque.back back()} of the + * {@link container_ underlying container} object.

    + * + * @return A value of the last element in the {@link Queue}. + */ + back(): T; + /** + *

    Insert element.

    + * + *

    Inserts a new element at the end of the {@link Queue}, after its current last element. + * The content of this new element is initialized to val.

    + * + *

    This member function effectively calls the member function {@link IDeque.push_back push_back()} of the + * {@link container_ underlying container} object.

    + * + * @param val Value to which the inserted element is initialized. + */ + push(val: T): void; + /** + *

    Remove next element.

    + * + *

    Removes the next element in the {@link Queue}, effectively reducing its size by one.

    + * + *

    The element removed is the "oldest" element in the {@link Queue} whose value can be retrieved by calling + * member {@link front Queue.front()}

    . + * + *

    This member function effectively calls the member function {@link IDeque.pop_front pop_front()} of the + * {@link container_ underlying container} object.

    + */ + pop(): void; + /** + *

    Swap contents.

    + * + *

    Exchanges the contents of the container adaptor (this) by those of obj.

    + * + *

    This member function calls the non-member function {@link IContainer.swap swap} (unqualified) to swap + * the {@link container_ underlying containers}.

    + * + * @param obj Another {@link Queue} container adaptor of the same type (i.e., instantiated with the same + * template parameter, T). Sizes may differ.

    + */ + swap(obj: Queue): void; + } +} +declare namespace std { + /** + *

    LIFO stack.

    + * + *

    {@link Stack}s are a type of container adaptor, specifically designed to operate in a LIFO context + * (last-in first-out), where elements are inserted and extracted only from one end of the

    + * + *

    {@link Stack}s are implemented as containers adaptors, which are classes that use an encapsulated object of + * a specific container class as its underlying container, providing a specific set of member functions to + * access its elements. Elements are pushed/popped from the {@link ILinearContainer.back back()} of the + * {@link ILinearContainer specific container}, which is known as the top of the {@link Stack}.

    + * + *

    {@link container_ The underlying container} may be any of the standard container class templates or some + * other specifically designed container class. The container shall support the following operations:

    + * + *
      + *
    • empty
    • + *
    • size
    • + *
    • front
    • + *
    • back
    • + *
    • push_back
    • + *
    • pop_back
    • + *
    + * + *

    The standard container classes {@link Vector}, {@link Deque} and {@link List} fulfill these requirements. + * By default, if no container class is specified for a particular {@link Stack} class instantiation, the standard + * container {@link List} is used.

    + * + *

    + * + *

    + * + * @param Type of elements. + * + * @reference http://www.cplusplus.com/reference/stack/stack + * @author Jeongho Nam + */ + class Stack { + /** + * The underlying object for implementing the LIFO + */ + private container_; + /** + * Default Constructor. + */ + constructor(); + /** + * Copy Constructor. + */ + constructor(stack: Stack); + /** + *

    Return size.

    + * + *

    Returns the number of elements in the {@link Stack}.

    + * + *

    This member function effectively calls member {@link ILinearContainer.size size()} of the + * {@link container_ underlying container} object.

    + * + * @return The number of elements in the {@link container_ underlying container}. + */ + size(): number; + /** + *

    Test whether container is empty.

    + * + *

    returns whether the {@link Stack} is empty: i.e. whether its size is zero.

    + * + *

    This member function effectively calls member {@link ILinearContainer.empty empty()} of the + * {@link container_ underlying container} object.

    + * + * @return true if the underlying container's size is 0, + * false otherwise.

    + */ + empty(): boolean; + /** + *

    Access next element.

    + * + *

    Returns a value of the top element in the {@link Stack}

    . + * + *

    Since {@link Stack}s are last-in first-out containers, the top element is the last element inserted into + * the {@link Stack}.

    + * + *

    This member function effectively calls member {@link ILinearContainer.back back()} of the + * {@link container_ underlying container} object.

    + * + * @return A value of the top element in the {@link Stack}. + */ + top(): T; + /** + *

    Insert element.

    + * + *

    Inserts a new element at the top of the {@link Stack}, above its current top element.

    + * + *

    This member function effectively calls the member function + * {@link ILinearContainer.push_back push_back()} of the {@link container_ underlying container} object.

    + * + * @param val Value to which the inserted element is initialized. + */ + push(val: T): void; + /** + *

    Remove top element.

    + * + *

    Removes the element on top of the {@link Stack}, effectively reducing its size by one.

    + * + *

    The element removed is the latest element inserted into the {@link Stack}, whose value can be retrieved + * by calling member {@link top Stack.top()}

    . + * + *

    This member function effectively calls the member function {@link ILinearContainer.pop_back pop_back()} + * of the {@link container_ underlying container} object.

    + */ + pop(): void; + /** + *

    Swap contents.

    + * + *

    Exchanges the contents of the container adaptor (this) by those of obj.

    + * + *

    This member function calls the non-member function {@link IContainer.swap swap} (unqualified) to swap + * the {@link container_ underlying containers}.

    + * + * @param obj Another {@link Stack} container adaptor of the same type (i.e., instantiated with the same + * template parameter, T). Sizes may differ.

    + */ + swap(obj: Stack): void; + } +} declare namespace std.base { /** *

    An abstract error instance.

    @@ -3017,6 +7992,1686 @@ declare namespace std.base { to_bool(): boolean; } } +declare namespace std { + /** + *

    System error exception.

    + * + *

    This class defines the type of objects thrown as exceptions to report conditions originating during + * runtime from the operating system or other low-level application program interfaces which have an + * associated {@link ErrorCode}.

    + * + *

    The class inherits from {@link RuntimeError}, to which it adds an {@link ErrorCode} as + * member code (and defines a specialized what member).

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/system_error/system_error + * @author Jeongho Nam + */ + class SystemError extends RuntimeError { + /** + * @hidden + */ + protected code_: ErrorCode; + /** + * Construct from an error code. + * + * @param code An {@link ErrorCode} object. + */ + constructor(code: ErrorCode); + /** + * Construct from an error code and message. + * + * @param code An {@link ErrorCode} object. + * @param message A message incorporated in the string returned by member {@link what what()}. + */ + constructor(code: ErrorCode, message: string); + /** + * Construct from a numeric value and error category. + * + * @param val A numerical value identifying an error code. + * @param category A reference to an {@link ErrorCode} object. + */ + constructor(val: number, category: ErrorCategory); + /** + * Construct from a numeric value, error category and message. + * + * @param val A numerical value identifying an error code. + * @param category A reference to an {@link ErrorCode} object. + * @param message A message incorporated in the string returned by member {@link what what()}. + */ + constructor(val: number, category: ErrorCategory, message: string); + /** + *

    Get error code.

    + * + *

    Returns the {@link ErrorCode} object associated with the exception.

    + * + *

    This value is either the {@link ErrorCode} passed to the construction or its equivalent + * (if constructed with a value and a {@link category}.

    + * + * @return The {@link ErrorCode} associated with the object. + */ + code(): ErrorCode; + } +} +declare namespace std { + /** + *

    Error category.

    + * + *

    This type serves as a base class for specific category types.

    + * + *

    Category types are used to identify the source of an error. They also define the relation between + * {@link ErrorCode} and {@link ErrorCondition}objects of its category, as well as the message set for {@link ErrorCode} + * objects. + * + *

    Objects of these types have no distinct values and are not-copyable and not-assignable, and thus can only be + * passed by reference. As such, only one object of each of these types shall exist, each uniquely identifying its own + * category: all error codes and conditions of a same category shall return a reference to same object.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/system_error/error_category + * @author Jeongho Nam + */ + abstract class ErrorCategory { + /** + * Default Constructor. + */ + constructor(); + /** + *

    Return category name.

    + * + *

    In derived classes, the function returns a string naming the category.

    + * + *

    In {@link ErrorCategory}, it is a pure virtual member function.

    + * + *
      + *
    • In the {@link GenericCategory} object, it returns "generic".
    • + *
    • In the {@link SystemCategory} object, it returns "system".
    • + *
    • In the {@link IOStreamCategory} object, it returns "iostream".
    • + *
    + * + * @return The category name. + */ + abstract name(): string; + /** + *

    Error message.

    + * + *

    In derived classes, the function returns a string object with a message describing the error condition + * denoted by val.

    + * + *

    In {@link ErrorCategory}, it is a pure virtual member function.

    + * + *

    This function is called both by {@link ErrorCode.message ErrorCode.message()} and + * {@link ErrorCondition.message ErrorCondition.message()} to obtain the corresponding message in the + * {@link category}. Therefore, numerical values used by custom error codes and + * {@link ErrorCondition error conditions} should only match for a category if they describe the same error.

    + * + * @param val A numerical value identifying an error condition. + * If the {@link ErrorCategory} object is the {@link GenericCategory}, this argument is equivalent to an + * {@link errno} value. + * + * @return A string object with the message. + */ + abstract message(val: number): string; + /** + *

    Default error condition.

    + * + *

    Returns the default {@link ErrorCondition}object of this category that is associated with the + * {@link ErrorCode} identified by a value of val.

    + * + *

    Its definition in the base class {@link ErrorCategory} returns the same as constructing an + * {@link ErrorCondition} object with: + * + *

    new ErrorCondition(val, *this);

    + * + *

    As a virtual member function, this behavior can be overriden in derived classes.

    + * + *

    This function is called by the default definition of member {@link equivalent equivalent()}, which is used to + * compare {@link ErrorCondition error conditions} with error codes.

    + * + * @param val A numerical value identifying an error condition. + * + * @return The default {@link ErrorCondition}object associated with condition value val for this category. + */ + default_error_condition(val: number): ErrorCondition; + /** + *

    Check error code equivalence.

    + * + *

    Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an + * {@link ErrorCondition error condition.

    + * + *

    This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is + * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' + * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered + * equivalent by the operator.

    + * + *

    As a virtual member function, this behavior can be overridden in derived classes to define a different + * correspondence mechanism for each {@link ErrorCategory} type.

    + * + * @param val_code A numerical value identifying an error code. + * @param cond An object of an {@link ErrorCondition} type. + * + * @return true if the arguments are considered equivalent. false otherwise. + */ + equivalent(val_code: number, cond: ErrorCondition): boolean; + /** + *

    Check error code equivalence.

    + * + *

    Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an + * {@link ErrorCondition error condition.

    + * + *

    This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is + * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' + * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered + * equivalent by the operator.

    + * + *

    As a virtual member function, this behavior can be overridden in derived classes to define a different + * correspondence mechanism for each {@link ErrorCategory} type.

    + * + * @param code An object of an {@link ErrorCode} type. + * @param val_cond A numerical value identifying an error code. + * + * @return true if the arguments are considered equivalent. false otherwise. + */ + equivalent(code: ErrorCode, val_cond: number): boolean; + } +} +declare namespace std { + /** + *

    Error condition.

    + * + *

    Objects of this type hold a condition {@link value} associated with a {@link category}.

    + * + *

    Objects of this type describe errors in a generic way so that they may be portable across different + * systems. This is in contrast with {@link ErrorCode} objects, that may contain system-specific + * information.

    + * + *

    Because {@link ErrorCondition}objects can be compared with error_code objects directly by using + * relational operators, {@link ErrorCondition}objects are generally used to check whether + * a particular {@link ErrorCode} obtained from the system matches a specific error condition no matter + * the system.

    + * + *

    The {@link ErrorCategory categories} associated with the {@link ErrorCondition} and the + * {@link ErrorCode} define the equivalences between them.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/system_error/error_condition + * @author Jeongho Nam + */ + class ErrorCondition extends base.ErrorInstance { + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from a numeric value and error category. + * + * @param val A numerical value identifying an error condition. + * @param category A reference to an {@link ErrorCategory} object. + */ + constructor(val: number, category: ErrorCategory); + } +} +declare namespace std { + /** + *

    Error code.

    + * + *

    Objects of this type hold an error code {@link value} associated with a {@link category}.

    + * + *

    The operating system and other low-level applications and libraries generate numerical error codes to + * represent possible results. These numerical values may carry essential information for a specific platform, + * but be non-portable from one platform to another.

    + * + *

    Objects of this class associate such numerical codes to {@link ErrorCategory error categories}, so that they + * can be interpreted when needed as more abstract (and portable) {@link ErrorCondition error conditions}.

    + * + *

    + *

    + * + * @reference http://www.cplusplus.com/reference/system_error/error_code + * @author Jeongho Nam + */ + class ErrorCode extends base.ErrorInstance { + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from a numeric value and error category. + * + * @param val A numerical value identifying an error code. + * @param category A reference to an {@link ErrorCategory} object. + */ + constructor(val: number, category: ErrorCategory); + } +} +declare namespace std.TreeMap { + type iterator = std.MapIterator; + type reverse_iterator = std.MapReverseIterator; +} +declare namespace std { + /** + *

    Tree-structured map, std::map of STL.

    + * + *

    {@link TreeMap TreeMaps} are associative containers that store elements formed by a combination of a + * key value (Key) and a mapped value (T), following order.

    + * + *

    In a {@link TreeMap}, the key values are generally used to sort and uniquely identify the elements, + * while the mapped values store the content associated to this key. The types of key and + * mapped value may differ, and are grouped together in member type value_type, which is a {@link Pair} + * type combining both:

    + * + *

    typedef Pair value_type;

    + * + *

    Internally, the elements in a {@link TreeMap} are always sorted by its key following a + * strict weak ordering criterion indicated by its internal comparison method {@link less}. + * + *

    {@link TreeMap} containers are generally slower than {@link HashMap HashMap} containers to access individual + * elements by their key, but they allow the direct iteration on subsets based on their order.

    + * + *

    {@link TreeMap}s are typically implemented as binary search trees.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
    + * + *
    Ordered
    + *
    The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order.
    + * + *
    Map
    + *
    Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value.
    + * + *
    Unique keys
    + *
    No two elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the keys. Each element in a map is uniquely identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/map/map + * @author Jeongho Nam + */ + class TreeMap extends base.UniqueMap implements base.ITreeMap { + /** + * @hidden + */ + private tree_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (x: Key, y: Key) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array>); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array>, compare: (x: Key, y: Key) => boolean); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: Array<[Key, T]>); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array<[Key, T]>, compare: (x: Key, y: Key) => boolean); + /** + * Copy Constructor. + * + * @param container Another map to copy. + */ + constructor(container: TreeMap); + /** + * Copy Constructor. + * + * @param container Another map to copy. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: TreeMap, compare: (x: Key, y: Key) => boolean); + /** + * Range Constructor. + * + * @param begin nput interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator>, end: Iterator>); + /** + * Range Constructor. + * + * @param begin nput interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator>, end: Iterator>, compare: (x: Key, y: Key) => boolean); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: Key): MapIterator; + /** + * @inheritdoc + */ + key_comp(): (x: Key, y: Key) => boolean; + /** + * @inheritdoc + */ + value_comp(): (x: Pair, y: Pair) => boolean; + /** + * @inheritdoc + */ + lower_bound(key: Key): MapIterator; + /** + * @inheritdoc + */ + upper_bound(key: Key): MapIterator; + /** + * @inheritdoc + */ + equal_range(key: Key): Pair, MapIterator>; + /** + * @hidden + */ + protected _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link TreeMap map} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link TreeMap map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeMap container}. + */ + swap(obj: TreeMap): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer>): void; + } +} +declare namespace std.TreeMultiMap { + type iterator = std.MapIterator; + type reverse_iterator = std.MapReverseIterator; +} +declare namespace std { + /** + *

    Tree-structured multiple-key map.

    + * + *

    {@link TreeMultiMap TreeMultiMaps} are associative containers that store elements formed by a combination of + * a key value and a mapped value, following a specific order, and where multiple elements can + * have equivalent keys.

    + * + *

    In a {@link TreeMultiMap}, the key values are generally used to sort and uniquely identify + * the elements, while the mapped values store the content associated to this key. The types of + * key and mapped value may differ, and are grouped together in member type + * value_type, which is a {@link Pair} type combining both:

    + * + *

    typedef Pair value_type;

    + * + *

    Internally, the elements in a {@link TreeMultiMap}are always sorted by its key following a + * strict weak ordering criterion indicated by its internal comparison method (of {@link less}).

    + * + *

    {@link TreeMultiMap}containers are generally slower than {@link HashMap} containers + * to access individual elements by their key, but they allow the direct iteration on subsets based + * on their order.

    + * + *

    {@link TreeMultiMap TreeMultiMaps} are typically implemented as binary search trees.

    + * + *

    < + * img src="http://samchon.github.io/typescript-stl/images/design/class_diagram/map_containers.png" style="max-width: 100%" />

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
    + * + *
    Ordered
    + *
    + * The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order. + *
    + * + *
    Map
    + *
    + * Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value. + *
    + * + *
    Multiple equivalent keys
    + *
    Multiple elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the keys. Each element in a map is uniquely identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/map/multimap + * @author Jeongho Nam + */ + class TreeMultiMap extends base.MultiMap implements base.ITreeMap { + /** + * @hidden + */ + private tree_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (x: Key, y: Key) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array>); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array>, compare: (x: Key, y: Key) => boolean); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: Array<[Key, T]>); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array<[Key, T]>, compare: (x: Key, y: Key) => boolean); + /** + * Copy Constructor. + * + * @param container Another map to copy. + */ + constructor(container: TreeMultiMap); + /** + * Copy Constructor. + * + * @param container Another map to copy. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: TreeMultiMap, compare: (x: Key, y: Key) => boolean); + /** + * Range Constructor. + * + * @param begin nput interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator>, end: Iterator>); + /** + * Range Constructor. + * + * @param begin nput interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator>, end: Iterator>, compare: (x: Key, y: Key) => boolean); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: Key): MapIterator; + /** + * @inheritdoc + */ + count(key: Key): number; + /** + * @inheritdoc + */ + key_comp(): (x: Key, y: Key) => boolean; + /** + * @inheritdoc + */ + value_comp(): (x: Pair, y: Pair) => boolean; + /** + * @inheritdoc + */ + lower_bound(key: Key): MapIterator; + /** + * @inheritdoc + */ + upper_bound(key: Key): MapIterator; + /** + * @inheritdoc + */ + equal_range(key: Key): Pair, MapIterator>; + /** + * @hidden + */ + protected _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link TreeMapMulti map} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link TreeMapMulti map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeMapMulti container}. + */ + swap(obj: TreeMultiMap): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer>): void; + } +} +declare namespace std.TreeMultiSet { + type iterator = std.SetIterator; + type reverse_iterator = std.SetReverseIterator; +} +declare namespace std { + /** + *

    Tree-structured multiple-key set.

    + * + *

    {@link TreeMultiSet TreeMultiSets} are containers that store elements following a specific order, and + * where multiple elements can have equivalent values.

    + * + *

    In a {@link TreeMultiSet}, the value of an element also identifies it (the value is itself + * the key, of type T). The value of the elements in a {@link TreeMultiSet} cannot + * be modified once in the container (the elements are always const), but they can be inserted or removed + * from the

    + * + *

    Internally, the elements in a {@link TreeMultiSet TreeMultiSets} are always sorted following a strict + * weak ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}).

    + * + *

    {@link TreeMultiSet} containers are generally slower than {@link HashMultiSet} containers + * to access individual elements by their key, but they allow the direct iteration on subsets based on + * their order.

    + * + *

    {@link TreeMultiSet TreeMultiSets} are typically implemented as binary search trees.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
    + * + *
    Ordered
    + *
    + * The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order. + *
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + * + *
    Multiple equivalent keys
    + *
    Multiple elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the elements. Each element in a {@link TreeMultiSet} container is also identified + * by this value (each value is itself also the element's key). + * + * @reference http://www.cplusplus.com/reference/set/multiset + * @author Jeongho Nam + */ + class TreeMultiSet extends base.MultiSet implements base.ITreeSet { + /** + * @hidden + */ + private tree_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (x: T, y: T) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array); + /** + * Contruct from elements with compare. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array, compare: (x: T, y: T) => boolean); + /** + * Copy Constructor. + */ + constructor(container: TreeMultiSet); + /** + * Copy Constructor with compare. + * + * @param container A container to be copied. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); + /** + * Range Constructor. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * Construct from range and compare. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator, end: Iterator, compare: (x: T, y: T) => boolean); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(val: T): SetIterator; + /** + * @inheritdoc + */ + count(val: T): number; + /** + * @inheritdoc + */ + key_comp(): (x: T, y: T) => boolean; + /** + * @inheritdoc + */ + value_comp(): (x: T, y: T) => boolean; + /** + * @inheritdoc + */ + lower_bound(val: T): SetIterator; + /** + * @inheritdoc + */ + upper_bound(val: T): SetIterator; + /** + * @inheritdoc + */ + equal_range(val: T): Pair, SetIterator>; + /** + * @hidden + */ + protected _Insert_by_val(val: T): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link TreeMultiSet set} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link TreeMultiSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeMultiSet container}. + */ + swap(obj: TreeMultiSet): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std.TreeSet { + type iterator = std.SetIterator; + type reverse_iterator = std.SetReverseIterator; +} +declare namespace std { + /** + *

    Tree-structured set, std::set of STL.

    + * + *

    {@link TreeSet}s are containers that store unique elements following a specific order.

    + * + *

    In a {@link TreeSet}, the value of an element also identifies it (the value is itself the + * key, of type T), and each value must be unique. The value of the elements in a + * {@link TreeSet} cannot be modified once in the container (the elements are always const), but they + * can be inserted or removed from the

    + * + *

    Internally, the elements in a {@link TreeSet} are always sorted following a specific strict weak + * ordering criterion indicated by its internal comparison method (of {@link less}).

    + * + *

    {@link TreeSet} containers are generally slower than {@link HashSet} containers to access + * individual elements by their key, but they allow the direct iteration on subsets based on their + * order.

    + * + *

    {@link TreeSet}s are typically implemented as binary search trees.

    + * + *

    + *

    + * + *

    Container properties

    + *
    + *
    Associative
    + *
    + * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
    + * + *
    Ordered
    + *
    + * The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order. + *
    + * + *
    Set
    + *
    The value of an element is also the key used to identify it.
    + * + *
    Unique keys
    + *
    No two elements in the container can have equivalent keys.
    + *
    + * + * @param Type of the elements. + * Each element in an {@link TreeSet} is also uniquely identified by this value. + * + * @reference http://www.cplusplus.com/reference/set/set + * @author Jeongho Nam + */ + class TreeSet extends base.UniqueSet implements base.ITreeSet { + /** + * @hidden + */ + private tree_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (x: T, y: T) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array); + /** + * Contruct from elements with compare. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array, compare: (x: T, y: T) => boolean); + /** + * Copy Constructor. + */ + constructor(container: TreeMultiSet); + /** + * Copy Constructor with compare. + * + * @param container A container to be copied. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); + /** + * Range Constructor. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * Construct from range and compare. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator, end: Iterator, compare: (x: T, y: T) => boolean); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(val: T): SetIterator; + /** + * @inheritdoc + */ + key_comp(): (x: T, y: T) => boolean; + /** + * @inheritdoc + */ + value_comp(): (x: T, y: T) => boolean; + /** + * @inheritdoc + */ + lower_bound(val: T): SetIterator; + /** + * @inheritdoc + */ + upper_bound(val: T): SetIterator; + /** + * @inheritdoc + */ + equal_range(val: T): Pair, SetIterator>; + /** + * @hidden + */ + protected _Insert_by_val(val: T): any; + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + protected _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @inheritdoc + */ + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link TreeSet set} of the same type. Sizes abd container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link TreeSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeSet container}. + */ + swap(obj: TreeSet): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std { + /** + *

    Running on Node.

    + * + *

    Test whether the JavaScript is running on Node.

    + * + * @references http://stackoverflow.com/questions/17575790/environment-detection-node-js-or-browser + */ + function is_node(): boolean; + /** + *

    Pair of values.

    + * + *

    This class couples together a pair of values, which may be of different types (T1 and + * T2). The individual values can be accessed through its public members {@link first} and + * {@link second}.

    + * + * @param Type of member {@link first}. + * @param Type of member {@link second}. + * + * @reference http://www.cplusplus.com/reference/utility/pair + * @author Jeongho Nam + */ + class Pair { + /** + *

    A first value in the Pair.

    + */ + first: T1; + /** + *

    A second value in the Pair.

    + */ + second: T2; + /** + *

    Construct from pair values.

    + * + * @param first The first value of the Pair + * @param second The second value of the Pair + */ + constructor(first: T1, second: T2); + /** + *

    Whether a Pair is equal with the Pair.

    + *

    Compare each first and second value of two Pair(s) and returns whether they are equal or not.

    + * + *

    If stored key and value in a Pair are not number or string but an object like a class or struct, + * the comparison will be executed by a member method (SomeObject)::equal_to(). If the object does not have + * the member method equal_to(), only address of pointer will be compared.

    + * + * @param obj A Map to compare + * @return Indicates whether equal or not. + */ + equal_to(pair: Pair): boolean; + less(pair: Pair): boolean; + } + /** + *

    Construct {@link Pair} object.

    + * + *

    Constructs a {@link Pair} object with its {@link Pair.first first} element set to x and its + * {@link Pair.second second} element set to y.

    + * + *

    The template types can be implicitly deduced from the arguments passed to {@link make_pair}.

    + * + *

    {@link Pair} objects can be constructed from other {@link Pair} objects containing different types, if the + * respective types are implicitly convertible.

    + * + * @param x Value for member {@link Pair.first first}. + * @param y Value for member {@link Pair.second second}. + * + * @return A {@link Pair} object whose elements {@link Pair.first first} and {@link Pair.second second} are set to + * x and y respectivelly. + */ + function make_pair(x: T1, y: T2): Pair; +} +declare namespace std.Vector { + type iterator = std.VectorIterator; + type reverse_iterator = std.VectorReverseIterator; +} +declare namespace std { + /** + *

    Vector, the dynamic array.

    + * + *

    {@link Vector}s are sequence containers representing arrays that can change in size.

    + * + *

    Just like arrays, {@link Vector}s use contiguous storage locations for their elements, which means that + * their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently + * as in arrays. But unlike arrays, their size can change dynamically, with their storage being handled + * automatically by the

    + * + *

    Internally, {@link Vector}s use a dynamically allocated array to store their elements. This array may need + * to be reallocated in order to grow in size when new elements are inserted, which implies allocating a new + * array and moving all elements to it. This is a relatively expensive task in terms of processing time, and + * thus, {@link Vector}s do not reallocate each time an element is added to the

    + * + *

    Instead, {@link Vector} containers may allocate some extra storage to accommodate for possible growth, and + * thus the container may have an actual {@link capacity} greater than the storage strictly needed to contain its + * elements (i.e., its {@link size}). Libraries can implement different strategies for growth to balance between + * memory usage and reallocations, but in any case, reallocations should only happen at logarithmically growing + * intervals of {@link size} so that the insertion of individual elements at the end of the {@link Vector} can be + * provided with amortized constant time complexity (see {@link push_back push_back()}).

    + * + *

    Therefore, compared to arrays, {@link Vector}s consume more memory in exchange for the ability to manage + * storage and grow dynamically in an efficient way.

    + * + *

    Compared to the other dynamic sequence containers ({@link Deque}s, {@link List}s), {@link Vector Vectors} + * are very efficient accessing its elements (just like arrays) and relatively efficient adding or removing + * elements from its end. For operations that involve inserting or removing elements at positions other than the + * end, they perform worse than the others, and have less consistent iterators and references than {@link List}s. + *

    + * + *

    + * + *

    + * + *

    Container properties

    + *
    + *
    Sequence
    + *
    + * Elements in sequence containers are ordered in a strict linear sequence. Individual elements are + * accessed by their position in this sequence. + *
    + * + *
    Dynamic array
    + *
    + * Allows direct access to any element in the sequence, even through pointer arithmetics, and provides + * relatively fast addition/removal of elements at the end of the sequence. + *
    + *
    + * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/vector/vector + * @author Jeongho Nam + */ + class Vector extends Array implements base.IContainer, base.IArrayContainer { + /** + *

    Default Constructor.

    + * + *

    Constructs an empty container, with no elements.

    + */ + constructor(); + /** + * @inheritdoc + */ + constructor(array: Array); + /** + *

    Initializer list Constructor.

    + * + *

    Constructs a container with a copy of each of the elements in array, in the same order.

    + * + * @param array An array containing elements to be copied and contained. + */ + constructor(n: number); + /** + *

    Fill Constructor.

    + * + *

    Constructs a container with n elements. Each element is a copy of val (if provided).

    + * + * @param n Initial container size (i.e., the number of elements in the container at construction). + * @param val Value to fill the container with. Each of the n elements in the container is + * initialized to a copy of this value. + */ + constructor(n: number, val: T); + /** + *

    Copy Constructor.

    + * + *

    Constructs a container with a copy of each of the elements in container, in the same order.

    + * + * @param container Another container object of the same type (with the same class template + * arguments T), whose contents are either copied or acquired. + */ + constructor(container: Vector); + /** + *

    Range Constructor.

    + * + *

    Constructs a container with as many elements as the range (begin, end), with each + * element emplace-constructed from its corresponding element in that range, in the same order.

    + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + assign>(begin: InputIterator, end: InputIterator): void; + /** + * @inheritdoc + */ + assign(n: number, val: T): void; + /** + * @inheritdoc + */ + reserve(size: number): void; + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + begin(): VectorIterator; + /** + * @inheritdoc + */ + end(): VectorIterator; + /** + * @inheritdoc + */ + rbegin(): VectorReverseIterator; + /** + * @inheritdoc + */ + rend(): VectorReverseIterator; + /** + * @inheritdoc + */ + size(): number; + /** + * @inheritdoc + */ + capacity(): number; + /** + * @inheritdoc + */ + empty(): boolean; + /** + * @inheritdoc + */ + at(index: number): T; + /** + * @inheritdoc + */ + set(index: number, val: T): T; + /** + * @inheritdoc + */ + front(): T; + /** + * @inheritdoc + */ + back(): T; + /** + * @inheritdoc + */ + push_back(val: T): void; + /** + *

    Insert an element.

    + * + *

    The {@link Vector} is extended by inserting new element before the element at the specified + * position, effectively increasing the container size by one.

    + * + *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new + * {@link size} surpasses the current {@link capacity}.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, inserting element in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to its new position. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    + * + * @param position Position in the {@link Vector} where the new element is inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param val Value to be copied to the inserted element. + * + * @return An iterator that points to the newly inserted element. + */ + insert(position: VectorIterator, val: T): VectorIterator; + /** + *

    Insert elements by repeated filling.

    + * + *

    The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted.

    + * + *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new + * {@link size} surpasses the current {@link capacity}.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to their new positions. This is generally an inefficient operation compared to the + * one performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new elements are inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param n Number of elements to insert. Each element is initialized to a copy of val. + * @param val Value to be copied (or moved) to the inserted elements. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: VectorIterator, n: number, val: T): VectorIterator; + /** + *

    Insert elements by range iterators.

    + * + *

    The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted by range + * iterators.

    + * + *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new + * {@link size} surpasses the current {@link capacity}.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to their new positions. This is generally an inefficient operation compared to the + * one performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new elements are inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: VectorIterator, begin: InputIterator, end: InputIterator): VectorIterator; + /** + *

    Insert an element.

    + * + *

    The {@link Vector} is extended by inserting new element before the element at the specified + * position, effectively increasing the container size by one.

    + * + *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new + * {@link size} surpasses the current {@link capacity}.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, inserting element in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to its new position. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    + * + * @param position Position in the {@link Vector} where the new element is inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param val Value to be copied to the inserted element. + * + * @return An iterator that points to the newly inserted element. + */ + insert(position: VectorReverseIterator, val: T): VectorReverseIterator; + /** + *

    Insert elements by repeated filling.

    + * + *

    The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted.

    + * + *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new + * {@link size} surpasses the current {@link capacity}.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to their new positions. This is generally an inefficient operation compared to the + * one performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new elements are inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param n Number of elements to insert. Each element is initialized to a copy of val. + * @param val Value to be copied (or moved) to the inserted elements. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: VectorReverseIterator, n: number, val: T): VectorReverseIterator; + /** + *

    Insert elements by range iterators.

    + * + *

    The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted by range + * iterators.

    + * + *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new + * {@link size} surpasses the current {@link capacity}.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to their new positions. This is generally an inefficient operation compared to the + * one performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new elements are inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: VectorReverseIterator, begin: InputIterator, end: InputIterator): VectorReverseIterator; + /** + * @hidden + */ + private insert_by_val(position, val); + /** + * @hidden + */ + protected _Insert_by_repeating_val(position: VectorIterator, n: number, val: T): VectorIterator; + /** + * @hidden + */ + protected _Insert_by_range>(position: VectorIterator, first: InputIterator, last: InputIterator): VectorIterator; + /** + * @inheritdoc + */ + pop_back(): void; + /** + *

    Erase element.

    + * + *

    Removes from the {@link Vector} either a single element; position.

    + * + *

    This effectively reduces the container size by the number of element removed.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, erasing an element in + * position other than the {@link end end()} causes the container to relocate all the elements after the + * segment erased to their new positions. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    + * + * @param position Iterator pointing to a single element to be removed from the {@link Vector}. + * + * @return An iterator pointing to the new location of the element that followed the last element erased by + * the function call. This is the {@link end end()} if the operation erased the last element in the + * sequence. + */ + erase(position: VectorIterator): VectorIterator; + /** + *

    Erase element.

    + * + *

    Removes from the Vector either a single element; position.

    + * + *

    This effectively reduces the container size by the number of elements removed.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, erasing elements in + * position other than the {@link end end()} causes the container to relocate all the elements after the + * segment erased to their new positions. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the new location of the element that followed the last element erased by + * the function call. This is the {@link rend rend()} if the operation erased the last element in the + * sequence. + */ + erase(first: VectorIterator, last: VectorIterator): VectorIterator; + /** + *

    Erase element.

    + * + *

    Removes from the {@link Vector} either a single element; position.

    + * + *

    This effectively reduces the container size by the number of element removed.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, erasing an element in + * position other than the {@link end end()} causes the container to relocate all the elements after the + * segment erased to their new positions. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    + * + * @param position Iterator pointing to a single element to be removed from the {@link Vector}. + * + * @return An iterator pointing to the new location of the element that followed the last element erased by + * the function call. This is the {@link rend rend()} if the operation erased the last element in the + * sequence. + */ + erase(position: VectorReverseIterator): VectorReverseIterator; + /** + *

    Erase element.

    + * + *

    Removes from the Vector either a single element; position.

    + * + *

    This effectively reduces the container size by the number of elements removed.

    + * + *

    Because {@link Vector}s use an Array as their underlying storage, erasing elements in + * position other than the {@link end end()} causes the container to relocate all the elements after the + * segment erased to their new positions. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the new location of the element that followed the last element erased by + * the function call. This is the {@link end end()} if the operation erased the last element in the + * sequence. + */ + erase(first: VectorReverseIterator, last: VectorReverseIterator): VectorReverseIterator; + /** + * @hidden + */ + protected _Erase_by_range(first: VectorIterator, last: VectorIterator): VectorIterator; + /** + *

    Swap content.

    + * + *

    Exchanges the content of the container by the content of obj, which is another + * {@link Vector container} object with same type of elements. Sizes and container type may differ.

    + * + *

    After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects.

    + * + *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that + * algorithm with an optimization that behaves like this member function.

    + * + * @param obj Another {@link Vector container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link container Vector}. + */ + obj(obj: Vector): void; + /** + * @inheritdoc + */ + swap(obj: base.IContainer): void; + } +} +declare namespace std { + /** + *

    An iterator of Vector.

    + * + *

    + * + *

    + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class VectorIterator extends Iterator implements base.IArrayIterator { + /** + * Sequence number of iterator in the source {@link Vector}. + */ + private index_; + /** + *

    Construct from the source {@link Vector container}.

    + * + *

    Note

    + *

    Do not create the iterator directly, by yourself.

    + *

    Use {@link Vector.begin begin()}, {@link Vector.end end()} in {@link Vector container} instead.

    + * + * @param source The source {@link Vector container} to reference. + * @param index Sequence number of the element in the source {@link Vector}. + */ + constructor(source: Vector, index: number); + /** + * @hidden + */ + private vector; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + /** + * Get index. + */ + index: number; + /** + * @inheritdoc + */ + prev(): VectorIterator; + /** + * @inheritdoc + */ + next(): VectorIterator; + /** + * @inheritdoc + */ + advance(n: number): VectorIterator; + /** + *

    Whether an iterator is equal with the iterator.

    + * + *

    Compare two iterators and returns whether they are equal or not.

    + * + *

    Note

    + *

    Iterator's equal_to() only compare souce container and index number.

    + * + *

    Although elements in a pair, key and value are equal_to, if the source map or + * index number is different, then the {@link equal_to equal_to()} will return false. If you want to + * compare the elements of a pair, compare them directly by yourself.

    + * + * @param obj An iterator to compare + * @return Indicates whether equal or not. + */ + equal_to(obj: VectorIterator): boolean; + /** + * @inheritdoc + */ + swap(obj: VectorIterator): void; + } +} +declare namespace std { + /** + *

    A reverse-iterator of Vector.

    + * + *

    + * + *

    + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class VectorReverseIterator extends ReverseIterator, VectorReverseIterator> implements base.IArrayIterator { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: VectorIterator); + /** + * @hidden + */ + protected create_neighbor(base: VectorIterator): VectorReverseIterator; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + /** + * Get index. + */ + index: number; + } +} +declare namespace std.base { + /** + *

    Static class holding enumeration codes of color of Red-black tree.

    + * + *

    Color codes imposed to nodes of RB-Tree are following those rules:

    + * + *
      + *
    1. A node is either red or black.
    2. + *
    3. The root is black. This rule is sometimes omitted. Since the root can + * always be changed from red to black, but not + * necessarily vice versa, this rule has little effect on analysis.
    4. + *
    5. All leaves (NIL; null) are black.
    6. + *
    7. If a node is red, then both its children are + * black.
    8. + *
    9. Every path from a given node to any of its descendant NIL nodes contains the same number of + * black nodes. Some definitions: the number of + * black nodes from the root to a node is the node's + * black depth; the uniform number of black + * nodes in all paths from root to the leaves is called the black-height of + * the red-black tree.
    10. + *
    + * + * @author Migrated by Jeongho Nam + */ + enum Color { + /** + *

    Code of color black.

    + * + *
      + *
    • Those are clearly black: root, leaf nodes or children nodes of red.
    • + *
    • Every path from a given nodes containes the same number of black nodes exclude NIL(s).
    • + *
    + */ + BLACK = 0, + /** + *

    Code of color red.

    + */ + RED = 1, + } +} declare namespace std.base { enum Hash { MIN_SIZE = 10, @@ -4153,1440 +10808,6 @@ declare namespace std.base { insert>(position: Iterator, begin: InputIterator, end: InputIterator): Iterator; } } -declare namespace std { - /** - *

    Bi-directional iterator.

    - * - *

    {@link Iterator Bidirectional iterators} are iterators that can be used to access the sequence of elements - * in a range in both directions (towards the end and towards the beginning).

    - * - *

    All {@link IArrayIterator random-access iterators} are also valid {@link Iterrator bidirectional iterators}. - *

    - * - *

    There is not a single type of {@link Iterator bidirectional iterator}: {@link IContainer Each container} - * may define its own specific iterator type able to iterate through it and access its elements.

    - * - *

    - * - *

    - * - * @reference http://www.cplusplus.com/reference/iterator/BidirectionalIterator - * @author Jeongho Nam - */ - abstract class Iterator { - /** - * Source container of the iterator is directing for. - */ - protected source_: base.IContainer; - /** - * Construct from the source {@link IContainer container}. - * - * @param source The source - */ - constructor(source: base.IContainer); - /** - *

    Get iterator to previous element.

    - *

    If current iterator is the first item(equal with {@link IContainer.begin IContainer.begin()}), - * returns {@link IContainer.end IContainer.end()}.

    - * - * @return An iterator of the previous item. - */ - abstract prev(): Iterator; - /** - *

    Get iterator to next element.

    - *

    If current iterator is the last item, returns {@link IContainer.end IContainer.end()}.

    - * - * @return An iterator of the next item. - */ - abstract next(): Iterator; - /** - * Advances the {@link Iterator} by n element positions. - * - * @param n Number of element positions to advance. - * @return An advanced iterator. - */ - advance(n: number): Iterator; - /** - * Get source - */ - get_source(): base.IContainer; - /** - *

    Whether an iterator is equal with the iterator.

    - * - *

    Compare two iterators and returns whether they are equal or not.

    - * - *

    Note

    - *

    Iterator's equal_to() only compare souce container and index number.

    - * - *

    Although elements in a pair, key and value are equal_to, if the source map or - * index number is different, then the {@link equal_to equal_to()} will return false. If you want to - * compare the elements of a pair, compare them directly by yourself.

    - * - * @param obj An iterator to compare - * @return Indicates whether equal or not. - */ - equal_to(obj: Iterator): boolean; - /** - *

    Get value of the iterator is pointing.

    - * - * @return A value of the iterator. - */ - readonly value: T; - abstract swap(obj: Iterator): void; - } -} -declare namespace std { - /** - *

    This class reverses the direction in which a bidirectional or random-access iterator iterates through a range. - *

    - * - *

    A copy of the original iterator (the {@link Iterator base iterator}) is kept internally and used to reflect - * the operations performed on the {@link ReverseIterator}: whenever the {@link ReverseIterator} is incremented, its - * {@link Iterator base iterator} is decreased, and vice versa. A copy of the {@link Iterator base iterator} with the - * current state can be obtained at any time by calling member {@link base}.

    - * - *

    Notice however that when an iterator is reversed, the reversed version does not point to the same element in - * the range, but to the one preceding it. This is so, in order to arrange for the past-the-end element of a - * range: An iterator pointing to a past-the-end element in a range, when reversed, is pointing to the last element - * (not past it) of the range (this would be the first element of the reversed range). And if an iterator to the - * first element in a range is reversed, the reversed iterator points to the element before the first element (this - * would be the past-the-end element of the reversed range).

    - * - *

    - * - *

    - * - * @reference http://www.cplusplus.com/reference/iterator/reverse_iterator - * @author Jeongho Nam - */ - abstract class ReverseIterator, This extends ReverseIterator> extends Iterator { - /** - * @hidden - */ - protected base_: Base; - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: Base); - /** - *

    Return base iterator.

    - * - *

    Return a reference of the base iteraotr.

    - * - *

    The base iterator is an iterator of the same type as the one used to construct the {@link ReverseIterator}, - * but pointing to the element next to the one the {@link ReverseIterator} is currently pointing to - * (a {@link ReverseIterator} has always an offset of -1 with respect to its base iterator). - * - * @return A reference of the base iterator, which iterates in the opposite direction. - */ - base(): Base; - /** - * @hidden - */ - protected abstract create_neighbor(base: Base): This; - /** - *

    Get value of the iterator is pointing.

    - * - * @return A value of the reverse iterator. - */ - readonly value: T; - /** - * @inheritdoc - */ - prev(): This; - /** - * @inheritdoc - */ - next(): This; - /** - * @inheritdoc - */ - advance(n: number): This; - /** - * @inheritdoc - */ - equal_to(obj: This): boolean; - /** - * @inheritdoc - */ - swap(obj: This): void; - } - /** - *

    Return distance between {@link Iterator iterators}.

    - * - *

    Calculates the number of elements between first and last.

    - * - *

    If it is a {@link IArrayIterator random-access iterator}, the function uses operator- to calculate this. - * Otherwise, the function uses the increase operator {@link Iterator.next next()} repeatedly.

    - * - * @param first Iterator pointing to the initial element. - * @param last Iterator pointing to the final element. This must be reachable from first. - * - * @return The number of elements between first and last. - */ - function distance>(first: InputIterator, last: InputIterator): number; - /** - *

    Advance iterator.

    - * - *

    Advances the iterator it by n elements positions.

    - * - * @param it Iterator to be advanced. - * @param n Number of element positions to advance. - * - * @return An iterator to the element n positions before it. - */ - function advance>(it: InputIterator, n: number): InputIterator; - /** - *

    Get iterator to previous element.

    - * - *

    Returns an iterator pointing to the element that it would be pointing to if advanced -n positions.

    - * - * @param it Iterator to base position. - * @param n Number of element positions offset (1 by default). - * - * @return An iterator to the element n positions before it. - */ - function prev>(it: BidirectionalIterator, n?: number): BidirectionalIterator; - /** - *

    Get iterator to next element.

    - * - *

    Returns an iterator pointing to the element that it would be pointing to if advanced n positions.

    - * - * @param it Iterator to base position. - * @param n Number of element positions offset (1 by default). - * - * @return An iterator to the element n positions away from it. - */ - function next>(it: ForwardIterator, n?: number): ForwardIterator; - /** - *

    Iterator to beginning.

    - * - *

    Returns an iterator pointing to the first element in the sequence.

    - * - *

    If the sequence is empty, the returned value shall not be dereferenced.

    - * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: Vector): VectorIterator; - /** - *

    Iterator to beginning.

    - * - *

    Returns an iterator pointing to the first element in the sequence.

    - * - *

    If the sequence is empty, the returned value shall not be dereferenced.

    - * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: List): ListIterator; - /** - *

    Iterator to beginning.

    - * - *

    Returns an iterator pointing to the first element in the sequence.

    - * - *

    If the sequence is empty, the returned value shall not be dereferenced.

    - * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: Deque): DequeIterator; - /** - *

    Iterator to beginning.

    - * - *

    Returns an iterator pointing to the first element in the sequence.

    - * - *

    If the sequence is empty, the returned value shall not be dereferenced.

    - * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: base.SetContainer): SetIterator; - /** - *

    Iterator to beginning.

    - * - *

    Returns an iterator pointing to the first element in the sequence.

    - * - *

    If the sequence is empty, the returned value shall not be dereferenced.

    - * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: base.MapContainer): MapIterator; - /** - *

    Iterator to end.

    - * - *

    Returns an iterator pointing to the past-the-end element in the sequence.

    - * - *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    - * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: Vector): VectorIterator; - /** - *

    Iterator to end.

    - * - *

    Returns an iterator pointing to the past-the-end element in the sequence.

    - * - *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    - * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: List): ListIterator; - /** - *

    Iterator to end.

    - * - *

    Returns an iterator pointing to the past-the-end element in the sequence.

    - * - *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    - * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: Deque): DequeIterator; - /** - *

    Iterator to end.

    - * - *

    Returns an iterator pointing to the past-the-end element in the sequence.

    - * - *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    - * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: base.SetContainer): SetIterator; - /** - *

    Iterator to end.

    - * - *

    Returns an iterator pointing to the past-the-end element in the sequence.

    - * - *

    If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

    - * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: base.MapContainer): MapIterator; -} -declare namespace std.base { - /** - *

    An abstract map.

    - * - *

    {@link MapContainer MapContainers} are associative containers that store elements formed by a combination - * of a key value (Key) and a mapped value (T), and which allows for fast retrieval - * of individual elements based on their keys.

    - * - *

    In a {@link MapContainer}, the key values are generally used to identify the elements, while the - * mapped values store the content associated to this key. The types of key and - * mapped value may differ, and are grouped together in member type value_type, which is a - * {@link Pair} type combining both:

    - * - *

    typedef pair value_type;

    - * - *

    {@link MapContainer} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute position - * in the container. - *
    - * - *
    Map
    - *
    - * Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value. - *
    - *
    - * - * @param Type of the keys. Each element in a map is identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @author Jeongho Nam - */ - abstract class MapContainer extends Container> { - /** - *

    {@link List} storing elements.

    - * - *

    Storing elements and keeping those sequence of the {@link MapContainer} are implemented by - * {@link data_ this list container}. Implementing index-table is also related with {@link data_ this list} - * by storing {@link ListIterator iterators} ({@link MapIterator} references {@link ListIterator}) who are - * created from {@link data_ here}.

    - */ - private data_; - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - assign>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - clear(): void; - /** - *

    Get iterator to element.

    - * - *

    Searches the container for an element with a identifier equivalent to key and returns an - * iterator to it if found, otherwise it returns an iterator to {@link end end()}.

    - * - *

    Two keys are considered equivalent if the container's comparison object returns false reflexively - * (i.e., no matter the order in which the elements are passed as arguments).

    - * - *

    Another member functions, {@link has has()} and {@link count count()}, can be used to just check - * whether a particular key exists.

    - * - * @param key Key to be searched for - * @return An iterator to the element, if an element with specified key is found, or - * {@link end end()} otherwise. - */ - abstract find(key: Key): MapIterator; - /** - *

    Return iterator to beginning.

    - * - *

    Returns an iterator referring the first element in the

    - * - *

    Note

    - *

    If the container is {@link empty}, the returned iterator is same with {@link end end()}.

    - * - * @return An iterator to the first element in the The iterator containes the first element's value. - */ - begin(): MapIterator; - /** - *

    Return iterator to end.

    - *

    Returns an iterator referring to the past-the-end element in the

    - * - *

    The past-the-end element is the theoretical element that would follow the last element in the - * It does not point to any element, and thus shall not be dereferenced.

    - * - *

    Because the ranges used by functions of the container do not include the element reference by their - * closing iterator, this function is often used in combination with {@link MapContainer}.{@link begin} to - * specify a range including all the elements in the

    - * - *

    Note

    - *

    Returned iterator from {@link MapContainer}.{@link end} does not refer any element. Trying to accessing - * element by the iterator will cause throwing exception ({@link OutOfRange}).

    - * - *

    If the container is {@link empty}, this function returns the same as {@link begin}.

    - * - * @return An iterator to the end element in the - */ - end(): MapIterator; - /** - *

    Return {@link MapReverseIterator reverse iterator} to reverse beginning.

    - * - *

    Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in the container - * (i.e., its reverse beginning).

    - * - * {@link MapReverseIterator Reverse iterators} iterate backwards: increasing them moves them towards the - * beginning of the container.

    - * - *

    {@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}. - *

    - * - * @return A {@link MapReverseIterator reverse iterator} to the reverse beginning of the sequence - * - */ - rbegin(): MapReverseIterator; - /** - *

    Return {@link MapReverseIterator reverse iterator} to reverse end.

    - * - *

    Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before - * the first element in the {@link MapContainer map container} (which is considered its reverse end). - *

    - * - *

    The range between {@link MapContainer}.{@link rbegin} and {@link MapContainer}.{@link rend} contains - * all the elements of the container (in reverse order).

    - * - * @return A {@link MapReverseIterator reverse iterator} to the reverse end of the sequence - */ - rend(): MapReverseIterator; - /** - *

    Whether have the item or not.

    - * - *

    Indicates whether a map has an item having the specified identifier.

    - * - * @param key Key value of the element whose mapped value is accessed. - * - * @return Whether the map has an item having the specified identifier. - */ - has(key: Key): boolean; - /** - *

    Count elements with a specific key.

    - * - *

    Searches the container for elements whose key is key and returns the number of elements found.

    - * - * @param key Key value to be searched for. - * - * @return The number of elements in the container with a key. - */ - abstract count(key: Key): number; - /** - * Return the number of elements in the map. - */ - size(): number; - /** - * @inheritdoc - */ - push(...args: Pair[]): number; - /** - * @inheritdoc - */ - push(...args: [Key, T][]): number; - /** - * Construct and insert element with hint - * - * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in - * place using *args* as the arguments for the element's constructor. *hint* points to a location in the - * container suggested as a hint on where to start the search for its insertion point (the container may or - * may not use this suggestion to optimize the insertion operation). - * - * A similar member function exists, {@link insert}, which either copies or moves an existing object into - * the container, and may also take a position *hint*. - * - * @param hint Hint for the position where the element can be inserted. - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - emplace_hint(hint: MapIterator, key: Key, val: T): MapIterator; - /** - * Construct and insert element with hint - * - * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in - * place using *args* as the arguments for the element's constructor. *hint* points to a location in the - * container suggested as a hint on where to start the search for its insertion point (the container may or - * may not use this suggestion to optimize the insertion operation). - * - * A similar member function exists, {@link insert}, which either copies or moves an existing object into - * the container, and may also take a position *hint*. - * - * @param hint Hint for the position where the element can be inserted. - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An {@link MapIterator iterator} pointing to either the newly inserted element or to the element - * that already had an equivalent key in the {@link MapContainer}. - */ - emplace_hint(hint: MapReverseIterator, key: Key, val: T): MapReverseIterator; - /** - * Construct and insert element with hint - * - * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in - * place using *args* as the arguments for the element's constructor. *hint* points to a location in the - * container suggested as a hint on where to start the search for its insertion point (the container may or - * may not use this suggestion to optimize the insertion operation). - * - * A similar member function exists, {@link insert}, which either copies or moves an existing object into - * the container, and may also take a position *hint*. - * - * @param hint Hint for the position where the element can be inserted. - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - emplace_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * Construct and insert element with hint - * - * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in - * place using *args* as the arguments for the element's constructor. *hint* points to a location in the - * container suggested as a hint on where to start the search for its insertion point (the container may or - * may not use this suggestion to optimize the insertion operation). - * - * A similar member function exists, {@link insert}, which either copies or moves an existing object into - * the container, and may also take a position *hint*. - * - * @param hint Hint for the position where the element can be inserted. - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return An {@link MapIterator iterator} pointing to either the newly inserted element or to the element - * that already had an equivalent key in the {@link MapContainer}. - */ - emplace_hint(hint: MapReverseIterator, pair: Pair): MapReverseIterator; - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting a new element, effectively increasing the container {@link size} - * by the number of element inserted (zero or one).

    - * - * @param hint Hint for the position where the element can be inserted. - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapIterator, pair: Pair): MapIterator; - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting a new element, effectively increasing the container {@link size} - * by the number of element inserted (zero or one).

    - * - * @param hint Hint for the position where the element can be inserted. - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} - * by the number of elements inserted.

    - * - * @param hint Hint for the position where the element can be inserted. - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapIterator, tuple: [L, U]): MapIterator; - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} - * by the number of elements inserted.

    - * - * @param hint Hint for the position where the element can be inserted. - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; - /** - *

    Insert elements from range iterators.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

    - * - * @param begin Input iterator specifying initial position of a range of elements. - * @param end Input iterator specifying final position of a range of elements. - * Notice that the range includes all the elements between begin and end, - * including the element pointed by begin but not the one pointed by end. - */ - insert>>(first: InputIterator, last: InputIterator): void; - /** - * @hidden - */ - protected abstract _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - private insert_by_tuple(tuple); - /** - * @hidden - */ - protected abstract _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - private insert_by_hint_with_tuple(hint, tuple); - /** - * @hidden - */ - protected abstract _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - *

    Erase an elemet by key.

    - * - *

    Removes from the {@link MapContainer map container} a single element.

    - * - *

    This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.

    - * - * @param key Key of the element to be removed from the {@link MapContainer}. - */ - erase(key: Key): number; - /** - *

    Erase an elemet by iterator.

    - * - *

    Removes from the {@link MapContainer map container} a single element.

    - * - *

    This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.

    - * - * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. - */ - erase(it: MapIterator): MapIterator; - /** - *

    Erase elements by range iterators.

    - * - *

    Removes from the {@link MapContainer map container} a range of elements.

    - * - *

    This effectively reduces the container {@link size} by the number of elements removed, which are - * destroyed.

    - * - * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * @param end An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * Notice that the range includes all the elements between begin and end, - * including the element pointed by begin but not the one pointed by end. - */ - erase(begin: MapIterator, end: MapIterator): MapIterator; - /** - *

    Erase an elemet by iterator.

    - * - *

    Removes from the {@link MapContainer map container} a single element.

    - * - *

    This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.

    - * - * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. - */ - erase(it: MapReverseIterator): MapReverseIterator; - /** - *

    Erase elements by range iterators.

    - * - *

    Removes from the {@link MapContainer map container} a range of elements.

    - * - *

    This effectively reduces the container {@link size} by the number of elements removed, which are - * destroyed.

    - * - * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * @param end An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * Notice that the range includes all the elements between begin and end, - * including the element pointed by begin but not the one pointed by end. - */ - erase(begin: MapReverseIterator, end: MapReverseIterator): MapReverseIterator; - /** - * @hidden - */ - private erase_by_key(key); - /** - * @hidden - */ - private erase_by_iterator(first, last?); - /** - * @hidden - */ - private erase_by_range(begin, end); - /** - *

    Abstract method handling insertions for indexing.

    - * - *

    This method, {@link _Handle_insert} is designed to register the first to last to somewhere storing - * those {@link MapIterator iterators} for indexing, fast accessment and retrievalance.

    - * - *

    When {@link insert} is called, new elements will be inserted into the {@link data_ list container} and new - * {@link MapIterator iterators} first to last, pointing the inserted elements, will be created and the - * newly created iterators first to last will be shifted into this method {@link _Handle_insert} after the - * insertions.

    - * - *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators} - * will be registered into the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * registered into the {@link HashSet.hash_buckets_ hash bucket}.

    - * - * @param first An {@link MapIterator} to the initial position in a sequence. - * @param last An {@link MapIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - */ - protected abstract _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - *

    Abstract method handling deletions for indexing.

    - * - *

    This method, {@link _Handle_erase} is designed to unregister the first to last to somewhere storing - * those {@link MapIterator iterators} for indexing, fast accessment and retrievalance.

    - * - *

    When {@link erase} is called with first to last, {@link MapIterator iterators} positioning somewhere - * place to be deleted, is memorized and shifted to this method {@link _Handle_erase} after the deletion process is - * terminated.

    - * - *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators} - * will be unregistered from the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * unregistered from the {@link HashSet.hash_buckets_ hash bucket}.

    - * - * @param first An {@link MapIterator} to the initial position in a sequence. - * @param last An {@link MapIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - */ - protected abstract _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - * @hidden - */ - protected _Swap(obj: MapContainer): void; - } -} -declare namespace std { - /** - *

    An iterator of {@link MapContainer map container}.

    - * - *

    - *

    - * - * @author Jeongho Nam - */ - class MapIterator extends Iterator> implements IComparable> { - /** - * A {@link ListIterator} pointing {@link Pair} of key and value. - */ - private list_iterator_; - /** - * Construct from the {@link MapContainer source map} and {@link ListIterator list iterator}. - * - * @param source The source {@link MapContainer}. - * @param list_iterator A {@link ListIterator} pointing {@link Pair} of key and value. - */ - constructor(source: base.MapContainer, list_iterator: ListIterator>); - /** - * Get iterator to previous element. - */ - prev(): MapIterator; - /** - * Get iterator to next element. - */ - next(): MapIterator; - /** - * Advances the Iterator by n element positions. - * - * @param step Number of element positions to advance. - * @return An advanced Iterator. - */ - advance(step: number): MapIterator; - /** - * @hidden - */ - private readonly map; - /** - * Get ListIterator. - */ - get_list_iterator(): ListIterator>; - /** - * @inheritdoc - */ - readonly value: Pair; - /** - * Get first, key element. - */ - readonly first: Key; - /** - * Get second, value element. - */ - /** - * Set second value. - */ - second: T; - /** - *

    Whether an iterator is equal with the iterator.

    - * - *

    Compare two iterators and returns whether they are equal or not.

    - * - * @param obj An iterator to compare - * @return Indicates whether equal or not. - */ - equal_to(obj: MapIterator): boolean; - less(obj: MapIterator): boolean; - hash(): number; - swap(obj: MapIterator): void; - } - /** - *

    A reverse-iterator of {@link MapContainer map container}.

    - * - *

    - *

    - * - * @author Jeongho Nam - */ - class MapReverseIterator extends ReverseIterator, MapIterator, MapReverseIterator> { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: MapIterator); - /** - * @hidden - */ - protected create_neighbor(base: MapIterator): MapReverseIterator; - /** - * Get first, key element. - */ - readonly first: Key; - /** - * Get second, value element. - */ - /** - * Set second value. - */ - second: T; - } -} -declare namespace std.base { - /** - *

    An abstract multi-map.

    - * - *

    {@link MultiMap MultiMaps} are associative containers that store elements formed by a combination of a - * key value (Key) and a mapped value (T), and which allows for fast retrieval of - * individual elements based on their keys.

    - * - *

    In a {@link MapContainer}, the key values are generally used to identify the elements, while the - * mapped values store the content associated to this key. The types of key and - * mapped value may differ, and are grouped together in member type value_type, which is a - * {@link Pair} type combining both:

    - * - *

    typedef pair value_type;

    - * - *

    {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute position - * in the container. - *
    - * - *
    Map
    - *
    - * Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value. - *
    - * - *
    Multiple equivalent keys
    - *
    Multiple elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the keys. Each element in a map is identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @author Jeongho Nam - */ - abstract class MultiMap extends MapContainer { - /** - * Construct and insert element. - * - * Inserts a new element in the {@link MultiMap}. This new element is constructed in place using args - * as the arguments for the element's constructor. - * - * This effectively increases the container {@link size} by one. - * - * A similar member function exists, {@link insert}, which either copies or moves existing objects into the - * container. - * - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An {@link MapIterator iterator} to the newly inserted element. - */ - emplace(key: Key, value: T): MapIterator; - /** - * Construct and insert element. - * - * Inserts a new element in the {@link MultiMap}. This new element is constructed in place using args - * as the arguments for the element's constructor. - * - * This effectively increases the container {@link size} by one. - * - * A similar member function exists, {@link insert}, which either copies or moves existing objects into the - * container. - * - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * @return An {@link MapIterator iterator} to the newly inserted element. - */ - emplace(pair: Pair): MapIterator; - /** - *

    Insert elements.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

    - * - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return An iterator pointing to the newly inserted element. - */ - insert(pair: Pair): MapIterator; - /** - *

    Insert elements.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

    - * - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to the newly inserted element. - */ - insert(tuple: [L, U]): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapIterator, pair: Pair): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; - /** - * @inheritdoc - */ - insert(hint: MapIterator, tuple: [L, U]): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; - /** - * @inheritdoc - */ - insert>>(first: InputIterator, last: InputIterator): void; - } -} -declare namespace std.base { - /** - *

    An abstract set.

    - * - *

    {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.

    - * - *

    In an {@link SetContainer}, the value of an element is at the same time its key, used to - * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be - * modified once in the container - they can be inserted and removed, though.

    - * - *

    {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - *
    - * - * @param Type of the elements. Each element in a {@link SetContainer} container is also identified - * by this value (each value is itself also the element's key). - * - * @author Jeongho Nam - */ - abstract class SetContainer extends Container { - /** - *

    {@link List} storing elements.

    - * - *

    Storing elements and keeping those sequence of the {@link SetContainer} are implemented by - * {@link data_ this list container}. Implementing index-table is also related with {@link data_ this list} - * by storing {@link ListIterator iterators} ({@link SetIterator} references {@link ListIterator}) who are - * created from {@link data_ here}.

    - */ - private data_; - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - assign>(begin: Iterator, end: Iterator): void; - /** - * @inheritdoc - */ - clear(): void; - /** - *

    Get iterator to element.

    - * - *

    Searches the container for an element with key as value and returns an iterator to it if found, - * otherwise it returns an iterator to {@link end end()} (the element past the end of the container).

    - * - *

    Another member function, {@link count count()}, can be used to just check whether a particular element - * exists.

    - * - * @param key Key to be searched for. - * - * @return An iterator to the element, if the specified value is found, or {@link end end()} if it is not - * found in the - */ - abstract find(val: T): SetIterator; - /** - * @inheritdoc - */ - begin(): SetIterator; - /** - * @inheritdoc - */ - end(): SetIterator; - /** - * @inheritdoc - */ - rbegin(): SetReverseIterator; - /** - * @inheritdoc - */ - rend(): SetReverseIterator; - /** - *

    Whether have the item or not.

    - * - *

    Indicates whether a set has an item having the specified identifier.

    - * - * @param key Key value of the element whose mapped value is accessed. - * - * @return Whether the set has an item having the specified identifier. - */ - has(val: T): boolean; - /** - *

    Count elements with a specific key.

    - * - *

    Searches the container for elements with a value of k and returns the number of elements found.

    - * - * @param key Value of the elements to be counted. - * - * @return The number of elements in the container with a key. - */ - abstract count(val: T): number; - /** - * @inheritdoc - */ - size(): number; - /** - * @inheritdoc - */ - push(...args: U[]): number; - /** - *

    Insert an element with hint.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.

    - * - * @param hint Hint for the position where the element can be inserted. - * @param val Value to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had its - * same value in the {@link SetContainer}. - */ - insert(hint: SetIterator, val: T): SetIterator; - /** - *

    Insert an element with hint.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.

    - * - * @param hint Hint for the position where the element can be inserted. - * @param val Value to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had its - * same value in the {@link SetContainer}. - */ - insert(hint: SetReverseIterator, val: T): SetReverseIterator; - /** - *

    Insert elements with a range of a

    - * - *

    Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.

    - * - * @param begin An iterator specifying range of the begining element. - * @param end An iterator specifying range of the ending element. - */ - insert>(begin: InputIterator, end: InputIterator): void; - /** - * @hidden - */ - protected abstract _Insert_by_val(val: T): any; - /** - * @hidden - */ - protected abstract _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected abstract _Insert_by_range>(begin: InputIterator, end: InputIterator): void; - /** - *

    Erase an element.

    - *

    Removes from the set container the elements whose value is key.

    - * - *

    This effectively reduces the container size by the number of elements removed.

    - * - * @param key Value of the elements to be erased. - * - * @return Number of elements erased. - */ - erase(val: T): number; - /** - * @inheritdoc - */ - erase(it: SetIterator): SetIterator; - /** - *

    Erase elements.

    - *

    Removes from the set container a range of elements..

    - * - *

    This effectively reduces the container size by the number of elements removed.

    - * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - */ - erase(begin: SetIterator, end: SetIterator): SetIterator; - /** - * @inheritdoc - */ - erase(it: SetReverseIterator): SetReverseIterator; - /** - *

    Erase elements.

    - *

    Removes from the set container a range of elements..

    - * - *

    This effectively reduces the container size by the number of elements removed.

    - * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - */ - erase(begin: SetReverseIterator, end: SetReverseIterator): SetReverseIterator; - /** - * @hidden - */ - private erase_by_iterator(first, last?); - /** - * @hidden - */ - private erase_by_val(val); - /** - * @hidden - */ - private erase_by_range(begin, end); - /** - *

    Abstract method handling insertions for indexing.

    - * - *

    This method, {@link _Handle_insert} is designed to register the first to last to somewhere storing - * those {@link SetIterator iterators} for indexing, fast accessment and retrievalance.

    - * - *

    When {@link insert} is called, new elements will be inserted into the {@link data_ list container} and new - * {@link SetIterator iterators} first to last, pointing the inserted elements, will be created and the - * newly created iterators first to last will be shifted into this method {@link _Handle_insert} after the - * insertions.

    - * - *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link SetIterator iterators} - * will be registered into the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * registered into the {@link HashSet.hash_buckets_ hash bucket}.

    - * - * @param first An {@link SetIterator} to the initial position in a sequence. - * @param last An {@link SetIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - */ - protected abstract _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - *

    Abstract method handling deletions for indexing.

    - * - *

    This method, {@link _Handle_erase} is designed to unregister the first to last to somewhere storing - * those {@link SetIterator iterators} for indexing, fast accessment and retrievalance.

    - * - *

    When {@link erase} is called with first to last, {@link SetIterator iterators} positioning somewhere - * place to be deleted, is memorized and shifted to this method {@link _Handle_erase} after the deletion process is - * terminated.

    - * - *

    If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link SetIterator iterators} - * will be unregistered from the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * unregistered from the {@link HashSet.hash_buckets_ hash bucket}.

    - * - * @param first An {@link SetIterator} to the initial position in a sequence. - * @param last An {@link SetIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - */ - protected abstract _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - * @hidden - */ - protected _Swap(obj: SetContainer): void; - } -} -declare namespace std { - /** - *

    An iterator of a Set.

    - * - *

    - *

    - * - * @author Jeongho Nam - */ - class SetIterator extends Iterator implements IComparable> { - private list_iterator_; - /** - *

    Construct from source and index number.

    - * - *

    Note

    - *

    Do not create iterator directly.

    - *

    Use begin(), find() or end() in Map instead.

    - * - * @param map The source Set to reference. - * @param index Sequence number of the element in the source Set. - */ - constructor(source: base.SetContainer, it: ListIterator); - /** - * @inheritdoc - */ - prev(): SetIterator; - /** - * @inheritdoc - */ - next(): SetIterator; - /** - * @inheritdoc - */ - advance(size: number): SetIterator; - /** - * @hidden - */ - private readonly set; - get_list_iterator(): ListIterator; - /** - * @inheritdoc - */ - readonly value: T; - /** - * @inheritdoc - */ - equal_to(obj: SetIterator): boolean; - /** - * @inheritdoc - */ - less(obj: SetIterator): boolean; - /** - * @inheritdoc - */ - hash(): number; - /** - * @inheritdoc - */ - swap(obj: SetIterator): void; - } - /** - *

    A reverse-iterator of Set.

    - * - *

    - *

    - * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class SetReverseIterator extends ReverseIterator, SetReverseIterator> { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: SetIterator); - /** - * @hidden - */ - protected create_neighbor(base: SetIterator): SetReverseIterator; - } -} -declare namespace std.base { - /** - *

    An abstract set.

    - * - *

    {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.

    - * - *

    In an {@link SetContainer}, the value of an element is at the same time its key, used to - * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be - * modified once in the container - they can be inserted and removed, though.

    - * - *

    {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - * - *
    Multiple equivalent keys
    - *
    Multiple elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the elements. Each element in a {@link SetContainer} container is also identified - * by this value (each value is itself also the element's key). - * - * @author Jeongho Nam - */ - abstract class MultiSet extends SetContainer { - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

    - * - * @param key Value to be inserted as an element. - * - * @return An iterator to the newly inserted element. - */ - insert(val: T): SetIterator; - /** - * @inheritdoc - */ - insert(hint: SetIterator, val: T): SetIterator; - /** - * @inheritdoc - */ - insert(hint: SetReverseIterator, val: T): SetReverseIterator; - /** - * @inheritdoc - */ - insert>(begin: InputIterator, end: InputIterator): void; - } -} declare namespace std.base { /** *

    Red-black Tree.

    @@ -6815,427 +12036,6 @@ declare namespace std.base { is_less(left: SetIterator, right: SetIterator): boolean; } } -declare namespace std.base { - /** - *

    An abstract unique-map.

    - * - *

    {@link UniqueMap UniqueMaps} are associative containers that store elements formed by a combination of a - * key value (Key) and a mapped value (T), and which allows for fast retrieval of - * individual elements based on their keys.

    - * - *

    In a {@link MapContainer}, the key values are generally used to uniquely identify the elements, - * while the mapped values store the content associated to this key. The types of key and - * mapped value may differ, and are grouped together in member type value_type, which is a - * {@link Pair} type combining both:

    - * - *

    typedef pair value_type;

    - * - *

    {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute position - * in the container. - *
    - * - *
    Map
    - *
    - * Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value. - *
    - * - *
    Unique keys
    - *
    No two elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the keys. Each element in a map is uniquely identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @author Jeongho Nam - */ - abstract class UniqueMap extends MapContainer { - /** - * @inheritdoc - */ - count(key: Key): number; - /** - *

    Get an element

    - * - *

    Returns a reference to the mapped value of the element identified with key.

    - * - * @param key Key value of the element whose mapped value is accessed. - * - * @throw exception out of range - * - * @return A reference object of the mapped value (_Ty) - */ - get(key: Key): T; - /** - *

    Set an item as the specified identifier.

    - * - *

    If the identifier is already in map, change value of the identifier. If not, then insert the object - * with the identifier.

    - * - * @param key Key value of the element whose mapped value is accessed. - * @param val Value, the item. - */ - set(key: Key, val: T): void; - /** - *

    Extract an element.

    - * - *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    - * - * @param key Key value of the element whose mapped value is accessed. - * - * @return A {@link Pair} containing the value pointed to by key. - */ - extract(key: Key): Pair; - /** - *

    Extract an element.

    - * - *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    - * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: MapIterator): MapIterator; - /** - *

    Extract an element.

    - * - *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    - * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: MapReverseIterator): MapReverseIterator; - /** - * @hidden - */ - private extract_by_key(key); - /** - * @hidden - */ - private extract_by_iterator(it); - /** - * @hidden - */ - private extract_by_reverse_iterator(it); - /** - * Construct and insert element. - * - * Inserts a new element in the {@link UniqueMap} if its *key* is unique. This new element is constructed in - * place using args as the arguments for the construction of a *value_type* (which is an object of a - * {@link Pair} type). - * - * The insertion only takes place if no other element in the container has a *key equivalent* to the one - * being emplaced (*keys* in a {@link UniqueMap} container are unique). - * - * If inserted, this effectively increases the container {@link size} by one. - * - * A similar member function exists, {@link insert}, which either copies or moves existing objects into the - * container. - * - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return If the function successfully inserts the element (because no equivalent element existed already in - * the {@link UniqueMap}), the function returns a {@link Pair} of an {@link MapIterator iterator} to - * the newly inserted element and a value of true. Otherwise, it returns an - * {@link MapIterator iterator} to the equivalent element within the container and a value of false. - */ - emplace(key: Key, value: T): Pair, boolean>; - /** - * Construct and insert element. - * - * Inserts a new element in the {@link UniqueMap} if its *key* is unique. This new element is constructed in - * place using args as the arguments for the construction of a *value_type* (which is an object of a - * {@link Pair} type). - * - * The insertion only takes place if no other element in the container has a *key equivalent* to the one - * being emplaced (*keys* in a {@link UniqueMap} container are unique). - * - * If inserted, this effectively increases the container {@link size} by one. - * - * A similar member function exists, {@link insert}, which either copies or moves existing objects into the - * container. - * - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return If the function successfully inserts the element (because no equivalent element existed already in - * the {@link UniqueMap}), the function returns a {@link Pair} of an {@link MapIterator iterator} to - * the newly inserted element and a value of true. Otherwise, it returns an - * {@link MapIterator iterator} to the equivalent element within the container and a value of false. - */ - emplace(pair: Pair): Pair, boolean>; - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by - * one.

    - * - *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is not inserted, returning an iterator to this existing element (if the function - * returns a value).

    - * - *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    - * - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent key already existed. - */ - insert(pair: Pair): Pair, boolean>; - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting a new element, effectively increasing the container size by the - * number of elements inserted.

    - * - *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is not inserted, returning an iterator to this existing element (if the function - * returns a value).

    - * - *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    - * - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent key already existed. - */ - insert(tuple: [L, U]): Pair, boolean>; - /** - * @inheritdoc - */ - insert(hint: MapIterator, pair: Pair): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; - /** - * @inheritdoc - */ - insert(hint: MapIterator, tuple: [L, U]): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; - /** - * @inheritdoc - */ - insert>>(first: InputIterator, last: InputIterator): void; - /** - *

    Insert or assign an element.

    - * - *

    Inserts an element or assigns to the current element if the key already exists.

    - * - *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).

    - * - *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    - * - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent key already existed so the value is assigned. - */ - insert_or_assign(key: Key, value: T): Pair, boolean>; - /** - *

    Insert or assign an element.

    - * - *

    Inserts an element or assigns to the current element if the key already exists.

    - * - *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).

    - * - *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    - * - * @param hint Hint for the position where the element can be inserted. - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link UniqueMap}. - */ - insert_or_assign(hint: MapIterator, key: Key, value: T): MapIterator; - /** - *

    Insert or assign an element.

    - * - *

    Inserts an element or assigns to the current element if the key already exists.

    - * - *

    Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).

    - * - *

    For a similar container allowing for duplicate elements, see {@link MultiMap}.

    - * - * @param hint Hint for the position where the element can be inserted. - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link UniqueMap}. - */ - insert_or_assign(hint: MapReverseIterator, key: Key, value: T): MapReverseIterator; - /** - * @hidden - */ - private insert_or_assign_with_key_value(key, value); - /** - * @hidden - */ - private insert_or_assign_with_hint(hint, key, value); - } -} -declare namespace std.base { - /** - *

    An abstract set.

    - * - *

    {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.

    - * - *

    In an {@link SetContainer}, the value of an element is at the same time its key, used to uniquely - * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be modified - * once in the container - they can be inserted and removed, though.

    - * - *

    {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - * - *
    Unique keys
    - *
    No two elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the elements. Each element in a {@link SetContainer} container is also identified - * by this value (each value is itself also the element's key). - * - * @author Jeongho Nam - */ - abstract class UniqueSet extends SetContainer { - /** - * @inheritdoc - */ - count(key: T): number; - /** - *

    Extract an element.

    - * - *

    Extracts the element pointed to by val and erases it from the {@link UniqueSet}.

    - * - * @param val Value to be extracted. - * - * @return A value. - */ - extract(val: T): T; - /** - *

    Extract an element.

    - * - *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    - * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: SetIterator): SetIterator; - /** - *

    Extract an element.

    - * - *

    Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

    - * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: SetReverseIterator): SetReverseIterator; - /** - * @hidden - */ - private extract_by_key(val); - /** - * @hidden - */ - private extract_by_iterator(it); - /** - * @hidden - */ - private extract_by_reverse_iterator(it); - /** - *

    Insert an element.

    - * - *

    Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of element inserted (zero or one).

    - * - *

    Because elements in a {@link UniqueSet UniqueSets} are unique, the insertion operation checks whether - * each inserted element is equivalent to an element already in the container, and if so, the element is not - * inserted, returning an iterator to this existing element (if the function returns a value).

    - * - *

    For a similar container allowing for duplicate elements, see {@link MultiSet}.

    - * - * @param key Value to be inserted as an element. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the equivalent element already in the {@link UniqueSet}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent element already existed. - */ - insert(val: T): Pair, boolean>; - /** - * @inheritdoc - */ - insert(hint: SetIterator, val: T): SetIterator; - /** - * @inheritdoc - */ - insert(hint: SetReverseIterator, val: T): SetReverseIterator; - /** - * @inheritdoc - */ - insert>(begin: InputIterator, end: InputIterator): void; - } -} declare namespace std.base { /** *

    A node in an XTree.

    @@ -7276,4814 +12076,14 @@ declare namespace std.base { /** * Get grand-parent. */ - readonly grand_parent: XTreeNode; + grand_parent: XTreeNode; /** * Get sibling, opposite side node in same parent. */ - readonly sibling: XTreeNode; + sibling: XTreeNode; /** * Get uncle, parent's sibling. */ - readonly uncle: XTreeNode; - } -} -declare namespace std.Deque { - type iterator = std.DequeIterator; - type reverse_iterator = std.DequeReverseIterator; -} -declare namespace std { - /** - *

    Double ended queue.

    - * - *

    {@link Deque} (usually pronounced like "deck") is an irregular acronym of - * double-ended queue. Double-ended queues are sequence containers with dynamic sizes that can be - * expanded or contracted on both ends (either its front or its back).

    - * - *

    Specific libraries may implement deques in different ways, generally as some form of dynamic array. But in any - * case, they allow for the individual elements to be accessed directly through random access iterators, with storage - * handled automatically by expanding and contracting the container as needed.

    - * - *

    Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of - * elements also at the beginning of the sequence, and not only at its end. But, unlike {@link Vector Vectors}, - * {@link Deque Deques} are not guaranteed to store all its elements in contiguous storage locations: accessing - * elements in a deque by offsetting a pointer to another element causes undefined behavior.

    - * - *

    Both {@link Vector}s and {@link Deque}s provide a very similar interface and can be used for similar purposes, - * but internally both work in quite different ways: While {@link Vector}s use a single array that needs to be - * occasionally reallocated for growth, the elements of a {@link Deque} can be scattered in different chunks of - * storage, with the container keeping the necessary information internally to provide direct access to any of its - * elements in constant time and with a uniform sequential interface (through iterators). Therefore, - * {@link Deque Deques} are a little more complex internally than {@link Vector}s, but this allows them to grow more - * efficiently under certain circumstances, especially with very long sequences, where reallocations become more - * expensive.

    - * - *

    For operations that involve frequent insertion or removals of elements at positions other than the beginning or - * the end, {@link Deque Deques} perform worse and have less consistent iterators and references than - * {@link List Lists}.

    - * - *

    - * - *

    - * - *

    Container properties

    - *
    - *
    Sequence
    - *
    Elements in sequence containers are ordered in a strict linear sequence. Individual elements - * are accessed by their position in this sequence.
    - * - *
    Dynamic array
    - *
    Generally implemented as a dynamic array, it allows direct access to any element in the - * sequence and provides relatively fast addition/removal of elements at the beginning or the end - * of the sequence.
    - *
    - * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/deque/deque/ - * @author Jeongho Nam - */ - class Deque extends base.Container implements base.IArrayContainer, base.IDequeContainer { - /** - * @hidden - */ - private static readonly ROW; - /** - * @hidden - */ - private static readonly MIN_CAPACITY; - /** - * @hidden - */ - private matrix_; - /** - * @hidden - */ - private size_; - /** - * @hidden - */ - private capacity_; - /** - * @hidden - */ - private get_col_size(); - /** - *

    Default Constructor.

    - * - *

    Constructs an empty container, with no elements.

    - */ - constructor(); - /** - *

    Initializer list Constructor.

    - * - *

    Constructs a container with a copy of each of the elements in array, in the same order.

    - * - * @param array An array containing elements to be copied and contained. - */ - constructor(items: Array); - /** - *

    Fill Constructor.

    - * - *

    Constructs a container with n elements. Each element is a copy of val (if provided).

    - * - * @param n Initial container size (i.e., the number of elements in the container at construction). - * @param val Value to fill the container with. Each of the n elements in the container is - * initialized to a copy of this value. - */ - constructor(size: number, val: T); - /** - *

    Copy Constructor.

    - * - *

    Constructs a container with a copy of each of the elements in container, in the same order.

    - * - * @param container Another container object of the same type (with the same class template - * arguments T), whose contents are either copied or acquired. - */ - constructor(container: Deque); - /** - *

    Range Constructor.

    - * - *

    Constructs a container with as many elements as the range (begin, end), with each - * element emplace-constructed from its corresponding element in that range, in the same order.

    - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - assign>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - assign(n: number, val: T): void; - /** - * @inheritdoc - */ - reserve(capacity: number): void; - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - begin(): DequeIterator; - /** - * @inheritdoc - */ - end(): DequeIterator; - /** - * @inheritdoc - */ - rbegin(): DequeReverseIterator; - /** - * @inheritdoc - */ - rend(): DequeReverseIterator; - /** - * @inheritdoc - */ - size(): number; - /** - * @inheritdoc - */ - empty(): boolean; - /** - * @inheritdoc - */ - capacity(): number; - /** - * @inheritdoc - */ - at(index: number): T; - /** - * @inheritdoc - */ - set(index: number, val: T): void; - /** - * @inheritdoc - */ - front(): T; - /** - * @inheritdoc - */ - back(): T; - /** - // Fetch row and column's index. - /** - * @hidden - */ - private fetch_index(index); - /** - * @inheritdoc - */ - push(...items: T[]): number; - /** - * @inheritdoc - */ - push_front(val: T): void; - /** - * @inheritdoc - */ - push_back(val: T): void; - /** - * @inheritdoc - */ - pop_front(): void; - /** - * @inheritdoc - */ - pop_back(): void; - /** - * @inheritdoc - */ - insert(position: DequeIterator, val: T): DequeIterator; - /** - * @inheritdoc - */ - insert(position: DequeIterator, n: number, val: T): DequeIterator; - /** - * @inheritdoc - */ - insert>(position: DequeIterator, begin: InputIterator, end: InputIterator): DequeIterator; - /** - * @inheritdoc - */ - insert(position: DequeReverseIterator, val: T): DequeReverseIterator; - /** - * @inheritdoc - */ - insert(position: DequeReverseIterator, n: number, val: T): DequeReverseIterator; - /** - * @inheritdoc - */ - insert>(position: DequeReverseIterator, begin: InputIterator, end: InputIterator): DequeReverseIterator; - /** - * @hidden - */ - private insert_by_val(position, val); - /** - * @hidden - */ - protected _Insert_by_repeating_val(position: DequeIterator, n: number, val: T): DequeIterator; - /** - * @hidden - */ - protected _Insert_by_range>(position: DequeIterator, begin: InputIterator, end: InputIterator): DequeIterator; - /** - * @hidden - */ - private insert_by_items(position, items); - /** - * @inheritdoc - */ - erase(position: DequeIterator): DequeIterator; - /** - * @inheritdoc - */ - erase(first: DequeIterator, last: DequeIterator): DequeIterator; - /** - * @inheritdoc - */ - erase(position: DequeReverseIterator): DequeReverseIterator; - /** - * @inheritdoc - */ - erase(first: DequeReverseIterator, last: DequeReverseIterator): DequeReverseIterator; - /** - * @hidden - */ - protected _Erase_by_range(first: DequeIterator, last: DequeIterator): DequeIterator; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link Deque container} object with same type of elements. Sizes and container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were in obj - * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link Deque container} of the same type of elements (i.e., instantiated - * with the same template parameter, T) whose content is swapped with that of this - * {@link container Deque}. - */ - swap(obj: Deque): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std { - /** - *

    An iterator of {@link Deque}.

    - * - *

    - * - *

    - * - * @author Jeongho Nam - */ - class DequeIterator extends Iterator implements base.IArrayIterator { - /** - * Sequence number of iterator in the source {@link Deque}. - */ - private index_; - /** - *

    Construct from the source {@link Deque container}.

    - * - *

    Note

    - *

    Do not create the iterator directly, by yourself.

    - *

    Use {@link Deque.begin begin()}, {@link Deque.end end()} in {@link Deque container} instead.

    - * - * @param source The source {@link Deque container} to reference. - * @param index Sequence number of the element in the source {@link Deque}. - */ - constructor(source: Deque, index: number); - /** - * @hidden - */ - private readonly deque; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * @inheritdoc - */ - readonly index: number; - /** - * @inheritdoc - */ - prev(): DequeIterator; - /** - * @inheritdoc - */ - next(): DequeIterator; - /** - * @inheritdoc - */ - advance(n: number): DequeIterator; - /** - *

    Whether an iterator is equal with the iterator.

    - * - *

    Compare two iterators and returns whether they are equal or not.

    - * - *

    Note

    - *

    Iterator's equal_to() only compare souce container and index number.

    - * - *

    Although elements in a pair, key and value are equal_to, if the source map or - * index number is different, then the {@link equal_to equal_to()} will return false. If you want to - * compare the elements of a pair, compare them directly by yourself.

    - * - * @param obj An iterator to compare - * @return Indicates whether equal or not. - */ - equal_to(obj: DequeIterator): boolean; - /** - * @inheritdoc - */ - swap(obj: DequeIterator): void; - } -} -declare namespace std { - /** - *

    A reverse-iterator of Deque.

    - * - *

    - * - *

    - * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class DequeReverseIterator extends ReverseIterator, DequeReverseIterator> implements base.IArrayIterator { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: DequeIterator); - /** - * @hidden - */ - protected create_neighbor(base: DequeIterator): DequeReverseIterator; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * Get index. - */ - readonly index: number; - } -} -declare namespace std { - /** - *

    Function handling termination on exception

    - * - *

    Calls the current terminate handler.

    - * - *

    By default, the terminate handler calls abort. But this behavior can be redefined by calling - * {@link set_terminate}.

    - * - *

    This function is automatically called when no catch handler can be found for a thrown exception, - * or for some other exceptional circumstance that makes impossible to continue the exception handling process.

    - * - *

    This function is provided so that the terminate handler can be explicitly called by a program that needs to - * abnormally terminate, and works even if {@link set_terminate} has not been used to set a custom terminate handler - * (calling abort in this case).

    - */ - function terminate(): void; - /** - *

    Set terminate handler function.

    - * - *

    A terminate handler function is a function automatically called when the exception handling process has - * to be abandoned for some reason. This happens when no catch handler can be found for a thrown exception, or for - * some other exceptional circumstance that makes impossible to continue the exception handling process.

    - * - *

    Before this function is called by the program for the first time, the default behavior is to call abort.

    - * - *

    A program may explicitly call the current terminate handler function by calling {@link terminate}.

    - * - * @param f Function that takes no parameters and returns no value (void). - */ - function set_terminate(f: () => void): void; - /** - *

    Get terminate handler function.

    - * - *

    The terminate handler function is automatically called when no catch handler can be found - * for a thrown exception, or for some other exceptional circumstance that makes impossible to continue the exception - * handling process.

    - * - *

    If no such function has been set by a previous call to {@link set_terminate}, the function returns a - * null-pointer.

    - * - * @return If {@link set_terminate} has previously been called by the program, the function returns the current - * terminate handler function. Otherwise, it returns a null-pointer. - */ - function get_terminate(): () => void; - /** - *

    Standard exception class.

    - * - *

    Base class for standard exceptions.

    - * - *

    All objects thrown by components of the standard library are derived from this class. - * Therefore, all standard exceptions can be caught by catching this type by reference.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/exception/exception - * @author Jeongho Nam - */ - class Exception extends Error { - /** - * A message representing specification about the Exception. - */ - private description; - /** - * Default Constructor. - */ - constructor(); - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - /** - *

    Get string identifying exception.

    - *

    Returns a string that may be used to identify the exception.

    - * - *

    The particular representation pointed by the returned value is implementation-defined. - * As a virtual function, derived classes may redefine this function so that specify value are - * returned.

    - */ - what(): string; - /** - * @inheritdoc - */ - readonly message: string; - /** - * @inheritdoc - */ - readonly name: string; - } - /** - *

    Logic error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report errors in the internal - * logical of the program, such as violation of logical preconditions or class invariants.

    - * - *

    These errors are presumably detectable before the program executes.

    - * - *

    It is used as a base class for several logical error exceptions.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/logic_error - * @author Jeongho Nam - */ - class LogicError extends Exception { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Domain error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report domain errors.

    - * - *

    Generally, the domain of a mathematical function is the subset of values that it is defined for. - * For example, the square root function is only defined for non-negative numbers. Thus, a negative number - * for such a function would qualify as a domain error.

    - * - *

    No component of the standard library throws exceptions of this type. It is designed as a standard - * exception to be thrown by programs.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/domain_error - * @author Jeongho Nam - */ - class DomainError extends LogicError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Invalid argument exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report an invalid argument.

    - * - *

    It is a standard exception that can be thrown by programs. Some components of the standard library - * also throw exceptions of this type to signal invalid arguments.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/invalid_argument - * @author Jeongho Nam - */ - class InvalidArgument extends LogicError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Length error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report a length error.

    - * - *

    It is a standard exception that can be thrown by programs. Some components of the standard library, - * such as vector and string also throw exceptions of this type to signal errors resizing.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/length_error - * @author Jeongho Nam - */ - class LengthError extends LogicError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Out-of-range exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report an out-of-range error.

    - * - *

    It is a standard exception that can be thrown by programs. Some components of the standard library, - * such as vector, deque, string and bitset also throw exceptions of this type to signal arguments - * out of range.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/out_of_range - * @author Jeongho Nam - */ - class OutOfRange extends LogicError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Runtime error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report errors that can only be - * detected during runtime.

    - * - *

    It is used as a base class for several runtime error exceptions.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/runtime_error - * @author Jeongho Nam - */ - class RuntimeError extends Exception { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Overflow error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to arithmetic overflow errors.

    - * - *

    It is a standard exception that can be thrown by programs. Some components of the standard library - * also throw exceptions of this type to signal range errors.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/overflow_error - * @author Jeongho Nam - */ - class OverflowError extends RuntimeError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Underflow error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to arithmetic underflow errors.

    - * - *

    No component of the standard library throws exceptions of this type. It is designed as a standard - * exception to be thrown by programs.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/underflow_error - * @author Jeongho Nam - */ - class UnderflowError extends RuntimeError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

    Range error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report range errors in internal - * computations.

    - * - *

    It is a standard exception that can be thrown by programs. Some components of the standard library - * also throw exceptions of this type to signal range errors.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/stdexcept/range_error - * @author Jeongho Nam - */ - class RangeError extends RuntimeError { - /** - *

    Construct from a message.

    - * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } -} -declare namespace std { - /** - *

    Function object class for equality comparison.

    - * - *

    Binary function object class whose call returns whether its two arguments compare equal (as returned by - * operator ==).

    - * - *

    Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} - * defined. This member function allows the object to be used with the same syntax as a function call.

    - * - * @param x First element to compare. - * @param y Second element to compare. - * - * @return Whether the arguments are equal. - */ - function equal_to(x: T, y: T): boolean; - /** - *

    Function object class for non-equality comparison.

    - * - *

    Binary function object class whose call returns whether its two arguments compare not equal (as returned - * by operator operator!=).

    - * - *

    Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} - * defined. This member function allows the object to be used with the same syntax as a function call.

    - * - * @param x First element to compare. - * @param y Second element to compare. - * - * @return Whether the arguments are not equal. - */ - function not_equal_to(x: T, y: T): boolean; - /** - *

    Function for less-than inequality comparison.

    - * - *

    Binary function returns whether the its first argument compares less than the second.

    - * - *

    Generically, function objects are instances of a class with member function {@link IComparable.less less} - * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. - * This member function allows the object to be used with the same syntax as a function call.

    - * - *

    Objects of this class can be used on standard algorithms such as {@link sort sort()}, - * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.

    - * - * @param Type of arguments to compare by the function call. The type shall supporrt the operation - * operator<() or method {@link IComparable.less less}. - * - * @param x First element, the standard of comparison. - * @param y Second element compare with the first. - * - * @return Whether the first parameter is less than the second. - */ - function less(x: T, y: T): boolean; - /** - *

    Function object class for less-than-or-equal-to comparison.

    - * - *

    Binary function object class whose call returns whether the its first argument compares {@link less less than} or - * {@link equal_to equal to} the second (as returned by operator <=).

    - * - *

    Generically, function objects are instances of a class with member function {@link IComparable.less less} - * and {@link IComparable.equal_to equal_to} defined. This member function allows the object to be used with the same - * syntax as a function call.

    - * - * @param x First element, the standard of comparison. - * @param y Second element compare with the first. - * - * @return Whether the x is {@link less less than} or {@link equal_to equal to} the y. - */ - function less_equal(x: T, y: T): boolean; - /** - *

    Function for greater-than inequality comparison.

    - * - *

    Binary function returns whether the its first argument compares greater than the second.

    - * - *

    Generically, function objects are instances of a class with member function {@link less} and - * {@link equal_to equal_to()} defined. If an object doesn't have those methods, then its own uid will be used - * to compare insteadly. This member function allows the object to be used with the same syntax as a function - * call.

    - * - *

    Objects of this class can be used on standard algorithms such as {@link sort sort()}, - * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.

    - * - * @param Type of arguments to compare by the function call. The type shall supporrt the operation - * operator>() or method {@link IComparable.greater greater}. - * - * @return Whether the x is greater than the y. - */ - function greater(x: T, y: T): boolean; - /** - *

    Function object class for greater-than-or-equal-to comparison.

    - * - *

    Binary function object class whose call returns whether the its first argument compares - * {@link greater greater than} or {@link equal_to equal to} the second (as returned by operator >=).

    - * - *

    Generically, function objects are instances of a class with member function {@link IComparable.less less} - * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. - * This member function allows the object to be used with the same syntax as a function call.

    - * - * @param x First element, the standard of comparison. - * @param y Second element compare with the first. - * - * @return Whether the x is {@link greater greater than} or {@link equal_to equal to} the y. - */ - function greater_equal(x: T, y: T): boolean; - /** - *

    Logical AND function object class.

    - * - *

    Binary function object class whose call returns the result of the logical "and" operation between its two - * arguments (as returned by operator &&).

    - * - *

    Generically, function objects are instances of a class with member function operator() defined. This member - * function allows the object to be used with the same syntax as a function call.

    - * - * @param x First element. - * @param y Second element. - * - * @return Result of logical AND operation. - */ - function logical_and(x: T, y: T): boolean; - /** - *

    Logical OR function object class.

    - * - *

    Binary function object class whose call returns the result of the logical "or" operation between its two - * arguments (as returned by operator ||).

    - * - *

    Generically, function objects are instances of a class with member function operator() defined. This member - * function allows the object to be used with the same syntax as a function call.

    - * - * @param x First element. - * @param y Second element. - * - * @return Result of logical OR operation. - */ - function logical_or(x: T, y: T): boolean; - /** - *

    Logical NOT function object class.

    - * - *

    Unary function object class whose call returns the result of the logical "not" operation on its argument - * (as returned by operator !).

    - * - *

    Generically, function objects are instances of a class with member function operator() defined. This member - * function allows the object to be used with the same syntax as a function call.

    - * - * @param x Target element. - * - * @return Result of logical NOT operation. - */ - function logical_not(x: T): boolean; - /** - *

    Bitwise AND function object class.

    - * - *

    Binary function object class whose call returns the result of applying the bitwise "and" operation between - * its two arguments (as returned by operator &).

    - * - * @param x First element. - * @param y Second element. - * - * @return Result of bitwise AND operation. - */ - function bit_and(x: number, y: number): number; - /** - *

    Bitwise OR function object class.

    - * - *

    Binary function object class whose call returns the result of applying the bitwise "and" operation between - * its two arguments (as returned by operator &).

    - * - * @param x First element. - * @param y Second element. - * - * @return Result of bitwise OR operation. - */ - function bit_or(x: number, y: number): number; - /** - *

    Bitwise XOR function object class.

    - * - *

    Binary function object class whose call returns the result of applying the bitwise "exclusive or" - * operation between its two arguments (as returned by operator ^).

    - * - * @param x First element. - * @param y Second element. - * - * @return Result of bitwise XOR operation. - */ - function bit_xor(x: number, y: number): number; - /** - *

    Comparable instance.

    - * - *

    {@link IComparable} is a common interface for objects who can compare each other.

    - * - * @reference https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html - * @author Jeongho Nam - */ - interface IComparable extends Object { - /** - *

    Indicates whether some other object is "equal to" this one.

    - * - *

    The {@link equal_to} method implements an equivalence relation on non-null object references:

    - * - *
      - *
    • - * It is reflexive: for any non-null reference value x, x.equal_to(x) - * should return true. - *
    • - *
    • - * It is symmetric: for any non-null reference values x and y, - * x.equal_to(y) should return true if and only if y.equal_to(x) - * returns true.
    • - *
    • - * It is transitive: for any non-null reference values x, y, and - * z, if x.equal_to(y) returns true and y.equal_to(z) - * returns true, then x.equal_to(z) should return true. - *
    • - *
    • - * It is consistent: for any non-null reference values x and y, multiple - * invocations of x.equal_to(y) consistently return true or consistently return - * false, provided no information used in equal_to comparisons on the objects is modified. - *
    • - *
    • - * For any non-null reference value x, x.equal_to(null) should return - * false. - *
    • - *
    - * - *

    The {@link equal_to} method for interface {@link IComparable} implements the most discriminating possible - * equivalence relation on objects; that is, for any non-null reference values x and - * y, this method returns true if and only if x and y - * refer to the same object (x == y has the value true).

    - * - *

    Note that it is generally necessary to override the {@link hash_code} method whenever this method is - * overridden, so as to maintain the general contract for the {@link hash_code} method, which states that - * equal objects must have equal hash codes.

    - * - *
      - *
    • {@link IComparable.equal_to} is called by {@link std.equal_to}.
    • - *
    - * - * @param obj the reference object with which to compare. - * - * @return true if this object is the same as the obj argument; false otherwise. - */ - equal_to(obj: T): boolean; - /** - *

    Less-than inequality comparison.

    - * - *

    Binary method returns whether the the instance compares less than the obj.

    - * - *
      - *
    • - * {@link IComparable.less} is called by {@link std.less}. Also, this method can be used on standard - * algorithms such as {@link sort sort()}, {@link merge merge()} or - * {@link TreeMap.lower_bound lower_bound()}. - *
    • - *
    - * - * @param obj the reference object with which to compare. - * - * @return Whether the first parameter is less than the second. - */ - less(obj: T): boolean; - /** - *

    Issue a hash code.

    - * - *

    Returns a hash code value for the object. This method is supported for the benefit of hash tables such - * as those provided by hash containers; {@link HashSet}, {@link HashMap}, {@link MultiHashSet} and - * {@link MultiHashMap}.

    - * - *

    As much as is reasonably practical, the {@link hash_code} method defined by interface - * {@link IComparable} does return distinct integers for distinct objects. (This is typically implemented by - * converting the internal address of the object into an integer, but this implementation technique is not - * required by the JavaScript programming language.)

    - * - *
      - *
    • - * {@link IComparable.hash_code} is called by {@link std.hash_code}. If you want to keep basically - * provided hash function, then returns {@link std.Hash.code}; return std.Hash.code(this); - *
    • - *
    - * - * @return An hash code who represents the object. - */ - hash(): number; - } - /** - *

    Default hash function for number.

    - * - *

    Unary function that defines the default hash function used by the standard library.

    - * - *

    The functional call returns a hash value of its argument: A hash value is a value that depends solely on - * its argument, returning always the same value for the same argument (for a given execution of a program). The - * value returned shall have a small likelihood of being the same as the one returned for a different argument. - *

    - * - * @param val Value to be hashed. - * - * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. - */ - function hash(val: number): number; - /** - *

    Default hash function for string.

    - * - *

    Unary function that defines the default hash function used by the standard library.

    - * - *

    The functional call returns a hash value of its argument: A hash value is a value that depends solely on - * its argument, returning always the same value for the same argument (for a given execution of a program). The - * value returned shall have a small likelihood of being the same as the one returned for a different argument. - *

    - * - * @param str A string to be hashed. - * - * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. - */ - function hash(str: string): number; - /** - *

    Default hash function for Object.

    - * - *

    Unary function that defines the default hash function used by the standard library.

    - * - *

    The functional call returns a hash value of its argument: A hash value is a value that depends solely on - * its argument, returning always the same value for the same argument (for a given execution of a program). The - * value returned shall have a small likelihood of being the same as the one returned for a different argument. - *

    - * - *

    The default {@link hash} function of Object returns a value returned from {@link hash hash(number)} with - * an unique id of each Object. If you want to specify {@link hash} function of a specific class, then - * define a member function public hash(): number in the class.

    - * - * @param obj Object to be hashed. - * - * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. - */ - function hash(obj: Object): number; - /** - *

    Exchange contents of {@link IContainers containers}.

    - * - *

    The contents of container left are exchanged with those of right. Both container objects must have - * same type of elements (same template parameters), although sizes may differ.

    - * - *

    After the call to this member function, the elements in left are those which were in right before - * the call, and the elements of right are those which were in left. All iterators, references and - * pointers remain valid for the swapped objects.

    - * - *

    This is an overload of the generic algorithm swap that improves its performance by mutually transferring - * ownership over their assets to the other container (i.e., the containers exchange references to their data, without - * actually performing any element copy or movement): It behaves as if left. - * {@link IContainer.swap swap}(right) was called.

    - * - * @param left A {@link IContainer container} to swap its contents. - * @param right A {@link IContainer container} to swap its contents. - */ - function swap(left: base.IContainer, right: base.IContainer): void; - /** - *

    Exchange contents of queues.

    - * - *

    Exchanges the contents of left and right.

    - * - * @param left A {@link Queue} container of the same type. Size may differ. - * @param right A {@link Queue} container of the same type. Size may differ. - */ - function swap(left: Queue, right: Queue): void; - /** - *

    Exchange contents of {@link PriorityQueue PriorityQueues}.

    - * - *

    Exchanges the contents of left and right.

    - * - * @param left A {@link PriorityQueue} container of the same type. Size may differ. - * @param right A {@link PriorityQueue} container of the same type. Size may differ. - */ - function swap(left: PriorityQueue, right: PriorityQueue): void; - /** - *

    Exchange contents of {@link Stack Stacks}.

    - * - *

    Exchanges the contents of left and right.

    - * - * @param left A {@link Stack} container of the same type. Size may differ. - * @param right A {@link Stack} container of the same type. Size may differ. - */ - function swap(left: Stack, right: Stack): void; - /** - *

    Exchanges the contents of two {@link UniqueMap unique maps}.

    - * - *

    The contents of container left are exchanged with those of right. Both container objects must - * be of the same type (same template parameters), although sizes may differ.

    - * - *

    After the call to this member function, the elements in left are those which were in right - * before the call, and the elements of right are those which were in left. All iterators, references - * and pointers remain valid for the swapped objects.

    - * - *

    This is an overload of the generic algorithm swap that improves its performance by mutually transferring - * ownership over their assets to the other container (i.e., the containers exchange references to their data, - * without actually performing any element copy or movement): It behaves as if - * left.{@link UniqueMap.swap swap}(right) was called.

    - * - * @param left An {@link UniqueMap unique map} to swap its conents. - * @param right An {@link UniqueMap unique map} to swap its conents. - */ - function swap(left: base.UniqueMap, right: base.UniqueMap): void; - /** - *

    Exchanges the contents of two {@link MultiMap multi maps}.

    - * - *

    The contents of container left are exchanged with those of right. Both container objects must - * be of the same type (same template parameters), although sizes may differ.

    - * - *

    After the call to this member function, the elements in left are those which were in right - * before the call, and the elements of right are those which were in left. All iterators, references - * and pointers remain valid for the swapped objects.

    - * - *

    This is an overload of the generic algorithm swap that improves its performance by mutually transferring - * ownership over their assets to the other container (i.e., the containers exchange references to their data, - * without actually performing any element copy or movement): It behaves as if - * left.{@link MultiMap.swap swap}(right) was called.

    - * - * @param left A {@link MultiMap multi map} to swap its conents. - * @param right A {@link MultiMap multi map} to swap its conents. - */ - function swap(left: base.MultiMap, right: base.MultiMap): void; -} -declare namespace std { - /** - *

    Bind function arguments.

    - * - *

    Returns a function object based on fn, but with its arguments bound to args.

    - * - *

    Each argument may either be bound to a value or be a {@link placeholders placeholder}:

    - *
      - *
    • If bound to a value, calling the returned function object will always use that value as argument.
    • - *
    • - * If a {@link placeholders placeholder}, calling the returned function object forwards an argument passed to the - * call (the one whose order number is specified by the placeholder). - *
    • - *
    - * - *

    Calling the returned object returns the same type as fn.

    - * - * @param fn A function object, pointer to function or pointer to member. - * @param args List of arguments to bind: either values, or {@link placeholders}. - * - * @return A function object that, when called, calls fn with its arguments bound to args. If fn is - * a pointer to member, the first argument expected by the returned function is an object of the class fn - * is a member. - */ - function bind(fn: (...args: any[]) => Ret, ...args: any[]): (...args: any[]) => Ret; - /** - *

    Bind function arguments.

    - * - *

    Returns a function object based on fn, but with its arguments bound to args.

    - * - *

    Each argument may either be bound to a value or be a {@link placeholders placeholder}:

    - *
      - *
    • If bound to a value, calling the returned function object will always use that value as argument.
    • - *
    • - * If a {@link placeholders placeholder}, calling the returned function object forwards an argument passed to the - * call (the one whose order number is specified by the placeholder). - *
    • - *
    - * - *

    Calling the returned object returns the same type as fn.

    - * - * @param fn A function object, pointer to function or pointer to member. - * @param thisArg This argument, owner object of the member method fn. - * @param args List of arguments to bind: either values, or {@link placeholders}. - * - * @return A function object that, when called, calls fn with its arguments bound to args. If fn is - * a pointer to member, the first argument expected by the returned function is an object of the class fn - * is a member. - */ - function bind(fn: (...args: any[]) => Ret, thisArg: T, ...args: any[]): (...args: any[]) => Ret; -} -/** - *

    Bind argument placeholders.

    - * - *
    - * - *

    When the function object returned by bind is called, an argument with placeholder {@link _1} is replaced by the - * first argument in the call, {@link _2} is replaced by the second argument in the call, and so on... For example:

    - * - * - * let vec: Vector = new Vector(); - * - * let bind = std.bind(Vector.insert, _1, vec.end(), _2, _3); - * bind.apply(vec, 5, 1); // vec.insert(vec.end(), 5, 1); - * // [1, 1, 1, 1, 1] - * - * - *

    When a call to {@link bind} is used as a subexpression in another call to bind, the {@link placeholders} - * are relative to the outermost {@link bind} expression.

    - * - * @reference http://www.cplusplus.com/reference/functional/placeholders/ - * @author Jeongho Nam - */ -declare namespace std.placeholders { - /** - * @hidden - */ - class PlaceHolder { - private index_; - constructor(index: number); - readonly index: number; - } - /** - * Replaced by the first argument in the function call. - */ - const _1: PlaceHolder; - /** - * Replaced by the second argument in the function call. - */ - const _2: PlaceHolder; - /** - * Replaced by the third argument in the function call. - */ - const _3: PlaceHolder; - const _4: PlaceHolder; - const _5: PlaceHolder; - const _6: PlaceHolder; - const _7: PlaceHolder; - const _8: PlaceHolder; - const _9: PlaceHolder; - const _10: PlaceHolder; - const _11: PlaceHolder; - const _12: PlaceHolder; - const _13: PlaceHolder; - const _14: PlaceHolder; - const _15: PlaceHolder; - const _16: PlaceHolder; - const _17: PlaceHolder; - const _18: PlaceHolder; - const _19: PlaceHolder; - const _20: PlaceHolder; -} -declare namespace std.HashMap { - type iterator = std.MapIterator; - type reverse_iterator = std.MapReverseIterator; -} -declare namespace std { - /** - *

    Hashed, unordered map.

    - * - *

    {@link HashMap}s are associative containers that store elements formed by the combination of a key value - * and a mapped value, and which allows for fast retrieval of individual elements based on their keys. - *

    - * - *

    In an {@link HashMap}, the key value is generally used to uniquely identify the element, while the - * mapped value is an object with the content associated to this key. Types of key and - * mapped value may differ.

    - * - *

    Internally, the elements in the {@link HashMap} are not sorted in any particular order with respect to either - * their key or mapped values, but organized into buckets depending on their hash values to allow - * for fast access to individual elements directly by their key values (with a constant average time complexity - * on average).

    - * - *

    {@link HashMap} containers are faster than {@link TreeMap} containers to access individual elements by their - * key, although they are generally less efficient for range iteration through a subset of their elements.

    - * - *

    - * - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
    - * - *
    Hashed
    - *
    Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
    - * - *
    Map
    - *
    Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value.
    - * - *
    Unique keys
    - *
    No two elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the key values. - * Each element in an {@link HashMap} is uniquely identified by its key value. - * @param Type of the mapped value. - * Each element in an {@link HashMap} is used to store some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/unordered_map/unordered_map - * @author Jeongho Nam - */ - class HashMap extends base.UniqueMap implements base.IHashMap { - /** - * @hidden - */ - private hash_buckets_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from elements. - */ - constructor(items: Pair[]); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - */ - constructor(array: [Key, T][]); - /** - * Copy Constructor. - */ - constructor(container: HashMap); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator>, end: Iterator>); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: Key): MapIterator; - /** - * @inheritdoc - */ - begin(): MapIterator; - /** - * @inheritdoc - */ - begin(index: number): MapIterator; - /** - * @inheritdoc - */ - end(): MapIterator; - /** - * @inheritdoc - */ - end(index: number): MapIterator; - /** - * @inheritdoc - */ - rbegin(): MapReverseIterator; - /** - * @inheritdoc - */ - rbegin(index: number): MapReverseIterator; - /** - * @inheritdoc - */ - rend(): MapReverseIterator; - /** - * @inheritdoc - */ - rend(index: number): MapReverseIterator; - /** - * @inheritdoc - */ - bucket_count(): number; - /** - * @inheritdoc - */ - bucket_size(index: number): number; - /** - * @inheritdoc - */ - max_load_factor(): number; - /** - * @inheritdoc - */ - max_load_factor(z: number): void; - /** - * @inheritdoc - */ - bucket(key: Key): number; - /** - * @inheritdoc - */ - reserve(n: number): void; - /** - * @inheritdoc - */ - rehash(n: number): void; - /** - * @hidden - */ - protected _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link HashMap map} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link HashMap map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashMap container}. - */ - swap(obj: HashMap): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer>): void; - } -} -declare namespace std.HashMultiMap { - type iterator = std.MapIterator; - type reverse_iterator = std.MapReverseIterator; -} -declare namespace std { - /** - *

    Hashed, unordered Multimap.

    - * - *

    {@link HashMultiMap}s are associative containers that store elements formed by the combination of - * a key value and a mapped value, much like {@link HashMultiMap} containers, but allowing - * different elements to have equivalent keys.

    - * - *

    In an {@link HashMultiMap}, the key value is generally used to uniquely identify the - * element, while the mapped value is an object with the content associated to this key. - * Types of key and mapped value may differ.

    - * - *

    Internally, the elements in the {@link HashMultiMap} are not sorted in any particular order with - * respect to either their key or mapped values, but organized into buckets depending on - * their hash values to allow for fast access to individual elements directly by their key values - * (with a constant average time complexity on average).

    - * - *

    Elements with equivalent keys are grouped together in the same bucket and in such a way that - * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

    - * - *

    - * - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
    - * - *
    Hashed
    - *
    Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
    - * - *
    Map
    - *
    Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value.
    - * - *
    Multiple equivalent keys
    - *
    The container can hold multiple elements with equivalent keys.
    - *
    - * - * @param Type of the key values. - * Each element in an {@link HashMultiMap} is identified by a key value. - * @param Type of the mapped value. - * Each element in an {@link HashMultiMap} is used to store some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/unordered_map/unordered_multimap - * @author Jeongho Nam - */ - class HashMultiMap extends base.MultiMap { - /** - * @hidden - */ - private hash_buckets_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from elements. - */ - constructor(items: Pair[]); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - */ - constructor(array: [Key, T][]); - /** - * Copy Constructor. - */ - constructor(container: HashMultiMap); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator>, end: Iterator>); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: Key): MapIterator; - /** - * @inheritdoc - */ - count(key: Key): number; - /** - * @inheritdoc - */ - begin(): MapIterator; - /** - * @inheritdoc - */ - begin(index: number): MapIterator; - /** - * @inheritdoc - */ - end(): MapIterator; - /** - * @inheritdoc - */ - end(index: number): MapIterator; - /** - * @inheritdoc - */ - rbegin(): MapReverseIterator; - /** - * @inheritdoc - */ - rbegin(index: number): MapReverseIterator; - /** - * @inheritdoc - */ - rend(): MapReverseIterator; - /** - * @inheritdoc - */ - rend(index: number): MapReverseIterator; - /** - * @inheritdoc - */ - bucket_count(): number; - /** - * @inheritdoc - */ - bucket_size(n: number): number; - /** - * @inheritdoc - */ - max_load_factor(): number; - /** - * @inheritdoc - */ - max_load_factor(z: number): void; - /** - * @inheritdoc - */ - bucket(key: Key): number; - /** - * @inheritdoc - */ - reserve(n: number): void; - /** - * @inheritdoc - */ - rehash(n: number): void; - /** - * @hidden - */ - protected _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link HashMultiMap map} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link HashMultiMap map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashMultiMap container}. - */ - swap(obj: HashMultiMap): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer>): void; - } -} -declare namespace std.HashMultiSet { - type iterator = std.SetIterator; - type reverse_iterator = std.SetReverseIterator; -} -declare namespace std { - /** - *

    Hashed, unordered Multiset.

    - * - *

    {@link HashMultiSet HashMultiSets} are containers that store elements in no particular order, allowing fast - * retrieval of individual elements based on their value, much like {@link HashMultiSet} containers, - * but allowing different elements to have equivalent values.

    - * - *

    In an {@link HashMultiSet}, the value of an element is at the same time its key, used to - * identify it. Keys are immutable, therefore, the elements in an {@link HashMultiSet} cannot be - * modified once in the container - they can be inserted and removed, though.

    - * - *

    Internally, the elements in the {@link HashMultiSet} are not sorted in any particular, but - * organized into buckets depending on their hash values to allow for fast access to individual - * elements directly by their values (with a constant average time complexity on average).

    - * - *

    Elements with equivalent values are grouped together in the same bucket and in such a way that an - * iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
    - * - *
    Hashed
    - *
    Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - * - *
    Multiple equivalent keys
    - *
    The container can hold multiple elements with equivalent keys.
    - *
    - * - * @param Type of the elements. - * Each element in an {@link UnorderedMultiSet} is also identified by this value.. - * - * @reference http://www.cplusplus.com/reference/unordered_set/unordered_multiset - * @author Jeongho Nam - */ - class HashMultiSet extends base.MultiSet { - /** - * @hidden - */ - private hash_buckets_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from elements. - */ - constructor(items: T[]); - /** - * Copy Constructor. - */ - constructor(container: HashMultiSet); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: T): SetIterator; - /** - * @inheritdoc - */ - count(key: T): number; - /** - * @inheritdoc - */ - begin(): SetIterator; - /** - * @inheritdoc - */ - begin(index: number): SetIterator; - /** - * @inheritdoc - */ - end(): SetIterator; - /** - * @inheritdoc - */ - end(index: number): SetIterator; - /** - * @inheritdoc - */ - rbegin(): SetReverseIterator; - /** - * @inheritdoc - */ - rbegin(index: number): SetReverseIterator; - /** - * @inheritdoc - */ - rend(): SetReverseIterator; - /** - * @inheritdoc - */ - rend(index: number): SetReverseIterator; - /** - * @inheritdoc - */ - bucket_count(): number; - /** - * @inheritdoc - */ - bucket_size(n: number): number; - /** - * @inheritdoc - */ - max_load_factor(): number; - /** - * @inheritdoc - */ - max_load_factor(z: number): void; - /** - * @inheritdoc - */ - bucket(key: T): number; - /** - * @inheritdoc - */ - reserve(n: number): void; - /** - * @inheritdoc - */ - rehash(n: number): void; - /** - * @hidden - */ - protected _Insert_by_val(val: T): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link HashMultiSet set} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link HashMultiSet set container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashMultiSet container}. - */ - swap(obj: HashMultiSet): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std.HashSet { - type iterator = std.SetIterator; - type reverse_iterator = std.SetReverseIterator; -} -declare namespace std { - /** - *

    Hashed, unordered set.

    - * - *

    {@link HashSet}s are containers that store unique elements in no particular order, and which - * allow for fast retrieval of individual elements based on their value.

    - * - *

    In an {@link HashSet}, the value of an element is at the same time its key, that - * identifies it uniquely. Keys are immutable, therefore, the elements in an {@link HashSet} cannot be - * modified once in the container - they can be inserted and removed, though.

    - * - *

    Internally, the elements in the {@link HashSet} are not sorted in any particular order, but - * organized into buckets depending on their hash values to allow for fast access to individual elements - * directly by their values (with a constant average time complexity on average).

    - * - *

    {@link HashSet} containers are faster than {@link TreeSet} containers to access individual - * elements by their key, although they are generally less efficient for range iteration through a - * subset of their elements.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
    - * - *
    Hashed
    - *
    Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - * - *
    Unique keys
    - *
    No two elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the elements. - * Each element in an {@link HashSet} is also uniquely identified by this value. - * - * @reference http://www.cplusplus.com/reference/unordered_set/unordered_set - * @author Jeongho Nam - */ - class HashSet extends base.UniqueSet implements base.IHashSet { - /** - * @hidden - */ - private hash_buckets_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from elements. - */ - constructor(items: T[]); - /** - * Copy Constructor. - */ - constructor(container: HashSet); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: T): SetIterator; - /** - * @inheritdoc - */ - begin(): SetIterator; - /** - * @inheritdoc - */ - begin(index: number): SetIterator; - /** - * @inheritdoc - */ - end(): SetIterator; - /** - * @inheritdoc - */ - end(index: number): SetIterator; - /** - * @inheritdoc - */ - rbegin(): SetReverseIterator; - /** - * @inheritdoc - */ - rbegin(index: number): SetReverseIterator; - /** - * @inheritdoc - */ - rend(): SetReverseIterator; - /** - * @inheritdoc - */ - rend(index: number): SetReverseIterator; - /** - * @inheritdoc - */ - bucket_count(): number; - /** - * @inheritdoc - */ - bucket_size(n: number): number; - /** - * @inheritdoc - */ - max_load_factor(): number; - /** - * @inheritdoc - */ - max_load_factor(z: number): void; - /** - * @inheritdoc - */ - bucket(key: T): number; - /** - * @inheritdoc - */ - reserve(n: number): void; - /** - * @inheritdoc - */ - rehash(n: number): void; - /** - * @hidden - */ - protected _Insert_by_val(val: T): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link HashSet set} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link HashSet set container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashSet container}. - */ - swap(obj: HashSet): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std.List { - type iterator = std.ListIterator; - type reverse_iterator = std.ListReverseIterator; -} -declare namespace std { - /** - *

    Doubly linked list.

    - * - *

    {@link List}s are sequence containers that allow constant time insert and erase operations anywhere within the - * sequence, and iteration in both directions.

    - * - *

    List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements they - * contain in different and unrelated storage locations. The ordering is kept internally by the association to each - * element of a link to the element preceding it and a link to the element following it.

    - * - *

    They are very similar to forward_list: The main difference being that forward_list objects are single-linked - * lists, and thus they can only be iterated forwards, in exchange for being somewhat smaller and more efficient.

    - * - *

    Compared to other base standard sequence containers (array, vector and deque), lists perform generally better - * in inserting, extracting and moving elements in any position within the container for which an iterator has already - * been obtained, and therefore also in algorithms that make intensive use of these, like sorting algorithms.

    - * - *

    The main drawback of lists and forward_lists compared to these other sequence containers is that they lack - * direct access to the elements by their position; For example, to access the sixth element in a list, one has to - * iterate from a known position (like the beginning or the end) to that position, which takes linear time in the - * distance between these. They also consume some extra memory to keep the linking information associated to each - * element (which may be an important factor for large lists of small-sized elements).

    - * - *

    - * - *

    - * - *

    Container properties

    - *
    - *
    Sequence
    - *
    Elements in sequence containers are ordered in a strict linear sequence. Individual elements are accessed by - * their position in this sequence.
    - * - *
    Doubly-linked list
    - *
    Each element keeps information on how to locate the next and the previous elements, allowing constant time - * insert and erase operations before or after a specific element (even of entire ranges), but no direct random - * access.
    - *
    - * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/list/list/ - * @author Jeongho Nam - */ - class List extends base.Container implements base.IDequeContainer { - /** - * @hidden - */ - private begin_; - /** - * @hidden - */ - private end_; - /** - * @hidden - */ - private size_; - /** - *

    Default Constructor.

    - * - *

    Constructs an empty container, with no elements.

    - */ - constructor(); - /** - *

    Initializer list Constructor.

    - * - *

    Constructs a container with a copy of each of the elements in array, in the same order.

    - * - * @param array An array containing elements to be copied and contained. - */ - constructor(items: Array); - /** - *

    Fill Constructor.

    - * - *

    Constructs a container with n elements. Each element is a copy of val (if provided).

    - * - * @param n Initial container size (i.e., the number of elements in the container at construction). - * @param val Value to fill the container with. Each of the n elements in the container is - * initialized to a copy of this value. - */ - constructor(size: number, val: T); - /** - *

    Copy Constructor.

    - * - *

    Constructs a container with a copy of each of the elements in container, in the same order.

    - * - * @param container Another container object of the same type (with the same class template - * arguments T), whose contents are either copied or acquired. - */ - constructor(container: List); - /** - *

    Range Constructor.

    - * - *

    Constructs a container with as many elements as the range (begin, end), with each - * element emplace-constructed from its corresponding element in that range, in the same order.

    - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - assign(n: number, val: T): void; - /** - * @inheritdoc - */ - assign>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - begin(): ListIterator; - /** - * @inheritdoc - */ - end(): ListIterator; - /** - * @inheritdoc - */ - rbegin(): ListReverseIterator; - /** - * @inheritdoc - */ - rend(): ListReverseIterator; - /** - * @inheritdoc - */ - size(): number; - /** - * @inheritdoc - */ - front(): T; - /** - * @inheritdoc - */ - back(): T; - /** - * @inheritdoc - */ - push(...items: U[]): number; - /** - * @inheritdoc - */ - push_front(val: T): void; - /** - * @inheritdoc - */ - push_back(val: T): void; - /** - * @inheritdoc - */ - pop_front(): void; - /** - * @inheritdoc - */ - pop_back(): void; - /** - *

    Insert an element.

    - * - *

    The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    - * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Position in the container where the new element is inserted. - * {@link iterator}> is a member type, defined as a - * {@link ListIterator bidirectional iterator} type that points to elements. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the newly inserted element; val. - */ - insert(position: ListIterator, val: T): ListIterator; - /** - *

    Insert elements by repeated filling.

    - * - *

    The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    - * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListIterator bidirectional iterator} type that points to - * elements. - * @param size Number of elements to insert. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: ListIterator, size: number, val: T): ListIterator; - /** - *

    Insert elements by range iterators.

    - * - *

    The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    - * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListIterator bidirectional iterator} type that points to - * elements. - * @param begin An iterator specifying range of the begining element. - * @param end An iterator specifying range of the ending element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; - /** - *

    Insert an element.

    - * - *

    The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    - * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Position in the container where the new element is inserted. - * {@link iterator}> is a member type, defined as a - * {@link ListReverseIterator bidirectional iterator} type that points to elements. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the newly inserted element; val. - */ - insert(position: ListReverseIterator, val: T): ListReverseIterator; - /** - *

    Insert elements by repeated filling.

    - * - *

    The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    - * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to - * elements. - * @param size Number of elements to insert. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: ListReverseIterator, size: number, val: T): ListReverseIterator; - /** - *

    Insert elements by range iterators.

    - * - *

    The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

    - * - *

    Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to - * elements. - * @param begin An iterator specifying range of the begining element. - * @param end An iterator specifying range of the ending element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: ListReverseIterator, begin: InputIterator, end: InputIterator): ListReverseIterator; - /** - * @hidden - */ - private insert_by_val(position, val); - /** - * @hidden - */ - protected _Insert_by_repeating_val(position: ListIterator, size: number, val: T): ListIterator; - /** - * @hidden - */ - protected _Insert_by_range>(position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; - /** - *

    Erase an element.

    - * - *

    Removes from the {@link List} either a single element; position.

    - * - *

    This effectively reduces the container size by the number of element removed.

    - * - *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Iterator pointing to a single element to be removed from the {@link List}. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link end end()} if the operation erased the last element in the sequence. - */ - erase(position: ListIterator): ListIterator; - /** - *

    Erase elements.

    - * - *

    Removes from the {@link List} container a range of elements.

    - * - *

    This effectively reduces the container {@link size} by the number of elements removed.

    - * - *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link end end()} if the operation erased the last element in the sequence. - */ - erase(begin: ListIterator, end: ListIterator): ListIterator; - /** - *

    Erase an element.

    - * - *

    Removes from the {@link List} either a single element; position.

    - * - *

    This effectively reduces the container size by the number of element removed.

    - * - *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param position Iterator pointing to a single element to be removed from the {@link List}. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link rend rend()} if the operation erased the last element in the sequence. - */ - erase(position: ListReverseIterator): ListReverseIterator; - /** - *

    Erase elements.

    - * - *

    Removes from the {@link List} container a range of elements.

    - * - *

    This effectively reduces the container {@link size} by the number of elements removed.

    - * - *

    Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

    - * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link rend rend()} if the operation erased the last element in the sequence. - */ - erase(begin: ListReverseIterator, end: ListReverseIterator): ListReverseIterator; - /** - * @hidden - */ - protected _Erase_by_range(first: ListIterator, last: ListIterator): ListIterator; - /** - *

    Remove duplicate values.

    - * - *

    Removes all but the first element from every consecutive group of equal elements in the

    - * - *

    Notice that an element is only removed from the {@link List} container if it compares equal to the - * element immediately preceding it. Thus, this function is especially useful for sorted lists.

    - */ - unique(): void; - /** - *

    Remove duplicate values.

    - * - *

    Removes all but the first element from every consecutive group of equal elements in the

    - * - *

    The argument binary_pred is a specific comparison function that determine the uniqueness - * of an element. In fact, any behavior can be implemented (and not only an equality comparison), but notice - * that the function will call binary_pred(it.value, it.prev().value) for all pairs of elements - * (where it is an iterator to an element, starting from the second) and remove it - * from the {@link List} if the predicate returns true. - * - *

    Notice that an element is only removed from the {@link List} container if it compares equal to the - * element immediately preceding it. Thus, this function is especially useful for sorted lists.

    - * - * @param binary_pred Binary predicate that, taking two values of the same type than those contained in the - * {@link List}, returns true to remove the element passed as first argument - * from the container, and false otherwise. This shall be a function pointer - * or a function object. - */ - unique(binary_pred: (left: T, right: T) => boolean): void; - /** - *

    Remove elements with specific value.

    - * - *

    Removes from the container all the elements that compare equal to val. This calls the - * destructor of these objects and reduces the container {@link size} by the number of elements removed.

    - * - *

    Unlike member function {@link List.erase}, which erases elements by their position (using an - * iterator), this function ({@link List.remove}) removes elements by their value.

    - * - *

    A similar function, {@link List.remove_if}, exists, which allows for a condition other than an - * equality comparison to determine whether an element is removed.

    - * - * @param val Value of the elements to be removed. - */ - remove(val: T): void; - /** - *

    Remove elements fulfilling condition.

    - * - *

    Removes from the container all the elements for which pred returns true. This - * calls the destructor of these objects and reduces the container {@link size} by the number of elements - * removed.

    - * - *

    The function calls pred(it.value) for each element (where it is an iterator - * to that element). Any of the elements in the list for which this returns true, are removed - * from the

    - * - * @param pred Unary predicate that, taking a value of the same type as those contained in the forward_list - * object, returns true for those values to be removed from the container, and - * false for those remaining. This can either be a function pointer or a function - * object. - */ - remove_if(pred: (val: T) => boolean): void; - /** - *

    Merge sorted {@link List Lists}.

    - * - *

    Merges obj into the {@link List} by transferring all of its elements at their respective - * ordered positions into the container (both containers shall already be ordered). - *

    - * - *

    This effectively removes all the elements in obj (which becomes {@link empty}), and inserts - * them into their ordered position within container (which expands in {@link size} by the number of elements - * transferred). The operation is performed without constructing nor destroying any element: they are - * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports - * move-construction or not.

    - * - *

    This function requires that the {@link List} containers have their elements already ordered by value - * ({@link less}) before the call. For an alternative on unordered {@link List Lists}, see - * {@link List.splice}.

    - * - *

    Assuming such ordering, each element of obj is inserted at the position that corresponds to its - * value according to the strict weak ordering defined by {@link less}. The resulting order of equivalent - * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and - * existing elements precede those equivalent inserted from obj).

    - * - * The function does nothing if this == obj. - * - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - * Note that this function modifies obj no matter whether an lvalue or rvalue reference is - * passed. - */ - merge(obj: List): void; - /** - *

    Merge sorted {@link List Lists}.

    - * - *

    Merges obj into the {@link List} by transferring all of its elements at their respective - * ordered positions into the container (both containers shall already be ordered). - *

    - * - *

    This effectively removes all the elements in obj (which becomes {@link empty}), and inserts - * them into their ordered position within container (which expands in {@link size} by the number of elements - * transferred). The operation is performed without constructing nor destroying any element: they are - * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports - * move-construction or not.

    - * - *

    The argument compare is a specific predicate to perform the comparison operation between - * elements. This comparison shall produce a strict weak ordering of the elements (i.e., a consistent - * transitive comparison, without considering its reflexiveness). - * - *

    This function requires that the {@link List} containers have their elements already ordered by - * compare before the call. For an alternative on unordered {@link List Lists}, see - * {@link List.splice}.

    - * - *

    Assuming such ordering, each element of obj is inserted at the position that corresponds to its - * value according to the strict weak ordering defined by compare. The resulting order of equivalent - * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and - * existing elements precede those equivalent inserted from obj).

    - * - * The function does nothing if this == obj. - * - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - * Note that this function modifies obj no matter whether an lvalue or rvalue reference is - * passed. - * @param compare Binary predicate that, taking two values of the same type than those contained in the - * {@link list}, returns true if the first argument is considered to go before - * the second in the strict weak ordering it defines, and false otherwise. - * This shall be a function pointer or a function object. - */ - merge(obj: List, compare: (left: T, right: T) => boolean): void; - /** - *

    Transfer elements from {@link List} to {@link List}.

    - * - *

    Transfers elements from obj into the container, inserting them at position.

    - * - *

    This effectively inserts all elements into the container and removes them from obj, altering - * the sizes of both containers. The operation does not involve the construction or destruction of any - * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the - * value_type supports move-construction or not.

    - * - *

    This first version (1) transfers all the elements of obj into the

    - * - * @param position Position within the container where the elements of obj are inserted. - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - */ - splice(position: ListIterator, obj: List): void; - /** - *

    Transfer an element from {@link List} to {@link List}.

    - * - *

    Transfers an element from obj, which is pointed by an {@link ListIterator iterator} it, - * into the container, inserting the element at specified position.

    - * - *

    This effectively inserts an element into the container and removes it from obj, altering the - * sizes of both containers. The operation does not involve the construction or destruction of any element. - * They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type - * supports move-construction or not.

    - * - *

    This second version (2) transfers only the element pointed by it from obj into the - *

    - * - * @param position Position within the container where the element of obj is inserted. - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - * This parameter may be this if position points to an element not actually - * being spliced. - * @param it {@link ListIterator Iterator} to an element in obj. Only this single element is - * transferred. - */ - splice(position: ListIterator, obj: List, it: ListIterator): void; - /** - *

    Transfer elements from {@link List} to {@link List}.

    - * - *

    Transfers elements from obj into the container, inserting them at position.

    - * - *

    This effectively inserts those elements into the container and removes them from obj, altering - * the sizes of both containers. The operation does not involve the construction or destruction of any - * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the - * value_type supports move-construction or not.

    - * - *

    This third version (3) transfers the range [begin, end) from obj into the - *

    - * - * @param position Position within the container where the elements of obj are inserted. - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - * This parameter may be this if position points to an element not actually - * being spliced. - * @param begin {@link ListIterator An Iterator} specifying initial position of a range of elements in - * obj. Transfers the elements in the range [begin, end) to - * position. - * @param end {@link ListIterator An Iterator} specifying final position of a range of elements in - * obj. Transfers the elements in the range [begin, end) to - * position. Notice that the range includes all the elements between begin and - * end, including the element pointed by begin but not the one pointed by end. - */ - splice(position: ListIterator, obj: List, begin: ListIterator, end: ListIterator): void; - /** - *

    Sort elements in

    - * - *

    Sorts the elements in the {@link List}, altering their position within the

    - * - *

    The sorting is performed by applying an algorithm that uses {@link less}. This comparison shall - * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without - * considering its reflexiveness).

    - * - *

    The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative - * order they had before the call.

    - * - *

    The entire operation does not involve the construction, destruction or copy of any element object. - * Elements are moved within the

    - */ - sort(): void; - /** - *

    Sort elements in

    - * - *

    Sorts the elements in the {@link List}, altering their position within the

    - * - *

    The sorting is performed by applying an algorithm that uses compare. This comparison shall - * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without - * considering its reflexiveness).

    - * - *

    The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative - * order they had before the call.

    - * - *

    The entire operation does not involve the construction, destruction or copy of any element object. - * Elements are moved within the

    - * - * @param compare Binary predicate that, taking two values of the same type of those contained in the - * {@link List}, returns true if the first argument goes before the second - * argument in the strict weak ordering it defines, and false otherwise. This - * shall be a function pointer or a function object. - */ - sort(compare: (left: T, right: T) => boolean): void; - /** - * @hidden - */ - private qsort(first, last, compare); - /** - * @hidden - */ - private partition(first, last, compare); - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link List container} object with same type of elements. Sizes and container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were in obj - * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link List container} of the same type of elements (i.e., instantiated - * with the same template parameter, T) whose content is swapped with that of this - * {@link container List}. - */ - swap(obj: List): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std { - /** - *

    An iterator, node of a List.

    - * - *

    - * - *

    - * - * @author Jeongho Nam - */ - class ListIterator extends Iterator { - /** - * @hidden - */ - private prev_; - /** - * @hidden - */ - private next_; - /** - * @hidden - */ - private value_; - /** - *

    Construct from the source {@link List container}.

    - * - *

    Note

    - *

    Do not create the iterator directly, by yourself.

    - *

    Use {@link List.begin begin()}, {@link List.end end()} in {@link List container} instead.

    - * - * @param source The source {@link List container} to reference. - * @param prev A refenrece of previous node ({@link ListIterator iterator}). - * @param next A refenrece of next node ({@link ListIterator iterator}). - * @param value Value to be stored in the node (iterator). - */ - constructor(source: List, prev: ListIterator, next: ListIterator, value: T); - private list(); - /** - * @inheritdoc - */ - prev(): ListIterator; - /** - * @inheritdoc - */ - next(): ListIterator; - /** - * @inheritdoc - */ - advance(step: number): ListIterator; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * @inheritdoc - */ - equal_to(obj: ListIterator): boolean; - /** - * @inheritdoc - */ - swap(obj: ListIterator): void; - } -} -declare namespace std { - /** - *

    A reverse-iterator of List.

    - * - *

    - * - *

    - * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class ListReverseIterator extends ReverseIterator, ListReverseIterator> { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: ListIterator); - /** - * @hidden - */ - protected create_neighbor(base: ListIterator): ListReverseIterator; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - } -} -declare namespace std.Vector { - type iterator = std.VectorIterator; - type reverse_iterator = std.VectorReverseIterator; -} -declare namespace std { - /** - *

    Vector, the dynamic array.

    - * - *

    {@link Vector}s are sequence containers representing arrays that can change in size.

    - * - *

    Just like arrays, {@link Vector}s use contiguous storage locations for their elements, which means that - * their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently - * as in arrays. But unlike arrays, their size can change dynamically, with their storage being handled - * automatically by the

    - * - *

    Internally, {@link Vector}s use a dynamically allocated array to store their elements. This array may need - * to be reallocated in order to grow in size when new elements are inserted, which implies allocating a new - * array and moving all elements to it. This is a relatively expensive task in terms of processing time, and - * thus, {@link Vector}s do not reallocate each time an element is added to the

    - * - *

    Instead, {@link Vector} containers may allocate some extra storage to accommodate for possible growth, and - * thus the container may have an actual {@link capacity} greater than the storage strictly needed to contain its - * elements (i.e., its {@link size}). Libraries can implement different strategies for growth to balance between - * memory usage and reallocations, but in any case, reallocations should only happen at logarithmically growing - * intervals of {@link size} so that the insertion of individual elements at the end of the {@link Vector} can be - * provided with amortized constant time complexity (see {@link push_back push_back()}).

    - * - *

    Therefore, compared to arrays, {@link Vector}s consume more memory in exchange for the ability to manage - * storage and grow dynamically in an efficient way.

    - * - *

    Compared to the other dynamic sequence containers ({@link Deque}s, {@link List}s), {@link Vector Vectors} - * are very efficient accessing its elements (just like arrays) and relatively efficient adding or removing - * elements from its end. For operations that involve inserting or removing elements at positions other than the - * end, they perform worse than the others, and have less consistent iterators and references than {@link List}s. - *

    - * - *

    - * - *

    - * - *

    Container properties

    - *
    - *
    Sequence
    - *
    - * Elements in sequence containers are ordered in a strict linear sequence. Individual elements are - * accessed by their position in this sequence. - *
    - * - *
    Dynamic array
    - *
    - * Allows direct access to any element in the sequence, even through pointer arithmetics, and provides - * relatively fast addition/removal of elements at the end of the sequence. - *
    - *
    - * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/vector/vector - * @author Jeongho Nam - */ - class Vector extends Array implements base.IContainer, base.IArrayContainer { - /** - *

    Default Constructor.

    - * - *

    Constructs an empty container, with no elements.

    - */ - constructor(); - /** - * @inheritdoc - */ - constructor(array: Array); - /** - *

    Initializer list Constructor.

    - * - *

    Constructs a container with a copy of each of the elements in array, in the same order.

    - * - * @param array An array containing elements to be copied and contained. - */ - constructor(n: number); - /** - *

    Fill Constructor.

    - * - *

    Constructs a container with n elements. Each element is a copy of val (if provided).

    - * - * @param n Initial container size (i.e., the number of elements in the container at construction). - * @param val Value to fill the container with. Each of the n elements in the container is - * initialized to a copy of this value. - */ - constructor(n: number, val: T); - /** - *

    Copy Constructor.

    - * - *

    Constructs a container with a copy of each of the elements in container, in the same order.

    - * - * @param container Another container object of the same type (with the same class template - * arguments T), whose contents are either copied or acquired. - */ - constructor(container: Vector); - /** - *

    Range Constructor.

    - * - *

    Constructs a container with as many elements as the range (begin, end), with each - * element emplace-constructed from its corresponding element in that range, in the same order.

    - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - assign>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - assign(n: number, val: T): void; - /** - * @inheritdoc - */ - reserve(size: number): void; - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - begin(): VectorIterator; - /** - * @inheritdoc - */ - end(): VectorIterator; - /** - * @inheritdoc - */ - rbegin(): VectorReverseIterator; - /** - * @inheritdoc - */ - rend(): VectorReverseIterator; - /** - * @inheritdoc - */ - size(): number; - /** - * @inheritdoc - */ - capacity(): number; - /** - * @inheritdoc - */ - empty(): boolean; - /** - * @inheritdoc - */ - at(index: number): T; - /** - * @inheritdoc - */ - set(index: number, val: T): T; - /** - * @inheritdoc - */ - front(): T; - /** - * @inheritdoc - */ - back(): T; - /** - * @inheritdoc - */ - push_back(val: T): void; - /** - *

    Insert an element.

    - * - *

    The {@link Vector} is extended by inserting new element before the element at the specified - * position, effectively increasing the container size by one.

    - * - *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, inserting element in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to its new position. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    - * - * @param position Position in the {@link Vector} where the new element is inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param val Value to be copied to the inserted element. - * - * @return An iterator that points to the newly inserted element. - */ - insert(position: VectorIterator, val: T): VectorIterator; - /** - *

    Insert elements by repeated filling.

    - * - *

    The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted.

    - * - *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to their new positions. This is generally an inefficient operation compared to the - * one performed for the same operation by other kinds of sequence containers (such as {@link List}). - * - * @param position Position in the {@link Vector} where the new elements are inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param n Number of elements to insert. Each element is initialized to a copy of val. - * @param val Value to be copied (or moved) to the inserted elements. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: VectorIterator, n: number, val: T): VectorIterator; - /** - *

    Insert elements by range iterators.

    - * - *

    The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted by range - * iterators.

    - * - *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to their new positions. This is generally an inefficient operation compared to the - * one performed for the same operation by other kinds of sequence containers (such as {@link List}). - * - * @param position Position in the {@link Vector} where the new elements are inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: VectorIterator, begin: InputIterator, end: InputIterator): VectorIterator; - /** - *

    Insert an element.

    - * - *

    The {@link Vector} is extended by inserting new element before the element at the specified - * position, effectively increasing the container size by one.

    - * - *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, inserting element in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to its new position. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    - * - * @param position Position in the {@link Vector} where the new element is inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param val Value to be copied to the inserted element. - * - * @return An iterator that points to the newly inserted element. - */ - insert(position: VectorReverseIterator, val: T): VectorReverseIterator; - /** - *

    Insert elements by repeated filling.

    - * - *

    The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted.

    - * - *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to their new positions. This is generally an inefficient operation compared to the - * one performed for the same operation by other kinds of sequence containers (such as {@link List}). - * - * @param position Position in the {@link Vector} where the new elements are inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param n Number of elements to insert. Each element is initialized to a copy of val. - * @param val Value to be copied (or moved) to the inserted elements. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: VectorReverseIterator, n: number, val: T): VectorReverseIterator; - /** - *

    Insert elements by range iterators.

    - * - *

    The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted by range - * iterators.

    - * - *

    This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, inserting elements in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to their new positions. This is generally an inefficient operation compared to the - * one performed for the same operation by other kinds of sequence containers (such as {@link List}). - * - * @param position Position in the {@link Vector} where the new elements are inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: VectorReverseIterator, begin: InputIterator, end: InputIterator): VectorReverseIterator; - /** - * @hidden - */ - private insert_by_val(position, val); - /** - * @hidden - */ - protected _Insert_by_repeating_val(position: VectorIterator, n: number, val: T): VectorIterator; - /** - * @hidden - */ - protected _Insert_by_range>(position: VectorIterator, first: InputIterator, last: InputIterator): VectorIterator; - /** - * @inheritdoc - */ - pop_back(): void; - /** - *

    Erase element.

    - * - *

    Removes from the {@link Vector} either a single element; position.

    - * - *

    This effectively reduces the container size by the number of element removed.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, erasing an element in - * position other than the {@link end end()} causes the container to relocate all the elements after the - * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    - * - * @param position Iterator pointing to a single element to be removed from the {@link Vector}. - * - * @return An iterator pointing to the new location of the element that followed the last element erased by - * the function call. This is the {@link end end()} if the operation erased the last element in the - * sequence. - */ - erase(position: VectorIterator): VectorIterator; - /** - *

    Erase element.

    - * - *

    Removes from the Vector either a single element; position.

    - * - *

    This effectively reduces the container size by the number of elements removed.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, erasing elements in - * position other than the {@link end end()} causes the container to relocate all the elements after the - * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    - * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the new location of the element that followed the last element erased by - * the function call. This is the {@link rend rend()} if the operation erased the last element in the - * sequence. - */ - erase(first: VectorIterator, last: VectorIterator): VectorIterator; - /** - *

    Erase element.

    - * - *

    Removes from the {@link Vector} either a single element; position.

    - * - *

    This effectively reduces the container size by the number of element removed.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, erasing an element in - * position other than the {@link end end()} causes the container to relocate all the elements after the - * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    - * - * @param position Iterator pointing to a single element to be removed from the {@link Vector}. - * - * @return An iterator pointing to the new location of the element that followed the last element erased by - * the function call. This is the {@link rend rend()} if the operation erased the last element in the - * sequence. - */ - erase(position: VectorReverseIterator): VectorReverseIterator; - /** - *

    Erase element.

    - * - *

    Removes from the Vector either a single element; position.

    - * - *

    This effectively reduces the container size by the number of elements removed.

    - * - *

    Because {@link Vector}s use an Array as their underlying storage, erasing elements in - * position other than the {@link end end()} causes the container to relocate all the elements after the - * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

    - * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the new location of the element that followed the last element erased by - * the function call. This is the {@link end end()} if the operation erased the last element in the - * sequence. - */ - erase(first: VectorReverseIterator, last: VectorReverseIterator): VectorReverseIterator; - /** - * @hidden - */ - protected _Erase_by_range(first: VectorIterator, last: VectorIterator): VectorIterator; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link Vector container} object with same type of elements. Sizes and container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were in obj - * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link Vector container} of the same type of elements (i.e., instantiated - * with the same template parameter, T) whose content is swapped with that of this - * {@link container Vector}. - */ - obj(obj: Vector): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std { - /** - *

    An iterator of Vector.

    - * - *

    - * - *

    - * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class VectorIterator extends Iterator implements base.IArrayIterator { - /** - * Sequence number of iterator in the source {@link Vector}. - */ - private index_; - /** - *

    Construct from the source {@link Vector container}.

    - * - *

    Note

    - *

    Do not create the iterator directly, by yourself.

    - *

    Use {@link Vector.begin begin()}, {@link Vector.end end()} in {@link Vector container} instead.

    - * - * @param source The source {@link Vector container} to reference. - * @param index Sequence number of the element in the source {@link Vector}. - */ - constructor(source: Vector, index: number); - /** - * @hidden - */ - private readonly vector; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * Get index. - */ - readonly index: number; - /** - * @inheritdoc - */ - prev(): VectorIterator; - /** - * @inheritdoc - */ - next(): VectorIterator; - /** - * @inheritdoc - */ - advance(n: number): VectorIterator; - /** - *

    Whether an iterator is equal with the iterator.

    - * - *

    Compare two iterators and returns whether they are equal or not.

    - * - *

    Note

    - *

    Iterator's equal_to() only compare souce container and index number.

    - * - *

    Although elements in a pair, key and value are equal_to, if the source map or - * index number is different, then the {@link equal_to equal_to()} will return false. If you want to - * compare the elements of a pair, compare them directly by yourself.

    - * - * @param obj An iterator to compare - * @return Indicates whether equal or not. - */ - equal_to(obj: VectorIterator): boolean; - /** - * @inheritdoc - */ - swap(obj: VectorIterator): void; - } -} -declare namespace std { - /** - *

    A reverse-iterator of Vector.

    - * - *

    - * - *

    - * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class VectorReverseIterator extends ReverseIterator, VectorReverseIterator> implements base.IArrayIterator { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: VectorIterator); - /** - * @hidden - */ - protected create_neighbor(base: VectorIterator): VectorReverseIterator; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * Get index. - */ - readonly index: number; - } -} -declare namespace std { - /** - *

    FIFO queue.

    - * - *

    {@link Queue}s are a type of container adaptor, specifically designed to operate in a FIFO context - * (first-in first-out), where elements are inserted into one end of the container and extracted from the other. - *

    - * - *

    {@link Queue}s are implemented as containers adaptors, which are classes that use an encapsulated object of - * a specific container class as its underlying container, providing a specific set of member functions to access - * its elements. Elements are pushed into the {@link IDeque.back back()} of the specific container and popped from - * its {@link IDeque.front front()}.

    - * - *

    {@link container_ The underlying container} may be one of the standard container class template or some - * other specifically designed container class. This underlying container shall support at least the following - * operations:

    - * - *
      - *
    • empty
    • - *
    • size
    • - *
    • front
    • - *
    • back
    • - *
    • push_back
    • - *
    • pop_front
    • - *
    - * - *

    The standard container classes {@link Deque} and {@link List} fulfill these requirements. - * By default, if no container class is specified for a particular {@link Queue} class instantiation, the standard - * container {@link List} is used.

    - * - *

    - * - *

    - * - * @param Type of elements. - * - * @reference http://www.cplusplus.com/reference/queue/queue - * @author Jeongho Nam - */ - class Queue { - /** - * The underlying object for implementing the FIFO - */ - private container_; - /** - * Default Constructor. - */ - constructor(); - /** - * Copy Constructor. - */ - constructor(container: Queue); - /** - *

    Return size.

    - *

    Returns the number of elements in the {@link Queue}.

    - * - *

    This member function effectively calls member {@link IDeque.size size()} of the - * {@link container_ underlying container} object.

    - * - * @return The number of elements in the {@link container_ underlying container}. - */ - size(): number; - /** - *

    Test whether container is empty.

    - *

    returns whether the {@link Queue} is empty: i.e. whether its size is zero.

    - * - *

    This member function efeectively calls member {@link IDeque.empty empty()} of the - * {@link container_ underlying container} object.

    - * - * @return true if the {@link container_ underlying container}'s size is 0, - * false otherwise.

    - */ - empty(): boolean; - /** - *

    Access next element.

    - *

    Returns a value of the next element in the {@link Queue}.

    - * - *

    The next element is the "oldest" element in the {@link Queue} and the same element that is popped out - * from the queue when {@link pop Queue.pop()} is called.

    - * - *

    This member function effectively calls member {@link IDeque.front front()} of the - * {@link container_ underlying container} object.

    - * - * @return A value of the next element in the {@link Queue}. - */ - front(): T; - /** - *

    Access last element.

    - * - *

    Returns a vaue of the last element in the queue. This is the "newest" element in the queue (i.e. the - * last element pushed into the queue).

    - * - *

    This member function effectively calls the member function {@link IDeque.back back()} of the - * {@link container_ underlying container} object.

    - * - * @return A value of the last element in the {@link Queue}. - */ - back(): T; - /** - *

    Insert element.

    - * - *

    Inserts a new element at the end of the {@link Queue}, after its current last element. - * The content of this new element is initialized to val.

    - * - *

    This member function effectively calls the member function {@link IDeque.push_back push_back()} of the - * {@link container_ underlying container} object.

    - * - * @param val Value to which the inserted element is initialized. - */ - push(val: T): void; - /** - *

    Remove next element.

    - * - *

    Removes the next element in the {@link Queue}, effectively reducing its size by one.

    - * - *

    The element removed is the "oldest" element in the {@link Queue} whose value can be retrieved by calling - * member {@link front Queue.front()}

    . - * - *

    This member function effectively calls the member function {@link IDeque.pop_front pop_front()} of the - * {@link container_ underlying container} object.

    - */ - pop(): void; - /** - *

    Swap contents.

    - * - *

    Exchanges the contents of the container adaptor (this) by those of obj.

    - * - *

    This member function calls the non-member function {@link IContainer.swap swap} (unqualified) to swap - * the {@link container_ underlying containers}.

    - * - * @param obj Another {@link Queue} container adaptor of the same type (i.e., instantiated with the same - * template parameter, T). Sizes may differ.

    - */ - swap(obj: Queue): void; - } -} -declare namespace std { - /** - *

    LIFO stack.

    - * - *

    {@link Stack}s are a type of container adaptor, specifically designed to operate in a LIFO context - * (last-in first-out), where elements are inserted and extracted only from one end of the

    - * - *

    {@link Stack}s are implemented as containers adaptors, which are classes that use an encapsulated object of - * a specific container class as its underlying container, providing a specific set of member functions to - * access its elements. Elements are pushed/popped from the {@link ILinearContainer.back back()} of the - * {@link ILinearContainer specific container}, which is known as the top of the {@link Stack}.

    - * - *

    {@link container_ The underlying container} may be any of the standard container class templates or some - * other specifically designed container class. The container shall support the following operations:

    - * - *
      - *
    • empty
    • - *
    • size
    • - *
    • front
    • - *
    • back
    • - *
    • push_back
    • - *
    • pop_back
    • - *
    - * - *

    The standard container classes {@link Vector}, {@link Deque} and {@link List} fulfill these requirements. - * By default, if no container class is specified for a particular {@link Stack} class instantiation, the standard - * container {@link List} is used.

    - * - *

    - * - *

    - * - * @param Type of elements. - * - * @reference http://www.cplusplus.com/reference/stack/stack - * @author Jeongho Nam - */ - class Stack { - /** - * The underlying object for implementing the LIFO - */ - private container_; - /** - * Default Constructor. - */ - constructor(); - /** - * Copy Constructor. - */ - constructor(stack: Stack); - /** - *

    Return size.

    - * - *

    Returns the number of elements in the {@link Stack}.

    - * - *

    This member function effectively calls member {@link ILinearContainer.size size()} of the - * {@link container_ underlying container} object.

    - * - * @return The number of elements in the {@link container_ underlying container}. - */ - size(): number; - /** - *

    Test whether container is empty.

    - * - *

    returns whether the {@link Stack} is empty: i.e. whether its size is zero.

    - * - *

    This member function effectively calls member {@link ILinearContainer.empty empty()} of the - * {@link container_ underlying container} object.

    - * - * @return true if the underlying container's size is 0, - * false otherwise.

    - */ - empty(): boolean; - /** - *

    Access next element.

    - * - *

    Returns a value of the top element in the {@link Stack}

    . - * - *

    Since {@link Stack}s are last-in first-out containers, the top element is the last element inserted into - * the {@link Stack}.

    - * - *

    This member function effectively calls member {@link ILinearContainer.back back()} of the - * {@link container_ underlying container} object.

    - * - * @return A value of the top element in the {@link Stack}. - */ - top(): T; - /** - *

    Insert element.

    - * - *

    Inserts a new element at the top of the {@link Stack}, above its current top element.

    - * - *

    This member function effectively calls the member function - * {@link ILinearContainer.push_back push_back()} of the {@link container_ underlying container} object.

    - * - * @param val Value to which the inserted element is initialized. - */ - push(val: T): void; - /** - *

    Remove top element.

    - * - *

    Removes the element on top of the {@link Stack}, effectively reducing its size by one.

    - * - *

    The element removed is the latest element inserted into the {@link Stack}, whose value can be retrieved - * by calling member {@link top Stack.top()}

    . - * - *

    This member function effectively calls the member function {@link ILinearContainer.pop_back pop_back()} - * of the {@link container_ underlying container} object.

    - */ - pop(): void; - /** - *

    Swap contents.

    - * - *

    Exchanges the contents of the container adaptor (this) by those of obj.

    - * - *

    This member function calls the non-member function {@link IContainer.swap swap} (unqualified) to swap - * the {@link container_ underlying containers}.

    - * - * @param obj Another {@link Stack} container adaptor of the same type (i.e., instantiated with the same - * template parameter, T). Sizes may differ.

    - */ - swap(obj: Stack): void; - } -} -declare namespace std.TreeSet { - type iterator = std.SetIterator; - type reverse_iterator = std.SetReverseIterator; -} -declare namespace std { - /** - *

    Tree-structured set, std::set of STL.

    - * - *

    {@link TreeSet}s are containers that store unique elements following a specific order.

    - * - *

    In a {@link TreeSet}, the value of an element also identifies it (the value is itself the - * key, of type T), and each value must be unique. The value of the elements in a - * {@link TreeSet} cannot be modified once in the container (the elements are always const), but they - * can be inserted or removed from the

    - * - *

    Internally, the elements in a {@link TreeSet} are always sorted following a specific strict weak - * ordering criterion indicated by its internal comparison method (of {@link less}).

    - * - *

    {@link TreeSet} containers are generally slower than {@link HashSet} containers to access - * individual elements by their key, but they allow the direct iteration on subsets based on their - * order.

    - * - *

    {@link TreeSet}s are typically implemented as binary search trees.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
    - * - *
    Ordered
    - *
    - * The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order. - *
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - * - *
    Unique keys
    - *
    No two elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the elements. - * Each element in an {@link TreeSet} is also uniquely identified by this value. - * - * @reference http://www.cplusplus.com/reference/set/set - * @author Jeongho Nam - */ - class TreeSet extends base.UniqueSet implements base.ITreeSet { - /** - * @hidden - */ - private tree_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (x: T, y: T) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array); - /** - * Contruct from elements with compare. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array, compare: (x: T, y: T) => boolean); - /** - * Copy Constructor. - */ - constructor(container: TreeMultiSet); - /** - * Copy Constructor with compare. - * - * @param container A container to be copied. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); - /** - * Range Constructor. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * Construct from range and compare. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator, end: Iterator, compare: (x: T, y: T) => boolean); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(val: T): SetIterator; - /** - * @inheritdoc - */ - key_comp(): (x: T, y: T) => boolean; - /** - * @inheritdoc - */ - value_comp(): (x: T, y: T) => boolean; - /** - * @inheritdoc - */ - lower_bound(val: T): SetIterator; - /** - * @inheritdoc - */ - upper_bound(val: T): SetIterator; - /** - * @inheritdoc - */ - equal_range(val: T): Pair, SetIterator>; - /** - * @hidden - */ - protected _Insert_by_val(val: T): any; - protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link TreeSet set} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link TreeSet set container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link TreeSet container}. - */ - swap(obj: TreeSet): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std.TreeMap { - type iterator = std.MapIterator; - type reverse_iterator = std.MapReverseIterator; -} -declare namespace std { - /** - *

    Tree-structured map, std::map of STL.

    - * - *

    {@link TreeMap TreeMaps} are associative containers that store elements formed by a combination of a - * key value (Key) and a mapped value (T), following order.

    - * - *

    In a {@link TreeMap}, the key values are generally used to sort and uniquely identify the elements, - * while the mapped values store the content associated to this key. The types of key and - * mapped value may differ, and are grouped together in member type value_type, which is a {@link Pair} - * type combining both:

    - * - *

    typedef Pair value_type;

    - * - *

    Internally, the elements in a {@link TreeMap} are always sorted by its key following a - * strict weak ordering criterion indicated by its internal comparison method {@link less}. - * - *

    {@link TreeMap} containers are generally slower than {@link HashMap HashMap} containers to access individual - * elements by their key, but they allow the direct iteration on subsets based on their order.

    - * - *

    {@link TreeMap}s are typically implemented as binary search trees.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
    - * - *
    Ordered
    - *
    The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order.
    - * - *
    Map
    - *
    Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value.
    - * - *
    Unique keys
    - *
    No two elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the keys. Each element in a map is uniquely identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/map/map - * @author Jeongho Nam - */ - class TreeMap extends base.UniqueMap implements base.ITreeMap { - /** - * @hidden - */ - private tree_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (x: Key, y: Key) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array>); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array>, compare: (x: Key, y: Key) => boolean); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - */ - constructor(array: Array<[Key, T]>); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array<[Key, T]>, compare: (x: Key, y: Key) => boolean); - /** - * Copy Constructor. - * - * @param container Another map to copy. - */ - constructor(container: TreeMap); - /** - * Copy Constructor. - * - * @param container Another map to copy. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: TreeMap, compare: (x: Key, y: Key) => boolean); - /** - * Range Constructor. - * - * @param begin nput interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator>, end: Iterator>); - /** - * Range Constructor. - * - * @param begin nput interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator>, end: Iterator>, compare: (x: Key, y: Key) => boolean); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: Key): MapIterator; - /** - * @inheritdoc - */ - key_comp(): (x: Key, y: Key) => boolean; - /** - * @inheritdoc - */ - value_comp(): (x: Pair, y: Pair) => boolean; - /** - * @inheritdoc - */ - lower_bound(key: Key): MapIterator; - /** - * @inheritdoc - */ - upper_bound(key: Key): MapIterator; - /** - * @inheritdoc - */ - equal_range(key: Key): Pair, MapIterator>; - /** - * @hidden - */ - protected _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link TreeMap map} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link TreeMap map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link TreeMap container}. - */ - swap(obj: TreeMap): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer>): void; - } -} -declare namespace std.TreeMultiSet { - type iterator = std.SetIterator; - type reverse_iterator = std.SetReverseIterator; -} -declare namespace std { - /** - *

    Tree-structured multiple-key set.

    - * - *

    {@link TreeMultiSet TreeMultiSets} are containers that store elements following a specific order, and - * where multiple elements can have equivalent values.

    - * - *

    In a {@link TreeMultiSet}, the value of an element also identifies it (the value is itself - * the key, of type T). The value of the elements in a {@link TreeMultiSet} cannot - * be modified once in the container (the elements are always const), but they can be inserted or removed - * from the

    - * - *

    Internally, the elements in a {@link TreeMultiSet TreeMultiSets} are always sorted following a strict - * weak ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}).

    - * - *

    {@link TreeMultiSet} containers are generally slower than {@link HashMultiSet} containers - * to access individual elements by their key, but they allow the direct iteration on subsets based on - * their order.

    - * - *

    {@link TreeMultiSet TreeMultiSets} are typically implemented as binary search trees.

    - * - *

    - *

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
    - * - *
    Ordered
    - *
    - * The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order. - *
    - * - *
    Set
    - *
    The value of an element is also the key used to identify it.
    - * - *
    Multiple equivalent keys
    - *
    Multiple elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the elements. Each element in a {@link TreeMultiSet} container is also identified - * by this value (each value is itself also the element's key). - * - * @reference http://www.cplusplus.com/reference/set/multiset - * @author Jeongho Nam - */ - class TreeMultiSet extends base.MultiSet implements base.ITreeSet { - /** - * @hidden - */ - private tree_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (x: T, y: T) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array); - /** - * Contruct from elements with compare. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array, compare: (x: T, y: T) => boolean); - /** - * Copy Constructor. - */ - constructor(container: TreeMultiSet); - /** - * Copy Constructor with compare. - * - * @param container A container to be copied. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); - /** - * Range Constructor. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * Construct from range and compare. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator, end: Iterator, compare: (x: T, y: T) => boolean); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(val: T): SetIterator; - /** - * @inheritdoc - */ - count(val: T): number; - /** - * @inheritdoc - */ - key_comp(): (x: T, y: T) => boolean; - /** - * @inheritdoc - */ - value_comp(): (x: T, y: T) => boolean; - /** - * @inheritdoc - */ - lower_bound(val: T): SetIterator; - /** - * @inheritdoc - */ - upper_bound(val: T): SetIterator; - /** - * @inheritdoc - */ - equal_range(val: T): Pair, SetIterator>; - /** - * @hidden - */ - protected _Insert_by_val(val: T): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link TreeMultiSet set} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link TreeMultiSet set container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link TreeMultiSet container}. - */ - swap(obj: TreeMultiSet): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std.TreeMultiMap { - type iterator = std.MapIterator; - type reverse_iterator = std.MapReverseIterator; -} -declare namespace std { - /** - *

    Tree-structured multiple-key map.

    - * - *

    {@link TreeMultiMap TreeMultiMaps} are associative containers that store elements formed by a combination of - * a key value and a mapped value, following a specific order, and where multiple elements can - * have equivalent keys.

    - * - *

    In a {@link TreeMultiMap}, the key values are generally used to sort and uniquely identify - * the elements, while the mapped values store the content associated to this key. The types of - * key and mapped value may differ, and are grouped together in member type - * value_type, which is a {@link Pair} type combining both:

    - * - *

    typedef Pair value_type;

    - * - *

    Internally, the elements in a {@link TreeMultiMap}are always sorted by its key following a - * strict weak ordering criterion indicated by its internal comparison method (of {@link less}).

    - * - *

    {@link TreeMultiMap}containers are generally slower than {@link HashMap} containers - * to access individual elements by their key, but they allow the direct iteration on subsets based - * on their order.

    - * - *

    {@link TreeMultiMap TreeMultiMaps} are typically implemented as binary search trees.

    - * - *

    < - * img src="http://samchon.github.io/typescript-stl/images/design/class_diagram/map_containers.png" style="max-width: 100%" />

    - * - *

    Container properties

    - *
    - *
    Associative
    - *
    - * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
    - * - *
    Ordered
    - *
    - * The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order. - *
    - * - *
    Map
    - *
    - * Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value. - *
    - * - *
    Multiple equivalent keys
    - *
    Multiple elements in the container can have equivalent keys.
    - *
    - * - * @param Type of the keys. Each element in a map is uniquely identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/map/multimap - * @author Jeongho Nam - */ - class TreeMultiMap extends base.MultiMap implements base.ITreeMap { - /** - * @hidden - */ - private tree_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (x: Key, y: Key) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array>); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array>, compare: (x: Key, y: Key) => boolean); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - */ - constructor(array: Array<[Key, T]>); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array<[Key, T]>, compare: (x: Key, y: Key) => boolean); - /** - * Copy Constructor. - * - * @param container Another map to copy. - */ - constructor(container: TreeMultiMap); - /** - * Copy Constructor. - * - * @param container Another map to copy. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: TreeMultiMap, compare: (x: Key, y: Key) => boolean); - /** - * Range Constructor. - * - * @param begin nput interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator>, end: Iterator>); - /** - * Range Constructor. - * - * @param begin nput interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator>, end: Iterator>, compare: (x: Key, y: Key) => boolean); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: Key): MapIterator; - /** - * @inheritdoc - */ - count(key: Key): number; - /** - * @inheritdoc - */ - key_comp(): (x: Key, y: Key) => boolean; - /** - * @inheritdoc - */ - value_comp(): (x: Pair, y: Pair) => boolean; - /** - * @inheritdoc - */ - lower_bound(key: Key): MapIterator; - /** - * @inheritdoc - */ - upper_bound(key: Key): MapIterator; - /** - * @inheritdoc - */ - equal_range(key: Key): Pair, MapIterator>; - /** - * @hidden - */ - protected _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - *

    Swap content.

    - * - *

    Exchanges the content of the container by the content of obj, which is another - * {@link TreeMapMulti map} of the same type. Sizes abd container type may differ.

    - * - *

    After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

    - * - *

    Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

    - * - * @param obj Another {@link TreeMapMulti map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link TreeMapMulti container}. - */ - swap(obj: TreeMultiMap): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer>): void; - } -} -declare namespace std { - /** - *

    System error exception.

    - * - *

    This class defines the type of objects thrown as exceptions to report conditions originating during - * runtime from the operating system or other low-level application program interfaces which have an - * associated {@link ErrorCode}.

    - * - *

    The class inherits from {@link RuntimeError}, to which it adds an {@link ErrorCode} as - * member code (and defines a specialized what member).

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/system_error/system_error - * @author Jeongho Nam - */ - class SystemError extends RuntimeError { - /** - * @hidden - */ - protected code_: ErrorCode; - /** - * Construct from an error code. - * - * @param code An {@link ErrorCode} object. - */ - constructor(code: ErrorCode); - /** - * Construct from an error code and message. - * - * @param code An {@link ErrorCode} object. - * @param message A message incorporated in the string returned by member {@link what what()}. - */ - constructor(code: ErrorCode, message: string); - /** - * Construct from a numeric value and error category. - * - * @param val A numerical value identifying an error code. - * @param category A reference to an {@link ErrorCode} object. - */ - constructor(val: number, category: ErrorCategory); - /** - * Construct from a numeric value, error category and message. - * - * @param val A numerical value identifying an error code. - * @param category A reference to an {@link ErrorCode} object. - * @param message A message incorporated in the string returned by member {@link what what()}. - */ - constructor(val: number, category: ErrorCategory, message: string); - /** - *

    Get error code.

    - * - *

    Returns the {@link ErrorCode} object associated with the exception.

    - * - *

    This value is either the {@link ErrorCode} passed to the construction or its equivalent - * (if constructed with a value and a {@link category}.

    - * - * @return The {@link ErrorCode} associated with the object. - */ - code(): ErrorCode; - } -} -declare namespace std { - /** - *

    Error category.

    - * - *

    This type serves as a base class for specific category types.

    - * - *

    Category types are used to identify the source of an error. They also define the relation between - * {@link ErrorCode} and {@link ErrorCondition}objects of its category, as well as the message set for {@link ErrorCode} - * objects. - * - *

    Objects of these types have no distinct values and are not-copyable and not-assignable, and thus can only be - * passed by reference. As such, only one object of each of these types shall exist, each uniquely identifying its own - * category: all error codes and conditions of a same category shall return a reference to same object.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/system_error/error_category - * @author Jeongho Nam - */ - abstract class ErrorCategory { - /** - * Default Constructor. - */ - constructor(); - /** - *

    Return category name.

    - * - *

    In derived classes, the function returns a string naming the category.

    - * - *

    In {@link ErrorCategory}, it is a pure virtual member function.

    - * - *
      - *
    • In the {@link GenericCategory} object, it returns "generic".
    • - *
    • In the {@link SystemCategory} object, it returns "system".
    • - *
    • In the {@link IOStreamCategory} object, it returns "iostream".
    • - *
    - * - * @return The category name. - */ - abstract name(): string; - /** - *

    Error message.

    - * - *

    In derived classes, the function returns a string object with a message describing the error condition - * denoted by val.

    - * - *

    In {@link ErrorCategory}, it is a pure virtual member function.

    - * - *

    This function is called both by {@link ErrorCode.message ErrorCode.message()} and - * {@link ErrorCondition.message ErrorCondition.message()} to obtain the corresponding message in the - * {@link category}. Therefore, numerical values used by custom error codes and - * {@link ErrorCondition error conditions} should only match for a category if they describe the same error.

    - * - * @param val A numerical value identifying an error condition. - * If the {@link ErrorCategory} object is the {@link GenericCategory}, this argument is equivalent to an - * {@link errno} value. - * - * @return A string object with the message. - */ - abstract message(val: number): string; - /** - *

    Default error condition.

    - * - *

    Returns the default {@link ErrorCondition}object of this category that is associated with the - * {@link ErrorCode} identified by a value of val.

    - * - *

    Its definition in the base class {@link ErrorCategory} returns the same as constructing an - * {@link ErrorCondition} object with: - * - *

    new ErrorCondition(val, *this);

    - * - *

    As a virtual member function, this behavior can be overriden in derived classes.

    - * - *

    This function is called by the default definition of member {@link equivalent equivalent()}, which is used to - * compare {@link ErrorCondition error conditions} with error codes.

    - * - * @param val A numerical value identifying an error condition. - * - * @return The default {@link ErrorCondition}object associated with condition value val for this category. - */ - default_error_condition(val: number): ErrorCondition; - /** - *

    Check error code equivalence.

    - * - *

    Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an - * {@link ErrorCondition error condition.

    - * - *

    This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is - * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' - * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered - * equivalent by the operator.

    - * - *

    As a virtual member function, this behavior can be overridden in derived classes to define a different - * correspondence mechanism for each {@link ErrorCategory} type.

    - * - * @param val_code A numerical value identifying an error code. - * @param cond An object of an {@link ErrorCondition} type. - * - * @return true if the arguments are considered equivalent. false otherwise. - */ - equivalent(val_code: number, cond: ErrorCondition): boolean; - /** - *

    Check error code equivalence.

    - * - *

    Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an - * {@link ErrorCondition error condition.

    - * - *

    This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is - * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' - * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered - * equivalent by the operator.

    - * - *

    As a virtual member function, this behavior can be overridden in derived classes to define a different - * correspondence mechanism for each {@link ErrorCategory} type.

    - * - * @param code An object of an {@link ErrorCode} type. - * @param val_cond A numerical value identifying an error code. - * - * @return true if the arguments are considered equivalent. false otherwise. - */ - equivalent(code: ErrorCode, val_cond: number): boolean; - } -} -declare namespace std { - /** - *

    Error condition.

    - * - *

    Objects of this type hold a condition {@link value} associated with a {@link category}.

    - * - *

    Objects of this type describe errors in a generic way so that they may be portable across different - * systems. This is in contrast with {@link ErrorCode} objects, that may contain system-specific - * information.

    - * - *

    Because {@link ErrorCondition}objects can be compared with error_code objects directly by using - * relational operators, {@link ErrorCondition}objects are generally used to check whether - * a particular {@link ErrorCode} obtained from the system matches a specific error condition no matter - * the system.

    - * - *

    The {@link ErrorCategory categories} associated with the {@link ErrorCondition} and the - * {@link ErrorCode} define the equivalences between them.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/system_error/error_condition - * @author Jeongho Nam - */ - class ErrorCondition extends base.ErrorInstance { - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from a numeric value and error category. - * - * @param val A numerical value identifying an error condition. - * @param category A reference to an {@link ErrorCategory} object. - */ - constructor(val: number, category: ErrorCategory); - } -} -declare namespace std { - /** - *

    Error code.

    - * - *

    Objects of this type hold an error code {@link value} associated with a {@link category}.

    - * - *

    The operating system and other low-level applications and libraries generate numerical error codes to - * represent possible results. These numerical values may carry essential information for a specific platform, - * but be non-portable from one platform to another.

    - * - *

    Objects of this class associate such numerical codes to {@link ErrorCategory error categories}, so that they - * can be interpreted when needed as more abstract (and portable) {@link ErrorCondition error conditions}.

    - * - *

    - *

    - * - * @reference http://www.cplusplus.com/reference/system_error/error_code - * @author Jeongho Nam - */ - class ErrorCode extends base.ErrorInstance { - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from a numeric value and error category. - * - * @param val A numerical value identifying an error code. - * @param category A reference to an {@link ErrorCategory} object. - */ - constructor(val: number, category: ErrorCategory); - } -} -declare namespace std { - /** - *

    Running on Node.

    - * - *

    Test whether the JavaScript is running on Node.

    - * - * @references http://stackoverflow.com/questions/17575790/environment-detection-node-js-or-browser - */ - function is_node(): boolean; - /** - *

    Pair of values.

    - * - *

    This class couples together a pair of values, which may be of different types (T1 and - * T2). The individual values can be accessed through its public members {@link first} and - * {@link second}.

    - * - * @param Type of member {@link first}. - * @param Type of member {@link second}. - * - * @reference http://www.cplusplus.com/reference/utility/pair - * @author Jeongho Nam - */ - class Pair { - /** - *

    A first value in the Pair.

    - */ - first: T1; - /** - *

    A second value in the Pair.

    - */ - second: T2; - /** - *

    Construct from pair values.

    - * - * @param first The first value of the Pair - * @param second The second value of the Pair - */ - constructor(first: T1, second: T2); - /** - *

    Whether a Pair is equal with the Pair.

    - *

    Compare each first and second value of two Pair(s) and returns whether they are equal or not.

    - * - *

    If stored key and value in a Pair are not number or string but an object like a class or struct, - * the comparison will be executed by a member method (SomeObject)::equal_to(). If the object does not have - * the member method equal_to(), only address of pointer will be compared.

    - * - * @param obj A Map to compare - * @return Indicates whether equal or not. - */ - equal_to(pair: Pair): boolean; - less(pair: Pair): boolean; - } - /** - *

    Construct {@link Pair} object.

    - * - *

    Constructs a {@link Pair} object with its {@link Pair.first first} element set to x and its - * {@link Pair.second second} element set to y.

    - * - *

    The template types can be implicitly deduced from the arguments passed to {@link make_pair}.

    - * - *

    {@link Pair} objects can be constructed from other {@link Pair} objects containing different types, if the - * respective types are implicitly convertible.

    - * - * @param x Value for member {@link Pair.first first}. - * @param y Value for member {@link Pair.second second}. - * - * @return A {@link Pair} object whose elements {@link Pair.first first} and {@link Pair.second second} are set to - * x and y respectivelly. - */ - function make_pair(x: T1, y: T2): Pair; -} -declare namespace std { - /** - *

    Priority queue.

    - * - *

    {@link PriorityQueue Priority queues} are a type of container adaptors, specifically designed such that its - * first element is always the greatest of the elements it contains, according to some strict weak ordering - * criterion.

    - * - *

    This context is similar to a heap, where elements can be inserted at any moment, and only the - * max heap element can be retrieved (the one at the top in the {@link PriorityQueue priority queue}).

    - * - *

    {@link PriorityQueue Priority queues} are implemented as container adaptors, which are classes that - * use an encapsulated object of a specific container class as its {@link container_ underlying container}, - * providing a specific set of member functions to access its elements. Elements are popped from the "back" - * of the specific container, which is known as the top of the {@link PriorityQueue Priority queue}.

    - * - *

    The {@link container_ underlying container} may be any of the standard container class templates or some - * other specifically designed container class. The container shall be accessible through - * {@link IArrayIterator random access iterators} and support the following operations:

    - * - *
      - *
    • empty()
    • - *
    • size()
    • - *
    • front()
    • - *
    • push_back()
    • - *
    • pop_back()
    • - *
    - * - *

    The standard container classes {@link Vector} and {@link Deque} fulfill these requirements. By default, if - * no container class is specified for a particular {@link PriorityQueue} class instantiation, the standard - * container {@link Vector} is used.

    - * - *

    Support of {@link IArrayIterator random access iterators} is required to keep a heap structure internally - * at all times. This is done automatically by the container adaptor by automatically calling the algorithm - * functions make_heap, push_heap and pop_heap when needed.

    - * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/queue/priority_queue/ - * @author Jeongho Nam - */ - class PriorityQueue { - /** - *

    The underlying container for implementing the priority queue.

    - * - *

    Following standard definition from the C++ committee, the underlying container should be one of - * {@link Vector} or {@link Deque}, however, I've adopted {@link TreeMultiSet} instead of them. Of course, - * there are proper reasons for adapting the {@link TreeMultiSet} even violating standard advice.

    - * - *

    Underlying container of {@link PriorityQueue} must keep a condition; the highest (or lowest) - * element must be placed on the terminal node for fast retrieval and deletion. To keep the condition with - * {@link Vector} or {@link Deque}, lots of times will only be spent for re-arranging elements. It calls - * rearrangement functions like make_heap, push_heap and pop_head for rearrangement.

    - * - *

    However, the {@link TreeMultiSet} container always keeps arrangment automatically without additional - * operations and it even meets full criteria of {@link PriorityQueue}. Those are the reason why I've adopted - * {@link TreeMultiSet} as the underlying container of {@link PriorityQueue}.

    - */ - private container_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (left: T, right: T) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array); - /** - * Contruct from elements with compare. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array, compare: (left: T, right: T) => boolean); - /** - * Copy Constructor. - */ - constructor(container: base.IContainer); - /** - * Copy Constructor with compare. - * - * @param container A container to be copied. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: base.IContainer, compare: (left: T, right: T) => boolean); - /** - * Range Constructor. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * Range Constructor with compare. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator, end: Iterator, compare: (left: T, right: T) => boolean); - /** - *

    Return size.

    - * - *

    Returns the number of elements in the {@link PriorityQueue}.

    - * - *

    This member function effectively calls member {@link IArray.size size} of the - * {@link container_ underlying container} object.

    - * - * @return The number of elements in the underlying - */ - size(): number; - /** - *

    Test whether container is empty.

    - * - *

    Returns whether the {@link PriorityQueue} is empty: i.e. whether its {@link size} is zero.

    - * - *

    This member function effectively calls member {@link IARray.empty empty} of the - * {@link container_ underlying container} object.

    - */ - empty(): boolean; - /** - *

    Access top element.

    - * - *

    Returns a constant reference to the top element in the {@link PriorityQueue}.

    - * - *

    The top element is the element that compares higher in the {@link PriorityQueue}, and the next that is - * removed from the container when {@link PriorityQueue.pop} is called.

    - * - *

    This member function effectively calls member {@link IArray.front front} of the - * {@link container_ underlying container} object.

    - * - * @return A reference to the top element in the {@link PriorityQueue}. - */ - top(): T; - /** - *

    Insert element.

    - * - *

    Inserts a new element in the {@link PriorityQueue}. The content of this new element is initialized to - * val. - * - *

    This member function effectively calls the member function {@link IArray.push_back push_back} of the - * {@link container_ underlying container} object, and then reorders it to its location in the heap by calling - * the push_heap algorithm on the range that includes all the elements of the

    - * - * @param val Value to which the inserted element is initialized. - */ - push(val: T): void; - /** - *

    Remove top element.

    - * - *

    Removes the element on top of the {@link PriorityQueue}, effectively reducing its {@link size} by one. - * The element removed is the one with the highest (or lowest) value.

    - * - *

    The value of this element can be retrieved before being popped by calling member - * {@link PriorityQueue.top}.

    - * - *

    This member function effectively calls the pop_heap algorithm to keep the heap property of - * {@link PriorityQueue PriorityQueues} and then calls the member function {@link IArray.pop_back pop_back} of - * the {@link container_ underlying container} object to remove the element.

    - */ - pop(): void; - /** - *

    Swap contents.

    - * - *

    Exchanges the contents of the container adaptor by those of obj, swapping both the - * {@link container_ underlying container} value and their comparison function using the corresponding - * {@link std.swap swap} non-member functions (unqualified).

    - * - *

    This member function has a noexcept specifier that matches the combined noexcept of the - * {@link IArray.swap swap} operations on the {@link container_ underlying container} and the comparison - * functions.

    - * - * @param obj {@link PriorityQueue} container adaptor of the same type (i.e., instantiated with the same - * template parameters, T). Sizes may differ. - */ - swap(obj: PriorityQueue): void; + uncle: XTreeNode; } } From b940d7fbf6d722656cf6ea991377c56cb746283e Mon Sep 17 00:00:00 2001 From: Derrick Liu Date: Fri, 23 Sep 2016 10:22:38 -0700 Subject: [PATCH 20/28] Add geojson constructor docstring --- leaflet/leaflet.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index debcf9fee4..cda1e73463 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -568,6 +568,13 @@ declare namespace L { export function coordsToLatLng(coords: [number, number, number]): LatLng; // check if LatLng has an altitude property } + /** + * Creates a GeoJSON layer. + * + * Optionally accepts an object in GeoJSON format to display on the + * map (you can alternatively add it later with addData method) and + * an options object. + */ export function geoJSON(geojson?: Object, options?: GeoJSONOptions): GeoJSON; type Zoom = boolean | 'center'; From e0c6192ab78336baea7e46a35b385b05d7d91f86 Mon Sep 17 00:00:00 2001 From: Derrick Liu Date: Fri, 23 Sep 2016 10:25:59 -0700 Subject: [PATCH 21/28] Add GeoJSON interface docstrings, add missing functions from docs, and fix some typos --- leaflet/leaflet.d.ts | 109 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 105 insertions(+), 4 deletions(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index cda1e73463..74d2cf3a63 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -544,28 +544,129 @@ declare namespace L { export function featureGroup(layers: Array): FeatureGroup; + type StyleFunction = (feature: any) => PathOptions; + export interface GeoJSONOptions extends LayerOptions { + /** + * A Function defining how GeoJSON points spawn Leaflet layers. + * It is internally called when data is added, passing the GeoJSON point + * feature and its LatLng. + * + * The default is to spawn a default Marker: + * + * ``` + * function(geoJsonPoint, latlng) { + * return L.marker(latlng); + * } + * ``` + */ pointToLayer?: (geoJsonPoint: Object, latlng: LatLng) => Layer; // should import GeoJSON typings + + /** + * A Function defining the Path options for styling GeoJSON lines and polygons, + * called internally when data is added. + * + * The default value is to not override any defaults: + * + * ``` + * function (geoJsonFeature) { + * return {} + * } + * ``` + */ style?: (geoJsonFeature: Object) => PathOptions; - onEachFeature?: (feaure: Object, layer: Layer) => void; + + /** + * A Function that will be called once for each created Feature, after it + * has been created and styled. Useful for attaching events and popups to features. + * + * The default is to do nothing with the newly created layers: + * + * ``` + * function (feature, layer) {} + * ``` + */ + onEachFeature?: (feature: Object, layer: Layer) => void; + + /** + * A Function that will be used to decide whether to show a feature or not. + * + * The default is to show all features: + * + * ``` + * function (geoJsonFeature) { + * return true; + * } + * ``` + */ filter?: (geoJsonFeature: Object) => boolean; + + /** + * A Function that will be used for converting GeoJSON coordinates to LatLngs. + * The default is the coordsToLatLng static method. + */ coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng; // check if LatLng has an altitude property } + /** + * Represents a GeoJSON object or an array of GeoJSON objects. + * Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup. + */ export interface GeoJSON extends FeatureGroup {} export namespace GeoJSON { + /** + * Adds a GeoJSON object to the layer. + */ export function addData(data: Object): Layer; + /** + * Resets the given vector layer's style to the original GeoJSON style, + * useful for resetting style after hover events. + */ export function resetStyle(layer: Layer): Layer; - export function setStyle(style: (geoJsonFeature: Object) => PathOptions): Layer; // not sure about this one, docs don't provide enough detail + /** + * Changes styles of GeoJSON vector layers with the given style function. + */ + export function setStyle(style: PathOptions | StyleFunction): Layer; + /** + * Creates a Layer from a given GeoJSON feature. Can use a custom pointToLayer + * and/or coordsToLatLng functions if provided as options. + */ export function geometryToLayer(featureData: Object, options?: GeoJSONOptions): Layer; - export function coordsToLatLng(coords: [number, number]): LatLng; + /** + * Creates a LatLng object from an array of 2 numbers (longitude, latitude) or + * 3 numbers (longitude, latitude, altitude) used in GeoJSON for points. + */ + export function coordsToLatLng(coords: [number, number] | [number, number, number]): LatLng; - export function coordsToLatLng(coords: [number, number, number]): LatLng; // check if LatLng has an altitude property + /** + * Creates a multidimensional array of LatLngs from a GeoJSON coordinates array. + * levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of + * arrays of points, etc., 0 by default). + * Can use a custom coordsToLatLng function. + */ + export function coordsToLatLngs(coords: Array, levelsDeep?: number, coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng): LatLng[]; // Not entirely sure how to define arbitrarily nested arrays + + /** + * Reverse of coordsToLatLng + */ + export function latLngToCoords(latlng: LatLng): number[]; + + /** + * Reverse of coordsToLatLngs closed determines whether the first point should be + * appended to the end of the array to close the feature, only used when levelsDeep is 0. + * False by default. + */ + export function latLngsToCoords(latlngs: Array, levelsDeep?: number, closed?: boolean): number[]; + + /** + * Normalize GeoJSON geometries/features into GeoJSON features. + */ + export function asFeature(geojson: Object): Object; } /** From bfdb74d84982f57582734867190eacd7e424d69f Mon Sep 17 00:00:00 2001 From: Derrick Liu Date: Fri, 23 Sep 2016 10:29:27 -0700 Subject: [PATCH 22/28] Tighten up some types for coord conversion --- leaflet/leaflet.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 74d2cf3a63..e5fc545e43 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -654,14 +654,14 @@ declare namespace L { /** * Reverse of coordsToLatLng */ - export function latLngToCoords(latlng: LatLng): number[]; + export function latLngToCoords(latlng: LatLng): [number, number] | [number, number, number]; /** * Reverse of coordsToLatLngs closed determines whether the first point should be * appended to the end of the array to close the feature, only used when levelsDeep is 0. * False by default. */ - export function latLngsToCoords(latlngs: Array, levelsDeep?: number, closed?: boolean): number[]; + export function latLngsToCoords(latlngs: Array, levelsDeep?: number, closed?: boolean): [number, number] | [number, number, number]; /** * Normalize GeoJSON geometries/features into GeoJSON features. From a61388dd5e3eaf8cb72ca0b16e507dedd7eeab07 Mon Sep 17 00:00:00 2001 From: Derrick Liu Date: Fri, 23 Sep 2016 10:30:05 -0700 Subject: [PATCH 23/28] Feature group docstrings, make layers param optional in feature group constructor --- leaflet/leaflet.d.ts | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index e5fc545e43..8102230ab9 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -535,14 +535,37 @@ declare namespace L { export function layerGroup(layers: Array): LayerGroup; + /** + * Extended LayerGroup that also has mouse events (propagated from + * members of the group) and a shared bindPopup method. + */ export interface FeatureGroup extends LayerGroup { + /** + * Sets the given path options to each layer of the group that has a setStyle method. + */ setStyle(style: PathOptions): this; + + /** + * Brings the layer group to the top of all other layers + */ bringToFront(): this; + + /** + * Brings the layer group to the top [sic] of all other layers + */ bringToBack(): this; + + /** + * Returns the LatLngBounds of the Feature Group (created from + * bounds and coordinates of its children). + */ getBounds(): LatLngBounds; } - export function featureGroup(layers: Array): FeatureGroup; + /** + * Create a feature group, optionally given an initial set of layers. + */ + export function featureGroup(layers?: Array): FeatureGroup; type StyleFunction = (feature: any) => PathOptions; From 9e9ffce813576fca8583a087fe2235cca72cd67b Mon Sep 17 00:00:00 2001 From: Derrick Liu Date: Fri, 23 Sep 2016 10:31:07 -0700 Subject: [PATCH 24/28] Add docstrings for LayerGroup --- leaflet/leaflet.d.ts | 57 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 8102230ab9..b76fe02b34 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -518,21 +518,78 @@ declare namespace L { export function canvas(options?: RendererOptions): Canvas; + /** + * Used to group several layers and handle them as one. + * If you add it to the map, any layers added or removed from the group will be + * added/removed on the map as well. Extends Layer. + */ export interface LayerGroup extends Layer { + /** + * Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection). + */ toGeoJSON(): Object; // should import GeoJSON typings + + /** + * Adds the given layer to the group. + */ addLayer(layer: Layer): this; + + /** + * Removes the given layer from the group. + */ removeLayer(layer: Layer): this; + + /** + * Removes the layer with the given internal ID from the group. + */ removeLayer(id: number): this; + + /** + * Returns true if the given layer is currently added to the group. + */ hasLayer(layer: Layer): boolean; + + /** + * Removes all the layers from the group. + */ clearLayers(): this; + + /** + * Calls methodName on every layer contained in this group, passing any additional parameters. + * Has no effect if the layers contained do not implement methodName. + */ invoke(methodName: string, ...params: Array): this; + + /** + * Iterates over the layers of the group, + * optionally specifying context of the iterator function. + */ eachLayer(fn: (layer: Layer) => void, context?: Object): this; + + /** + * Returns the layer with the given internal ID. + */ getLayer(id: number): Layer; + + /** + * Returns an array of all the layers added to the group. + */ getLayers(): Array; + + /** + * Calls setZIndex on every layer contained in this group, passing the z-index. + */ setZIndex(zIndex: number): this; + + /** + * Returns the internal ID for a layer + */ getLayerId(layer: Layer): number; } + /** + * Create a layer group, optionally given an initial set of layers. + */ export function layerGroup(layers: Array): LayerGroup; /** From ed9f34a0127e0ee5d1d2b535aa0c704a45c2679f Mon Sep 17 00:00:00 2001 From: Derrick Liu Date: Fri, 23 Sep 2016 10:32:26 -0700 Subject: [PATCH 25/28] Add docstrings, implement additional items from the Evented docs, fix typos --- leaflet/leaflet.d.ts | 125 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 124 insertions(+), 1 deletion(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index b76fe02b34..e203a066ec 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -203,22 +203,145 @@ declare namespace L { export type EventHandlerFnMap = {[type: string]: EventHandlerFn}; + /** + * A set of methods shared between event-powered classes (like Map and Marker). + * Generally, events allow you to execute some function when something happens + * with an object (e.g. the user clicks on the map, causing the map to fire + * 'click' event). + */ export interface Evented { + /** + * Adds a listener function (fn) to a particular event type of the object. + * You can optionally specify the context of the listener (object the this + * keyword will point to). You can also pass several space-separated types + * (e.g. 'click dblclick'). + */ on(type: string, fn: EventHandlerFn, context?: Object): this; + + /** + * Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove} + */ on(eventMap: EventHandlerFnMap): this; + + /** + * Removes a previously added listener function. If no function is specified, + * it will remove all the listeners of that particular event from the object. + * Note that if you passed a custom context to on, you must pass the same context + * to off in order to remove the listener. + */ off(type: string, fn?: EventHandlerFn, context?: Object): this; + + /** + * Removes a set of type/listener pairs. + */ off(eventMap: EventHandlerFnMap): this; + + /** + * Removes all listeners to all events on the object. + */ off(): this; + + /** + * Fires an event of the specified type. You can optionally provide a data + * object — the first argument of the listener function will contain its properties. + * The event might can optionally be propagated to event parents. + */ fire(type: string, data?: Object, propagate?: boolean): this; + + /** + * Returns true if a particular event type has any listeners attached to it. + */ listens(type: string): boolean; + + /** + * Behaves as on(...), except the listener will only get fired once and then removed. + */ once(type: string, fn: EventHandlerFn, context?: Object): this; - addEventParnet(obj: Evented): this; + + /** + * Behaves as on(...), except the listener will only get fired once and then removed. + */ + once(eventMap: EventHandlerFnMap): this; + + /** + * Adds an event parent - an Evented that will receive propagated events + */ + addEventParent(obj: Evented): this; + + /** + * Removes an event parent, so it will stop receiving propagated events + */ removeEventParent(obj: Evented): this; + + /** + * Alias for on(...) + * + * Adds a listener function (fn) to a particular event type of the object. + * You can optionally specify the context of the listener (object the this + * keyword will point to). You can also pass several space-separated types + * (e.g. 'click dblclick'). + */ addEventListener(type: string, fn: EventHandlerFn, context?: Object): this; + + /** + * Alias for on(...) + * + * Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove} + */ + addEventListener(eventMap: EventHandlerFnMap): this; + + /** + * Alias for off(...) + * + * Removes a previously added listener function. If no function is specified, + * it will remove all the listeners of that particular event from the object. + * Note that if you passed a custom context to on, you must pass the same context + * to off in order to remove the listener. + */ removeEventListener(type: string, fn: EventHandlerFn, context?: Object): this; + + /** + * Alias for off(...) + * + * Removes a set of type/listener pairs. + */ + removeEventListener(eventMap: EventHandlerFnMap): this; + + /** + * Alias for off() + * + * Removes all listeners to all events on the object. + */ clearAllEventListeners(): this; + + /** + * Alias for once(...) + * + * Behaves as on(...), except the listener will only get fired once and then removed. + */ addOneTimeEventListener(type: string, fn: EventHandlerFn, context?: Object): this; + + /** + * Alias for once(...) + * + * Behaves as on(...), except the listener will only get fired once and then removed. + */ + addOneTimeEventListener(eventMap: EventHandlerFnMap): this; + + /** + * Alias for fire(...) + * + * Fires an event of the specified type. You can optionally provide a data + * object — the first argument of the listener function will contain its properties. + * The event might can optionally be propagated to event parents. + */ fireEvent(type: string, data?: Object, propagate?: boolean): this; + + /** + * Alias for listens(...) + * + * Returns true if a particular event type has any listeners attached to it. + */ hasEventListeners(type: string): boolean; } From aee664c7fe39679e29015fe48dc01406f6503ba8 Mon Sep 17 00:00:00 2001 From: NoHomey Date: Fri, 23 Sep 2016 20:48:54 +0300 Subject: [PATCH 26/28] Adding wiring-pi definition --- wiring-pi/wiring-pi-tests.ts | 89 ++++++++++ wiring-pi/wiring-pi.d.ts | 314 +++++++++++++++++++++++++++++++++++ 2 files changed, 403 insertions(+) create mode 100644 wiring-pi/wiring-pi-tests.ts create mode 100644 wiring-pi/wiring-pi.d.ts diff --git a/wiring-pi/wiring-pi-tests.ts b/wiring-pi/wiring-pi-tests.ts new file mode 100644 index 0000000000..856d3c2833 --- /dev/null +++ b/wiring-pi/wiring-pi-tests.ts @@ -0,0 +1,89 @@ +/// + +import * as wpi from 'wiring-pi'; + +console.log(wpi.VERSION); + +// Setup +let ret: number = wpi.wiringPiSetup(); +ret = wpi.wiringPiSetupGpio(); +ret = wpi.wiringPiSetupPhys(); +ret = wpi.wiringPiSetupSys(); +ret = wpi.setup('wpi'); +// Core functions +wpi.pinModeAlt(1, wpi.FSEL_ALT0); +wpi.pinMode(2, wpi.INPUT); +wpi.pullUpDnControl(2, wpi.PUD_UP); +let read: number = wpi.digitalRead(2); +wpi.pinMode(3, wpi.OUTPUT); +wpi.digitalWrite(3, wpi.HIGH); +wpi.pinMode(4, wpi.PWM_OUTPUT); +wpi.pwmWrite(4, 1023); +ret = wpi.gertboardAnalogSetup(5); +read = wpi.analogRead(5); +wpi.analogWrite(6, 100); +read = wpi.pulseIn(2, read); +wpi.delay(2); +wpi.delayMicroseconds(3); +ret = wpi.millis(); +ret = wpi.micros(); +// Interupts +wpi.wiringPiISR(2, wpi.INT_EDGE_BOTH, (delta: number) => console.log(delta)); +wpi.wiringPiISRCancel(2); +// Raspberry Pi hardware specific functions +ret = wpi.piBoardRev(); +let boardId: wpi.PiBoardId = wpi.piBoardId(); +console.log(boardId.model === wpi.PI_MODEL_BP); +console.log(boardId.rev === wpi.PI_VERSION_2); +console.log(boardId.maker === wpi.PI_MAKER_SONY); +let pin: number = wpi.wpiPinToGpio(9); +pin = wpi.physPinToGpio(9); +wpi.setPadDrive(1, 7); +ret = wpi.getAlt(1); +wpi.digitalWriteByte(9); +wpi.pwmSetMode(wpi.PWM_MODE_MS); +wpi.pwmSetRange(100); +wpi.pwmSetClock(2); +wpi.pwmToneWrite(6, 1024); +wpi.gpioClockSet(6, 1024); +// I2C +let fd: number = wpi.wiringPiI2CSetup(2); +fd = wpi.wiringPiI2CSetupInterface('/dev/i2c-2', 2); +read = wpi.wiringPiI2CRead(fd); +ret = wpi.wiringPiI2CWrite(fd, read); +read = wpi.wiringPiI2CReadReg8(fd, 2); +read = wpi.wiringPiI2CReadReg16(fd, 2); +ret = wpi.wiringPiI2CWriteReg8(fd, 2, read); +ret = wpi.wiringPiI2CWriteReg16(fd, 2, read); +// SPI +fd = wpi.wiringPiSPIGetFd(2); +fd = wpi.wiringPiSPISetup(2, 32000000); +fd = wpi.wiringPiSPISetupMode(2, 32000000, 3); +let buff: Buffer = new Buffer("spi data"); +ret = wpi.wiringPiSPIDataRW(2, buff); +console.log(buff.toString()); +// Serial +fd = wpi.serialOpen('/dev/AMA0', 9600); +wpi.serialFlush(fd); +wpi.serialPutChar(fd, 'i'.charCodeAt(0)); +wpi.serialPuts(fd, 'serial data'); +wpi.serialPrintf(fd, 'more'); +read = wpi.serialDataAvail(fd); +read = wpi.serialGetchar(fd); +wpi.serialClose(fd); +// Shift +ret = wpi.shiftIn(7, 8, wpi.MSBFIRST); +wpi.shiftOut(7, 8, wpi.LSBFIRST, ret); +// Soft PWM +wpi.pinMode(9, wpi.SOFT_PWM_OUTPUT); +ret = wpi.softPwmCreate(9, 100, 100); +wpi.softPwmWrite(9, 98); +wpi.softPwmStop(9); +// Soft Servo +ret = wpi.softServoSetup(10, 11, 12, 13, 14, 14, 16, 17); +wpi.softServoWrite(10, 100); +// Soft Tone +wpi.pinMode(18, wpi.SOFT_TONE_OUTPUT); +ret = wpi.softToneCreate(18); +wpi.softToneWrite(18, 98); +wpi.softToneStop(18); \ No newline at end of file diff --git a/wiring-pi/wiring-pi.d.ts b/wiring-pi/wiring-pi.d.ts new file mode 100644 index 0000000000..465a3cc1ad --- /dev/null +++ b/wiring-pi/wiring-pi.d.ts @@ -0,0 +1,314 @@ +// Type definitions for wiring-pi 2.1.1 +// Project: https://github.com/eugeneware/wiring-pi +// Definitions by: Ivo Stratev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'wiring-pi' { + // Setup + export function wiringPiSetup(): number; + export function wiringPiSetupGpio(): number; + export function wiringPiSetupPhys(): number; + export function wiringPiSetupSys(): number; + export function setup(mode: string): number; + // Core functions + export function pinModeAlt(pin: number, mode: number): void; + export function pinMode(pin: number, mode: number): void; + export function pullUpDnControl(pin: number, pud: number): void; + export function digitalRead(pin: number): number; + export function digitalWrite(pin: number, state: number): void; + export function pwmWrite(pin: number, value: number): void; + export function analogRead(pin: number): number; + export function analogWrite(pin: number, value: number): void; + export function pulseIn(pin: number, state: number): number; + export function delay(ms: number): void; + export function delayMicroseconds(us: number): void; + export function millis(): number; + export function micros(): number; + // Interrupts + export function wiringPiISR(pin: number, edgeType: number, callback: (delta: number) => void): void; + export function wiringPiISRCancel(pin: number): void; + export const INST_EDGE_FALLING: number; + export const INT_EDGE_RISING: number; + export const INT_EDGE_BOTH: number; + export const INT_EDGE_SETUP: number; + // Raspberry Pi hardware specific functions + export function piBoardRev(): number; + + export interface PiBoardId { + model: number; + rev: number; + mem: number; + maker: number; + overvolted: number; + } + + export function piBoardId(): PiBoardId; + export function wpiPinToGpio(pin: number): number; + export function physPinToGpio(pin: number): number; + export function setPadDrive(group: number, value: number): void; + export function getAlt(pin: number): number; + export function digitalWriteByte(byte: number): void; + export function pwmSetMode(mode: number): void; + export function pwmSetRange(range: number): void; + export function pwmSetClock(divisor: number): void; + export function pwmToneWrite(pin: number, frequency: number): void; + export function gpioClockSet(pin: number, frequency: number): void; + // Constants + // WPI_MODEs + export const WPI_MODE_PINS: number; + export const WPI_MODE_PHYS: number; + export const WPI_MODE_GPIO: number; + export const WPI_MODE_GPIO_SYS: number; + export const WPI_MODE_PIFACE: number; + export const WPI_MODE_UNINITIALISED: number; + // pinMode + export const INPUT: number; + export const OUTPUT: number; + export const PWM_OUTPUT: number; + export const GPIO_CLOCK: number; + export const SOFT_PWM_OUTPUT: number; + export const SOFT_TONE_OUTPUT: number; + // pullUpDnControl + export const PUD_OFF: number; + export const PUD_DOWN: number; + export const PUD_UP: number; + // digitalRead/Write + export const HIGH: number; + export const LOW: number; + // pwmSetMode + export const PWM_MODE_BAL: number; + export const PWM_MODE_MS: number; + // PiBoardId.model + export const PI_MODEL_UNKNOWN: number; + export const PI_MODEL_A: number; + export const PI_MODEL_B: number; + export const PI_MODEL_BP: number; + export const PI_MODEL_CM: number; + export const PI_MODEL_AP: number; + export const PI_MODEL_2: number; + // PiBoardId.rev + export const PI_VERSION_UNKNOWN: number; + export const PI_VERSION_1: number; + export const PI_VERSION_1_1: number; + export const PI_VERSION_1_2: number; + export const PI_VERSION_2: number; + // PiBoardId,marker + export const PI_MAKER_UNKNOWN: number; + export const PI_MAKER_EGOMAN: number; + export const PI_MAKER_SONY: number; + export const PI_MAKER_QISDA: number; + export const PI_MAKER_MBEST: number; + // arrays + export const PI_MODEL_NAMES: string[]; + export const PI_REVISION_NAMES: string[]; + export const PI_MAKER_NAMES: string[]; + // pinModeAlt + export const FSEL_INPT: number; + export const FSEL_OUTP: number; + export const FSEL_ALT0: number; + export const FSEL_ALT1: number; + export const FSEL_ALT2: number; + export const FSEL_ALT3: number; + export const FSEL_ALT4: number; + export const FSEL_ALT5: number; + // I2C + export function wiringPiI2CSetup(devId: number): number; + export function wiringPiI2CSetupInterface(device: string, devId: number): number; + export function wiringPiI2CRead(fd: number): number; + export function wiringPiI2CReadReg8(fd: number, reg: number): number; + export function wiringPiI2CReadReg16(fd: number, reg: number): number; + export function wiringPiI2CWrite(fd: number, data: number): number; + export function wiringPiI2CWriteReg8(fd: number, reg: number, data: number): number; + export function wiringPiI2CWriteReg16(fd: number, reg: number, data: number): number; + // SPI + export function wiringPiSPIGetFd(channel: number): number; + export function wiringPiSPIDataRW(channel: number, data: Buffer): number; + export function wiringPiSPISetup(channel: number, speed: number): number; + export function wiringPiSPISetupMode(channel: number, speed: number, mode: number): number; + // Serial + export function serialOpen(device: string, baudrate: number): number; + export function serialClose(fd: number): void; + export function serialFlush(fd: number): void; + export function serialPutChar(fd: number, character: number): void; + export function serialPuts(fd: number, data: string): void; + export function serialPrintf(fd: number, data: string): void; + export function serialDataAvail(fd: number): number; + export function serialGetchar(fd: number): number; + // Shift + export function shiftIn(dPin: number, cPin: number, order: number): number; + export function shiftOut(dPin: number, cPin: number, order: number, value: number): void; + export const LSBFIRST: number; + export const MSBFIRST: number; + // Soft PWM + export function softPwmCreate(pin: number, value: number, range: number): number; + export function softPwmWrite(pin: number, value: number): void; + export function softPwmStop(pin: number): void; + // Soft Servo + export function softServoWrite(pin: number, value: number): void; + export function softServoSetup(p0: number, p1: number, p2: number, p3: number, p4: number, p5: number, p6: number, p7: number): number; + // Soft Tone + export function softToneCreate(pin: number): number; + export function softToneWrite(pin: number, frequency: number): void; + export function softToneStop(pin: number): void; + // Extentions + // dac7678 + export function dac7678Setup(pinBase: number, i2cAddress: number, vrefMode: number): number; + export const DAC7678_VREF_MODE_STATIC_ON: number; + export const DAC7678_VREF_MODE_STATIC_OFF: number; + export const DAC7678_VREF_MODE_FLEXIBLE_ON: number; + export const DAC7678_VREF_MODE_FLEXIBLE_ALWAYS_ON: number; + export const DAC7678_VREF_MODE_FLEXIBLE_ALWAYS_OFF: number; + // drcSerial + export function drcSerialSetup(pinBase: number, numPins: number, device: string, baudrate: number): number; + // max31855 + export function max31855Setup(pinBase: number, spiChannel: number): number; + // max5322 + export function max5322Setup(pinBase: number, spiChannel: number): number; + // mcp23008 + export function mcp23008Setup(pinBase: number, i2cAddress: number): number; + // mpc23016 + export function mpc23016Setup(pinBase: number, i2cAddress: number): number; + // mpc23017 + export function mpc23017Setup(pinBase: number, i2cAddress: number): number; + // mcp23s08 + export function mcp23s08Setup(pinBase: number, spiChannel: number, devId: number): number; + // mcp23s17 + export function mcp23s17Setup(pinBase: number, spiChannel: number, devId: number): number; + // mcp3002 + export function mcp3002Setup(pinBase: number, spiChannel: number): number; + // mcp3004/8 + export function mcp3004Setup(pinBase: number, spiChannel: number): number; + // mcp3422 + export function mcp3422Setup(pinBase: number, i2cAddress: number, sampleRate: number, gain: number): number; + export const MCP3422_SR_3_75: number; + export const MCP3422_SR_15: number; + export const MCP3422_SR_60: number; + export const MCP3422_SR_240: number; + export const MCP3422_GAIN_1: number; + export const MCP3422_GAIN_2: number; + export const MCP3422_GAIN_4: number; + export const MCP3422_GAIN_8: number; + // mcp4802 + export function mcp4802Setup(pinBase: number, spiChannel: number): number; + // pca9685 + export function pca9685Setuo(pinBase: number, i2cAddress: number, frequency: number): number; + // pcf8574 + export function pcf8574Setup(pinBase: number, i2cAddress: number): number; + // pcf8591 + export function pcf8591Setup(pinBase: number, i2cAddress: number): number; + // sn3218 + export function sn3218Setup(pinBase: number): number; + // sr595 + export function sr595Setup(pinBase: number, numPins: number, dataPin: number, clockPin: number, latchPin: number): number; + // DevLib + // ds1302 + export function ds1302setup(clockPin: number, dataPin: number, csPin: number): void; + export function ds1302rtcRead(reg: number): number; + export function ds1302rtcWrite(reg: number, data: number): void; + export function ds1302ramRead(address: number): number; + export function ds1302ramWrite(address: number, data: number): void; + export function ds1302clockRead(): number[]; + export function ds1302clockWrite(clcokData: number[]): void; + export function ds1302trickleCharge(diodes: number, resistors: number): void; + // GertBoard + export function gertboardAnalogSetup(pinBase: number): number; + // LCD + export function lcdInit(rows: number, cols: number, bits: number, rs: number, strb: number, d0: number, d1: number, d2: number, d3: number, d4: number, d5: number, d6: number, d7: number): number; + export function lcdHome(fd: number): void; + export function lcdClear(fd: number): void; + export function lcdDisplay(fd: number, state: number): void; + export function lcdCursor(fd: number, state: number): void; + export function lcdCursorBlink(fd: number, state: number): void; + export function lcdSendCommand(fd: number, command: number): void; + export function lcdPosition(fd: number, x: number, y: number): void; + export function lcdCharDef(fd: number, index: number, data: number[]): void; + export function lcdPutchar(fd: number, data: number): void; + export function lcdPuts(fd: number, data: string): void; + export function lcdPrintf(fd: number, data: string): void; + export const MAX_LCDS: number; + // LCD 128x64 + export function lcd128x64setup(): number; + export function lcd128x64setOrigin(x: number, y: number): void; + export function lcd128x64setOrientation(orientation: number): void; + export function lcd128x64orientCoordinates(): number[]; + export function lcd128x64getScreenSize(): number[]; + export function lcd128x64point(x: number, y: number, color: number): void; + export function lcd128x64line(x0: number, y0: number, x1: number, y1: number, color: number): void; + export function lcd128x64lineTo(x: number, y: number, color: number): void; + export function lcd128x64rectangle(x1: number, y1: number, x2: number, y2: number, color: number, filled: number): void; + export function lcd128x64circle(x: number, y: number, r: number, color: number, filled: number): void; + export function lcd128x64ellipse(cx: number, cy: number, xRadius: number, yRadius: number, color: number, filled: number): void; + export function lcd128x64putchar(x: number, y: number, c: number, bgColor: number, fgColor: number): void; + export function lcd128x64puts(x: number, y: number, data: string, bgColor: number, fgColor: number): void; + export function lcd128x64update(): void; + export function lcd128x64clear(color: number): void; + // cd128x64clear + export function maxDetectRead(pin: number): number[]; + export function readRHT03(pin: number): number[]; + // piFace + export function piFaceSetup(pinBase: number): number; + // piGlow + export function piGlowSetup(clear: number): void; + export function piGlow1(leg: number, ring: number, intensity: number): void; + export function piGlowLeg(leg: number, intensity: number): void; + export function piGlowRing(ring: number, intensity: number): void; + export const PIGLOW_RED: number; + export const PIGLOW_YELLOW: number; + export const PIGLOW_ORANGE: number; + export const PIGLOW_GREEN: number; + export const PIGLOW_BLUE: number; + export const PIGLOW_WHITE: number; + + // pinNes + export function setupNesJoystick(dPin: number, cPin: number, lPin: number): number; + export function readNesJoystick(joystick: number): number; + export const MAX_NES_JOYSTICKS: number; + export const NES_RIGHT: number; + export const NES_LEFT: number; + export const NES_DOWN: number; + export const NES_UP: number; + export const NES_START: number; + export const NES_SELECT: number; + export const NES_A: number; + export const NES_B: number; + // tcs34725 + export function tcs34725Setup(i2cAddress: number, integrationTime: number, gain: number): number; + + export interface tcs34725RGBC { + r: number; + g: number; + b: number; + c: number; + } + + export function tcs34725ReadRGBC(id: number): tcs34725RGBC; + + export interface tcs34725HSV { + h: number; + s: number; + v: number; + } + + export function tcs34725ReadHSV(id: number): tcs34725HSV; + export function tcs34725GetCorrelatedColorTemperature(r: number, g: number, b: number): void; + export function tcs34725GetIlluminance(r: number, g: number, b: number): void; + export function tcs34725SetInterrupt(id: number, aien: number): void; + export function tcs34725ClearInterrupt(id: number): void; + export function tcs34725SetInterruptLimits(id: number, low: number, high: number): void; + export function tcs34725Enable(id: number): void; + export function tcs34725Disable(id: number): void; + export const TCS34725_ATIME_2_4MS: number; + export const TCS34725_ATIME_24MS: number; + export const TCS34725_ATIME_50MS: number; + export const TCS34725_ATIME_101MS: number; + export const TCS34725_ATIME_154MS: number; + export const TCS34725_ATIME_700MS: number; + export const TCS34725_GAIN_1: number; + export const TCS34725_GAIN_4: number; + export const TCS34725_GAIN_16: number; + export const TCS34725_GAIN_60: number; + export const TCS34725_MAX_TCS34725: number; + export const VERSION: string; +} From aab909252472a20546bd006fc3c8573613c790eb Mon Sep 17 00:00:00 2001 From: Erin Coughlan Date: Fri, 23 Sep 2016 10:59:37 -0700 Subject: [PATCH 27/28] Update MdPanel in angular-material.d.ts file Adds interceptor logic and updates offsetX and offsetY to accept new param types. --- angular-material/angular-material.d.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 68d645abfa..31da141bf9 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -355,6 +355,9 @@ declare namespace angular.material { removeClass(oldClass: string): void; toggleClass(toggleClass: string): void; updatePosition(position: IPanelPosition): void; + registerInterceptor(type: string, callback: () => angular.IPromise): IPanelRef; + removeInterceptor(type: string, callback: () => angular.IPromise): IPanelRef; + removeAllInterceptors(type?: string): IPanelRef; } interface IPanelPosition { @@ -370,8 +373,8 @@ declare namespace angular.material { centerVertically(): IPanelPosition; center(): IPanelPosition; addPanelPosition(xPosition: string, yPosition: string): IPanelPosition; - withOffsetX(offsetX: string): IPanelPosition; - withOffsetY(offsetY: string): IPanelPosition; + withOffsetX(offsetX: string|((panel: IPanelPosition) => string)): IPanelPosition; + withOffsetY(offsetY: string|((panel: IPanelPosition) => string)): IPanelPosition; } interface IPanelAnimation { @@ -404,5 +407,8 @@ declare namespace angular.material { SCALE: string, FADE: string, }; + interceptorTypes: { + CLOSE: string, + }; } } From 867ca84ab6cf3ebb8f68d36054e830638d587b29 Mon Sep 17 00:00:00 2001 From: Dasa Paddock Date: Fri, 23 Sep 2016 13:17:45 -0700 Subject: [PATCH 28/28] Update for ArcGIS API for JavaScript version 3.18 --- arcgis-js-api/arcgis-js-api.d.ts | 480 ++++++++++++++++++++++++++++--- 1 file changed, 435 insertions(+), 45 deletions(-) diff --git a/arcgis-js-api/arcgis-js-api.d.ts b/arcgis-js-api/arcgis-js-api.d.ts index 65765fbb09..d27429b428 100644 --- a/arcgis-js-api/arcgis-js-api.d.ts +++ b/arcgis-js-api/arcgis-js-api.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript v3.17 +// Type definitions for ArcGIS API for JavaScript v3.18 // Project: http://js.arcgis.com // Definitions by: Esri // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -44,6 +44,7 @@ declare module "esri" { import QueryTask = require("esri/tasks/QueryTask"); import TextSymbol = require("esri/symbols/TextSymbol"); import StandardGeographyQueryTask = require("esri/tasks/geoenrichment/StandardGeographyQueryTask"); + import WCSConnection = require("esri/layers/WCSConnection"); import WMSLayerInfo = require("esri/layers/WMSLayerInfo"); import WMTSLayerInfo = require("esri/layers/WMTSLayerInfo"); @@ -483,12 +484,14 @@ declare module "esri" { featureLayers: FeatureLayer[]; /** Reference to the map object. */ map?: Map; - /** The point feature layer containing the origin points. */ - originsLayer: FeatureLayer; + /** The point feature layers containing the origin points. */ + originsLayers: FeatureLayer[]; /** The name of the output layer to be shown in the Result layer name input box. */ outputLayerName?: string; /** The url to the ArcGIS.com site or in-house portal where the GP server is hosted. */ portalUrl?: string; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer?: boolean; } export interface CoordinatesLocationProviderOptions { /** The attribute field in the graphic object that contains the longitude (X) values. */ @@ -563,12 +566,14 @@ declare module "esri" { export interface CreateWatershedsOptions { /** The URL to the GPServer used to execute an analysis job. */ analysisGpServer?: string; - /** The feature layer containing input points used for calculating watersheds. */ - inputLayer: FeatureLayer; + /** The feature layers containing input points used for calculating watersheds. */ + inputLayers: FeatureLayer[]; /** Reference to the map object. */ map?: Map; /** The url to the ArcGIS.com site or in-house portal where the GP server is hosted. */ portalUrl?: string; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer?: boolean; } export interface CutOptions { /** The feature(s) added to the feature layer by the cut operation. */ @@ -939,6 +944,10 @@ declare module "esri" { outFields?: string[]; /** Displays or hides the attachment column. */ showAttachments?: boolean; + /** Displays or hides tooltips for column headers. */ + showColumnHeaderTooltips?: boolean; + /** Shows or hides cyclical relationship. */ + showCyclicalRelationships?: boolean; /** Displays the data type of the field right under the field label. */ showDataTypes?: boolean; /** Displays or hides total number of features and selected number of features in the grid header. */ @@ -947,6 +956,8 @@ declare module "esri" { showGridHeader?: boolean; /** Displays or hides 'Options' drop-down menu of the FeatureTable. */ showGridMenu?: boolean; + /** Displays or hides the option to show related records in a table if the layer has pre-established relationship. */ + showRelatedRecords?: boolean; /** Displays or hides the 'Statistics' option in column menus for numeric fields. */ showStatistics?: boolean; /** Enables an interaction between the map and the feature table. */ @@ -1996,6 +2007,30 @@ declare module "esri" { /** The URL to use for connecting to a socket. */ socketUrl?: string; } + export interface StretchFilterOptions { + /** Indicates whether to perform dynamic range adjustment using the current pixel data. */ + dra?: boolean; + /** An array of gamma values, for example [0.8, 0.8, 0.8]. */ + gamma?: number[]; + /** The maximum value of stretched pixels. */ + max?: number; + /** Percent of pixels clipped on the right histogram tail, for example 0.25. */ + maxPercent?: number; + /** The minimum value of stretched pixels. */ + min?: number; + /** Percent of pixels clipped on the left histogram tail, for example 1.5. */ + minPercent?: number; + /** The number of standard deviations for StandardDeviation stretch, for example 2.5. */ + numberOfStandardDeviations?: number; + /** The output pixel type. */ + outputPixelType?: string; + /** An array of arrays containing custom statistics objects. */ + statistics?: any[][]; + /** See the constants table for a list of possible stretchType values. */ + stretchType?: number; + /** Indicates whether to perform non-linear gamma stretch. */ + useGamma?: boolean; + } export interface SummarizeNearbyOptions { /** The URL to the GPServer used to execute an analysis job. */ analysisGpServer?: string; @@ -2023,6 +2058,8 @@ declare module "esri" { showCredits?: boolean; /** When true, the help links will be shown. */ showHelp?: boolean; + /** Indicates whether to display a drop down menu listing valid input analysis layers. */ + showSelectAnalysisLayer?: boolean; /** When true, the select folder dropdown will be shown. */ showSelectFolder?: boolean; /** An array of possible statistics attribute field names and summary types that you wish to calculate for all nearby features. */ @@ -2031,8 +2068,8 @@ declare module "esri" { summaryLayer?: FeatureLayer; /** An array of possible feature layers summarizing toward. */ summaryLayers: FeatureLayer[]; - /** The point, line, or polygon feature layer from which distances will be measured to features in summarizeLayer. */ - sumNearbyLayer: FeatureLayer; + /** The point, line, or polygon feature layers from which distances will be measured to features in summarizeLayer. */ + sumNearbyLayers: FeatureLayer[]; /** If true. */ sumShape?: boolean; /** Type of units shown as the defeault value in the Find nearest features using a option. */ @@ -2184,27 +2221,37 @@ declare module "esri" { /** Region of preview scale thumbnails. */ region?: string; } + export interface WCSConnectionOptions { + /** The coverage identifier, defaults to the first coverage. */ + coverageId?: string; + /** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */ + version?: string; + } + export interface WCSLayerOptions { + /** The coverage identifier, defaults to the first coverage. */ + coverageId?: string; + /** Sets the layer's draw mode. */ + drawMode?: boolean; + /** Sets the context of the Canvas. */ + drawType?: string; + /** A function that takes a pixelData object as input and processes it. */ + pixelFilter?: Function; + /** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */ + version?: string; + /** A WCS Connection object. */ + wcsConnection?: WCSConnection; + } export interface WFSLayerOptions { - /** Full WFS body request sent to WFS server via POST method. */ - getFeatureRequest?: string; - /** URL used when executing getFeature request. */ - getFeatureUrl?: string; + /** Use this to append custom parameters to WFS requests. */ + customParameters?: any; /** The template that defines the content to display in the map info window when the user clicks on a feature. */ infoTemplate?: InfoTemplate; - /** For "ondemand" mode only. */ - inverseFilter?: boolean; - /** When true, the XY coordinates should be swapped (this is required for some WFS vendors, versions, and WKIDS). */ - inverseResponse?: boolean; /** Specifies the maximum number of features to return in one response. */ maxFeatures?: number; /** The query mode for the WFS layer. */ mode?: string; - /** For "ondemand" mode only. */ - nsGeometryFieldName?: string; - /** The full layer name including the namespace as a prefix. */ - nsLayerName?: string; - /** When true, more details will be printed to console when the first connection to a WFS server is established. */ - showDetails?: boolean; + /** The simple layer name (excluding the namespace). */ + name?: string; /** URL to the WFS server. */ url: string; /** OGC WFS version number. */ @@ -2235,6 +2282,10 @@ declare module "esri" { title?: string; } export interface WMSLayerOptions { + /** The customLayerParameters object used for the WMS Layer. */ + customLayerParameters?: any; + /** The customParameters object used for the WMS Layer. */ + customParameters?: any; /** Specify the map image format, valid options are png,jpg,bmp,gif,svg. */ format?: string; /** An optional resourceInfo object. */ @@ -2267,6 +2318,10 @@ declare module "esri" { title?: string; } export interface WMTSLayerOptions { + /** The customLayerParameters object used for the WMTS Layer. */ + customLayerParameters?: any; + /** The customParameters object used for the WMTS Layer. */ + customParameters?: any; /** A WMTSLayerInfo object that when ResourceInfo options are not specified the map will display the first layer in the WMTS capabilities that matches the properties specified by WMTSLayerInfo. */ layerInfo?: WMTSLayerInfo; /** When true, tile resampling is enabled. */ @@ -2783,7 +2838,7 @@ declare module "esri/TimeExtent" { * Returns a new time extent indicating the intersection between "this" and the argument time extent. * @param timeExtent The input time extent. */ - intersection(timeExtent: number): TimeExtent; + intersection(timeExtent: TimeExtent): TimeExtent; /** * Returns a new time extent with the given offset from "this' time extent. * @param offsetValue The length of time to offset from "this" time extent. @@ -2946,7 +3001,7 @@ declare module "esri/arcgis/Portal" { /** The prefix selected by the organization's administrator to be used with the customBaseURL. */ urlKey: string; /** User information for the accessing user is returned only when a token is passed in. */ - user: any; + user: PortalUser; /** If true, only simple where clauses that are complaint with SQL92 can be used when querying layers and tables. */ useStandardizedQuery: boolean; /** @@ -3951,6 +4006,8 @@ declare module "esri/dijit/ElevationProfile" { startup(): void; /** Fires when the elevation profile is cleared. */ on(type: "clear-profile", listener: (event: { target: ElevationProfile }) => void): esri.Handle; + /** Fires after the profile is generated. */ + on(type: "elevation-values", listener: (event: { data: any; target: ElevationProfile }) => void): esri.Handle; /** Fires when the widget has fully loaded. */ on(type: "load", listener: (event: { target: ElevationProfile }) => void): esri.Handle; /** Fires when the title of the elevation profile is changed */ @@ -3967,6 +4024,7 @@ declare module "esri/dijit/FeatureTable" { import FeatureLayer = require("esri/layers/FeatureLayer"); import Map = require("esri/map"); import FeatureEditResult = require("esri/layers/FeatureEditResult"); + import Graphic = require("esri/graphic"); /** Creates an instance of the FeatureTable widget within the provided DOM node. */ class FeatureTable { @@ -4012,6 +4070,10 @@ declare module "esri/dijit/FeatureTable" { selectedRows: any[]; /** Displays or hides the attachment column. */ showAttachments: boolean; + /** Displays or hides tooltips for column headers. */ + showColumnHeaderTooltips: boolean; + /** Relies on showRelatedRecords property. */ + showCyclicalRelationships: boolean; /** Displays or hides the data type of the field right under the field label in the column header. */ showDataTypes: boolean; /** Displays or hides total number of features and selected number of features in the grid header. */ @@ -4020,6 +4082,8 @@ declare module "esri/dijit/FeatureTable" { showGridHeader: boolean; /** Displays or hides 'Options' drop-down menu of the FeatureTable. */ showGridMenu: boolean; + /** Displays or hides the option to show related records in a table if the layer has pre-established relationship. */ + showRelatedRecords: boolean; /** Displays or hides the 'Statistics' option in column menus for numeric fields. */ showStatistics: boolean; /** Enables an interaction between the map and the feature table. */ @@ -4032,35 +4096,55 @@ declare module "esri/dijit/FeatureTable" { * @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into. */ constructor(params: esri.FeatureTableOptions, srcNodeRef: Node | string); - /** Removes all current selections including subsets from filterSelectedRecords(). */ + /** Centers the map on combined extent of selected rows. */ + centerOnSelection(): void; + /** Removes all filters and selections in the table. */ + clearFilter(): void; + /** Removes all selections. */ clearSelection(): void; /** Destroys the FeatureTable widget. */ destroy(): void; /** - * Allows users to see the sub-set of currently selected records (uses dGrid.query). - * @param toggle When true only a subset of currently selected features will be displayed in the FeatureTable. + * Filters the table based on the provided row ids. + * @param ids Array of row ids. */ - filterSelectedRecords(toggle: boolean): void; + filterRecordsByIds(ids: number[]): void; + /** Allows users to see the sub-set of records. */ + filterSelectedRecords(): void; /** * Queries and gets selected features from the FeatureLayer instead of the store. - * @param id Array of row ids + * @param id Row id or an array of row ids */ - getFeatureDataById(id: number[]): any; + getFeatureDataById(id: number | number[]): any; /** * Gets row object by the row ID. * @param id row ID */ getRowDataById(id: number): any; - /** Refreshes the data in the grid. */ + /** Refreshes the data in the table. */ refresh(): void; /** Resizes the grid's container. */ resize(): void; + /** + * Allows users to select rows(s) based on row id(s). + * @param ids Row id or an array of row ids + * @param scrollToRow Indicates whether the table should scroll to selected rows. + */ + selectRows(ids: number | number[], scrollToRow?: boolean): void; + /** + * Sorts a given field in ascending or descending order. + * @param field Name of the field + * @param descending Defines whether the specified field will be sorted in ascending or descending order. + */ + sort(field: string, descending?: boolean): void; /** Finalizes the creation of the widget. */ startup(): void; + /** This event fires in response to clearSelection() method. */ + on(type: "clear-selection", listener: (event: { target: FeatureTable }) => void): esri.Handle; /** Fires when the grid column is resized. */ - on(type: "column-resize", listener: (event: { target: FeatureTable }) => void): esri.Handle; + on(type: "column-resize", listener: (event: { resizeEvent: any; target: FeatureTable }) => void): esri.Handle; /** Fires when a column is hidden or shown via 'Options' drop-down menu. */ - on(type: "column-state-change", listener: (event: { target: FeatureTable }) => void): esri.Handle; + on(type: "column-state-change", listener: (event: { stateChangeEvent: any; target: FeatureTable }) => void): esri.Handle; /** Fires when grid editor field loses focus after being changed. */ on(type: "data-change", listener: (event: { target: FeatureTable }) => void): esri.Handle; /** Fires when grid editor is hidden. */ @@ -4072,19 +4156,23 @@ declare module "esri/dijit/FeatureTable" { /** Fires when an error occurs in the grid. */ on(type: "error", listener: (event: { target: FeatureTable }) => void): esri.Handle; /** Fires when grid is filtered. */ - on(type: "filter", listener: (event: { target: FeatureTable }) => void): esri.Handle; + on(type: "filter", listener: (event: { ids: number[]; target: FeatureTable }) => void): esri.Handle; /** Fires when the FeatureTable is loaded. */ on(type: "load", listener: (event: { target: FeatureTable }) => void): esri.Handle; /** Fires when the grid is refreshed. */ on(type: "refresh", listener: (event: { target: FeatureTable }) => void): esri.Handle; /** Fires when a row is deselected. */ - on(type: "row-deselect", listener: (event: { target: FeatureTable }) => void): esri.Handle; + on(type: "row-deselect", listener: (event: { event: any; target: FeatureTable }) => void): esri.Handle; /** Fires when a row is selected. */ - on(type: "row-select", listener: (event: { target: FeatureTable }) => void): esri.Handle; + on(type: "row-select", listener: (event: { event: any; target: FeatureTable }) => void): esri.Handle; + /** Fires when attachment is displayed in the table. */ + on(type: "show-attachments", listener: (event: { attachments: any; dialog: any; featureId: number; target: FeatureTable }) => void): esri.Handle; + /** Fires when related records are displayed in the table. */ + on(type: "show-related-records", listener: (event: { features: Graphic[]; relationship: any; row: any; target: FeatureTable }) => void): esri.Handle; /** Fires when the statistics dialog box shows the calculated statistics on a column with numeric data. */ on(type: "show-statistics", listener: (event: { statistics: any; target: FeatureTable }) => void): esri.Handle; /** Fires when a column is sorted. */ - on(type: "sort", listener: (event: { target: FeatureTable }) => void): esri.Handle; + on(type: "sort", listener: (event: { sortEvent: any; target: FeatureTable }) => void): esri.Handle; on(type: string, listener: (event: any) => void): esri.Handle; } export = FeatureTable; @@ -4168,7 +4256,7 @@ declare module "esri/dijit/Geocoder" { import GraphicsLayer = require("esri/layers/GraphicsLayer"); import Symbol = require("esri/symbols/Symbol"); - /** Starting with version 3.13, the Search Widget supersedes the Geocoder Widget and is deprecated. */ + /** The Geocoder widget was deprecated in version 3.13 and replaced by the Search widget. */ class Geocoder { /** Currently selected locator object. */ activeGeocoder: any; @@ -9403,6 +9491,8 @@ declare module "esri/layers/FeatureLayer" { labelingInfo: LabelClass[]; /** Unique ID of the layer that the FeatureLayer was constructed against. */ layerId: number; + /** The maximum allowable offset, only applicable for layers that are not editable. */ + maxAllowableOffset: number; /** The maximum number of results that will be returned from a query. */ maxRecordCount: number; /** Maximum visible scale for the layer. */ @@ -10914,7 +11004,7 @@ declare module "esri/layers/VectorTileLayer" { import SpatialReference = require("esri/SpatialReference"); import TileInfo = require("esri/layers/TileInfo"); - /** A VectorTileLayer accesses cached tiles of data and renders it in vector format. */ + /** A VectorTileLayer renders cached tiles of data. */ class VectorTileLayer extends Layer { /** The full extent of the layer. */ fullExtent: Extent; @@ -10946,6 +11036,224 @@ declare module "esri/layers/VectorTileLayer" { export = VectorTileLayer; } +declare module "esri/layers/WCSConnection" { + import esri = require("esri"); + import WCSCoverageDescription = require("esri/layers/WCSCoverageDescription"); + import DimensionalDefinition = require("esri/layers/DimensionalDefinition"); + + /** (Currently in beta), a helper class to discover available coverages in an OGC Web Coverage Service. */ + class WCSConnection { + /** Resamples pixel by bilinear interpolation. */ + static INTERPOLATION_BILINEAR: any; + /** Resamples pixel by cubic convolution. */ + static INTERPOLATION_CUBICCONVOLUTION: any; + /** Resamples pixel by nearest neighbor. */ + static INTERPOLATION_NEARESTNEIGHBOR: any; + /** An array of coverages offered by the WCS server. */ + coverages: WCSCoverageDescription[]; + /** Multiple dimensional definitions are usually used to filter data. */ + multidimensionalDefinition: DimensionalDefinition[]; + /** The name of the WCS server. */ + name: string; + /** Key-value pairs for URLs of different WCS operations: GetCapabilitiesDescribeCoverage */ + onlineResources: any; + /** An array of string values indicating WCS 2.0.1 profiles. */ + profiles: string[]; + /** An array of supported formats by the server. */ + supportedFormats: string[]; + /** The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space. */ + supportedInterpolations: number[]; + /** An array of supported WCS versions by the server. */ + supportedVersions: string[]; + /** URL to a WCS Server endpoint. */ + url: string; + /** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */ + version: string; + /** + * Creates a new WCSConnection. + * @param url URL to a WCS Server endpoint. + * @param options Optional parameters. + */ + constructor(url: string, options?: esri.WCSConnectionOptions); + /** Triggered when successfully retrieved list of coverages. */ + on(type: "onConnected", listener: (event: { target: WCSConnection }) => void): esri.Handle; + /** Triggered when an error occurred. */ + on(type: "onConnectionFailed", listener: (event: { error: Error; target: WCSConnection }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = WCSConnection; +} + +declare module "esri/layers/WCSCoverageDescription" { + import Extent = require("esri/geometry/Extent"); + import Point = require("esri/geometry/Point"); + import TimeInfo = require("esri/layers/TimeInfo"); + + /** (Currently in beta), the WCSCoverageDescription models the coverage properties offered by the WCS Server. */ + class WCSCoverageDescription { + /** Resamples pixel by bilinear interpolation. */ + static INTERPOLATION_BILINEAR: any; + /** Resamples pixel by cubic convolution. */ + static INTERPOLATION_CUBICCONVOLUTION: any; + /** Resamples pixel by nearest neighbor. */ + static INTERPOLATION_NEARESTNEIGHBOR: any; + /** An array of band names. */ + bandInfo: string[]; + /** Number of columns at the source resolution. */ + columns: number; + /** The coverage description text. */ + description: string; + /** Coverage extent in the native spatial reference. */ + extent: Extent; + /** The coverage id. */ + id: string; + /** Coverage extent in WGS84. */ + lonLatEnvelope: Extent; + /** A parsed multidimensional object that describes variables and dimensions. */ + multiDimensionalInfo: any; + /** A parsed coverage description object in a structure similar to WCS Coverage Description schema. */ + nativeCoverageDescription: any; + /** Coverage's source resolution. */ + resolution: Point; + /** Number of rows at the source resolution. */ + rows: number; + /** Generalized from the following properties:SupportedFormats for WCS 1.0.0 and 1.1.xserviceParameters.supportedFormats for WCS 2.0.1. */ + supportedFormats: string[]; + /** The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space. */ + supportedInterpolations: number[]; + /** Temporal information for the layer, such as time extent. */ + timeInfo: TimeInfo; + /** The current version of the coverage. */ + version: string; + /** + * Creates a new WCSCoverageDescription. + * @param coverageDocument The coverage description XML. + * @param version The version of the coverage description document. + */ + constructor(coverageDocument: string, version: string); + } + export = WCSCoverageDescription; +} + +declare module "esri/layers/WCSLayer" { + import esri = require("esri"); + import WCSCoverageDescription = require("esri/layers/WCSCoverageDescription"); + import Extent = require("esri/geometry/Extent"); + import DimensionalDefinition = require("esri/layers/DimensionalDefinition"); + import TimeInfo = require("esri/layers/TimeInfo"); + import WCSConnection = require("esri/layers/WCSConnection"); + import Point = require("esri/geometry/Point"); + import Layer = require("esri/layers/layer"); + + /** (Currently in beta) The WCSLayer works with OGC Web Coverage Services. */ + class WCSLayer { + /** Resamples pixel by bilinear interpolation. */ + static INTERPOLATION_BILINEAR: any; + /** Resamples pixel by cubic convolution. */ + static INTERPOLATION_CUBICCONVOLUTION: any; + /** Resamples pixel by nearest neighbor. */ + static INTERPOLATION_NEARESTNEIGHBOR: any; + /** Zero-based array of current band selections. */ + bandIds: number[]; + /** A reference to a WCSCoverageDescription object. */ + coverageDescription: WCSCoverageDescription; + /** The coverage identifier, defaults to the first coverage. */ + coverageId: string; + /** The extent of the full coverage. */ + extent: Extent; + /** Raster format of the layer. */ + format: string; + /** Current interpolation method. */ + interpolation: number; + /** When the layer is loaded, the value becomes "true", and layer properties can be accessed. */ + loaded: boolean; + /** Multiple dimensional definitions are usually used to filter data. */ + multidimensionalDefinition: DimensionalDefinition[]; + /** Opacity or transparency of layer. */ + opacity: number; + /** A function that takes a pixelData object as input and processes it. */ + pixelFilter: Function; + /** The pixel type of the image service. */ + pixelType: string; + /** The projected extent in the map's spatial reference. */ + projectedFullExtent: Extent; + /** When true, the layer is suspended. */ + suspended: boolean; + /** Temporal information for the layer, such as time extent. */ + timeInfo: TimeInfo; + /** URL to a WCS Server endpoint. */ + url: string; + /** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */ + version: string; + /** The visibility of the layer. */ + visible: boolean; + /** A WCS Connection object. */ + wcsConnection: WCSConnection; + /** + * Creates a new WCSLayer. + * @param url URL to a WCS Server endpoint. + * @param options Optional parameters. + */ + constructor(url: string, options?: esri.WCSLayerOptions); + /** Returns the context of the Canvas. */ + getContext(): any; + /** + * Returns an array of graphics as a Promise. + * @param mapPoint The map point location in which to identify. + */ + identify(mapPoint: Point): any; + /** Resumes layer drawing. */ + resume(): void; + /** + * Sets the opacity of the layer. + * @param opacity Value from 0 to 1, where 0 is 100% transparent and 1 has no transparency. + */ + setOpacity(opacity: number): void; + /** + * Sets a pixelFilter on the layer. + * @param pixelFilter The function defining the PixelFilter to set on the layer. + * @param doNotRefresh When true the layer will not refresh the map image. + */ + setPixelFilter(pixelFilter: Function, doNotRefresh?: boolean): void; + /** + * Determines if the layer will update its content based on the map's current time extent. + * @param use Use true to update the layer's content based on the map's current time extent. + */ + setUseMapTime(use: boolean): void; + /** + * Sets the visibility of the layer. + * @param isVisible Indicate whether to set layer visibility. + */ + setVisibility(isVisible: boolean): void; + /** Suspends layer drawing. */ + suspend(): void; + /** Fires when there is a problem retrieving a layer. */ + on(type: "error", listener: (event: { error: Error; target: WCSLayer }) => void): esri.Handle; + /** Fires after layer properties for the layer are successfully populated. */ + on(type: "load", listener: (event: { layer: Layer; target: WCSLayer }) => void): esri.Handle; + /** Fires when the layer opacity has been changed, and returns an object with the opacity value. */ + on(type: "opacity-change", listener: (event: { opacity: number; target: WCSLayer }) => void): esri.Handle; + /** This event is fired when the layer's refreshInterval is modified. */ + on(type: "refresh-interval-change", listener: (event: { target: WCSLayer }) => void): esri.Handle; + /** Fires when a layer resumes drawing. */ + on(type: "resume", listener: (event: { target: WCSLayer }) => void): esri.Handle; + /** Fires when a layer's minScale and/or maxScale is changed. */ + on(type: "scale-range-change", listener: (event: { target: WCSLayer }) => void): esri.Handle; + /** Fires when a layer's scale visibility changes. */ + on(type: "scale-visibility-change", listener: (event: { target: WCSLayer }) => void): esri.Handle; + /** Fires when a layer suspends drawing */ + on(type: "suspend", listener: (event: { target: WCSLayer }) => void): esri.Handle; + /** Fires when a layer has finished updating its content. */ + on(type: "update-end", listener: (event: { error: Error; target: WCSLayer }) => void): esri.Handle; + /** Fires when a layer begins to update its content. */ + on(type: "update-start", listener: (event: { target: WCSLayer }) => void): esri.Handle; + /** Fires when the layer visibility has been changed, and returns an object with a Boolean visible property containing the new visibility value of the layer. */ + on(type: "visibility-change", listener: (event: { visible: boolean; target: WCSLayer }) => void): esri.Handle; + on(type: string, listener: (event: any) => void): esri.Handle; + } + export = WCSLayer; +} + declare module "esri/layers/WFSLayer" { import esri = require("esri"); import GraphicsLayer = require("esri/layers/GraphicsLayer"); @@ -10957,6 +11265,8 @@ declare module "esri/layers/WFSLayer" { /** (Currently in beta) A layer for OGC Web Feature Services (WFS). */ class WFSLayer extends GraphicsLayer { + /** Use this to append custom parameters to WFS requests. */ + customParameters: any; /** An array of fields in the layer. */ fields: Field[]; /** The full extent of the layer. */ @@ -10987,6 +11297,11 @@ declare module "esri/layers/WFSLayer" { redraw(): void; /** Refreshes the features in the WFS layer. */ refresh(): void; + /** + * Sets the custom parameters used on the WFS layer. + * @param customParameters The customParameters object used append WFS requests. + */ + setCustomParameters(customParameters: any): void; /** Sets the default line symbol to be used if no renderer is specified. */ setLineSymbol(): void; /** Sets the default point symbol to be used if no renderer is specified. */ @@ -11012,12 +11327,20 @@ declare module "esri/layers/WMSLayer" { allExtents: Extent[]; /** Copyright of the WMS service. */ copyright: string; + /** Use this to append different custom parameters to WMS layer requests. */ + customLayerParameters: any; + /** Use this to append custom parameters to all WMS requests. */ + customParameters: any; /** Description of the WMS service. */ description: string; /** Extent of the WMS service. */ extent: Extent; + /** Feature info MIME type to request. */ + featureInfoFormat: string; + /** The URL for the WMS GetFeatureInfo call. */ + getFeatureInfoURL: string; /** The URL for the WMS GetMap call. */ - getMapUrl: string; + getMapURL: string; /** The map image format. */ imageFormat: string; /** List of layers in the WMS service. */ @@ -11034,12 +11357,22 @@ declare module "esri/layers/WMSLayer" { title: string; /** Version of the WMS service. */ version: string; + /** A list of layer names that represent the layers to include in the exported map. */ + visibleLayers: string[]; /** * Creates a new WMSLayer object. * @param url URL to the OGC Web Map Service. * @param options Optional parameters. */ constructor(url: string, options?: esri.WMSLayerOptions); + /** Returns the current map image format. */ + getImageFormat(): string; + /** + * Sets the custom parameters used on the WMS layer. + * @param customParameters The customParameters object used append WMS requests. + * @param customLayerParameters The customLayerParameters object used append specific WMS layer requests. + */ + setCustomParameters(customParameters: any, customLayerParameters?: any): void; /** * Set the map image format; valid values are "png", "jpg", "pdf", "bmp", "gif" and "svg". * @param format The image format. @@ -11106,6 +11439,10 @@ declare module "esri/layers/WMTSLayer" { class WMTSLayer extends TiledMapServiceLayer { /** Copyright information for the service. */ copyright: string; + /** Use this to append different custom parameters to a WMTS tile request. */ + customLayerParameters: any; + /** Use this to append custom parameters to all WMTS requests. */ + customParameters: any; /** The description of the active layer if specified in the capabilties file or the resource info. */ description: string; /** The tile format. */ @@ -11137,6 +11474,12 @@ declare module "esri/layers/WMTSLayer" { * @param WMTSLayerInfo The WMTSLayerInfo for the layer to make active. */ setActiveLayer(WMTSLayerInfo: WMTSLayerInfo): void; + /** + * Sets the custom parameters used on the WMTS layer. + * @param customParameters The customParameters object used append WMTS requests. + * @param customLayerParameters The customLayerParameters object used append specific WMTS layer requests. + */ + setCustomParameters(customParameters: any, customLayerParameters?: any): void; } export = WMTSLayer; } @@ -11315,6 +11658,47 @@ declare module "esri/layers/layer" { export = Layer; } +declare module "esri/layers/pixelfilters/StretchFilter" { + import esri = require("esri"); + + /** A stretch filter used to work with client -side pixel data to enhance raster/image appearances. */ + class StretchFilter { + /** Indicates whether to perform dynamic range adjustment using the current pixel data. */ + dra: boolean; + /** An array of gamma values, for example [0.8, 0.8, 0.8]. */ + gamma: number[]; + /** The maximum value of stretched pixels. */ + max: number; + /** Percent of pixels clipped on the right histogram tail, for example 0.25. */ + maxPercent: number; + /** The minimum value of stretched pixels. */ + min: number; + /** Percent of pixels clipped on the left histogram tail, for example 1.5. */ + minPercent: number; + /** The number of standard deviations for StandardDeviation stretch, for example 2.5. */ + numberOfStandardDeviations: number; + /** The output pixel type. */ + outputPixelType: string; + /** An array of arrays containing custom statistics objects. */ + statistics: any[][]; + /** Number indicating the various stretch types. */ + stretchType: number; + /** Indicates whether to perform non-linear gamma stretch. */ + useGamma: boolean; + /** + * Creates an instance of a StretchFilter. + * @param options Optional parameters. + */ + constructor(options?: esri.StretchFilterOptions); + /** + * It takes a pixelData object as input and processes it. + * @param pixelData The pixelData object used as filter input. + */ + filter(pixelData: any): void; + } + export = StretchFilter; +} + declare module "esri/map" { import esri = require("esri"); import Attribution = require("esri/dijit/Attribution"); @@ -11779,8 +12163,8 @@ declare module "esri/opsdashboard/ExtensionBase" { static POLYLINE: any; /** Read-only: Indicates if the host application is the Windows Operations Dashboard. */ isNative: boolean; - /** Read Only: It will list all of the Portal helper services. */ - portalHelperServices: string; + /** Read-only: It will list all of the Portal helper services. */ + portalHelperServices: any; /** Read-only: The URL to the ArcGIS.com site or in-house portal that you are currently signed in to. */ portalUrl: string; /** Get the collection of data sources from the host application. */ @@ -11838,8 +12222,11 @@ declare module "esri/opsdashboard/ExtensionConfigurationBase" { class ExtensionConfigurationBase extends ExtensionBase { /** The object that will store the Widget/MapTool/FeatureAction configuration. */ config: any; - /** Indicates that the configuration is ready to be persisted or not. */ - readyToPersistConfig: boolean; + /** + * Indicates if the configuration is ready to be persisted or not. + * @param ready Indicates that the configuration is ready to be persisted or not. + */ + readyToPersistConfig(ready: boolean): void; } export = ExtensionConfigurationBase; } @@ -14127,6 +14514,8 @@ declare module "esri/tasks/FeatureSet" { features: Graphic[]; /** Set of name-value pairs for the attribute's field and alias names. */ fieldAliases: any; + /** The array of fields. */ + fields: any[]; /** The geometry type of the FeatureSet. */ geometryType: string; /** When a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default. */ @@ -14379,7 +14768,7 @@ declare module "esri/tasks/GeometryService" { url: string; /** * Creates a new GeometryService object. - * @param url URL to the ArcGIS Server REST resource that represents a GeometryService, e.g., http://sampleserver6.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer. + * @param url URL to the ArcGIS Server REST resource that represents a GeometryService, https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer. */ constructor(url: string); /** @@ -15165,6 +15554,7 @@ declare module "esri/tasks/PrintParameters" { declare module "esri/tasks/PrintTask" { import esri = require("esri"); import PrintParameters = require("esri/tasks/PrintParameters"); + import DataFile = require("esri/tasks/DataFile"); /** The PrintTask class generates a printer-ready version of the map using an Export Web Map Task available with ArGIS Server 10.1 and later. */ class PrintTask { @@ -15184,7 +15574,7 @@ declare module "esri/tasks/PrintTask" { */ execute(printParameters: PrintParameters, callback?: Function, errback?: Function): any; /** Fired when the print operation is complete. */ - on(type: "complete", listener: (event: { url: string; target: PrintTask }) => void): esri.Handle; + on(type: "complete", listener: (event: { result: DataFile; target: PrintTask }) => void): esri.Handle; /** Fired when an error occurs while executing the print task. */ on(type: "error", listener: (event: { error: Error; target: PrintTask }) => void): esri.Handle; on(type: string, listener: (event: any) => void): esri.Handle;

    This namespace declares an unspecified number of objects: _1, _2, _3, ..., which are - * used to specify placeholders in calls to function {@link std.bind}.

    This namespace declares an unspecified number of objects: _1, _2, _3, ..., which are + * used to specify placeholders in calls to function {@link std.bind}.

    This namespace declares an unspecified number of objects: _1, _2, _3, ..., which are + * used to specify placeholders in calls to function {@link std.bind}.

    This namespace declares an unspecified number of objects: _1, _2, _3, ..., which are - * used to specify placeholders in calls to function {@link std.bind}.