import { CanBeUndef, If } from './logical'; import { PickAsOptional } from './pick'; /** * Defines an object with keys of type `TKey`, and all values of `TValue` type. * @param TValue Type of values, stored in object's properties. * @param TKeys Union type of keys stored in defined object type. * It is `any` by default, if you use this parameter, * most probably you will specify a union of some string or number unit types. */ export declare type Obj = Record; /** * Defines a union type of all the values stored in `TObj`. * @param TObj Object type to get values from. */ export declare type ValueOf = TObj[keyof TObj]; /** * Shorthand for `Extract`, i.e. it gets only those keys * that are assignable to `string` (without `number | symbol`) * * @param TObj Objet type to get string keys from. */ export declare type StrKeyOf = Extract; /** * Same as BasicObject<>, but defines all properties as readonly. * @param TValue Type of values, stored in object's readonly properties. */ export declare type ReadonlyObj = Readonly>; /** * Defines the same object type as `TSrcObj`, but all values types * replaced with `TMappedValue` type. * @param TSrcObj Type of object to take keys from. * @param TMappedValue Type of values in the created object type. */ export declare type MapValues = Obj; /** * Defines the same object type as `TSrcObj`, but all values types * replaced with `TMappedValue` type **recursively**. * @param TSrcObj Type of object to take keys from. * @param TMappedValue Type of values in the created object type. */ export declare type DeepMapValues = { [TKey in keyof TSrcObj]: TSrcObj[TKey] extends Obj ? DeepMapValues : TMappedValue; }; /** * Defines the same object type as `TSrcObj`, but with `TKeys` keys * having the value of type `TNewValue`. * * @param TSrcObj Type of object to replace property type of. * @param TKeys Union type of keys to change value types of (often just a string literal). * @param TNewValue Type of values stored at `TKeys` keys in the returned type. */ export declare type ReplaceValues = Merge>; /** * Defines the same object type as `TSrcObj`, but without `TKeysUnion` keys. * @param TSrcObj Type of object to remove keys from. * @param TKeysUnion A single or union type of keys to remove from `TSrcObj`. */ export declare type RemoveKeys = Pick>; /** * Defines the same object type as `TObj`, but with `TPrevKey` key renamed to `TNewKey`. * @param TObj Object type to rename key in. * @param TPrevKey Target property key to rename. * @param TNewKey New name (or symbol) for the `TObj[TPrevKey]` property. */ export declare type RenameKey = Merge, Obj>; /** * Merge objects `TObj1` and `TObj2`. * Properties types from `TObj2` override the ones defined on `TObj1`. * This type is analogous to the return type of `Object.assign()` */ export declare type Merge = Pick> & TObj2; /** * Defines the same type as `TObj`, but adds 'optional' modifier `?` to all * properties that allow `undefined` as their value type (this includes `unknown` and `any`). * @param TObj Target object type to take properties from. */ export declare type OptionalLikelyUndefProps = Merge>; declare type PickLikelyUndefPropsAsOptional = PickAsOptional), TKey, never>; }>>; export {}; //# sourceMappingURL=objects.d.ts.map