/** * Helper type to make the given array/map/set/object recursively read-only. * * You can use this type to easily build safe data structures. * * From: https://stackoverflow.com/questions/41879327/deepreadonly-object-typescript */ export type Immutable = T extends ImmutablePrimitive ? T : T extends Array ? ImmutableArray : T extends Map ? ImmutableMap : T extends Set ? ImmutableSet : ImmutableObject; type ImmutablePrimitive = undefined | null | boolean | string | number | Function; type ImmutableArray = ReadonlyArray>; type ImmutableMap = ReadonlyMap, Immutable>; type ImmutableSet = ReadonlySet>; type ImmutableObject = { readonly [K in keyof T]: Immutable; }; export {}; //# sourceMappingURL=Immutable.d.ts.map