@itwin/core-bentley 4.0.0-dev.8 → 4.0.0-dev.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -1
- package/lib/cjs/AccessToken.d.ts +10 -10
- package/lib/cjs/AccessToken.d.ts.map +1 -1
- package/lib/cjs/AccessToken.js +9 -9
- package/lib/cjs/AccessToken.js.map +1 -1
- package/lib/cjs/Assert.d.ts +25 -25
- package/lib/cjs/Assert.js +45 -45
- package/lib/cjs/Assert.js.map +1 -1
- package/lib/cjs/BeEvent.d.ts +81 -81
- package/lib/cjs/BeEvent.d.ts.map +1 -1
- package/lib/cjs/BeEvent.js +156 -156
- package/lib/cjs/BeEvent.js.map +1 -1
- package/lib/cjs/BeSQLite.d.ts +172 -170
- package/lib/cjs/BeSQLite.d.ts.map +1 -1
- package/lib/cjs/BeSQLite.js +185 -183
- package/lib/cjs/BeSQLite.js.map +1 -1
- package/lib/cjs/BentleyError.d.ts +378 -378
- package/lib/cjs/BentleyError.d.ts.map +1 -1
- package/lib/cjs/BentleyError.js +703 -702
- package/lib/cjs/BentleyError.js.map +1 -1
- package/lib/cjs/BentleyLoggerCategory.d.ts +11 -11
- package/lib/cjs/BentleyLoggerCategory.js +19 -19
- package/lib/cjs/BentleyLoggerCategory.js.map +1 -1
- package/lib/cjs/ByteStream.d.ts +110 -110
- package/lib/cjs/ByteStream.js +159 -159
- package/lib/cjs/ByteStream.js.map +1 -1
- package/lib/cjs/ClassUtils.d.ts +14 -14
- package/lib/cjs/ClassUtils.js +27 -27
- package/lib/cjs/ClassUtils.js.map +1 -1
- package/lib/cjs/Compare.d.ts +47 -47
- package/lib/cjs/Compare.d.ts.map +1 -1
- package/lib/cjs/Compare.js +75 -75
- package/lib/cjs/Compare.js.map +1 -1
- package/lib/cjs/CompressedId64Set.d.ts +134 -134
- package/lib/cjs/CompressedId64Set.d.ts.map +1 -1
- package/lib/cjs/CompressedId64Set.js +428 -428
- package/lib/cjs/CompressedId64Set.js.map +1 -1
- package/lib/cjs/Dictionary.d.ts +125 -125
- package/lib/cjs/Dictionary.js +203 -203
- package/lib/cjs/Dictionary.js.map +1 -1
- package/lib/cjs/Disposable.d.ts +80 -80
- package/lib/cjs/Disposable.d.ts.map +1 -1
- package/lib/cjs/Disposable.js +120 -120
- package/lib/cjs/Disposable.js.map +1 -1
- package/lib/cjs/Id.d.ts +285 -285
- package/lib/cjs/Id.d.ts.map +1 -1
- package/lib/cjs/Id.js +643 -643
- package/lib/cjs/Id.js.map +1 -1
- package/lib/cjs/IndexMap.d.ts +65 -65
- package/lib/cjs/IndexMap.js +91 -91
- package/lib/cjs/IndexMap.js.map +1 -1
- package/lib/cjs/JsonSchema.d.ts +77 -77
- package/lib/cjs/JsonSchema.d.ts.map +1 -1
- package/lib/cjs/JsonSchema.js +9 -9
- package/lib/cjs/JsonSchema.js.map +1 -1
- package/lib/cjs/JsonUtils.d.ts +78 -78
- package/lib/cjs/JsonUtils.js +151 -151
- package/lib/cjs/JsonUtils.js.map +1 -1
- package/lib/cjs/LRUMap.d.ts +129 -129
- package/lib/cjs/LRUMap.js +333 -333
- package/lib/cjs/LRUMap.js.map +1 -1
- package/lib/cjs/Logger.d.ts +143 -143
- package/lib/cjs/Logger.d.ts.map +1 -1
- package/lib/cjs/Logger.js +256 -258
- package/lib/cjs/Logger.js.map +1 -1
- package/lib/cjs/ObservableSet.d.ts +23 -23
- package/lib/cjs/ObservableSet.js +51 -51
- package/lib/cjs/ObservableSet.js.map +1 -1
- package/lib/cjs/OneAtATimeAction.d.ts +31 -31
- package/lib/cjs/OneAtATimeAction.js +94 -94
- package/lib/cjs/OneAtATimeAction.js.map +1 -1
- package/lib/cjs/OrderedId64Iterable.d.ts +74 -74
- package/lib/cjs/OrderedId64Iterable.d.ts.map +1 -1
- package/lib/cjs/OrderedId64Iterable.js +235 -235
- package/lib/cjs/OrderedId64Iterable.js.map +1 -1
- package/lib/cjs/OrderedSet.d.ts +40 -40
- package/lib/cjs/OrderedSet.js +64 -64
- package/lib/cjs/OrderedSet.js.map +1 -1
- package/lib/cjs/PriorityQueue.d.ts +70 -70
- package/lib/cjs/PriorityQueue.d.ts.map +1 -1
- package/lib/cjs/PriorityQueue.js +140 -140
- package/lib/cjs/PriorityQueue.js.map +1 -1
- package/lib/cjs/ProcessDetector.d.ts +59 -59
- package/lib/cjs/ProcessDetector.js +71 -71
- package/lib/cjs/ProcessDetector.js.map +1 -1
- package/lib/cjs/SortedArray.d.ts +236 -232
- package/lib/cjs/SortedArray.d.ts.map +1 -1
- package/lib/cjs/SortedArray.js +315 -303
- package/lib/cjs/SortedArray.js.map +1 -1
- package/lib/cjs/StatusCategory.d.ts +30 -30
- package/lib/cjs/StatusCategory.d.ts.map +1 -1
- package/lib/cjs/StatusCategory.js +460 -460
- package/lib/cjs/StatusCategory.js.map +1 -1
- package/lib/cjs/StringUtils.d.ts +22 -22
- package/lib/cjs/StringUtils.js +148 -148
- package/lib/cjs/StringUtils.js.map +1 -1
- package/lib/cjs/Time.d.ts +122 -122
- package/lib/cjs/Time.js +152 -152
- package/lib/cjs/Time.js.map +1 -1
- package/lib/cjs/Tracing.d.ts +43 -40
- package/lib/cjs/Tracing.d.ts.map +1 -1
- package/lib/cjs/Tracing.js +134 -130
- package/lib/cjs/Tracing.js.map +1 -1
- package/lib/cjs/TupleKeyedMap.d.ts +36 -36
- package/lib/cjs/TupleKeyedMap.js +102 -102
- package/lib/cjs/TupleKeyedMap.js.map +1 -1
- package/lib/cjs/TypedArrayBuilder.d.ts +155 -155
- package/lib/cjs/TypedArrayBuilder.d.ts.map +1 -1
- package/lib/cjs/TypedArrayBuilder.js +206 -208
- package/lib/cjs/TypedArrayBuilder.js.map +1 -1
- package/lib/cjs/UnexpectedErrors.d.ts +43 -43
- package/lib/cjs/UnexpectedErrors.d.ts.map +1 -1
- package/lib/cjs/UnexpectedErrors.js +68 -68
- package/lib/cjs/UnexpectedErrors.js.map +1 -1
- package/lib/cjs/UtilityTypes.d.ts +112 -96
- package/lib/cjs/UtilityTypes.d.ts.map +1 -1
- package/lib/cjs/UtilityTypes.js +40 -40
- package/lib/cjs/UtilityTypes.js.map +1 -1
- package/lib/cjs/YieldManager.d.ts +18 -18
- package/lib/cjs/YieldManager.js +34 -34
- package/lib/cjs/YieldManager.js.map +1 -1
- package/lib/cjs/core-bentley.d.ts +74 -74
- package/lib/cjs/core-bentley.js +94 -90
- package/lib/cjs/core-bentley.js.map +1 -1
- package/lib/cjs/partitionArray.d.ts +21 -21
- package/lib/cjs/partitionArray.js +43 -43
- package/lib/cjs/partitionArray.js.map +1 -1
- package/lib/esm/AccessToken.d.ts +10 -10
- package/lib/esm/AccessToken.d.ts.map +1 -1
- package/lib/esm/AccessToken.js +8 -8
- package/lib/esm/AccessToken.js.map +1 -1
- package/lib/esm/Assert.d.ts +25 -25
- package/lib/esm/Assert.js +41 -41
- package/lib/esm/Assert.js.map +1 -1
- package/lib/esm/BeEvent.d.ts +81 -81
- package/lib/esm/BeEvent.d.ts.map +1 -1
- package/lib/esm/BeEvent.js +150 -150
- package/lib/esm/BeEvent.js.map +1 -1
- package/lib/esm/BeSQLite.d.ts +172 -170
- package/lib/esm/BeSQLite.d.ts.map +1 -1
- package/lib/esm/BeSQLite.js +182 -180
- package/lib/esm/BeSQLite.js.map +1 -1
- package/lib/esm/BentleyError.d.ts +378 -378
- package/lib/esm/BentleyError.d.ts.map +1 -1
- package/lib/esm/BentleyError.js +699 -698
- package/lib/esm/BentleyError.js.map +1 -1
- package/lib/esm/BentleyLoggerCategory.d.ts +11 -11
- package/lib/esm/BentleyLoggerCategory.js +16 -16
- package/lib/esm/BentleyLoggerCategory.js.map +1 -1
- package/lib/esm/ByteStream.d.ts +110 -110
- package/lib/esm/ByteStream.js +155 -155
- package/lib/esm/ByteStream.js.map +1 -1
- package/lib/esm/ClassUtils.d.ts +14 -14
- package/lib/esm/ClassUtils.js +22 -22
- package/lib/esm/ClassUtils.js.map +1 -1
- package/lib/esm/Compare.d.ts +47 -47
- package/lib/esm/Compare.d.ts.map +1 -1
- package/lib/esm/Compare.js +63 -63
- package/lib/esm/Compare.js.map +1 -1
- package/lib/esm/CompressedId64Set.d.ts +134 -134
- package/lib/esm/CompressedId64Set.d.ts.map +1 -1
- package/lib/esm/CompressedId64Set.js +423 -423
- package/lib/esm/CompressedId64Set.js.map +1 -1
- package/lib/esm/Dictionary.d.ts +125 -125
- package/lib/esm/Dictionary.js +199 -199
- package/lib/esm/Dictionary.js.map +1 -1
- package/lib/esm/Disposable.d.ts +80 -80
- package/lib/esm/Disposable.d.ts.map +1 -1
- package/lib/esm/Disposable.js +112 -112
- package/lib/esm/Disposable.js.map +1 -1
- package/lib/esm/Id.d.ts +285 -285
- package/lib/esm/Id.d.ts.map +1 -1
- package/lib/esm/Id.js +639 -639
- package/lib/esm/Id.js.map +1 -1
- package/lib/esm/IndexMap.d.ts +65 -65
- package/lib/esm/IndexMap.js +86 -86
- package/lib/esm/IndexMap.js.map +1 -1
- package/lib/esm/JsonSchema.d.ts +77 -77
- package/lib/esm/JsonSchema.d.ts.map +1 -1
- package/lib/esm/JsonSchema.js +8 -8
- package/lib/esm/JsonSchema.js.map +1 -1
- package/lib/esm/JsonUtils.d.ts +78 -78
- package/lib/esm/JsonUtils.js +148 -148
- package/lib/esm/JsonUtils.js.map +1 -1
- package/lib/esm/LRUMap.d.ts +129 -129
- package/lib/esm/LRUMap.js +326 -326
- package/lib/esm/LRUMap.js.map +1 -1
- package/lib/esm/Logger.d.ts +143 -143
- package/lib/esm/Logger.d.ts.map +1 -1
- package/lib/esm/Logger.js +253 -253
- package/lib/esm/Logger.js.map +1 -1
- package/lib/esm/ObservableSet.d.ts +23 -23
- package/lib/esm/ObservableSet.js +47 -47
- package/lib/esm/ObservableSet.js.map +1 -1
- package/lib/esm/OneAtATimeAction.d.ts +31 -31
- package/lib/esm/OneAtATimeAction.js +89 -89
- package/lib/esm/OneAtATimeAction.js.map +1 -1
- package/lib/esm/OrderedId64Iterable.d.ts +74 -74
- package/lib/esm/OrderedId64Iterable.d.ts.map +1 -1
- package/lib/esm/OrderedId64Iterable.js +232 -232
- package/lib/esm/OrderedId64Iterable.js.map +1 -1
- package/lib/esm/OrderedSet.d.ts +40 -40
- package/lib/esm/OrderedSet.js +59 -59
- package/lib/esm/OrderedSet.js.map +1 -1
- package/lib/esm/PriorityQueue.d.ts +70 -70
- package/lib/esm/PriorityQueue.d.ts.map +1 -1
- package/lib/esm/PriorityQueue.js +136 -136
- package/lib/esm/PriorityQueue.js.map +1 -1
- package/lib/esm/ProcessDetector.d.ts +59 -59
- package/lib/esm/ProcessDetector.js +67 -67
- package/lib/esm/ProcessDetector.js.map +1 -1
- package/lib/esm/SortedArray.d.ts +236 -232
- package/lib/esm/SortedArray.d.ts.map +1 -1
- package/lib/esm/SortedArray.js +308 -296
- package/lib/esm/SortedArray.js.map +1 -1
- package/lib/esm/StatusCategory.d.ts +30 -30
- package/lib/esm/StatusCategory.d.ts.map +1 -1
- package/lib/esm/StatusCategory.js +455 -454
- package/lib/esm/StatusCategory.js.map +1 -1
- package/lib/esm/StringUtils.d.ts +22 -22
- package/lib/esm/StringUtils.js +142 -142
- package/lib/esm/StringUtils.js.map +1 -1
- package/lib/esm/Time.d.ts +122 -122
- package/lib/esm/Time.js +146 -146
- package/lib/esm/Time.js.map +1 -1
- package/lib/esm/Tracing.d.ts +43 -40
- package/lib/esm/Tracing.d.ts.map +1 -1
- package/lib/esm/Tracing.js +130 -126
- package/lib/esm/Tracing.js.map +1 -1
- package/lib/esm/TupleKeyedMap.d.ts +36 -36
- package/lib/esm/TupleKeyedMap.js +98 -98
- package/lib/esm/TupleKeyedMap.js.map +1 -1
- package/lib/esm/TypedArrayBuilder.d.ts +155 -155
- package/lib/esm/TypedArrayBuilder.d.ts.map +1 -1
- package/lib/esm/TypedArrayBuilder.js +198 -200
- package/lib/esm/TypedArrayBuilder.js.map +1 -1
- package/lib/esm/UnexpectedErrors.d.ts +43 -43
- package/lib/esm/UnexpectedErrors.d.ts.map +1 -1
- package/lib/esm/UnexpectedErrors.js +65 -64
- package/lib/esm/UnexpectedErrors.js.map +1 -1
- package/lib/esm/UtilityTypes.d.ts +112 -96
- package/lib/esm/UtilityTypes.d.ts.map +1 -1
- package/lib/esm/UtilityTypes.js +34 -34
- package/lib/esm/UtilityTypes.js.map +1 -1
- package/lib/esm/YieldManager.d.ts +18 -18
- package/lib/esm/YieldManager.js +30 -30
- package/lib/esm/YieldManager.js.map +1 -1
- package/lib/esm/core-bentley.d.ts +74 -74
- package/lib/esm/core-bentley.js +78 -78
- package/lib/esm/core-bentley.js.map +1 -1
- package/lib/esm/partitionArray.d.ts +21 -21
- package/lib/esm/partitionArray.js +39 -39
- package/lib/esm/partitionArray.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../src/ProcessDetector.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,MAAa,eAAe;IAE1B;;OAEG;IACI,MAAM,KAAK,gBAAgB,KAAK,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC;IAEnH;;MAEE;IACK,MAAM,KAAK,aAAa,KAAK,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,SAAS,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE3G,uDAAuD;IAChD,MAAM,KAAK,qBAAqB,KAAK,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEjJ,sDAAsD;IAC/C,MAAM,KAAK,oBAAoB,KAAK,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,cAAc,CA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IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEtG,iEAAiE;IAC1D,MAAM,KAAK,gBAAgB,KAAK,OAAO,IAAI,CAAC,gBAAgB,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAE7H,qEAAqE;IAC9D,MAAM,KAAK,oBAAoB,KAAK,OAAO,IAAI,CAAC,gBAAgB,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAErI,gEAAgE;IACzD,MAAM,KAAK,eAAe,KAAK,OAAO,IAAI,CAAC,aAAa,IAAK,OAAO,CAAC,QAAgB,KAAK,KAAK,CAAC,CAAC,CAAC;IAEzG,oEAAoE;IAC7D,MAAM,KAAK,mBAAmB,KAAK,OAAO,IAAI,CAAC,aAAa,IAAK,OAAO,CAAC,QAAgB,KAAK,SAAS,CAAC,CAAC,CAAC;IAEjH,6CAA6C;IACtC,MAAM,KAAK,kBAAkB,KAAK,OAAO,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAEnG,yEAAyE;IAClE,MAAM,KAAK,mBAAmB,KAAK,OAAO,IAAI,CAAC,qBAAqB,IAAI,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;CAC3G;AAzED,0CAyEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"ProcessDetector.js","sourceRoot":"","sources":["../../src/ProcessDetector.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,MAAa,eAAe;IAE1B;;OAEG;IACI,MAAM,KAAK,gBAAgB,KAAK,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,Q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B,CAAC,CAAC,CAAC;IAEnG,yEAAyE;IAClE,MAAM,KAAK,mBAAmB,KAAK,OAAO,IAAI,CAAC,qBAAqB,IAAI,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;CAC3G;AAzED,0CAyEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ProcessDetector\n */\n\n/** Functions to determine the type of JavaScript process currently executing.\n * @public\n */\nexport class ProcessDetector {\n\n /** Is this a browser process?\n * @note this method will also return `true` for the frontend of Electron or Mobile apps. They *are* browser processes.\n */\n public static get isBrowserProcess() { return typeof window === \"object\" && typeof window.navigator === \"object\"; }\n\n /** Is this a Node process?\n * @note this means \"is this a backend process\"? It will return `true` for all backend process, including Electron and mobile apps.\n */\n public static get isNodeProcess() { return typeof process === \"object\" && undefined !== process.platform; }\n\n /** Is this process the frontend of an Electron app? */\n public static get isElectronAppFrontend() { return typeof navigator === \"object\" && navigator.userAgent.toLowerCase().indexOf(\"electron\") >= 0; }\n\n /** Is this process the backend of an Electron app? */\n public static get isElectronAppBackend() { return typeof process === \"object\" && process.versions.hasOwnProperty(\"electron\"); }\n\n /** Is this process running in a browser on an iPad?\n * @note This method will return `true` for any frontend running on an iPad, whether it is a user-launched web browser (e.g. Safari) or the frontend of a mobile app.\n */\n public static get isIPadBrowser() {\n return this.isBrowserProcess && window.navigator.platform === \"iPad\" || (window.navigator.platform === \"MacIntel\" && window.navigator.maxTouchPoints > 0 && !(\"MSStream\" in window)); /* eslint-disable-line deprecation/deprecation */\n }\n\n /** Is this process running in a browser on an iPhone?\n * @note This method will return `true` for any frontend running on an iPhone, whether it is a user-launched web browser (e.g. Safari) or the frontend of a mobile app.\n */\n public static get isIPhoneBrowser() { return this.isBrowserProcess && (/(iphone|ipod)/i.test(window.navigator.userAgent)); }\n\n /** Is this process running in a browser on an iOS device?\n * @note This method will return `true` for any frontend running on an iOS device, whether it is a user-launched web browser (e.g. Safari) or the frontend of a mobile app.\n */\n public static get isIOSBrowser() { return this.isIPadBrowser || this.isIPhoneBrowser; }\n\n /** Is this process running in a browser on an Android device?\n * @note This method will return `true` for any frontend running on an Android device, whether it is a user-launched web browser (e.g. Chrome) or the frontend of a mobile app.\n */\n public static get isAndroidBrowser() { return this.isBrowserProcess && /android/i.test(window.navigator.userAgent); }\n\n /** Is this process running in a browser on a mobile device?\n * @note This method will return `true` for any frontend running on a mobile device, whether it is a user-launched web browser or the frontend of a mobile app.\n */\n public static get isMobileBrowser() { return this.isIOSBrowser || this.isAndroidBrowser; }\n\n /** Is this process running in a Chromium based browser (Chrome / new Edge / Electron front end)? */\n public static get isChromium() {\n return (this.isBrowserProcess && window.navigator.userAgent.indexOf(\"Chrome\") > -1 && window.navigator.userAgent.indexOf(\"OP\") === -1) || this.isElectronAppFrontend;\n }\n\n /** Is this process the frontend of an iTwin mobile application?\n * @note this indicates that this is a browser process started by an iTwin mobile application.\n * It will return `false` when running user-launched web browsers on a mobile device.\n */\n public static get isMobileAppFrontend() { return this.isAndroidAppFrontend || this.isIOSAppFrontend; }\n\n /** Is this process the frontend of an iOS mobile application? */\n public static get isIOSAppFrontend() { return this.isBrowserProcess && window.location.hash.indexOf(\"platform=ios\") !== -1; }\n\n /** Is this process the frontend of an Android mobile application? */\n public static get isAndroidAppFrontend() { return this.isBrowserProcess && window.location.hash.indexOf(\"platform=android\") !== -1; }\n\n /** Is this process the backend of an iOS mobile application? */\n public static get isIOSAppBackend() { return this.isNodeProcess && (process.platform as any) === \"ios\"; }\n\n /** Is this process the backend of an Android mobile application? */\n public static get isAndroidAppBackend() { return this.isNodeProcess && (process.platform as any) === \"android\"; }\n\n /** Is this process a mobile app backend? */\n public static get isMobileAppBackend() { return this.isIOSAppBackend || this.isAndroidAppBackend; }\n\n /** Is this process the frontend of a native (Electron or Mobile) app? */\n public static get isNativeAppFrontend() { return this.isElectronAppFrontend || this.isMobileAppFrontend; }\n}\n"]}
|
package/lib/cjs/SortedArray.d.ts
CHANGED
|
@@ -1,233 +1,237 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Collections
|
|
3
|
-
*/
|
|
4
|
-
import { OrderedComparator } from "./Compare";
|
|
5
|
-
/**
|
|
6
|
-
* A function that, given a value of type T, returns a copy of that value. Such functions are used by various collection classes.
|
|
7
|
-
* It is up to the function to decide how deeply or shallowly the value is cloned. For example, [[shallowClone]] simply returns the input.
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export
|
|
11
|
-
/**
|
|
12
|
-
* A [[CloneFunction]] that, given a value of type T, returns the same value.
|
|
13
|
-
* Useful as a default argument for functions that can alternatively accept custom logic for cloning values of object type.
|
|
14
|
-
* @param value The value to clone.
|
|
15
|
-
* @returns the input value.
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
export declare function shallowClone<T>(value: T): T;
|
|
19
|
-
/**
|
|
20
|
-
* Given a sorted array, computes the position at which the specified value should be inserted into the array so that the array remains sorted.
|
|
21
|
-
* @param value The value whose position is to be computed.
|
|
22
|
-
* @param list An array of U already sorted according to the comparison criterion.
|
|
23
|
-
* @param compare The function used to compare the value with elements in `list`.
|
|
24
|
-
* @returns an object with 'index' corresponding to the computed position and 'equal' set to true if an equivalent element already exists at that index.
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
export declare function lowerBound<T, U = T>(value: T, list: U[], compare: OrderedComparator<T, U>): {
|
|
28
|
-
index: number;
|
|
29
|
-
equal: boolean;
|
|
30
|
-
};
|
|
31
|
-
/** Describes how duplicate values are handled when inserting into a [[SortedArray]].
|
|
32
|
-
* A "duplicate" value is one that compares equal to a value already present in the array, per the array's comparison function.
|
|
33
|
-
* @public
|
|
34
|
-
*/
|
|
35
|
-
export declare enum DuplicatePolicy {
|
|
36
|
-
/** The array allows duplicate values to be inserted. All duplicate values will be adjacent in the array, but the ordering between duplicate values is unspecified.
|
|
37
|
-
* @note In the presence of duplicate values, functions like [[SortedArray.indexOf]] and [[SortedArray.findEqual]] will return one of the values - exactly which one is unspecified.
|
|
38
|
-
*/
|
|
39
|
-
Allow = 0,
|
|
40
|
-
/** Duplicate values are forbidden - when attempting to insert a value equivalent to one already present, the already-present value is retained. */
|
|
41
|
-
Retain = 1,
|
|
42
|
-
/** Duplicate values are forbidden - when attempting to insert a value equivalent to one already present, the already-present value is replaced by the new value.
|
|
43
|
-
* This can be useful when the value type carries additional data that is not evaluated by the comparison function.
|
|
44
|
-
*/
|
|
45
|
-
Replace = 2
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* A read-only view of an array of some type T sorted according to some user-supplied criterion.
|
|
49
|
-
* Duplicate elements may be present, though sub-types may enforce uniqueness of elements.
|
|
50
|
-
* In the absence of duplicates, a ReadonlySortedArray<T> can behave like a Set<T> where T is an object and equality is determined
|
|
51
|
-
* by some criterion other than object identity.
|
|
52
|
-
*
|
|
53
|
-
* Because the array is always sorted, querying for the presence of an element is performed using binary
|
|
54
|
-
* search, which is more efficient than a linear search for reasonably large arrays.
|
|
55
|
-
*
|
|
56
|
-
* The comparison function must meet the following criteria, given 'lhs' and 'rhs' of type T:
|
|
57
|
-
* - If lhs is equal to rhs, returns 0
|
|
58
|
-
* - If lhs is less than rhs, returns a negative value
|
|
59
|
-
* - If lhs is greater than rhs, returns a positive value
|
|
60
|
-
* - If compare(lhs, rhs) returns 0, then compare(rhs, lhs) must also return 0
|
|
61
|
-
* - If compare(lhs, rhs) returns a negative value, then compare(rhs, lhs) must return a positive value, and vice versa.
|
|
62
|
-
*
|
|
63
|
-
* Note that the array is read-only only from the perspective of its public interface. Mutation methods are defined for internal use by sub-types.
|
|
64
|
-
*
|
|
65
|
-
* @see [[SortedArray]] for a general-purpose mutable sorted array.
|
|
66
|
-
* @public
|
|
67
|
-
*/
|
|
68
|
-
export declare class ReadonlySortedArray<T> implements Iterable<T> {
|
|
69
|
-
protected _array: T[];
|
|
70
|
-
protected readonly _compare: OrderedComparator<T>;
|
|
71
|
-
protected readonly _clone: CloneFunction<T>;
|
|
72
|
-
protected readonly _duplicatePolicy: DuplicatePolicy;
|
|
73
|
-
/**
|
|
74
|
-
* Construct a new ReadonlySortedArray<T>.
|
|
75
|
-
* @param compare The function used to compare elements within the array.
|
|
76
|
-
* @param duplicatePolicy Policy for handling attempts to insert a value when an equivalent value already exists. If the input is a boolean, then `true` indicates [[DuplicatePolicy.Allow]], and `false` indicates [[DuplicatePolicy.Retain]].
|
|
77
|
-
* @param clone The function invoked to clone a new element for insertion into the array. The default implementation simply returns its input.
|
|
78
|
-
*/
|
|
79
|
-
protected constructor(compare: OrderedComparator<T>, duplicatePolicy?: DuplicatePolicy | boolean, clone?: CloneFunction<T>);
|
|
80
|
-
/** The number of elements in the array */
|
|
81
|
-
get length(): number;
|
|
82
|
-
/** Returns true if the array contains no elements. */
|
|
83
|
-
get isEmpty(): boolean;
|
|
84
|
-
/** Returns an iterator over the contents of the array in sorted order, suitable for use in `for-of` loops. */
|
|
85
|
-
[Symbol.iterator](): Iterator<T>;
|
|
86
|
-
/**
|
|
87
|
-
* Looks up the index of an element comparing equal to the specified value using binary search.
|
|
88
|
-
* @param value The value to search for
|
|
89
|
-
* @returns the index of the first equivalent element found in the array, or -1 if no such element exists.
|
|
90
|
-
*/
|
|
91
|
-
indexOf(value: T): number;
|
|
92
|
-
/**
|
|
93
|
-
* Returns true if this array contains at least one value comparing equal to the specified value.
|
|
94
|
-
* @param value The value to search for
|
|
95
|
-
* @returns true if an equivalent element exists in the array.
|
|
96
|
-
*/
|
|
97
|
-
contains(value: T): boolean;
|
|
98
|
-
/**
|
|
99
|
-
* Looks up an element comparing equal to the specified value using binary search.
|
|
100
|
-
* @param value The value to search for
|
|
101
|
-
* @returns the first equivalent element found in the array, or undefined if no such element exists.
|
|
102
|
-
*/
|
|
103
|
-
findEqual(value: T): T | undefined;
|
|
104
|
-
/** Find an element that compares as equivalent based on some criterion. If multiple elements are equivalent, the specific one returned is unspecified.
|
|
105
|
-
* As an example, consider a `SortedArray<ModelState>` which uses `ModelState.id` as its ordering criterion. To find a model by its Id,
|
|
106
|
-
* use `sortedArray.findEquivalent((element) => compareStrings(element.id, modelId))` where `modelId` is an [[Id64String]].
|
|
107
|
-
* @param criterion A function accepting an element and returning 0 if it compares as equivalent, a negative number if it compares as "less-than", or a positive value if it compares as "greater-than".
|
|
108
|
-
* @returns The first element found that meets the criterion, or `undefined` if no elements meet the criterion.
|
|
109
|
-
* @see [[indexOfEquivalent]].
|
|
110
|
-
* @public
|
|
111
|
-
*/
|
|
112
|
-
findEquivalent(criterion: (element: T) => number): T | undefined;
|
|
113
|
-
/** Find the index of an element that compares as equivalent based on some criterion. If multiple elements are equivalent, the specific one returned is unspecified.
|
|
114
|
-
* As an example, consider a `SortedArray<ModelState>` which uses `ModelState.id` as its ordering criterion. To find the index of a model by its Id,
|
|
115
|
-
* use `sortedArray.indexOfEquivalent((element) => compareStrings(element.id, modelId))` where `modelId` is an [[Id64String]].
|
|
116
|
-
* @param criterion A function accepting an element and returning 0 if it compares as equivalent, a negative number if the element compares as "less-than", or a positive value if the element compares as "greater-than".
|
|
117
|
-
* @returns The index of the first element found that meets the criterion, or -1 if no elements meet the criterion.
|
|
118
|
-
* @public
|
|
119
|
-
*/
|
|
120
|
-
indexOfEquivalent(criterion: (element: T) => number): number;
|
|
121
|
-
/**
|
|
122
|
-
* Looks up an element by its index in the array.
|
|
123
|
-
* @param index The array index
|
|
124
|
-
* @returns the element corresponding to that position in the array, or undefined if the supplied index exceeds the length of the array.
|
|
125
|
-
*/
|
|
126
|
-
get(index: number): T | undefined;
|
|
127
|
-
/** Apply a function to each element in the array, in sorted order.
|
|
128
|
-
* @param func The function to be applied.
|
|
129
|
-
*/
|
|
130
|
-
forEach(func: (value: T) => void): void;
|
|
131
|
-
/**
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
*
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
* -
|
|
156
|
-
*
|
|
157
|
-
* - The
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* @
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
*
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
* The
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
* - If lhs is
|
|
189
|
-
* - If
|
|
190
|
-
* - If
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
*
|
|
201
|
-
* @param
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* If
|
|
217
|
-
* -
|
|
218
|
-
*
|
|
219
|
-
* - The
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* @
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
*
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Collections
|
|
3
|
+
*/
|
|
4
|
+
import { OrderedComparator } from "./Compare";
|
|
5
|
+
/**
|
|
6
|
+
* A function that, given a value of type T, returns a copy of that value. Such functions are used by various collection classes.
|
|
7
|
+
* It is up to the function to decide how deeply or shallowly the value is cloned. For example, [[shallowClone]] simply returns the input.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export type CloneFunction<T> = (value: T) => T;
|
|
11
|
+
/**
|
|
12
|
+
* A [[CloneFunction]] that, given a value of type T, returns the same value.
|
|
13
|
+
* Useful as a default argument for functions that can alternatively accept custom logic for cloning values of object type.
|
|
14
|
+
* @param value The value to clone.
|
|
15
|
+
* @returns the input value.
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export declare function shallowClone<T>(value: T): T;
|
|
19
|
+
/**
|
|
20
|
+
* Given a sorted array, computes the position at which the specified value should be inserted into the array so that the array remains sorted.
|
|
21
|
+
* @param value The value whose position is to be computed.
|
|
22
|
+
* @param list An array of U already sorted according to the comparison criterion.
|
|
23
|
+
* @param compare The function used to compare the value with elements in `list`.
|
|
24
|
+
* @returns an object with 'index' corresponding to the computed position and 'equal' set to true if an equivalent element already exists at that index.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export declare function lowerBound<T, U = T>(value: T, list: U[], compare: OrderedComparator<T, U>): {
|
|
28
|
+
index: number;
|
|
29
|
+
equal: boolean;
|
|
30
|
+
};
|
|
31
|
+
/** Describes how duplicate values are handled when inserting into a [[SortedArray]].
|
|
32
|
+
* A "duplicate" value is one that compares equal to a value already present in the array, per the array's comparison function.
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export declare enum DuplicatePolicy {
|
|
36
|
+
/** The array allows duplicate values to be inserted. All duplicate values will be adjacent in the array, but the ordering between duplicate values is unspecified.
|
|
37
|
+
* @note In the presence of duplicate values, functions like [[SortedArray.indexOf]] and [[SortedArray.findEqual]] will return one of the values - exactly which one is unspecified.
|
|
38
|
+
*/
|
|
39
|
+
Allow = 0,
|
|
40
|
+
/** Duplicate values are forbidden - when attempting to insert a value equivalent to one already present, the already-present value is retained. */
|
|
41
|
+
Retain = 1,
|
|
42
|
+
/** Duplicate values are forbidden - when attempting to insert a value equivalent to one already present, the already-present value is replaced by the new value.
|
|
43
|
+
* This can be useful when the value type carries additional data that is not evaluated by the comparison function.
|
|
44
|
+
*/
|
|
45
|
+
Replace = 2
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A read-only view of an array of some type T sorted according to some user-supplied criterion.
|
|
49
|
+
* Duplicate elements may be present, though sub-types may enforce uniqueness of elements.
|
|
50
|
+
* In the absence of duplicates, a ReadonlySortedArray<T> can behave like a Set<T> where T is an object and equality is determined
|
|
51
|
+
* by some criterion other than object identity.
|
|
52
|
+
*
|
|
53
|
+
* Because the array is always sorted, querying for the presence of an element is performed using binary
|
|
54
|
+
* search, which is more efficient than a linear search for reasonably large arrays.
|
|
55
|
+
*
|
|
56
|
+
* The comparison function must meet the following criteria, given 'lhs' and 'rhs' of type T:
|
|
57
|
+
* - If lhs is equal to rhs, returns 0
|
|
58
|
+
* - If lhs is less than rhs, returns a negative value
|
|
59
|
+
* - If lhs is greater than rhs, returns a positive value
|
|
60
|
+
* - If compare(lhs, rhs) returns 0, then compare(rhs, lhs) must also return 0
|
|
61
|
+
* - If compare(lhs, rhs) returns a negative value, then compare(rhs, lhs) must return a positive value, and vice versa.
|
|
62
|
+
*
|
|
63
|
+
* Note that the array is read-only only from the perspective of its public interface. Mutation methods are defined for internal use by sub-types.
|
|
64
|
+
*
|
|
65
|
+
* @see [[SortedArray]] for a general-purpose mutable sorted array.
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
export declare class ReadonlySortedArray<T> implements Iterable<T> {
|
|
69
|
+
protected _array: T[];
|
|
70
|
+
protected readonly _compare: OrderedComparator<T>;
|
|
71
|
+
protected readonly _clone: CloneFunction<T>;
|
|
72
|
+
protected readonly _duplicatePolicy: DuplicatePolicy;
|
|
73
|
+
/**
|
|
74
|
+
* Construct a new ReadonlySortedArray<T>.
|
|
75
|
+
* @param compare The function used to compare elements within the array.
|
|
76
|
+
* @param duplicatePolicy Policy for handling attempts to insert a value when an equivalent value already exists. If the input is a boolean, then `true` indicates [[DuplicatePolicy.Allow]], and `false` indicates [[DuplicatePolicy.Retain]].
|
|
77
|
+
* @param clone The function invoked to clone a new element for insertion into the array. The default implementation simply returns its input.
|
|
78
|
+
*/
|
|
79
|
+
protected constructor(compare: OrderedComparator<T>, duplicatePolicy?: DuplicatePolicy | boolean, clone?: CloneFunction<T>);
|
|
80
|
+
/** The number of elements in the array */
|
|
81
|
+
get length(): number;
|
|
82
|
+
/** Returns true if the array contains no elements. */
|
|
83
|
+
get isEmpty(): boolean;
|
|
84
|
+
/** Returns an iterator over the contents of the array in sorted order, suitable for use in `for-of` loops. */
|
|
85
|
+
[Symbol.iterator](): Iterator<T>;
|
|
86
|
+
/**
|
|
87
|
+
* Looks up the index of an element comparing equal to the specified value using binary search.
|
|
88
|
+
* @param value The value to search for
|
|
89
|
+
* @returns the index of the first equivalent element found in the array, or -1 if no such element exists.
|
|
90
|
+
*/
|
|
91
|
+
indexOf(value: T): number;
|
|
92
|
+
/**
|
|
93
|
+
* Returns true if this array contains at least one value comparing equal to the specified value.
|
|
94
|
+
* @param value The value to search for
|
|
95
|
+
* @returns true if an equivalent element exists in the array.
|
|
96
|
+
*/
|
|
97
|
+
contains(value: T): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Looks up an element comparing equal to the specified value using binary search.
|
|
100
|
+
* @param value The value to search for
|
|
101
|
+
* @returns the first equivalent element found in the array, or undefined if no such element exists.
|
|
102
|
+
*/
|
|
103
|
+
findEqual(value: T): T | undefined;
|
|
104
|
+
/** Find an element that compares as equivalent based on some criterion. If multiple elements are equivalent, the specific one returned is unspecified.
|
|
105
|
+
* As an example, consider a `SortedArray<ModelState>` which uses `ModelState.id` as its ordering criterion. To find a model by its Id,
|
|
106
|
+
* use `sortedArray.findEquivalent((element) => compareStrings(element.id, modelId))` where `modelId` is an [[Id64String]].
|
|
107
|
+
* @param criterion A function accepting an element and returning 0 if it compares as equivalent, a negative number if it compares as "less-than", or a positive value if it compares as "greater-than".
|
|
108
|
+
* @returns The first element found that meets the criterion, or `undefined` if no elements meet the criterion.
|
|
109
|
+
* @see [[indexOfEquivalent]].
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
findEquivalent(criterion: (element: T) => number): T | undefined;
|
|
113
|
+
/** Find the index of an element that compares as equivalent based on some criterion. If multiple elements are equivalent, the specific one returned is unspecified.
|
|
114
|
+
* As an example, consider a `SortedArray<ModelState>` which uses `ModelState.id` as its ordering criterion. To find the index of a model by its Id,
|
|
115
|
+
* use `sortedArray.indexOfEquivalent((element) => compareStrings(element.id, modelId))` where `modelId` is an [[Id64String]].
|
|
116
|
+
* @param criterion A function accepting an element and returning 0 if it compares as equivalent, a negative number if the element compares as "less-than", or a positive value if the element compares as "greater-than".
|
|
117
|
+
* @returns The index of the first element found that meets the criterion, or -1 if no elements meet the criterion.
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
indexOfEquivalent(criterion: (element: T) => number): number;
|
|
121
|
+
/**
|
|
122
|
+
* Looks up an element by its index in the array.
|
|
123
|
+
* @param index The array index
|
|
124
|
+
* @returns the element corresponding to that position in the array, or undefined if the supplied index exceeds the length of the array.
|
|
125
|
+
*/
|
|
126
|
+
get(index: number): T | undefined;
|
|
127
|
+
/** Apply a function to each element in the array, in sorted order.
|
|
128
|
+
* @param func The function to be applied.
|
|
129
|
+
*/
|
|
130
|
+
forEach(func: (value: T) => void): void;
|
|
131
|
+
/** The equivalent of [Array.slice](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice). */
|
|
132
|
+
slice(start?: number, end?: number): ReadonlySortedArray<T>;
|
|
133
|
+
/**
|
|
134
|
+
* Computes the position at which the specified value should be inserted to maintain sorted order.
|
|
135
|
+
* @param value The value whose position is to be computed.
|
|
136
|
+
* @returns an object with 'index' corresponding to the computed position and 'equal' set to true if an equivalent element already exists at that index.
|
|
137
|
+
*/
|
|
138
|
+
protected lowerBound(value: T): {
|
|
139
|
+
index: number;
|
|
140
|
+
equal: boolean;
|
|
141
|
+
};
|
|
142
|
+
/** Clears the contents of the sorted array. */
|
|
143
|
+
protected _clear(): void;
|
|
144
|
+
/** Extracts the sorted array as a T[] and empties the contents of this ReadonlySortedArray.
|
|
145
|
+
* @returns the contents of this ReadonlySortedArray as a T[].
|
|
146
|
+
*/
|
|
147
|
+
protected _extractArray(): T[];
|
|
148
|
+
/**
|
|
149
|
+
* Attempts to insert a new value into the array at a position determined by the ordering.
|
|
150
|
+
* The behavior differs based on the array's [[DuplicatePolicy]]:
|
|
151
|
+
* If duplicates are **not** permitted, then:
|
|
152
|
+
* - If an equivalent element already exists in the array:
|
|
153
|
+
* - [[DuplicatePolicy.Retain]]: nothing will be inserted and the index of the existing element will be returned.
|
|
154
|
+
* - [[DuplicatePolicy.Replace]]: the input value will overwrite the existing element at the same index and that index will be returned.
|
|
155
|
+
* - Otherwise, the element is inserted and its index is returned.
|
|
156
|
+
* If duplicates **are** permitted, then:
|
|
157
|
+
* - The element will be inserted in a correct position based on the sorting criterion;
|
|
158
|
+
* - The position of the element relative to other elements comparing as equal to it is unspecified; and
|
|
159
|
+
* - The actual index of the newly-inserted element is returned.
|
|
160
|
+
* If the element is to be inserted, then the supplied value will be passed to the clone function supplied to the constructor and the result will be inserted into the array.
|
|
161
|
+
* @param value The value to insert
|
|
162
|
+
* @param onInsert The optional callback method to call if insertion occurs with the inserted value
|
|
163
|
+
* @returns the index in the array of the newly-inserted value, or, if duplicates are not permitted and an equivalent value already exists, the index of the equivalent value.
|
|
164
|
+
*/
|
|
165
|
+
protected _insert(value: T, onInsert?: (value: T) => any): number;
|
|
166
|
+
/**
|
|
167
|
+
* Removes the first occurrence of a value comparing equal to the specified value from the array.
|
|
168
|
+
* @param value The value of the element to delete
|
|
169
|
+
* @returns the index of the deleted value, or -1 if no such element exists.
|
|
170
|
+
*/
|
|
171
|
+
protected _remove(value: T): number;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Maintains an array of some type T in sorted order. The ordering is specified by a function supplied
|
|
175
|
+
* by the user.
|
|
176
|
+
* By default, only unique elements are permitted; attempting to insert a new element that compares
|
|
177
|
+
* as equal to an element already in the array will not modify the contents of the array.
|
|
178
|
+
*
|
|
179
|
+
* This allows a SortedArray<T> to behave like a Set<T> where T is an object and equality is determined
|
|
180
|
+
* by some criterion other than object identity.
|
|
181
|
+
*
|
|
182
|
+
* Because the array is always sorted, querying for the presence of an element is performed using binary
|
|
183
|
+
* search, which is more efficient than a linear search for reasonably large arrays.
|
|
184
|
+
*
|
|
185
|
+
* The user can also specify how the SortedArray takes ownership of inserted values, e.g., by cloning them.
|
|
186
|
+
*
|
|
187
|
+
* The comparison function must meet the following criteria, given 'lhs' and 'rhs' of type T:
|
|
188
|
+
* - If lhs is equal to rhs, returns 0
|
|
189
|
+
* - If lhs is less than rhs, returns a negative value
|
|
190
|
+
* - If lhs is greater than rhs, returns a positive value
|
|
191
|
+
* - If compare(lhs, rhs) returns 0, then compare(rhs, lhs) must also return 0
|
|
192
|
+
* - If compare(lhs, rhs) returns a negative value, then compare(rhs, lhs) must return a positive value, and vice versa.
|
|
193
|
+
*
|
|
194
|
+
* Modifying an element in a way that affects the comparison function will produce unpredictable results, the
|
|
195
|
+
* most likely of which is that the array will cease to be sorted.
|
|
196
|
+
* @public
|
|
197
|
+
*/
|
|
198
|
+
export declare class SortedArray<T> extends ReadonlySortedArray<T> {
|
|
199
|
+
/**
|
|
200
|
+
* Construct a new SortedArray<T>.
|
|
201
|
+
* @param compare The function used to compare elements within the array.
|
|
202
|
+
* @param duplicatePolicy Policy for handling attempts to insert a value when an equivalent value already exists. If the input is a boolean, then `true` indicates [[DuplicatePolicy.Allow]], and `false` indicates [[DuplicatePolicy.Retain]].
|
|
203
|
+
* @param clone The function invoked to clone a new element for insertion into the array. The default implementation simply returns its input.
|
|
204
|
+
*/
|
|
205
|
+
constructor(compare: OrderedComparator<T>, duplicatePolicy?: DuplicatePolicy | boolean, clone?: CloneFunction<T>);
|
|
206
|
+
/** Clears the contents of the sorted array. */
|
|
207
|
+
clear(): void;
|
|
208
|
+
/** Extracts the sorted array as a T[] and empties the contents of this SortedArray.
|
|
209
|
+
* @returns the contents of this SortedArray as a T[].
|
|
210
|
+
*/
|
|
211
|
+
extractArray(): T[];
|
|
212
|
+
/**
|
|
213
|
+
* Attempts to insert a new value into the array at a position determined by the ordering.
|
|
214
|
+
* The behavior differs based on whether or not duplicate elements are permitted.
|
|
215
|
+
* If duplicates are **not** permitted, then:
|
|
216
|
+
* - If an equivalent element already exists in the array, nothing will be inserted and the index of the existing element will be returned.
|
|
217
|
+
* - Otherwise, the element is inserted and its index is returned.
|
|
218
|
+
* If duplicates **are** permitted, then:
|
|
219
|
+
* - The element will be inserted in a correct position based on the sorting criterion;
|
|
220
|
+
* - The position of the element relative to other elements comparing as equal to it is unspecified; and
|
|
221
|
+
* - The actual index of the newly-inserted element is returned.
|
|
222
|
+
* If the element is to be inserted, then the supplied value will be passed to the clone function supplied to the constructor and the result will be inserted into the array.
|
|
223
|
+
* @param value The value to insert
|
|
224
|
+
* @param onInsert The optional callback method to call if insertion occurs with the inserted value
|
|
225
|
+
* @returns the index in the array of the newly-inserted value, or, if duplicates are not permitted and an equivalent value already exists, the index of the equivalent value.
|
|
226
|
+
*/
|
|
227
|
+
insert(value: T, onInsert?: (value: T) => any): number;
|
|
228
|
+
/**
|
|
229
|
+
* Removes the first occurrence of a value comparing equal to the specified value from the array.
|
|
230
|
+
* @param value The value of the element to delete
|
|
231
|
+
* @returns the index of the deleted value, or -1 if no such element exists.
|
|
232
|
+
*/
|
|
233
|
+
remove(value: T): number;
|
|
234
|
+
/** The equivalent of [Array.slice](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice). */
|
|
235
|
+
slice(start?: number, end?: number): SortedArray<T>;
|
|
236
|
+
}
|
|
233
237
|
//# sourceMappingURL=SortedArray.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortedArray.d.ts","sourceRoot":"","sources":["../../src/SortedArray.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"SortedArray.d.ts","sourceRoot":"","sources":["../../src/SortedArray.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,KAEvC;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAE7H;AAmBD;;;GAGG;AACH,oBAAY,eAAe;IACzB;;OAEG;IACH,KAAK,IAAA;IACL,mJAAmJ;IACnJ,MAAM,IAAA;IACN;;OAEG;IACH,OAAO,IAAA;CACR;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,mBAAmB,CAAC,CAAC,CAAE,YAAW,QAAQ,CAAC,CA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