import { Observable } from 'rxjs'; import * as i0 from '@angular/core'; /** * Indicates whether the specified value is array. * @param value The value to test. * @returns true if the value is an array, false otherwise. */ declare const isArray: (value: any) => boolean; /** * Indicates whether the specified value is not an array. * @param value The value to test. * @returns true if the value is not an array, false otherwise. */ declare const isNotArray: (value: any) => boolean; /** * Indicates whether the specified value is an empty array. * @param value The value to test. * @returns true if the value is an empty array, false otherwise. */ declare const isEmpty: (value: any) => value is [any]; /** * Indicates whether the specified value is an array and not empty. * @param value The value to test. * @returns true if the value is an array and not empty. */ declare const isNotEmpty: (value: any) => boolean; /** * Indicates whether the specified value is a date. This function does not handle * the numeric representation of a date (it is considered invalid). * @param value The date to test. * @returns true if the value is a date, false otherwise. */ declare const isDate: (value: unknown) => value is Date; /** * Indicates whether the specified value is not a date. * @param value The value to test. * @returns true if the value is not a date, false otherwise. */ declare const isNotDate: (value: unknown) => value is Date; /** * Indicates whether the specified value is a date by LACERA standards where * 1/1/1900 is considered the default value and not a valid date. * @param date The date to test. * @returns true if the value is a LACERA date, false otherwise. */ declare const isDateValid: (date: unknown) => date is Date; /** * Indicates whether the specified value is not a date by LACERA standards where * 1/1/1900 is considered the default value and not a valid date. * @param date The date to test. * @returns true if the value is a LACERA date, false otherwise. */ declare const isDateNotValid: (date: unknown) => date is Date; /** * Indicates whether the specified value is an ISO 8601 date. * @param value The value to test. * @returns true if the value is a valid ISO 8601 date, false otherwise. */ declare const isDateIso: (value: unknown) => boolean; /** * Indicates whether the specified value is a date and later than 1/1/1900. * @param date The value to test. * @returns true if the value is LACERA valid, false otherwise. */ declare const isDateLaceraValid: (date?: unknown) => boolean; /** * Indicates whether the specified value is of type {@link Date}. * @param date The value to test. * @returns true if the value is a Date, false otherwise. */ declare const isDateObject: (date?: unknown) => boolean; /** * Converts a value to a {@link Date} object if value is a valid ISO 8601 date. * @param value The value to convert to a date. * @returns The value as a {@link Date} or null if not valid. */ declare const toIsoDate: (value: unknown) => Date | null; /** * Converts a value to a {@link Date} object if possible. * @param value The value to convert to a date. * @returns The value as a {@link Date} or null if not valid. */ declare const toDate: (value: unknown) => Date | null; /** * Indicates whether the specified value is a number. * @param value The value to test. * @returns true if the value is a number, false otherwise. */ declare const isNumber: (value: any) => value is number; /** * Indicates whether the specified value is not a number. * @param value The value to test. * @returns true if the value is not a number, false otherwise. */ declare const isNotNumber: (value: any) => value is number; /** * Indicates whether the specified value is currency (including $ symbol). * @param value The value to test. * @returns true if the value is currency, false otherwise. */ declare const isCurrency: (value: any) => boolean; /** * Converts the given value to an integer number. * @param value The value to convert. * @returns The value represented as a number or NaN. */ declare const toNumber: (value: any) => number; /** * Converts the given value to a floating number. * @param value The value to convert. * @returns The value represented as a number or NaN. */ declare const toFloat: (value: any) => number; /** * Removes all characters that are not digits from a string. * @param value The value to strip. * @param keepCurrency Indicates to keep currency symbols (dash, dot). * @returns A new string without non-digit characters. */ declare const stripNonNumbers: (value: any, keepCurrency?: boolean) => string; /** * Indicates whether the specified value is an object. * @param value The value to test. * @returns true if the value is an object, false otherwise. */ declare const isObject: (value: any) => value is object; /** * Indicates whether the specified value is not an object. * @param value The value to test. * @returns true if the value is not an object, false otherwise. */ declare const isNotObject: (value: any) => value is number; /** * Indicates whether the specified value is a function. * @param value The value to test. * @returns true if the value is a function, false otherwise. */ declare const isFunction: (value: any) => value is Function; /** * Indicates whether the specified value is not a function. * @param value The value to test. * @returns true if the value is not a function, false otherwise. */ declare const isNotFunction: (value: any) => value is number; /** * Indicates whether the specified value is valid/present. * @param obj The object to test. * @returns true if the value is present, false otherwise. */ declare const isPresent: (obj: any) => boolean; /** * Indicates whether the specified value is valid/present. * @param value The value to test. * @returns true if the value is present, false otherwise. */ declare const isInputValueEmpty: (value: any) => boolean; declare type TbxRandomStringType = /** Generate a random string with only numbers. */ "Number" | /** Generate a random string with only letters. */ "Letters" | /** Generate a random string with both letters and number. */ "Alpha" | /** Generate a random string with valid password characters (e.g., #$@) */ "Password"; /** * Generate a Globally Unique ID (GUID). * @param useRandom4 Indicates to use a random string of 4 characters instead of * the window.crypto API. * @returns A Globally Unique ID. */ declare const newGuid: (useRandom4?: boolean) => string; /** * Generates a random string. * @param length The length of the string to generate. Minimum is 1 character. * @param type The type of string to generate. * @param makeUpper Indicates to return the string in uppercase. * @returns The random string. */ declare const getString: (length: number, type?: TbxRandomStringType, makeUpper?: boolean) => string; /** * Generates a random password. * @param length The length of the string to generate. Minimum is 1 character. * @returns The random password. */ declare const generatePassword: (length: number) => string; /** * Returns a random value from the specified array of values. * @param values The array of values. * @returns One of the specified values. */ declare const getOneOf: (values: T[]) => T; /** * Simulates a coin toss. * @returns True 50% of the time, false the other. */ declare const coinToss: () => boolean; /** * Generates a random number. * @param maxValue The exclusive upper bound of the number to be generated. It * defaults to 10. * @param minValue The exclusive lower bound of the number to be generated. It * defaults to 1. * @returns The random number. */ declare const getNumber: (maxValue?: number, minValue?: number) => number; /** * Indicates whether the specified value is null or an empty string. * @param value The value to test. * @returns true if the value is null or an empty string. */ declare const isNullOrEmpty: (value: any) => boolean; /** * Indicates whether the specified value is not null or not an empty string. * @param value The value to test. * @returns true if the value is not null nor an empty string. */ declare const isNotNullOrEmpty: (value: any) => value is string; /** * Indicates whether a specified string is null, empty, or consists only of * white-space characters. * @param value The value test. * @returns true if the string is null, empty, or consists only of * white-space characters */ declare const isNullOrWhiteSpace: (value: any) => value is string; /** * Indicates whether a specified string is null, empty, or consists only of * white-space characters. * @param value The value test. * @returns true if the string is not null, not empty, nor consists only of * white-space characters */ declare const isNotNullOrWhiteSpace: (value: any) => value is string; /** * Compares two strings to determine whether they contain the same case-sensitive value. * @param value1 The first value to test. * @param value2 The second value to test. * @returns true if the strings contain the same case-sensitive value, false otherwise. */ declare const equals: (value1: any, value2: any) => value1 is string; /** * Determines whether two strings do not contain the same case-sensitive value. * @param value1 The first value to test. * @param value2 The second value to test. * @returns true if the strings do not contain the same case-sensitive value, * false otherwise. */ declare const notEquals: (value1: any, value2: any) => value1 is string; /** * Determines whether two strings contain the same case-insensitive value. * @param value1 The first value to test. * @param value2 The second value to test. * @returns true if the strings contain the same case-insensitive value, * false otherwise. */ declare const equalsIgnoreCase: (value1: any, value2: any) => value1 is string; /** * Determines whether two strings do not contain the same case-insensitive value. * @param value1 The first value to test. * @param value2 The second value to test. * @returns true if the strings do not contain the same case-insensitive value, * false otherwise. */ declare const notEqualsIgnoreCase: (value1: any, value2: any) => boolean; /** * Removes all characters that are not digits from a string. * @param value The value to strip. * @param keepCurrency Indicates to keep currency symbols (dash, dot). * @returns A new string without non-digit characters. */ declare const stripNonDigits: (value: any, keepCurrency?: boolean) => string; /** * Determines if the given value is a boolean by comparing it to typical true * values such as 'true', 1, '1', 'on', or 'yes' ignoring case. * @param value The value to check. * @returns true if the value is a truthy boolean, false otherwise. */ declare const isTrue: (value: any) => boolean; /** * Determines if the given value is a valid credit card number. * @param value The value to check. * @returns isTrue if the value is a credit card number, false otherwise. */ declare const isCreditCard: (value: any) => boolean; /** * Determines if the given value is a valid email address. * @param value The value to check. * @returns isTrue if the value is a valid email address, false otherwise. */ declare const isEmail: (value: any) => boolean; /** * Determines whether the specified value is a valid SSN with or without dashes. * @param value The SSN to test. * @returns true if it's a valid SSN, false otherwise. */ declare const isSsn: (value: any) => value is string; /** * Determines whether the specified value is not a valid SSN. * @param value The SSN to test. * @returns false if it's not a valid SSN, false otherwise. */ declare const isNotSsn: (value: any) => value is string; /** * Formats the specified SSN with or without dashes (defaults to add dashes). * @param value The SSN to format. * @param addDashes Indicates whether to format with dashes (defaults to true). * @returns The formatted SSN if valid, otherwise the same value is returned. */ declare const formatSsn: (value: any, addDashes?: boolean) => string; /** * Masks the SSN by showing only the last 4 digits and x for the rest. It the * specified SSN is invalid, it simply returns it without throwing an exception. * @param ssn The SSN to mask. * @returns The masked SSN. */ declare const maskSsn: (ssn: any) => string; /** * Removes the specified text from the beginning of the string. * @param text The text to trim. * @param what The text to remove from the string. Defaults to an empty space. * @returns The text without the specified text from the start of the string. */ declare const trimLeft: (text: string, what?: string) => string; /** * Removes the specified text from the end of the string. * @param text The text to trim. * @param what The text to remove from the string. Defaults to an empty space. * @returns The text without the specified text from the end of the string. */ declare const trimRight: (text: string, what?: string) => string; /** * Remove the trailing slash from the specified string, if any. * @param text The text to remove the trailing slash. * @returns The string without the trailing slash. */ declare const removeTrailingSlash: (text: string) => string; /** * Remove the leading slash from the specified string, if any. * @param text The text to remove the leading slash. * @returns The string without the leading slash. */ declare const removeLeadingSlash: (text: string) => string; /** * Adds a trailing slash to the specified text if it doesn't end with one, but * it does not add it if the text is null. * @param text The text to add the trailing slash to. * @returns The text with a trailing slash. */ declare const addTrailingSlash: (text: string) => string; /** * Ensures the text ends with the specified text. * @param text The text to ensure ends with the specified text. * @param what The text to end with. * @returns The text ending with specified text. */ declare const ensureEndsWith: (text: string, what: string) => string; /** * Ensures the text starts with the specified text. * @param text The text to ensure starts with the specified text. * @param what The text to start with. * @returns The text starting with specified text. */ declare const ensureStartsWith: (text: string, what: string) => string; /** * Ensures the given value is not null or undefined by returning * an empty string if so. * @param value The value to check. * @param defaultValue The value to return if null/undefined (default to ""). * @returns The value if it's a string, or an empty string if null or undefined. */ declare const ensureNotNull: (value: string | null | undefined, defaultValue?: string) => string; interface TbxSubscriptionLike { unsubscribe(): void; } /** * Subscription sink that holds Observable subscriptions until unsubscribe * is called to release all subscriptions (usually on ngOnDestroy). */ declare class TbxSubSink { /** The list of subscriptions to maintain. */ protected subs: TbxSubscriptionLike[]; /** * Assign subscription to this sink to add it to the tracked subscriptions * @example * this.subs.sink = observable$.subscribe(...); */ set sink(subscription: TbxSubscriptionLike); /** * Add subscriptions to the tracked subscriptions * @example * this.subs.add(observable$.subscribe(...)); */ add(...subscriptions: TbxSubscriptionLike[]): void; /** * Unsubscribe to all subscriptions in ngOnDestroy() * @example * ngOnDestroy() { * this.subs.unsubscribe(); * } */ unsubscribe(): void; } /** Provides basic clock functions. */ declare class TbxClockService { /** The clock Observable. */ private readonly clockObservable; /** Initializes a new instance of the {@link TbxClockService} class. */ constructor(); /** Gets the current date and time as an {@link Observable}. */ get now(): Observable; /** Gets the current date and time. */ get currentTime(): Date; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { TbxClockService, TbxSubSink, addTrailingSlash, coinToss, ensureEndsWith, ensureNotNull, ensureStartsWith, equals, equalsIgnoreCase, formatSsn, generatePassword, getNumber, getOneOf, getString, isArray, isCreditCard, isCurrency, isDate, isDateIso, isDateLaceraValid, isDateNotValid, isDateObject, isDateValid, isEmail, isEmpty, isFunction, isInputValueEmpty, isNotArray, isNotDate, isNotEmpty, isNotFunction, isNotNullOrEmpty, isNotNullOrWhiteSpace, isNotNumber, isNotObject, isNotSsn, isNullOrEmpty, isNullOrWhiteSpace, isNumber, isObject, isPresent, isSsn, isTrue, maskSsn, newGuid, notEquals, notEqualsIgnoreCase, removeLeadingSlash, removeTrailingSlash, stripNonDigits, stripNonNumbers, toDate, toFloat, toIsoDate, toNumber, trimLeft, trimRight }; export type { TbxRandomStringType, TbxSubscriptionLike };