mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-27 14:30:49 +08:00
Fixed a bug that resulted in `any` being inferred for nested recursive generics. Formatted type declaration on multiple lines for readability. Updated maintainers list.
18 lines
653 B
TypeScript
18 lines
653 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: 2.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> = {
|
|
readonly [P in keyof T]: DeepReadonly<T[P]>
|
|
};
|
|
}
|