mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
Addressed merge conflict in test file.
This commit is contained in:
+338
@@ -0,0 +1,338 @@
|
||||
# DefinitelyTyped [](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped)
|
||||
|
||||
[](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
> 이 저장소는 고품질의 타입스크립트(TypeScript) 자료형 정의(Type definition)를 위한 저장소입니다.
|
||||
|
||||
이 문서가 가장 최신 내용을 담고있긴 하지만, [공식 사이트(definitelytyped.org)](http://definitelytyped.org)도 확인해보시면 좋습니다.
|
||||
|
||||
## 선언 파일(Declaration file)이 뭔가요?
|
||||
|
||||
[타입스크립트 안내서(TypeScript handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)를 읽어보세요.
|
||||
|
||||
## 선언 파일(Declaration file)을 어떻게 받을 수 있나요??
|
||||
|
||||
### npm 사용하기
|
||||
|
||||
아래 방법은 타입스크립트(TypeScript) 2.0+ 이상의 버전을 사용하는 사람들만 사용할 수 있는 방법이기는 합니다만, 이 방법을 사용하기를 장려합니다.
|
||||
|
||||
```sh
|
||||
npm install --save-dev @types/node
|
||||
```
|
||||
|
||||
`node` 를 위한 자료형(Typing)이 컴파일 과정에 자동으로 포함될 겁니다.
|
||||
더 자세한 내용은 [안내서(Handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)에서 확인해보실 수 있습니다.
|
||||
|
||||
NPM 의 "foo" 패키지에 대응되는 자료형 패키지는 "@types/foo" 입니다.
|
||||
원하시는 패키지를 찾을 수 없는 경우, [타입서치(TypeSearch)](https://microsoft.github.io/TypeSearch/) 사이트에서 한 번 찾아보세요.
|
||||
|
||||
타입서치(TypeSearch)에서도 찾을 수 없는 경우, 찾고 있는 패키지가 자료형(Typing)을
|
||||
[함께 제공](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)하고 있지는 않은지 확인해보세요.
|
||||
패키지에 포함된 자료형(Typing)은 주로 `package.json` 파일의 `"types"` 나 `"typings"` 필드(Field)를 통해 제공되지만,
|
||||
`/// <reference path="" />` 같은 주석을 사용하여 패키지 안의 ".d.ts" 파일들을 직접 가져와야 할 수도 있습니다.
|
||||
|
||||
|
||||
### 그 외의 방법들
|
||||
|
||||
타입스크립트(TypeScript) 1.0 버전에서 사용할 수 있는 방법은 다음과 같습니다.
|
||||
|
||||
* [Typings](https://github.com/typings/typings) 을 사용하기
|
||||
* ~~[NuGet](http://nuget.org/packages?q=DefinitelyTyped) 을 사용하기~~ (다른 방법을 사용해주세요. NuGet 은 더 이상 DT 자료형(Typing)을 제공하지 않습니다.)
|
||||
* 이 저장소의 `master` 브랜치를 직접 내려받기
|
||||
|
||||
위 방법을 사용할 경우 수동으로 [참조(Reference)](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html)를 추가해주어야 할 수 있습니다.
|
||||
|
||||
|
||||
## 어떻게 이곳에 기여할 수 있나요?
|
||||
|
||||
여러분과 같은 많은 기여자들의 도움 덕분에 이 저장소가 돌아가고 있습니다. 감사합니다.
|
||||
|
||||
### 테스트
|
||||
|
||||
여러분이 만든 자료형 선언(Type declation)을 세상에 공유하기에 앞서, 여러분이 스스로 여러분의 자료형 선언(Type declation)을 사용하고 확인해주세요.
|
||||
|
||||
#### 이미 존재하는 자료형 패키지를 임시로 수정하기
|
||||
|
||||
이미 존재하는 패키지의 자료형 선언(Type declaration)에 새로운 기능을 추가하려면 [모듈 증강(module augmentation)](http://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation)를 사용할 수 있습니다.
|
||||
물론 `node_modules/@types/foo/index.d.ts` 를 직접 수정하실 수도 있으며, 이 파일을 복사한 다음 아래의 과정을 따라하실 수도 있습니다.
|
||||
|
||||
|
||||
#### 새 자료형 패키지를 임시로 추가하기
|
||||
|
||||
사용하고 계신 `tsconfig.json` 에 다음 내용을 추가해주세요.
|
||||
|
||||
```json
|
||||
"baseUrl": "types",
|
||||
"typeRoots": ["types"],
|
||||
```
|
||||
|
||||
(`types` 대신 `src/types` 을 사용하실 수도 있습니다.)
|
||||
그리고 "foo" 모듈(Module)에 대한 선언(Declaration)을 포함하는 `types/foo/index.d.ts` 파일을 만들어주세요.
|
||||
이제 코드 안에서 여러분의 새 자료형 선언(Type declaration)을 사용하는 `"foo"` 모듈(Module)을 임포트(Import)하실 수 있을 겁니다.
|
||||
코드를 컴파일하고 실행시켜서 여러분의 자료형(Typing)이 실행 중에 실제로 벌어지는 일과 잘 맞아떨어지는지 확인해주세요.
|
||||
실제 코드를 통한 확인이 끝나면, [풀 리퀘스트(Pull request)](#풀-리퀘스트pull-request-만들기)를 만들어주세요.
|
||||
[이미 존재하는 패키지를 수정](#이미-존재하는-패키지를-수정하기)하거나 [새 패키지를 만들기](#새-패키지-만들기)위한 과정들을 따라하시면 됩니다.
|
||||
|
||||
|
||||
### 풀 리퀘스트(Pull request) 만들기
|
||||
|
||||
여러분의 자료형 선언이 잘 작동하는지 확인하셨다면, DefinitelyTyped 에 공유해주세요.
|
||||
|
||||
우선, 이 저장소를 [포크(fork)](https://guides.github.com/activities/forking/)해 주시고, [node](https://nodejs.org/) 를 설치하신 뒤, `npm install` 명령을 실행해주세요.
|
||||
|
||||
|
||||
#### 이미 존재하는 패키지를 수정하기
|
||||
|
||||
* `cd types/my-package-to-edit` 명령을 실행합니다.
|
||||
* 자료형(Typing) 파일들을 수정합니다. 테스트를 추가하는 것도 잊지마세요!
|
||||
만약 브레이킹 체인지(Breaking change)를 만드셨다면, [메이저 버전(major version)](#i-want-to-update-a-package-to-a-new-major-version)을 꼭 올려주세요.
|
||||
* 패키지 머릿주석의 "Definitions by" 부분에 여러분의 이름을 추가하실 수도 있습니다.
|
||||
- 이름을 추가하시면 다른 사람들이 그 패키지에 대한 풀 리퀘스트(Pull request)나 이슈(Issue)를 만들 때 여러분에게 알람이 갑니다.
|
||||
- `// Definitions by: Alice <https://github.com/alice>, Bob <https://github.com/bob>` 와 같이 여러분의 이름을 줄의 맨 마지막에 추가할 수 있습니다.
|
||||
- 사람이 너무 많을 경우엔, 다음과 같이 여러 줄로 쓰실 수도 있습니다.
|
||||
```typescript
|
||||
// Definitions by: Alice <https://github.com/alice>
|
||||
// Bob <https://github.com/bob>
|
||||
// Steve <https://github.com/steve>
|
||||
// John <https://github.com/john>
|
||||
```
|
||||
* `tslint.json` 파일이 있는 경우에는, `npm run lint package-name` 명령을 실행시키고 결과를 확인해주세요. 그렇지 않은 경우에는, 해당 패키지가 있는 디렉토리 안에서 `tsc` 명령을 실행시키고 결과를 확인해주세요.
|
||||
|
||||
이미 존재하는 패키지에 대한 풀 리퀘스트(Pull request)를 만들었을 경우에는, `dt-bot` 이 이전 저자들을 자동으로 호출하는지 확인해주세요.
|
||||
그렇지 않은 경우에는, 여러분이 직접 풀 리퀘스트(Pull request)와 관계있는 사람들을 호출할 수도 있습니다.
|
||||
|
||||
|
||||
#### 새 패키지를 만들기
|
||||
|
||||
만약 라이브러리를 만드는 중이고 라이브러리가 타입스크립트(TypeScript)로 쓰여있다면, DefinitelyTyped 에 선언(Declaration)을 올리는 대신 패키지에 [자동생성된 선언(Declaration) 파일을 포함](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)시킬 수 있습니다.
|
||||
|
||||
NPM 패키지를 위한 자료형(Typing) 패키지를 만드시려면, 패키지의 이름과 같은 이름의 디렉토리를 만들어주세요.
|
||||
NPM 에 올라가 있지 않은 패키지를 위한 자료형(Typing) 패키지를 만드시려면, 그 패키지가 NPM 에 올라와 있는 패키지와 이름이 겹치지 않는지 확인해주세요.
|
||||
(`npm info foo` 명령어를 사용하여 `foo` 패키지가 NPM 에 있는지 확인할 수 있습니다.)
|
||||
|
||||
새 자료형 패키지는 다음과 같은 구조로 구성되어있어야만 합니다.
|
||||
|
||||
| 파일 이름 | 용도 |
|
||||
| --- | --- |
|
||||
| index.d.ts | 패키지를 위한 자료형(Typing)을 포함하는 파일입니다. |
|
||||
| foo-tests.ts | 자료형(Typing)의 테스트를 위한 파일입니다. 이 파일의 코드는 실행되지는 않지만, 자료형 검사(Type checking)를 통과해야 합니다. |
|
||||
| tsconfig.json | `tsc` 명령을 돌릴 수 있게 해주는 파일입니다. |
|
||||
| tslint.json | 린터(Linter)를 사용할 수 있게 해주는 파일입니다. |
|
||||
|
||||
이 파일들은, npm ≥ 5.2.0 에서는 `npx dts-gen --dt --name my-package-name --template module` 명령으로,
|
||||
그 이하 경우에는 `npm install -g dts-gen` 와 `dts-gen --dt --name my-package-name --template module` 명령으로 만들 수 있습니다.
|
||||
`dts-gen` 의 모든 옵션(Option)을 보고싶으시면 [dts-gen](https://github.com/Microsoft/dts-gen) 저장소를 확인해주세요.
|
||||
|
||||
자료형(Typing) 패키지에 새 파일을 추가하거나, `async` 키워드를 사용하기 위해 `"target"` 을 `"es6"` 로 설정하거나, `"lib"` 를 추가하거나, `jsx` 지원을 추가하기 위해서 `tsconfig.json` 파일을 변경해야 할 수도 있습니다.
|
||||
|
||||
DefinitelyTyped 의 관리자들이 주기적으로 새로운 풀 리퀘스트(Pull request)들을 확인하기는 하지만,
|
||||
다른 풀 리퀘스트(Pull request)가 많을 경우 확인이 느려질 수 있다는 걸 알아주세요.
|
||||
|
||||
[base64-js](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/base64-js) 패키지는 좋은 예시 중 하나입니다.
|
||||
|
||||
|
||||
#### 많이 저지르는 실수들
|
||||
|
||||
* 우선, [안내서(Handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html)에 나와있는 내용들을 따라주세요.
|
||||
* 코드에서는 모든 곳에서 탭(Tab)을 사용하거나, 항상 4 개의 띄어쓰기를 사용해주세요.
|
||||
* `function sum(nums: number[]): number`의 경우, 만약 함수가 인자를 변경하지 않는다면 `ReadonlyArray` 를 사용해주세요.
|
||||
* `interface Foo { new(): Foo; }`의 경우,
|
||||
이런 선언은 이 형(Type)을 가진 객체(Object)에 `new` 를 사용할 수 있도록 만듭니다. 많은 경우 여러분은 `declare class Foo { constructor(); }` 를 사용하려는 것일 겁니다.
|
||||
* `const Class: { new(): IClass; }`의 경우,
|
||||
`new` 를 사용할 수 있는 상수를 만드는 대신, `class Class { constructor(); }` 와 같이 클래스 선언(Class declaration)을 사용하는 게 더 좋습니다.
|
||||
* `getMeAT<T>(): T`의 경우,
|
||||
만일 자료형 매개변수(Type parameter)가 함수의 매개변수에 등장하지 않는다면, 그런 제너릭(Generic) 함수를 사용할 필요가 없습니다.
|
||||
그 제너릭(Generic) 함수는 단순히 자료형 단언(Type assertion)을 위장시킨 것뿐입니다. 이 경우 `getMeAT() as number` 와 같이 진짜 자료형 단언(Type assertion) 을 사용하는 게 더 좋습니다.
|
||||
다음은 괜찮은 제너릭(Generic)의 예시입니다. `function id<T>(value: T): T;`.
|
||||
다음은 문제가 있는 제너릭(Generic)의 예시입니다. `function parseJson<T>(json: string): T;`.
|
||||
예외적으로, `new Map<string, number>()` 와 같은 경우는 괜찮습니다.
|
||||
* `Function` 이나 `Object` 와 같은 형(Type)을 사용하는 것은 대부분의 경우 문제를 일으킵니다. 99% 의 경우 더 구체적인 형(Type)을 사용하는게 가능합니다. [함수(Function)](http://www.typescriptlang.org/docs/handbook/functions.html#function-types) 를 위해서는 `(x: number) => number` 와 같은, 객체를 위해서는 `{ x: number, y: number }` 와 같은 형(Type)들을 사용할 수 있습니다. 형(Type)에 대한 정보가 전혀 없을 경우에는, `Object` 형(Type)이 아니라 [`any`](http://www.typescriptlang.org/docs/handbook/basic-types.html#any) 형(Type)을 사용해야 합니다. 만일 어떤 형(Type)이 객체라는 사실만 알고 있는 경우, `Object` 나 `{ [key: string]: any }` 가 아니라 [`object`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#object-type) 를 사용해주세요.
|
||||
* `var foo: string | any`의 경우,
|
||||
`any` 가 합 자료형(Union type)의 안에서 사용될 경우, 결과 형(Type)은 언제나 `any` 가 됩니다. 따라서 형(Type)의 `string` 부분이 유용해 보인다 하더라도, 사실은 자료형 검사(Type checking)의 측면에서 `any` 와 다른 것이 없습니다.
|
||||
대신, `any`, `string`, 나 `string | object` 중 하나를 필요에 맞게 골라서 사용해주세요.
|
||||
|
||||
|
||||
#### 패키지 삭제하기
|
||||
|
||||
패키지가 스스로의 형(Type)을 [포함](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)하게 되면, DefinitelyTyped 에 있는 자료형(Typing) 패키지를 삭제하는 것이 좋습니다.
|
||||
|
||||
`npm run not-needed -- typingsPackageName asOfVersion sourceRepoURL [libraryName]` 명령어를 사용하여 자료형(Typing) 패키지를 삭제할 수 있습니다.
|
||||
- `typingsPackageName` 는 삭제할 디렉토리의 이름입니다.
|
||||
- `asOfVersion` 는 새 스텁(Stub) 용 `@types/foo` 를 퍼블리시(Publish)할 버전입니다. 이 버전은 현재 NPM 에 올라간 버전보다 더 높은 버전이어야 합니다.
|
||||
- `sourceRepoURL` 는 자료형(Typing)을 포함하게 된 저장소의 주소입니다.
|
||||
- `libraryName` 는 패키지의 이름을 읽기 쉽게 쓴 것입니다. 즉, "angular2" 대신에 "Angular 2" 와 같이 쓰는 것이 좋습니다. (생략했을 경우에는 "typingsPackageName" 와 같은 것으로 취급됩니다.)
|
||||
|
||||
DefinitelyTyped 의 다른 패키지들이 삭제된 자료형(Typing) 패키지를 사용하고 있을 경우, 형(Type)을 포함하기 시작한 원래 패키지를 사용하도록 수정해야합니다. 삭제된 자료형(Typing) 패키지를 사용하는 각 DefinitelyTyped 패키지들의 `package.json` 파일에 `"dependencies": { "foo": "x.y.z" }` 를 추가해주시면 됩니다.
|
||||
|
||||
DefinitelyTyped 에 한 번도 올라온 적 없는 패키지가 형(Type)을 포함하게 되었다면, `notNeededPackages.json` 파일에 추가할 필요도 없습니다.
|
||||
|
||||
|
||||
#### 린트(Lint)하기
|
||||
|
||||
자료형(Typing) 패키지를 린트(Lint)하려면, 패키지 디렉토리에 `{ "extends": "dtslint/dt.json" }` 를 포함하고 있는 `tslint.json` 파일을 추가해주시면 됩니다. 모든 새 패키지는 해당 파일을 가지고 있어야 합니다.
|
||||
고쳐야 하지만 아직 고쳐지지 않은 린트(Lint) 결과가 있을 때에만 `tslint.json` 에서 린트 규칙(Lint rule)을 사용하지 않도록 설정할 수 있습니다. 예를 들어,
|
||||
|
||||
```js
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// 이 패키지는 Function 형을 사용하고 있으며, 고치는 게 쉽지 않다.
|
||||
"ban-types": false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
(린트 규칙(Lint rule)이 절대로 적용되서는 안되는 경우에는, `// tslint:disable rule-name` 나 `//tslint:disable-next-line rule-name` 를 사용하는 것이 좋습니다. 후자가 더 나은 방식입니다.)
|
||||
|
||||
어떤 표현식(Expression)이 특정한 형(Type)을 가진다고 단언(Assert)하고 싶을 때에는 `$ExpectType` 를 사용하시면 됩니다. 어떤 표현식(Expression)이 컴파일에 실패해야하는 경우에는 `$ExpectError` 를 하시면 됩니다.
|
||||
|
||||
```js
|
||||
// $ExpectType void
|
||||
f(1);
|
||||
|
||||
// $ExpectError
|
||||
f("one");
|
||||
```
|
||||
|
||||
[dtslint](https://github.com/Microsoft/dtslint#write-tests) 저장소의 README 파일에서 더 자세한 내용을 확인하실 수 있습니다.
|
||||
|
||||
이런 테스트들은 `npm run lint package-name` 명령으로 실행해볼 수 있습니다. 이 때, `package-name` 은 테스트하고 싶은 패키지의 이름입니다.
|
||||
테스트 스크립트는 [dtslint](https://github.com/Microsoft/dtslint) 를 사용하고 있습니다.
|
||||
|
||||
|
||||
## 자주 하는 질문들
|
||||
|
||||
#### 이 저장소와 `@types` 패키지들이 대체 무슨 관계가 있는 건가요?
|
||||
|
||||
`master` 브랜치(Branch)의 내용들이 [types-publisher](https://github.com/Microsoft/types-publisher) 를 사용해 자동으로 `@types` 퍼블리시(Publish)됩니다.
|
||||
|
||||
#### 풀 리퀘스트(Pull request)를 제출했습니다. 이게 합쳐질 때까지 얼마나 걸리나요?
|
||||
|
||||
상황에 따라 다르지만, 대부분의 풀 리퀘스트(Pull request)들은 일주일 안에 합쳐집니다. 머릿주석에 있는 저자 중 한명에 의해 승인된 풀 리퀘스트(Pull request)는 보통 더 빨리 합쳐집니다. 새로운 패키지에 대한 풀 리퀘스트(Pull request)는 관리자의 세세한 코드 리뷰를 필요로 하기 때문에 더 오래 걸리는 경우가 많습니다. 각 PR 들은 합쳐지기 전에 TypeScript or DefinitelyTyped 팀 구성원의 코드 리뷰를 받아야 하며, 이는 사람이 하는 일이기 때문에 느려질 수도 있으니 양해를 바랍니다. [풀 리퀘스트 번다운 보드(PR Burndown Board)](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/3?card_filter_query=is%3Aopen)에서 열린 풀 리퀘스트에 대한 관리자들의 진행도를 확인하실 수 있습니다.
|
||||
|
||||
#### 내 풀 리퀘스트(Pull request)는 합쳐졌습니다. 언제 NPM 에 `@types` 패키지가 갱신되나요?
|
||||
|
||||
NPM 의 패키지들은 수시간 안에 갱신될 겁니다. 만약 24 시간이 지나도 갱신되지 않으면, 문제를 파악하기 위해 @RyanCavanaugh 나 @andy-ms 를 풀 리퀘스트(Pull request)에서 호출해주세요.
|
||||
|
||||
#### 다른 자료형 정의(Type definition)에 의존하는 자료형 정의(Type definition)을 만들고 있습니다. `<reference types="" />` 와 임포트(import) 중 무엇을 사용해야하나요?
|
||||
|
||||
외부 모듈(`export` 를 사용하는 모듈)을 사용할 경우, 임포트(import)를 사용해주세요.
|
||||
환경과 관련된 모듈(ambient module)(`declare module` 를 쓰거나 전역 변수들을 선언한 모듈)을 사용할 경우, `<reference types="" />` 를 사용해주세요.
|
||||
|
||||
#### `package.json` 파일이 가끔 보이던데?
|
||||
|
||||
일반적으로는 `package.json` 파일을 사용할 필요가 없습니다. 패키지가 퍼블리시(Publish)될 때 패키지를 위한 `package.json` 파일은 자동으로 생성됩니다.
|
||||
가끔 보이는 `package.json` 파일은 의존하는 것들을 표시하기 위해 사용됩니다. [예시](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pikaday/package.json)를 한 번 보세요.
|
||||
의존성을 제외한 다른 필드(Field)들, 그러니까 `"description"` 같은 것들은 사용해서는 안됩니다.
|
||||
옛날 `@types` 패키지를 사용하고 싶으실 경우에도 `"dependencies": { "@types/foo": "x.y.z" }` 와 같은 내용을 `package.json` 파일에 넣으셔야 합니다.
|
||||
|
||||
#### 어떤 패키지들에 `tslint.json` 이 없거나, `tsconfig.json` 에 `"noImplicitAny": true`, `"noImplicitThis": true`, 나 `"strictNullChecks": true` 가 없어요.
|
||||
|
||||
그럼 그 패키지들이 잘못된 겁니다. 고쳐서 풀 리퀘스트(Pull request)를 제출해주시면 고맙겠습니다.
|
||||
|
||||
#### 자료형 정의(Type definition)을 요청할 수 있나요?
|
||||
|
||||
이미 요청된 자료형 정의(Type definition)들을 [여기서](https://github.com/DefinitelyTyped/DefinitelyTyped/labels/Definition%3ARequest) 보실 수 있습니다.
|
||||
|
||||
#### DOM 을 위한 자료형 정의(Type definitions)는요?
|
||||
|
||||
웹 표준(Web standard)과 관련이 있는 자료형(Typing)들은 [TSJS-lib-generator](https://github.com/Microsoft/TSJS-lib-generator) 저장소에 기여해서 고치실 수 있습니다. 고쳐진 자료형(Typing)은 `lib.dom.d.ts` 파일에 포함될 겁니다.
|
||||
|
||||
#### 어떤 패키지가 `export =` 를 쓰고 있는데, 저는 디폴트 임포트(Default import)가 더 좋습니다. `export =` 를 `export default` 로 바꿔도 되나요?
|
||||
|
||||
타입스크립트(TypeScript) 2.7 이상을 사용하고 계시면 프로젝트 안에서 `--esModuleInterop` 를 사용해주세요.
|
||||
그 이하의 경우, 디폴트 임포트(Default import)가 동작하는 환경(Webpack, SystemJS, esm)에서 작업 중이시면 [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) 를 사용하는 걸 고려해보세요.
|
||||
자료형 정의(Type definition)가 맞는 경우에는 자료형 정의(Type definition)을 수정하지 마세요.
|
||||
NPM 패키지의 경우, `node -p 'require("foo")'` 가 원하는 값이라면 `export =` 이 맞고, `node -p 'require("foo").default'` 이 원하는 값이라면 `export default` 이 맞습니다.
|
||||
|
||||
#### 자료형 선언(Type declaration)에서 타입스크립트(TypeScript) 2.1 이상의 기능을 사용하고 싶습니다.
|
||||
|
||||
정의(Definition) 머릿주석(`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`) 뒤에 `// TypeScript Version: 2.1` 를 추가해주시면 됩니다.
|
||||
|
||||
#### 타입스크립트(TypeScript)에 기본으로 포함되지 않은 DOM API 를 추가하고 싶어요.
|
||||
|
||||
[TSJS-Lib-Generator](https://github.com/Microsoft/TSJS-lib-generator#readme) 저장소가 관련되어있을 가능성이 있습니다. 해당 저장소의 안내를 따라주세요.
|
||||
해당 표준이 아직 초안인 상태라면, 이 저장소와 관련된 일입니다.
|
||||
`dom-` 으로 시작하는 패키지를 만드신 뒤, "Project" 머릿주석 부분에 해당 표준의 링크를 써 주세요.
|
||||
다만 표준이 초안을 벗어나면 DefinitelyTyped 에서 삭제되고 `@types` 패키지가 지원이 중단된(Deprecated) 것으로 표시될 수도 있습니다.
|
||||
|
||||
#### 패키지를 새 메이저 버전(major version)에 맞게 갱신하고 싶어요.
|
||||
|
||||
옛날 버전도 계속해서 수정할 예정이라면, 이전 버전에 해당하는 새 디렉토리(예를 들어 `2.` 버전을 위해서는 `v2`)를 만들고 현재 파일들을 그 디렉토리로 옮겨야 합니다. 새 디렉토리로 옮긴 뒤에는
|
||||
|
||||
1. `tsconfig.json` 와 `tslint.json` 에 포함된 상대경로들을 수정해주어야 합니다.
|
||||
2. 경로 대응 규칙(Path mapping rule)을 추가하여 테스트가 올바른 버전을 검사하도록 해야합니다.
|
||||
|
||||
예를 들어, [history 패키지의 2 버전의 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/history/v2/tsconfig.json) 파일은 다음과 같이 생겼습니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": ["../../"],
|
||||
"paths": {
|
||||
"history": [ "history/v2" ]
|
||||
},
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"history-tests.ts"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
수정 중인 패키지에 의존하는 DefinitelyTyped 의 다른 패키지들이 새 버전과 호환되지 않을 경우, 그 패키지들에도 옛날 버전으로의 경로 대응 규칙(Path mapping rule)을 추가해주어야 합니다. 수정 중인 패키지에 의존하는 패키지에 의존하는 패키지들에도 똑같은 작업을 해 주셔야 합니다.
|
||||
|
||||
예를 들어, `react-router` 패키지는 `history@2` 패키지에 의존하고 있기 때문에, [react-router 패키지의 `tsconfig.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router/tsconfig.json) 파일이 `"history": [ "history/v2" ]` 와 같은 경로 대응 규칙(Path mapping rule)을 가지고 있는 걸 볼 수 있습니다.
|
||||
이어서 (`react-router` 패키지에 의존하는 패키지인) `react-router-bootstrap` 또한 [tsconfig.json](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-router-bootstrap/tsconfig.json) 파일 안에 경로 대응 규칙(Path mapping rule)을 가지고 있는 것을 보실 수 있습니다.
|
||||
|
||||
`/// <reference types=".." />` 에서는 경로 대응 규칙(Path mapping rule)이 동작하지 않기 때문에, DefinitelyTyped 패키지로에 의존할 때에는 임포트(import) 를 사용해야 합니다.
|
||||
|
||||
#### 전역적으로도 모듈로도 사용될 수 있는 패키지의 자료형 선언(Type declaration)은 어떻게 쓰나요?
|
||||
|
||||
타입스크립트 안내서(TypeScript Handbook)은 [선언(Declaration)을 쓰는 방법에 대한 전반적인 정보](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)와 [예시들](https://www.typescriptlang.org/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html)을 포함하고 있습니다. 이 내용에는 ES6 식의 모듈 문법을 사용할 수 있는 자료형 선언(Type declaration)을 만드는 방법과 객체를 전역에서 사용할 수 있도록 하는 방법이 포함되어 있습니다. [big.js 패키지의 자료형 선언(Type declaration)](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/big.js/index.d.ts)이 실례입니다. 이 패키지는 웹 페이지의 스크립트 태그를 사용해 불러올 수 있으며, 또한 ES6 식의 임포트(Import) 구문을 사용해서 불러올 수도 있습니다.
|
||||
|
||||
여러분의 패키지가 임포트(Import) 구문을 사용했을 때와 전역적으로 불렀을 때를 테스트 해보고 싶다면, `test` 디렉토리를 추가하고 `YourLibraryName-global.test.ts` 그리고 `YourLibraryName-module.test.ts` 라는 이름으로 테스트 파일 두 개를 추가해주세요. **전역(Global)** 테스트 파일은 웹 페이지에서 전역적으로 사용될 때를 테스트하는 파일입니다. 이 파일에서는 임포트(Import) 구문을 사용하지 않아야 합니다. **모듈(Module)** 테스트 파일은 임포트(Import) 구문을 사용할 때를 테스트 하는 파일입니다. 만약 여러분의 `tsconfig.json` 파일이 `files` 필드(Field)를 가지고 있다면, 이 필드(Field)는 반드시 두 테스트 파일을 모두 포함해야 합니다. [이 방식을 사용하는 실례](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/big.js/test) 또한 big.js 패키지의 자료형 선언(Type declaration)에서 확인해보실 수 있습니다.
|
||||
|
||||
각각의 테스트 파일에 모든 상황을 테스트할 필요는 없다는 걸 잊지마세요. 전역 테스트 파일에서는 전역적으로 사용될 때만 테스트하고, 모듈 테스트 파일에서 나머지 상황들을 모두 테스트 할 수 있으며, 그 반대의 경우도 괜찮습니다.
|
||||
|
||||
#### 지역 패키지(Scoped package)의 경우는 어떻게 하죠?
|
||||
|
||||
`@foo/bar` 패키지와 같은 지역 패키지(Scoped package)를 위한 자료형 패키지(Type package)는 `types/foo__bar` 디렉토리에 추가하면 됩니다. 밑줄 문자가 두 번 있는 것에 주의하세요.
|
||||
|
||||
지역 패키지(Scoped package)를 위한 자료형 패키지(Type package)를 생성하기 위해 `dts-gen` 를 사용한 경우에는,
|
||||
다음과 같이 생성된 `tsconfig.json` 안에 지역 패키지(Scoped package)를 위한 적절한 경로 대응 규칙(Path mapping rule)을 추가해주어야 합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"paths":{
|
||||
"@foo/bar": ["foo__bar"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
#### 깃헙(GitHub)이 보여주는 파일 히스토리(History)가 불완전해요.
|
||||
|
||||
깃헙은 이름이 바뀐 파일의 히스토리(History)를 [지원하지 않습니다](http://stackoverflow.com/questions/5646174/how-to-make-github-follow-directory-history-after-renames). 대신 [`git log --follow`](https://www.git-scm.com/docs/git-log) 명령을 사용하세요.
|
||||
|
||||
#### ES6 에서 사용하는 임포트(Import)를 사용하기 위해 모듈을 익스포트(Export)하지 않는 패키지들에 빈 이름공간을 추가해야 하나요?
|
||||
|
||||
[chai-http](https://github.com/chaijs/chai-http) 패키지와 같은 몇몇 패키지들은 함수를 익스포트(Export)합니다.
|
||||
|
||||
이런 패키지들을 `import * as foo from "foo";` 와 같이 임포트(Import)하면 다음과 같은 오류가 발생합니다.
|
||||
|
||||
> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct
|
||||
|
||||
이 오류는 함수의 이름과 똑같은 빈 이름공간(Namespace)을 정의해서 없앨 수 있으나, 좋은 방법은 아닙니다.
|
||||
[스택오버플로(Stack Overflow)의 이 질문의 답변](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this)이 이 문제와 관련되어 자주 언급됩니다.
|
||||
|
||||
`import foo = require("foo");` 를 사용하여 모듈을 임포트(Import)하거나, 환경에서 ES6 모듈 변환(Module interop)을 지원한다면 `--allowSyntheticDefaultImports` 와 함께 `import foo from "foo";` 같은 디폴트 임포트(Default import)를 사용하는 것이 더 나은 방법입니다.
|
||||
|
||||
## 라이센스
|
||||
|
||||
이 프로젝트는 MIT license 가 적용되어 있습니다.
|
||||
|
||||
각 자료형 정의(Type definition) 파일들의 저작권은 각 기여자들에게 있으며, 기여자들은 해당 자료형 정의(Type definition) 파일들의 맨 위에 나열되어 있습니다.
|
||||
|
||||
[](https://github.com/igrigorik/ga-beacon)
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
Also see the [definitelytyped.org](http://definitelytyped.org) website, although information in this README is more up-to-date.
|
||||
|
||||
*[You can also read this README in Spanish!](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md)*
|
||||
*You can also read this README in [Spanish](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md) and [Korean!](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md)*
|
||||
|
||||
## What are declaration files?
|
||||
|
||||
|
||||
@@ -479,6 +479,7 @@ str = cloudwatchLogsDecodedData.messageType;
|
||||
str = cloudwatchLogsDecodedData.logEvents[0].id;
|
||||
num = cloudwatchLogsDecodedData.logEvents[0].timestamp;
|
||||
str = cloudwatchLogsDecodedData.logEvents[0].message;
|
||||
str = cloudwatchLogsDecodedData.logEvents[0].extractedFields!["example"];
|
||||
|
||||
/* ClientContext */
|
||||
clientContextClient = clientCtx.client;
|
||||
|
||||
Vendored
+1
@@ -371,6 +371,7 @@ export interface CloudWatchLogsLogEvent {
|
||||
id: string;
|
||||
timestamp: number;
|
||||
message: string;
|
||||
extractedFields?: {[key: string]: string};
|
||||
}
|
||||
|
||||
// Context
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
import * as captureconsole from "capture-console";
|
||||
|
||||
captureconsole.capture(process.stdout, () => { }); // $ExpectType string[]
|
||||
captureconsole.capture(process.stdout, {}, () => { }); // $ExpectType string[]
|
||||
captureconsole.capture(process.stdout, { quiet: true }, () => { }); // $ExpectType string[]
|
||||
|
||||
captureconsole.capture([process.stdout, process.stdin], () => { }); // $ExpectType string[]
|
||||
captureconsole.capture([process.stdout, process.stdin], {}, () => { }); // $ExpectType string[]
|
||||
captureconsole.capture([process.stdout, process.stdin], { quiet: true }, () => { }); // $ExpectType string[]
|
||||
|
||||
captureconsole.captureStderr(() => { }); // $ExpectType string
|
||||
captureconsole.captureStderr({}, () => { }); // $ExpectType string
|
||||
captureconsole.captureStderr({ quiet: true }, () => { }); // $ExpectType string
|
||||
|
||||
captureconsole.captureStdio(() => { }); // $ExpectType { stdout: string; stderr: string; }
|
||||
captureconsole.captureStdio({}, () => { }); // $ExpectType { stdout: string; stderr: string; }
|
||||
captureconsole.captureStdio({ quiet: true }, () => { }); // $ExpectType { stdout: string; stderr: string; }
|
||||
|
||||
captureconsole.captureStdout(() => { }); // $ExpectType string
|
||||
captureconsole.captureStdout({}, () => { }); // $ExpectType string
|
||||
captureconsole.captureStdout({ quiet: true }, () => { }); // $ExpectType string
|
||||
|
||||
captureconsole.hook(process.stdout, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType () => boolean
|
||||
captureconsole.hook(process.stdout, {}, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType () => boolean
|
||||
captureconsole.hook(process.stdout, { quiet: true }, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType () => boolean
|
||||
|
||||
captureconsole.intercept(process.stdout, () => { }); // $ExpectType string[]
|
||||
captureconsole.intercept(process.stdout, {}, () => { }); // $ExpectType string[]
|
||||
captureconsole.intercept(process.stdout, { quiet: true }, () => { }); // $ExpectType string[]
|
||||
|
||||
captureconsole.interceptStderr(() => { }); // $ExpectType string
|
||||
captureconsole.interceptStderr({}, () => { }); // $ExpectType string
|
||||
captureconsole.interceptStderr({ quiet: true }, () => { }); // $ExpectType string
|
||||
|
||||
captureconsole.interceptStdio(() => { }); // $ExpectType { stdout: string; stderr: string; }
|
||||
captureconsole.interceptStdio({}, () => { }); // $ExpectType { stdout: string; stderr: string; }
|
||||
captureconsole.interceptStdio({ quiet: true }, () => { }); // $ExpectType { stdout: string; stderr: string; }
|
||||
|
||||
captureconsole.interceptStdout(() => { }); // $ExpectType string
|
||||
captureconsole.interceptStdout({}, () => { }); // $ExpectType string
|
||||
captureconsole.interceptStdout({ quiet: true }, () => { }); // $ExpectType string
|
||||
|
||||
captureconsole.startCapture(process.stdout, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType boolean
|
||||
captureconsole.startCapture(process.stdout, {}, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType boolean
|
||||
captureconsole.startCapture(process.stdout, { quiet: true }, (string: string, encoding?: string, fd?: (error?: any) => void) => { }); // $ExpectType boolean
|
||||
|
||||
captureconsole.startIntercept(process.stdout, () => { }); // $ExpectType boolean
|
||||
captureconsole.startIntercept(process.stdout, {}, () => { }); // $ExpectType boolean
|
||||
captureconsole.startIntercept(process.stdout, { quiet: true }, () => { }); // $ExpectType boolean
|
||||
|
||||
captureconsole.stopCapture(process.stdout); // $ExpectType boolean
|
||||
|
||||
captureconsole.stopIntercept(process.stdout); // $ExpectType boolean
|
||||
Vendored
+190
@@ -0,0 +1,190 @@
|
||||
// Type definitions for capture-console 1.0
|
||||
// Project: https://github.com/zackehh/capture-console
|
||||
// Definitions by: Auston Zahrt <https://github.com/AustonZ>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
/**
|
||||
* Options controlling behavior when capturing
|
||||
*/
|
||||
export interface CaptureOptions {
|
||||
/**
|
||||
* Option to silence the output going to the console
|
||||
*/
|
||||
quiet?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the provided function with the output
|
||||
* on the provided streams.
|
||||
*/
|
||||
export function capture(
|
||||
streams: ReadonlyArray<NodeJS.WritableStream> | NodeJS.WritableStream,
|
||||
exec: () => void
|
||||
): string[];
|
||||
|
||||
/**
|
||||
* Executes the provided function with the output
|
||||
* on the provided streams. Accepts options to silence
|
||||
* the output going to the console.
|
||||
*/
|
||||
export function capture(
|
||||
streams: ReadonlyArray<NodeJS.WritableStream> | NodeJS.WritableStream,
|
||||
opts: CaptureOptions,
|
||||
exec: () => void
|
||||
): string[];
|
||||
|
||||
/**
|
||||
* Captures stderr for the provided execution scope.
|
||||
*/
|
||||
export function captureStderr(exec: () => void): string;
|
||||
|
||||
/**
|
||||
* Captures stderr for the provided execution scope.
|
||||
*/
|
||||
export function captureStderr(opts: CaptureOptions, exec: () => void): string;
|
||||
|
||||
/**
|
||||
* Captures stdout and stderr into an object for
|
||||
* the provided execution scope.
|
||||
*/
|
||||
export function captureStdio(exec: () => void): { stdout: string; stderr: string; };
|
||||
|
||||
/**
|
||||
* Captures stdout and stderr into an object for
|
||||
* the provided execution scope.
|
||||
*/
|
||||
export function captureStdio(opts: CaptureOptions, exec: () => void): { stdout: string; stderr: string; };
|
||||
|
||||
/**
|
||||
* Captures stdout for the provided execution scope.
|
||||
*/
|
||||
export function captureStdout(exec: () => void): string;
|
||||
|
||||
/**
|
||||
* Captures stdout for the provided execution scope.
|
||||
*/
|
||||
export function captureStdout(opts: CaptureOptions, exec: () => void): string;
|
||||
|
||||
/**
|
||||
* Listens to a provided stream, and executes the provided
|
||||
* function for every write call. Accepts options to silence
|
||||
* the output going to the console.
|
||||
*
|
||||
* Returns a function to call when you wish to stop listening
|
||||
* to the call.
|
||||
*/
|
||||
export function hook(
|
||||
stream: NodeJS.WritableStream,
|
||||
exec: (
|
||||
string: string,
|
||||
encoding?: string,
|
||||
fd?: (error?: any) => void
|
||||
) => void
|
||||
): () => boolean;
|
||||
|
||||
/**
|
||||
* Listens to a provided stream, and executes the provided
|
||||
* function for every write call. Accepts options to silence
|
||||
* the output going to the console.
|
||||
*
|
||||
* Returns a function to call when you wish to stop listening
|
||||
* to the call.
|
||||
*/
|
||||
export function hook(
|
||||
stream: NodeJS.WritableStream,
|
||||
opts: CaptureOptions,
|
||||
exec: (
|
||||
string: string,
|
||||
encoding?: string,
|
||||
fd?: (error?: any) => void
|
||||
) => void
|
||||
): () => boolean;
|
||||
|
||||
/**
|
||||
* Delegate to #capture with a quiet passthrough.
|
||||
*/
|
||||
export function intercept(stream: NodeJS.WritableStream, exec: () => void): string[];
|
||||
|
||||
/**
|
||||
* Delegate to #capture with a quiet passthrough.
|
||||
*/
|
||||
export function intercept(stream: NodeJS.WritableStream, opts: CaptureOptions, exec: () => void): string[];
|
||||
|
||||
/**
|
||||
* Delegate to #captureStderr with a quiet passthrough.
|
||||
*/
|
||||
export function interceptStderr(exec: () => void): string;
|
||||
|
||||
/**
|
||||
* Delegate to #captureStderr with a quiet passthrough.
|
||||
*/
|
||||
export function interceptStderr(opts: CaptureOptions, exec: () => void): string;
|
||||
|
||||
/**
|
||||
* Delegate to #captureStdio with a quiet passthrough.
|
||||
*/
|
||||
export function interceptStdio(exec: () => void): { stdout: string; stderr: string; };
|
||||
|
||||
/**
|
||||
* Delegate to #captureStdio with a quiet passthrough.
|
||||
*/
|
||||
export function interceptStdio(opts: CaptureOptions, exec: () => void): { stdout: string; stderr: string; };
|
||||
|
||||
/**
|
||||
* Delegate to #captureStdout with a quiet passthrough.
|
||||
*/
|
||||
export function interceptStdout(exec: () => void): string;
|
||||
|
||||
/**
|
||||
* Delegate to #captureStdout with a quiet passthrough.
|
||||
*/
|
||||
export function interceptStdout(opts: CaptureOptions, exec: () => void): string;
|
||||
|
||||
/**
|
||||
* Starts a capture on the provided stream using the
|
||||
* provided options and stream execution.
|
||||
*/
|
||||
export function startCapture(
|
||||
stream: NodeJS.WritableStream,
|
||||
exec: (
|
||||
string: string,
|
||||
encoding?: string,
|
||||
fd?: (error?: any) => void
|
||||
) => void
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* Starts a capture on the provided stream using the
|
||||
* provided options and stream execution.
|
||||
*/
|
||||
export function startCapture(
|
||||
stream: NodeJS.WritableStream,
|
||||
opts: CaptureOptions,
|
||||
exec: (
|
||||
string: string,
|
||||
encoding?: string,
|
||||
fd?: (error?: any) => void
|
||||
) => void
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* Delegate to #startCapture with a quiet passthrough.
|
||||
*/
|
||||
export function startIntercept(stream: NodeJS.WritableStream, exec: () => void): boolean;
|
||||
|
||||
/**
|
||||
* Delegate to #startCapture with a quiet passthrough.
|
||||
*/
|
||||
export function startIntercept(stream: NodeJS.WritableStream, opts: CaptureOptions, exec: () => void): boolean;
|
||||
|
||||
/**
|
||||
* Stops a capture on the provided stream.
|
||||
*/
|
||||
export function stopCapture(stream: NodeJS.WritableStream): boolean;
|
||||
|
||||
/**
|
||||
* Delegate to #stopCapture with a quiet passthrough.
|
||||
*/
|
||||
export function stopIntercept(stream: NodeJS.WritableStream): boolean;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"capture-console-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+23
-23
@@ -1935,15 +1935,15 @@ declare namespace Cesium {
|
||||
semiMinorAxis: Property;
|
||||
rotation: Property;
|
||||
show: Property;
|
||||
material: MaterialProperty;
|
||||
material: MaterialProperty | Color;
|
||||
height: Property;
|
||||
extrudedHeight: Property;
|
||||
granularity: Property;
|
||||
stRotation: Property;
|
||||
fill: Property;
|
||||
outline: Property;
|
||||
outlineColor: Property;
|
||||
outlineWidth: Property;
|
||||
fill: boolean;
|
||||
outline: boolean;
|
||||
outlineColor: Color;
|
||||
outlineWidth: number;
|
||||
numberOfVerticalLines: Property;
|
||||
constructor(options?: {
|
||||
semiMajorAxis?: number;
|
||||
@@ -1951,11 +1951,11 @@ declare namespace Cesium {
|
||||
height?: Property;
|
||||
extrudedHeight?: Property;
|
||||
show?: Property;
|
||||
fill?: Property;
|
||||
material?: MaterialProperty;
|
||||
outline?: Property;
|
||||
outlineColor?: Property;
|
||||
outlineWidth?: Property;
|
||||
fill?: boolean;
|
||||
material?: MaterialProperty | Color
|
||||
outline?: boolean;
|
||||
outlineColor?: Color;
|
||||
outlineWidth?: number;
|
||||
numberOfVerticalLines?: Property;
|
||||
rotation?: Property;
|
||||
stRotation?: Property;
|
||||
@@ -2207,11 +2207,11 @@ declare namespace Cesium {
|
||||
class LabelGraphics {
|
||||
definitionChanged: Event;
|
||||
text: Property;
|
||||
font: Property;
|
||||
font: string;
|
||||
style: Property;
|
||||
fillColor: Property;
|
||||
outlineColor: Property;
|
||||
outlineWidth: Property;
|
||||
fillColor: Color;
|
||||
outlineColor: Color;
|
||||
outlineWidth: number;
|
||||
horizontalOrigin: Property;
|
||||
verticalOrigin: Property;
|
||||
eyeOffset: Property;
|
||||
@@ -2222,11 +2222,11 @@ declare namespace Cesium {
|
||||
pixelOffsetScaleByDistance: Property;
|
||||
constructor(options?: {
|
||||
text?: Property;
|
||||
font?: Property;
|
||||
font?: string;
|
||||
style?: Property;
|
||||
fillColor?: Property;
|
||||
outlineColor?: Property;
|
||||
outlineWidth?: Property;
|
||||
fillColor?: Color;
|
||||
outlineColor?: Color;
|
||||
outlineWidth?: number;
|
||||
show?: Property;
|
||||
scale?: Property;
|
||||
horizontalOrigin?: Property;
|
||||
@@ -2362,14 +2362,14 @@ declare namespace Cesium {
|
||||
class PolygonGraphics {
|
||||
definitionChanged: Event;
|
||||
show: Property;
|
||||
material: MaterialProperty;
|
||||
material: MaterialProperty | Color;
|
||||
positions: Property;
|
||||
hierarchy: Property;
|
||||
height: Property;
|
||||
extrudedHeight: Property;
|
||||
granularity: Property;
|
||||
stRotation: Property;
|
||||
fill: Property;
|
||||
fill: boolean;
|
||||
outline: Property;
|
||||
outlineColor: Color;
|
||||
outlineWidth: Property;
|
||||
@@ -2379,10 +2379,10 @@ declare namespace Cesium {
|
||||
height?: number;
|
||||
extrudedHeight?: Property;
|
||||
show?: Property;
|
||||
fill?: Property;
|
||||
material?: MaterialProperty;
|
||||
fill?: boolean;
|
||||
material?: MaterialProperty | Color;
|
||||
outline?: boolean;
|
||||
outlineColor?: Property;
|
||||
outlineColor?: Color;
|
||||
outlineWidth?: number;
|
||||
stRotation?: Property;
|
||||
granularity?: Property;
|
||||
|
||||
Vendored
+2
-2
@@ -104,11 +104,11 @@ declare namespace connectMongo {
|
||||
}
|
||||
|
||||
export class MongoStore extends session.Store {
|
||||
get: (sid: string, callback: (err: any, session: Express.Session) => void) => void;
|
||||
get: (sid: string, callback: (err: any, session: Express.Session | null) => void) => void;
|
||||
set: (sid: string, session: Express.Session, callback?: (err: any) => void) => void;
|
||||
destroy: (sid: string, callback?: (err: any) => void) => void;
|
||||
length: (callback: (err: any, length: number) => void) => void;
|
||||
clear: (callback?: (err: any) => void) => void;
|
||||
clear: (callback?: (err?: any) => void) => void;
|
||||
touch: (sid: string, session: Express.Session, callback?: (err: any) => void) => void;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://facebook.github.io/react/
|
||||
// Definitions by: John Gozde <https://github.com/jgoz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { ComponentSpec, ClassicComponentClass } from "react";
|
||||
|
||||
|
||||
@@ -13,19 +13,21 @@ import * as d3Quadtree from 'd3-quadtree';
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// custom type guard
|
||||
function isLeaf(a: any): a is d3Quadtree.QuadtreeLeaf<any> {
|
||||
return a.data !== undefined;
|
||||
function isLeaf<T>(a: d3Quadtree.QuadtreeInternalNode<T> | d3Quadtree.QuadtreeLeaf<T>): a is d3Quadtree.QuadtreeLeaf<T> {
|
||||
return a.length === undefined;
|
||||
}
|
||||
|
||||
let num: number;
|
||||
let extent: [[number, number], [number, number]];
|
||||
let num4: 4;
|
||||
let undef: undefined;
|
||||
let extent: [[number, number], [number, number]] | undefined;
|
||||
|
||||
interface TestDatum {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
let testDatum: TestDatum;
|
||||
let testDatum: TestDatum | undefined;
|
||||
|
||||
let testData: TestDatum[] = [
|
||||
{ x: 10, y: 20 },
|
||||
@@ -83,7 +85,6 @@ quadtree = d3Quadtree.quadtree<TestDatum>(testData); // explicitly typed to Test
|
||||
|
||||
// test without data
|
||||
quadtree = d3Quadtree.quadtree<TestDatum>();
|
||||
// quadtree = d3Quadtree.quadtree(); fails, wrong underlying data type
|
||||
|
||||
// Configure Quadtree ========================================================
|
||||
|
||||
@@ -111,12 +112,14 @@ quadtree = quadtree.cover(50, 90);
|
||||
// add(...) ------------------------------------------------------------------
|
||||
|
||||
quadtree = quadtree.add({ x: 35, y: 35 });
|
||||
// quadtree = quadtree.add({x: 35}); // fails, incompatible data type
|
||||
// $ExpectError
|
||||
quadtree = quadtree.add({x: 35}); // fails, incompatible data type
|
||||
|
||||
// addAll(...) ---------------------------------------------------------------
|
||||
|
||||
quadtree = quadtree.addAll(testData);
|
||||
// quadtree = quadtree.addAll([{x: 35}, {x: 55, y: 13}]); // fails, incompatible data type
|
||||
// $ExpectError
|
||||
quadtree = quadtree.addAll([{x: 35}, {x: 55, y: 13}]); // fails, incompatible data type
|
||||
|
||||
// remove(...) ---------------------------------------------------------------
|
||||
|
||||
@@ -191,9 +194,10 @@ quadtree = quadtree.visit((node, x0, y0, x1, y1) => {
|
||||
}
|
||||
});
|
||||
|
||||
// quadtree = quadtree.visit(function (node, x0, y0, x1, y1) {
|
||||
// return 10; // fails wrong return type
|
||||
// });
|
||||
// $ExpectError
|
||||
quadtree = quadtree.visit((node, x0, y0, x1, y1) => {
|
||||
return 10; // fails wrong return type
|
||||
});
|
||||
|
||||
// visitAfter() ---------------------------------------------------------------
|
||||
|
||||
@@ -232,3 +236,15 @@ quadNode = internalNode[0];
|
||||
quadNode = internalNode[1];
|
||||
quadNode = internalNode[2];
|
||||
quadNode = internalNode[3];
|
||||
|
||||
num = internalNode.length;
|
||||
num4 = internalNode.length;
|
||||
|
||||
quadtree = quadtree.visit((node, x0, y0, x1, y1) => {
|
||||
if (isLeaf(node)) {
|
||||
undef = node.length;
|
||||
} else {
|
||||
num = node.length;
|
||||
num4 = node.length;
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+165
-10
@@ -1,17 +1,34 @@
|
||||
// Type definitions for D3JS d3-quadtree module 1.0
|
||||
// Project: https://github.com/d3/d3-quadtree/
|
||||
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
|
||||
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
|
||||
// Alex Ford <https://github.com/gustavderdrache>
|
||||
// Boris Yankov <https://github.com/borisyankov>
|
||||
// denisname <https://github.com/denisname>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// Last module patch version validated against: 1.0.1
|
||||
// Last module patch version validated against: 1.0.3
|
||||
|
||||
/**
|
||||
* Leaf node of the quadtree.
|
||||
*/
|
||||
export interface QuadtreeLeaf<T> {
|
||||
/**
|
||||
* The data associated with this point, as passed to quadtree.add.
|
||||
*/
|
||||
data: T;
|
||||
|
||||
/**
|
||||
* The next datum in this leaf, if any.
|
||||
*/
|
||||
next?: QuadtreeLeaf<T>;
|
||||
|
||||
/**
|
||||
* The length property may be used to distinguish leaf nodes from internal nodes: it is undefined for leaf nodes, and 4 for internal nodes.
|
||||
*/
|
||||
length?: undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal nodes of the quadtree are represented as four-element arrays in left-to-right, top-to-bottom order:
|
||||
*
|
||||
@@ -22,32 +39,170 @@ export interface QuadtreeLeaf<T> {
|
||||
*
|
||||
* A child quadrant may be undefined if it is empty.
|
||||
*/
|
||||
export interface QuadtreeInternalNode<T> extends Array<QuadtreeInternalNode<T> | QuadtreeLeaf<T> | undefined> { }
|
||||
export interface QuadtreeInternalNode<T> extends Array<QuadtreeInternalNode<T> | QuadtreeLeaf<T> | undefined> {
|
||||
/**
|
||||
* The length property may be used to distinguish leaf nodes from internal nodes: it is undefined for leaf nodes, and 4 for internal nodes.
|
||||
*/
|
||||
length: 4;
|
||||
}
|
||||
|
||||
export interface Quadtree<T> {
|
||||
/**
|
||||
* Returns the current x-accessor, which defaults to: `x(d) => d[0]`.
|
||||
*/
|
||||
x(): (d: T) => number;
|
||||
/**
|
||||
* Sets the current x-coordinate accessor and returns the quadtree.
|
||||
* The x-accessors must be consistent, returning the same value given the same input.
|
||||
*
|
||||
* @param x The x-coordinate accessor.
|
||||
*/
|
||||
x(x: (d: T) => number): this;
|
||||
|
||||
/**
|
||||
* Returns the current y-accessor, which defaults to: `y(d) => d[1]`.
|
||||
*/
|
||||
y(): (d: T) => number;
|
||||
/**
|
||||
* Sets the current y-coordinate accessor and returns the quadtree.
|
||||
* The y-accessors must be consistent, returning the same value given the same input.
|
||||
*
|
||||
* @param y The y-coordinate accessor.
|
||||
*/
|
||||
y(y: (d: T) => number): this;
|
||||
|
||||
/**
|
||||
* Returns the quadtree's current extent `[[x0, y0], [x1, y1]]`,
|
||||
* where `x0` and `y0` are the inclusive lower bounds and `x1` and `y1` are the inclusive upper bounds,
|
||||
* or `undefined` if the quadtree has no extent.
|
||||
*/
|
||||
extent(): [[number, number], [number, number]] | undefined;
|
||||
/**
|
||||
* Expands the quadtree to cover the specified points `[[x0, y0], [x1, y1]]` and returns the quadtree.
|
||||
* The extent may also be expanded by calling `quadtree.cover` or `quadtree.add`.
|
||||
*
|
||||
* @param extend The specified points to cover.
|
||||
*/
|
||||
extent(extend: [[number, number], [number, number]]): this;
|
||||
|
||||
/**
|
||||
* Expands the quadtree to cover the specified point ⟨x,y⟩, and returns the quadtree.
|
||||
* * If the quadtree’s extent already covers the specified point, this method does nothing.
|
||||
* * If the quadtree has an extent, the extent is repeatedly doubled to cover the specified point, wrapping the root node as necessary.
|
||||
* * If the quadtree is empty, the extent is initialized to the extent `[[⌊x⌋, ⌊y⌋], [⌈x⌉, ⌈y⌉]]`.
|
||||
* Rounding is necessary such that if the extent is later doubled, the boundaries of existing quadrants do not change due to floating point error.
|
||||
*
|
||||
* @param x The x-coordinate for the specified point to cover.
|
||||
* @param y The y-coordinate for the specified point to cover.
|
||||
*/
|
||||
cover(x: number, y: number): this;
|
||||
|
||||
/**
|
||||
* Adds the specified datum to the quadtree, deriving its coordinates ⟨x,y⟩ using the current x- and y-accessors, and returns the quadtree.
|
||||
* If the new point is outside the current extent of the quadtree, the quadtree is automatically expanded to cover the new point.
|
||||
*
|
||||
* @param datum The specified datum to add.
|
||||
*/
|
||||
add(datum: T): this;
|
||||
|
||||
/**
|
||||
* Adds the specified array of data to the quadtree, deriving each element’s coordinates ⟨x,y⟩ using the current x- and y-accessors, and return this quadtree.
|
||||
* This is approximately equivalent to calling quadtree.add repeatedly.
|
||||
* However, this method results in a more compact quadtree because the extent of the data is computed first before adding the data.
|
||||
*
|
||||
* @param data The specified array of data to add.
|
||||
*/
|
||||
addAll(data: T[]): this;
|
||||
|
||||
/**
|
||||
* Removes the specified datum to the quadtree, deriving its coordinates ⟨x,y⟩ using the current x- and y-accessors, and returns the quadtree.
|
||||
* If the specified datum does not exist in this quadtree, this method does nothing.
|
||||
*
|
||||
* @param datum The specified datum to remove.
|
||||
*/
|
||||
remove(datum: T): this;
|
||||
|
||||
/**
|
||||
* Removes the specified data to the quadtree, deriving their coordinates ⟨x,y⟩ using the current x- and y-accessors, and returns the quadtree.
|
||||
* If a specified datum does not exist in this quadtree, it is ignored.
|
||||
*
|
||||
* @param data The specified array of data to remove.
|
||||
*/
|
||||
removeAll(data: T[]): this;
|
||||
|
||||
/**
|
||||
* Returns a copy of the quadtree. All nodes in the returned quadtree are identical copies of the corresponding node in the quadtree;
|
||||
* however, any data in the quadtree is shared by reference and not copied.
|
||||
*/
|
||||
copy(): Quadtree<T>;
|
||||
|
||||
/**
|
||||
* Returns the root node of the quadtree.
|
||||
*/
|
||||
root(): QuadtreeInternalNode<T> | QuadtreeLeaf<T>;
|
||||
|
||||
/**
|
||||
* Returns an array of all data in the quadtree.
|
||||
*/
|
||||
data(): T[];
|
||||
|
||||
/**
|
||||
* Returns the total number of data in the quadtree.
|
||||
*/
|
||||
size(): number;
|
||||
|
||||
/**
|
||||
* Returns the datum closest to the position ⟨x,y⟩ with the given search radius. If radius is not specified, it defaults to infinity.
|
||||
* If there is no datum within the search area, returns undefined.
|
||||
*
|
||||
* @param x The x-coordinate for the search position.
|
||||
* @param y The y-coordinate for the search position.
|
||||
* @param radius The optional search radius.
|
||||
*/
|
||||
find(x: number, y: number, radius?: number): T | undefined;
|
||||
// TODO: Review below, when validating to strictNullChecks.
|
||||
// tslint:disable-next-line:void-return
|
||||
visit(callback: (node: QuadtreeInternalNode<T> | QuadtreeLeaf<T>, x0: number, y0: number, x1: number, y1: number) => (void | boolean)): this;
|
||||
|
||||
/**
|
||||
* Visits each node in the quadtree in pre-order traversal, invoking the specified callback with arguments `node`, `x0`, `y0`, `x1`, `y1` for each node,
|
||||
* where `node` is the node being visited, ⟨x0, y0⟩ are the lower bounds of the node, and ⟨x1, y1⟩ are the upper bounds, and returns the quadtree.
|
||||
*
|
||||
* If the callback returns true for a given node, then the children of that node are not visited; otherwise, all child nodes are visited.
|
||||
* This can be used to quickly visit only parts of the tree.
|
||||
* Note, however, that child quadrants are always visited in sibling order: top-left, top-right, bottom-left, bottom-right.
|
||||
* In cases such as search, visiting siblings in a specific order may be faster.
|
||||
*
|
||||
* @param callback The callback invoked for each node.
|
||||
*/
|
||||
visit(callback: (node: QuadtreeInternalNode<T> | QuadtreeLeaf<T>, x0: number, y0: number, x1: number, y1: number) => void | boolean): this;
|
||||
|
||||
/**
|
||||
* Visits each node in the quadtree in post-order traversal, invoking the specified callback with arguments `node`, `x0`, `y0`, `x1`, `y1` for each node,
|
||||
* where `node` is the node being visited, ⟨x0, y0⟩ are the lower bounds of the node, and ⟨x1, y1⟩ are the upper bounds, and returns the quadtree.
|
||||
*
|
||||
* @param callback The callback invoked for each node.
|
||||
*/
|
||||
visitAfter(callback: (node: QuadtreeInternalNode<T> | QuadtreeLeaf<T>, x0: number, y0: number, x1: number, y1: number) => void): this;
|
||||
}
|
||||
|
||||
export function quadtree(): Quadtree<[number, number]>;
|
||||
export function quadtree(data: Array<[number, number]>): Quadtree<[number, number]>;
|
||||
export function quadtree<T>(): Quadtree<T>;
|
||||
export function quadtree<T>(data: T[], x?: (d: T) => number, y?: (d: T) => number): Quadtree<T>;
|
||||
/**
|
||||
* Creates a new, empty quadtree with an empty extent and the default x- and y-accessors.
|
||||
*
|
||||
* The generic refers to the data type. If omitted, the default setting assumes that,
|
||||
* the data used with the quadtree are two-element arrays.
|
||||
* The first element corresponds to the x-dimension, the second to the y-dimension.
|
||||
* When using another type, The x- and y-accessors must be specified.
|
||||
*/
|
||||
export function quadtree<T = [number, number]>(): Quadtree<T>;
|
||||
/**
|
||||
* Creates a new quadtree with the specified array of data.
|
||||
* If `x` and `y` are also specified, sets the x- and y- accessors to the specified functions before adding the specified array of data to the quadtree, otherwise use the default x- and y-accessors.
|
||||
*
|
||||
* The generic refers to the data type. If omitted, the default setting assumes that,
|
||||
* the data used with the quadtree are two-element arrays.
|
||||
* The first element corresponds to the x-dimension, the second to the y-dimension.
|
||||
* When using another type, The x- and y-accessors must be specified.
|
||||
*
|
||||
* @param data The specified array of data to add.
|
||||
* @param x The x-coordinate accessor.
|
||||
* @param y The y-coordinate accessor.
|
||||
*/
|
||||
export function quadtree<T = [number, number]>(data: T[], x?: (d: T) => number, y?: (d: T) => number): Quadtree<T>;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
|
||||
Vendored
+15
-14
@@ -3,13 +3,14 @@
|
||||
// Definitions by: Angel Merino <https://github.com/angelmerino>
|
||||
// Max Rumpf <https://github.com/Maxr1998>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="node" />
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
/** Declaration file generated by dts-gen */
|
||||
|
||||
export class Advertisement {
|
||||
export class Advertisement extends EventEmitter {
|
||||
constructor(type: string | string[] | ServiceType, port: number, ...args: any[]);
|
||||
|
||||
start(): Advertisement;
|
||||
@@ -43,7 +44,7 @@ export class Service {
|
||||
}
|
||||
|
||||
export class ServiceType {
|
||||
constructor(...args: string[])
|
||||
constructor(...args: Array<string | string[]>)
|
||||
constructor(args: ServiceType);
|
||||
|
||||
name: string;
|
||||
@@ -60,29 +61,29 @@ export class ServiceType {
|
||||
}
|
||||
|
||||
export class Browser extends EventEmitter {
|
||||
constructor(type: any, ...args: any[]);
|
||||
constructor(type: string | string[] | ServiceType, ...args: any[]);
|
||||
|
||||
list(): any;
|
||||
start(): Browser;
|
||||
|
||||
start(): any;
|
||||
stop(): void;
|
||||
|
||||
stop(): any;
|
||||
list(): any[];
|
||||
}
|
||||
|
||||
export const resolveA: any;
|
||||
export function resolve(name: string, type: string, args: object): Promise<any>;
|
||||
|
||||
export const resolveAAAA: any;
|
||||
export function resolve4(name: string, type: string, args: object): Promise<string>;
|
||||
|
||||
export function all(): ServiceType;
|
||||
export function resolve6(name: string, type: string, args: object): Promise<string>;
|
||||
|
||||
export function resolve(name: any, type: any, ...args: any[]): any;
|
||||
export function resolveSRV(name: string, args: object): Promise<any>;
|
||||
|
||||
export function resolveSRV(name: any, opts: any): any;
|
||||
export function resolveTXT(name: string, args: object): Promise<any>;
|
||||
|
||||
export function resolveService(name: any, ...args: any[]): any;
|
||||
|
||||
export function resolveTXT(name: any, opts: any): any;
|
||||
export function resolveService(name: string, args: object): Promise<any>;
|
||||
|
||||
export function tcp(...args: string[]): ServiceType;
|
||||
|
||||
export function udp(...args: string[]): ServiceType;
|
||||
|
||||
export function all(): ServiceType;
|
||||
|
||||
Vendored
+3
-3
@@ -60,11 +60,11 @@ interface Element extends ParentNode {
|
||||
matches(selectors: string): boolean;
|
||||
}
|
||||
|
||||
interface Elements extends ElementTraversal, ParentNode, Array<Element> {
|
||||
interface Elements extends ParentNode, Array<Element> {
|
||||
}
|
||||
|
||||
interface Document extends ElementTraversal, ParentNode {
|
||||
interface Document extends ParentNode {
|
||||
}
|
||||
|
||||
interface DocumentFragment extends ElementTraversal, ParentNode {
|
||||
interface DocumentFragment extends ParentNode {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { sprintf, fprintf, printf } from "extsprintf";
|
||||
|
||||
fprintf({write: (s: string) => {}}, '');
|
||||
fprintf({write: (s: string) => {}}, '', {}, [], null, 0, '');
|
||||
printf('');
|
||||
printf('', {}, [], null, 0, '');
|
||||
sprintf(''); // $ExpectType string
|
||||
sprintf('', {}, [], null, 0, ''); // $ExpectType string
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for extsprintf 1.4
|
||||
// Project: https://github.com/joyent/node-extsprintf#readme
|
||||
// Definitions by: Alex Hankins <https://github.com/AlexHankins>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface Stream {
|
||||
write(str: string): void;
|
||||
}
|
||||
|
||||
export function fprintf(stream: Stream, format: string, ...args: any[]): any;
|
||||
export function printf(format: string, ...args: any[]): any;
|
||||
export function sprintf(format: string, ...args: any[]): string;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"extsprintf-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/pinterest/gestalt
|
||||
// Definitions by: Nicolás Serrano Arévalo <https://github.com/serranoarevalo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ const complexQuery = ds.createQuery('special_namespace', kind)
|
||||
.offset(10);
|
||||
|
||||
// Running queries:
|
||||
const queryCallback: QueryCallback = (err: Error, entities: TestEntity[]) => entities[0][Datastore.KEY];
|
||||
const queryCallback: QueryCallback = (err: Error, entities: TestEntity[]) => entities[0][ds.KEY];
|
||||
|
||||
ds.runQuery(query, queryCallback);
|
||||
ds.runQuery(query, options, queryCallback);
|
||||
|
||||
+10
-11
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/googleapis/nodejs-datastore
|
||||
// Definitions by: Antoine Beauvais-Lacasse <https://github.com/beaulac>
|
||||
// Futa Ogawa <https://github.com/ogawa0071>
|
||||
// Thomas den Hollander <https://github.com/ThomasdenH>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
|
||||
@@ -35,6 +36,15 @@ declare module '@google-cloud/datastore' {
|
||||
import { DatastoreTransaction } from '@google-cloud/datastore/transaction';
|
||||
|
||||
class Datastore extends DatastoreRequest_ {
|
||||
static readonly KEY: unique symbol;
|
||||
static readonly MORE_RESULTS_AFTER_CURSOR: MoreResultsAfterCursor;
|
||||
static readonly MORE_RESULTS_AFTER_LIMIT: MoreResultsAfterLimit;
|
||||
static readonly NO_MORE_RESULTS: NoMoreResults;
|
||||
|
||||
static readonly Query: typeof DatastoreQuery;
|
||||
static readonly DatastoreRequest: typeof DatastoreRequest_;
|
||||
static readonly Transaction: typeof DatastoreTransaction;
|
||||
|
||||
constructor(options?: InitOptions);
|
||||
|
||||
readonly KEY: typeof Datastore.KEY;
|
||||
@@ -80,17 +90,6 @@ declare module '@google-cloud/datastore' {
|
||||
keyFilename?: string;
|
||||
credentials?: object;
|
||||
}
|
||||
|
||||
namespace Datastore {
|
||||
const KEY: unique symbol;
|
||||
const MORE_RESULTS_AFTER_CURSOR: MoreResultsAfterCursor;
|
||||
const MORE_RESULTS_AFTER_LIMIT: MoreResultsAfterLimit;
|
||||
const NO_MORE_RESULTS: NoMoreResults;
|
||||
|
||||
const Query: typeof DatastoreQuery;
|
||||
const DatastoreRequest: typeof DatastoreRequest_;
|
||||
const Transaction: typeof DatastoreTransaction;
|
||||
}
|
||||
}
|
||||
|
||||
declare module '@google-cloud/datastore/entity' {
|
||||
|
||||
Vendored
+1
-1
@@ -83,7 +83,7 @@ declare namespace google {
|
||||
*/
|
||||
export interface Picker {
|
||||
isVisible(): boolean;
|
||||
setCallback():Picker;
|
||||
setCallback(method:Function):Picker;
|
||||
setRelayUrl(url:string):Picker;
|
||||
setVisible(visible:boolean):Picker;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -3130,7 +3130,7 @@ declare namespace Highcharts {
|
||||
* chart's two series to be updated with respective options.
|
||||
* @since 5.0.0
|
||||
*/
|
||||
chartOptions?: ChartOptions;
|
||||
chartOptions?: Options;
|
||||
|
||||
/**
|
||||
* Under which conditions the rule applies.
|
||||
|
||||
@@ -2591,8 +2591,10 @@ function test_ResponsiveOptions() {
|
||||
const responsiveOptions: Highcharts.ResponsiveOptions = <Highcharts.ResponsiveOptions> {
|
||||
rules: [
|
||||
<Highcharts.RulesOptions> {
|
||||
chartOptions: <Highcharts.ChartOptions> {
|
||||
description: 'just a test'
|
||||
chartOptions: <Highcharts.Options> {
|
||||
chart: {
|
||||
description: 'just a test'
|
||||
}
|
||||
},
|
||||
condition: <Highcharts.ConditionOptions> {
|
||||
callback: () => { },
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import * as React from 'react';
|
||||
import * as React from 'react';
|
||||
import * as PropTypes from 'prop-types';
|
||||
|
||||
import hoistNonReactStatics = require('hoist-non-react-statics');
|
||||
|
||||
class A extends React.Component<{x: number, y?: number}> {
|
||||
class A extends React.Component<{ x: number; y?: number | null }> {
|
||||
static a = 'a';
|
||||
|
||||
static propTypes = {
|
||||
m: PropTypes.number.isRequired
|
||||
x: PropTypes.number.isRequired,
|
||||
y: PropTypes.number,
|
||||
};
|
||||
|
||||
getA() {
|
||||
@@ -19,7 +20,7 @@ class B extends React.Component {
|
||||
static b = 'b';
|
||||
|
||||
static propTypes = {
|
||||
n: PropTypes.number.isRequired
|
||||
n: PropTypes.number.isRequired,
|
||||
};
|
||||
|
||||
getB() {
|
||||
@@ -31,13 +32,13 @@ const C = hoistNonReactStatics(A, B);
|
||||
|
||||
C.a !== C.b;
|
||||
|
||||
C.propTypes.m;
|
||||
C.propTypes.x;
|
||||
C.prototype.getA();
|
||||
|
||||
C.propTypes.n; // $ExpectError
|
||||
C.prototype.getB(); // $ExpectError
|
||||
|
||||
<C x={1}/>;
|
||||
<C x={1} />;
|
||||
|
||||
const D = hoistNonReactStatics(A, B, { a: true, b: true });
|
||||
|
||||
|
||||
Vendored
+30
-2
@@ -6,6 +6,7 @@
|
||||
// Ebrahim <https://github.com/br8h>
|
||||
// Shahar Mor <https://github.com/shaharmor>
|
||||
// Whemoon Jang <https://github.com/palindrom615>
|
||||
// Francis Gulotta <https://github.com/reconbot>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -65,10 +66,23 @@ declare namespace IORedis {
|
||||
|
||||
get(key: string, callback: (err: Error, res: string) => void): void;
|
||||
get(key: string): Promise<string>;
|
||||
|
||||
getBuffer(key: string, callback: (err: Error, res: Buffer) => void): void;
|
||||
getBuffer(key: string): Promise<Buffer>;
|
||||
|
||||
set(key: string, value: any, ...args: any[]): any;
|
||||
set(key: string, value: any, expiryMode?: string | any[], time?: number | string, setMode?: number | string): Promise<string>;
|
||||
|
||||
set(key: string, value: any, callback: (err: Error, res: string) => void): void;
|
||||
set(key: string, value: any, setMode: string | any[], callback: (err: Error, res: string) => void): void;
|
||||
set(key: string, value: any, expiryMode: string, time: number | string, callback: (err: Error, res: string) => void): void;
|
||||
set(key: string, value: any, expiryMode: string, time: number | string, setMode: number | string, callback: (err: Error, res: string) => void): void;
|
||||
|
||||
setBuffer(key: string, value: any, expiryMode?: string | any[], time?: number | string, setMode?: number | string): Promise<Buffer>;
|
||||
|
||||
setBuffer(key: string, value: any, callback: (err: Error, res: Buffer) => void): void;
|
||||
setBuffer(key: string, value: any, setMode: string, callback: (err: Error, res: Buffer) => void): void;
|
||||
setBuffer(key: string, value: any, expiryMode: string, time: number, callback: (err: Error, res: Buffer) => void): void;
|
||||
setBuffer(key: string, value: any, expiryMode: string, time: number | string, setMode: number | string, callback: (err: Error, res: Buffer) => void): void;
|
||||
|
||||
setnx(key: string, value: any, callback: (err: Error, res: any) => void): void;
|
||||
setnx(key: string, value: any): Promise<any>;
|
||||
@@ -241,12 +255,16 @@ declare namespace IORedis {
|
||||
|
||||
hset(key: string, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
hset(key: string, field: string, value: any): Promise<0 | 1>;
|
||||
hsetBuffer(key: string, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
hsetBuffer(key: string, field: string, value: any): Promise<Buffer>;
|
||||
|
||||
hsetnx(key: string, field: string, value: any, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
hsetnx(key: string, field: string, value: any): Promise<0 | 1>;
|
||||
|
||||
hget(key: string, field: string, callback: (err: Error, res: string) => void): void;
|
||||
hget(key: string, field: string): Promise<string>;
|
||||
hgetBuffer(key: string, field: string, callback: (err: Error, res: Buffer) => void): void;
|
||||
hgetBuffer(key: string, field: string): Promise<Buffer>;
|
||||
|
||||
hmset(key: string, field: string, value: any, ...args: string[]): Promise<0 | 1>;
|
||||
hmset(key: string, data: any, callback: (err: Error, res: 0 | 1) => void): void;
|
||||
@@ -471,7 +489,15 @@ declare namespace IORedis {
|
||||
get(key: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
getBuffer(key: string, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
|
||||
set(key: string, value: any, ...args: any[]): Pipeline;
|
||||
set(key: string, value: any, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
set(key: string, value: any, setMode: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
set(key: string, value: any, expiryMode: string, time: number, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
set(key: string, value: any, expiryMode: string, time: number, setMode: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
|
||||
setBuffer(key: string, value: any, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
setBuffer(key: string, value: any, setMode: string, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
setBuffer(key: string, value: any, expiryMode: string, time: number, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
setBuffer(key: string, value: any, expiryMode: string, time: number, setMode: string, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
|
||||
setnx(key: string, value: any, callback?: (err: Error, res: any) => void): Pipeline;
|
||||
|
||||
@@ -602,10 +628,12 @@ declare namespace IORedis {
|
||||
zrevrank(key: string, member: string, callback?: (err: Error, res: number) => void): Pipeline;
|
||||
|
||||
hset(key: string, field: string, value: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
hsetBuffer(key: string, field: string, value: any, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
|
||||
hsetnx(key: string, field: string, value: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
hget(key: string, field: string, callback?: (err: Error, res: string) => void): Pipeline;
|
||||
hgetBuffer(key: string, field: string, callback?: (err: Error, res: Buffer) => void): Pipeline;
|
||||
|
||||
hmset(key: string, field: string, value: any, ...args: string[]): Pipeline;
|
||||
hmset(key: string, data: any, callback?: (err: Error, res: 0 | 1) => void): Pipeline;
|
||||
|
||||
@@ -16,7 +16,20 @@ redis.sadd('set', 1, 3, 5, 7);
|
||||
redis.sadd('set', [1, 3, 5, 7]);
|
||||
|
||||
// All arguments are passed directly to the redis server:
|
||||
redis.set('key', '100', 'EX', 10);
|
||||
redis.set('key', '100');
|
||||
redis.set('key', '100', 'XX');
|
||||
redis.set('key', '100', 'PX', 10);
|
||||
redis.set('key', '100', 'EX', 10, 'NX');
|
||||
redis.set('key', '100', 'NX', 'EX', 10);
|
||||
redis.set('key', '100', ['EX', 10, 'NX']);
|
||||
redis.setBuffer('key', '100', 'NX', 'EX', 10);
|
||||
|
||||
redis.set('key', '100', (err, data) => {});
|
||||
redis.set('key', '100', 'XX', (err, data) => {});
|
||||
redis.set('key', '100', 'PX', 10, (err, data) => {});
|
||||
redis.set('key', '100', 'EX', 10, 'NX', (err, data) => {});
|
||||
redis.set('key', '100', ['EX', 10, 'NX'], (err, data) => {});
|
||||
redis.setBuffer('key', '100', 'NX', 'EX', 10, (err, data) => {});
|
||||
|
||||
new Redis(); // Connect to 127.0.0.1:6379
|
||||
new Redis(6380); // 127.0.0.1:6380
|
||||
@@ -59,6 +72,10 @@ redis.on('messageBuffer', (channel: any, message: any) => {
|
||||
const pipeline = redis.pipeline();
|
||||
pipeline.set('foo', 'bar');
|
||||
pipeline.del('cc');
|
||||
pipeline.hset('hash', 'foo', 4);
|
||||
pipeline.hget('hash', 'foo');
|
||||
pipeline.hsetBuffer('hash', 'fooBuffer', 4);
|
||||
pipeline.hgetBuffer('hash', 'fooBuffer');
|
||||
pipeline.exec((err, results) => {
|
||||
// `err` is always null, and `results` is an array of responses
|
||||
// corresponding to the sequence of queued commands.
|
||||
|
||||
Vendored
+11
@@ -698,6 +698,17 @@ declare namespace JQueryUI {
|
||||
value?: number;
|
||||
values?: number[];
|
||||
highlight?: boolean;
|
||||
classes? : SliderClasses;
|
||||
}
|
||||
|
||||
interface SliderClasses {
|
||||
"ui-slider"?: string;
|
||||
"ui-slider-horizontal"?: string;
|
||||
"ui-slider-vertical"?: string;
|
||||
"ui-slider-handle"?: string;
|
||||
"ui-slider-range"?: string;
|
||||
"ui-slider-range-min"?: string;
|
||||
"ui-slider-range-max"?: string;
|
||||
}
|
||||
|
||||
interface SliderUIParams {
|
||||
|
||||
@@ -1599,6 +1599,7 @@ function test_slider() {
|
||||
$(".selector").slider({ step: 5 });
|
||||
$(".selector").slider({ value: 10 });
|
||||
$(".selector").slider({ values: [10, 25] });
|
||||
$(".selector").slider({ classes: { "ui-slider": "custom", "ui-slider-handle": "custom-handle" } } );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Vendored
+1
@@ -1081,6 +1081,7 @@ declare namespace kendo.data {
|
||||
query(options?: any): JQueryPromise<any>;
|
||||
read(data?: any): JQueryPromise<any>;
|
||||
remove(model: kendo.data.ObservableObject): void;
|
||||
skip(): number;
|
||||
sort(sort: DataSourceSortItem): void;
|
||||
sort(sort: DataSourceSortItem[]): void;
|
||||
sort(): DataSourceSortItem[];
|
||||
|
||||
Vendored
+4
-4
@@ -5,7 +5,7 @@
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as fs from "fs";
|
||||
import { Stats } from "fs";
|
||||
import { Readable, ReadableOptions } from 'stream';
|
||||
|
||||
declare function K(root: string, options?: K.Options): K.Walker;
|
||||
@@ -13,16 +13,16 @@ declare function K(root: string, options?: K.Options): K.Walker;
|
||||
declare namespace K {
|
||||
interface Item {
|
||||
path: string;
|
||||
stats: fs.Stats;
|
||||
stats: Stats;
|
||||
}
|
||||
|
||||
type QueueMethod = "shift" | "pop";
|
||||
|
||||
interface Options extends ReadableOptions {
|
||||
queueMethod?: QueueMethod;
|
||||
pathSorter?: (pathA: string, pathB: string) => number;
|
||||
pathSorter?(pathA: string, pathB: string): number;
|
||||
fs?: any; // fs or mock-fs
|
||||
filter?: (path: string) => boolean;
|
||||
filter?(path: string): boolean;
|
||||
}
|
||||
|
||||
type Event = "close" | "data" | "end" | "readable" | "error";
|
||||
|
||||
Vendored
+92
@@ -0,0 +1,92 @@
|
||||
// Type definitions for MarkdownPDF (markdown-pdf) 9.0
|
||||
// Project: https://github.com/alanshaw/markdown-pdf
|
||||
// Definitions by: Ange PICARD <https://github.com/MonsieurMan>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = MarkdownPDF;
|
||||
|
||||
declare function MarkdownPDF(options?: MarkdownPDF.Options): MarkdownPDF.OptionsBuilder;
|
||||
|
||||
declare namespace MarkdownPDF {
|
||||
/** Configuration options */
|
||||
interface Options {
|
||||
/** Current working directory. */
|
||||
cwd?: string;
|
||||
/** Path to the phantomjs library. */
|
||||
phantomPath?: string;
|
||||
/** Path to custom CSS file, relative to current directory. */
|
||||
cssPath?: string;
|
||||
/** Path to custorm highlight CSS file (for code highlighting with highlight.js), relative to the current directory. */
|
||||
highlightCssPath?: string;
|
||||
/** Path to CommonJS module which sets the page header and footer (see runnings.js). */
|
||||
runningsPath?: string;
|
||||
/** Delay (in ms) before the PDF is rendered. */
|
||||
renderDelay?: number;
|
||||
/** If renderDelay option isn't set, this is the timeout (in ms) before the page is rendered in case the page.onLoadFinished event doesn't fire. */
|
||||
loadTimeout?: number;
|
||||
/** Supported dimension units are: 'mm', 'cm', 'in', 'px' */
|
||||
paperBorder?: string;
|
||||
paperFormat?: PaperFormat;
|
||||
paperOrientation?: PaperOrientation;
|
||||
/** A function that returns a through2 stream that transforms the markdown before it is converted to HTML. */
|
||||
preProcessMd?: () => any;
|
||||
/** A function that returns a through2 stream that transforms the HTML before it is converted to PDF. */
|
||||
preProcessHtml?: () => any;
|
||||
/** A config object that is passed to remarkable, the underlying markdown parser */
|
||||
remarkable?: any; // FIXME: remarkable config types
|
||||
}
|
||||
type PaperFormat = "A3" | "A4" | "A5" | "Legal" | "Letter" | "Tabloid";
|
||||
type PaperOrientation = "portait" | "landscape";
|
||||
|
||||
interface OptionsBuilder {
|
||||
/** Create a readable stream and pipe it to markdown pdf. */
|
||||
from: FromOptionsBuilder & FromFunction;
|
||||
/** Concatenates stream and pipe them to markdown pdf. */
|
||||
concat: ConcatOptionsBuilder;
|
||||
}
|
||||
|
||||
type FromFunction =
|
||||
/** Create a readable stream from path and pipe to markdown-pdf. path can be a single path or array of paths. */
|
||||
(path: string | string[]) => ToOptionsBuilder;
|
||||
interface FromOptionsBuilder {
|
||||
/** Create a readable stream from string and pipe to markdown-pdf. string can be a single string or array of strings. */
|
||||
string(markdown: string | string[]): ToOptionsBuilder;
|
||||
/** Create a readable stream from path and pipe to markdown-pdf. path can be a single path or array of paths. */
|
||||
path(path: string | string[], opts: any): ToOptionsBuilder;
|
||||
}
|
||||
|
||||
interface ConcatOptionsBuilder {
|
||||
from: ConcatFromOptionsBuilder;
|
||||
}
|
||||
interface ConcatFromOptionsBuilder {
|
||||
/** Create and concatenate readable streams from strings and pipe to markdown-pdf. */
|
||||
strings(markdownTexts: string[], opts: any): ToOptionsBuilder;
|
||||
/** Create and concatenate readable streams from paths and pipe to markdown-pdf. */
|
||||
paths(paths: string[], opts: any): ToOptionsBuilder;
|
||||
}
|
||||
|
||||
interface ToOptionsBuilder {
|
||||
to: ToBuilder & ToFunction;
|
||||
}
|
||||
|
||||
interface ToBuilder {
|
||||
/**
|
||||
* Create a writeable stream to path and pipe output from markdown-pdf to it.
|
||||
* path can be a single path, or array of output paths if you specified an array of inputs.
|
||||
* The callback function cb will be invoked when data has finished being written.
|
||||
*/
|
||||
path(path: string, callback?: () => void): void;
|
||||
/** Create a concat-stream and pipe output from markdown-pdf to it. The callback function cb will be invoked when the buffer has been created. */
|
||||
buffer(opts: any, callback?: () => void): void;
|
||||
/** Create a concat-stream and pipe output from markdown-pdf to it. The callback function cb will be invoked when the string has been created. */
|
||||
string(opts: any, callback?: () => void): void;
|
||||
}
|
||||
|
||||
type ToFunction =
|
||||
/**
|
||||
* Create a writeable stream to path and pipe output from markdown-pdf to it.
|
||||
* path can be a single path, or array of output paths if you specified an array of inputs.
|
||||
* The callback function cb will be invoked when data has finished being written.
|
||||
*/
|
||||
(path: string, callback?: () => void) => void;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import mdPdf = require('markdown-pdf');
|
||||
|
||||
mdPdf().from('path').to('path', () => { }); // $ExpectType void
|
||||
mdPdf().from.string('markdown').to('path', () => { }); // $ExpectType void
|
||||
mdPdf({ paperOrientation: 'landscape', paperFormat: 'A3' }).from('lol').to('lol', () => { }); // $ExpectType void
|
||||
mdPdf().concat.from.paths(['lol', 'lol'], {}).to('path', () => { }); // $ExpectType void
|
||||
mdPdf().concat.from.strings(['lol', 'lol'], {}).to('path', () => { }); // $ExpectType void
|
||||
mdPdf().from('path').to.path('path', () => { }); // $ExpectType void
|
||||
mdPdf().from('path').to('path'); // $ExpectType void
|
||||
|
||||
mdPdf({ paperFormat: 'wrongFormat' }); // $ExpectError
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"markdown-pdf-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Vendored
+8
-8
@@ -66,12 +66,12 @@ export interface CornerBit extends MDCNumbers {
|
||||
* Likewise END maps to RIGHT or LEFT depending on the directionality.
|
||||
*/
|
||||
export interface Corner extends MDCNumbers {
|
||||
TOP_LEFT: 0;
|
||||
TOP_RIGHT: CornerBit["RIGHT"];
|
||||
BOTTOM_LEFT: CornerBit["BOTTOM"];
|
||||
BOTTOM_RIGHT: CornerBit["BOTTOM"] | CornerBit["RIGHT"];
|
||||
TOP_START: CornerBit["FLIP_RTL"];
|
||||
TOP_END: CornerBit["FLIP_RTL"] | CornerBit["RIGHT"];
|
||||
BOTTOM_START: CornerBit["BOTTOM"] | CornerBit["FLIP_RTL"];
|
||||
BOTTOM_END: CornerBit["BOTTOM"] | CornerBit["RIGHT"] | CornerBit["FLIP_RTL"];
|
||||
TOP_LEFT: 0;
|
||||
TOP_RIGHT: 4;
|
||||
BOTTOM_LEFT: 1;
|
||||
BOTTOM_RIGHT: 5;
|
||||
TOP_START: 8;
|
||||
TOP_END: 12;
|
||||
BOTTOM_START: 9;
|
||||
BOTTOM_END: 13;
|
||||
}
|
||||
|
||||
+17
-34
@@ -748,16 +748,14 @@ function test_reporter_string(localMocha: LocalMocha) {
|
||||
// $ExpectType BrowserMocha
|
||||
mocha.reporter('html');
|
||||
|
||||
// $ExpectType Mocha
|
||||
localMocha.reporter('html');
|
||||
const m: Mocha = localMocha.reporter('html');
|
||||
}
|
||||
|
||||
function test_reporter_function(localMocha: LocalMocha) {
|
||||
// $ExpectType BrowserMocha
|
||||
mocha.reporter(class extends LocalMocha.reporters.Base { });
|
||||
|
||||
// $ExpectType Mocha
|
||||
localMocha.reporter(class extends LocalMocha.reporters.Base { });
|
||||
const m: Mocha = localMocha.reporter(class extends LocalMocha.reporters.Base { });
|
||||
}
|
||||
|
||||
function test_browser_mocha_setup_slow_option() {
|
||||
@@ -836,63 +834,51 @@ function test_browser_mocha_setup_all_options() {
|
||||
}
|
||||
|
||||
function test_constructor_slow_option() {
|
||||
// $ExpectType Mocha
|
||||
new LocalMocha({ slow: 25 });
|
||||
const m: Mocha = new LocalMocha({ slow: 25 });
|
||||
}
|
||||
|
||||
function test_constructor_timeout_option() {
|
||||
// $ExpectType Mocha
|
||||
new LocalMocha({ timeout: 25 });
|
||||
const m: Mocha = new LocalMocha({ timeout: 25 });
|
||||
}
|
||||
|
||||
function test_constructor_globals_option() {
|
||||
// $ExpectType Mocha
|
||||
new LocalMocha({ globals: ['mocha'] });
|
||||
const m: Mocha = new LocalMocha({ globals: ['mocha'] });
|
||||
}
|
||||
|
||||
function test_constructor_ui_option() {
|
||||
// $ExpectType Mocha
|
||||
new LocalMocha({ ui: 'bdd' });
|
||||
const m: Mocha = new LocalMocha({ ui: 'bdd' });
|
||||
}
|
||||
|
||||
function test_constructor_reporter_string_option() {
|
||||
// $ExpectType Mocha
|
||||
new LocalMocha({ reporter: 'html' });
|
||||
const m: Mocha = new LocalMocha({ reporter: 'html' });
|
||||
}
|
||||
|
||||
function test_constructor_reporter_function_option() {
|
||||
// $ExpectType Mocha
|
||||
new LocalMocha({ reporter: class extends LocalMocha.reporters.Base { } });
|
||||
const m: Mocha = new LocalMocha({ reporter: class extends LocalMocha.reporters.Base { } });
|
||||
}
|
||||
|
||||
function test_constructor_bail_option() {
|
||||
// $ExpectType Mocha
|
||||
new LocalMocha({ bail: false });
|
||||
const m: Mocha = new LocalMocha({ bail: false });
|
||||
}
|
||||
|
||||
function test_constructor_ignore_leaks_option() {
|
||||
// $ExpectType Mocha
|
||||
new LocalMocha({ ignoreLeaks: false });
|
||||
const m: Mocha = new LocalMocha({ ignoreLeaks: false });
|
||||
}
|
||||
|
||||
function test_constructor_grep_string_option() {
|
||||
// $ExpectType Mocha
|
||||
new LocalMocha({ grep: "describe" });
|
||||
const m: Mocha = new LocalMocha({ grep: "describe" });
|
||||
}
|
||||
|
||||
function test_constructor_grep_regex_option() {
|
||||
// $ExpectType Mocha
|
||||
new LocalMocha({ grep: new RegExp('describe') });
|
||||
const m: Mocha = new LocalMocha({ grep: new RegExp('describe') });
|
||||
}
|
||||
|
||||
function test_constructor_grep_regex_literal_option() {
|
||||
// $ExpectType Mocha
|
||||
new LocalMocha({ grep: /(expect|should)/i });
|
||||
const m: Mocha = new LocalMocha({ grep: /(expect|should)/i });
|
||||
}
|
||||
|
||||
function test_constructor_all_options() {
|
||||
// $ExpectType Mocha
|
||||
new LocalMocha({
|
||||
const m: Mocha = new LocalMocha({
|
||||
slow: 25,
|
||||
timeout: 25,
|
||||
ui: 'bdd',
|
||||
@@ -1154,8 +1140,7 @@ function test_suite_events(suite: LocalMocha.Suite) {
|
||||
context;
|
||||
// $ExpectType string
|
||||
file;
|
||||
// $ExpectType Mocha
|
||||
mocha;
|
||||
const m: Mocha = mocha;
|
||||
});
|
||||
|
||||
// $ExpectType Suite
|
||||
@@ -1164,8 +1149,7 @@ function test_suite_events(suite: LocalMocha.Suite) {
|
||||
module;
|
||||
// $ExpectType string
|
||||
file;
|
||||
// $ExpectType Mocha
|
||||
mocha;
|
||||
const m: Mocha = mocha;
|
||||
});
|
||||
|
||||
// $ExpectType Suite
|
||||
@@ -1174,8 +1158,7 @@ function test_suite_events(suite: LocalMocha.Suite) {
|
||||
context;
|
||||
// $ExpectType string
|
||||
file;
|
||||
// $ExpectType Mocha
|
||||
mocha;
|
||||
const m: Mocha = mocha;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
@@ -2983,6 +2983,8 @@ declare module "mongoose" {
|
||||
rawResult?: boolean;
|
||||
/** overwrites the schema's strict mode option for this update */
|
||||
strict?: boolean;
|
||||
/** The context option lets you set the value of this in update validators to the underlying query. */
|
||||
context?: string;
|
||||
}
|
||||
|
||||
interface ModelFindOneAndUpdateOptions extends ModelFindByIdAndUpdateOptions {
|
||||
|
||||
Vendored
+30
-33
@@ -26,6 +26,7 @@
|
||||
// Lishude <https://github.com/islishude>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Zane Hannan AU <https://github.com/ZaneHannanAU>
|
||||
// Eugene Y. Q. Shen <https://github.com/eyqs>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** inspector module types */
|
||||
@@ -5862,8 +5863,8 @@ declare module "crypto" {
|
||||
export interface Signer extends NodeJS.WritableStream {
|
||||
update(data: string | Buffer | NodeJS.TypedArray | DataView): Signer;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer;
|
||||
sign(private_key: string | { key: string; passphrase: string }): Buffer;
|
||||
sign(private_key: string | { key: string; passphrase: string }, output_format: HexBase64Latin1Encoding): string;
|
||||
sign(private_key: string | { key: string; passphrase: string, padding?: number, saltLength?: number }): Buffer;
|
||||
sign(private_key: string | { key: string; passphrase: string, padding?: number, saltLength?: number }, output_format: HexBase64Latin1Encoding): string;
|
||||
}
|
||||
export function createVerify(algorith: string, options?: stream.WritableOptions): Verify;
|
||||
export interface Verify extends NodeJS.WritableStream {
|
||||
@@ -6381,7 +6382,7 @@ declare module "util" {
|
||||
}
|
||||
|
||||
declare module "assert" {
|
||||
function internal(value: any, message?: string): void;
|
||||
function internal(value: any, message?: string | Error): void;
|
||||
namespace internal {
|
||||
export class AssertionError implements Error {
|
||||
name: string;
|
||||
@@ -6390,46 +6391,42 @@ declare module "assert" {
|
||||
expected: any;
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
code: 'ERR_ASSERTION';
|
||||
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(message: string): never;
|
||||
/** @deprecated since v10.0.0 */
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string): never;
|
||||
export function ok(value: any, message?: string): void;
|
||||
/** @deprecated use strictEqual() */
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
/** @deprecated use notStrictEqual() */
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
/** @deprecated use deepStrictEqual() */
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
/** @deprecated use notDeepStrictEqual() */
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function fail(message?: string | Error): never;
|
||||
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
|
||||
export function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
|
||||
export function ok(value: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use strictEqual() instead. */
|
||||
export function equal(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use notStrictEqual() instead. */
|
||||
export function notEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
|
||||
export function deepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp, message?: string): void;
|
||||
export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
export function throws(block: Function, message?: string | Error): void;
|
||||
export function throws(block: Function, error: RegExp | Function | Object | Error, message?: string | Error): void;
|
||||
export function doesNotThrow(block: Function, message?: string | Error): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string | Error): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
|
||||
export function rejects(block: Function | Promise<any>, message?: string): Promise<void>;
|
||||
export function rejects(block: Function | Promise<any>, error: Function | RegExp | Object | Error, message?: string): Promise<void>;
|
||||
export function doesNotReject(block: Function | Promise<any>, message?: string): Promise<void>;
|
||||
export function doesNotReject(block: Function | Promise<any>, error: Function | RegExp | Object | Error, message?: string): Promise<void>;
|
||||
export function rejects(block: Function | Promise<any>, message?: string | Error): Promise<void>;
|
||||
export function rejects(block: Function | Promise<any>, error: RegExp | Function | Object | Error, message?: string | Error): Promise<void>;
|
||||
export function doesNotReject(block: Function | Promise<any>, message?: string | Error): Promise<void>;
|
||||
export function doesNotReject(block: Function | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
|
||||
|
||||
export var strict: typeof internal;
|
||||
}
|
||||
|
||||
Vendored
+42
-48
@@ -573,42 +573,42 @@ declare module "http" {
|
||||
*/
|
||||
export interface ClientResponse extends IncomingMessage { }
|
||||
|
||||
export interface AgentOptions {
|
||||
/**
|
||||
* Keep sockets around in a pool to be used by other requests in the future. Default = false
|
||||
*/
|
||||
keepAlive?: boolean;
|
||||
/**
|
||||
* When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
|
||||
* Only relevant if keepAlive is set to true.
|
||||
*/
|
||||
keepAliveMsecs?: number;
|
||||
/**
|
||||
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
|
||||
*/
|
||||
maxSockets?: number;
|
||||
/**
|
||||
* Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
|
||||
*/
|
||||
maxFreeSockets?: number;
|
||||
}
|
||||
export interface AgentOptions {
|
||||
/**
|
||||
* Keep sockets around in a pool to be used by other requests in the future. Default = false
|
||||
*/
|
||||
keepAlive?: boolean;
|
||||
/**
|
||||
* When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
|
||||
* Only relevant if keepAlive is set to true.
|
||||
*/
|
||||
keepAliveMsecs?: number;
|
||||
/**
|
||||
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
|
||||
*/
|
||||
maxSockets?: number;
|
||||
/**
|
||||
* Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
|
||||
*/
|
||||
maxFreeSockets?: number;
|
||||
}
|
||||
|
||||
export class Agent {
|
||||
maxFreeSockets: number;
|
||||
maxSockets: number;
|
||||
sockets: any;
|
||||
requests: any;
|
||||
maxFreeSockets: number;
|
||||
maxSockets: number;
|
||||
sockets: any;
|
||||
requests: any;
|
||||
|
||||
constructor(opts?: AgentOptions);
|
||||
constructor(opts?: AgentOptions);
|
||||
|
||||
/**
|
||||
* Destroy any sockets that are currently in use by the agent.
|
||||
* It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
|
||||
* then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
|
||||
* sockets may hang open for quite a long time before the server terminates them.
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
/**
|
||||
* Destroy any sockets that are currently in use by the agent.
|
||||
* It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
|
||||
* then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
|
||||
* sockets may hang open for quite a long time before the server terminates them.
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export var METHODS: string[];
|
||||
|
||||
@@ -1858,7 +1858,7 @@ declare module "util" {
|
||||
}
|
||||
|
||||
declare module "assert" {
|
||||
function internal (value: any, message?: string): void;
|
||||
function internal(value: any, message?: string): void;
|
||||
namespace internal {
|
||||
export class AssertionError implements Error {
|
||||
name: string;
|
||||
@@ -1868,8 +1868,10 @@ declare module "assert" {
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
|
||||
constructor(options?: {message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function});
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(actual?: any, expected?: any, message?: string, operator?: string): never;
|
||||
@@ -1877,22 +1879,14 @@ declare module "assert" {
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export var throws: {
|
||||
(block: Function, message?: string): void;
|
||||
(block: Function, error: Function, message?: string): void;
|
||||
(block: Function, error: RegExp, message?: string): void;
|
||||
(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
};
|
||||
|
||||
export var doesNotThrow: {
|
||||
(block: Function, message?: string): void;
|
||||
(block: Function, error: Function, message?: string): void;
|
||||
(block: Function, error: RegExp, message?: string): void;
|
||||
(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
};
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp | Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
}
|
||||
|
||||
+29
-29
@@ -179,37 +179,37 @@ function stream_readable_pipe_test() {
|
||||
var hmacResult: string = crypto.createHmac('md5', 'hello').update('world').digest('hex');
|
||||
|
||||
function crypto_cipher_decipher_string_test() {
|
||||
var key:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]);
|
||||
var clearText:string = "This is the clear text.";
|
||||
var cipher:crypto.Cipher = crypto.createCipher("aes-128-ecb", key);
|
||||
var cipherText:string = cipher.update(clearText, "utf8", "hex");
|
||||
cipherText += cipher.final("hex");
|
||||
var key:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]);
|
||||
var clearText:string = "This is the clear text.";
|
||||
var cipher:crypto.Cipher = crypto.createCipher("aes-128-ecb", key);
|
||||
var cipherText:string = cipher.update(clearText, "utf8", "hex");
|
||||
cipherText += cipher.final("hex");
|
||||
|
||||
var decipher:crypto.Decipher = crypto.createDecipher("aes-128-ecb", key);
|
||||
var clearText2:string = decipher.update(cipherText, "hex", "utf8");
|
||||
clearText2 += decipher.final("utf8");
|
||||
var decipher:crypto.Decipher = crypto.createDecipher("aes-128-ecb", key);
|
||||
var clearText2:string = decipher.update(cipherText, "hex", "utf8");
|
||||
clearText2 += decipher.final("utf8");
|
||||
|
||||
assert.equal(clearText2, clearText);
|
||||
assert.equal(clearText2, clearText);
|
||||
}
|
||||
|
||||
function crypto_cipher_decipher_buffer_test() {
|
||||
var key:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]);
|
||||
var clearText:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]);
|
||||
var cipher:crypto.Cipher = crypto.createCipher("aes-128-ecb", key);
|
||||
var cipherBuffers:Buffer[] = [];
|
||||
cipherBuffers.push(cipher.update(clearText));
|
||||
cipherBuffers.push(cipher.final());
|
||||
var key:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]);
|
||||
var clearText:Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]);
|
||||
var cipher:crypto.Cipher = crypto.createCipher("aes-128-ecb", key);
|
||||
var cipherBuffers:Buffer[] = [];
|
||||
cipherBuffers.push(cipher.update(clearText));
|
||||
cipherBuffers.push(cipher.final());
|
||||
|
||||
var cipherText:Buffer = Buffer.concat(cipherBuffers);
|
||||
var cipherText:Buffer = Buffer.concat(cipherBuffers);
|
||||
|
||||
var decipher:crypto.Decipher = crypto.createDecipher("aes-128-ecb", key);
|
||||
var decipherBuffers:Buffer[] = [];
|
||||
decipherBuffers.push(decipher.update(cipherText));
|
||||
decipherBuffers.push(decipher.final());
|
||||
var decipher:crypto.Decipher = crypto.createDecipher("aes-128-ecb", key);
|
||||
var decipherBuffers:Buffer[] = [];
|
||||
decipherBuffers.push(decipher.update(cipherText));
|
||||
decipherBuffers.push(decipher.final());
|
||||
|
||||
var clearText2:Buffer = Buffer.concat(decipherBuffers);
|
||||
var clearText2:Buffer = Buffer.concat(decipherBuffers);
|
||||
|
||||
assert.deepEqual(clearText2, clearText);
|
||||
assert.deepEqual(clearText2, clearText);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
@@ -242,14 +242,14 @@ namespace http_tests {
|
||||
var codeMessage = http.STATUS_CODES['400'];
|
||||
var codeMessage = http.STATUS_CODES[400];
|
||||
|
||||
var agent: http.Agent = new http.Agent({
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: 10000,
|
||||
maxSockets: Infinity,
|
||||
maxFreeSockets: 256
|
||||
});
|
||||
var agent: http.Agent = new http.Agent({
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: 10000,
|
||||
maxSockets: Infinity,
|
||||
maxFreeSockets: 256
|
||||
});
|
||||
|
||||
var agent: http.Agent = http.globalAgent;
|
||||
var agent: http.Agent = http.globalAgent;
|
||||
|
||||
http.request('http://www.example.com/xyz');
|
||||
}
|
||||
|
||||
Vendored
+8
-11
@@ -2440,7 +2440,7 @@ declare module "util" {
|
||||
}
|
||||
|
||||
declare module "assert" {
|
||||
function internal (value: any, message?: string): void;
|
||||
function internal(value: any, message?: string): void;
|
||||
namespace internal {
|
||||
export class AssertionError implements Error {
|
||||
name: string;
|
||||
@@ -2450,8 +2450,10 @@ declare module "assert" {
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
|
||||
constructor(options?: {message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function});
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string): never;
|
||||
@@ -2459,21 +2461,16 @@ declare module "assert" {
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp, message?: string): void;
|
||||
export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
|
||||
export function throws(block: Function, error: RegExp | Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
}
|
||||
|
||||
Vendored
+6
-10
@@ -3944,30 +3944,26 @@ declare module "assert" {
|
||||
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string): never;
|
||||
export function fail(message?: string): never;
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string, stackStartFn?: Function): never;
|
||||
export function ok(value: any, message?: string): void;
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp, message?: string): void;
|
||||
export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
|
||||
export function throws(block: Function, error: RegExp | Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
}
|
||||
|
||||
+17
-17
@@ -786,13 +786,13 @@ namespace crypto_tests {
|
||||
let clearText: string = "This is the clear text.";
|
||||
let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key);
|
||||
let cipherText: string = cipher.update(clearText, "utf8", "hex");
|
||||
cipherText += cipher.final("hex");
|
||||
cipherText += cipher.final("hex");
|
||||
|
||||
let decipher: crypto.Decipher = crypto.createDecipher("aes-128-ecb", key);
|
||||
let clearText2: string = decipher.update(cipherText, "hex", "utf8");
|
||||
clearText2 += decipher.final("utf8");
|
||||
clearText2 += decipher.final("utf8");
|
||||
|
||||
assert.equal(clearText2, clearText);
|
||||
assert.equal(clearText2, clearText);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -801,19 +801,19 @@ namespace crypto_tests {
|
||||
let clearText: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]);
|
||||
let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key);
|
||||
let cipherBuffers: Buffer[] = [];
|
||||
cipherBuffers.push(cipher.update(clearText));
|
||||
cipherBuffers.push(cipher.final());
|
||||
cipherBuffers.push(cipher.update(clearText));
|
||||
cipherBuffers.push(cipher.final());
|
||||
|
||||
let cipherText: Buffer = Buffer.concat(cipherBuffers);
|
||||
|
||||
let decipher: crypto.Decipher = crypto.createDecipher("aes-128-ecb", key);
|
||||
let decipherBuffers: Buffer[] = [];
|
||||
decipherBuffers.push(decipher.update(cipherText));
|
||||
decipherBuffers.push(decipher.final());
|
||||
decipherBuffers.push(decipher.update(cipherText));
|
||||
decipherBuffers.push(decipher.final());
|
||||
|
||||
let clearText2: Buffer = Buffer.concat(decipherBuffers);
|
||||
|
||||
assert.deepEqual(clearText2, clearText);
|
||||
assert.deepEqual(clearText2, clearText);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -839,8 +839,8 @@ namespace tls_tests {
|
||||
var blah = ctx.context;
|
||||
|
||||
var connOpts: tls.ConnectionOptions = {
|
||||
host: "127.0.0.1",
|
||||
port: 55
|
||||
host: "127.0.0.1",
|
||||
port: 55
|
||||
};
|
||||
var tlsSocket = tls.connect(connOpts);
|
||||
}
|
||||
@@ -1043,14 +1043,14 @@ namespace http_tests {
|
||||
}
|
||||
|
||||
{
|
||||
var agent: http.Agent = new http.Agent({
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: 10000,
|
||||
maxSockets: Infinity,
|
||||
maxFreeSockets: 256
|
||||
});
|
||||
var agent: http.Agent = new http.Agent({
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: 10000,
|
||||
maxSockets: Infinity,
|
||||
maxFreeSockets: 256
|
||||
});
|
||||
|
||||
var agent: http.Agent = http.globalAgent;
|
||||
var agent: http.Agent = http.globalAgent;
|
||||
|
||||
http.request({ agent: false });
|
||||
http.request({ agent: agent });
|
||||
|
||||
Vendored
+6
-10
@@ -3988,30 +3988,26 @@ declare module "assert" {
|
||||
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string): never;
|
||||
export function fail(message?: string): never;
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string, stackStartFn?: Function): never;
|
||||
export function ok(value: any, message?: string): void;
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp, message?: string): void;
|
||||
export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
|
||||
export function throws(block: Function, error: RegExp | Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
}
|
||||
|
||||
@@ -1025,14 +1025,14 @@ namespace http_tests {
|
||||
}
|
||||
|
||||
{
|
||||
var agent: http.Agent = new http.Agent({
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: 10000,
|
||||
maxSockets: Infinity,
|
||||
maxFreeSockets: 256
|
||||
});
|
||||
var agent: http.Agent = new http.Agent({
|
||||
keepAlive: true,
|
||||
keepAliveMsecs: 10000,
|
||||
maxSockets: Infinity,
|
||||
maxFreeSockets: 256
|
||||
});
|
||||
|
||||
var agent: http.Agent = http.globalAgent;
|
||||
var agent: http.Agent = http.globalAgent;
|
||||
|
||||
http.request({ agent: false });
|
||||
http.request({ agent: agent });
|
||||
@@ -1056,7 +1056,7 @@ namespace http_tests {
|
||||
request.abort();
|
||||
}
|
||||
|
||||
// http request options
|
||||
// http request options
|
||||
{
|
||||
const requestOpts: http.RequestOptions = {
|
||||
timeout: 30000
|
||||
|
||||
Vendored
+7
-11
@@ -5634,34 +5634,30 @@ declare module "assert" {
|
||||
expected: any;
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
code: 'ERR_ASSERTION';
|
||||
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(message: string): never;
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string): never;
|
||||
export function fail(message?: string): never;
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string, stackStartFn?: Function): never;
|
||||
export function ok(value: any, message?: string): void;
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp, message?: string): void;
|
||||
export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
|
||||
export function throws(block: Function, error: RegExp | Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
}
|
||||
|
||||
Vendored
+19
-22
@@ -25,6 +25,7 @@
|
||||
// Alexander T. <https://github.com/a-tarasyuk>
|
||||
// Lishude <https://github.com/islishude>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Eugene Y. Q. Shen <https://github.com/eyqs>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/** inspector module types */
|
||||
@@ -5708,7 +5709,7 @@ declare module "util" {
|
||||
}
|
||||
|
||||
declare module "assert" {
|
||||
function internal(value: any, message?: string): void;
|
||||
function internal(value: any, message?: string | Error): void;
|
||||
namespace internal {
|
||||
export class AssertionError implements Error {
|
||||
name: string;
|
||||
@@ -5717,34 +5718,30 @@ declare module "assert" {
|
||||
expected: any;
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
code: 'ERR_ASSERTION';
|
||||
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFunction?: Function
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
export function fail(message: string): never;
|
||||
export function fail(actual: any, expected: any, message?: string, operator?: string): never;
|
||||
export function ok(value: any, message?: string): void;
|
||||
export function equal(actual: any, expected: any, message?: string): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepEqual(acutal: any, expected: any, message?: string): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;
|
||||
export function fail(message?: string | Error): never;
|
||||
export function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
|
||||
export function ok(value: any, message?: string | Error): void;
|
||||
export function equal(actual: any, expected: any, message?: string | Error): void;
|
||||
export function notEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function deepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function strictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
export function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
|
||||
export function throws(block: Function, message?: string): void;
|
||||
export function throws(block: Function, error: Function, message?: string): void;
|
||||
export function throws(block: Function, error: RegExp, message?: string): void;
|
||||
export function throws(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
|
||||
export function doesNotThrow(block: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: Function, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp, message?: string): void;
|
||||
export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void;
|
||||
export function throws(block: Function, message?: string | Error): void;
|
||||
export function throws(block: Function, error: RegExp | Function, message?: string | Error): void;
|
||||
export function doesNotThrow(block: Function, message?: string | Error): void;
|
||||
export function doesNotThrow(block: Function, error: RegExp | Function, message?: string | Error): void;
|
||||
|
||||
export function ifError(value: any): void;
|
||||
}
|
||||
|
||||
Vendored
+1246
-280
File diff suppressed because it is too large
Load Diff
Vendored
+1
@@ -61,6 +61,7 @@ declare namespace OwlCarousel {
|
||||
dotsContainer?: string | boolean;
|
||||
checkVisible?: boolean;
|
||||
slideTransition?: string;
|
||||
autoHeight?: boolean;
|
||||
// CLASSES
|
||||
refreshClass?: string;
|
||||
loadingClass?: string;
|
||||
|
||||
Vendored
+1
-1
@@ -626,7 +626,7 @@ declare namespace PouchDB {
|
||||
};
|
||||
}
|
||||
|
||||
interface Database<Content extends {} = {}> {
|
||||
interface Database<Content extends {} = {}> extends EventEmitter {
|
||||
/** The name passed to the PouchDB constructor and unique identifier of the database. */
|
||||
name: string;
|
||||
|
||||
|
||||
@@ -114,6 +114,8 @@ function testBasics() {
|
||||
|
||||
const db = new PouchDB<MyModel>();
|
||||
|
||||
db.on("closed", () => {});
|
||||
|
||||
db.post(model).then((result) => {
|
||||
isString(result.id);
|
||||
});
|
||||
|
||||
Vendored
+3
-1
@@ -1,6 +1,7 @@
|
||||
// Type definitions for pretty-ms 3.0
|
||||
// Type definitions for pretty-ms 3.2
|
||||
// Project: https://github.com/sindresorhus/pretty-ms#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// ocboogie <https://github.com/ocboogie>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = prettyMs;
|
||||
@@ -11,6 +12,7 @@ declare namespace prettyMs {
|
||||
interface PrettyMsOptions {
|
||||
secDecimalDigits?: number;
|
||||
msDecimalDigits?: number;
|
||||
keepDecimalsOnWholeSeconds?: boolean;
|
||||
compact?: boolean;
|
||||
verbose?: boolean;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ let str: string;
|
||||
str = prettyMs(133);
|
||||
str = prettyMs(1337, {compact: true});
|
||||
str = prettyMs(1335669000, {verbose: true});
|
||||
str = prettyMs(1335669000, {keepDecimalsOnWholeSeconds: true});
|
||||
str = prettyMs(1335669000, {secDecimalDigits: 1});
|
||||
str = prettyMs(1335669000, {msDecimalDigits: 2});
|
||||
str = prettyMs(new Date(2014, 0, 1, 10, 40).getTime() - new Date(2014, 0, 1, 10, 5).getTime());
|
||||
|
||||
Vendored
+2
@@ -4,6 +4,7 @@
|
||||
// Guillaume <https://github.com/guillaume-ro-fr>
|
||||
// James Garbutt <https://github.com/43081j>
|
||||
// Aniello Falcone <https://github.com/AnielloFalcone>
|
||||
// Mohammad Hossein Amri <https://github.com/mhamri>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Blot } from 'parchment/dist/src/blot/abstract/blot';
|
||||
@@ -42,6 +43,7 @@ export interface KeyboardStatic {
|
||||
}
|
||||
|
||||
export interface ClipboardStatic {
|
||||
convert(html?: string): DeltaStatic;
|
||||
addMatcher(selectorOrNodeType: string|number, callback: (node: any, delta: DeltaStatic) => DeltaStatic): void;
|
||||
dangerouslyPasteHTML(html: string, source?: Sources): void;
|
||||
dangerouslyPasteHTML(index: number, html: string, source?: Sources): void;
|
||||
|
||||
@@ -129,7 +129,7 @@ function test_updateContents() {
|
||||
}));
|
||||
}
|
||||
|
||||
function test_setContents() {
|
||||
function test_setDeltaContents() {
|
||||
const quillEditor = new Quill('#editor');
|
||||
quillEditor.setContents(new Delta({ ops: [
|
||||
{ insert: 'Hello ' },
|
||||
@@ -138,11 +138,19 @@ function test_setContents() {
|
||||
]}));
|
||||
}
|
||||
|
||||
function test_setText() {
|
||||
function test_setTextContents() {
|
||||
const quillEditor = new Quill('#editor');
|
||||
quillEditor.setText('Hello\n');
|
||||
}
|
||||
|
||||
function test_setHtmlContents() {
|
||||
const quillEditor = new Quill('#editor');
|
||||
const html = "<b>this is a bold text</b>";
|
||||
const delta = quillEditor.clipboard.convert(html);
|
||||
quillEditor.setContents(delta);
|
||||
quillEditor.clipboard.convert();
|
||||
}
|
||||
|
||||
function test_getSelection() {
|
||||
const quillEditor = new Quill('#editor');
|
||||
const range = quillEditor.getSelection();
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/salvoravida/react-adal#readme
|
||||
// Definitions by: Dmitry Korolev <https://github.com/dkorolev1>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import 'react-addons-transition-group';
|
||||
import { ComponentClass, CSSTransitionGroupProps } from 'react';
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Mixin } from 'react';
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Mixin } from 'react';
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Component } from 'react';
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { AbstractView, Component, ComponentClass,
|
||||
ReactElement, ReactInstance, ClassType,
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { ComponentClass, TransitionGroupProps } from 'react';
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: http://facebook.github.io/react/
|
||||
// Definitions by: Asana <https://asana.com>, AssureSign <http://www.assuresign.com>, Microsoft <https://microsoft.com>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/davidtheclark/react-aria-modal#readme
|
||||
// Definitions by: forabi <https://github.com/forabi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import React = require('react');
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://facebook.github.io/react/
|
||||
// Definitions by: John Gozde <https://github.com/jgoz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
export as namespace ReactDOMFactories;
|
||||
export = ReactDOMFactories;
|
||||
|
||||
Vendored
+1
-1
@@ -6,7 +6,7 @@
|
||||
// MartynasZilinskas <https://github.com/MartynasZilinskas>
|
||||
// Josh Rutherford <https://github.com/theruther4d>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
export as namespace ReactDOM;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -5,7 +5,7 @@
|
||||
// Microsoft <https://microsoft.com>
|
||||
// MartynasZilinskas <https://github.com/MartynasZilinskas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
export as namespace ReactDOM;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/chrisjpatty/react-dragtastic#readme
|
||||
// Definitions by: Nicolás Scarcella <https://github.com/nscarcella>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { ReactNode, Component, MouseEventHandler, TouchEventHandler } from 'react';
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/matteocng/react-flag-icon-css#readme
|
||||
// Definitions by: Jon Freedman <https://github.com/jonfreedman>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as CSS from 'csstype';
|
||||
import { PureComponent, ReactNode } from 'react';
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/akiran/react-highlight
|
||||
// Definitions by: Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
|
||||
Vendored
+1
@@ -3,6 +3,7 @@
|
||||
// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>
|
||||
// Simon Baumann <https://github.com/chnoch>
|
||||
// Benedict Etzel <https://github.com/beheh>
|
||||
// Wu Haotian <https://github.com/whtsky>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -15,7 +15,7 @@ export interface i18nProps {
|
||||
i18n?: i18n;
|
||||
initialI18nStore?: any;
|
||||
initialLanguage?: string;
|
||||
children: (t: TranslationFunction, options: Options) => JSX.Element;
|
||||
children: (t: TranslationFunction, options: Options) => React.ReactNode;
|
||||
}
|
||||
|
||||
export default class I18n extends React.Component<i18nProps> { }
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ export interface I18nextProviderProps {
|
||||
i18n: i18n;
|
||||
initialI18nStore?: any;
|
||||
initialLanguage?: string;
|
||||
children: JSX.Element;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export default class I18nextProvider extends React.Component<I18nextProviderProps> { }
|
||||
|
||||
@@ -107,6 +107,10 @@ class App extends React.Component {
|
||||
<App/>
|
||||
</I18nextProvider>;
|
||||
|
||||
<I18nextProvider i18n={i18n} initialLanguage={'en'} initialI18nStore={{}}>
|
||||
123
|
||||
</I18nextProvider>;
|
||||
|
||||
loadNamespaces({components: [App], i18n}).then(() => {
|
||||
}).catch(error => {
|
||||
});
|
||||
@@ -182,6 +186,10 @@ interface CustomTranslateFunctionProps {
|
||||
}
|
||||
</I18n>;
|
||||
|
||||
<I18n>
|
||||
{t => '123'}
|
||||
</I18n>;
|
||||
|
||||
const defaults: ReactI18NextOptions = {
|
||||
wait: true,
|
||||
withRef: true,
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/JedWatson/react-input-autosize#readme
|
||||
// Definitions by: Jason Unger <https://github.com/jsonunger>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.7
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
import * as React from "react";
|
||||
import * as PropTypes from "prop-types";
|
||||
import * as reactMixin from "react-mixin";
|
||||
|
||||
import {
|
||||
@@ -63,8 +64,9 @@ const SomeFunctionalComponentWithIntl: React.ComponentClass<SomeComponentProps>
|
||||
});
|
||||
|
||||
class SomeComponent extends React.Component<SomeComponentProps & InjectedIntlProps> {
|
||||
static propTypes: React.ValidationMap<any> = {
|
||||
intl: intlShape.isRequired
|
||||
static propTypes: React.ValidationMap<SomeComponentProps & InjectedIntlProps> = {
|
||||
intl: intlShape.isRequired,
|
||||
className: PropTypes.string.isRequired
|
||||
};
|
||||
render(): React.ReactElement<{}> {
|
||||
const intl = this.props.intl;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://revolunet.github.io/react-mailchimp-subscribe/
|
||||
// Definitions by: Omar Diab <https://github.com/osdiab>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Component, ReactNode } from "react";
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
||||
// Definitions by: Robert Imig <https://github.com/rimig>
|
||||
// Fabio Berta <https://github.com/fnberta>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
import * as MapboxGL from 'mapbox-gl';
|
||||
|
||||
Vendored
+1
-1
@@ -4,7 +4,7 @@
|
||||
// Adam Lavin <https://github.com/lavoaster>
|
||||
// Carlos Bonetti <https://github.com/CarlosBonetti>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/janstuemmel/react-mce
|
||||
// Definitions by: Gavin Heise <https://github.com/morphologue>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
import * as ActualTinyMCE from 'tinymce';
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/tleunen/react-mdl
|
||||
// Definitions by: Brad Zacher <https://github.com/bradzacher>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/souporserious/react-measure
|
||||
// Definitions by: Alexey Svetliakov <https://github.com/asvetliakov>, Marc Fallows <https://github.com/marcfallows>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/brigand/react-mixin
|
||||
// Definitions by: Qubo <https://github.com/tkqubo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/// <reference types="react" />
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -7,7 +7,7 @@
|
||||
// Uwe Wiemer <https://github.com/hallowatcher>,
|
||||
// Peter Blazejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/souporserious/react-motion-slider
|
||||
// Definitions by: Alexey Svetliakov <https://github.com/asvetliakov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
declare module "react-motion-slider" {
|
||||
import * as React from "react";
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/souporserious/react-motion-ui-pack
|
||||
// Definitions by: Jason Unger <https://github.com/jsonunger>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
import * as motion from 'react-motion';
|
||||
|
||||
Vendored
+1
-1
@@ -4,7 +4,7 @@
|
||||
// Alexey Svetliakov <https://github.com/asvetliakov>
|
||||
// Dimitar Nestorov <https://github.com/dimitarnestorov>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Component, ReactElement } from 'react';
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/jwarby/react-native-android-taskdescription
|
||||
// Definitions by: Christian Chown <https://github.com/christianchown>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/l-urence/react-native-autocomplete-input#readme
|
||||
// Definitions by: Ifiok Jr. <https://github.com/ifiokjr>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Component, ReactNode } from 'react';
|
||||
import {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/rusel1989/react-native-bluetooth-serial
|
||||
// Definitions by: Rodrigo Weber <https://github.com/RodrigoAWeber>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
import * as React from "react";
|
||||
import * as ReactNative from "react-native";
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/wix/react-native-calendars#readme
|
||||
// Definitions by: Tyler Zhang <https://github.com/Tyler-Zhang>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
import { ViewProps, StyleProp } from 'react-native';
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/xgfe/react-native-datepicker
|
||||
// Definitions by: Jacob Baskin <https://github.com/jacobbaskin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
import { ImageURISource } from 'react-native';
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/mmazzarolo/react-native-dialog
|
||||
// Definitions by: MrLuje <https://github.com/MrLuje>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Ref, PureComponent, ReactNode } from "react";
|
||||
import {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/innFactory/react-native-dialogflow#readme
|
||||
// Definitions by: Jason Merino <https://github.com/jasonmerino>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
export namespace Dialogflow {
|
||||
const LANG_CHINESE_CHINA = 'zh-CN';
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/philipphecht/react-native-doc-viewer/blob/master/README.md
|
||||
// Definitions by: Kyle Roach <https://github.com/iRoachie>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
export function openDoc(
|
||||
files: Array<{ url: string; fileName?: string }>,
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/react-native-community/react-native-drawer-layout
|
||||
// Definitions by: Justin Firth <https://github.com/jmfirth>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as React from 'react';
|
||||
import { ViewProps } from 'react-native';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user