import { DeepReadonly, TaggedObject } from '../types/objects'; /** * Type guard for any key, `k`. * Marks `k` as a key of `T` if `k` is in `obj`. * @param obj object to query for key `k` * @param k key to check existence in `obj` */ export declare function isKeyOf(obj: T, k: keyof any): k is keyof T; /** * Same as `Object.keys` except that the returned type is an array of keys of the object. * Note that for the same reason that `Object.keys` does not do this natively, this method _is not safe_ for objects on the perimeter of your code (user input, read in files, network requests etc.). * @param obj object whose keys will be returned * @returns an array of keys from `obj` */ export declare function objectKeys(obj: T): (keyof T)[]; /** * Useful for marking object literals as readonly while still keeping type inference: * `const obj = Readonly({ a: 22, b: 'yellow' });` * @param obj an object to be marked readonly * @returns `obj` marked as readonly at compile time */ export declare function Readonly(obj: T): DeepReadonly; /** * Useful for tagged unions of objects (imagine redux reducers) this tags every sub-object with the key pointing to that sub-object. * @param obj an object of objects whose keys will be used as tags for the inner objects * @param key the name of the "tag" parameter * @returns `obj` with the inner objects tagged with parameter `key` and the key pointing to that inner object */ export declare function taggedObject, K extends string>(obj: T, key: K): TaggedObject;