DefinitelyTyped/types/deep-freeze/index.d.ts
Joel Brenstrum 07b144b70a [@types/deep-freeze] - allow functions to be called with out error (#37096)
* allow functions to be called

* lint

* fix ups
2019-08-05 09:59:40 -07:00

19 lines
711 B
TypeScript

// Type definitions for deep-freeze 0.1
// Project: https://github.com/substack/deep-freeze
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Aluan Haddad <https://github.com/aluanhaddad>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.1
export = deepFreeze;
declare function deepFreeze<T>(a: T[]): ReadonlyArray<deepFreeze.DeepReadonly<T>>;
declare function deepFreeze<T extends Function>(f: T): T;
declare function deepFreeze<T>(o: T): deepFreeze.DeepReadonly<T>;
declare namespace deepFreeze {
type DeepReadonly<T> =
T extends (...args: any) => any
? T
: { readonly [P in keyof T]: DeepReadonly<T[P]> };
}