import type { PathFn } from '../global/path.js'; import type { PropFn } from '../global/prop.js'; import type { Obj, Path } from '../internal/types/tools/index.js'; declare const objWithW: { /** * Returns a new object with the specified property set to the given value. * * It is the same as `objWith`, but with looser type restrictions. The `W` postfix stands for "wide". * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. * @param prop Property name or `prop` function representing the property to set. * @param value Value to set. * * @example * ```typescript * const obj = { a: 1, b: 2, c: { d: [{ e: 3 }] } }; * objWithW(obj, 'a', 2); // => { a: 2, b: 2, c: { d: [{ e: 3 }] } } * objWithW(obj, prop('a'), 2); // => { a: 2, b: 2, c: { d: [{ e: 3 }] } } * objWithW(obj, path('c.d[0].e'), 4); // => { a: 1, b: 2, c: { d: [{ e: 4 }] } } * objWithW(obj, ['c', 'd', '0', 'e'], 4); // => { a: 1, b: 2, c: { d: [{ e: 4 }] } } * ``` * * @see {@link objWith} */ ( o: O, prop: K | PropFn, value: V, ): Obj.With>; /** * Returns a new object with the specified property set to the given value. * * It is the same as `objWith`, but with looser type restrictions. The `W` postfix stands for "wide". * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. * @param path Property path or `path` function representing the property to set. * @param value Value to set. * * @example * ```typescript * const obj = { a: 1, b: 2, c: { d: [{ e: 3 }] } }; * objWithW(obj, 'a', 2); // => { a: 2, b: 2, c: { d: [{ e: 3 }] } } * objWithW(obj, prop('a'), 2); // => { a: 2, b: 2, c: { d: [{ e: 3 }] } } * objWithW(obj, path('c.d[0].e'), 4); // => { a: 1, b: 2, c: { d: [{ e: 4 }] } } * objWithW(obj, ['c', 'd', '0', 'e'], 4); // => { a: 1, b: 2, c: { d: [{ e: 4 }] } } * ``` * * @see {@link objWith} */ ( o: O, path: PathFn, value: V, ): Obj.With, Obj.WritableDeep>; /** * Returns a new object with the specified property set to the given value. * * It is the same as `objWith`, but with looser type restrictions. The `W` postfix stands for "wide". * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. * @param path Property path or `path` function representing the property to set. * @param value Value to set. * * @example * ```typescript * const obj = { a: 1, b: 2, c: { d: [{ e: 3 }] } }; * objWithW(obj, 'a', 2); // => { a: 2, b: 2, c: { d: [{ e: 3 }] } } * objWithW(obj, prop('a'), 2); // => { a: 2, b: 2, c: { d: [{ e: 3 }] } } * objWithW(obj, path('c.d[0].e'), 4); // => { a: 1, b: 2, c: { d: [{ e: 4 }] } } * objWithW(obj, ['c', 'd', '0', 'e'], 4); // => { a: 1, b: 2, c: { d: [{ e: 4 }] } } * ``` * * @see {@link objWith} */ ( o: O, path: PP, value: V, ): Obj.With, Obj.WritableDeep>; }; export default objWithW; //# sourceMappingURL=withW.d.ts.map