UNPKG

typescript-base

Version:

A TypeScript implementation of basic exception, assertion and parameter check functions.

1,159 lines (1,157 loc) 116 kB
export declare namespace TS { /** * @class TS.Exception * * @description The base class of all exceptions defined in this framework. The Exception class has a public read only * property called 'type' which returns the fully qualified type name of the exception class. This way you are able * to create a finer granular error handling based on the exception type. Your are not longer forced to parse the * error message string to infer the nature of the exception. Each subclass of the Exception class has to override * the 'type' property to reflect the own type. The exception class has also a read only 'innerException' property * which allows to create an exception stack which links back to the root exception. * * @implements {Error} */ class Exception implements Error { /** * @private */ private internalMessage; /** * @private */ private internalInnerException; /** * @description Returns the inner exception if available or null. * * @public * * @get {TS.Exception | null} innerException */ readonly innerException: TS.Exception | null; /** * @description The error message. * * @implements {Error} * * @get {string} message */ readonly message: string; /** * @description The error name. It's the same as the type. * * @implements {Error} * * @get {string} name */ readonly name: string; /** * @description Returns the fully qualified type name of the exception. * * @public * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: TS.Exception); /** * @description Returns a combination of the 'type' and 'message' of the exception as string. * * @override {Object} * * @returns {string} */ toString(): string; /** * @description Returns a string which is the concatenation of the 'toString' call results of the current exception and the inner exceptions. * Call this function without any arguments on the top exception of the exception chain. * * @param {TS.Exception} exception * @param {boolean} isInner, Defaults to false * @param {string} offset, A string which is used to indent inner exception messages. Default to 2 spaces. * * @returns {string} */ stackTrace(exception?: TS.Exception, isInner?: boolean, offset?: string): string; } /** * @class TS.AmbiguousResultException * * @description This exception signals a an error where an operation which is specified to deliver a single result * fails because there are multiple possible results available. * * @extends {TS.Exception} */ class AmbiguousResultException extends TS.Exception { /** * @private */ private internalArgumentName; /** * @private */ private internalArgumentValue; /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @description The name of the argument which caused the exception. * * @get {string} argumentName */ readonly argumentName: string; /** * @description The value of the argument which caused the exception. * * @get {any} argumentValue */ readonly argumentValue: any; /** * @constructor * * @param {string} argumentName, The name of the argument which caused the exception. * @param {any} argumentValue, The value of the argument which caused the exception. * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(argumentName: string, argumentValue: any, message?: string, innerException?: Exception); } /** * @class TS.ArgumentException * * @description This exceptions signals a general error caused by an invalid argument. * * @extends {TS.Exception} */ class ArgumentException extends TS.Exception { /** * @private */ private internalArgumentName; /** * @private */ private internalArgumentValue; /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @description The name of the argument which caused the exception. * * @get {string} argumentName */ readonly argumentName: string; /** * @description The value of the argument which caused the exception. * * @get {any} argumentValue */ readonly argumentValue: any; /** * @constructor * * @param {string} argumentName, The name of the argument which caused the exception. * @param {any} argumentValue, The value of the argument which caused the exception. * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(argumentName: string, argumentValue: any, message?: string, innerException?: Exception); } /** * @class TS.ArgumentNullException * * @description This exception signals an error caused by an unexpected null value in an argument. * * @extends {TS.ArgumentException} */ class ArgumentNullException extends TS.ArgumentException { /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} argumentName, The name of the argument which caused the exception. * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(argumentName: string, message?: string, innerException?: Exception); } /** * @class TS.ArgumentNullOrUndefinedException * * @description This exceptions signals an error caused by an unexpected undefined or null value in an argument. The * argument value of that exception will always be null and doesn't reflect the exact argument value which caused * this exception. * * @extends {TS.ArgumentException} */ class ArgumentNullOrUndefinedException extends TS.ArgumentException { /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} argumentName, The name of the argument which caused the exception. * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(argumentName: string, message?: string, innerException?: Exception); } /** * @class TS.ArgumentNullUndefOrEmptyException * * @description This exception signals an error caused by an unexpected undefined or null value in an argument or * an unexpected emptiness for an argument like an empty string or array. The argument value of that exception * will always be null and doesn't reflect the exact argument value which caused this exception. * * @extends {TS.ArgumentException} */ class ArgumentNullUndefOrEmptyException extends TS.ArgumentException { /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} argumentName, The name of the argument which caused the exception. * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(argumentName: string, message?: string, innerException?: Exception); } /** * @class TS.ArgumentNullUndefOrWhiteSpaceException * * @description This exceptions signals an unexpected emptiness of a string. The argument value of that exception * will always be null and doesn't reflect the exact argument value which caused this exception. * * @extends {TS.ArgumentException} */ class ArgumentNullUndefOrWhiteSpaceException extends TS.ArgumentException { /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} argumentName, The name of the argument which caused the exception. * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(argumentName: string, message?: string, innerException?: Exception); } /** * @class TS.ArgumentOutOfRangeException * * @description This exceptions signals that an argument exceeded the range of allowed values. * * @extends {TS.ArgumentException} */ class ArgumentOutOfRangeException extends TS.ArgumentException { /** * @override {TS.ArgumentException} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} argumentName, The name of the argument which caused the exception. * @param {any} argumentValue, The value of the argument which caused the exception. * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(argumentName: string, argumentValue: any, message?: string, innerException?: Exception); } /** * @class TS.ArgumentUndefinedException * * @description This exceptions signals an error caused by an unexpected undefined value in an argument. * * @extends {TS.ArgumentException} */ class ArgumentUndefinedException extends TS.ArgumentException { /** * @override {TS.ArgumentException} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} argumentName, The name of the argument which caused the exception. * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(argumentName: string, message?: string, innerException?: Exception); } /** * @class TS.IndexOutOfRangeException * * @description This exceptions signals that an index value exceeded the range of indexable elements. * * @extends {TS.Exception} */ class IndexOutOfRangeException extends TS.Exception { /** * @get {string} type * @public * @override {TS.Exception} */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: Exception); } /** * @class TS.InvalidInvocationException * * @description This exceptions signals that a function was invoked in an unexpected or invalid way. * * @extends {TS.Exception} */ class InvalidInvocationException extends TS.Exception { /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: Exception); } /** * @class TS.InvalidOperationException * * @description This exceptions signals an attempt to start an operation which was not allowed to start in the current * situation. * * @extends {TS.Exception} */ class InvalidOperationException extends TS.Exception { /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: Exception); } /** * @class TS.InvalidCastException * * @description This exceptions signals that a casting operation failed. * @extends {TS.Exception} */ class InvalidCastException extends TS.Exception { /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: Exception); } /** * @class TS.InvalidFormatException * * @description This exceptions signals that an operation failed because of an invalid format of some data. * * @extends {TS.Exception} */ class InvalidFormatException extends TS.Exception { /** * @private */ private internalArgumentName; /** * @private */ private internalArgumentValue; /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @description The name of the argument which caused the exception. * * @get {string} argumentName */ readonly argumentName: string; /** * @description The value of the argument which caused the exception. * * @get {string} argumentValue */ readonly argumentValue: any; /** * @constructor * * @param {string} argumentName, The name of the argument which caused the exception. * @param {any} argumentValue, The value of the argument which caused the exception. * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(argumentName?: string, argumentValue?: any, message?: string, innerException?: Exception); } /** * @class TS.InvalidTypeException * * @description This exceptions signals that an argument has an invalid type. * * @extends {TS.Exception} */ class InvalidTypeException extends TS.Exception { /** * @private */ private internalArgumentName; /** * @private */ private internalArgumentValue; /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @description The name of the argument which caused the exception. * * @get {string} argumentName */ readonly argumentName: string; /** * @description The value of the argument which caused the exception. * * @get {string} argumentValue */ readonly argumentValue: any; /** * @constructor * * @param {string} argumentName, The name of the argument which caused the exception. * @param {any} argumentValue, The value of the argument which caused the exception. * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(argumentName?: string, argumentValue?: any, message?: string, innerException?: Exception); } /** * @class TS.ArithmeticException * * @description This exception signals an errors in an arithmetic, casting, or conversion operation. * ArithmeticException is the base class for DivideByZeroException, NotFiniteNumberException, and OverflowException. * Use one of the derived classes of ArithmeticException if appropriate to the exact nature of the error. * Throw an ArithmeticException if there is no appropriate subclass to describe the nature of the error. * * @extends {TS.Exception} */ class ArithmeticException extends TS.Exception { /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: Exception); } /** * @class TS.OverflowException * * @description This exception signals that an arithmetic, casting, or conversion operation results in an overflow. * * @extends {TS.ArithmeticException} */ class OverflowException extends ArithmeticException { /** * @override {TS.ArithmeticException} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: Exception); } /** * @class TS.DividedByZeroException * * @description This exception signals an attempt to divide a number value by zero. * * @extends {TS.ArithmeticException} */ class DividedByZeroException extends ArithmeticException { /** * @override {TS.ArithmeticException} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: Exception); } /** * @class TS.NotFiniteNumberException * * @description This exception signals an attempt to execute an arithmetic operation with a number value which is * either infinite or Not-a-Number (NaN). * * @extends {TS.ArithmeticException} */ class NotFiniteNumberException extends ArithmeticException { /** * @override {TS.ArithmeticException} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: Exception); } /** * @class TS.NotImplementedException * * @description This exception signals that a function or class is not or not fully implemented and can't be used. * * @extends {TS.Exception} */ class NotImplementedException extends TS.Exception { /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: Exception); } /** * @class TS.DeprecatedException * * @description This exception signals that a function or class should not longer be used. * * @extends {TS.Exception} */ class DeprecatedException extends TS.Exception { /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: Exception); } /** * @class TS.DirectoryNotFoundException * * @description This exception signals if the file system is not able to locate the requested directory. * * @extends {TS.Exception} */ class DirectoryNotFoundException extends TS.Exception { /** * @private */ private internalArgumentName; /** * @private */ private internalArgumentValue; /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @description The name of the argument which caused the exception. * * @get {string} argumentName */ readonly argumentName: string; /** * @description The value of the argument which caused the exception. * * @get {string} argumentValue */ readonly argumentValue: any; /** * @constructor * * @param {string} argumentName, The name of the argument which caused the exception. Typically the name of a directory variable. * @param {any} argumentValue, The value of the argument which caused the exception. Typically the value of a directory variable. * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(argumentName?: string, argumentValue?: string, message?: string, innerException?: Exception); } /** * @class TS.BufferOverrunException * * @description This exception signals if the file system is not able to locate the requested directory. * * @extends {TS.Exception} */ class BufferOverrunException extends TS.Exception { /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: Exception); } /** * @class TS.EnvironmentNotSupportedException * * @description This exception that some operation failed because the current environment is not supported. That may * be the reason if a JavaScript VM lacks some functions, a Node.js script is running in a browser or vice versa or * the operation system is not supported. * * @extends {TS.Exception} */ class EnvironmentNotSupportedException extends TS.Exception { /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: Exception); } /** * @class TS.TimeoutException * * @description This exception if thrown if a function or operation doesn't response in a timely manner. * * @extends {TS.Exception} */ class TimeoutException extends TS.Exception { /** * @override {TS.Exception} * * @get {string} type */ readonly type: string; /** * @constructor * * @param {string} message?, An optional message string. * @param {Exception} innerException?, An optional inner exception. */ constructor(message?: string, innerException?: Exception); } /** * @description The module 'Utils' hosts a collection of functions which offer solutions for common problems or * reoccurring tasks which are not class specific. Since they are not class specific, they are also not part of a * class. They are simply collected in this file and are part of the namespace. You can consider all of this * functions as static if you like, because you can call them without a prior instantiation of an object. */ namespace Utils { /** * @interface ICurrency */ interface ICurrency { Name: string; Code: string; Symbol: string; } /** * @description An array of currencies as defined in ISO 4217 * * @see {@link http://www.iso.org/iso/home/standards/currency_codes.htm | ISO} */ const currencyArray: Array<ICurrency>; /** * @description Searches for all occurrences of 'searchString' in 'sourceString' and returns an array of the * indexes where the search string occurred in the sourceString. * * @param {string} sourceString * @param {string} searchString * * @returns {Array<number>}, An array of indexes where the searchString occurred in the sourceString. */ function allIndexOf(sourceString: string, searchString: string): Array<number>; /** * @description Converts a bit string into an array of byte values. The function throws an exceptions if the * value of argument 'bitString' is not a valid bit string. * * @param {string} bitString, The bit string to convert. * * @returns {Array<number>}, The resulting byte value array which may be empty. * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.ArgumentNullUndefOrWhiteSpaceException} * @throws {TS.InvalidTypeException} */ function bitStringToByteArray(bitString: string): Array<number>; /** * @description Converts the values of the elements in argument 'byteArray' into a bit string representation. * * @param {Array<number>} unsignedByteArray, The array of byte values to convert. * * @returns {string}, The resulting bit string. * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException } */ function byteArrayToBitString(unsignedByteArray: Array<number>): string; /** * @description Converts an array of unsigned byte values into an unsigned integer value. The function throws an * exception if the value in argument 'unsignedByteArray' is not a valid byte array or empty. The function throws * a 'TS.ArgumentOutOfRangeException' if the conversion exceeds the maximum number range. (Number.MAX_SAFE_INTEGER) * * @params {Array<number>} byteArray, An array of unsigned byte values. * * @returns {number}, The result value as unsigned integer. * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException } * @throws {TS.ArgumentOutOfRangeException} */ function byteArrayToUInt(unsignedByteArray: Array<number>): number; /** * @description Converts the value given in argument 'unsignedByteValue' into an 8 character bit string. The result * string will be padded with leading '0' characters if necessary until the length of 8 characters is reached. * * @param {number} unsignedByteValue, Has to be an unsigned byte value. * * @returns {string}, The 8 character bit string representation of the value. * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} */ function byteToBitString(unsignedByteValue: number): string; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'parameter' is an ArrayLike type. Trows a * 'TS.InvalidTypeException' if not. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} */ function checkArrayLikeParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'parameter' is an array. Throws a 'TS.InvalidTypeException' if no. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} */ function checkArrayParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the argument 'parameter' is a valid string. Throws a 'TS.InvalidTypeException' if not. Checks * whether the argument 'parameter' is an empty string or whitespace only. Throws a * 'TS.ArgumentNullUndefOrWhiteSpaceException' if so. Check whether the argument 'parameter' is a valid binary * string. (A string which comprises the characters '[0,1]' only, with no white space.) Throws a * 'TS.InvalidTypeException' if not. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {string} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.ArgumentNullUndefOrWhiteSpaceException} * @throws {TS.InvalidTypeException} */ function checkBitStringParameter(parameterName: string, parameter: string, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'parameter' is a boolean. Throws a 'TS.InvalidTypeException' if not. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} */ function checkBooleanParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the 'thisContext' is a valid type for a constructor call or not. Throws a * 'TS.InvalidOperationException' if the value of argument 'thisContext' is either null or undefined or not of the * required type. Throws a 'TS.ArgumentNullOrUndefinedException' if argument 'requiredType' is not specified. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @deprecated Since JavaScript ECMAScript 2015 * * @param {any} thisContext * @param {any} requiredType * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidOperationException} */ function checkConstructorCall(thisContext: any, requiredType: any): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the type of the argument 'parameter' evaluates to 'function' and checks whether the function * returns an object if it is called with the 'new' operator and an empty argument list. * * The function throws a 'TS.InvalidTypeException' if the call with the 'new' operator fails for any reason or the * returned value is not an object, an empty object, null or undefined. * * Attention, even if the check succeeded, the function specified in the argument 'parameter' may not be supposed * to be called as a constructor function. (To be called with the new operator.) Since JavaScript allows to call * every function with the new operator there is no way to tell whether a function was supposed to be used as a * constructor function or not. But at least that check can tell that a call to that function as constructor * function won't fail and will return an object of any type when the function passed the check. * * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} */ function checkConstructorParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'parameter' is a Date. Throws as 'TS.InvalidTypeException' if not. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} */ function checkDateParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'parameter' is a valid date string. Throws as 'TS.InvalidTypeException' if * not. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} */ function checkDateStringParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'parameter' is a function. Throws as 'TS.InvalidTypeException' if not. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} */ function checkFunctionParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'parameter' is an integer number in the range of * [Number.MIN_SAFE_INTEGER...Number.MAX_SAFE_INTEGER]. Throws a 'TS.InvalidTypeException' if the value is * either not an integer, out of range or not a number at all. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {number} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} */ function checkIntNumberParameter(parameterName: string, parameter: number, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'type' is a valid type. Throws a 'TS.InvalidInvocationException' if not. * Checks whether the value of argument 'parameter' is an instance of the type provide in argument 'type'. * Throws a 'TS.InvalidTypeException' if not. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {any} type * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidInvocationException} * @throws {TS.InvalidTypeException} */ function checkInstanceOfParameter(parameterName: string, parameter: any, type: Object, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'parameter' is iterable. Throws a 'TS.InvalidTypeException' if not. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} */ function checkIterableParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'parameter' is an array of unsigned byte values. Throws a * 'TS.InvalidTypeException' if not. Checks whether the value of argument 'parameter' is an array with 16, 24 or * 32 elements. Throws a 'TS.ArgumentOutOfRangeException' if not. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} * @throws {TS.ArgumentOutOfRangeException} */ function checkKeyByteArray(parameterName: string, parameter: any, functionName: string): void; /** * @description This function checks the argument 'parameter' against null, undefined, an empty string and an empty * array and throws a 'TS.ArgumentNullUndefOrEmptyException' if the argument is either of this. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullUndefOrEmptyException} */ function checkNotEmptyParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against undefined and throws a * 'TS.ArgumentUndefinedException' if the argument is undefined. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentUndefinedException} */ function checkNotUndefinedParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'parameter' is a number. Throws a 'TS.InvalidTypeException' if not. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} */ function checkNumberParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'parameter' is an object. Throws a 'TS.InvalidTypeException' if not. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} */ function checkObjectParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} */ function checkParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the argument 'parameter' is a valid string. Throws a 'TS.InvalidTypeException' if not. * Checks whether the argument 'parameter' is an empty string or whitespace only.Throws a * 'TS.ArgumentNullUndefOrWhiteSpaceException' if so. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.ArgumentNullUndefOrWhiteSpaceException} * @throws {TS.InvalidTypeException} */ function checkStringParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'parameter' is a valid array of unsigned bytes and throws a * 'TS.InvalidTypeException' if not. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter * @param {string} functionName * * @throws {TS.ArgumentNullOrUndefinedException} * @throws {TS.InvalidTypeException} */ function checkUByteArrayParameter(parameterName: string, parameter: any, functionName: string): void; /** * @description Checks the value of argument 'parameter' against null and undefined and throws a * 'TS.ArgumentNullOrUndefinedException' if the argument is either null or undefined. * Checks whether the value of argument 'parameter' is a valid unsigned byte value and throws a * 'TS.InvalidTypeException' if not. * The exception messages use the 'parameterName' and 'functionName' in its message to signal which parameter * failed the check and which function received the invalid parameter. * * @param {string} parameterName * @param {any} parameter