diff --git a/types/history/history-tests.ts b/types/history/history-tests.ts index 672d980352..62ea643d58 100644 --- a/types/history/history-tests.ts +++ b/types/history/history-tests.ts @@ -153,5 +153,5 @@ let input = { value: '' }; { const anything: any = {}; const history: History = anything; - history.location.state; // $ExpectType UnknownFacade + history.location.state; // $ExpectType unknown } diff --git a/types/history/index.d.ts b/types/history/index.d.ts index 615f7171f2..695f04e228 100644 --- a/types/history/index.d.ts +++ b/types/history/index.d.ts @@ -45,14 +45,7 @@ export namespace History { export type LocationKey = string; export type LocationListener = (location: Location, action: Action) => void; - // TODO: The value type here is a version of `unknown` with an acceptably lossy amount of accuracy. - // Now that TypeScript's DT support is 3.0+, we can look into replacing this with `unknown`. - type UnknownFacade = {} | null | undefined; - - /** @deprecated - Use `UnknownFacade` instead. It is a better classifier for the type */ - type PoorMansUnknown = UnknownFacade - - export type LocationState = UnknownFacade; + export type LocationState = unknown; export type Path = string; export type Pathname = string; export type Search = string; diff --git a/types/node/v11/globals.d.ts b/types/node/v11/globals.d.ts index 8e6694a815..029acbaee2 100644 --- a/types/node/v11/globals.d.ts +++ b/types/node/v11/globals.d.ts @@ -1142,11 +1142,4 @@ declare namespace NodeJS { } type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array; - - // TODO: The value type here is a version of `unknown` with an acceptably lossy amount of accuracy. - // Now that TypeScript's DT support is 3.0+, we can look into replacing this with `unknown`. - type UnknownFacade = {} | null | undefined; - - /** @deprecated - Use `UnknownFacade` instead. It is a better classifier for the type */ - type PoorMansUnknown = UnknownFacade; } diff --git a/types/node/v11/querystring.d.ts b/types/node/v11/querystring.d.ts index 4563ca6826..5e65b6a6fc 100644 --- a/types/node/v11/querystring.d.ts +++ b/types/node/v11/querystring.d.ts @@ -11,7 +11,7 @@ declare module "querystring" { interface ParsedUrlQuery { [key: string]: string | string[]; } interface ParsedUrlQueryInput { - [key: string]: NodeJS.UnknownFacade; + [key: string]: unknown; } function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; diff --git a/types/node/v12/globals.d.ts b/types/node/v12/globals.d.ts index 1a4f1f32bc..c13ec98ca3 100644 --- a/types/node/v12/globals.d.ts +++ b/types/node/v12/globals.d.ts @@ -1189,11 +1189,4 @@ declare namespace NodeJS { type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array; type ArrayBufferView = TypedArray | DataView; - - // TODO: The value type here is a version of `unknown` with an acceptably lossy amount of accuracy. - // Now that TypeScript's DT support is 3.0+, we can look into replacing this with `unknown`. - type UnknownFacade = {} | null | undefined; - - /** @deprecated - Use `UnknownFacade` instead. It is a better classifier for the type */ - type PoorMansUnknown = UnknownFacade; } diff --git a/types/node/v12/test/util.ts b/types/node/v12/test/util.ts index 31bc4a4b1b..6d1b74106a 100644 --- a/types/node/v12/test/util.ts +++ b/types/node/v12/test/util.ts @@ -120,7 +120,7 @@ import { readFile } from 'fs'; const arg0: () => Promise = util.promisify((cb: (err: Error | null, result: number) => void): void => { }); const arg0NoResult: () => Promise = util.promisify((cb: (err: Error | null) => void): void => { }); const arg1: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error | null, result: number) => void): void => { }); - const arg1UnknownError: (arg: string) => Promise = util.promisify((arg: string, cb: (err: NodeJS.UnknownFacade, result: number) => void): void => { }); + const arg1UnknownError: (arg: string) => Promise = util.promisify((arg: string, cb: (err: unknown, result: number) => void): void => { }); const arg1NoResult: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error | null) => void): void => { }); const cbOptionalError: () => Promise = util.promisify((cb: (err?: Error | null) => void): void => { cb(); }); // tslint:disable-line void-return assert(typeof util.promisify.custom === 'symbol'); diff --git a/types/qs/index.d.ts b/types/qs/index.d.ts index 2b4f10b8a7..cfa3a67d54 100644 --- a/types/qs/index.d.ts +++ b/types/qs/index.d.ts @@ -54,16 +54,9 @@ declare namespace QueryString { interpretNumericEntities?: boolean; } - // TODO: The value type here is a version of `unknown` which replicates with an acceptably lossy amount of accuracy. - // When these types support TypeScript 3.0+, we can replace this with `unknown`. - type UnknownFacade = {} | null | undefined; - - /** @deprecated - UnknownFacade is more clear about what's going on */ - type PoorMansUnknown = UnknownFacade - interface ParsedQs { [key: string]: undefined | string | string[] | ParsedQs | ParsedQs[] } function stringify(obj: any, options?: IStringifyOptions): string; function parse(str: string, options?: IParseOptions & { decoder?: never }): ParsedQs; - function parse(str: string, options?: IParseOptions): { [key: string]: UnknownFacade }; + function parse(str: string, options?: IParseOptions): { [key: string]: unknown }; } diff --git a/types/qs/qs-tests.ts b/types/qs/qs-tests.ts index 13a932c7fc..996b8e4bdc 100644 --- a/types/qs/qs-tests.ts +++ b/types/qs/qs-tests.ts @@ -26,8 +26,8 @@ qs.parse('a=b&c=d', { delimiter: '&' }); } }, }); - obj; // $ExpectType { [key: string]: UnknownFacade; } - obj.a; // $ExpectType UnknownFacade + obj; // $ExpectType { [key: string]: unknown; } + obj.a; // $ExpectType unknown } { @@ -40,8 +40,8 @@ qs.parse('a=b&c=d', { delimiter: '&' }); }, }; let obj = qs.parse('a=c', options); - obj; // $ExpectType { [key: string]: UnknownFacade; } - obj.a; // $ExpectType UnknownFacade + obj; // $ExpectType { [key: string]: unknown; } + obj.a; // $ExpectType unknown } () => {