mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge branch 'master' into HEAD
This commit is contained in:
+657
-264
File diff suppressed because it is too large
Load Diff
+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?
|
||||
|
||||
@@ -54,7 +54,7 @@ Before you share your improvement with the world, use it yourself.
|
||||
|
||||
#### Test editing an existing package
|
||||
|
||||
To add new features you can use [module augmentation](http://www.typescriptlang.org/docs/handbook/declaration-merging.html).
|
||||
To add new features you can use [module augmentation](http://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation).
|
||||
You can also directly edit the types in `node_modules/@types/foo/index.d.ts`, or copy them from there and follow the steps below.
|
||||
|
||||
|
||||
|
||||
+61
-7
@@ -156,12 +156,6 @@
|
||||
"sourceRepoURL": "https://github.com/brianloveswords/base64url",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "better-scroll",
|
||||
"typingsPackageName": "better-scroll",
|
||||
"sourceRepoURL": "https://github.com/ustbhuangyi/better-scroll",
|
||||
"asOfVersion": "1.5.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "BigInteger.js",
|
||||
"typingsPackageName": "big-integer",
|
||||
@@ -396,6 +390,12 @@
|
||||
"sourceRepoURL": "https://github.com/MikeMcl/decimal.js",
|
||||
"asOfVersion": "7.4.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "delay",
|
||||
"typingsPackageName": "delay",
|
||||
"sourceRepoURL": "https://github.com/sindresorhus/delay",
|
||||
"asOfVersion": "3.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "DevExtreme",
|
||||
"typingsPackageName": "devextreme",
|
||||
@@ -570,6 +570,12 @@
|
||||
"sourceRepoURL": "https://github.com/acdlite/flux-standard-action",
|
||||
"asOfVersion": "1.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "fork-ts-checker-webpack-plugin",
|
||||
"typingsPackageName": "fork-ts-checker-webpack-plugin",
|
||||
"sourceRepoURL": "https://github.com/Realytics/fork-ts-checker-webpack-plugin",
|
||||
"asOfVersion": "0.4.5"
|
||||
},
|
||||
{
|
||||
"libraryName": "Foundation Sites",
|
||||
"typingsPackageName": "foundation-sites",
|
||||
@@ -678,6 +684,12 @@
|
||||
"sourceRepoURL": "https://github.com/facebook/immutable-js",
|
||||
"asOfVersion": "3.8.7"
|
||||
},
|
||||
{
|
||||
"libraryName": "interactjs",
|
||||
"typingsPackageName": "interact.js",
|
||||
"sourceRepoURL": "https://github.com/taye/interact.js",
|
||||
"asOfVersion": "1.3.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "inversify",
|
||||
"typingsPackageName": "inversify",
|
||||
@@ -1140,6 +1152,24 @@
|
||||
"sourceRepoURL": "https://github.com/gpbl/react-day-picker",
|
||||
"asOfVersion": "5.3.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-dnd",
|
||||
"typingsPackageName": "react-dnd",
|
||||
"sourceRepoURL": "https://github.com/react-dnd/react-dnd",
|
||||
"asOfVersion": "3.0.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-dnd-html5-backend",
|
||||
"typingsPackageName": "react-dnd-html5-backend",
|
||||
"sourceRepoURL": "https://github.com/react-dnd/react-dnd",
|
||||
"asOfVersion": "3.0.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-dnd-test-backend",
|
||||
"typingsPackageName": "react-dnd-test-backend",
|
||||
"sourceRepoURL": "https://github.com/react-dnd/react-dnd",
|
||||
"asOfVersion": "3.0.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-flip-move",
|
||||
"typingsPackageName": "react-flip-move",
|
||||
@@ -1194,12 +1224,24 @@
|
||||
"sourceRepoURL": "https://github.com/react-native-community/react-native-modal",
|
||||
"asOfVersion": "4.1.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-native-navigation",
|
||||
"typingsPackageName": "react-native-navigation",
|
||||
"sourceRepoURL": "https://github.com/wix/react-native-navigation",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-split-pane",
|
||||
"typingsPackageName": "react-split-pane",
|
||||
"sourceRepoURL": "https://github.com/tomkp/react-split-pane",
|
||||
"asOfVersion": "0.1.67"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-svg",
|
||||
"typingsPackageName": "react-svg",
|
||||
"sourceRepoURL": "https://github.com/tanem/react-svg",
|
||||
"asOfVersion": "5.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "realm",
|
||||
"typingsPackageName": "realm",
|
||||
@@ -1219,7 +1261,7 @@
|
||||
"asOfVersion": "0.1.5"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-bootstrap",
|
||||
"libraryName": "redux-bootstrap",
|
||||
"typingsPackageName": "redux-bootstrap",
|
||||
"sourceRepoURL": "https://github.com/remojansen/redux-bootstrap",
|
||||
"asOfVersion": "1.1.0"
|
||||
@@ -1494,6 +1536,12 @@
|
||||
"sourceRepoURL": "https://github.com/samchon/tstl",
|
||||
"asOfVersion": "1.5.7"
|
||||
},
|
||||
{
|
||||
"libraryName": "typed.js",
|
||||
"typingsPackageName": "typed.js",
|
||||
"sourceRepoURL": "https://github.com/mattboldt/typed.js",
|
||||
"asOfVersion": "2.0.9"
|
||||
},
|
||||
{
|
||||
"libraryName": "TypeScript",
|
||||
"typingsPackageName": "typescript",
|
||||
@@ -1584,6 +1632,12 @@
|
||||
"sourceRepoURL": "http://webix.com",
|
||||
"asOfVersion": "5.1.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "winston",
|
||||
"typingsPackageName": "winston",
|
||||
"sourceRepoURL": "https://github.com/winstonjs/winston.git",
|
||||
"asOfVersion": "2.4.4"
|
||||
},
|
||||
{
|
||||
"libraryName": "wolfy87-eventemitter",
|
||||
"typingsPackageName": "wolfy87-eventemitter",
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "definitely-typed",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.3",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { AbstractLevelDOWN } from 'abstract-leveldown';
|
||||
|
||||
const test = (levelDown: AbstractLevelDOWN<any, string>) => {
|
||||
levelDown.put("key", "value", (err?) => { });
|
||||
levelDown.put(1, "value", { something: true }, (err?) => { });
|
||||
|
||||
levelDown.get("key", (err?) => { });
|
||||
levelDown.get(1, { something: true }, (err?) => { });
|
||||
};
|
||||
// $ExpectType void
|
||||
test(new AbstractLevelDOWN('here'));
|
||||
// $ExpectType void
|
||||
test(AbstractLevelDOWN('there'));
|
||||
Vendored
+103
@@ -0,0 +1,103 @@
|
||||
// Type definitions for abstract-leveldown 5.0
|
||||
// Project: https://github.com/Level/abstract-leveldown
|
||||
// Definitions by: Meirion Hughes <https://github.com/MeirionHughes>
|
||||
// Daniel Byrne <https://github.com/danwbyrne>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface AbstractOptions {
|
||||
readonly [k: string]: any;
|
||||
}
|
||||
|
||||
export type ErrorCallback = (err: Error | undefined) => void;
|
||||
export type ErrorValueCallback<V> = (err: Error | undefined, value: V) => void;
|
||||
export type ErrorKeyValueCallback<K, V> = (err: Error | undefined, key: K, value: V) => void;
|
||||
|
||||
export interface AbstractOpenOptions extends AbstractOptions {
|
||||
createIfMissing?: boolean;
|
||||
errorIfExists?: boolean;
|
||||
}
|
||||
|
||||
export interface AbstractGetOptions extends AbstractOptions {
|
||||
asBuffer?: boolean;
|
||||
}
|
||||
|
||||
export interface AbstractLevelDOWN<K, V> extends AbstractOptions {
|
||||
open(cb: ErrorCallback): void;
|
||||
open(options: AbstractOpenOptions, cb: ErrorCallback): void;
|
||||
|
||||
close(cb: ErrorCallback): void;
|
||||
|
||||
get(key: K, cb: ErrorValueCallback<V>): void;
|
||||
get(key: K, options: AbstractGetOptions, cb: ErrorValueCallback<V>): void;
|
||||
|
||||
put(key: K, value: V, cb: ErrorCallback): void;
|
||||
put(key: K, value: V, options: AbstractOptions, cb: ErrorCallback): void;
|
||||
|
||||
del(key: K, cb: ErrorCallback): void;
|
||||
del(key: K, options: AbstractOptions, cb: ErrorCallback): void;
|
||||
|
||||
batch(): AbstractChainedBatch<K, V>;
|
||||
batch(array: ReadonlyArray<AbstractBatch<K, V>>, cb: ErrorCallback): AbstractChainedBatch<K, V>;
|
||||
batch(array: ReadonlyArray<AbstractBatch<K, V>>, options: AbstractOptions, cb: ErrorCallback): AbstractChainedBatch<K, V>;
|
||||
|
||||
iterator(options?: AbstractIteratorOptions<K>): AbstractIterator<K, V>;
|
||||
}
|
||||
|
||||
export interface AbstractLevelDOWNConstructor {
|
||||
new (location: string): AbstractLevelDOWN<any, any>;
|
||||
(location: string): AbstractLevelDOWN<any, any>;
|
||||
}
|
||||
|
||||
export interface AbstractIteratorOptions<K> extends AbstractOptions {
|
||||
gt?: K;
|
||||
gte?: K;
|
||||
lt?: K;
|
||||
lte?: K;
|
||||
reverse?: boolean;
|
||||
limit?: number;
|
||||
keys?: boolean;
|
||||
values?: boolean;
|
||||
keyAsBuffer?: boolean;
|
||||
valueAsBuffer?: boolean;
|
||||
}
|
||||
|
||||
export type AbstractBatch<K, V> = PutBatch<K, V> | DelBatch<K, V>;
|
||||
|
||||
export interface PutBatch<K, V> {
|
||||
readonly type: 'put';
|
||||
readonly key: K;
|
||||
readonly value: V;
|
||||
}
|
||||
|
||||
export interface DelBatch<K, V> {
|
||||
readonly type: 'del';
|
||||
readonly key: K;
|
||||
}
|
||||
|
||||
export interface AbstractChainedBatch<K, V> extends AbstractChainedBatchConstructor, AbstractOptions {
|
||||
put: (key: K, value: V) => this;
|
||||
del: (key: K) => this;
|
||||
clear: () => this;
|
||||
write(cb: ErrorCallback): any;
|
||||
write(options: any, cb: ErrorCallback): any;
|
||||
}
|
||||
|
||||
export interface AbstractChainedBatchConstructor {
|
||||
new(db: any): AbstractChainedBatch<any, any>;
|
||||
(db: any): AbstractChainedBatch<any, any>;
|
||||
}
|
||||
|
||||
export interface AbstractIterator<K, V> extends AbstractChainedBatchConstructor {
|
||||
db: AbstractLevelDOWN<K, V>;
|
||||
next(cb: ErrorKeyValueCallback<K, V>): this;
|
||||
end(cb: ErrorCallback): void;
|
||||
}
|
||||
|
||||
export interface AbstractIteratorConstructor {
|
||||
new(db: any): AbstractIterator<any, any>;
|
||||
(db: any): AbstractIterator<any, any>;
|
||||
}
|
||||
|
||||
export const AbstractLevelDOWN: AbstractLevelDOWNConstructor;
|
||||
export const AbstractIterator: AbstractIteratorConstructor;
|
||||
export const AbstractChainedBatch: AbstractChainedBatchConstructor;
|
||||
@@ -18,6 +18,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"meteor-univserse-i18n-tests.ts"
|
||||
"abstract-leveldown-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Vendored
+2
-1
@@ -832,8 +832,9 @@ declare namespace AceAjax {
|
||||
|
||||
/**
|
||||
* [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft}
|
||||
* @param scrollLeft The new scroll left value
|
||||
**/
|
||||
setScrollLeft(): void;
|
||||
setScrollLeft(scrollLeft: number): void;
|
||||
|
||||
/**
|
||||
* [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft}
|
||||
|
||||
@@ -18,6 +18,23 @@ function createFoldTestSession() {
|
||||
return session;
|
||||
}
|
||||
|
||||
function createScrollTestRenderer(): AceAjax.VirtualRenderer | null {
|
||||
var el = document.createElement("div");
|
||||
|
||||
if (!el.getBoundingClientRect) {
|
||||
console.log("Skipping test: This test only runs in the browser");
|
||||
return null;
|
||||
}
|
||||
|
||||
el.style.left = "20px";
|
||||
el.style.top = "30px";
|
||||
el.style.width = "300px";
|
||||
el.style.height = "100px";
|
||||
document.body.appendChild(el);
|
||||
|
||||
return new AceAjax.VirtualRenderer(el);
|
||||
}
|
||||
|
||||
function assertArray(a, b) {
|
||||
assert.equal(a + "", b + "");
|
||||
assert.ok(a.length == b.length);
|
||||
@@ -915,5 +932,25 @@ const aceEditSessionTests = {
|
||||
session = new AceAjax.EditSession(new Array(30).join("\n"));
|
||||
session.documentToScreenPosition(2, 0);
|
||||
session.documentToScreenPosition(2, 0);
|
||||
},
|
||||
|
||||
"test setScrollTop()": function() {
|
||||
var renderer = createScrollTestRenderer();
|
||||
var session = new AceAjax.EditSession(["1", "2", "3", "2", "3", "4"]);
|
||||
renderer.setSession(session);
|
||||
assert.equal(renderer.getScrollTop(), 0);
|
||||
session.setScrollTop(40);
|
||||
assert.equal(renderer.getScrollTop(), 40);
|
||||
renderer.getScrollTop()
|
||||
},
|
||||
|
||||
"test setScrollLeft()": function() {
|
||||
var renderer = createScrollTestRenderer();
|
||||
var session = new AceAjax.EditSession(["1", "2", "3", "2", "3", "4"]);
|
||||
renderer.setSession(session);
|
||||
assert.equal(renderer.getScrollLeft(), 0);
|
||||
session.setScrollLeft(40);
|
||||
assert.equal(renderer.getScrollLeft(), 40);
|
||||
renderer.getScrollLeft()
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Vendored
+1
-2
@@ -2,9 +2,8 @@
|
||||
// Project: https://github.com/optimalbits/node_acl
|
||||
// Definitions by: Qubo <https://github.com/tkQubo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/// <reference types="bluebird" />
|
||||
/// <reference types="node"/>
|
||||
/// <reference types="express"/>
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import ActiveDirectory = require("activedirectory2");
|
||||
|
||||
const ad = new ActiveDirectory({
|
||||
url: 'ldap://192.168.199.10',
|
||||
baseDN: 'OU=MyUsers,DC=mydomain,DC=com',
|
||||
username: 'service-user@mydomain.com',
|
||||
password: 'xxxxx000pw'
|
||||
});
|
||||
|
||||
ad.authenticate("test@mydomain.com", "yyyy111pw", (err, authed) => {
|
||||
console.log("hello");
|
||||
console.log(err);
|
||||
console.log(authed);
|
||||
});
|
||||
Vendored
+151
@@ -0,0 +1,151 @@
|
||||
// Type definitions for activedirectory2 1.2
|
||||
// Project: https://github.com/jsumners/node-activedirectory#readme
|
||||
// Definitions by: pas <https://github.com/pasthelod>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.5
|
||||
|
||||
import { Filter } from "ldapjs";
|
||||
|
||||
interface ADProperties {
|
||||
url: string;
|
||||
baseDN: string;
|
||||
username: string;
|
||||
password: string;
|
||||
pageSize?: 1000;
|
||||
entryParser?: (entry: object, raw: string, cb: (entry: object) => void) => void;
|
||||
referrals?: {
|
||||
enabled: false,
|
||||
exclude: [
|
||||
'ldaps?://ForestDnsZones\\..*/.*',
|
||||
'ldaps?://DomainDnsZones\\..*/.*',
|
||||
'ldaps?://.*/CN=Configuration,.*'
|
||||
]
|
||||
};
|
||||
attributes?: {
|
||||
user: [
|
||||
'dn', 'distinguishedName',
|
||||
'userPrincipalName', 'sAMAccountName', 'mail',
|
||||
'lockoutTime', 'whenCreated', 'pwdLastSet', 'userAccountControl',
|
||||
'employeeID', 'sn', 'givenName', 'initials', 'cn', 'displayName',
|
||||
'comment', 'description'
|
||||
],
|
||||
group: [
|
||||
'dn', 'cn', 'description', 'distinguishedName', 'objectCategory'
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
interface LDAPjsReqProps {
|
||||
url: string;
|
||||
tlsOptions: {
|
||||
host?: string;
|
||||
key?: string;
|
||||
cert?: string;
|
||||
ca?: string;
|
||||
rejectUnauthorized: boolean;
|
||||
};
|
||||
socketPath?: string;
|
||||
log?: any;
|
||||
timeout?: number;
|
||||
idleTimeout?: number;
|
||||
connectionTimeout?: number;
|
||||
strictDN?: boolean;
|
||||
}
|
||||
|
||||
type MembershipType = 'all'|'user'|'group';
|
||||
|
||||
interface ReqProps extends LDAPjsReqProps {
|
||||
baseDN?: string;
|
||||
bindDN?: string;
|
||||
bindCredentials?: string;
|
||||
scope?: 'base' | 'one' | 'sub';
|
||||
filter: string | Filter;
|
||||
attributes: AttributeSpec;
|
||||
sizeLimit: 0;
|
||||
timeLimit: 10;
|
||||
includeMembership: MembershipType[];
|
||||
}
|
||||
|
||||
interface AttributeSpec {
|
||||
user: UserAttributes[];
|
||||
group: GroupAttributes[];
|
||||
}
|
||||
|
||||
type GroupAttributes =
|
||||
| 'distinguishedName'
|
||||
| 'objectCategory'
|
||||
| 'cn'
|
||||
| 'description';
|
||||
|
||||
type UserAttributes =
|
||||
| 'distinguishedName'
|
||||
| 'userPrincipalName'
|
||||
| 'sAMAccountName'
|
||||
| 'mail'
|
||||
| 'lockoutTime'
|
||||
| 'whenCreated'
|
||||
| 'pwdLastSet'
|
||||
| 'userAccountControl'
|
||||
| 'employeeID'
|
||||
| 'sn'
|
||||
| 'givenName'
|
||||
| 'initials'
|
||||
| 'cn'
|
||||
| 'displayName'
|
||||
| 'comment'
|
||||
| 'description';
|
||||
|
||||
interface FindResult {
|
||||
groups: object[];
|
||||
users: object[];
|
||||
other: object[];
|
||||
}
|
||||
|
||||
declare class ActiveDirectory {
|
||||
constructor(props: ADProperties);
|
||||
authenticate(
|
||||
username: string,
|
||||
password: string,
|
||||
callback: (err: string, authenticated: boolean) => void
|
||||
): void;
|
||||
isUserMemberOf(
|
||||
opts: ReqProps,
|
||||
username: string,
|
||||
groupName: string,
|
||||
callback: (err: object, res: boolean) => void
|
||||
): void;
|
||||
find(
|
||||
opts: string | ReqProps,
|
||||
callback: (err: object, results: FindResult) => void
|
||||
): void;
|
||||
findDeletedObjects(
|
||||
opts: string | ReqProps,
|
||||
callback: (err: object, results: object[]) => void
|
||||
): void;
|
||||
findUser(
|
||||
opts: string | ReqProps,
|
||||
username: string,
|
||||
callback: (err: object, user: object) => void
|
||||
): void;
|
||||
findUsers(
|
||||
opts: string | ReqProps,
|
||||
callback: (err: object, users: object[]) => void
|
||||
): void;
|
||||
findGroup(
|
||||
opts: string | ReqProps,
|
||||
groupName: string,
|
||||
callback: (err: object, group: object) => void
|
||||
): void;
|
||||
findGroups(
|
||||
opts: string | ReqProps,
|
||||
groupName: string,
|
||||
callback: (err: object, groups: object[]) => void
|
||||
): void;
|
||||
getRootDSE(
|
||||
url: string,
|
||||
attributes: string[],
|
||||
callback: (err: object, result: object) => void
|
||||
): void;
|
||||
}
|
||||
|
||||
export = ActiveDirectory;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"activedirectory2-tests.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"es2015.iterable"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,17 @@ const inCollection = <T = any>(collection: { Item(index: any): T }, index: strin
|
||||
return item;
|
||||
};
|
||||
|
||||
{
|
||||
let app1: Excel.Application | null = new ActiveXObject('Excel.Application');
|
||||
app1.Visible = true;
|
||||
const book1 = app1.Workbooks.Add();
|
||||
|
||||
app1.Quit();
|
||||
app1 = null;
|
||||
|
||||
WScript.Quit();
|
||||
}
|
||||
|
||||
const app = new ActiveXObject('Excel.Application');
|
||||
|
||||
// create a workbook -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/create-a-workbook
|
||||
@@ -27,7 +38,7 @@ newBook.SaveAs('allsales.xls');
|
||||
// create or replace a worksheet -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/create-or-replace-a-worksheet
|
||||
const newOrExistingWorksheet = () => {
|
||||
const mySheetName = 'Sheet4';
|
||||
let mySheet = inCollection(newBook.Worksheets, mySheetName) as Excel.Worksheet | undefined;
|
||||
let mySheet = inCollection<Excel.Worksheet>(newBook.Worksheets, mySheetName);
|
||||
if (!mySheet) {
|
||||
WScript.Echo(`The sheet named "${mySheetName} doesn't exist, but will be created.`);
|
||||
mySheet = app.Worksheets.Add() as Excel.Worksheet;
|
||||
@@ -37,7 +48,7 @@ const newOrExistingWorksheet = () => {
|
||||
const replaceWorksheet = () => {
|
||||
const mySheetName = 'Sheet4';
|
||||
app.DisplayAlerts = false;
|
||||
let mySheet = inCollection<Excel.Worksheet | Excel.Chart | Excel.DialogSheet>(app.Worksheets, mySheetName);
|
||||
let mySheet = inCollection<Excel.Worksheet>(app.Worksheets, mySheetName);
|
||||
if (mySheet) { mySheet.Delete(); }
|
||||
app.DisplayAlerts = true;
|
||||
mySheet = app.Worksheets.Add() as Excel.Worksheet;
|
||||
@@ -46,9 +57,7 @@ const replaceWorksheet = () => {
|
||||
};
|
||||
|
||||
// referencing multiple sheets -- https://msdn.microsoft.com/VBA/Excel-VBA/articles/sheets-object-excel
|
||||
const moveMultipleSheets = () => {
|
||||
app.Worksheets.Item(toSafeArray<string | number>(1, 'Sheet2')).Move(4);
|
||||
};
|
||||
const moveMultipleSheets = () => app.Worksheets(toSafeArray<string | number>(1, 'Sheet2')).Move(4);
|
||||
|
||||
// sort worksheets alphanumerically by name -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/sort-worksheets-alphanumerically-by-name
|
||||
const sortSheetsTabName = () => {
|
||||
@@ -56,9 +65,9 @@ const sortSheetsTabName = () => {
|
||||
const sheets = app.ActiveWorkbook.Sheets;
|
||||
const sheetCount = sheets.Count;
|
||||
for (let i = 0; i < sheetCount; i += 1) {
|
||||
const sheetI = sheets.Item(i);
|
||||
const sheetI = sheets(i);
|
||||
for (let j = i; j < sheetCount; j += 1) {
|
||||
const sheetJ = sheets.Item(j);
|
||||
const sheetJ = sheets(j);
|
||||
if (sheetJ.Name < sheetI.Name) { sheetJ.Move(sheetI); }
|
||||
}
|
||||
}
|
||||
@@ -68,7 +77,7 @@ const sortSheetsTabName = () => {
|
||||
// fill a value down into blank cells in a column -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/fill-a-value-down-into-blank-cells-in-a-column
|
||||
const fillCellsFromAbove = () => {
|
||||
app.ScreenUpdating = false;
|
||||
const columnA = app.Columns.Item(1);
|
||||
const columnA = app.Columns(1);
|
||||
try {
|
||||
columnA.SpecialCells(Excel.XlCellType.xlCellTypeBlanks).Formula = '=R[-1]C';
|
||||
columnA.Value = columnA.Value;
|
||||
@@ -78,7 +87,7 @@ const fillCellsFromAbove = () => {
|
||||
|
||||
// hide and unhide columns -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/hide-and-unhide-columns
|
||||
const setColumnVisibility = (visible: boolean) => {
|
||||
const book = app.Workbooks.Item(1);
|
||||
const book = app.Workbooks(1);
|
||||
const sheet = inCollection<Excel.Worksheet | Excel.Chart | Excel.DialogSheet>(book.Worksheets, 'Sheet1');
|
||||
if (!sheet) { return; }
|
||||
|
||||
@@ -97,7 +106,7 @@ const setColumnVisibility = (visible: boolean) => {
|
||||
};
|
||||
|
||||
// highlighting the active cell, row, or column -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/highlight-the-active-cell-row-or-column
|
||||
(() => {
|
||||
{
|
||||
const wks = app.ActiveSheet as Excel.Worksheet;
|
||||
|
||||
// highlight active cell
|
||||
@@ -120,10 +129,10 @@ const setColumnVisibility = (visible: boolean) => {
|
||||
prm.Target.EntireColumn.Interior.ColorIndex = 8;
|
||||
app.ScreenUpdating = true;
|
||||
});
|
||||
})();
|
||||
}
|
||||
|
||||
// referencing cells -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/reference-cells-and-ranges
|
||||
(() => {
|
||||
{
|
||||
const wks = app.ActiveSheet as Excel.Worksheet;
|
||||
|
||||
// all the cells on a worksheet
|
||||
@@ -141,20 +150,19 @@ const setColumnVisibility = (visible: boolean) => {
|
||||
wks.Range('A:A,C:C,F:F').Font.Bold = true;
|
||||
|
||||
// using index numbers
|
||||
wks.Cells.Item(6, 1).Value2 = 10;
|
||||
// Value is also a property with parameters
|
||||
ActiveXObject.set(wks.Cells.Item(6, 1), 'Value', 10);
|
||||
wks.Cells(6, 1).Value2 = 10;
|
||||
wks.Cells(6, 1).Value = 10;
|
||||
|
||||
// iterating through cells using index numbers
|
||||
for (let counter = 1; counter < 20; counter += 1) {
|
||||
ActiveXObject.set(wks.Cells.Item(counter, 1), 'Value', 10);
|
||||
wks.Cells(counter, 1).Value = 10;
|
||||
}
|
||||
|
||||
// relative to other cells
|
||||
wks.Cells.Item(1, 1).Font.Underline = Excel.XlUnderlineStyle.xlUnderlineStyleDouble;
|
||||
wks.Cells(1, 1).Font.Underline = Excel.XlUnderlineStyle.xlUnderlineStyleDouble;
|
||||
|
||||
// using a Range object
|
||||
const rng = wks.Cells.Item('A1:D5');
|
||||
const rng = wks.Cells('A1:D5');
|
||||
rng.Formula = '=RAND()';
|
||||
rng.Font.Bold = true;
|
||||
|
||||
@@ -166,23 +174,22 @@ const setColumnVisibility = (visible: boolean) => {
|
||||
|
||||
// refer to multiple ranges using Areas
|
||||
WScript.Echo(union.Areas.Count);
|
||||
})();
|
||||
}
|
||||
|
||||
// looping through a range of cells -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/looping-through-a-range-of-cells
|
||||
(() => {
|
||||
{
|
||||
const wks = app.ActiveSheet as Excel.Worksheet;
|
||||
|
||||
// using for
|
||||
for (let x = 1; x < 20; x++) {
|
||||
const currentCell = wks.Cells.Item(x, 1);
|
||||
if (Math.abs(currentCell.Value()) < 0.01) {
|
||||
// because Value is typed as a method on the Excel.Range class, we have to treat it as a setter with parameters
|
||||
ActiveXObject.set(currentCell, 'Value', 0);
|
||||
const currentCell = wks.Cells(x, 1);
|
||||
if (Math.abs(currentCell.Value) < 0.01) {
|
||||
currentCell.Value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// using Enumerator
|
||||
let enumerator = new Enumerator(wks.Cells.Item('A1:D10'));
|
||||
let enumerator = new Enumerator(wks.Cells('A1:D10'));
|
||||
enumerator.moveFirst();
|
||||
while (!enumerator.atEnd()) {
|
||||
const currentCell = enumerator.item();
|
||||
@@ -202,11 +209,11 @@ const setColumnVisibility = (visible: boolean) => {
|
||||
}
|
||||
enumerator.moveNext();
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
// using selection -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/selecting-and-activating-cells
|
||||
(() => {
|
||||
const wks = app.ActiveWorkbook.Worksheets.Item(1) as Excel.Worksheet;
|
||||
{
|
||||
const wks = app.ActiveWorkbook.Worksheets(1);
|
||||
|
||||
// make a worksheet the active worksheet; otherwise code which uses the selection will fail
|
||||
wks.Select();
|
||||
@@ -219,24 +226,24 @@ const setColumnVisibility = (visible: boolean) => {
|
||||
wks.Range("B1").Activate();
|
||||
|
||||
// working with 3-D ranges -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/working-with-3-d-ranges
|
||||
app.Sheets.Item(toSafeArray("Sheet2", "Sheet3", "Sheet4")).Select();
|
||||
app.Sheets(toSafeArray("Sheet2", "Sheet3", "Sheet4")).Select();
|
||||
app.Range("A1:H1").Select();
|
||||
(app.Selection as Excel.Range).Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble;
|
||||
(app.Selection as Excel.Range).Borders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble;
|
||||
|
||||
// alternatively, use FillAcrossSheets to fill formatting and data across sheets
|
||||
const book = app.ActiveWorkbook;
|
||||
const wks2 = book.Sheets.Item("Sheet2") as Excel.Worksheet;
|
||||
const wks2 = book.Worksheets("Sheet2");
|
||||
const rng = wks2.Range("A1:H1");
|
||||
rng.Borders.Item(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble;
|
||||
rng.Borders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDouble;
|
||||
book.Sheets.FillAcrossSheets(rng);
|
||||
})();
|
||||
}
|
||||
|
||||
// prevent duplicate entry -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/prevent-duplicate-entries-in-a-range
|
||||
(() => {
|
||||
const book = app.Workbooks.Item(1);
|
||||
{
|
||||
const book = app.Workbooks(1);
|
||||
|
||||
ActiveXObject.on(book, 'SheetChange', ['Sh', 'Target'], function(this, prm) {
|
||||
const EvalRange = this.ActiveSheet.Range("A1:B20");
|
||||
const EvalRange = (this.ActiveSheet as Excel.Worksheet).Range("A1:B20");
|
||||
|
||||
// If the cell where the value was entered is not in the defined range, if the value pasted is larger than a single cell, or if no value was entered in the cell, then exit the macro
|
||||
if (
|
||||
@@ -253,10 +260,11 @@ const setColumnVisibility = (visible: boolean) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// const enumerator = new Enumerator<Excel.Worksheet | Excel.Chart | Excel.DialogSheet>(book.Worksheets);
|
||||
const enumerator = new Enumerator(book.Worksheets);
|
||||
enumerator.moveFirst();
|
||||
while (!enumerator.atEnd()) {
|
||||
const wks = enumerator.item() as Excel.Worksheet;
|
||||
const wks = enumerator.item();
|
||||
if (wks.Name === prm.Target.Name) { continue; }
|
||||
|
||||
// If the value entered already exists in the defined range on the current worksheet, undo the entry.
|
||||
@@ -267,14 +275,14 @@ const setColumnVisibility = (visible: boolean) => {
|
||||
app.EnableEvents = true;
|
||||
}
|
||||
});
|
||||
})();
|
||||
}
|
||||
|
||||
// add a unique list of values to a combobox -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/add-a-unique-list-of-values-to-a-combo-box
|
||||
(() => {
|
||||
(() => {
|
||||
{
|
||||
{
|
||||
// using the AdvancedFilter property
|
||||
const book = app.ThisWorkbook;
|
||||
const sheet = book.Worksheets.Item("Sheet1") as Excel.Worksheet;
|
||||
const sheet = book.Worksheets("Sheet1");
|
||||
const dataRange = sheet.Range('A1', sheet.Range("A100").End(Excel.XlDirection.xlUp));
|
||||
dataRange.AdvancedFilter(Excel.XlFilterAction.xlFilterCopy, undefined, sheet.Range('L1'), true);
|
||||
const data = sheet.Range("L2", sheet.Range('L100').End(Excel.XlDirection.xlUp)).Value() as SafeArray;
|
||||
@@ -284,15 +292,17 @@ const setColumnVisibility = (visible: boolean) => {
|
||||
combobox.Clear();
|
||||
ActiveXObject.set(combobox, 'List', [], data);
|
||||
combobox.ListIndex = -1;
|
||||
})();
|
||||
}
|
||||
|
||||
(() => {
|
||||
{
|
||||
// using a Dictionary
|
||||
const sheet = app.ThisWorkbook.Sheets.Item('Sheet2') as Excel.Worksheet;
|
||||
const sheet = app.ThisWorkbook.Sheets('Sheet2') as Excel.Worksheet;
|
||||
const data = sheet.Range('A2', sheet.Range('A100').End(Excel.XlDirection.xlUp)).Value2 as SafeArray;
|
||||
const arr = new VBArray(data).toArray();
|
||||
const dict = new ActiveXObject('Scripting.Dictionary');
|
||||
arr.forEach(x => ActiveXObject.set(dict, 'Item', [x], true));
|
||||
for (const x of arr) {
|
||||
ActiveXObject.set(dict, 'Item', [x], true);
|
||||
}
|
||||
|
||||
const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox;
|
||||
combobox.Clear();
|
||||
@@ -307,21 +317,28 @@ const setColumnVisibility = (visible: boolean) => {
|
||||
|
||||
// alternatively, make a JS array out of the keys, and iterate using forEach
|
||||
// new VBArray(dict.Keys()).toArray().forEach(x => combobox.AddItem(x));
|
||||
})();
|
||||
})();
|
||||
|
||||
// animating a sparkline -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/animate-a-sparkline
|
||||
(() => {
|
||||
const wks = app.ActiveSheet as Excel.Worksheet;
|
||||
const oSparkGroup = wks.Cells.SparklineGroups.Item(1);
|
||||
|
||||
// Set the data source to the first year of data
|
||||
oSparkGroup.ModifySourceData('B2:M4');
|
||||
|
||||
// Loop through the data points for the subsequent two years
|
||||
for (let i = 1; i <= 24; i++) {
|
||||
// Move the reference for the sparkline group over one cell
|
||||
oSparkGroup.ModifySourceData(wks.Range(oSparkGroup.SourceData).Offset(0, 1).Address());
|
||||
WScript.Sleep(1000);
|
||||
}
|
||||
})();
|
||||
|
||||
// animating a sparkline -- https://msdn.microsoft.com/en-us/vba/excel-vba/articles/animate-a-sparkline
|
||||
{
|
||||
const wks = app.ActiveSheet as Excel.Worksheet;
|
||||
const oSparkGroup = wks.Cells.SparklineGroups(1);
|
||||
|
||||
// Set the data source to the first year of data
|
||||
oSparkGroup.ModifySourceData('B2:M4');
|
||||
|
||||
// Loop through the data points for the subsequent two years
|
||||
for (let i = 1; i <= 24; i++) {
|
||||
// Move the reference for the sparkline group over one cell
|
||||
oSparkGroup.ModifySourceData(wks.Range(oSparkGroup.SourceData).Offset(0, 1).Address());
|
||||
WScript.Sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
const formats = new VBArray(app.ClipboardFormats).toArray();
|
||||
for (const format of formats) {
|
||||
WScript.Echo(format);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2148
-1759
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-const-enum": false,
|
||||
"max-line-length": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
-1
@@ -51,7 +51,6 @@ interface Enumerator<T = any> {
|
||||
|
||||
interface EnumeratorConstructor {
|
||||
new <T = any>(collection: { Item(index: any): T }): Enumerator<T>;
|
||||
// new (collection: any): Enumerator;
|
||||
}
|
||||
|
||||
declare var Enumerator: EnumeratorConstructor;
|
||||
|
||||
Vendored
+2
@@ -10,6 +10,8 @@
|
||||
declare namespace Office {
|
||||
type MsoRGBType = number;
|
||||
|
||||
type ByteArray = SafeArray<number>;
|
||||
|
||||
const enum BackstageGroupStyle {
|
||||
BackstageGroupStyleError = 2,
|
||||
BackstageGroupStyleNormal = 0,
|
||||
|
||||
Vendored
-4
@@ -5886,7 +5886,3 @@ interface EnumeratorConstructor {
|
||||
new(col: Outlook.Reminders): Enumerator<Outlook.Reminder>;
|
||||
new(col: Outlook.Views): Enumerator<Outlook.View>;
|
||||
}
|
||||
|
||||
interface SafeArray<T = any> {
|
||||
_brand: SafeArray<T>;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/ciferox/adone
|
||||
// Definitions by: am <https://github.com/s0m3on3>, Maximus <https://github.com/maxveres>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/// <reference path="./adone.d.ts" />
|
||||
/// <reference path="./glosses/app.d.ts" />
|
||||
|
||||
@@ -1,109 +1,110 @@
|
||||
import Agenda = require("agenda");
|
||||
import { Db, Server } from "mongodb";
|
||||
import { Db, Server, MongoClient } from "mongodb";
|
||||
|
||||
var mongoConnectionString = "mongodb://127.0.0.1/agenda";
|
||||
|
||||
var agenda = new Agenda({ db: { address: mongoConnectionString } });
|
||||
(async () => {
|
||||
var agenda = new Agenda({ db: { address: mongoConnectionString } });
|
||||
var agenda = new Agenda({
|
||||
mongo: (await MongoClient.connect(mongoConnectionString)).db(),
|
||||
db: { collection: 'agenda-jobs' },
|
||||
});
|
||||
|
||||
agenda.define<{ foo: Error }>('delete old users', (job, done) => {
|
||||
done(job.attrs.data.foo)
|
||||
agenda.define<{ foo: Error }>('delete old users', (job, done) => {
|
||||
done(job.attrs.data.foo)
|
||||
});
|
||||
|
||||
agenda.on('ready', () => {
|
||||
agenda.every('3 minutes', 'delete old users');
|
||||
|
||||
// Alternatively, you could also do:
|
||||
agenda.every('*/3 * * * *', 'delete old users');
|
||||
|
||||
agenda.start();
|
||||
});
|
||||
|
||||
agenda.define('send email report', { priority: 'high', concurrency: 10 }, (job, done) => {
|
||||
});
|
||||
|
||||
agenda.on('ready', () => {
|
||||
agenda.schedule('in 20 minutes', 'send email report', { to: 'admin@example.com' });
|
||||
agenda.start();
|
||||
});
|
||||
|
||||
agenda.on('ready', () => {
|
||||
var weeklyReport = agenda.create('send email report', { to: 'another-guy@example.com' });
|
||||
weeklyReport.repeatEvery('1 week').save();
|
||||
agenda.start();
|
||||
});
|
||||
|
||||
var agenda = new Agenda({ processEvery: '30 seconds' });
|
||||
|
||||
agenda.defaultConcurrency(5);
|
||||
|
||||
var agenda = new Agenda({ defaultConcurrency: 5 });
|
||||
|
||||
agenda.lockLimit(0);
|
||||
|
||||
var agenda = new Agenda({ lockLimit: 0 });
|
||||
|
||||
agenda.defaultLockLimit(0);
|
||||
|
||||
var agenda = new Agenda({ defaultLockLimit: 0 });
|
||||
|
||||
agenda.defaultLockLifetime(10000);
|
||||
|
||||
var agenda = new Agenda({ defaultLockLifetime: 10000 });
|
||||
|
||||
agenda.define('some long running job', function (job, done) {
|
||||
done();
|
||||
});
|
||||
|
||||
agenda.every('15 minutes', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']);
|
||||
|
||||
agenda.schedule('tomorrow at noon', 'printAnalyticsReport', { userCount: 100 });
|
||||
|
||||
agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']);
|
||||
|
||||
agenda.now('do the hokey pokey');
|
||||
|
||||
var job = agenda.create<{ userCount: number }>('printAnalyticsReport', { userCount: 100 });
|
||||
await job.save();
|
||||
|
||||
const jobs = await agenda.jobs({ name: 'printAnalyticsReport' });
|
||||
jobs.forEach((job) => {
|
||||
job.save();
|
||||
});
|
||||
|
||||
let numRemoved = await agenda.cancel({ name: 'printAnalyticsReport' });
|
||||
|
||||
numRemoved = await agenda.purge();
|
||||
|
||||
await agenda.stop();
|
||||
|
||||
await job.agenda.now('do the hokey pokey');
|
||||
|
||||
job.repeatEvery('10 minutes');
|
||||
|
||||
job.repeatEvery('10 minutes', { timezone: 'America/New_York' });
|
||||
|
||||
job.repeatEvery('10 minutes', { skipImmediate: true });
|
||||
|
||||
job.repeatAt('3:30pm');
|
||||
|
||||
job.schedule('tomorrow at 6pm');
|
||||
|
||||
job.priority('low');
|
||||
job.priority(10);
|
||||
|
||||
job.unique({ 'data.type': 'active', 'data.userId': '123' });
|
||||
job.fail('insuficient disk space');
|
||||
job.fail(new Error('insufficient disk space'));
|
||||
const job2 = await job.run();
|
||||
await job.remove();
|
||||
});
|
||||
|
||||
agenda.on('ready', () => {
|
||||
agenda.every('3 minutes', 'delete old users');
|
||||
|
||||
// Alternatively, you could also do:
|
||||
agenda.every('*/3 * * * *', 'delete old users');
|
||||
|
||||
agenda.start();
|
||||
});
|
||||
|
||||
agenda.define('send email report', { priority: 'high', concurrency: 10 }, (job, done) => {
|
||||
});
|
||||
|
||||
agenda.on('ready', () => {
|
||||
agenda.schedule('in 20 minutes', 'send email report', { to: 'admin@example.com' });
|
||||
agenda.start();
|
||||
});
|
||||
|
||||
agenda.on('ready', () => {
|
||||
var weeklyReport = agenda.create('send email report', { to: 'another-guy@example.com' });
|
||||
weeklyReport.repeatEvery('1 week').save();
|
||||
agenda.start();
|
||||
});
|
||||
|
||||
var agenda = new Agenda({ processEvery: '30 seconds' });
|
||||
|
||||
agenda.defaultConcurrency(5);
|
||||
|
||||
var agenda = new Agenda({ defaultConcurrency: 5 });
|
||||
|
||||
agenda.lockLimit(0);
|
||||
|
||||
var agenda = new Agenda({ lockLimit: 0 });
|
||||
|
||||
agenda.defaultLockLimit(0);
|
||||
|
||||
var agenda = new Agenda({ defaultLockLimit: 0 });
|
||||
|
||||
agenda.defaultLockLifetime(10000);
|
||||
|
||||
var agenda = new Agenda({ defaultLockLifetime: 10000 });
|
||||
|
||||
agenda.define('some long running job', function(job, done) {
|
||||
done();
|
||||
});
|
||||
|
||||
agenda.every('15 minutes', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']);
|
||||
|
||||
agenda.schedule('tomorrow at noon', 'printAnalyticsReport', { userCount: 100 });
|
||||
|
||||
agenda.schedule('tomorrow at noon', ['printAnalyticsReport', 'sendNotifications', 'updateUserRecords']);
|
||||
|
||||
agenda.now('do the hokey pokey');
|
||||
|
||||
var job = agenda.create<{ userCount: number }>('printAnalyticsReport', { userCount: 100 });
|
||||
job.save(function(err) {
|
||||
console.log("Job successfully saved");
|
||||
});
|
||||
|
||||
agenda.jobs({ name: 'printAnalyticsReport' }, function(err, jobs) {
|
||||
// Work with jobs (see below)
|
||||
});
|
||||
|
||||
agenda.cancel({ name: 'printAnalyticsReport' }, function(err, numRemoved) {
|
||||
});
|
||||
|
||||
agenda.purge(function(err, numRemoved) {
|
||||
});
|
||||
|
||||
agenda.stop(function() {
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
job.agenda.now('do the hokey pokey');
|
||||
|
||||
job.repeatEvery('10 minutes');
|
||||
|
||||
job.repeatAt('3:30pm');
|
||||
|
||||
job.schedule('tomorrow at 6pm');
|
||||
|
||||
job.priority('low');
|
||||
job.priority(10);
|
||||
|
||||
job.unique({ 'data.type': 'active', 'data.userId': '123' });
|
||||
job.fail('insuficient disk space');
|
||||
job.fail(new Error('insufficient disk space'));
|
||||
job.run(function(err, job) {
|
||||
console.log("I don't know why you would need to do this...");
|
||||
});
|
||||
job.remove(function(err) {
|
||||
if (!err) console.log("Successfully removed job from collection");
|
||||
})
|
||||
|
||||
class ExtendedAgenda extends Agenda {
|
||||
async start() { }
|
||||
async start() { }
|
||||
}
|
||||
|
||||
const extendedAgenda: ExtendedAgenda = new ExtendedAgenda()
|
||||
|
||||
Vendored
+32
-49
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Agenda v1.0.3
|
||||
// Type definitions for Agenda v2.0.0
|
||||
// Project: https://github.com/agenda/agenda
|
||||
// Definitions by: Meir Gottlieb <https://github.com/meirgottlieb>
|
||||
// Jeff Principe <https://github.com/princjef>
|
||||
@@ -95,16 +95,14 @@ declare class Agenda extends EventEmitter {
|
||||
/**
|
||||
* Find all Jobs matching `query` and pass same back in cb().
|
||||
* @param query
|
||||
* @param cb
|
||||
*/
|
||||
jobs<T extends Agenda.JobAttributesData = Agenda.JobAttributesData>(query: any, cb: ResultCallback<Agenda.Job<T>[]>): void;
|
||||
jobs<T extends Agenda.JobAttributesData = Agenda.JobAttributesData>(query: any): Promise<Agenda.Job<T>[]>;
|
||||
|
||||
/**
|
||||
* Removes all jobs in the database without defined behaviors. Useful if you change a definition name and want
|
||||
* to remove old jobs.
|
||||
* @param cb Called with the number of jobs removed.
|
||||
*/
|
||||
purge(cb?: ResultCallback<number>): void;
|
||||
purge(): Promise<number>;
|
||||
|
||||
/**
|
||||
* Defines a job with the name of jobName. When a job of job name gets run, it will be passed to fn(job, done).
|
||||
@@ -123,46 +121,41 @@ declare class Agenda extends EventEmitter {
|
||||
* @param names The name or names of the job(s) to run.
|
||||
* @param data An optional argument that will be passed to the processing function under job.attrs.data.
|
||||
* @param options An optional argument that will be passed to job.repeatEvery.
|
||||
* @param cb An optional callback function which will be called when the job has been persisted in the database.
|
||||
*/
|
||||
every<T extends Agenda.JobAttributesData = Agenda.JobAttributesData>(interval: number | string, names: string, data?: T, options?: any, cb?: ResultCallback<Agenda.Job<T>>): Agenda.Job<T>;
|
||||
every<T extends Agenda.JobAttributesData = Agenda.JobAttributesData>(interval: number | string, names: string[], data?: T, options?: any, cb?: ResultCallback<Agenda.Job<T>[]>): Agenda.Job<T>[];
|
||||
every<T extends Agenda.JobAttributesData = Agenda.JobAttributesData>(interval: number | string, names: string, data?: T, options?: any): Promise<Agenda.Job<T>>;
|
||||
every<T extends Agenda.JobAttributesData = Agenda.JobAttributesData>(interval: number | string, names: string[], data?: T, options?: any): Promise<Agenda.Job<T>[]>;
|
||||
|
||||
/**
|
||||
* Schedules a job to run name once at a given time.
|
||||
* @param when A Date or a String such as tomorrow at 5pm.
|
||||
* @param names The name or names of the job(s) to run.
|
||||
* @param data An optional argument that will be passed to the processing function under job.attrs.data.
|
||||
* @param cb An optional callback function which will be called when the job has been persisted in the database.
|
||||
*/
|
||||
schedule<T extends Agenda.JobAttributesData = Agenda.JobAttributesData>(when: Date | string, names: string, data?: T, cb?: ResultCallback<Agenda.Job<T>>): Agenda.Job<T>;
|
||||
schedule<T extends Agenda.JobAttributesData = Agenda.JobAttributesData>(when: Date | string, names: string[], data?: T, cb?: ResultCallback<Agenda.Job<T>[]>): Agenda.Job<T>[];
|
||||
schedule<T extends Agenda.JobAttributesData = Agenda.JobAttributesData>(when: Date | string, names: string, data?: T): Promise<Agenda.Job<T>>;
|
||||
schedule<T extends Agenda.JobAttributesData = Agenda.JobAttributesData>(when: Date | string, names: string[], data?: T): Promise<Agenda.Job<T>[]>;
|
||||
|
||||
/**
|
||||
* Schedules a job to run name once immediately.
|
||||
* @param name The name of the job to run.
|
||||
* @param data An optional argument that will be passed to the processing function under job.attrs.data.
|
||||
* @param cb An optional callback function which will be called when the job has been persisted in the database.
|
||||
*/
|
||||
now<T extends Agenda.JobAttributesData = Agenda.JobAttributesData>(name: string, data?: T, cb?: ResultCallback<Agenda.Job<T>>): Agenda.Job<T>;
|
||||
now<T extends Agenda.JobAttributesData = Agenda.JobAttributesData>(name: string, data?: T): Promise<Agenda.Job<T>>;
|
||||
|
||||
/**
|
||||
* Cancels any jobs matching the passed mongodb-native query, and removes them from the database.
|
||||
* @param query Mongodb native query.
|
||||
* @param cb Called with the number of jobs removed.
|
||||
*/
|
||||
cancel(query: any, cb?: ResultCallback<number>): void;
|
||||
cancel(query: any): Promise<number>;
|
||||
|
||||
/**
|
||||
* Starts the job queue processing, checking processEvery time to see if there are new jobs.
|
||||
*/
|
||||
start(): void;
|
||||
start(): Promise<void>;
|
||||
|
||||
/**
|
||||
* Stops the job queue processing. Unlocks currently running jobs.
|
||||
* @param cb Called after the job processing queue shuts down and unlocks all jobs.
|
||||
*/
|
||||
stop(cb: Callback): void;
|
||||
stop(): Promise<void>;
|
||||
}
|
||||
|
||||
declare namespace Agenda {
|
||||
@@ -210,17 +203,7 @@ declare namespace Agenda {
|
||||
/**
|
||||
* Specifies that Agenda should be initialized using and existing MongoDB connection.
|
||||
*/
|
||||
mongo?: {
|
||||
/**
|
||||
* The MongoDB database connection to use.
|
||||
*/
|
||||
db: Db;
|
||||
|
||||
/**
|
||||
* The name of the collection to use.
|
||||
*/
|
||||
collection?: string;
|
||||
}
|
||||
mongo?: Db;
|
||||
|
||||
/**
|
||||
* Specifies that Agenda should connect to MongoDB.
|
||||
@@ -228,8 +211,10 @@ declare namespace Agenda {
|
||||
db?: {
|
||||
/**
|
||||
* The connection URL.
|
||||
* Required when using `db` option to connect.
|
||||
* Not required when an existing connection is passed as `mongo` property.
|
||||
*/
|
||||
address: string;
|
||||
address?: string;
|
||||
|
||||
/**
|
||||
* The name of the collection to use.
|
||||
@@ -238,6 +223,7 @@ declare namespace Agenda {
|
||||
|
||||
/**
|
||||
* Connection options to pass to MongoDB.
|
||||
* Not required when an existing connection is passed as `mongo` property.
|
||||
*/
|
||||
options?: any;
|
||||
}
|
||||
@@ -350,57 +336,57 @@ declare namespace Agenda {
|
||||
/**
|
||||
* Specifies an interval on which the job should repeat.
|
||||
* @param interval A human-readable format String, a cron format String, or a Number.
|
||||
* @param options An optional argument that can include a timezone field. The timezone should be a string as
|
||||
* accepted by moment-timezone and is considered when using an interval in the cron string format.
|
||||
* @param options An optional argument that can include a timezone field or skipImmediate field.
|
||||
* The timezone should be a string as accepted by moment-timezone and is considered when using an interval in the cron string format.
|
||||
* Setting skipImmediate as true will skip the immediate run. The first run will occur only in configured interval.
|
||||
*/
|
||||
repeatEvery(interval: string | number, options?: { timezone?: string }): Job<T>
|
||||
repeatEvery(interval: string | number, options?: { timezone?: string, skipImmediate?: boolean }): this
|
||||
|
||||
/**
|
||||
* Specifies a time when the job should repeat. [Possible values](https://github.com/matthewmueller/date#examples).
|
||||
* @param time
|
||||
*/
|
||||
repeatAt(time: string): Job<T>
|
||||
repeatAt(time: string): this
|
||||
|
||||
/**
|
||||
* Disables the job.
|
||||
*/
|
||||
disable(): Job<T>;
|
||||
disable(): this;
|
||||
|
||||
/**
|
||||
* Enables the job.
|
||||
*/
|
||||
enable(): Job<T>;
|
||||
enable(): this;
|
||||
|
||||
/**
|
||||
* Ensure that only one instance of this job exists with the specified properties
|
||||
* @param value The properties associated with the job that must be unqiue.
|
||||
* @param opts
|
||||
*/
|
||||
unique(value: any, opts?: { insertOnly?: boolean }): Job<T>;
|
||||
unique(value: any, opts?: { insertOnly?: boolean }): this;
|
||||
|
||||
/**
|
||||
* Specifies the next time at which the job should run.
|
||||
* @param time The next time at which the job should run.
|
||||
*/
|
||||
schedule(time: string | Date): Job<T>;
|
||||
schedule(time: string | Date): this;
|
||||
|
||||
/**
|
||||
* Specifies the priority weighting of the job.
|
||||
* @param value The priority of the job (lowest|low|normal|high|highest|number).
|
||||
*/
|
||||
priority(value: string | number): Job<T>;
|
||||
priority(value: string | number): this;
|
||||
|
||||
/**
|
||||
* Sets job.attrs.failedAt to now, and sets job.attrs.failReason to reason.
|
||||
* @param reason A message or Error object that indicates why the job failed.
|
||||
*/
|
||||
fail(reason: string | Error): Job<T>;
|
||||
fail(reason: string | Error): this;
|
||||
|
||||
/**
|
||||
* Runs the given job and calls callback(err, job) upon completion. Normally you never need to call this manually
|
||||
* @param cb Called when the job is completed.
|
||||
*/
|
||||
run(cb?: ResultCallback<Job<T>>): Job<T>;
|
||||
run(): Promise<this>;
|
||||
|
||||
/**
|
||||
* Returns true if the job is running; otherwise, returns false.
|
||||
@@ -409,27 +395,24 @@ declare namespace Agenda {
|
||||
|
||||
/**
|
||||
* Saves the job into the database.
|
||||
* @param cb Called when the job is saved.
|
||||
*/
|
||||
save(cb?: ResultCallback<Job<T>>): Job<T>;
|
||||
save(): Promise<this>;
|
||||
|
||||
/**
|
||||
* Removes the job from the database and cancels the job.
|
||||
* @param cb Called after the job has beeb removed from the database.
|
||||
*/
|
||||
remove(cb?: Callback): void;
|
||||
remove(): Promise<void>;
|
||||
|
||||
/**
|
||||
* Resets the lock on the job. Useful to indicate that the job hasn't timed out when you have very long running
|
||||
* jobs.
|
||||
* @param cb Called after the job has been saved to the database.
|
||||
*/
|
||||
touch(cb?: Callback): void;
|
||||
touch(): Promise<this>;
|
||||
|
||||
/**
|
||||
* Calculates next time the job should run
|
||||
*/
|
||||
computeNextRunAt(): Job<T>;
|
||||
computeNextRunAt(): this;
|
||||
}
|
||||
|
||||
interface JobOptions {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import agent = require('agent-base');
|
||||
|
||||
agent(); // $ExpectType Agent
|
||||
agent({ timeout: 1000 }); // $ExpectType Agent
|
||||
|
||||
agent((req, opts) => {}); // $ExpectType Agent
|
||||
agent((req, opts) => {}, { timeout: 1000 }); // $ExpectType Agent
|
||||
|
||||
agent(async (req, opts) => {}); // $ExpectType Agent
|
||||
agent(async (req, opts) => {}, { timeout: 1000 }); // $ExpectType Agent
|
||||
|
||||
agent(0); // $ExpectError
|
||||
agent(1); // $ExpectError
|
||||
agent(''); // $ExpectError
|
||||
agent(true); // $ExpectError
|
||||
agent(null); // $ExpectError
|
||||
|
||||
agent((req, opts) => {}, 0); // $ExpectError
|
||||
agent((req, opts) => {}, 1); // $ExpectError
|
||||
agent((req, opts) => {}, ''); // $ExpectError
|
||||
agent((req, opts) => {}, true); // $ExpectError
|
||||
agent((req, opts) => {}, null); // $ExpectError
|
||||
agent((req, opts) => {}, (req, opts) => {}); // $ExpectError
|
||||
Vendored
+44
@@ -0,0 +1,44 @@
|
||||
// Type definitions for agent-base 4.2
|
||||
// Project: https://github.com/TooTallNate/node-agent-base#readme
|
||||
// Definitions by: Christopher Quadflieg <https://github.com/Shinigami92>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
declare namespace Agent {
|
||||
type AgentCallback = (
|
||||
req?: any,
|
||||
opts?: {
|
||||
secureEndpoint: boolean;
|
||||
}
|
||||
) => void;
|
||||
|
||||
interface AgentOptions {
|
||||
timeout?: number;
|
||||
host?: string;
|
||||
port?: number;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface Agent extends EventEmitter {
|
||||
_promisifiedCallback: boolean;
|
||||
timeout: number | null;
|
||||
options?: AgentOptions;
|
||||
callback: AgentCallback;
|
||||
addRequest: (req?: any, opts?: any) => void;
|
||||
freeSocket: (socket: any, opts: any) => void;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Base `http.Agent` implementation.
|
||||
* No pooling/keep-alive is implemented by default.
|
||||
*/
|
||||
declare function Agent(opts?: Agent.AgentOptions): Agent.Agent;
|
||||
declare function Agent(
|
||||
callback: Agent.AgentCallback,
|
||||
opts?: Agent.AgentOptions
|
||||
): Agent.Agent;
|
||||
|
||||
export = Agent;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"agent-base-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
let client = AgoraRTC.createClient({
|
||||
mode: 'live',
|
||||
codec: 'vp8'
|
||||
});
|
||||
|
||||
let stream = AgoraRTC.createStream({
|
||||
video: true,
|
||||
audio: true,
|
||||
streamID: 21230,
|
||||
screen: false
|
||||
});
|
||||
|
||||
client.init('74a0b7bb5d3e47c7abca0533d17b0afa', () => {
|
||||
client.join('74a0b7bb5d3e47c7abca0533d17b0afa', 'testyy', 21230, uid => {
|
||||
stream.init(() => {
|
||||
client.publish(stream, err => {
|
||||
throw(err);
|
||||
});
|
||||
}, err => {
|
||||
throw(err);
|
||||
});
|
||||
}, err => {
|
||||
throw(err);
|
||||
});
|
||||
}, err => {
|
||||
throw(err);
|
||||
});
|
||||
Vendored
+314
@@ -0,0 +1,314 @@
|
||||
// Type definitions for agora-rtc-sdk 2.3
|
||||
// Project: https://github.com/AgoraIO/web-archive#readme
|
||||
// Definitions by: Menthays <https://github.com/menthays>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/*~ If this module is a UMD module that exposes a global variable 'myLib' when
|
||||
*~ loaded outside a module loader environment, declare that global here.
|
||||
*~ Otherwise, delete this declaration.
|
||||
*/
|
||||
export as namespace AgoraRTC;
|
||||
|
||||
/*~ If this module has methods, declare them as functions like so.
|
||||
*/
|
||||
export function createClient(config: ClientConfig): Client;
|
||||
export function createStream(spec: StreamSpec): Stream;
|
||||
export function checkSystemRequirements(): boolean;
|
||||
export function getDevices(callback: (devices: any[]) => void): void;
|
||||
|
||||
/*~ You can declare types that are available via importing the module */
|
||||
export interface ClientConfig {
|
||||
mode: 'live' | 'rtc';
|
||||
codec: 'vp8' | 'h264';
|
||||
proxyServer?: string;
|
||||
turnServer?: {
|
||||
turnServerURL: string;
|
||||
username: string;
|
||||
password: string;
|
||||
udpport: string;
|
||||
tcpport: string;
|
||||
forceturn: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface StreamSpec {
|
||||
streamID: number;
|
||||
audio: boolean;
|
||||
video: boolean;
|
||||
screen: boolean;
|
||||
cameraId?: string;
|
||||
microphoneId?: string;
|
||||
mirror?: boolean;
|
||||
extensionid?: string;
|
||||
mediaSource?: 'screen' | 'application' | 'window';
|
||||
audioProcessing?: {
|
||||
AGC: boolean;
|
||||
};
|
||||
attributes?: {
|
||||
resolution: string;
|
||||
minFrameRate: number;
|
||||
maxFrameRate: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface LocalStreamStats {
|
||||
audioSendBytes: string;
|
||||
audioSendPackets: string;
|
||||
videoSendBytes: string;
|
||||
videoSendPackets: string;
|
||||
videoSendPacketsLost: string;
|
||||
videoSendFrameRate: string;
|
||||
videoSendBandwidth: string;
|
||||
videoSendResolutionWidth?: string;
|
||||
videoSendResolutionHeight?: string;
|
||||
audioCodecName: string;
|
||||
videoCodecName: string;
|
||||
timestamp: string;
|
||||
startTime: string;
|
||||
duration: string;
|
||||
}
|
||||
|
||||
export interface RemoteStreamStats {
|
||||
audioReceiveBytes: string;
|
||||
audioReceivePackets: string;
|
||||
audioReceivePacketsLost: string;
|
||||
videoReceiveBytes: string;
|
||||
videoReceivePackets: string;
|
||||
videoReceivePacketsLost: string;
|
||||
videoReceiveFrameRate?: string;
|
||||
videoReceiveDecodeFrameRate?: string;
|
||||
videoReceiveBandwidth?: string;
|
||||
videoReceivedResolutionWidth?: string;
|
||||
videoReceivedResolutionHeight?: string;
|
||||
timestamp: string;
|
||||
startTime: string;
|
||||
duration: string;
|
||||
}
|
||||
|
||||
export type VideoProfile =
|
||||
| '120p'
|
||||
| '120p_1'
|
||||
| '120p_3'
|
||||
| '180p'
|
||||
| '180p_1'
|
||||
| '180p_3'
|
||||
| '180p_4'
|
||||
| '240p'
|
||||
| '240p_1'
|
||||
| '240p_3'
|
||||
| '240p_4'
|
||||
| '360p'
|
||||
| '360p_1'
|
||||
| '360p_3'
|
||||
| '360p_4'
|
||||
| '360p_6'
|
||||
| '360p_7'
|
||||
| '360p_8'
|
||||
| '360p_9'
|
||||
| '360p_10'
|
||||
| '360p_11'
|
||||
| '480p'
|
||||
| '480p_1'
|
||||
| '480p_2'
|
||||
| '480p_3'
|
||||
| '480p_4'
|
||||
| '480p_6'
|
||||
| '480p_8'
|
||||
| '480p_9'
|
||||
| '480p_10'
|
||||
| '720p'
|
||||
| '720p_1'
|
||||
| '720p_2'
|
||||
| '720p_3'
|
||||
| '720p_5'
|
||||
| '720p_6'
|
||||
| '1080p'
|
||||
| '1080p_1'
|
||||
| '1080p_2'
|
||||
| '1080p_3'
|
||||
| '1080p_5'
|
||||
| '1440p'
|
||||
| '1440p_1'
|
||||
| '1440p_2'
|
||||
| '4K'
|
||||
| '4K_1'
|
||||
| '4K_3';
|
||||
|
||||
export type FirefoxVideoProfile =
|
||||
| '480p'
|
||||
| '480p_1'
|
||||
| '480p_2'
|
||||
| '480p_3'
|
||||
| '480p_4'
|
||||
| '480p_6'
|
||||
| '480p_8'
|
||||
| '480p_9'
|
||||
| '480p_10'
|
||||
| '720p'
|
||||
| '720p_1'
|
||||
| '720p_2'
|
||||
| '720p_3'
|
||||
| '720p_5'
|
||||
| '720p_6';
|
||||
|
||||
export type SafariVideoProfile =
|
||||
| '480p'
|
||||
| '480p_1'
|
||||
| '480p_2'
|
||||
| '480p_3'
|
||||
| '480p_4'
|
||||
| '480p_6'
|
||||
| '480p_8'
|
||||
| '480p_9'
|
||||
| '480p_10'
|
||||
| '720p'
|
||||
| '720p_1'
|
||||
| '720p_2'
|
||||
| '720p_3'
|
||||
| '720p_5'
|
||||
| '720p_6'
|
||||
| '1080p'
|
||||
| '1080p_1'
|
||||
| '1080p_2'
|
||||
| '1080p_3'
|
||||
| '1080p_5'
|
||||
| '1440p'
|
||||
| '1440p_1'
|
||||
| '1440p_2'
|
||||
| '4K'
|
||||
| '4K_1'
|
||||
| '4K_3';
|
||||
|
||||
export type ScreenSharingProfile =
|
||||
| '480p_1'
|
||||
| '480p_2'
|
||||
| '720p_1'
|
||||
| '720p_2'
|
||||
| '1080p_1'
|
||||
| '1080p_2';
|
||||
|
||||
export type ClientEvent =
|
||||
| 'stream-published'
|
||||
| 'stream-added'
|
||||
| 'stream-removed'
|
||||
| 'stream-subscribed'
|
||||
| 'peer-leave'
|
||||
| 'mute-audio'
|
||||
| 'unmute-audio'
|
||||
| 'mute-video'
|
||||
| 'unmute-video'
|
||||
| 'client-banned'
|
||||
| 'active-speaker'
|
||||
| 'error';
|
||||
|
||||
export interface Stream {
|
||||
getStats(
|
||||
callback: (stats: LocalStreamStats | RemoteStreamStats) => void
|
||||
): void;
|
||||
init(onSuccess: () => void, onFailure: (err: any) => void): void;
|
||||
getId(): number;
|
||||
getAttributes(): any;
|
||||
getAudioLevel(): number;
|
||||
hasVideo(): boolean;
|
||||
hasAudio(): boolean;
|
||||
enableVideo(): void;
|
||||
disableVideo(): void;
|
||||
enableAudio(): void;
|
||||
disableAudio(): void;
|
||||
setVideoProfile(
|
||||
profile:
|
||||
| VideoProfile
|
||||
| FirefoxVideoProfile
|
||||
| SafariVideoProfile
|
||||
| ScreenSharingProfile
|
||||
): void;
|
||||
play(HTMLElementID: string): void;
|
||||
stop(): void;
|
||||
close(): void;
|
||||
}
|
||||
|
||||
export interface Client {
|
||||
on(eventName: ClientEvent, callback: (evt: any) => void): void;
|
||||
init(
|
||||
appId: string,
|
||||
onSuccess: () => void,
|
||||
onFailure: (err: any) => void
|
||||
): void;
|
||||
join(
|
||||
tokenOrKey: string,
|
||||
channel: string,
|
||||
uid: number,
|
||||
onSuccess: (uid: number) => void,
|
||||
onFailure: (err: any) => void
|
||||
): void;
|
||||
renewChannelKey(
|
||||
key: string,
|
||||
onSuccess: () => void,
|
||||
onFailure: (err: any) => void
|
||||
): void;
|
||||
enableDualStream(
|
||||
onSuccess: () => void,
|
||||
onFailure: (err: any) => void
|
||||
): void;
|
||||
setRemoteVideoStreamType(stream: Stream, streamType: 0 | 1): void;
|
||||
setLowStreamParameter(param: {
|
||||
width: number;
|
||||
height: number;
|
||||
framerate: number;
|
||||
birate: number;
|
||||
}): void;
|
||||
disableDualStream(
|
||||
onSuccess: () => void,
|
||||
onFailure: (err: any) => void
|
||||
): void;
|
||||
leave(onSuccess: () => void, onFailure: (err: any) => void): void;
|
||||
publish(stream: Stream, onFailure: (err: any) => void): void;
|
||||
unpublish(stream: Stream, onFailure: (err: any) => void): void;
|
||||
subscribe(stream: Stream, onFailure: (err: any) => void): void;
|
||||
unsubscribe(stream: Stream, onFailure: (err: any) => void): void;
|
||||
setProxyServer(proxyServer: ClientConfig['proxyServer']): void;
|
||||
setTurnServer(turnServer: ClientConfig['turnServer']): void;
|
||||
setEncryptionSecret(password: string): void;
|
||||
setEncryptionMode(
|
||||
encryptionMode: 'aes-128-xts' | 'aes-256-xts' | 'aes-128-ecb'
|
||||
): void;
|
||||
}
|
||||
|
||||
/*~ You can declare properties of the module using const, let, or var */
|
||||
export const VERSION: string;
|
||||
|
||||
export const AUDIO_SAMPLE_RATE_32000: 32000;
|
||||
export const AUDIO_SAMPLE_RATE_44100: 44100;
|
||||
export const AUDIO_SAMPLE_RATE_48000: 48000;
|
||||
|
||||
export const VIDEO_CODEC_PROFILE_BASELINE: 66;
|
||||
export const VIDEO_CODEC_PROFILE_MAIN: 77;
|
||||
export const VIDEO_CODEC_PROFILE_HIGH: 100;
|
||||
|
||||
export const REMOTE_VIDEO_STREAM_HIGH: 0;
|
||||
export const REMOTE_VIDEO_STREAM_LOW: 1;
|
||||
export const REMOTE_VIDEO_STREAM_MEDIUM: 2;
|
||||
/*~ If there are types, properties, or methods inside dotted names
|
||||
*~ of the module, declare them inside a 'namespace'.
|
||||
*/
|
||||
export namespace Logger {
|
||||
/*~ For example, given this definition, someone could write:
|
||||
*~ import { subProp } from 'yourModule';
|
||||
*~ subProp.foo();
|
||||
*~ or
|
||||
*~ import * as yourMod from 'yourModule';
|
||||
*~ yourMod.subProp.foo();
|
||||
*/
|
||||
type DEBUG = 0;
|
||||
type INFO = 1;
|
||||
type WARNING = 2;
|
||||
type ERROR = 3;
|
||||
type NONE = 4;
|
||||
function setLogLevel(level: DEBUG|INFO|WARNING|NONE): void;
|
||||
function log(args: any): void;
|
||||
function debug(args: any): void;
|
||||
function info(args: any): void;
|
||||
function warning(args: any): void;
|
||||
function error(args: any): void;
|
||||
}
|
||||
@@ -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",
|
||||
"agora-rtc-sdk-tests.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+13
@@ -764,6 +764,11 @@ declare namespace algoliasearch {
|
||||
* https://github.com/algolia/algoliasearch-client-js#client-options
|
||||
*/
|
||||
hosts?: { read?: string[]; write?: string[] };
|
||||
/**
|
||||
* enable the experimental feature: caching requests instead of responses
|
||||
* see https://github.com/algolia/algoliasearch-client-javascript/pull/694
|
||||
*/
|
||||
_useRequestCache?: boolean
|
||||
}
|
||||
/**
|
||||
* Interface describing options available for gettings the logs
|
||||
@@ -1771,6 +1776,14 @@ declare namespace algoliasearch {
|
||||
facets?: {
|
||||
[facetName: string]: { [facetValue: string]: number };
|
||||
};
|
||||
facets_stats?: {
|
||||
[facetName: string]: {
|
||||
avg: number,
|
||||
max: number,
|
||||
min: number,
|
||||
sum: number,
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
interface MultiResponse {
|
||||
|
||||
Vendored
+14
@@ -4,6 +4,7 @@
|
||||
// Haroen Viaene <https://github.com/haroenv>
|
||||
// Aurélien Hervé <https://github.com/aherve>
|
||||
// Samuel Vaillant <https://github.com/samouss>
|
||||
// Claas Brüggemann <https://github.com/ClaasBrueggemann>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@@ -180,6 +181,11 @@ declare namespace algoliasearch {
|
||||
* https://github.com/algolia/algoliasearch-client-js#client-options
|
||||
*/
|
||||
hosts?: { read?: string[]; write?: string[] };
|
||||
/**
|
||||
* enable the experimental feature: caching requests instead of responses
|
||||
* see https://github.com/algolia/algoliasearch-client-javascript/pull/694
|
||||
*/
|
||||
_useRequestCache?: boolean
|
||||
}
|
||||
interface BrowseResponse {
|
||||
cursor?: string;
|
||||
@@ -565,6 +571,14 @@ declare namespace algoliasearch {
|
||||
facets?: {
|
||||
[facetName: string]: { [facetValue: string]: number };
|
||||
};
|
||||
facets_stats?: {
|
||||
[facetName: string]: {
|
||||
avg: number,
|
||||
max: number,
|
||||
min: number,
|
||||
sum: number,
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
interface MultiResponse {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as almostEqual from 'almost-equal';
|
||||
|
||||
const res1 = almostEqual(1.999999, 2.0);
|
||||
|
||||
const res2 = almostEqual(1.999999, 2.0, almostEqual.DBL_EPSILON);
|
||||
|
||||
const res3 = almostEqual(1.999999, 2.0, almostEqual.FLT_EPSILON, almostEqual.FLT_EPSILON);
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// Type definitions for almost-equal 1.1
|
||||
// Project: https://github.com/mikolalysenko/almost-equal#readme
|
||||
// Definitions by: Curtis Maddalozzo <https://github.com/cmaddalozzo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function almostEqual(value: number, other: number, absoluteTolerance?: number, relativeTolerance?: number): boolean;
|
||||
declare namespace almostEqual {
|
||||
const FLT_EPSILON: number;
|
||||
const DBL_EPSILON: number;
|
||||
}
|
||||
export = almostEqual;
|
||||
+2
-2
@@ -7,17 +7,17 @@
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"strictFunctionTypes": true,
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"fork-ts-checker-webpack-plugin-tests.ts"
|
||||
"almost-equal-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/goatslacker/alt
|
||||
// Definitions by: Michael Shearer <https://github.com/Shearerbeard>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
///<reference types="react"/>
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ new Stream({
|
||||
highWaterMark: 1,
|
||||
decodeStrings: true,
|
||||
objectMode: true,
|
||||
destroy: (error?: Error) => {
|
||||
destroy: (error: Error | null) => {
|
||||
return 'handle error';
|
||||
},
|
||||
final: (callback: (error?: Error) => void) => {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import * as amqp from "amqplib";
|
||||
import * as amqpConMgr from 'amqp-connection-manager';
|
||||
|
||||
// from README.md
|
||||
const connection = amqpConMgr.connect(['amqp://localhost']);
|
||||
const channelWrapper: amqpConMgr.ChannelWrapper = connection.createChannel({
|
||||
json: true,
|
||||
setup: async (channel: amqp.ConfirmChannel): Promise<void> => {
|
||||
// `channel` here is a regular amqplib `ConfirmChannel`. Unfortunately its typings make it return a bluebird-specific promise
|
||||
// tslint:disable-next-line:await-promise
|
||||
await channel.assertQueue('rxQueueName', {durable: true});
|
||||
}
|
||||
});
|
||||
|
||||
connection.on("connect", (_arg: { connection: amqp.Connection, url: string }): void => undefined);
|
||||
connection.on("disconnect", (_arg: { err: Error }): void => undefined);
|
||||
|
||||
channelWrapper.on("close", () => undefined);
|
||||
channelWrapper.on("connect", () => undefined);
|
||||
channelWrapper.on("error", (_error: Error) => undefined);
|
||||
|
||||
channelWrapper.sendToQueue("foo", Buffer.from("bar"))
|
||||
.catch((error: Error): void => {
|
||||
// nothing
|
||||
});
|
||||
+184
@@ -0,0 +1,184 @@
|
||||
// Type definitions for amqp-connection-manager 2.0
|
||||
// Project: https://github.com/benbria/node-amqp-connection-manager
|
||||
// Definitions by: rogierschouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { ConfirmChannel, Connection, Message, Options, Replies } from "amqplib";
|
||||
import { EventEmitter } from "events";
|
||||
import { SecureContextOptions } from "tls";
|
||||
|
||||
/**
|
||||
* connect() options
|
||||
*/
|
||||
export interface AmqpConnectionManagerOptions {
|
||||
/**
|
||||
* Interval to send heartbeats to broker. Defaults to 5 seconds.
|
||||
*/
|
||||
heartbeatIntervalInSeconds?: number;
|
||||
|
||||
/**
|
||||
* The time to wait before trying to reconnect. If not specified, defaults to heartbeatIntervalInSeconds
|
||||
*/
|
||||
reconnectTimeInSeconds?: number;
|
||||
|
||||
/**
|
||||
* is a function which returns one or more servers to connect to. This should return either a single URL or an array of URLs.
|
||||
* This is handy when you're using a service discovery mechanism such as Consul or etcd. Instead of taking a callback, this can also
|
||||
* return a Promise. Note that if this is supplied, then urls is ignored.
|
||||
*/
|
||||
findServers?: ((callback: (urls: string | string[]) => void) => void) | (() => Promise<string | string[]>);
|
||||
|
||||
/**
|
||||
* TLS options
|
||||
*/
|
||||
connectionOptions?: SecureContextOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new AmqpConnectionManager, which will connect to one of the URLs provided in urls.
|
||||
* If a broker is unreachable or dies, then AmqpConnectionManager will try the next available broker, round-robin.
|
||||
* @param urls
|
||||
* @param options
|
||||
*/
|
||||
export function connect(urls: string[], options?: AmqpConnectionManagerOptions): AmqpConnectionManager;
|
||||
|
||||
export type SetupFunc = ((channel: ConfirmChannel, callback: (error?: Error) => void) => void) | ((channel: ConfirmChannel) => Promise<void>);
|
||||
|
||||
export interface CreateChannelOpts {
|
||||
/**
|
||||
* Name for this channel. Used for debugging.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* A function to call whenever we reconnect to the broker (and therefore create a new underlying channel.)
|
||||
* This function should either accept a callback, or return a Promise. See addSetup below
|
||||
*/
|
||||
setup?: SetupFunc;
|
||||
/**
|
||||
* if true, then ChannelWrapper assumes all messages passed to publish() and sendToQueue() are plain JSON objects.
|
||||
* These will be encoded automatically before being sent.
|
||||
*/
|
||||
json?: boolean;
|
||||
}
|
||||
|
||||
export interface AmqpConnectionManager extends EventEmitter {
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this;
|
||||
addListener(event: "disconnect", listener: (arg: {err: Error}) => void): this;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this;
|
||||
on(event: "disconnect", listener: (arg: {err: Error}) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this;
|
||||
once(event: "disconnect", listener: (arg: {err: Error}) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this;
|
||||
prependListener(event: "disconnect", listener: (arg: {err: Error}) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "connect", listener: (arg: { connection: Connection, url: string }) => void): this;
|
||||
prependOnceListener(event: "disconnect", listener: (arg: {err: Error}) => void): this;
|
||||
|
||||
/**
|
||||
* Create a new ChannelWrapper. This is a proxy for the actual channel (which may or may not exist at any moment, depending on whether or not we are currently connected.)
|
||||
* @param opts
|
||||
*/
|
||||
createChannel(opts: CreateChannelOpts): ChannelWrapper;
|
||||
|
||||
/**
|
||||
* Returns true if the AmqpConnectionManager is connected to a broker, false otherwise.
|
||||
*/
|
||||
isConnected(): boolean;
|
||||
|
||||
/**
|
||||
* Close this AmqpConnectionManager and free all associated resources.
|
||||
*/
|
||||
close(): Promise<void>;
|
||||
}
|
||||
|
||||
export interface ChannelWrapper extends EventEmitter {
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "connect", listener: () => void): this;
|
||||
addListener(event: "error", listener: (err: Error, info: { name: string }) => void): this;
|
||||
addListener(event: "close", listener: () => void): this;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "connect", listener: () => void): this;
|
||||
on(event: "error", listener: (err: Error, info: { name: string }) => void): this;
|
||||
on(event: "close", listener: () => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "connect", listener: () => void): this;
|
||||
once(event: "error", listener: (err: Error, info: { name: string }) => void): this;
|
||||
once(event: "close", listener: () => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "connect", listener: () => void): this;
|
||||
prependListener(event: "error", listener: (err: Error, info: { name: string }) => void): this;
|
||||
prependListener(event: "close", listener: () => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "connect", listener: () => void): this;
|
||||
prependOnceListener(event: "error", listener: (err: Error, info: { name: string }) => void): this;
|
||||
prependOnceListener(event: "close", listener: () => void): this;
|
||||
|
||||
/**
|
||||
* Adds a new 'setup handler'. setup(channel, [cb]) is a function to call when a new underlying channel is created -
|
||||
* handy for asserting exchanges and queues exists, and whatnot. The channel object here is a ConfirmChannel from amqplib.
|
||||
* The setup function should return a Promise (or optionally take a callback) - no messages will be sent until this Promise resolves.
|
||||
* If there is a connection, setup() will be run immediately, and the addSetup Promise/callback won't resolve until setup is complete.
|
||||
* Note that in this case, if the setup throws an error, no 'error' event will be emitted, since you can just handle the error here
|
||||
* (although the setup will still be added for future reconnects, even if it throws an error.)
|
||||
* Setup functions should, ideally, not throw errors, but if they do then the ChannelWrapper will emit an 'error' event.
|
||||
* @param func
|
||||
*/
|
||||
addSetup(func: SetupFunc): Promise<void>;
|
||||
|
||||
/**
|
||||
* @see amqplib
|
||||
* @param exchange
|
||||
* @param routingKey
|
||||
* @param content
|
||||
* @param options
|
||||
* @param callback
|
||||
*/
|
||||
publish(exchange: string, routingKey: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): Promise<void>;
|
||||
|
||||
/**
|
||||
* @see amqplib
|
||||
* @param queue
|
||||
* @param content
|
||||
* @param options
|
||||
* @param callback
|
||||
*/
|
||||
sendToQueue(queue: string, content: Buffer, options?: Options.Publish, callback?: (err: any, ok: Replies.Empty) => void): Promise<void>;
|
||||
|
||||
/**
|
||||
* @see amqplib
|
||||
* @param message
|
||||
* @param allUpTo
|
||||
*/
|
||||
ack(message: Message, allUpTo?: boolean): void;
|
||||
|
||||
/**
|
||||
* @see amqplib
|
||||
* @param message
|
||||
* @param allUpTo
|
||||
* @param requeue
|
||||
*/
|
||||
nack(message: Message, allUpTo?: boolean, requeue?: boolean): void;
|
||||
|
||||
/**
|
||||
* Returns a count of messages currently waiting to be sent to the underlying channel.
|
||||
*/
|
||||
queueLength(): number;
|
||||
|
||||
/**
|
||||
* Close a channel, clean up resources associated with it.
|
||||
*/
|
||||
close(): Promise<void>;
|
||||
}
|
||||
@@ -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",
|
||||
"amqp-connection-manager-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"strict-export-declare-modifiers": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/squaremo/amqp.node
|
||||
// Definitions by: Michael Nahkies <https://github.com/mnahkies>, Ab Reitsma <https://github.com/abreits>, Nicolás Fantone <https://github.com/nfantone>, Nick Zelei <https://github.com/zelein>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
@@ -38,4 +38,9 @@ app.controller('Ctrl', ($scope: ng.IScope, blockUI: angular.blockUI.BlockUIServi
|
||||
blockUI.message("Hello Types");
|
||||
blockUI.done();
|
||||
const b: boolean = blockUI.isBlocking();
|
||||
|
||||
const myBlockUI = blockUI.instances.get("myBlockUI");
|
||||
myBlockUI.start();
|
||||
myBlockUI.reset();
|
||||
myBlockUI.stop();
|
||||
});
|
||||
|
||||
Vendored
+7
-1
@@ -1,6 +1,6 @@
|
||||
// Type definitions for angular-block-ui 0.2
|
||||
// Project: https://github.com/McNull/angular-block-ui
|
||||
// Definitions by: Lasse Nørregaard <https://github.com/lassebn>, Stephan Classen <https://github.com/sclassen>
|
||||
// Definitions by: Lasse Nørregaard <https://github.com/lassebn>, Stephan Classen <https://github.com/sclassen>, Soner Köksal <https://github.com/renjfk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -164,6 +164,12 @@ declare module 'angular' {
|
||||
* Returns whether currently a block is shown for the instance or not.
|
||||
*/
|
||||
isBlocking(): boolean;
|
||||
|
||||
instances: BlockUIInstances;
|
||||
}
|
||||
|
||||
interface BlockUIInstances {
|
||||
get(id: string): BlockUIService;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ declare module 'angular' {
|
||||
* This is an experimental technology
|
||||
* Ref: https://developer.mozilla.org/en-US/docs/Web/API/Notification/badge
|
||||
*/
|
||||
badge?: USVString;
|
||||
badge?: string;
|
||||
|
||||
/**
|
||||
* The data read-only property of the Notification interface returns a structured clone of the notification's data,
|
||||
@@ -40,7 +40,7 @@ declare module 'angular' {
|
||||
* Note: This feature is available in Web Workers.
|
||||
* Ref: https://developer.mozilla.org/en-US/docs/Web/API/Notification/image
|
||||
*/
|
||||
image?: USVString;
|
||||
image?: string;
|
||||
|
||||
/**
|
||||
* The renotify read-only property of the Notification interface specifies whether the user should be notified after a
|
||||
|
||||
@@ -24,6 +24,8 @@ angular.module("myApp").controller("helloController", function (gettextCatalog:
|
||||
|
||||
angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) {
|
||||
var myString2: string = gettextCatalog.getPlural(3, "Bird", "Birds");
|
||||
var myStringWithScope: string = gettextCatalog.getPlural(4, "{{color}} Bird", "{{color}} Birds", {color: 'Blue'});
|
||||
var myStringWithContext: string = gettextCatalog.getPlural(5, "pick", "picks", null, 'noun');
|
||||
});
|
||||
|
||||
angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) {
|
||||
|
||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for angular-gettext v2.1.0
|
||||
// Type definitions for angular-gettext v2.1.1
|
||||
// Project: https://angular-gettext.rocketeer.be/
|
||||
// Definitions by: Ákos Lukács <https://github.com/AkosLukacs>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -66,7 +66,7 @@ declare module 'angular' {
|
||||
getString(string: string, scope?: any, context?: string): string;
|
||||
|
||||
/** Translate a plural string with the given context. */
|
||||
getPlural(n: number, string: string, stringPlural: string, context?: any): string;
|
||||
getPlural(n: number, string: string, stringPlural: string, scope?: any, context?: string): string;
|
||||
|
||||
/** Load a set of translation strings from a given URL.This should be a JSON catalog generated with grunt-angular-gettext. More details https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/ */
|
||||
loadRemote(url: string): ng.IHttpPromise<any>;
|
||||
|
||||
@@ -87,7 +87,6 @@ timeoutService.verifyNoPendingTasks();
|
||||
let intervalService: ng.IIntervalService;
|
||||
let intervalServiceTimeActuallyAdvanced: number;
|
||||
|
||||
intervalServiceTimeActuallyAdvanced = intervalService.flush();
|
||||
intervalServiceTimeActuallyAdvanced = intervalService.flush(1234);
|
||||
|
||||
///////////////////////////////////////
|
||||
@@ -1509,12 +1508,30 @@ requestHandler.respond(expectedData);
|
||||
requestHandler.respond({ key: 'value' });
|
||||
requestHandler.respond({ key: 'value' }, { header: 'value' });
|
||||
requestHandler.respond({ key: 'value' }, { header: 'value' }, 'responseText');
|
||||
requestHandler.respond(404);
|
||||
requestHandler.respond(404, 'data');
|
||||
requestHandler.respond(404, 'data').respond({});
|
||||
requestHandler.respond(404, { key: 'value' });
|
||||
requestHandler.respond(404, { key: 'value' }, { header: 'value' });
|
||||
requestHandler.respond(404, { key: 'value' }, { header: 'value' }, 'responseText');
|
||||
|
||||
///////////////////////////////////////
|
||||
// IFlushPendingTasksService
|
||||
///////////////////////////////////////
|
||||
let $flushPendingTasks: ng.IFlushPendingTasksService;
|
||||
$flushPendingTasks();
|
||||
$flushPendingTasks(42);
|
||||
|
||||
///////////////////////////////////////
|
||||
// IVerifyNoPendingTasksService
|
||||
///////////////////////////////////////
|
||||
let $verifyNoPendingTasks: ng.IVerifyNoPendingTasksService;
|
||||
$verifyNoPendingTasks();
|
||||
$verifyNoPendingTasks('task type');
|
||||
|
||||
///////////////////////////////////////
|
||||
// browserTrigger
|
||||
///////////////////////////////////////
|
||||
browserTrigger(document.body, 'click');
|
||||
browserTrigger(angular.element(document.body), 'click');
|
||||
browserTrigger(angular.element(document.body), 'click', { which: 1, keys: ['ctrl'] });
|
||||
|
||||
Vendored
+112
-8
@@ -1,6 +1,8 @@
|
||||
// Type definitions for Angular JS (ngMock, ngMockE2E module) 1.6
|
||||
// Type definitions for Angular JS (ngMock, ngMockE2E module) 1.7
|
||||
// Project: http://angularjs.org
|
||||
// Definitions by: Diego Vilar <https://github.com/diegovilar>, Tony Curtis <https://github.com/daltin>
|
||||
// Definitions by: Diego Vilar <https://github.com/diegovilar>
|
||||
// Tony Curtis <https://github.com/daltin>
|
||||
// Georgii Dolzhykov <https://github.com/thorn0>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
@@ -59,7 +61,38 @@ declare module 'angular' {
|
||||
// Augments the original service
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface ITimeoutService {
|
||||
/**
|
||||
* **Deprecated** since version 1.7.3. (Use `$flushPendingTasks` instead.)
|
||||
*
|
||||
* ---
|
||||
* Flushes the queue of pending tasks.
|
||||
*
|
||||
* _This method is essentially an alias of `$flushPendingTasks`._
|
||||
*
|
||||
* > For historical reasons, this method will also flush non-`$timeout` pending tasks, such as
|
||||
* > `$q` promises and tasks scheduled via `$applyAsync` and `$evalAsync`.
|
||||
*
|
||||
* @param delay - The maximum timeout amount to flush up until.
|
||||
*/
|
||||
flush(delay?: number): void;
|
||||
|
||||
/**
|
||||
* **Deprecated** since version 1.7.3. (Use `$verifyNoPendingTasks` instead.)
|
||||
*
|
||||
* ---
|
||||
* Verifies that there are no pending tasks that need to be flushed. It throws an error if there
|
||||
* are still pending tasks.
|
||||
*
|
||||
* _This method is essentially an alias of `$verifyNoPendingTasks` (called with no arguments)._
|
||||
*
|
||||
* > For historical reasons, this method will also verify non-`$timeout` pending tasks, such as
|
||||
* > pending `$http` requests, in-progress `$route` transitions, unresolved `$q` promises and
|
||||
* > tasks scheduled via `$applyAsync` and `$evalAsync`.
|
||||
* >
|
||||
* > It is recommended to use `$verifyNoPendingTasks` instead, which additionally supports
|
||||
* > verifying a specific type of tasks. For example, you can verify there are no pending
|
||||
* > timeouts with `$verifyNoPendingTasks('$timeout')`.
|
||||
*/
|
||||
verifyNoPendingTasks(): void;
|
||||
}
|
||||
|
||||
@@ -69,7 +102,13 @@ declare module 'angular' {
|
||||
// Augments the original service
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IIntervalService {
|
||||
flush(millis?: number): number;
|
||||
/**
|
||||
* Runs interval tasks scheduled to be run in the next `millis` milliseconds.
|
||||
*
|
||||
* @param millis - The maximum timeout amount to flush up until.
|
||||
* @return The amount of time moved forward.
|
||||
*/
|
||||
flush(millis: number): number;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -413,6 +452,65 @@ declare module 'angular' {
|
||||
whenRoute(method: string, url: string): mock.IRequestHandler;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// FlushPendingTasksService
|
||||
// see https://docs.angularjs.org/api/ngMock/service/$flushPendingTasks
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IFlushPendingTasksService {
|
||||
/**
|
||||
* Flushes all currently pending tasks and executes the corresponding callbacks.
|
||||
*
|
||||
* Optionally, you can also pass a `delay` argument to only flush tasks that are scheduled to be
|
||||
* executed within `delay` milliseconds. Currently, `delay` only applies to timeouts, since all
|
||||
* other tasks have a delay of 0 (i.e. they are scheduled to be executed as soon as possible, but
|
||||
* still asynchronously).
|
||||
*
|
||||
* If no delay is specified, it uses a delay such that all currently pending tasks are flushed.
|
||||
*
|
||||
* The types of tasks that are flushed include:
|
||||
*
|
||||
* - Pending timeouts (via `$timeout`).
|
||||
* - Pending tasks scheduled via `$applyAsync`.
|
||||
* - Pending tasks scheduled via `$evalAsync`.
|
||||
* These include tasks scheduled via `$evalAsync()` indirectly (such as `$q` promises).
|
||||
*
|
||||
* > Periodic tasks scheduled via `$interval` use a different queue and are not flushed by
|
||||
* > `$flushPendingTasks()`. Use `$interval.flush(millis)` instead.
|
||||
*
|
||||
* @param millis - The number of milliseconds to flush.
|
||||
*/
|
||||
(delay?: number): void;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// VerifyNoPendingTasksService
|
||||
// see https://docs.angularjs.org/api/ngMock/service/$verifyNoPendingTasks
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
interface IVerifyNoPendingTasksService {
|
||||
/**
|
||||
* Verifies that there are no pending tasks that need to be flushed. It throws an error if there
|
||||
* are still pending tasks.
|
||||
*
|
||||
* You can check for a specific type of tasks only, by specifying a `taskType`.
|
||||
*
|
||||
* Available task types:
|
||||
*
|
||||
* - `$timeout`: Pending timeouts (via `$timeout`).
|
||||
* - `$http`: Pending HTTP requests (via `$http`).
|
||||
* - `$route`: In-progress route transitions (via `$route`).
|
||||
* - `$applyAsync`: Pending tasks scheduled via `$applyAsync`.
|
||||
* - `$evalAsync`: Pending tasks scheduled via `$evalAsync`.
|
||||
* These include tasks scheduled via `$evalAsync()` indirectly (such as `$q` promises).
|
||||
*
|
||||
* > Periodic tasks scheduled via `$interval` use a different queue and are not taken into
|
||||
* > account by `$verifyNoPendingTasks()`. There is currently no way to verify that there are no
|
||||
* > pending `$interval` tasks.
|
||||
*
|
||||
* @param taskType - The type of tasks to check for.
|
||||
*/
|
||||
(taskType?: string): void;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// AnimateService
|
||||
// see https://docs.angularjs.org/api/ngMock/service/$animate
|
||||
@@ -464,7 +562,7 @@ declare module 'angular' {
|
||||
*/
|
||||
respond(
|
||||
status: number,
|
||||
data: string | object,
|
||||
data?: string | object,
|
||||
headers?: IHttpHeaders,
|
||||
responseText?: string
|
||||
): IRequestHandler;
|
||||
@@ -513,6 +611,11 @@ declare module 'angular' {
|
||||
* for keyboard events (keydown, keypress, and keyup).
|
||||
*/
|
||||
charcode?: number;
|
||||
/**
|
||||
* [data](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent/data) for
|
||||
* [CompositionEvents](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent).
|
||||
*/
|
||||
data?: string;
|
||||
/**
|
||||
* The elapsedTime for
|
||||
* [TransitionEvent](https://developer.mozilla.org/docs/Web/API/TransitionEvent)
|
||||
@@ -566,10 +669,11 @@ declare global {
|
||||
* This is a global (window) function that is only available when the `ngMock` module is included.
|
||||
* It can be used to trigger a native browser event on an element, which is useful for unit testing.
|
||||
*
|
||||
* @param element Either a wrapped jQuery/jqLite node or a DOM element
|
||||
* @param eventType Optional event type. If none is specified, the function tries to determine
|
||||
* the right event type for the element, e.g. `change` for `input[text]`.
|
||||
* @param eventData An optional object which contains additional event data used when creating the event.
|
||||
* @param element Either a wrapped jQuery/jqLite node or a DOM element.
|
||||
* @param eventType Optional event type. If none is specified, the function tries to determine the
|
||||
* right event type for the element, e.g. `change` for `input[text]`.
|
||||
* @param eventData An optional object which contains additional event data used when creating the
|
||||
* event.
|
||||
*/
|
||||
function browserTrigger(
|
||||
element: JQuery | Element,
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
interface MyService {
|
||||
getFirstname(): ng.IPromise<string>;
|
||||
getLastname(): ng.IPromise<string>;
|
||||
}
|
||||
|
||||
function TestCtrl($q: ng.IQService, MyService: MyService) {
|
||||
function arrayCallback(result: [ng.PromiseValue<string>, ng.PromiseValue<string>]) {
|
||||
const firstnameOk: boolean = $q.isFulfilledState(result[0]);
|
||||
const lastnameOk: boolean = $q.isFulfilledState(result[1]);
|
||||
}
|
||||
|
||||
function objectCallback(result: {firstname: ng.PromiseValue<string>, lastname: ng.PromiseValue<string>}) {
|
||||
const firstnameOk: boolean = $q.isFulfilledState(result.firstname);
|
||||
const lastnameOk: boolean = $q.isFulfilledState(result.lastname);
|
||||
}
|
||||
|
||||
$q
|
||||
.allSettled([
|
||||
MyService.getFirstname(),
|
||||
MyService.getLastname()
|
||||
])
|
||||
.then(arrayCallback);
|
||||
|
||||
$q
|
||||
.allSettled({
|
||||
firstname: MyService.getFirstname(),
|
||||
lastname: MyService.getLastname()
|
||||
})
|
||||
.then(objectCallback);
|
||||
}
|
||||
|
||||
TestCtrl.$inject = ['$q', 'MyService'];
|
||||
|
||||
angular.module('test').controller('TestCtrl', TestCtrl);
|
||||
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
// Type definitions for angular-q-extras 1.1
|
||||
// Project: https://github.com/niqdev/angular-q-extras
|
||||
// Definitions by: Damien Sorel <https://github.com/mistic100>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
declare var _: string;
|
||||
export = _;
|
||||
|
||||
import * as angular from 'angular';
|
||||
|
||||
declare module 'angular' {
|
||||
type PromiseState = 'fulfilled' | 'rejected';
|
||||
|
||||
interface PromiseValue<T> {
|
||||
state: PromiseState;
|
||||
value?: T;
|
||||
reason?: any;
|
||||
}
|
||||
|
||||
// tslint:disable-next-line interface-name
|
||||
interface IQService {
|
||||
// tslint:disable:max-line-length
|
||||
allSettled<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: [T1 | IPromise<T1>, T2 | IPromise<T2>, T3 | IPromise<T3>, T4 | IPromise<T4>, T5 | IPromise<T5>, T6 | IPromise<T6>, T7 | IPromise<T7>, T8 | IPromise<T8>, T9 | IPromise<T9>, T10 | IPromise<T10>]): IPromise<[PromiseValue<T1>, PromiseValue<T2>, PromiseValue<T3>, PromiseValue<T4>, PromiseValue<T5>, PromiseValue<T6>, PromiseValue<T7>, PromiseValue<T8>, PromiseValue<T9>, PromiseValue<T10>]>;
|
||||
allSettled<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [T1 | IPromise<T1>, T2 | IPromise<T2>, T3 | IPromise<T3>, T4 | IPromise<T4>, T5 | IPromise<T5>, T6 | IPromise<T6>, T7 | IPromise<T7>, T8 | IPromise<T8>, T9 | IPromise<T9>]): IPromise<[PromiseValue<T1>, PromiseValue<T2>, PromiseValue<T3>, PromiseValue<T4>, PromiseValue<T5>, PromiseValue<T6>, PromiseValue<T7>, PromiseValue<T8>, PromiseValue<T9>]>;
|
||||
allSettled<T1, T2, T3, T4, T5, T6, T7, T8>(values: [T1 | IPromise<T1>, T2 | IPromise<T2>, T3 | IPromise<T3>, T4 | IPromise<T4>, T5 | IPromise<T5>, T6 | IPromise<T6>, T7 | IPromise<T7>, T8 | IPromise<T8>]): IPromise<[PromiseValue<T1>, PromiseValue<T2>, PromiseValue<T3>, PromiseValue<T4>, PromiseValue<T5>, PromiseValue<T6>, PromiseValue<T7>, PromiseValue<T8>]>;
|
||||
allSettled<T1, T2, T3, T4, T5, T6, T7>(values: [T1 | IPromise<T1>, T2 | IPromise<T2>, T3 | IPromise<T3>, T4 | IPromise<T4>, T5 | IPromise<T5>, T6 | IPromise<T6>, T7 | IPromise<T7>]): IPromise<[PromiseValue<T1>, PromiseValue<T2>, PromiseValue<T3>, PromiseValue<T4>, PromiseValue<T5>, PromiseValue<T6>, PromiseValue<T7>]>;
|
||||
allSettled<T1, T2, T3, T4, T5, T6>(values: [T1 | IPromise<T1>, T2 | IPromise<T2>, T3 | IPromise<T3>, T4 | IPromise<T4>, T5 | IPromise<T5>, T6 | IPromise<T6>]): IPromise<[PromiseValue<T1>, PromiseValue<T2>, PromiseValue<T3>, PromiseValue<T4>, PromiseValue<T5>, PromiseValue<T6>]>;
|
||||
allSettled<T1, T2, T3, T4, T5>(values: [T1 | IPromise<T1>, T2 | IPromise<T2>, T3 | IPromise<T3>, T4 | IPromise<T4>, T5 | IPromise<T5>]): IPromise<[PromiseValue<T1>, PromiseValue<T2>, PromiseValue<T3>, PromiseValue<T4>, PromiseValue<T5>]>;
|
||||
allSettled<T1, T2, T3, T4>(values: [T1 | IPromise<T1>, T2 | IPromise<T2>, T3 | IPromise<T3>, T4 | IPromise<T4>]): IPromise<[PromiseValue<T1>, PromiseValue<T2>, PromiseValue<T3>, PromiseValue<T4>]>;
|
||||
allSettled<T1, T2, T3>(values: [T1 | IPromise<T1>, T2 | IPromise<T2>, T3 | IPromise<T3>]): IPromise<[PromiseValue<T1>, PromiseValue<T2>, PromiseValue<T3>]>;
|
||||
allSettled<T1, T2>(values: [T1 | IPromise<T1>, T2 | IPromise<T2>]): IPromise<[PromiseValue<T1>, PromiseValue<T2>]>;
|
||||
// tslint:enable:max-line-length
|
||||
|
||||
allSettled<TAll>(promises: Array<TAll | IPromise<TAll>>): IPromise<Array<PromiseValue<TAll>>>;
|
||||
|
||||
allSettled<T>(promises: { [K in keyof T]: (T[K] | IPromise<T[K]>); }): IPromise<{ [K in keyof T]: PromiseValue<T[K]>; }>;
|
||||
|
||||
isFulfilledState(promise: PromiseValue<any>): boolean;
|
||||
isRejectedState(promise: PromiseValue<any>): boolean;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"angular-q-extras-tests.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -39,6 +39,21 @@ $routeProvider
|
||||
return "I return a string"
|
||||
}
|
||||
})
|
||||
.when('/projects/:projectId/dashboard6', {
|
||||
resolve: {
|
||||
foo: () => 'foo',
|
||||
bar: () => 'bar',
|
||||
},
|
||||
resolveAs: 'baz',
|
||||
resolveRedirectTo: [
|
||||
'$http',
|
||||
($http: ng.IHttpService) => $http.get('/is-admin').then(() => '/admin/lounge', () => undefined),
|
||||
],
|
||||
})
|
||||
.when('/projects/:projectId/dashboard7', {
|
||||
reloadOnUrl: false,
|
||||
resolveRedirectTo: () => (Math.random() < 0.5) ? '/some/route' : undefined,
|
||||
})
|
||||
.otherwise({ redirectTo: '/' })
|
||||
.otherwise({ redirectTo: ($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) => "" })
|
||||
.otherwise("/");
|
||||
|
||||
Vendored
+94
-27
@@ -1,6 +1,7 @@
|
||||
// Type definitions for Angular JS (ngRoute module) 1.3
|
||||
// Type definitions for Angular JS (ngRoute module) 1.7
|
||||
// Project: http://angularjs.org
|
||||
// Definitions by: Jonathan Park <https://github.com/park9140>
|
||||
// George Kalpakas <https://github.com/gkalpak>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -52,7 +53,7 @@ declare module 'angular' {
|
||||
*/
|
||||
interface IRoute {
|
||||
/**
|
||||
* {(string|function()=}
|
||||
* {(string|Function)=}
|
||||
* Controller fn that should be associated with newly created scope or the name of a registered controller if passed as a string.
|
||||
*/
|
||||
controller?: string | InlineAnnotatedFunction;
|
||||
@@ -61,56 +62,122 @@ declare module 'angular' {
|
||||
*/
|
||||
controllerAs?: string;
|
||||
/**
|
||||
* Undocumented?
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* {string=|function()=}
|
||||
* {(string|Function)=}
|
||||
* Html template as a string or a function that returns an html template as a string which should be used by ngView or ngInclude directives. This property takes precedence over templateUrl.
|
||||
*
|
||||
* If template is a function, it will be called with the following parameters:
|
||||
*
|
||||
* {Array.<Object>} - route parameters extracted from the current $location.path() by applying the current route
|
||||
*/
|
||||
template?: string | { ($routeParams?: angular.route.IRouteParamsService): string; }
|
||||
template?: string | { ($routeParams?: IRouteParamsService): string; }
|
||||
/**
|
||||
* {string=|function()=}
|
||||
* {(string|Function)=}
|
||||
* Path or function that returns a path to an html template that should be used by ngView.
|
||||
*
|
||||
* If templateUrl is a function, it will be called with the following parameters:
|
||||
*
|
||||
* {Array.<Object>} - route parameters extracted from the current $location.path() by applying the current route
|
||||
*/
|
||||
templateUrl?: string | { ($routeParams?: angular.route.IRouteParamsService): string; }
|
||||
templateUrl?: string | { ($routeParams?: IRouteParamsService): string; }
|
||||
/**
|
||||
* {Object.<string, function>=} - An optional map of dependencies which should be injected into the controller. If any of these dependencies are promises, the router will wait for them all to be resolved or one to be rejected before the controller is instantiated. If all the promises are resolved successfully, the values of the resolved promises are injected and $routeChangeSuccess event is fired. If any of the promises are rejected the $routeChangeError event is fired. The map object is:
|
||||
* {Object.<string, Function>=}
|
||||
* An optional map of dependencies which should be injected into the controller. If any of these
|
||||
* dependencies are promises, the router will wait for them all to be resolved or one to be rejected before
|
||||
* the controller is instantiated.
|
||||
* If all the promises are resolved successfully, the values of the resolved promises are injected and
|
||||
* `$routeChangeSuccess` event is fired. If any of the promises are rejected the `$routeChangeError` event
|
||||
* is fired.
|
||||
* For easier access to the resolved dependencies from the template, the `resolve` map will be available on
|
||||
* the scope of the route, under `$resolve` (by default) or a custom name specified by the `resolveAs`
|
||||
* property (see below). This can be particularly useful, when working with components as route templates.
|
||||
*
|
||||
* - key - {string}: a name of a dependency to be injected into the controller.
|
||||
* - factory - {string|function}: If string then it is an alias for a service. Otherwise if function, then it is injected and the return value is treated as the dependency. If the result is a promise, it is resolved before its value is injected into the controller. Be aware that ngRoute.$routeParams will still refer to the previous route within these resolve functions. Use $route.current.params to access the new route parameters, instead.
|
||||
* > **Note:** If your scope already contains a property with this name, it will be hidden or overwritten.
|
||||
* > Make sure, you specify an appropriate name for this property, that does not collide with other
|
||||
* > properties on the scope.
|
||||
*
|
||||
* The map object is:
|
||||
*
|
||||
* - `key` – `{string}`: a name of a dependency to be injected into the controller.
|
||||
* - `factory` - `{string|Function}`: If `string` then it is an alias for a service. Otherwise if function,
|
||||
* then it is called with `$injector#invoke()` and the return value is treated as the dependency. If the
|
||||
* result is a promise, it is resolved before its value is injected into the controller. Be aware that
|
||||
* `ngRoute.$routeParams` will still refer to the previous route within these resolve functions. Use
|
||||
* `$route.current.params` to access the new route parameters, instead.
|
||||
*/
|
||||
resolve?: { [key: string]: any };
|
||||
/**
|
||||
* {(string|function())=}
|
||||
* Value to update $location path with and trigger route redirection.
|
||||
*
|
||||
* If redirectTo is a function, it will be called with the following parameters:
|
||||
*
|
||||
* - {Object.<string>} - route parameters extracted from the current $location.path() by applying the current route templateUrl.
|
||||
* - {string} - current $location.path()
|
||||
* - {Object} - current $location.search()
|
||||
* - The custom redirectTo function is expected to return a string which will be used to update $location.path() and $location.search().
|
||||
* {string=}
|
||||
* The name under which the `resolve` map will be available on the scope of the route. If omitted, defaults
|
||||
* to `$resolve`.
|
||||
*/
|
||||
redirectTo?: string | { ($routeParams?: angular.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any): string };
|
||||
resolveAs?: string;
|
||||
/**
|
||||
* Reload route when only $location.search() or $location.hash() changes.
|
||||
* {(string|Function)=}
|
||||
* Value to update `$location` path with and trigger route redirection.
|
||||
*
|
||||
* This option defaults to true. If the option is set to false and url in the browser changes, then $routeUpdate event is broadcasted on the root scope.
|
||||
* If `redirectTo` is a function, it will be called with the following parameters:
|
||||
*
|
||||
* - `{Object.<string>}` - route parameters extracted from the current `$location.path()` by applying the
|
||||
* current route templateUrl.
|
||||
* - `{string}` - current `$location.path()`
|
||||
* - `{Object}` - current `$location.search()`
|
||||
*
|
||||
* The custom `redirectTo` function is expected to return a string which will be used to update
|
||||
* `$location.url()`. If the function throws an error, no further processing will take place and the
|
||||
* `$routeChangeError` event will be fired.
|
||||
*
|
||||
* Routes that specify `redirectTo` will not have their controllers, template functions or resolves called,
|
||||
* the `$location` will be changed to the redirect url and route processing will stop. The exception to this
|
||||
* is if the `redirectTo` is a function that returns `undefined`. In this case the route transition occurs
|
||||
* as though there was no redirection.
|
||||
*/
|
||||
redirectTo?: string | { ($routeParams?: IRouteParamsService, $locationPath?: string, $locationSearch?: any): string };
|
||||
/**
|
||||
* {Function=}
|
||||
* A function that will (eventually) return the value to update `$location` URL with and trigger route
|
||||
* redirection. In contrast to `redirectTo`, dependencies can be injected into `resolveRedirectTo` and the
|
||||
* return value can be either a string or a promise that will be resolved to a string.
|
||||
*
|
||||
* Similar to `redirectTo`, if the return value is `undefined` (or a promise that gets resolved to
|
||||
* `undefined`), no redirection takes place and the route transition occurs as though there was no
|
||||
* redirection.
|
||||
*
|
||||
* If the function throws an error or the returned promise gets rejected, no further processing will take
|
||||
* place and the `$routeChangeError` event will be fired.
|
||||
*
|
||||
* `redirectTo` takes precedence over `resolveRedirectTo`, so specifying both on the same route definition,
|
||||
* will cause the latter to be ignored.
|
||||
*/
|
||||
resolveRedirectTo?: angular.Injectable<(...deps: any[]) => angular.IPromise<string | undefined> | string | undefined>;
|
||||
/**
|
||||
* {boolean=true}
|
||||
* Reload route when any part of the URL changes (including the path) even if the new URL maps to the same
|
||||
* route.
|
||||
*
|
||||
* If the option is set to `false` and the URL in the browser changes, but the new URL maps to the same
|
||||
* route, then a `$routeUpdate` event is broadcasted on the root scope (without reloading the route).
|
||||
*
|
||||
* Defaults to `true`.
|
||||
*/
|
||||
reloadOnUrl?: boolean;
|
||||
/**
|
||||
* {boolean=true}
|
||||
* Reload route when only `$location.search()` or `$location.hash()` changes.
|
||||
*
|
||||
* If the option is set to `false` and the URL in the browser changes, then a `$routeUpdate` event is
|
||||
* broadcasted on the root scope (without reloading the route).
|
||||
*
|
||||
* > Note: This option has no effect if `reloadOnUrl` is set to `false`.
|
||||
*
|
||||
* Defaults to `true`.
|
||||
*/
|
||||
reloadOnSearch?: boolean;
|
||||
/**
|
||||
* Match routes without being case sensitive
|
||||
* {boolean=false}
|
||||
* Match routes without being case sensitive.
|
||||
* If the option is set to `true`, then the particular route can be matched without being case sensitive.
|
||||
*
|
||||
* This option defaults to false. If the option is set to true, then the particular route can be matched without being case sensitive
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
caseInsensitiveMatch?: boolean;
|
||||
}
|
||||
|
||||
@@ -57,6 +57,28 @@ testApp.config((
|
||||
/**
|
||||
* $datepickerPopupConfig tests
|
||||
*/
|
||||
$datepickerPopupConfig.datepickerMode = 'month';
|
||||
$datepickerPopupConfig.formatDay = 'd';
|
||||
$datepickerPopupConfig.formatDayHeader = 'E';
|
||||
$datepickerPopupConfig.formatDayTitle = 'dd-MM-yyyy';
|
||||
$datepickerPopupConfig.formatMonth = 'M';
|
||||
$datepickerPopupConfig.formatMonthTitle = 'yy';
|
||||
$datepickerPopupConfig.formatYear = 'y';
|
||||
$datepickerPopupConfig.initDate = '1389586124979';
|
||||
$datepickerPopupConfig.maxDate = '1389586124979';
|
||||
$datepickerPopupConfig.maxMode = 'month';
|
||||
$datepickerPopupConfig.minDate = '1389586124979';
|
||||
$datepickerPopupConfig.minMode = 'month';
|
||||
$datepickerPopupConfig.shortcutPropagation = true;
|
||||
$datepickerPopupConfig.showWeeks = false;
|
||||
$datepickerPopupConfig.startingDay = 1;
|
||||
$datepickerPopupConfig.yearRange = 10;
|
||||
$datepickerPopupConfig.monthColumns = 3;
|
||||
$datepickerPopupConfig.yearColumns = 9;
|
||||
$datepickerPopupConfig.yearRows = 6;
|
||||
$datepickerPopupConfig.ngModelOptions.allowInvalid = false;
|
||||
$datepickerPopupConfig.ngModelOptions.timezone = "EST";
|
||||
$datepickerPopupConfig.ngModelOptions.updateOn = "click";
|
||||
$datepickerPopupConfig.altInputFormats = ["mm/dd/YYYY", "mm-dd-YY"];
|
||||
$datepickerPopupConfig.appendToBody = true;
|
||||
$datepickerPopupConfig.currentText = 'Select Today';
|
||||
|
||||
+4
-2
@@ -1,6 +1,8 @@
|
||||
// Type definitions for Angular UI Bootstrap 0.13.3
|
||||
// Project: https://github.com/angular-ui/bootstrap
|
||||
// Definitions by: Brian Surowiec <https://github.com/xt0rted>, Ryan Southgate <https://github.com/ry8806>
|
||||
// Definitions by: Brian Surowiec <https://github.com/xt0rted>,
|
||||
// Ryan Southgate <https://github.com/ry8806>
|
||||
// Alfie Johnson <https://github.com/alfiej>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -227,7 +229,7 @@ declare module 'angular' {
|
||||
customClass?: DatepickerCallback<string>;
|
||||
}
|
||||
|
||||
interface IDatepickerPopupConfig {
|
||||
interface IDatepickerPopupConfig extends IDatepickerConfig {
|
||||
|
||||
/**
|
||||
* A list of alternate formats acceptable for manual entry.
|
||||
|
||||
@@ -214,11 +214,18 @@ mod.factory({
|
||||
name1(foo: any) {},
|
||||
name2: ['foo', (foo: any) => {}]
|
||||
});
|
||||
mod.filter('name', ($scope: ng.IScope) => {});
|
||||
mod.filter('name', ['$scope', ($scope: ng.IScope) => {}]);
|
||||
mod.filter('name', ($scope: ng.IScope) => () => {});
|
||||
mod.filter('name', ['$scope', ($scope: ng.IScope) => () => {}]);
|
||||
mod.filter({
|
||||
name1(foo: any) {},
|
||||
name2: ['foo', (foo: any) => {}]
|
||||
name1(foo: any) { return () => {}; },
|
||||
name2: ['foo', (foo: any) => () => {}],
|
||||
});
|
||||
const customStatefulFilter: ng.IFilterFunction = (s) => 1;
|
||||
mod.filter('name', () => customStatefulFilter);
|
||||
mod.filter('name', ['$scope', () => customStatefulFilter]);
|
||||
mod.filter({
|
||||
name1: () => customStatefulFilter,
|
||||
name2: ['foo', () => customStatefulFilter],
|
||||
});
|
||||
mod.provider('name', ($scope: ng.IScope) => ({ $get: () => { } }));
|
||||
mod.provider('name', TestProvider);
|
||||
@@ -304,8 +311,10 @@ namespace TestQ {
|
||||
}
|
||||
const abcObject: AbcObject = null;
|
||||
const abcObjectPromise: angular.IPromise<AbcObject> = null;
|
||||
const abcObjectPromiseLike: PromiseLike<AbcObject> = null;
|
||||
const efObject: EfObject = null;
|
||||
const efObjectPromise: angular.IPromise<EfObject> = null;
|
||||
const efObjectPromiseLike: PromiseLike<EfObject> = null;
|
||||
const ghObject: GhObject = null;
|
||||
const ghObjectPromise: angular.IPromise<GhObject> = null;
|
||||
|
||||
@@ -397,6 +406,7 @@ namespace TestQ {
|
||||
|
||||
result = $q.when<AbcObject>(abcObject);
|
||||
result = $q.when<AbcObject>(abcObjectPromise);
|
||||
result = $q.when<AbcObject>(abcObjectPromiseLike);
|
||||
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObject);
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObject, (any) => any);
|
||||
@@ -409,10 +419,21 @@ namespace TestQ {
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromise, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any);
|
||||
|
||||
result = $q.when<AbcObject, EfObject>(efObjectPromiseLike, (result: EfObject) => abcObject);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObject, (any) => any);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObjectPromise);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromiseLike, (result: EfObject) => abcObject, (any) => ghObjectPromise, (any) => any);
|
||||
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObjectPromise);
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObjectPromise, (any) => any);
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObjectPromise, (any) => any, (any) => any);
|
||||
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObjectPromiseLike);
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObjectPromiseLike, (any) => any);
|
||||
result = $q.when<AbcObject, EfObject>(efObject, (result: EfObject) => abcObjectPromiseLike, (any) => any, (any) => any);
|
||||
|
||||
result = $q.when<AbcObject, EfObject>(efObjectPromise, (result: EfObject) => abcObjectPromise);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject);
|
||||
resultOther = $q.when<AbcObject, GhObject, EfObject>(efObjectPromise, (result: EfObject) => abcObjectPromise, (any) => ghObject, (any) => any);
|
||||
@@ -513,6 +534,20 @@ namespace TestInjector {
|
||||
anyResult = $injector.invoke(inlineAnnotatedFunction, 'anyContext');
|
||||
anyResult = $injector.invoke(inlineAnnotatedFunction, undefined, 'anyLocals');
|
||||
}
|
||||
|
||||
// $injector.loadNewModules
|
||||
{
|
||||
const inlineAnnotatedFunction: any[] = [false, (v: boolean) => {}];
|
||||
const modA = angular.module('$injector.moduleA', []);
|
||||
$injector.loadNewModules([modA]);
|
||||
$injector.loadNewModules([modA.name]);
|
||||
$injector.loadNewModules([inlineAnnotatedFunction]);
|
||||
}
|
||||
|
||||
// $injector.modules
|
||||
{
|
||||
const module: angular.IModule = $injector.modules['$injector.module'];
|
||||
}
|
||||
}
|
||||
|
||||
// Promise signature tests
|
||||
@@ -710,11 +745,12 @@ function test_angular_forEach() {
|
||||
this.push(`${key}: ${value}`);
|
||||
}, log);
|
||||
// expect(log).toEqual(['name: misko', 'gender: male']);
|
||||
// $ExpectType NodeListOf<HTMLImageElement>
|
||||
angular.forEach(document.getElementsByTagName('img'), (value, key, obj) => {
|
||||
// TODO: Set minimum version to ts3.1 where this is always HTMLCollectionOf
|
||||
type Collection = NodeListOf<HTMLImageElement> | HTMLCollectionOf<HTMLImageElement>;
|
||||
const collection: Collection = angular.forEach(document.getElementsByTagName('img'), (value, key, obj) => {
|
||||
value; // $ExpectType HTMLImageElement
|
||||
key; // $ExpectType number
|
||||
obj; // $ExpectType NodeListOf<HTMLImageElement>
|
||||
const collection: Collection = obj;
|
||||
});
|
||||
// $ExpectType number[]
|
||||
angular.forEach([1, 2, 3], (value, key, obj) => {
|
||||
|
||||
Vendored
+26
-9
@@ -250,8 +250,8 @@ declare namespace angular {
|
||||
*/
|
||||
factory(name: string, $getFn: Injectable<Function>): IModule;
|
||||
factory(object: {[name: string]: Injectable<Function>}): IModule;
|
||||
filter(name: string, filterFactoryFunction: Injectable<Function>): IModule;
|
||||
filter(object: {[name: string]: Injectable<Function>}): IModule;
|
||||
filter(name: string, filterFactoryFunction: Injectable<FilterFactory>): IModule;
|
||||
filter(object: {[name: string]: Injectable<FilterFactory>}): IModule;
|
||||
provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule;
|
||||
provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule;
|
||||
provider(name: string, inlineAnnotatedConstructor: any[]): IModule;
|
||||
@@ -1137,12 +1137,12 @@ declare namespace angular {
|
||||
*
|
||||
* @param value Value or a promise
|
||||
*/
|
||||
resolve<T>(value: IPromise<T>|T): IPromise<T>;
|
||||
resolve<T>(value: PromiseLike<T>|T): IPromise<T>;
|
||||
/**
|
||||
* @deprecated Since TS 2.4, inference is stricter and no longer produces the desired type when T1 !== T2.
|
||||
* To use resolve with two different types, pass a union type to the single-type-argument overload.
|
||||
*/
|
||||
resolve<T1, T2>(value: IPromise<T1>|T2): IPromise<T1|T2>;
|
||||
resolve<T1, T2>(value: PromiseLike<T1>|T2): IPromise<T1|T2>;
|
||||
/**
|
||||
* Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
|
||||
*/
|
||||
@@ -1152,11 +1152,11 @@ declare namespace angular {
|
||||
*
|
||||
* @param value Value or a promise
|
||||
*/
|
||||
when<T>(value: IPromise<T>|T): IPromise<T>;
|
||||
when<T1, T2>(value: IPromise<T1>|T2): IPromise<T1|T2>;
|
||||
when<TResult, T>(value: IPromise<T>|T, successCallback: (promiseValue: T) => IPromise<TResult>|TResult): IPromise<TResult>;
|
||||
when<TResult, T>(value: T, successCallback: (promiseValue: T) => IPromise<TResult>|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
when<TResult, TResult2, T>(value: IPromise<T>, successCallback: (promiseValue: T) => IPromise<TResult>|TResult, errorCallback: (reason: any) => TResult2 | IPromise<TResult2>, notifyCallback?: (state: any) => any): IPromise<TResult | TResult2>;
|
||||
when<T>(value: PromiseLike<T>|T): IPromise<T>;
|
||||
when<T1, T2>(value: PromiseLike<T1>|T2): IPromise<T1|T2>;
|
||||
when<TResult, T>(value: PromiseLike<T>|T, successCallback: (promiseValue: T) => PromiseLike<TResult>|TResult): IPromise<TResult>;
|
||||
when<TResult, T>(value: T, successCallback: (promiseValue: T) => PromiseLike<TResult>|TResult, errorCallback: null | undefined | ((reason: any) => any), notifyCallback?: (state: any) => any): IPromise<TResult>;
|
||||
when<TResult, TResult2, T>(value: PromiseLike<T>, successCallback: (promiseValue: T) => PromiseLike<TResult>|TResult, errorCallback: (reason: any) => TResult2 | PromiseLike<TResult2>, notifyCallback?: (state: any) => any): IPromise<TResult | TResult2>;
|
||||
/**
|
||||
* Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted.
|
||||
*/
|
||||
@@ -2183,6 +2183,14 @@ declare namespace angular {
|
||||
has(name: string): boolean;
|
||||
instantiate<T>(typeConstructor: {new(...args: any[]): T}, locals?: any): T;
|
||||
invoke<T = any>(func: Injectable<Function | ((...args: any[]) => T)>, context?: any, locals?: any): T;
|
||||
/**
|
||||
* Add the specified modules to the current injector.
|
||||
* This method will add each of the injectables to the injector and execute all of the config and run blocks for each module passed to the method.
|
||||
* @param modules A module, module name or annotated injection function.
|
||||
*/
|
||||
loadNewModules(modules: Array<IModule|string|Injectable<(...args: any[]) => void>>): void;
|
||||
/** An object map of all the modules that have been loaded into the injector. */
|
||||
modules: {[moduleName: string]: IModule};
|
||||
strictDi: boolean;
|
||||
}
|
||||
|
||||
@@ -2237,4 +2245,13 @@ declare namespace angular {
|
||||
interface IHttpParamSerializer {
|
||||
(obj: Object): string;
|
||||
}
|
||||
|
||||
interface IFilterFunction extends Function {
|
||||
/**
|
||||
* By default, filters are only run once the input value changes. By marking the filter as `$stateful`, the filter will be run on every `$digest` to update the output. **This is strongly discouraged.**
|
||||
* See https://docs.angularjs.org/guide/filter#stateful-filters
|
||||
*/
|
||||
$stateful?: boolean;
|
||||
}
|
||||
type FilterFactory = (...I: any[]) => IFilterFunction;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
import * as ansi from 'ansi-escape-sequences';
|
||||
|
||||
// $ExpectType string
|
||||
ansi.style.red;
|
||||
// $ExpectError
|
||||
ansi.style.invalidStyle;
|
||||
|
||||
// $ExpectType string
|
||||
ansi.styles('green');
|
||||
// $ExpectType string
|
||||
ansi.styles(['green', 'underline']);
|
||||
// $ExpectError
|
||||
ansi.styles('invalidStyle');
|
||||
// $ExpectError
|
||||
ansi.styles(['invalidStyle']);
|
||||
|
||||
// $ExpectType string
|
||||
ansi.format('what?', 'green');
|
||||
// $ExpectType string
|
||||
ansi.format('what?', ['green', 'bold']);
|
||||
// $ExpectType string
|
||||
ansi.format('[green bold]{what?}');
|
||||
// $ExpectError
|
||||
ansi.styles('what?', 'invalidStyle');
|
||||
// $ExpectError
|
||||
ansi.styles('what?', ['invalidStyle']);
|
||||
|
||||
// $ExpectType string
|
||||
ansi.cursor.up();
|
||||
// $ExpectType string
|
||||
ansi.cursor.up(1);
|
||||
|
||||
// $ExpectType string
|
||||
ansi.cursor.hide;
|
||||
// $ExpectType string
|
||||
ansi.cursor.show;
|
||||
|
||||
// $ExpectType string
|
||||
ansi.erase.display();
|
||||
// $ExpectType string
|
||||
ansi.erase.display(3);
|
||||
// $ExpectError
|
||||
ansi.erase.display(4);
|
||||
|
||||
// $ExpectType string
|
||||
ansi.erase.inLine();
|
||||
// $ExpectType string
|
||||
ansi.erase.inLine(2);
|
||||
// $ExpectError
|
||||
ansi.erase.inLine(3);
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
// Type definitions for ansi-escape-sequences 4.0
|
||||
// Project: https://github.com/75lb/ansi-escape-sequences#readme
|
||||
// Definitions by: Alexander Marks <https://github.com/aomarks>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export type Style = 'reset'|'bold'|'italic'|'underline'|'fontDefault'|'font2'|
|
||||
'font3'|'font4'|'font5'|'font6'|'imageNegative'|'imagePositive'|'black'|
|
||||
'red'|'green'|'yellow'|'blue'|'magenta'|'cyan'|'white'|'grey'|'gray'|
|
||||
'bg-black'|'bg-red'|'bg-green'|'bg-yellow'|'bg-blue'|'bg-magenta'|'bg-cyan'|
|
||||
'bg-white'|'bg-grey'|'bg-gray';
|
||||
|
||||
/**
|
||||
* Various formatting styles (aka Select Graphic Rendition codes).
|
||||
*
|
||||
* @example
|
||||
* console.log(ansi.style.red + 'this is red' + ansi.style.reset)
|
||||
*/
|
||||
export const style: {[K in Style]: string};
|
||||
|
||||
/**
|
||||
* Returns an ansi sequence setting one or more effects.
|
||||
*
|
||||
* @param styles a style, or list or styles
|
||||
*
|
||||
* @example
|
||||
* > ansi.styles('green')
|
||||
* '\u001b[32m'
|
||||
*
|
||||
* > ansi.styles([ 'green', 'underline' ])
|
||||
* '\u001b[32;4m'
|
||||
*/
|
||||
export function styles(styles: Style|ReadonlyArray<Style>): string;
|
||||
|
||||
/**
|
||||
* A convenience function, applying the provided styles to the input string and
|
||||
* then resetting.
|
||||
*
|
||||
* Inline styling can be applied using the syntax `[style-list]{text to
|
||||
* format}`, where `style-list` is a space-separated list of styles from {@link
|
||||
* module:ansi-escape-sequences.style ansi.style}. For example `[bold white
|
||||
* bg-red]{bold white text on a red background}`.
|
||||
*
|
||||
* @param str the string to format
|
||||
* @param styles a style or list of styles to add to the input string
|
||||
*
|
||||
* @example
|
||||
* > ansi.format('what?', 'green')
|
||||
* '\u001b[32mwhat?\u001b[0m'
|
||||
*
|
||||
* > ansi.format('what?', ['green', 'bold'])
|
||||
* '\u001b[32;1mwhat?\u001b[0m'
|
||||
*
|
||||
* > ansi.format('[green bold]{what?}')
|
||||
* '\u001b[32;1mwhat?\u001b[0m'
|
||||
*/
|
||||
export function format(
|
||||
str: string, styles?: Style|ReadonlyArray<Style>): string;
|
||||
|
||||
/**
|
||||
* cursor-related sequences
|
||||
*/
|
||||
export namespace cursor {
|
||||
/**
|
||||
* Moves the cursor `lines` cells up. If the cursor is already at the edge
|
||||
* of the screen, this has no effect.
|
||||
* @param lines default=1
|
||||
*/
|
||||
function up(lines?: number): string;
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells down. If the cursor is already at the edge
|
||||
* of the screen, this has no effect.
|
||||
* @param lines default=1
|
||||
*/
|
||||
function down(lines?: number): string;
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells forward. If the cursor is already at the
|
||||
* edge of the screen, this has no effect.
|
||||
* @param lines default=1
|
||||
*/
|
||||
function forward(lines?: number): string;
|
||||
|
||||
/**
|
||||
* Moves the cursor `lines` cells back. If the cursor is already at the edge
|
||||
* of the screen, this has no effect.
|
||||
* @param lines default=1
|
||||
*/
|
||||
function back(lines?: number): string;
|
||||
|
||||
/**
|
||||
* Moves cursor to beginning of the line n lines down.
|
||||
* @param lines default=1
|
||||
*/
|
||||
function nextLine(lines?: number): string;
|
||||
|
||||
/**
|
||||
* Moves cursor to beginning of the line n lines up.
|
||||
* @param lines default=1
|
||||
*/
|
||||
function previousLine(lines?: number): string;
|
||||
|
||||
/**
|
||||
* Moves the cursor to column n.
|
||||
* @param n column number
|
||||
*/
|
||||
function horizontalAbsolute(n: number): string;
|
||||
|
||||
/**
|
||||
* Moves the cursor to row n, column m. The values are 1-based, and default
|
||||
* to 1 (top left corner) if omitted.
|
||||
*
|
||||
* @param n row number, default=1
|
||||
* @param m column number, default=1
|
||||
*/
|
||||
function position(n?: number, m?: number): string;
|
||||
|
||||
/**
|
||||
* Hides the cursor
|
||||
*/
|
||||
const hide: string;
|
||||
|
||||
/**
|
||||
* Shows the cursor
|
||||
*/
|
||||
const show: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* erase sequences
|
||||
*/
|
||||
export namespace erase {
|
||||
/**
|
||||
* Clears part of the screen. If n is 0 (or missing), clear from cursor to
|
||||
* end of screen. If n is 1, clear from cursor to beginning of the screen.
|
||||
* If n is 2, clear entire screen. If n is 3, clear entire screen and delete
|
||||
* all lines saved in the scrollback buffer (some terminals only).
|
||||
*/
|
||||
function display(n?: 0|1|2|3): string;
|
||||
|
||||
/**
|
||||
* Erases part of the line. If n is zero (or missing), clear from cursor to
|
||||
* the end of the line. If n is one, clear from cursor to beginning of the
|
||||
* line. If n is two, clear entire line. Cursor position does not change.
|
||||
*/
|
||||
function inLine(n?: 0|1|2): string;
|
||||
}
|
||||
@@ -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",
|
||||
"ansi-escape-sequences-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
import { Token } from './Token';
|
||||
import { Interval } from './IntervalSet';
|
||||
|
||||
export class BufferedTokenStream {
|
||||
tokenSource: any;
|
||||
tokens: Token[];
|
||||
index: number;
|
||||
fetchEOF: boolean;
|
||||
|
||||
mark(): number;
|
||||
|
||||
release(marker: number): number;
|
||||
|
||||
reset(): void;
|
||||
|
||||
seek(index: number): void;
|
||||
|
||||
get(index: number): Token;
|
||||
|
||||
consume(): void;
|
||||
|
||||
sync(i: number): boolean;
|
||||
|
||||
fetch(n: number): number;
|
||||
|
||||
getTokens(start: number, stop: number, types: any): Token[];
|
||||
|
||||
LA(i: number): any;
|
||||
|
||||
LB(k: number): Token;
|
||||
|
||||
LT(k: number): Token;
|
||||
|
||||
adjustSeekIndex(i: number): number;
|
||||
|
||||
lazyInit(): void;
|
||||
|
||||
setup(): void;
|
||||
|
||||
setTokenSource(tokenSource: any): void;
|
||||
|
||||
nextTokenOnChannel(i: number, channel: any): number;
|
||||
|
||||
previousTokenOnChannel(i: number, channel: any): number;
|
||||
|
||||
getHiddenTokensToRight(tokenIndex: number, channel: any): Token[];
|
||||
|
||||
getSourceName(): any;
|
||||
|
||||
getText(interval: Interval): any;
|
||||
|
||||
fill(): void;
|
||||
}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
import { BufferedTokenStream } from './BufferedTokenStream';
|
||||
import { Token } from './Token';
|
||||
import { Lexer } from './Lexer';
|
||||
|
||||
export class CommonTokenStream extends BufferedTokenStream {
|
||||
constructor(lexer: Lexer, channel?: any);
|
||||
|
||||
adjustSeekIndex(i: number): any;
|
||||
|
||||
LB(k: number): Token;
|
||||
|
||||
LT(k: number): Token;
|
||||
|
||||
getNumberOfOnChannelTokens(): number;
|
||||
}
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
export class InputStream {
|
||||
readonly index: number;
|
||||
readonly size: number;
|
||||
|
||||
constructor(data: string, decodeToUnicodeCodePoints?: boolean);
|
||||
|
||||
reset(): void;
|
||||
|
||||
consume(): void;
|
||||
|
||||
LA(offset: number): string;
|
||||
|
||||
LT(offset: number): string;
|
||||
|
||||
mark(): number;
|
||||
|
||||
release(marker: any): number;
|
||||
|
||||
seek(index: number): void;
|
||||
|
||||
getText(start: number, stop: number): string;
|
||||
|
||||
toString(): string;
|
||||
}
|
||||
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
import { Token } from './Token';
|
||||
|
||||
export class Interval {
|
||||
readonly length: number;
|
||||
readonly start: number;
|
||||
readonly stop: number;
|
||||
|
||||
constructor(start: number, stop: number);
|
||||
|
||||
contains(item: number): boolean;
|
||||
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export class IntervalSet {
|
||||
readonly readOnly: boolean;
|
||||
readonly intervals: Interval[];
|
||||
readonly length: boolean;
|
||||
|
||||
first(): number;
|
||||
|
||||
addOne(v: number): void;
|
||||
|
||||
addRange(l: number, h: number): void;
|
||||
|
||||
addInterval(interval: Interval): void;
|
||||
|
||||
addSet(other: IntervalSet): void;
|
||||
|
||||
reduce(k: number): void;
|
||||
|
||||
complement(start: number, stop: number): IntervalSet;
|
||||
|
||||
contains(item: number): boolean;
|
||||
|
||||
removeRange(interval: Interval): boolean;
|
||||
|
||||
removeOne(v: number): boolean;
|
||||
|
||||
toString(literalNames?: string[], symbolicNames?: string[], elemsAreChar?: boolean): string;
|
||||
|
||||
toCharString(): string;
|
||||
|
||||
toIndexString(): string;
|
||||
|
||||
toTokenString(literalNames: string[], symbolicNames: string[]): string;
|
||||
|
||||
elementName(literalNames: string[], symbolicNames: string[], token: Token): string;
|
||||
}
|
||||
Vendored
+52
@@ -0,0 +1,52 @@
|
||||
import { Recognizer } from './Recognizer';
|
||||
import { Token } from './Token';
|
||||
import { RecognitionException } from './error/Errors';
|
||||
|
||||
export class Lexer extends Recognizer {
|
||||
inputStream: any;
|
||||
sourceName: any;
|
||||
type: any;
|
||||
line: any;
|
||||
column: any;
|
||||
text: string;
|
||||
|
||||
reset(): void;
|
||||
|
||||
nextToken(): Token;
|
||||
|
||||
skip(): void;
|
||||
|
||||
more(): void;
|
||||
|
||||
pushMode(mode: any): void;
|
||||
|
||||
popMode(): any;
|
||||
|
||||
emitToken(): void;
|
||||
|
||||
emit(): Token;
|
||||
|
||||
emitEOF(): Token;
|
||||
|
||||
charIndex(): number;
|
||||
|
||||
getAllTokens(): Token[];
|
||||
|
||||
notifyListeners(e: RecognitionException): void;
|
||||
|
||||
getErrorDisplay(s: string): string;
|
||||
|
||||
getErrorDisplayForChar(c: string): string;
|
||||
|
||||
getCharErrorDisplay(c: string): string;
|
||||
|
||||
recover(re: RecognitionException): void;
|
||||
|
||||
static readonly DEFAULT_MODE: number;
|
||||
static readonly MORE: number;
|
||||
static readonly SKIP: number;
|
||||
static readonly DEFAULT_TOKEN_CHANNEL: any;
|
||||
static readonly HIDDEN: any;
|
||||
static readonly MIN_CHAR_VALUE: number;
|
||||
static readonly MAX_CHAR_VALUE: number;
|
||||
}
|
||||
Vendored
+90
@@ -0,0 +1,90 @@
|
||||
import { CommonTokenStream } from './CommonTokenStream';
|
||||
import { Recognizer } from './Recognizer';
|
||||
import { Token } from './Token';
|
||||
import { ParseTreeListener } from './tree/Tree';
|
||||
import { Lexer } from './Lexer';
|
||||
import { InputStream } from './InputStream';
|
||||
import { ParserRuleContext } from './ParserRuleContext';
|
||||
import { ErrorStrategy } from './error/ErrorStrategy';
|
||||
|
||||
export class Parser extends Recognizer {
|
||||
constructor(input: CommonTokenStream);
|
||||
|
||||
buildParseTrees: boolean;
|
||||
|
||||
_errHandler: ErrorStrategy;
|
||||
|
||||
reset(): void;
|
||||
|
||||
match(): Token;
|
||||
|
||||
matchWildcard(): Token;
|
||||
|
||||
getParseListeners(): ParseTreeListener[];
|
||||
|
||||
addParseListener(lister: ParseTreeListener): void;
|
||||
|
||||
removeParseListener(lister: ParseTreeListener): void;
|
||||
|
||||
removeParseListeners(): void;
|
||||
|
||||
triggerEnterRuleEvent(): void;
|
||||
|
||||
triggerExitRuleEvent(): void;
|
||||
|
||||
getTokenFactory(): any;
|
||||
|
||||
setTokenFactory(factory: any): void;
|
||||
|
||||
getATNWithBypassAlts(): any;
|
||||
|
||||
compileParseTreePattern(pattern: any, patternRuleIndex: any, lexer: Lexer): any;
|
||||
|
||||
getInputStream(): InputStream;
|
||||
|
||||
getTokenStream(): any;
|
||||
|
||||
setTokenStream(stream: any): any;
|
||||
|
||||
getCurrentToken(): Token;
|
||||
|
||||
notifyErrorListeners(msg: string, offendingToken: Token, err: any): void;
|
||||
|
||||
consume(): any;
|
||||
|
||||
addContextToParseTree(): any;
|
||||
|
||||
enterRule(localCtx: ParserRuleContext, state: any, ruleIndex: number): void;
|
||||
|
||||
exitRule(): void;
|
||||
|
||||
enterOuterAlt(): void;
|
||||
|
||||
getPrecedence(): any;
|
||||
|
||||
enterRecursionRule(localCtx: ParserRuleContext, state: any, ruleIndex: any, precedence: any): void;
|
||||
|
||||
pushNewRecursionContext(localCtx: ParserRuleContext, state: any, ruleIndex: any, precedence: any): void;
|
||||
|
||||
unrollRecursionContexts(parentCtx: ParserRuleContext): void;
|
||||
|
||||
getInvokingContext(ruleIndex: number): any;
|
||||
|
||||
isExpectedToken(symbol: Token): boolean;
|
||||
|
||||
getExpectedTokens(): Token[];
|
||||
|
||||
getExpectedTokensWithinCurrentRule(): Token[];
|
||||
|
||||
getRuleIndex(ruleName: string): number;
|
||||
|
||||
getRuleInvocationStack(p: any): any;
|
||||
|
||||
getDFAStrings(): any;
|
||||
|
||||
dumpDFA(): void;
|
||||
|
||||
getSourceName(): any;
|
||||
|
||||
setTrace(trace: boolean): void;
|
||||
}
|
||||
Vendored
+44
@@ -0,0 +1,44 @@
|
||||
import { RuleContext } from './RuleContext';
|
||||
import { Token } from './Token';
|
||||
import { ErrorNode, ParseTreeListener } from './tree/Tree';
|
||||
import { Interval } from './IntervalSet';
|
||||
import { RecognitionException } from './error/Errors';
|
||||
|
||||
export class ParserRuleContext extends RuleContext {
|
||||
readonly start: Token;
|
||||
readonly stop: Token;
|
||||
readonly ruleIndex: number;
|
||||
readonly exception: RecognitionException;
|
||||
|
||||
constructor(parent: any, invokingState: number);
|
||||
|
||||
copyFrom(ctx: any): void;
|
||||
|
||||
enterRule(listener: ParseTreeListener): void;
|
||||
|
||||
exitRule(listener: ParseTreeListener): void;
|
||||
|
||||
addChild(child: any): any;
|
||||
|
||||
removeLastChild(): void;
|
||||
|
||||
addTokenNode(token: Token): Token;
|
||||
|
||||
addErrorNode(badToken: Token): ErrorNode;
|
||||
|
||||
getChild(i: number, type?: any): any;
|
||||
|
||||
getToken(ttype: number, i: number): Token;
|
||||
|
||||
getTokens(ttype: number): Token[];
|
||||
|
||||
getTypedRuleContext(cxtType: any, i: number): any;
|
||||
|
||||
getTypedRuleContexts(cxtType: any): any[];
|
||||
|
||||
getChildCount(): number;
|
||||
|
||||
getSourceInterval(): Interval;
|
||||
|
||||
static readonly EMPTY: ParserRuleContext;
|
||||
}
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
import { ErrorListener, ProxyErrorListener } from './error/ErrorListener';
|
||||
import { Token } from './Token';
|
||||
import { ParserRuleContext } from './ParserRuleContext';
|
||||
|
||||
export class Recognizer {
|
||||
state: number;
|
||||
|
||||
checkVersion(toolVersion: number): void;
|
||||
|
||||
addErrorListener(listener: ErrorListener): void;
|
||||
|
||||
removeErrorListeners(): void;
|
||||
|
||||
getTokenTypeMap(): any;
|
||||
|
||||
getRuleIndexMap(): any;
|
||||
|
||||
getTokenType(tokenName: string): any;
|
||||
|
||||
getErrorHeader(e: any): string;
|
||||
|
||||
getTokenErrorDisplay(t: Token): string;
|
||||
|
||||
getErrorListenerDispatch(): ProxyErrorListener;
|
||||
|
||||
sempred(localCtx: ParserRuleContext, ruleIndex: number, actionIndex: number): boolean;
|
||||
|
||||
precpred(localCtx: ParserRuleContext, precedence: any): boolean;
|
||||
}
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
import { ParseTreeVisitor, RuleNode } from './tree/Tree';
|
||||
import { Interval } from './IntervalSet';
|
||||
import { ParserRuleContext } from './ParserRuleContext';
|
||||
|
||||
export class RuleContext extends RuleNode {
|
||||
readonly invokingState: number;
|
||||
readonly parentCtx: ParserRuleContext;
|
||||
|
||||
constructor(parent: any, invokingState: number);
|
||||
|
||||
depth(): number;
|
||||
|
||||
isEmpty(): boolean;
|
||||
|
||||
getSourceInterval(): Interval;
|
||||
|
||||
getRuleContext(): RuleContext;
|
||||
|
||||
getPayload(): RuleContext;
|
||||
|
||||
getText(): string;
|
||||
|
||||
getAltNumber(): number;
|
||||
|
||||
setAltNumber(altNumber: number): void;
|
||||
|
||||
getChild(i: number): any;
|
||||
|
||||
getChildCount(): number;
|
||||
|
||||
accept(visitor: ParseTreeVisitor): void;
|
||||
|
||||
toStringTree(ruleNames: string[], recog: any): string;
|
||||
}
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
export class Token {
|
||||
readonly text: string;
|
||||
source: any;
|
||||
type: any;
|
||||
channel: any;
|
||||
start: number;
|
||||
stop: number;
|
||||
tokenIndex: number;
|
||||
line: number;
|
||||
column: number;
|
||||
|
||||
getTokenSource(): any;
|
||||
|
||||
getInputStream(): any;
|
||||
|
||||
static readonly INVALID_TYPE: number;
|
||||
static readonly EPSILON: number;
|
||||
static readonly MIN_USER_TOKEN_TYPE: number;
|
||||
static readonly EOF: number;
|
||||
static readonly HIDDEN_CHANNEL: number;
|
||||
}
|
||||
|
||||
export class CommonToken extends Token {
|
||||
constructor(source: any, type: any, channel: any, start: number, stop: number);
|
||||
|
||||
clone(): Token;
|
||||
|
||||
toString(): string;
|
||||
|
||||
static readonly EMPTY_SOURCE: any;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+15
@@ -0,0 +1,15 @@
|
||||
import { Recognizer } from '../Recognizer';
|
||||
import { Token } from '../Token';
|
||||
|
||||
export class ErrorListener {
|
||||
syntaxError(recognizer: Recognizer, offendingSymbol: Token, line: number, column: number, msg: string, e: any): void;
|
||||
reportAmbiguity(recognizer: Recognizer, dfa: any, startIndex: number, stopIndex: number, exact: any, ambigAlts: any, configs: any): void;
|
||||
reportAttemptingFullContext(recognizer: Recognizer, dfa: any, startIndex: number, stopIndex: number, conflictingAlts: any, configs: any): void;
|
||||
reportContextSensitivity(recognizer: Recognizer, dfa: any, startIndex: number, stopIndex: number, conflictingAlts: any, configs: any): void;
|
||||
}
|
||||
|
||||
export class ConsoleErrorListener extends ErrorListener {
|
||||
}
|
||||
|
||||
export class ProxyErrorListener extends ErrorListener {
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import { Recognizer } from '../Recognizer';
|
||||
|
||||
export class ErrorStrategy {
|
||||
reset(recognizer: Recognizer): void;
|
||||
|
||||
recoverInline(recognizer: Recognizer): void;
|
||||
|
||||
recover(recognizer: Recognizer, e: Error): void;
|
||||
|
||||
sync(recognizer: Recognizer): void;
|
||||
|
||||
inErrorRecoveryMode(recognizer: Recognizer): void;
|
||||
|
||||
reportError(recognizer: Recognizer): void;
|
||||
}
|
||||
|
||||
export class DefaultErrorStrategy extends ErrorStrategy {
|
||||
}
|
||||
|
||||
export class BailErrorStrategy extends ErrorStrategy {
|
||||
}
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
import { ParserRuleContext } from '../ParserRuleContext';
|
||||
import { Recognizer } from '../Recognizer';
|
||||
import { InputStream } from '../InputStream';
|
||||
import { Token } from '../Token';
|
||||
|
||||
export class RecognitionException extends Error {
|
||||
message: string;
|
||||
ctx: ParserRuleContext;
|
||||
recognizer: Recognizer;
|
||||
input: InputStream;
|
||||
offendingToken: Token;
|
||||
offendingState: -1;
|
||||
getExpectedTokens(): Token[];
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export class LexerNoViableAltException extends RecognitionException {
|
||||
}
|
||||
|
||||
export class NoViableAltException extends RecognitionException {
|
||||
}
|
||||
|
||||
export class InputMismatchException extends RecognitionException {
|
||||
}
|
||||
|
||||
export class FailedPredicateException extends RecognitionException {
|
||||
}
|
||||
|
||||
export class ParseCancellationException extends RecognitionException {
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
export * from './ErrorListener';
|
||||
export * from './ErrorStrategy';
|
||||
export * from './Errors';
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// Type definitions for antlr4 4.7
|
||||
// Project: https://github.com/antlr/antlr4
|
||||
// Definitions by: Marlon Chatman <https://github.com/mcchatman8009>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
export * from './Lexer';
|
||||
export * from './Parser';
|
||||
export * from './Recognizer';
|
||||
export * from './ParserRuleContext';
|
||||
export * from './IntervalSet';
|
||||
export * from './CommonTokenStream';
|
||||
export * from './InputStream';
|
||||
export * from './Token';
|
||||
import { ParserRuleContext } from './ParserRuleContext';
|
||||
|
||||
export type AntlrRule = ParserRuleContext;
|
||||
Vendored
+80
@@ -0,0 +1,80 @@
|
||||
import { Interval } from '../IntervalSet';
|
||||
import { Token } from '../Token';
|
||||
import { ParserRuleContext } from '../ParserRuleContext';
|
||||
|
||||
export const INVALID_INTERVAL: Interval;
|
||||
|
||||
export class ParseTree {
|
||||
}
|
||||
|
||||
export class RuleNode extends ParseTree {
|
||||
}
|
||||
|
||||
export class TerminalNode implements ParseTree {
|
||||
constructor(symbol: Token);
|
||||
|
||||
getChild(i: number): any;
|
||||
|
||||
getSymbol(): Token;
|
||||
|
||||
getParent(): any;
|
||||
|
||||
getPayload(): Token;
|
||||
|
||||
getSourceInterval(): Interval;
|
||||
|
||||
getChildCount(): number;
|
||||
|
||||
accept(visitor: ParseTreeVisitor): any;
|
||||
|
||||
getText(): string;
|
||||
|
||||
toString(): string;
|
||||
|
||||
readonly parentCtx: any;
|
||||
readonly symbol: Token;
|
||||
}
|
||||
|
||||
export class ErrorNode extends TerminalNode {
|
||||
}
|
||||
|
||||
export class ParseTreeVisitor {
|
||||
visit(ctx: ParserRuleContext): any;
|
||||
|
||||
visitChildren(ctx: ParserRuleContext): any;
|
||||
|
||||
visitTerminal(node: TerminalNode): any;
|
||||
|
||||
visitErrorNode(node: ErrorNode): any;
|
||||
}
|
||||
|
||||
export interface ParseTreeListener {
|
||||
visitTerminal(node: TerminalNode): void;
|
||||
|
||||
visitErrorNode(node: ErrorNode): void;
|
||||
|
||||
enterEveryRule(node: ParserRuleContext): void;
|
||||
|
||||
exitEveryRule(node: ParserRuleContext): void;
|
||||
}
|
||||
|
||||
export class TerminalNodeImpl extends TerminalNode {
|
||||
}
|
||||
|
||||
export class ErrorNodeImpl extends TerminalNode {
|
||||
constructor(token: Token);
|
||||
|
||||
isErrorNode(): boolean;
|
||||
|
||||
accept(visitor: ParseTreeVisitor): any;
|
||||
}
|
||||
|
||||
export class ParseTreeWalker {
|
||||
static readonly DEFAULT: ParseTreeWalker;
|
||||
|
||||
walk(listener: ParseTreeListener, rule: any): void;
|
||||
|
||||
enterRule(listener: ParseTreeListener, rule: any): void;
|
||||
|
||||
exitRule(listener: ParseTreeListener, rule: any): void;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"error/ErrorListener.d.ts",
|
||||
"error/Errors.d.ts",
|
||||
"error/ErrorStrategy.d.ts",
|
||||
"error/index.d.ts",
|
||||
"tree/Tree.d.ts",
|
||||
"antlr4-tests.ts",
|
||||
"BufferedTokenStream.d.ts",
|
||||
"CommonTokenStream.d.ts",
|
||||
"index.d.ts",
|
||||
"InputStream.d.ts",
|
||||
"IntervalSet.d.ts",
|
||||
"Lexer.d.ts",
|
||||
"Parser.d.ts",
|
||||
"ParserRuleContext.d.ts",
|
||||
"Recognizer.d.ts",
|
||||
"RuleContext.d.ts",
|
||||
"Token.d.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+4
-3
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/Khan/aphrodite
|
||||
// Definitions by: Alexey Svetliakov <https://github.com/asvetliakov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import * as CSS from "csstype";
|
||||
|
||||
@@ -14,12 +14,13 @@ type FontFamily =
|
||||
|
||||
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never, [x: number]: never })[keyof T]>;
|
||||
|
||||
type CSSProperties = Omit<BaseCSSProperties, 'fontFamily'> & {
|
||||
type CSSProperties = Omit<BaseCSSProperties, 'fontFamily' | 'transition' | 'animationName' > & {
|
||||
fontFamily?: FontFamily | FontFamily[];
|
||||
animationName?: string | OpenCSSProperties | OpenCSSProperties[];
|
||||
};
|
||||
|
||||
// For pseudo selectors and media queries
|
||||
interface OpenCSSProperties extends CSSProperties {
|
||||
interface OpenCSSProperties extends CSSProperties {
|
||||
[k: string]: CSSProperties[keyof CSSProperties] | CSSProperties;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ async function main() {
|
||||
"POST"
|
||||
);
|
||||
|
||||
generate(["input.ts"], "schema.json", "types.ts", "typescript", "gql", {
|
||||
generate(["input.ts"], "schema.json", "types.ts", "", "typescript", "gql", "", {
|
||||
passthroughCustomScalars: false,
|
||||
customScalarsPrefix: "S",
|
||||
addTypename: false,
|
||||
|
||||
Vendored
+21
-12
@@ -1,13 +1,15 @@
|
||||
// Type definitions for apollo-codegen 0.16
|
||||
// Type definitions for apollo-codegen 0.20
|
||||
// Project: https://github.com/apollographql/apollo-codegen
|
||||
// Definitions by: Bradley Ayers <https://github.com/bradleyayers>
|
||||
// Definitions by: Bradley Ayers <https://github.com/bradleyayers>, Maria Carrasco <https://github.com/kostspielig>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { Options } from 'graphql/utilities/schemaPrinter';
|
||||
|
||||
export function downloadSchema(
|
||||
url: string,
|
||||
outputPath: string,
|
||||
additionalHeaders: { [name: string]: string },
|
||||
additionalHeaders: { [name: string]: string; },
|
||||
insecure: boolean,
|
||||
method: string
|
||||
): Promise<void>;
|
||||
@@ -19,22 +21,29 @@ export function introspectSchema(
|
||||
|
||||
export function printSchema(
|
||||
schemaPath: string,
|
||||
outputPath: string
|
||||
outputPath: string,
|
||||
options?: Options
|
||||
): Promise<void>;
|
||||
|
||||
export type TargetType = 'json' | 'swift' | 'ts-legacy' | 'typescript-legacy' | 'flow-legacy' | 'scala' | 'flow' | 'typescript' | 'ts';
|
||||
|
||||
export function generate(
|
||||
inputPaths: string[],
|
||||
schemaPath: string,
|
||||
outputPath: string,
|
||||
target: "json" | "swift" | "ts" | "typescript" | "flow" | "scala",
|
||||
only: string,
|
||||
target: TargetType,
|
||||
tagName: string,
|
||||
projectName: string,
|
||||
options: {
|
||||
passthroughCustomScalars: boolean;
|
||||
customScalarsPrefix: string;
|
||||
addTypename: boolean;
|
||||
namespace: string;
|
||||
operationIdsPath: string | null;
|
||||
generateOperationIds: boolean;
|
||||
mergeInFieldsFromFragmentSpreads: boolean;
|
||||
passthroughCustomScalars?: boolean;
|
||||
customScalarsPrefix?: string;
|
||||
addTypename?: boolean;
|
||||
namespace?: string;
|
||||
operationIdsPath?: string | null;
|
||||
generateOperationIds?: boolean;
|
||||
mergeInFieldsFromFragmentSpreads?: boolean;
|
||||
useFlowExactObjects?: boolean;
|
||||
useFlowReadOnlyTypes?: boolean;
|
||||
}
|
||||
): void;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { createUploadLink, ReactNativeFile } from "apollo-upload-client";
|
||||
|
||||
new ReactNativeFile({
|
||||
name: "its coming home",
|
||||
type: "its coming",
|
||||
uri: "football's coming home",
|
||||
});
|
||||
|
||||
createUploadLink({
|
||||
fetch: (uri, options) => fetch(`http://localhost/${uri}`, options),
|
||||
fetchOptions: { method: "GET" },
|
||||
headers: { special: "Special header value" },
|
||||
includeExtensions: true,
|
||||
uri: "http://localhost",
|
||||
credentials: "beepboop",
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// Type definitions for apollo-upload-client 8.1
|
||||
// Project: https://github.com/jaydenseric/apollo-upload-client#readme
|
||||
// Definitions by: Edward Sammut Alessi <https://github.com/Slessi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import { ApolloLink } from "apollo-link";
|
||||
import { HttpOptions } from "apollo-link-http-common";
|
||||
|
||||
export { ReactNativeFile } from "extract-files";
|
||||
|
||||
/**
|
||||
* `createUploadLink` options match `createHttpLink` options
|
||||
* @param linkOptions `HttpOptions`
|
||||
*/
|
||||
export function createUploadLink(linkOptions?: HttpOptions): ApolloLink;
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"apollo-link": "^1.0.0",
|
||||
"apollo-link-http-common": "^0.2.4"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6", "dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"apollo-upload-client-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -17,17 +17,24 @@ const config: Microsoft.ApplicationInsights.IConfig = {
|
||||
autoTrackPageVisitTime: true,
|
||||
disableExceptionTracking: false,
|
||||
disableAjaxTracking: false,
|
||||
disableFetchTracking: true,
|
||||
overridePageViewDuration: false,
|
||||
maxAjaxCallsPerView: -1,
|
||||
disableDataLossAnalysis: true,
|
||||
disableCorrelationHeaders: true,
|
||||
correlationHeaderExcludedDomains: [],
|
||||
disableFlushOnBeforeUnload: false,
|
||||
enableSessionStorageBuffer: false,
|
||||
cookieDomain: "",
|
||||
isCookieUseDisabled: true,
|
||||
isRetryDisabled: true,
|
||||
isPerfAnalyzerEnabled: true,
|
||||
isStorageUseDisabled: true
|
||||
url: "url",
|
||||
isStorageUseDisabled: true,
|
||||
isBeaconApiDisabled: false,
|
||||
sdkExtension: "sdkExtension",
|
||||
isBrowserLinkTrackingEnabled: false,
|
||||
appId: "appId",
|
||||
enableCorsCorrelation: false
|
||||
};
|
||||
|
||||
appInsights = {
|
||||
@@ -175,3 +182,8 @@ const traceObj = new Microsoft.ApplicationInsights.Telemetry.Trace("message", nu
|
||||
const traceData = new Microsoft.ApplicationInsights.Telemetry.Common.Data<Microsoft.ApplicationInsights.Telemetry.Trace>(Microsoft.ApplicationInsights.Telemetry.Trace.dataType, traceObj);
|
||||
const traceEnvelope = new Microsoft.ApplicationInsights.Telemetry.Common.Envelope(traceData, Microsoft.ApplicationInsights.Telemetry.Trace.envelopeType);
|
||||
context.track(traceEnvelope);
|
||||
|
||||
// UtilHelpers
|
||||
let Util: typeof Microsoft.ApplicationInsights.UtilHelpers;
|
||||
|
||||
Util.newId();
|
||||
|
||||
+15
-1
@@ -1,6 +1,7 @@
|
||||
// Type definitions for ApplicationInsights-JS 1.0
|
||||
// Project: https://github.com/Microsoft/ApplicationInsights-JS
|
||||
// Definitions by: Kamil Szostak <https://github.com/kamilszostak>
|
||||
// Mark Wolff <https://github.com/markwolff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module AI {
|
||||
@@ -560,19 +561,24 @@ declare module Microsoft.ApplicationInsights {
|
||||
samplingPercentage?: number;
|
||||
autoTrackPageVisitTime?: boolean;
|
||||
disableAjaxTracking?: boolean;
|
||||
disableFetchTracking?: boolean;
|
||||
overridePageViewDuration?: boolean;
|
||||
maxAjaxCallsPerView?: number;
|
||||
disableDataLossAnalysis?: boolean;
|
||||
disableCorrelationHeaders?: boolean;
|
||||
correlationHeaderExcludedDomains?: string[];
|
||||
disableFlushOnBeforeUnload?: boolean;
|
||||
enableSessionStorageBuffer?: boolean;
|
||||
isCookieUseDisabled?: boolean;
|
||||
cookieDomain?: string;
|
||||
isRetryDisabled?: boolean;
|
||||
isPerfAnalyzerEnabled?: boolean;
|
||||
url?: string;
|
||||
isStorageUseDisabled?: boolean;
|
||||
isBeaconApiDisabled?: boolean;
|
||||
sdkExtension?: string;
|
||||
isBrowserLinkTrackingEnabled?: boolean;
|
||||
appId?: string;
|
||||
enableCorsCorrelation?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -793,10 +799,18 @@ declare module Microsoft.ApplicationInsights {
|
||||
*/
|
||||
_onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error): any;
|
||||
}
|
||||
|
||||
class UtilHelpers {
|
||||
/**
|
||||
* Generate a random ID string
|
||||
*/
|
||||
static newId(): string;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'applicationinsights-js' {
|
||||
const AppInsights: Microsoft.ApplicationInsights.IAppInsights;
|
||||
const Util: typeof Microsoft.ApplicationInsights.UtilHelpers;
|
||||
}
|
||||
|
||||
declare var appInsights: Microsoft.ApplicationInsights.IAppInsights;
|
||||
|
||||
@@ -96,3 +96,12 @@ console.log(
|
||||
RETURN u
|
||||
`.toArray()
|
||||
);
|
||||
|
||||
const view = db._view("yolo")!;
|
||||
view.properties({
|
||||
consolidationIntervalMsec: 123,
|
||||
consolidationPolicy: {
|
||||
type: "bytes",
|
||||
segmentThreshold: 234
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+58
-9
@@ -837,11 +837,60 @@ declare namespace ArangoDB {
|
||||
|
||||
// Views
|
||||
|
||||
interface View {
|
||||
// TODO
|
||||
[key: string]: any;
|
||||
interface ArangoSearchView {
|
||||
_dbName: string;
|
||||
_id: string;
|
||||
name(): string;
|
||||
type(): ViewType;
|
||||
rename(newName: string): void;
|
||||
properties(
|
||||
newProperties?: ArangoSearchViewPropertiesOptions
|
||||
): ArangoSearchViewProperties;
|
||||
}
|
||||
|
||||
type ArangoSearchViewConsolidationType =
|
||||
| "bytes"
|
||||
| "bytes_accum"
|
||||
| "count"
|
||||
| "fill";
|
||||
|
||||
interface ArangoSearchViewCollectionLink {
|
||||
analyzers?: string[];
|
||||
fields?: { [key: string]: ArangoSearchViewCollectionLink | undefined };
|
||||
includeAllFields?: boolean;
|
||||
trackListPositions?: boolean;
|
||||
storeValues?: "none" | "id";
|
||||
}
|
||||
|
||||
interface ArangoSearchViewProperties {
|
||||
id: string;
|
||||
name: string;
|
||||
type: "arangosearch";
|
||||
|
||||
cleanupIntervalStep: number;
|
||||
consolidationIntervalMsec: number;
|
||||
consolidationPolicy: {
|
||||
type: ArangoSearchViewConsolidationType;
|
||||
segmentThreshold: number;
|
||||
threshold: number;
|
||||
};
|
||||
links: {
|
||||
[key: string]: ArangoSearchViewCollectionLink | undefined;
|
||||
};
|
||||
}
|
||||
|
||||
interface ArangoSearchViewPropertiesOptions {
|
||||
cleanupIntervalStep?: number;
|
||||
consolidationIntervalMsec?: number;
|
||||
consolidationPolicy?: {
|
||||
type?: ArangoSearchViewConsolidationType;
|
||||
segmentThreshold?: number;
|
||||
threshold?: number;
|
||||
};
|
||||
links?: {
|
||||
[key: string]: ArangoSearchViewCollectionLink | undefined;
|
||||
};
|
||||
}
|
||||
type ViewProperties = object; // TODO
|
||||
|
||||
// Global
|
||||
|
||||
@@ -923,13 +972,13 @@ declare namespace ArangoDB {
|
||||
): DocumentMetadata;
|
||||
|
||||
// Views
|
||||
_view(name: string): View | null;
|
||||
_views(): View[];
|
||||
_view(name: string): ArangoSearchView | null;
|
||||
_views(): ArangoSearchView[];
|
||||
_createView(
|
||||
name: string,
|
||||
type: ViewType,
|
||||
properties: ViewProperties
|
||||
): View;
|
||||
properties: ArangoSearchViewPropertiesOptions
|
||||
): ArangoSearchView;
|
||||
_dropView(name: string): void;
|
||||
|
||||
// Global
|
||||
@@ -1392,7 +1441,7 @@ declare module "@arangodb/foxx/router" {
|
||||
}
|
||||
|
||||
declare module "@arangodb/foxx/graphql" {
|
||||
import { GraphQLSchema, formatError } from "graphql";
|
||||
import { formatError, GraphQLSchema } from "graphql";
|
||||
type GraphQLModule = object;
|
||||
type GraphQLFormatErrorFunction = typeof formatError;
|
||||
interface GraphQLOptions {
|
||||
|
||||
Vendored
+3278
-1493
File diff suppressed because it is too large
Load Diff
Vendored
+101
-24
@@ -1,4 +1,4 @@
|
||||
// Type definitions for ArcGIS API for JavaScript 3.24
|
||||
// Type definitions for ArcGIS API for JavaScript 3.25
|
||||
// Project: https://developers.arcgis.com/javascript/3/
|
||||
// Definitions by: Esri <https://github.com/Esri>
|
||||
// Bjorn Svensson <https://github.com/bsvensson>
|
||||
@@ -45,7 +45,6 @@ declare module "esri" {
|
||||
import PrintTemplate = require("esri/tasks/PrintTemplate");
|
||||
import QueryTask = require("esri/tasks/QueryTask");
|
||||
import DataProviderGE = require("esri/dijit/geoenrichment/ReportPlayer/DataProviderGE");
|
||||
import PlayerResizeModes = require("esri/dijit/geoenrichment/ReportPlayer/PlayerResizeModes");
|
||||
import PlayerThemes = require("esri/dijit/geoenrichment/ReportPlayer/PlayerThemes");
|
||||
import TextSymbol = require("esri/symbols/TextSymbol");
|
||||
import StandardGeographyQueryTask = require("esri/tasks/geoenrichment/StandardGeographyQueryTask");
|
||||
@@ -1896,14 +1895,29 @@ declare module "esri" {
|
||||
values: number[];
|
||||
}
|
||||
export interface ReportPlayerOptions {
|
||||
/** Indicates whether left and right arrows key can be used to paginate when viewMode is set to PlayerViewModes.PANELS_IN_SLIDES. */
|
||||
allowKeyboardNavigation?: boolean;
|
||||
/** Specifies which export options are available for the report. */
|
||||
dataProvider?: DataProviderGE;
|
||||
/** Indicate whether to display the report in slide view or full screen, defaults to false which is full view. */
|
||||
isSlidesView?: boolean;
|
||||
/** Specifies how the ReportPlayer should zoom by default. */
|
||||
defaultZoomBehavior?: string;
|
||||
/** Indicates whether interactive experience for panels should be enabled. */
|
||||
enableDataDrilling?: boolean;
|
||||
/** Specifies the resize mode of the ReportPlayer. */
|
||||
resizeMode?: PlayerResizeModes;
|
||||
resizeMode?: string;
|
||||
/** If true, indicates that panels should scale to fit the window. */
|
||||
scaleSlidesToFitWindow?: boolean;
|
||||
/** Indicates whether the analysis area title will be shown in the toolbar. */
|
||||
showAreaTitle?: boolean;
|
||||
/** Indicates whether the toolbar will be shown in a compact popup view. */
|
||||
showToolbarInPopup?: boolean;
|
||||
/** Specifies the theme of the ReportPlayer. */
|
||||
theme?: PlayerThemes;
|
||||
/**
|
||||
* Specifies the display of the report in full page view, slide view, or stacked panel view.
|
||||
* @deprecated
|
||||
*/
|
||||
viewMode?: string;
|
||||
}
|
||||
export interface RingBufferOptions {
|
||||
/** The radii to use to create ring buffers */
|
||||
@@ -7549,22 +7563,45 @@ declare module "esri/dijit/geoenrichment/ReportPlayer/PlayerThemes" {
|
||||
export = PlayerThemes;
|
||||
}
|
||||
|
||||
declare module "esri/dijit/geoenrichment/ReportPlayer/PlayerViewModes" {
|
||||
/** An enumerator of available view modes displaying the Report Player. */
|
||||
class PlayerViewModes {
|
||||
/** Displays one full page at a time. */
|
||||
static FULL_PAGES: any;
|
||||
/** Panels will be shown in the slides view mode. */
|
||||
static PANELS_IN_SLIDES: any;
|
||||
/** Panels will be shown in a single stack. */
|
||||
static PANELS_IN_STACK: any;
|
||||
}
|
||||
export = PlayerViewModes;
|
||||
}
|
||||
|
||||
declare module "esri/dijit/geoenrichment/ReportPlayer/ReportPlayer" {
|
||||
import esri = require("esri");
|
||||
import DataProviderGE = require("esri/dijit/geoenrichment/ReportPlayer/DataProviderGE");
|
||||
import PlayerResizeModes = require("esri/dijit/geoenrichment/ReportPlayer/PlayerResizeModes");
|
||||
import PlayerThemes = require("esri/dijit/geoenrichment/ReportPlayer/PlayerThemes");
|
||||
|
||||
/** The ReportPlayer widget runs infographic report templates for a provided analysis area. */
|
||||
class ReportPlayer {
|
||||
/** Indicates whether left and right arrows key can be used to paginate when viewMode is set to PlayerViewModes.PANELS_IN_SLIDES. */
|
||||
allowKeyboardNavigation: boolean;
|
||||
/** Data Provider for the ReportPlayer which allows you to specify which export options are available when running the report. */
|
||||
dataProvider: DataProviderGE;
|
||||
/** Indicate whether to display the report in slide view or full screen, defaults to false which is full view. */
|
||||
isSlidesView: boolean;
|
||||
/** Specifies how the ReportPlayer should zoom by default. */
|
||||
defaultZoomBehavior: string;
|
||||
/** Indicates whether interactive experience for panels should be enabled. */
|
||||
enableDataDrilling: boolean;
|
||||
/** Specifies the resize mode of the ReportPlayer. */
|
||||
resizeModes: PlayerResizeModes;
|
||||
resizeMode: string;
|
||||
/** If true, indicates that panels should scale to fit the window. */
|
||||
scaleSlidesToFitWindow: boolean;
|
||||
/** Indicates whether the analysis area title will be shown in the toolbar. */
|
||||
showAreaTitle: boolean;
|
||||
/** Indicates whether the toolbar will be shown in a compact popup view. */
|
||||
showToolbarInPopup: boolean;
|
||||
/** Specifies the theme of the ReportPlayer. */
|
||||
theme: PlayerThemes;
|
||||
theme: string;
|
||||
/** Specifies the display of the report in full page view, slide view, or stacked panel view. */
|
||||
viewMode: string;
|
||||
/**
|
||||
* Creates a new ReportPlayer dijit using the given DOM node.
|
||||
* @param params Various parameters that can be used to configure the ReportPlayer.
|
||||
@@ -7577,6 +7614,22 @@ declare module "esri/dijit/geoenrichment/ReportPlayer/ReportPlayer" {
|
||||
* @param playParams See the object specifications table below for the structure of the playParams object.
|
||||
*/
|
||||
playReport(dataProviderParams: any, playParams?: any): any;
|
||||
/**
|
||||
* Sets the width and height of the ReportPlayer when resizeMode is set to PlayerResizeModes.MANUAL.
|
||||
* @param width The width in pixels.
|
||||
* @param height The height in pixels.
|
||||
*/
|
||||
resize(width?: number, height?: number): any;
|
||||
/**
|
||||
* Sets the maximum height for the Report Player.
|
||||
* @param number The height in pixels.
|
||||
*/
|
||||
setMaxHeight(number: number): number;
|
||||
/**
|
||||
* Sets the maximum width for the Report Player.
|
||||
* @param number The width in pixels.
|
||||
*/
|
||||
setMaxWidth(number: number): number;
|
||||
}
|
||||
export = ReportPlayer;
|
||||
}
|
||||
@@ -11463,6 +11516,8 @@ declare module "esri/layers/VectorTileLayer" {
|
||||
|
||||
/** A VectorTileLayer renders cached tiles of data. */
|
||||
class VectorTileLayer extends Layer {
|
||||
/** The current style information of the VectorTileLayer. */
|
||||
currentStyleInfo: any;
|
||||
/** The full extent of the layer. */
|
||||
fullExtent: Extent;
|
||||
/** The initial extent of the layer. */
|
||||
@@ -11608,7 +11663,7 @@ declare module "esri/layers/WCSLayer" {
|
||||
import Point = require("esri/geometry/Point");
|
||||
import Layer = require("esri/layers/layer");
|
||||
|
||||
/** (Currently in beta) The WCSLayer works with OGC Web Coverage Services. */
|
||||
/** The WCSLayer works with OGC Web Coverage Services. */
|
||||
class WCSLayer {
|
||||
/** Resamples pixel by bilinear interpolation. */
|
||||
static INTERPOLATION_BILINEAR: any;
|
||||
@@ -12566,7 +12621,7 @@ declare module "esri/opsdashboard/DataSourceProxy" {
|
||||
import Query = require("esri/tasks/query");
|
||||
import Graphic = require("esri/graphic");
|
||||
|
||||
/** DataSourceProxy is a proxy class that represents a operations dashboard data source. */
|
||||
/** (Currently in Mature Support) DataSourceProxy is a proxy class that represents a operations dashboard data source. */
|
||||
class DataSourceProxy {
|
||||
/** Read-only: The name of the display field. */
|
||||
displayFieldName: string;
|
||||
@@ -12634,7 +12689,7 @@ declare module "esri/opsdashboard/ExtensionBase" {
|
||||
import esri = require("esri");
|
||||
import MapWidgetProxy = require("esri/opsdashboard/MapWidgetProxy");
|
||||
|
||||
/** ExtensionBase is a base class used by all the extension proxies. */
|
||||
/** (Currently in Mature Support) ExtensionBase is a base class used by all the extension proxies. */
|
||||
class ExtensionBase {
|
||||
/** "circle" */
|
||||
static CIRCLE: any;
|
||||
@@ -12712,7 +12767,7 @@ declare module "esri/opsdashboard/ExtensionBase" {
|
||||
declare module "esri/opsdashboard/ExtensionConfigurationBase" {
|
||||
import ExtensionBase = require("esri/opsdashboard/ExtensionBase");
|
||||
|
||||
/** ExtensionConfigurationBase is a base class used by all the extension configuration proxies. */
|
||||
/** (Currently in Mature Support) ExtensionConfigurationBase is a base class used by all the extension configuration proxies. */
|
||||
class ExtensionConfigurationBase extends ExtensionBase {
|
||||
/** The object that will store the Widget/MapTool/FeatureAction configuration. */
|
||||
config: any;
|
||||
@@ -12728,7 +12783,7 @@ declare module "esri/opsdashboard/ExtensionConfigurationBase" {
|
||||
declare module "esri/opsdashboard/FeatureActionConfigurationProxy" {
|
||||
import ExtensionConfigurationBase = require("esri/opsdashboard/ExtensionConfigurationBase");
|
||||
|
||||
/** FeatureActionConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension feature action. */
|
||||
/** (Currently in Mature Support) FeatureActionConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension feature action. */
|
||||
class FeatureActionConfigurationProxy extends ExtensionConfigurationBase {
|
||||
}
|
||||
export = FeatureActionConfigurationProxy;
|
||||
@@ -12738,7 +12793,7 @@ declare module "esri/opsdashboard/FeatureActionFeatures" {
|
||||
import DataSourceProxy = require("esri/opsdashboard/DataSourceProxy");
|
||||
import Graphic = require("esri/graphic");
|
||||
|
||||
/** FeatureActionFeatures is a specialized collection of features used by WidgetProxy to hold the collection of features for the associated feature actions. */
|
||||
/** (Currently in Mature Support) FeatureActionFeatures is a specialized collection of features used by WidgetProxy to hold the collection of features for the associated feature actions. */
|
||||
class FeatureActionFeatures {
|
||||
/** The DataSourceProxy from which the collection of features belongs to. */
|
||||
dataSourceProxy: DataSourceProxy;
|
||||
@@ -12782,7 +12837,7 @@ declare module "esri/opsdashboard/GraphicsLayerProxy" {
|
||||
import Renderer = require("esri/renderers/Renderer");
|
||||
import Graphic = require("esri/graphic");
|
||||
|
||||
/** GraphicsLayerProxy is a proxy class that represents a graphics layer in a map widget in the host application. */
|
||||
/** (Currently in Mature Support) GraphicsLayerProxy is a proxy class that represents a graphics layer in a map widget in the host application. */
|
||||
class GraphicsLayerProxy {
|
||||
/** Read-only: The current host graphics layer maximum visible scale. */
|
||||
maxScale: number;
|
||||
@@ -12843,7 +12898,7 @@ declare module "esri/opsdashboard/GraphicsLayerProxy" {
|
||||
declare module "esri/opsdashboard/MapToolConfigurationProxy" {
|
||||
import ExtensionConfigurationBase = require("esri/opsdashboard/ExtensionConfigurationBase");
|
||||
|
||||
/** MapToolConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension map tool. */
|
||||
/** (Currently in Mature Support) MapToolConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension map tool. */
|
||||
class MapToolConfigurationProxy extends ExtensionConfigurationBase {
|
||||
}
|
||||
export = MapToolConfigurationProxy;
|
||||
@@ -12854,7 +12909,7 @@ declare module "esri/opsdashboard/MapToolProxy" {
|
||||
import MapWidgetProxy = require("esri/opsdashboard/MapWidgetProxy");
|
||||
import Geometry = require("esri/geometry/Geometry");
|
||||
|
||||
/** MapToolProxy is a class used to define an operations dashboard extension map tool. */
|
||||
/** (Currently in Mature Support) MapToolProxy is a class used to define an operations dashboard extension map tool. */
|
||||
class MapToolProxy {
|
||||
/** Read-only: The available size for the map tool user experience on the host map widget. */
|
||||
availableDisplaySize: number;
|
||||
@@ -12907,7 +12962,7 @@ declare module "esri/opsdashboard/MapWidgetProxy" {
|
||||
import Point = require("esri/geometry/Point");
|
||||
import Extent = require("esri/geometry/Extent");
|
||||
|
||||
/** MapWidgetProxy is a proxy class that represents a operations dashboard map widget. */
|
||||
/** (Currently in Mature Support) MapWidgetProxy is a proxy class that represents a operations dashboard map widget. */
|
||||
class MapWidgetProxy {
|
||||
/** Read-only: The map id. */
|
||||
id: string;
|
||||
@@ -12954,7 +13009,7 @@ declare module "esri/opsdashboard/WidgetConfigurationProxy" {
|
||||
import DataSourceProxy = require("esri/opsdashboard/DataSourceProxy");
|
||||
import MapWidgetProxy = require("esri/opsdashboard/MapWidgetProxy");
|
||||
|
||||
/** WidgetConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension widget. */
|
||||
/** (Currently in Mature Support) WidgetConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension widget. */
|
||||
class WidgetConfigurationProxy extends ExtensionConfigurationBase {
|
||||
/**
|
||||
* Called by the host application when the user has changed the selected data source in the data source selector.
|
||||
@@ -12990,7 +13045,7 @@ declare module "esri/opsdashboard/WidgetProxy" {
|
||||
import Graphic = require("esri/graphic");
|
||||
import Geometry = require("esri/geometry/Geometry");
|
||||
|
||||
/** WidgetProxy is a class used to define an operations dashboard extension widget. */
|
||||
/** (Currently in Mature Support) WidgetProxy is a class used to define an operations dashboard extension widget. */
|
||||
class WidgetProxy extends ExtensionBase {
|
||||
/** Read-only: If the widget was configured to consume data sources, the dataSourceConfig array will hold a collection of dataSourceConfig objects. */
|
||||
dataSourceConfigs: any[];
|
||||
@@ -13051,7 +13106,7 @@ declare module "esri/opsdashboard/featureActionProxy" {
|
||||
import DataSourceProxy = require("esri/opsdashboard/DataSourceProxy");
|
||||
import FeatureSet = require("esri/tasks/FeatureSet");
|
||||
|
||||
/** featureActionProxy is a singleton object that allows implementing an operations dashboard Feature Action extension. */
|
||||
/** (Currently in Mature Support) featureActionProxy is a singleton object that allows implementing an operations dashboard Feature Action extension. */
|
||||
class featureActionProxy extends ExtensionBase {
|
||||
/** Event raised when the feature action should execute for a set of features. */
|
||||
on(type: "execute", listener: (event: { config: any; dataSourceProxy: DataSourceProxy; featureSet: FeatureSet; target: featureActionProxy }) => void): esri.Handle;
|
||||
@@ -13903,6 +13958,11 @@ declare module "esri/renderers/smartMapping" {
|
||||
* @param params See the Object Specifications table below for the structure of the params object.
|
||||
*/
|
||||
createPredominanceRenderer(params: any): any;
|
||||
/**
|
||||
* Creates a renderer for exploring the relationship between two numeric attributes.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
*/
|
||||
createRelationshipRenderer(params: any): any;
|
||||
/**
|
||||
* Defines the size of the symbol where feature size is proportional to data value.
|
||||
* @param params See the object specifications table below for the structure of the params object.
|
||||
@@ -15776,6 +15836,8 @@ declare module "esri/tasks/ImageServiceIdentifyParameters" {
|
||||
class ImageServiceIdentifyParameters {
|
||||
/** Input geometry that defines the location to be identified. */
|
||||
geometry: Geometry;
|
||||
/** If the returnCatalogItems parameter is set to true, this parameter will take effect. */
|
||||
maxItemCount: number;
|
||||
/** Specifies the mosaic rules defining the image sorting order. */
|
||||
mosaicRule: MosaicRule;
|
||||
/** The pixel or RGB color value representing no information. */
|
||||
@@ -15794,6 +15856,8 @@ declare module "esri/tasks/ImageServiceIdentifyParameters" {
|
||||
returnCatalogItems: boolean;
|
||||
/** When true, each feature in the catalog items includes the geometry. */
|
||||
returnGeometry: boolean;
|
||||
/** If true, returns the pixel values of all mosaicked raster catalog items under the requested geometry. */
|
||||
returnPixelValues: boolean;
|
||||
/** Specify a time extent. */
|
||||
timeExtent: TimeExtent;
|
||||
/** Creates a new ImageServiceIdentifyParameters object. */
|
||||
@@ -18456,3 +18520,16 @@ declare module "esri/workers/WorkerClient" {
|
||||
export = WorkerClient;
|
||||
}
|
||||
|
||||
declare module "sri/dijit/geoenrichment/ReportPlayer/PlayerZoomBehaviors" {
|
||||
/** Enumerator of available zoom behavior options for the ReportPlayer. */
|
||||
class PlayerZoomBehaviors {
|
||||
/** The Report Player zooms in to fit a full page in the viewable area. */
|
||||
static FIT_PAGE: any;
|
||||
/** The Report Player zooms to fit the full page's width in the viewable area. */
|
||||
static FIT_PAGE_WIDTH: any;
|
||||
/** The zoom will be set to 100% (not zoomed). */
|
||||
static RESET: any;
|
||||
}
|
||||
export = PlayerZoomBehaviors;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user