mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-31 19:12:20 +08:00
Merge pull request #19919 from mattbishop/deep-freeze-es6
Add definitions for deep-freeze-es6
This commit is contained in:
11
types/deep-freeze-es6/deep-freeze-es6-tests.ts
Normal file
11
types/deep-freeze-es6/deep-freeze-es6-tests.ts
Normal 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
15
types/deep-freeze-es6/index.d.ts
vendored
Normal 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: {};
|
||||
}
|
||||
22
types/deep-freeze-es6/tsconfig.json
Normal file
22
types/deep-freeze-es6/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/deep-freeze-es6/tslint.json
Normal file
1
types/deep-freeze-es6/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user