Utils

Miscellaneous utility classes.

Classes

Name Description  
AbandonedError Beta
BeDuration A duration of time.  
BeTimePoint A specific point in time relative to the current time.  
ByteStream Allows the contents of an ArrayBuffer  
ClientRequestContext Provides generic context for a server application to get details of a particular  
DisposableList A disposable container of disposable objects.  
OneAtATimeAction Orchestrator of a one-at-a-time activity. Beta
StopWatch A StopWatch for timing operations.  

Global Functions

Name Description  
areEqualPossiblyUndefined Compare two possibly-undefined values for equality.  
asInstanceOf Cast obj to an instance of class T, or return undefined if obj is not an instance of class T.  
assert Asserts that a condition is true, and in development builds 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 IDisposable interface  
isInstanceOf Returns true if obj is an object of class T.  
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  
ClientRequestContextProps The properties of ClientRequestContext.  
IDisposable Interface adopted by a type which has deterministic cleanup logic.  
SerializedClientRequestContext Serialized format for sending the client request context across the RPC layer  
SessionProps Properties that identify a session.  

Namespaces

Name Description  
JsonUtils Utility functions for converting from JSON objects, with default values.  

Type Aliases

Name Description  
Constructor Generically represents a class T, for use in type annotations.  
DisposeFunc A definition of function which may be called to dispose an object  
Mutable The inverse of TypeScript's Readonly type, producing a type that has all the properties of T with any readonly modifiers removed.  
OrderedComparator A function that returns a numerical value indicating how two objects are ordered in relation to one another.  

Last Updated: 06 October, 2021