Utils
Miscellaneous utility classes.
Classes
| Name | Description | |
|---|---|---|
| AbandonedError | ||
| BeDuration | A duration of time. | |
| BeTimePoint | A specific point in time relative to the current time. | |
| ByteStream | Allows the contents of an ArrayBuffer | |
| DisposableList | A disposable container of disposable objects. | |
| OneAtATimeAction | Orchestrator of a one-at-a-time activity. | |
| StopWatch | A StopWatch for timing operations. | |
| YieldManager | Provides a mechanism by which a loop can be made to periodically yield control back to the browser/node environment. | 
Global Functions
| Name | Description | |
|---|---|---|
| areEqualPossiblyUndefined | Compare two possibly-undefined values for equality. | |
| asInstanceOf | Cast objto an instance of classT, or return undefined ifobjis not an instance of classT. | |
| assert | Asserts that a condition is trueand - when enabled - throws an error if it is not. | |
| base64StringToUint8Array | Given a base-64-encoded string, decode it into an array of bytes. | |
| compareBooleans | ||
| compareBooleansOrUndefined | ||
| compareNumbers | ||
| compareNumbersOrUndefined | ||
| comparePossiblyUndefined | ||
| compareStrings | ||
| compareStringsOrUndefined | ||
| compareWithTolerance | An OrderedComparator for numbers that treats two numbers as equal if the absolute value of their difference is less than a specified tolerance. | |
| dispose | Convenience function for disposing of a disposable object that may be undefined. | |
| disposeArray | Disposes of and empties a list of disposable objects. | |
| isIDisposable | A type guard that checks whether the given argument implements IDisposableinterface | |
| isInstanceOf | Returns true if objis an object of classT. | |
| isProperSubclassOf | Check if class subclassis a different class fromsuperclassbut extends fromsuperclass | |
| isSubclassOf | Check if class subclassissuperclassor extends fromsuperclass | |
| omit | A runtime property omitter, makes a shallow copy of the given object without the specified properties | |
| using | A 'using' function which is a substitution for .NET's using statement. | |
| utf8ToString | Given an array of bytes containing a utf-8 string, convert to a string. | 
Interfaces
| Name | Description | |
|---|---|---|
| IDisposable | Interface adopted by a type which has deterministic cleanup logic. | |
| YieldManagerOptions | Options supplied to a YieldManager. | 
Type Aliases
| Name | Description | |
|---|---|---|
| AccessToken | A string representing a token used to access resources. | |
| AsyncFunction | Any function returning a Promise. | |
| AsyncMethodsOf | Extracts the names of all function properties of Tthat return a Promise. | |
| Constructor | Generically represents a class T, for use in type annotations. | |
| DisposeFunc | A definition of function which may be called to dispose an object | |
| MarkRequired | Make a new type from an existing type T, with set of optional propertiesKrequired. | |
| MaybePromise | A type that is either TorPromise<T>. | |
| Mutable | The inverse of TypeScript's Readonly Twith anyreadonlymodifiers removed. | |
| NonFunctionPropertiesOf | Produces a type consisting of all of the public properties of Texcept for those of typefunction. | |
| NonFunctionPropertyNamesOf | Extracts the names of all public properties of Tthat are not of typefunction. | |
| Optional | Make a new type from an existing type T, with set of required propertiesKoptional. | |
| OrderedComparator | A function that returns a numerical value indicating how two objects are ordered in relation to one another. | |
| PickAsyncMethods | The members of Tthat are async functions (functions that return a promise), and no other properties | |
| PickMethods | The members of Tthat are functions and no other properties | |
| PickSyncMethods | The members of Tthat are functions that do not return a Promise | |
| PromiseReturnType | Extracts the type to which the Promise returned by an async function resolves. | |
| RequireAtLeastOne | Defines a type wherein at least one of the properties of T is required to exist. | 
Last Updated: 10 June, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.