ts-data-forge
Version:
[](https://www.npmjs.com/package/ts-data-forge) [](https://www.npmjs.com/package/ts-data-forge) [
*/
export declare const castReadonly: <T>(mutable: T) => Readonly<T>;
/**
* Casts a mutable type `T` to its `DeepReadonly<T>` equivalent, recursively
* adding readonly modifiers.
*
* This is a safe type assertion that adds immutability constraints at ALL
* levels of nesting. Provides complete protection against mutations in complex
* data structures. The runtime value is unchanged - only TypeScript's type
* checking is enhanced.
*
* @template T - The type of the mutable value
* @param mutable - The mutable value to cast to deeply readonly
* @returns The same value with readonly modifiers recursively added to all
* properties
* @see castReadonly - For shallow readonly casting
* @see castDeepMutable - For the opposite operation (use with extreme caution)
*/
export declare const castDeepReadonly: <T>(mutable: T) => DeepReadonly<T>;
//# sourceMappingURL=cast-readonly.d.mts.map