All files / src/api Types.ts

100% Statements 19/19
100% Branches 0/0
100% Functions 12/12
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 4435x 36x 36x 3560x                           29x                     29x   3x             29x   36x        
export { Consumer, Method as ConsumerFunction, guard as consumerGuard, Type as ConsumerType } from "@jonloucks/concurrency-ts/auxiliary/Consumer";
export { Predicate, Method as PredicateFunction, guard as predicateGuard, Type as PredicateType } from "@jonloucks/concurrency-ts/auxiliary/Predicate";
export { Supplier, Method as SupplierFunction, guard as supplierGuard, Type as SupplierType, toValue as supplierToValue } from "@jonloucks/concurrency-ts/auxiliary/Supplier";
export { guardFunctions, isNotPresent, isNumber, isPresent, isString, OptionalType, RequiredType } from "@jonloucks/contracts-ts/api/Types";
 
// candidate for inclusion in api-ts
/**
 * A type that can be a value of type T, null, or undefined
 */
export type Throwable<T> = T | null | undefined;
 
/**
 * Type guard to determine if a value is Throwable
 *
 * @param value the value to check
 * @return true if the value is Throwable
 */
export function isThrowable<T>(value: unknown): value is Throwable<T> { return true; }
 
// review if there is a something better to use here, like Java's Duration
// candidate for inclusion in api-ts
export interface Duration {
  get milliSeconds(): number;
}
 
/**
 * The minimum timeout duration
 */
export const MIN_TIMEOUT: Duration = {
  get milliSeconds() : number {
    return 0;
  }
};
 
/**
 * The maximum timeout duration
 */
export const MAX_TIMEOUT: Duration = {
  get milliSeconds() : number {
    return Number.MAX_SAFE_INTEGER;
  }
};