import { Compare } from '../../array/array/lift'; import { Predicate } from '../../boolean/predicate/predicate'; import { Unary } from '../../function/function/unary'; import { Absent, Defined, NotNull, Present } from '../../value/value'; /** * An object of type `T` with a defined value of property `K`. * * @since v0.1.0 */ export type ObjectWithDefined = T & { [P in K]-?: Defined; }; /** * An object of type `T` with an undefined value of property `K`. * * @since v0.1.0 */ export type ObjectWithUndefined = T & Partial>; /** * An object of type `T` with a non-null value of property `K`. * * @since v0.1.0 */ export type ObjectWithNotNull = T & { [P in K]: NotNull; }; /** * An object of type `T` with a null value of property `K`. * * @since v0.1.0 */ export type ObjectWithNull = T & Record; /** * An object of type `T` with a present value of property `K`. * * @since v0.1.0 */ export type ObjectWithPresent = T & { [P in K]-?: Present; }; /** * An object of type `T` with an absent value of property `K`. * * @since v0.1.0 */ export type ObjectWithAbsent = T & { [P in K]: Absent; }; /** * Creates a function that for a given value returns the value of a given `property`. * * @since v0.2.0 */ export declare function property(property: K): Unary; /** * Creates a predicate that for a given value returns true * if a given `property` satisfies a given `condition`. * * @since v0.2.0 */ export declare function property(property: K, condition: Predicate): Predicate; /** * Returns a function to compare two objects by their `property` with a given `order` callback. * * @since v0.2.0 */ export declare function by(property: K, order: Compare): Compare; /** * Returns a type guard that returns true if its argument has a defined `property` * and all given `properties`. * * @since v0.2.3 */ export declare function hasDefinedProperty(property: K, ...properties: readonly K[]): (value: T) => value is ObjectWithDefined; /** * Returns a type guard that returns true if its argument has an undefined `property` * and all given `properties`. * * @since v0.2.3 */ export declare function hasUndefinedProperty(property: K, ...properties: readonly K[]): (value: T) => value is ObjectWithUndefined; /** * Returns a type guard that returns true if its argument has a non-null `property` * and all given `properties`. * * @since v0.2.3 */ export declare function hasNotNullProperty(property: K, ...properties: readonly K[]): (value: T) => value is ObjectWithNotNull; /** * Returns a type guard that returns true if its argument has a `null` `property` * and all given `properties`. * * @since v0.2.3 */ export declare function hasNullProperty(property: K, ...properties: readonly K[]): (value: T) => value is ObjectWithNull; /** * Returns a type guard that returns true if its argument has a present `property` * and all given `properties`. * * @since v0.2.3 */ export declare function hasPresentProperty(property: K, ...properties: readonly K[]): (value: T) => value is ObjectWithPresent; /** * Returns a type guard that returns true if its argument has an absent `property` * and all given `properties`. * * @since v0.2.3 */ export declare function hasAbsentProperty(property: K, ...properties: readonly K[]): (value: T) => value is ObjectWithAbsent;