mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #47624 [node][qs][history] UnknownFacade -> unknown by @OliverJAsh
This commit is contained in:
parent
7487d3c1f4
commit
cc251bdaf2
@ -153,5 +153,5 @@ let input = { value: '' };
|
||||
{
|
||||
const anything: any = {};
|
||||
const history: History = anything;
|
||||
history.location.state; // $ExpectType UnknownFacade
|
||||
history.location.state; // $ExpectType unknown
|
||||
}
|
||||
|
||||
9
types/history/index.d.ts
vendored
9
types/history/index.d.ts
vendored
@ -45,14 +45,7 @@ export namespace History {
|
||||
export type LocationKey = string;
|
||||
export type LocationListener<S = LocationState> = (location: Location<S>, 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;
|
||||
|
||||
7
types/node/v11/globals.d.ts
vendored
7
types/node/v11/globals.d.ts
vendored
@ -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;
|
||||
}
|
||||
|
||||
2
types/node/v11/querystring.d.ts
vendored
2
types/node/v11/querystring.d.ts
vendored
@ -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;
|
||||
|
||||
7
types/node/v12/globals.d.ts
vendored
7
types/node/v12/globals.d.ts
vendored
@ -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;
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ import { readFile } from 'fs';
|
||||
const arg0: () => Promise<number> = util.promisify((cb: (err: Error | null, result: number) => void): void => { });
|
||||
const arg0NoResult: () => Promise<any> = util.promisify((cb: (err: Error | null) => void): void => { });
|
||||
const arg1: (arg: string) => Promise<number> = util.promisify((arg: string, cb: (err: Error | null, result: number) => void): void => { });
|
||||
const arg1UnknownError: (arg: string) => Promise<number> = util.promisify((arg: string, cb: (err: NodeJS.UnknownFacade, result: number) => void): void => { });
|
||||
const arg1UnknownError: (arg: string) => Promise<number> = util.promisify((arg: string, cb: (err: unknown, result: number) => void): void => { });
|
||||
const arg1NoResult: (arg: string) => Promise<any> = util.promisify((arg: string, cb: (err: Error | null) => void): void => { });
|
||||
const cbOptionalError: () => Promise<void | {}> = util.promisify((cb: (err?: Error | null) => void): void => { cb(); }); // tslint:disable-line void-return
|
||||
assert(typeof util.promisify.custom === 'symbol');
|
||||
|
||||
9
types/qs/index.d.ts
vendored
9
types/qs/index.d.ts
vendored
@ -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 };
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
() => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user