forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/DefinitelyTyped/Definitel…
…yTyped into azdata_1_22 # Conflicts: # types/azdata/index.d.ts
- Loading branch information
Showing
3,184 changed files
with
197,361 additions
and
138,905 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
这可能会对在 PRs 和包中遇到任何问题的贡献者有所帮助。 | ||
|
||
* 最近的构建都具有完善的 [类型标注](https://github.com/Microsoft/dtslint):[![Build Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.DefinitelyTyped?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=1&branchName=master) | ||
* 所有的包基于 typescript@next 版本都有完善的类型标注:[![Build Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.dtslint-runner?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=2&branchName=master) | ||
* 所有的包基于 typescript@next 版本都有完善的类型标注:[![Build status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/Nightly%20dtslint)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=8) | ||
* 所有的包都会在1小时内 [发布到 npm](https://github.com/Microsoft/types-publisher): [![Publish Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.types-publisher-watchdog?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=5&branchName=master) | ||
* [typescript-bot](https://github.com/typescript-bot) 在 Definitely Typed 一直处于活跃状态 [![Activity Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.typescript-bot-watchdog?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=6&branchName=master) | ||
|
||
|
@@ -59,9 +59,9 @@ npm install --save-dev @types/node | |
这通常会在 `package.json` 文件中的 `"types"` 或 `"typings"` 字段中提供, | ||
或者可以只查找包中的任何 ".d.ts" 文件并手动将它们包含在 `/// <reference path="" />`. | ||
|
||
#### 旧版本的 TypeScript(2.9 和更早版本) | ||
#### 旧版本的 TypeScript(3.0 和更早版本) | ||
|
||
Definitely Typed 仅在小于 2 年的 TypeScript 版本上测试软件包。当前已测试 3.0 及更高版本。如果您使用的是 TypeScript 2.0 到 2.9,仍然可以尝试安装 @types 软件包,大多数软件包都不使用 TypeScript 的新特性。但是不能保证它们会起作用,这是支持窗口: | ||
Definitely Typed 仅在小于 2 年的 TypeScript 版本上测试软件包。当前已测试 3.1 及更高版本。如果您使用的是 TypeScript 2.0 到 3.0,仍然可以尝试安装 @types 软件包,大多数软件包都不使用 TypeScript 的新特性。但是不能保证它们会起作用,这是支持窗口: | ||
|
||
Version | Released | End of Support | ||
-- | -- | -- | ||
|
@@ -77,6 +77,7 @@ Version | Released | End of Support | |
3.7 | November 2019 | November 2021 | ||
3.8 | February 2020 | February 2022 | ||
3.9 | May 2020 | May 2022 | ||
4.0 | August 2020 | August 2022 | ||
|
||
`@types` 软件包具有它们明确支持的 TypeScript 版本的标记,因此通常可以获取早于 2 年窗口的较早版本的软件包。例如,如果运行 `npm dist-tags @types/react`,您将看到 TypeScript 2.5 可以将类型用于 [email protected],而 TypeScript 2.6 和 2.7 可以将类型用于 [email protected]: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,10 +32,10 @@ Si aún no puedes encontrarlo, comprueba si el paquete ya [incluye](http://www.t | |
Esto es provisto usualmente en el campo `"types"` o `"typings"` en el `package.json`, | ||
o solo busca por cualquier archivo ".d.ts" en el paquete e inclúyelo manualmente con un `/// <reference path="" />`. | ||
|
||
#### Versiones más viejas de Typescript (2.9 y anteriores) | ||
#### Versiones más viejas de Typescript (3.0 y anteriores) | ||
|
||
Definitely Typed solamente prueba paquetes en versiones de TypeScript que son menores a 2 años. | ||
Actualmente, las versiones 3.0 y posteriores están siendo probadas. Si estas usando TypeScript 2.0 a 2.9, puedes intentar instalando paquetes `@types` — la mayoría de los paquetes no usan los beneficios de Typescript más nuevos. No hay garantía de que funcionen. | ||
Actualmente, las versiones 3.1 y posteriores están siendo probadas. Si estas usando TypeScript 2.0 a 3.0, puedes intentar instalando paquetes `@types` — la mayoría de los paquetes no usan los beneficios de Typescript más nuevos. No hay garantía de que funcionen. | ||
Versiones soportadas: | ||
|
||
Versión | Liberado | Fin de soporte | ||
|
@@ -52,6 +52,7 @@ Versión | Liberado | Fin de soporte | |
3.7 | Noviembre 2019 | Noviembre 2021 | ||
3.8 | Febrero 2020 | Febrero 2022 | ||
3.9 | Mayo 2020 | Mayo 2022 | ||
4.0 | Agosto 2020 | Agosto 2022 | ||
|
||
Los paquetes `@types` tienen etiquetas para las versiones de Typescript que explícitamente soportan, usualmente puedes obtener versiones más viejas de los paquetes anteriores a 2 años. | ||
Por ejemplo, si ejecutas `npm dist-tags @types/react`, observaras que Typescript 2.5 puede usar types para [email protected], a su vez, Typescript 2.6 y 2.7 pueden usar types para [email protected]. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ | |
기여자분들이 작성한 PR 또는 패키지에 문제가 발생했을 경우 이 표시를 보면 도움이 될 수 있습니다. | ||
|
||
* 최신 빌드가 [타입 체크/린트](https://github.com/Microsoft/dtslint) 과정을 깔끔하게 통과했습니다: [![Build Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.DefinitelyTyped?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=1&branchName=master) | ||
* 모든 패키지가 typescript@next상에서 타입 체크/린트 과정을 깔끔하게 통과합니다: [![Build Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.dtslint-runner?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=2&branchName=master) | ||
* 모든 패키지가 typescript@next상에서 타입 체크/린트 과정을 깔끔하게 통과합니다: [![Build status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/Nightly%20dtslint)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=8) | ||
* 모든 패키지가 1시간 내에 [npm에 배포](https://github.com/microsoft/types-publisher)되었습니다: [![Publish Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.types-publisher-watchdog?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=5&branchName=master) | ||
* [typescript-bot](https://github.com/typescript-bot)이 Definitely Typed에서 잘 돌고 있습니다 [![Activity Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.typescript-bot-watchdog?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=6&branchName=master) | ||
|
||
|
@@ -65,11 +65,11 @@ NPM 의 "foo" 패키지에 대응되는 자료형 패키지는 "@types/foo" 입 | |
이 경우 주로 `package.json` 파일의 `"types"` 나 `"typings"` 필드(Field)를 통해 제공되지만, | ||
`/// <reference path="" />` 같은 주석을 사용하여 패키지 안의 ".d.ts" 파일들을 직접 가져와야 할 수도 있습니다. | ||
|
||
#### 이전 버전 TypeScript (2.9 또는 그 이전) | ||
#### 이전 버전 TypeScript (3.0 또는 그 이전) | ||
|
||
Definitely Typed는 2년이 지나지 않은 TypeScript 버전만을 대상으로 패키지를 테스트합니다. | ||
현재 버전 3.0 및 그 이상만을 테스트하고 있습니다. | ||
TypeScript 2.0에서 2.9 버전을 사용하는 경우, 그래도 `@types` 패키지를 한번 설치해 보셔도 무방합니다. 최신 TypeScript 기능을 사용하는 패키지는 그리 많지 않으니까요. | ||
현재 버전 3.1 및 그 이상만을 테스트하고 있습니다. | ||
TypeScript 2.0에서 3.0 버전을 사용하는 경우, 그래도 `@types` 패키지를 한번 설치해 보셔도 무방합니다. 최신 TypeScript 기능을 사용하는 패키지는 그리 많지 않으니까요. | ||
그러나 작동 여부를 보장하지는 못합니다. | ||
지원 기간은 다음과 같습니다: | ||
|
||
|
@@ -87,6 +87,7 @@ TypeScript 2.0에서 2.9 버전을 사용하는 경우, 그래도 `@types` 패 | |
3.7 | 2019년 11월 | 2021년 11월 | ||
3.8 | 2020년 2월 | 2022년 2월 | ||
3.9 | 2020년 5월 | 2022년 5월 | ||
4.0 | 2020년 8월 | 2022년 8월 | ||
|
||
`@types` 패키지 안에는 패키지가 확실하게 지원하는 TypeScript 버전이 태그로 쓰여 있으므로, 2년 지원 기간이 지난 오래된 패키지도 보통 찾아보실 수 있습니다. | ||
예를 들어, `npm dist-tags @types/react` 명령어를 입력하면 TypeScript 2.5는 [email protected]용 타입을, TypeScript 2.6 및 2.7은 [email protected]용 타입을 사용할 수 있는 것을 확인하실 수 있습니다: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ This section tracks the health of the repository and publishing process. | |
It may be helpful for contributors experiencing any issues with their PRs and packages. | ||
|
||
* Most recent build [type-checked/linted](https://github.com/Microsoft/dtslint) cleanly: [![Build Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.DefinitelyTyped?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=1&branchName=master) | ||
* All packages are type-checking/linting cleanly on typescript@next: [![Build Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.dtslint-runner?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=2&branchName=master) | ||
* All packages are type-checking/linting cleanly on typescript@next: [![Build status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/Nightly%20dtslint)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=8) | ||
* All packages are being [published to npm](https://github.com/microsoft/types-publisher) in under an hour: [![Publish Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.types-publisher-watchdog?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=5&branchName=master) | ||
* [typescript-bot](https://github.com/typescript-bot) has been active on Definitely Typed [![Activity Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.typescript-bot-watchdog?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=6&branchName=master) | ||
* Current [infrastructure status updates](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/44317) | ||
|
@@ -65,19 +65,19 @@ If you still can't find it, check if it [bundles](http://www.typescriptlang.org/ | |
This is usually provided in a `"types"` or `"typings"` field in the `package.json`, | ||
or just look for any ".d.ts" files in the package and manually include them with a `/// <reference path="" />`. | ||
|
||
#### Older versions of TypeScript (2.9 and earlier) | ||
#### Older versions of TypeScript (3.0 and earlier) | ||
|
||
Definitely Typed only tests packages on versions of TypeScript that are less than 2 years old. | ||
Currently versions 3.0 and above are tested. | ||
If you're using TypeScript 2.0 to 2.9, you can still try installing `@types` packages — the majority of packages don't use fancy new TypeScript features. | ||
Currently versions 3.1 and above are tested. | ||
If you're using TypeScript 2.0 to 3.0, you can still try installing `@types` packages — the majority of packages don't use fancy new TypeScript features. | ||
But there's no guarantee that they'll work. | ||
Here is the support window: | ||
|
||
Version | Released | End of Support | ||
-- | -- | -- | ||
2.8 | March 2018 | March 2020 | ||
2.9 | May 2018 | May 2020 | ||
3.0 | July 2018 | July 2020 | ||
3.0 | July 2018 | August 2020 | ||
3.1 | September 2018 | September 2020 | ||
3.2 | November 2018 | November 2020 | ||
3.3 | January 2019 | January 2021 | ||
|
@@ -87,6 +87,7 @@ Version | Released | End of Support | |
3.7 | November 2019 | November 2021 | ||
3.8 | February 2020 | February 2022 | ||
3.9 | May 2020 | May 2022 | ||
4.0 | August 2020 | August 2022 | ||
|
||
`@types` packages have tags for versions of TypeScript that they explicitly support, so you can usually get older versions of packages that predate the 2-year window. | ||
For example, if you run `npm dist-tags @types/react`, you'll see that TypeScript 2.5 can use types for [email protected], whereas TypeScript 2.6 and 2.7 can use types for [email protected]: | ||
|
@@ -149,6 +150,9 @@ Once you've tested your package, you can share it on Definitely Typed. | |
|
||
First, [fork](https://guides.github.com/activities/forking/) this repository, install [node](https://nodejs.org/), and run `npm install`. | ||
|
||
We use a bot to let a large number of pull requests to DefinitelyTyped be handled entirely in a self-service manner. You can read more about [why and how here](https://devblogs.microsoft.com/typescript/changes-to-how-we-manage-definitelytyped/). Here is a handy reference showing the life-cycle of a pull request to DT: | ||
|
||
<img src="https://github.com/DefinitelyTyped/dt-mergebot/blob/master/docs/dt-mergebot-lifecycle.png?raw=true"> | ||
|
||
#### Edit an existing package | ||
|
||
|
@@ -193,7 +197,7 @@ const result = twoslash("//") | |
+ const resultWithOptions = twoslash("//", { }) | ||
``` | ||
|
||
You can validate your changes with `npm test` from the root of this repo, which takes changed files into account. | ||
You can validate your changes with `npm test package-name` from the root of this repo, which takes changed files into account. | ||
|
||
#### Create a new package | ||
|
||
|
@@ -334,16 +338,15 @@ For more details, see [dtslint](https://github.com/Microsoft/dtslint#write-tests | |
|
||
## Verifying | ||
|
||
Test your changes by running `npm run lint package-name` where `package-name` is the name of your package. | ||
|
||
This script uses [dtslint](https://github.com/Microsoft/dtslint) to run the TypeScript compiler against your dts files. | ||
Test your changes by running `npm test package-name` where `package-name` is the name of your package. | ||
|
||
This script uses [dtslint](https://github.com/microsoft/dtslint) to run the TypeScript compiler against your dts files. | ||
|
||
## FAQ | ||
|
||
#### What exactly is the relationship between this repository and the `@types` packages on NPM? | ||
|
||
The `master` branch is automatically published to the `@types` scope on NPM thanks to [types-publisher](https://github.com/Microsoft/types-publisher). | ||
The `master` branch is automatically published to the `@types` scope on NPM thanks to [types-publisher](https://github.com/microsoft/DefinitelyTyped-tools). | ||
|
||
#### I've submitted a pull request. How long until it is merged? | ||
|
||
|
@@ -414,14 +417,14 @@ compiler options. | |
Do not change the type definition if it is accurate. | ||
For an NPM package, `export =` is accurate if `node -p 'require("foo")'` works to import a module, and `export default` is accurate if `node -p 'require("foo").default'` works to import a module. | ||
|
||
#### I want to use features from TypeScript 3.1 or above. | ||
#### I want to use features from TypeScript 3.2 or above. | ||
|
||
Then you will have to add a comment to the last line of your definition header (after `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`): `// TypeScript Version: 3.1`. | ||
Then you will have to add a comment to the last line of your definition header (after `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`): `// Minimum TypeScript Version: 3.2`. | ||
|
||
However, if your project needs to maintain types that are compatible with 3.1 and above *at the same time as* types that are compatible with 3.0 or below, you will need to use the `typesVersions` feature, which is available in TypeScript 3.1 and above. | ||
However, if your project needs to maintain types that are compatible with, say, 3.7 and above *at the same time as* types that are compatible with 3.6 or below, you will need to use the `typesVersions` feature. | ||
You can find a detailed explanation of this feature in the [official TypeScript documentation](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#version-selection-with-typesversions). | ||
|
||
Here's a short explanation to get you started: | ||
Here's a short example to get you started: | ||
|
||
1. You'll have to add a `package.json` file to your package definition, with the following contents: | ||
|
||
|
@@ -430,16 +433,17 @@ Here's a short explanation to get you started: | |
"private": true, | ||
"types": "index", | ||
"typesVersions": { | ||
">=3.1.0-0": { "*": ["ts3.1/*"] } | ||
"<=3.6": { "*": ["ts3.6/*"] } | ||
} | ||
} | ||
``` | ||
|
||
2. Create the sub-directory mentioned in the `typesVersions` field inside your types directory (`ts3.1/` in this example) | ||
and add the types and tests specific for the new TypeScript version. You don't need the typical definition header | ||
in any of the files from the `ts3.1/` directory. | ||
2. Create the sub-directory mentioned in the `typesVersions` field inside your types directory (`ts3.6/` in this example). | ||
`ts3.6/` will support TypeScript versions 3.6 and below, so copy the existing types and tests there. | ||
|
||
3. Set the `baseUrl` and `typeRoots` options in `ts3.1/tsconfig.json` to the correct paths, they should look something like this: | ||
You'll need to delete the definition header from `ts3.6/index.d.ts` since only the root `index.d.ts` is supposed to have it. | ||
|
||
3. Set the `baseUrl` and `typeRoots` options in `ts3.6/tsconfig.json` to the correct paths, which should look something like this: | ||
```json | ||
{ | ||
"compilerOptions": { | ||
|
@@ -449,7 +453,10 @@ in any of the files from the `ts3.1/` directory. | |
} | ||
``` | ||
|
||
You can look [here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/debounce-promise) and [here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/create-html-element) for examples. | ||
4. Back in the root of the package, add the TypeScript 3.7 features you want to use. | ||
When people install the package, TypeScript 3.6 and below will start from `ts3.6/index.d.ts`, whereas TypeScript 3.7 and above will start from `index.d.ts`. | ||
|
||
You can look at [styled-components](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/styled-components). | ||
|
||
#### I want to add a DOM API not present in TypeScript by default. | ||
|
||
|
Oops, something went wrong.