/**
 * Replaces `T` with `R` if it is assignable to `M`.
 */
declare type Replace<T, M, R> = T extends M ? R : T;
/**
 * Recursively replaces all values in `T` assignable to `M` with `R`.
 */
export declare type DeepReplace<T, M, R> = {
    [K in keyof T]: DeepReplace<Replace<T[K], M, R>, M, R>;
};
/**
 * Identity-function helper to ensure a value `T` is a subtype of `U`.
 *
 * @template U The type to check for (explicitly specify this)
 * @template T The actual type (inferred, don't specify this)
 */
export declare const subtypeOf: <U>() => <T extends U>(value: T) => T;
/**
 * Returns true if `val` is not `null` or `undefined`
 */
export declare const isDefined: <T>(value: T) => value is NonNullable<T>;
/**
 * Returns a type guard that checks whether the given value is strictly equal to a specific value.
 * This can for example be used with `isNot()` to exclude string literals like `"loading"`.
 *
 * @param constant The value to compare to. Pass this with `as const` to improve type inference.
 */
export declare const isExactly: <T, C extends T>(constant: C) => (value: T) => value is C;
/**
 * Negates a type guard.
 * Returns a function that returns `true` when the input is **not** the type checked for by the given type guard.
 * It therefor excludes a type from a union type.
 *
 * @param isType The type guard that checks whether the given input value should be excluded.
 */
export declare const isNot: <TInput, TExclude extends TInput>(isType: (value: TInput) => value is TExclude) => (value: TInput) => value is Exclude<TInput, TExclude>;
/**
 * Returns a function that returns `true` if the given `key` of the object passes the given type guard.
 *
 * @param key The key of the property to check.
 */
export declare const hasProperty: <O extends object, K extends string | number | symbol>(key: K) => (object: O) => object is O & { [k in K]: unknown; };
/**
 * Returns a function that returns `true` if the given `key` exists in the given object, narrowing down the type of the _key_.
 *
 * @param key The key of the property to check.
 */
export declare const keyExistsIn: <O extends object>(key: string | number | symbol, object: O) => key is keyof O;
/**
 * Returns a function that returns `true` if the given `key` of the object passes the given type guard.
 *
 * @param key The key of the property to check.
 * @param isType The type guard to evalute on the property value.
 */
export declare const property: <O extends object, K extends keyof O, T extends O[K]>(key: K, isType: (value: O[K]) => value is T) => (object: O) => object is O & Record<K, T>;
/**
 * Resolves a tagged union type to a specific member of the union identified by the given tag value.
 */
export declare const isTaggedUnionMember: <O extends object, K extends keyof O, V extends O[K]>(key: K, tagValue: V) => (object: O) => object is Extract<O, Record<K, V>>;
/**
 * Returns a function that returns `true` if the given value is an instance of the given class.
 *
 * @param constructor A reference to a class, e.g. `HTMLElement`
 */
export declare const isInstanceOf: <C extends new () => object>(constructor: C) => (value: unknown) => value is InstanceType<C>;
/**
 * Combines multiple type guards into one type guard that checks if the value passes any of the provided type guards.
 */
export declare function anyOf<T0, T1 extends T0, T2 extends Exclude<T0, T1>>(t1: (value: T0) => value is T1, t2: (value: Exclude<T0, T1>) => value is T2): (value: T0) => value is T1 | T2;
export declare function anyOf<T0, T1 extends T0, T2 extends Exclude<T0, T1>, T3 extends Exclude<T1, T2>>(t1: (value: T0) => value is T1, t2: (value: Exclude<T0, T1>) => value is T2, t3: (value: Exclude<T1, T2>) => value is T3): (value: T0) => value is T1 | T2 | T3;
export declare function anyOf<T0, T1 extends T0, T2 extends Exclude<T0, T1>, T3 extends Exclude<T1, T2>, T4 extends Exclude<T2, T3>>(t1: (value: T0) => value is T1, t2: (value: Exclude<T0, T1>) => value is T2, t3: (value: Exclude<T1, T2>) => value is T3, t4: (value: Exclude<T2, T3>) => value is T4): (value: T0) => value is T1 | T2 | T3 | T4;
/**
 * Combines multiple type guards into one type guard that checks if the value passes all of the provided type guards.
 */
export declare function allOf<T0, T1 extends T0, T2 extends T1>(t1: (value: T0) => value is T1, t2: (value: T1) => value is T2): (value: T0) => value is T1 & T2;
export declare function allOf<T0, T1 extends T0, T2 extends T1, T3 extends T2>(t1: (value: T0) => value is T1, t2: (value: T1) => value is T2, t3: (value: T2) => value is T3): (value: T0) => value is T1 & T2 & T3;
export declare function allOf<T0, T1 extends T0, T2 extends T1, T3 extends T2, T4 extends T3>(t1: (value: T0) => value is T1, t2: (value: T1) => value is T2, t3: (value: T2) => value is T3, t4: (value: T3) => value is T4): (value: T0) => value is T1 & T2 & T3 & T4;
/**
 * Returns a type guard for a simple condition that does not check the type of the argument (but something about the value).
 */
export declare const check: <T>(simpleCondition: (value: T) => boolean) => (value: T) => value is T;
export {};
