import { TemplateRef, Type } from '@angular/core'; import { CssStyleObject, GenericFunction, WeakObject, TypedRecord, StyleGroup, UnionTypeOf, KeyOf } from 'warskald-ui/models'; import { FormControl, FormGroup } from '@angular/forms'; /** * Checks if the input is a string indexed object. * * @param input- The value to check if it is a string indexed object * @returns true if the input is a string indexed object, false otherwise */ export declare function isWeakObject(input: unknown): input is WeakObject; /** * Checks if the input is an object that is not an array. * While this will typically result in the same value as isWeakObject, it is a quicker check, * but also less strict. * * @param input - The value to check if it is an object that is not an array * @returns true if the input is an object that is not an array, false otherwise */ export declare function isWeakObjectQuick(input: unknown): input is WeakObject; export declare function isArray(value: unknown): value is unknown[]; /** * Checks if the input is an array of string indexed objects. * * @param input - The value to check if it is an array of string indexed objects * @returns true if the input is an array of string indexed objects, false otherwise */ export declare function isWeakObjectArray(input: unknown): input is WeakObject[]; /** * Checks if the input is numeric. * * @param value - The value to check if it is numeric * @returns true if the input is numeric, false otherwise */ export declare function isNumeric(value: unknown): value is number | string; /** * Checks if the input is a string. * * @param value - The value to check if it is a string * @returns true if the input is a string, false otherwise */ export declare function isString(value: unknown): value is string; /** * Checks if the input is an array of strings. * * @param value - The value to check if it is an array of strings * @returns true if the input is an array of strings, false otherwise */ export declare function isStringArray(value: unknown): value is string[]; /** * Checks if the input is a number. * * @param value - The value to check if it is a number * @returns true if the input is a number, false otherwise */ export declare function isNumber(value: unknown): value is number; /** * Checks if the input is an array of numbers. * * @param value - The value to check if it is an array of numbers * @returns true if the input is an array of numbers, false otherwise */ export declare function isNumberArray(value: unknown): value is number[]; /** * Checks if the input is a boolean. * * @param value - The value to check if it is a boolean * @returns true if the input is a boolean, false otherwise */ export declare function isBoolean(value: unknown): value is boolean; /** * Checks if the input is an array of booleans. * * @param value - The value to check if it is an array of booleans * @returns true if the input is an array of booleans, false otherwise */ export declare function isBooleanArray(value: unknown): value is boolean[]; /** * Checks if the input is a function. * * @param value - The value to check if it is a function * @returns true if the input is a function, false otherwise */ export declare function isFunction(value: unknown): value is GenericFunction; /** * Checks if the input is a date. * * @param value - The value to check if it is a date * @returns true if the input is a date, false otherwise */ export declare function isDate(value: unknown): value is Date; /** * Checks if the input is an array of dates. * * @param value - The value to check if it is an array of dates * @returns true if the input is an array of dates, false otherwise */ export declare function isDateArray(value: unknown): value is Date[]; export declare function isUndefined(value: unknown): value is undefined; export declare function isComparableType(value: unknown): value is number | string | Date | boolean; export type TypeGuard = (input: unknown, ...args: unknown[]) => input is T; export interface PropertyTypeGuard { predicate: TypeGuard; optional?: boolean; } export type Defined = Exclude; export declare function exists(obj: unknown): obj is Defined; export declare function hasValue(obj: unknown): boolean; export declare function matchesAllOf(value: unknown, ...typeGuards: { [K in keyof T]: TypeGuard; }): value is T; export declare function matchesAnyOf(value: unknown, ...typeGuards: { [K in keyof T]: TypeGuard; }): value is T; export declare function matchesAllOfFactory(...typeGuards: { [K in keyof T]: TypeGuard; }): (value: unknown) => value is T; export declare function matchesAnyOfFactory(...typeGuards: { [K in keyof T]: TypeGuard; }): (value: unknown) => value is T; export declare function stringUnionGuardFactory(...types: string[]): TypeGuard>; export type TypeMapping = Record; export type WeakTypeMapping = Record; export declare const OptionalStringProp: PropertyTypeGuard; export declare const OptionalNumberProp: PropertyTypeGuard; export declare const OptionalBooleanProp: PropertyTypeGuard; export declare const OptionalDateProp: PropertyTypeGuard; export declare const OptionalFunctionProp: PropertyTypeGuard; export declare const OptionalWeakObjectProp: PropertyTypeGuard; export declare const OptionalWeakObjectArrayProp: PropertyTypeGuard; export declare const OptionalStringArrayProp: PropertyTypeGuard; export declare const OptionalNumberArrayProp: PropertyTypeGuard; export declare const OptionalBooleanArrayProp: PropertyTypeGuard; export declare const OptionalDateArrayProp: PropertyTypeGuard; export declare const OptionalExistsProp: PropertyTypeGuard; export declare const OptionalStyleProp: PropertyTypeGuard; export declare const OptionalArrayProp: PropertyTypeGuard; export declare const OptionalStyleGroupProp: PropertyTypeGuard; export declare const StringProp: PropertyTypeGuard; export declare const NumberProp: PropertyTypeGuard; export declare const BooleanProp: PropertyTypeGuard; export declare const DateProp: PropertyTypeGuard; export declare const FunctionProp: PropertyTypeGuard; export declare const WeakObjectProp: PropertyTypeGuard; export declare const WeakObjectArrayProp: PropertyTypeGuard; export declare const StringArrayProp: PropertyTypeGuard; export declare const NumberArrayProp: PropertyTypeGuard; export declare const BooleanArrayProp: PropertyTypeGuard; export declare const DateArrayProp: PropertyTypeGuard; export declare const ExistsProp: PropertyTypeGuard; export declare const StyleProp: PropertyTypeGuard; export declare const ArrayProp: PropertyTypeGuard; export declare const StyleGroupProp: PropertyTypeGuard; export declare function objIsType(obj: unknown, typeGuards: TypeMapping | string[]): obj is T; export declare function isTypedRecord(obj: unknown, typeGuard: TypeGuard): obj is TypedRecord; export declare function isTypedRecordArray(obj: unknown, typeGuard: (obj: unknown) => obj is T): obj is TypedRecord[]; export declare function isNumericString(str: string, strict?: boolean): boolean; export declare function stringToDate(dateString: string): Date | undefined; export declare function isBooleanString(str: string): boolean; export declare function isCssStyleObject(obj: unknown): obj is CssStyleObject; export declare function isStyle(obj: unknown): obj is string | CssStyleObject; export declare function isTemplateRef(obj: unknown): obj is TemplateRef; export declare function isComponentClass(obj: unknown): obj is Type; export declare const StyleGroupTypeMap: TypeMapping; export declare function isStyleGroup(obj: unknown): obj is StyleGroup; export declare function isStyleGroupArray(obj: unknown): obj is StyleGroup[]; export declare function isFunctionRecord(obj: unknown): obj is Record>; export declare function isCast(value: unknown): value is T; export declare function castAs(value: unknown): T; export declare function isForm(obj: unknown): obj is FormControl | FormGroup; export declare function isKeyOf(value: unknown, obj: T): value is KeyOf;