From 9ebc05c7f56fff8d8d8a59674a53d7095f9d710d Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 26 May 2020 11:33:26 -0700 Subject: [PATCH] Document removed support for TS 2.9 (#44968) --- README.cn.md | 10 +++------- README.es.md | 8 ++++---- README.ko.md | 10 +++++----- README.md | 13 +++++-------- README.ru.md | 8 ++++---- 5 files changed, 21 insertions(+), 28 deletions(-) diff --git a/README.cn.md b/README.cn.md index 1b140c9fdf..2b5535a3d9 100644 --- a/README.cn.md +++ b/README.cn.md @@ -59,9 +59,9 @@ npm install --save-dev @types/node 这通常会在 `package.json` 文件中的 `"types"` 或 `"typings"` 字段中提供, 或者可以只查找包中的任何 ".d.ts" 文件并手动将它们包含在 `/// `. -#### 旧版本的 TypeScript(2.8 和更早版本) +#### 旧版本的 TypeScript(2.9 和更早版本) -Definitely Typed 仅在小于 2 年的 TypeScript 版本上测试软件包。当前已测试 2.9 及更高版本。如果您使用的是 TypeScript 2.0 到 2.8,仍然可以尝试安装 @types 软件包,大多数软件包都不使用 TypeScript 的新特性。但是不能保证它们会起作用,这是支持窗口: +Definitely Typed 仅在小于 2 年的 TypeScript 版本上测试软件包。当前已测试 3.0 及更高版本。如果您使用的是 TypeScript 2.0 到 2.9,仍然可以尝试安装 @types 软件包,大多数软件包都不使用 TypeScript 的新特性。但是不能保证它们会起作用,这是支持窗口: Version | Released | End of Support -- | -- | -- @@ -342,13 +342,9 @@ Definitely Typed 包的发布者会为在 Definitely Typed 之外没有依赖的 请不要更改准确的类型定义。 对于一个 NPM 包,如果使用 `node -p 'require("foo")'` 去导入模块,那么 `export =` 是准确的。如果使用 `node -p 'require("foo").default'` 去导入模块,那么 `export default` 是准确的。 -#### 我想使用 TypeScript 2.1 或更高版本的功能。 - -那么你必须在你的定义头部的最后一行添加注释(在 `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped` 之后):`// TypeScript Version: 2.1`. - #### 我想使用 TypeScript 3.1 或更高版本的功能。 -你可以使用与上面相同的 `// TypeScript Version: 3.1` 注释。 +那么你必须在你的定义头部的最后一行添加注释(在 `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped` 之后):`// TypeScript Version: 3.1`. 但是,如果你的项目在维护类型时需要在兼容 3.1 版本及以上的同时还要兼容 3.0 及以下的版本,那么你需要使用一个只有在 TypeScript 3.1 及以上版本的新特性 `typesVersions`. 你可以在 [官方 TypeScript 文档](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#version-selection-with-typesversions) 中找到此功能的详细说明。 diff --git a/README.es.md b/README.es.md index 0e74efaa89..710a54416c 100644 --- a/README.es.md +++ b/README.es.md @@ -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 `/// `. -#### Versiones más viejas de Typescript (2.8 y anteriores) +#### Versiones más viejas de Typescript (2.9 y anteriores) Definitely Typed solamente prueba paquetes en versiones de TypeScript que son menores a 2 años. -Actualmente, las versiones 2.9 y posteriores están siendo probadas. Si estas usando TypeScript 2.0 a 2.8, 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.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. Versiones soportadas: Versión | Liberado | Fin de soporte @@ -275,9 +275,9 @@ Si la import predeterminada trabaja en tu ambiente, considera hacer un cambio en No cambies la type definition si es preciso. Para un paquete NPM, `export =` es exacto si `node -p 'require("foo")'` es la export, y `export default` es exacto si `node -p 'require("foo").default'` es el export. -#### Quiero usar las características de TypeScript 2.1 o superior. +#### Quiero usar las características de TypeScript 3.1 o superior. -Entonces deberás añadir un comentario a la última línea de la definición en el encabezado (despues de `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`): `// TypeScript Version: 2.1`. +Entonces deberás añadir un comentario a la última línea de la definición en el encabezado (despues de `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`): `// TypeScript Version: 3.1`. #### Quiero añadir un DOM API que no está presente en TypeScript por defecto. diff --git a/README.ko.md b/README.ko.md index 7fe4da8e64..cd53ae1226 100644 --- a/README.ko.md +++ b/README.ko.md @@ -65,11 +65,11 @@ NPM 의 "foo" 패키지에 대응되는 자료형 패키지는 "@types/foo" 입 이 경우 주로 `package.json` 파일의 `"types"` 나 `"typings"` 필드(Field)를 통해 제공되지만, `/// ` 같은 주석을 사용하여 패키지 안의 ".d.ts" 파일들을 직접 가져와야 할 수도 있습니다. -#### 이전 버전 TypeScript (2.8 또는 그 이전) +#### 이전 버전 TypeScript (2.9 또는 그 이전) Definitely Typed는 2년이 지나지 않은 TypeScript 버전만을 대상으로 패키지를 테스트합니다. -현재 버전 2.9 및 그 이상만을 테스트하고 있습니다. -TypeScript 2.0에서 2.8 버전을 사용하는 경우, 그래도 `@types` 패키지를 한번 설치해 보셔도 무방합니다. 최신 TypeScript 기능을 사용하는 패키지는 그리 많지 않으니까요. +현재 버전 3.0 및 그 이상만을 테스트하고 있습니다. +TypeScript 2.0에서 2.9 버전을 사용하는 경우, 그래도 `@types` 패키지를 한번 설치해 보셔도 무방합니다. 최신 TypeScript 기능을 사용하는 패키지는 그리 많지 않으니까요. 그러나 작동 여부를 보장하지는 못합니다. 지원 기간은 다음과 같습니다: @@ -315,9 +315,9 @@ NPM 의 패키지들은 수시간 안에 갱신될 겁니다. 만약 24 시간 자료형 정의(Type definition)가 맞는 경우에는 자료형 정의(Type definition)을 수정하지 마세요. NPM 패키지의 경우, `node -p 'require("foo")'` 가 원하는 값이라면 `export =` 이 맞고, `node -p 'require("foo").default'` 이 원하는 값이라면 `export default` 이 맞습니다. -#### 자료형 선언(Type declaration)에서 타입스크립트(TypeScript) 2.1 이상의 기능을 사용하고 싶습니다. +#### 자료형 선언(Type declaration)에서 타입스크립트(TypeScript) 3.1 이상의 기능을 사용하고 싶습니다. -정의(Definition) 머릿주석(`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`) 뒤에 `// TypeScript Version: 2.1` 를 추가해주시면 됩니다. +정의(Definition) 머릿주석(`// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`) 뒤에 `// TypeScript Version: 3.1` 를 추가해주시면 됩니다. #### 타입스크립트(TypeScript)에 기본으로 포함되지 않은 DOM API 를 추가하고 싶어요. diff --git a/README.md b/README.md index bfb282d3e4..55c385a8cb 100644 --- a/README.md +++ b/README.md @@ -65,11 +65,11 @@ 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 `/// `. -#### Older versions of TypeScript (2.8 and earlier) +#### Older versions of TypeScript (2.9 and earlier) Definitely Typed only tests packages on versions of TypeScript that are less than 2 years old. -Currently versions 2.9 and above are tested. -If you're using TypeScript 2.0 to 2.8, you can still try installing `@types` packages — the majority of packages don't use fancy new TypeScript features. +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. But there's no guarantee that they'll work. Here is the support window: @@ -414,13 +414,10 @@ 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 2.9 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: 2.9`. - #### I want to use features from TypeScript 3.1 or above. -You can use the same `// TypeScript Version: 3.1` comment as 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`. + 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. 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). diff --git a/README.ru.md b/README.ru.md index e44f177847..e5ace81b0b 100644 --- a/README.ru.md +++ b/README.ru.md @@ -71,10 +71,10 @@ npm install --save-dev @types/node Если вы все еще не можете найти его, проверьте [включает](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) ли пакет собственную типизацию. Обычно это отражается в поле `"types"` или `"typings"` файла `package.json`, или просто ищите любые файлы «.d.ts» в пакете и вручную включайте их с помощью `/// `. -#### Typescript 2.8 и старее +#### Typescript 2.9 и старее Начиная с ноября 2019 года, Definitely Typed тестирует пакеты только на версиях Typescript, которым меньше двух лет. -Если вы используете Typescript от 2.0 до 2.8, вы все равно можете попробовать установить пакеты `@types` - большинство пакетов не используют новые функции Typescript. +Если вы используете Typescript от 2.0 до 2.9, вы все равно можете попробовать установить пакеты `@types` - большинство пакетов не используют новые функции Typescript. Но нет гарантии, что они будут работать. График обновлений: @@ -322,9 +322,9 @@ f('one'); Не меняйте определение типа, если оно точное. Для пакета NPM, `export =` является точным, если `node -p 'require("foo")'` является экспортом, а `export default` является точным, если `node -p 'require("foo").default'` является экспортом. -#### Я хочу использовать функции из TypeScript 2.1 или выше. +#### Я хочу использовать функции из TypeScript 3.1 или выше. -В таком случае вам нужно будет добавить комментарий к последней строке заголовка вашего определения (после `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`): `// TypeScript Version: 2.1`. +В таком случае вам нужно будет добавить комментарий к последней строке заголовка вашего определения (после `// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`): `// TypeScript Version: 3.1`. #### Я хочу добавить DOM API, отсутствующий в TypeScript по умолчанию.