Merge pull request #19919 from mattbishop/deep-freeze-es6

Add definitions for deep-freeze-es6
This commit is contained in:
Benjamin Lichtman
2017-09-21 16:46:33 -07:00
committed by GitHub
4 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import * as deepFreeze from "deep-freeze-es6";
class Foo {
foo: string;
}
const foo: Foo = deepFreeze(new Foo());
const foo2: Foo = deepFreeze({foo: "bar"});
const obj: object = deepFreeze({count: 2});
const items: Array<{id: number, name: string}> = deepFreeze([{id: 0, name: "first"}]);
const map: Map<string, number> = deepFreeze(new Map());
const set: Set<string> = deepFreeze(new Set());

15
types/deep-freeze-es6/index.d.ts vendored Normal file
View File

@@ -0,0 +1,15 @@
// Type definitions for deep-freeze-es6 1.0
// Project: https://github.com/christophehurpeau/deep-freeze-es6
// Definitions by: Matt Bishop <https://github.com/mattbishop>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/** Declaration file generated by dts-gen */
export = deepFreeze;
declare function deepFreeze<T>(obj: T): T;
declare namespace deepFreeze {
const prototype: {};
}

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"deep-freeze-es6-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }