From ed36b1aa90c2273479c3870448ae55213be49c67 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 3 Sep 2020 08:12:54 -0700 Subject: [PATCH] Knockout put current version in root (#47255) * Put current version of knockout in the root Previously, the code that supports the oldest version of Typescript was in the root: 3.1 and below. Newer versions were in ts*/ subdirectories. This PR puts the newest version in the root, and older versions -- before 4.0 in this case -- in ts*/ subdirectories. This is possible because all supported versions of the Typescript now understand the typesVersions property in package.json. This PR needs a new version of DefinitelyTyped-tools and dtslint, which I will ship soon. It also needs to be brought up to date with master. * Delete ts4.0/ --- types/knockout/index.d.ts | 2 +- types/knockout/package.json | 4 ++-- types/knockout/{ts4.0 => ts3.9}/index.d.ts | 14 -------------- types/knockout/{ts4.0 => ts3.9}/test/index.ts | 0 types/knockout/{ts4.0 => ts3.9}/test/readonly.ts | 0 .../{ts4.0 => ts3.9}/test/templatingBehaviors.ts | 0 types/knockout/{ts4.0 => ts3.9}/tsconfig.json | 0 types/knockout/{ts4.0 => ts3.9}/tslint.json | 0 8 files changed, 3 insertions(+), 17 deletions(-) rename types/knockout/{ts4.0 => ts3.9}/index.d.ts (98%) rename types/knockout/{ts4.0 => ts3.9}/test/index.ts (100%) rename types/knockout/{ts4.0 => ts3.9}/test/readonly.ts (100%) rename types/knockout/{ts4.0 => ts3.9}/test/templatingBehaviors.ts (100%) rename types/knockout/{ts4.0 => ts3.9}/tsconfig.json (100%) rename types/knockout/{ts4.0 => ts3.9}/tslint.json (100%) diff --git a/types/knockout/index.d.ts b/types/knockout/index.d.ts index eadd28d875..d96d22a9a2 100644 --- a/types/knockout/index.d.ts +++ b/types/knockout/index.d.ts @@ -10,7 +10,6 @@ // Retsam // Rey Pena // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 interface KnockoutSubscribableFunctions { /** @@ -286,6 +285,7 @@ interface KnockoutObservableStatic { fn: KnockoutObservableFunctions; (value: T): KnockoutObservable; + (value: any): KnockoutObservable; (value: null): KnockoutObservable (): KnockoutObservable } diff --git a/types/knockout/package.json b/types/knockout/package.json index d17715e91f..86892b38c9 100644 --- a/types/knockout/package.json +++ b/types/knockout/package.json @@ -2,9 +2,9 @@ "private": true, "types": "index", "typesVersions": { - ">=4.0.0-0": { + "<=3.9": { "*": [ - "ts4.0/*" + "ts3.9/*" ] } } diff --git a/types/knockout/ts4.0/index.d.ts b/types/knockout/ts3.9/index.d.ts similarity index 98% rename from types/knockout/ts4.0/index.d.ts rename to types/knockout/ts3.9/index.d.ts index d96d22a9a2..e1100d7c04 100644 --- a/types/knockout/ts4.0/index.d.ts +++ b/types/knockout/ts3.9/index.d.ts @@ -1,16 +1,3 @@ -// Type definitions for Knockout v3.4.0 -// Project: http://knockoutjs.com -// Definitions by: Boris Yankov , -// Igor Oleinikov , -// Clément Bourgeois , -// Matt Brooks , -// Benjamin Eckardt , -// Mathias Lorenzen , -// Leonardo Lombardi -// Retsam -// Rey Pena -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - interface KnockoutSubscribableFunctions { /** * Notify subscribers of knockout "change" event. This doesn't actually change the observable value. @@ -285,7 +272,6 @@ interface KnockoutObservableStatic { fn: KnockoutObservableFunctions; (value: T): KnockoutObservable; - (value: any): KnockoutObservable; (value: null): KnockoutObservable (): KnockoutObservable } diff --git a/types/knockout/ts4.0/test/index.ts b/types/knockout/ts3.9/test/index.ts similarity index 100% rename from types/knockout/ts4.0/test/index.ts rename to types/knockout/ts3.9/test/index.ts diff --git a/types/knockout/ts4.0/test/readonly.ts b/types/knockout/ts3.9/test/readonly.ts similarity index 100% rename from types/knockout/ts4.0/test/readonly.ts rename to types/knockout/ts3.9/test/readonly.ts diff --git a/types/knockout/ts4.0/test/templatingBehaviors.ts b/types/knockout/ts3.9/test/templatingBehaviors.ts similarity index 100% rename from types/knockout/ts4.0/test/templatingBehaviors.ts rename to types/knockout/ts3.9/test/templatingBehaviors.ts diff --git a/types/knockout/ts4.0/tsconfig.json b/types/knockout/ts3.9/tsconfig.json similarity index 100% rename from types/knockout/ts4.0/tsconfig.json rename to types/knockout/ts3.9/tsconfig.json diff --git a/types/knockout/ts4.0/tslint.json b/types/knockout/ts3.9/tslint.json similarity index 100% rename from types/knockout/ts4.0/tslint.json rename to types/knockout/ts3.9/tslint.json