Prepare for TS #36696 (#42619)

This commit is contained in:
Anders Hejlsberg 2020-02-25 10:38:03 -08:00 committed by GitHub
parent e7edc7c479
commit 552fe474c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 25 additions and 28 deletions

View File

@ -1158,7 +1158,7 @@ declare namespace MangoPay {
type OtherData = BaseData & OtherDetails;
type Data = OtherData | CAData | GBData | IBANData | USData;
type DataIntersection = OtherData & CAData & GBData & IBANData & USData;
type DataIntersection = OtherData & CAData & GBData & IBANData & USData & { Type: never };
type CreationDetails =
| OtherDetails
| CADetails

View File

@ -267,7 +267,7 @@ declare namespace Mocha {
test: TestFunction;
}
type AnyInterface = Omit<BDD & TDD & QUnit, 'detectedInterface'> & BaseInterface;
type AnyInterface = Omit<BDD, 'detectedInterface'> & Omit<TDD, 'detectedInterface'> & Omit<QUnit, 'detectedInterface'> & BaseInterface;
// #endregion
// #region Test context

View File

@ -353,7 +353,7 @@ export interface GeometryType extends Array<{ x: number, y: number } | GeometryT
}
export type TypeCast = boolean | (
(field: FieldInfo
(field: UntypedFieldInfo
& { type: string, length: number, string(): string, buffer(): Buffer, geometry(): null | GeometryType },
next: () => void) => any);
@ -701,7 +701,7 @@ export const enum Types {
GEOMETRY = 0xff, // aka GEOMETRY
}
export interface FieldInfo {
export interface UntypedFieldInfo {
catalog: string;
db: string;
table: string;
@ -710,10 +710,13 @@ export interface FieldInfo {
orgName: string;
charsetNr: number;
length: number;
type: Types;
flags: number;
decimals: number;
default?: string;
zeroFill: boolean;
protocol41: boolean;
}
export interface FieldInfo extends UntypedFieldInfo {
type: Types;
}

View File

@ -270,21 +270,18 @@ type ThemedStyledComponentFactories<T extends object> = {
export type StyledComponentInnerComponent<
C extends React.ComponentType<any>
> = C extends
| StyledComponent<infer I, any, any, any>
| StyledComponent<infer I, any, any>
? I
: C;
> = C extends StyledComponent<infer I, any, any, any> ? I :
C extends StyledComponent<infer I, any, any> ? I :
C;
export type StyledComponentPropsWithRef<
C extends keyof JSX.IntrinsicElements | React.ComponentType<any>
> = C extends AnyStyledComponent
? React.ComponentPropsWithRef<StyledComponentInnerComponent<C>>
: React.ComponentPropsWithRef<C>;
export type StyledComponentInnerOtherProps<C extends AnyStyledComponent> = C extends
| StyledComponent<any, any, infer O, any>
| StyledComponent<any, any, infer O>
? O
: never;
export type StyledComponentInnerOtherProps<C extends AnyStyledComponent> =
C extends StyledComponent<any, any, infer O, any> ? O :
C extends StyledComponent<any, any, infer O> ? O :
never;
export type StyledComponentInnerAttrs<
C extends AnyStyledComponent
> = C extends StyledComponent<any, any, any, infer A> ? A : never;

View File

@ -236,21 +236,18 @@ type ThemedStyledComponentFactories<T extends object> = {
export type StyledComponentInnerComponent<
C extends React.ComponentType<any>
> = C extends
| StyledComponent<infer I, any, any, any>
| StyledComponent<infer I, any, any>
? I
: C;
> = C extends StyledComponent<infer I, any, any, any> ? I :
C extends StyledComponent<infer I, any, any> ? I :
C;
export type StyledComponentPropsWithRef<
C extends keyof JSX.IntrinsicElements | React.ComponentType<any>
> = C extends AnyStyledComponent
? React.ComponentPropsWithRef<StyledComponentInnerComponent<C>>
: React.ComponentPropsWithRef<C>;
export type StyledComponentInnerOtherProps<C extends AnyStyledComponent> = C extends
| StyledComponent<any, any, infer O, any>
| StyledComponent<any, any, infer O>
? O
: never;
export type StyledComponentInnerOtherProps<C extends AnyStyledComponent> =
C extends StyledComponent<any, any, infer O, any> ? O :
C extends StyledComponent<any, any, infer O> ? O :
never;
export type StyledComponentInnerAttrs<
C extends AnyStyledComponent
> = C extends StyledComponent<any, any, any, infer A> ? A : never;

View File

@ -161,9 +161,9 @@ export class TestMethods<T extends HTMLElement> {
$.tablesorter.getData($(), config.headers[0], "sorter");
// $ExpectType string | boolean | undefined
$.tablesorter.getData($()[0], config.headers[0], "sorter");
// $ExpectType "top" | "bottom" | "zero" | "min" | "max" | undefined
// $ExpectType "top" | "bottom" | "zero" | "min" | "max" | undefined || "top" | "bottom" | "min" | "max" | "zero" | undefined
$.tablesorter.getData($(), config.headers[0], "string");
// $ExpectType "top" | "bottom" | "zero" | "min" | "max" | undefined
// $ExpectType "top" | "bottom" | "zero" | "min" | "max" | undefined || "top" | "bottom" | "min" | "max" | "zero" | undefined
$.tablesorter.getData($()[0], config.headers[0], "string");
// $ExpectType string[]

View File

@ -6,7 +6,7 @@ import { Validation } from './vuelidate'
declare module 'vue/types/vue' {
type ValidationProperties<V> = {
[P in keyof V]?: Validation & ValidationProperties<V[P]> & ValidationEvaluation
[P in Exclude<keyof V, '$v'>]?: Validation & ValidationProperties<V[P]> & ValidationEvaluation
}
interface ValidationGroups {