import type { AnyFunction, AnyObject } from './types'; /** * const value = lazyValue(() => expensiveComputation()) * * value() // calls expensiveComputation() once * value() // returns cached result * value() // returns cached result * * Based on: https://github.com/sindresorhus/lazy-value */ export declare function _lazyValue(fn: T): T; /** * interface Obj { * v: number * } * * const obj = {} as Obj * * _defineLazyProperty(obj, 'v', () => expensiveComputation()) * obj.v // runs expensiveComputation() once * obj.v // cached value * obj.v // cached value * * Based on: https://github.com/sindresorhus/define-lazy-prop */ export declare function _defineLazyProperty(obj: OBJ, propertyName: keyof OBJ, fn: AnyFunction): OBJ; /** * Like _defineLazyProperty, but allows to define multiple props at once. */ export declare function _defineLazyProps(obj: OBJ, props: Partial>): OBJ; /** * Same as Object.defineProperty, but with better (least restricting) defaults. * * Defaults are: * writable: true * configurable: true * enumerable: true * value: existing obj[prop] value * * Original defaults: * writable: false * configurable: false * enumerable: false * value: existing obj[prop] value * */ export declare function _defineProperty(obj: T, prop: keyof T, pd: PropertyDescriptor): T; /** * Object.defineProperties with better defaults. * See _defineProperty for exact defaults definition. */ export declare function _defineProps(obj: T, props: Partial>): T; /** * Like _defineProps, but skips props with nullish values. */ export declare function _defineNonNullishProps(obj: T, props: Partial>): T;