mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
@@ -24590,8 +24590,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
// parameter and has inferences that would conflict. Otherwise, we use the contra-variant inference.
|
||||
const useCovariantType = inferredCovariantType && !(inferredCovariantType.flags & TypeFlags.Never) &&
|
||||
some(inference.contraCandidates, t => isTypeSubtypeOf(inferredCovariantType, t)) &&
|
||||
every(context.inferences, other => other === inference ||
|
||||
getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter ||
|
||||
every(context.inferences, other =>
|
||||
other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter ||
|
||||
every(other.candidates, t => isTypeSubtypeOf(t, inferredCovariantType)));
|
||||
inferredType = useCovariantType ? inferredCovariantType : getContravariantInference(inference);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
//// [coAndContraVariantInferences3.ts]
|
||||
interface DeprecationOptions {
|
||||
message?: string;
|
||||
error?: boolean;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
||||
|
||||
type OverloadDefinitions = { readonly [P in number]: (...args: any[]) => any; };
|
||||
|
||||
type OverloadBinder<T extends OverloadDefinitions> = (args: OverloadParameters<T>) => OverloadKeys<T> | undefined;
|
||||
|
||||
type OverloadKeys<T extends OverloadDefinitions> = Extract<keyof T, number>;
|
||||
|
||||
type OverloadParameters<T extends OverloadDefinitions> = Parameters<{ [P in OverloadKeys<T>]: T[P]; }[OverloadKeys<T>]>;
|
||||
|
||||
type OverloadFunction<T extends OverloadDefinitions> = UnionToIntersection<T[keyof T]>;
|
||||
|
||||
type OverloadBinders<T extends OverloadDefinitions> = { [P in OverloadKeys<T>]: (args: OverloadParameters<T>) => boolean | undefined; };
|
||||
|
||||
type OverloadDeprecations<T extends OverloadDefinitions> = { [P in OverloadKeys<T>]?: DeprecationOptions; };
|
||||
|
||||
declare function createOverload<T extends OverloadDefinitions>(name: string, overloads: T, binder: OverloadBinders<T>, deprecations?: OverloadDeprecations<T>): UnionToIntersection<T[keyof T]>;
|
||||
|
||||
declare function createBinder<T extends OverloadDefinitions>(overloads: T, binder: OverloadBinders<T>): OverloadBinder<T>;
|
||||
|
||||
interface OverloadBuilder {
|
||||
overload<T extends OverloadDefinitions>(overloads: T): BindableOverloadBuilder<T>;
|
||||
}
|
||||
|
||||
interface BindableOverloadBuilder<T extends OverloadDefinitions> {
|
||||
bind(binder: OverloadBinders<T>): BoundOverloadBuilder<T>;
|
||||
}
|
||||
|
||||
interface FinishableOverloadBuilder<T extends OverloadDefinitions> {
|
||||
finish(): OverloadFunction<T>;
|
||||
}
|
||||
|
||||
interface BoundOverloadBuilder<T extends OverloadDefinitions> extends FinishableOverloadBuilder<T> {
|
||||
deprecate(deprecations: OverloadDeprecations<T>): FinishableOverloadBuilder<T>;
|
||||
}
|
||||
|
||||
declare function buildOverload(name: string): OverloadBuilder;
|
||||
|
||||
const enum SyntaxKind {
|
||||
ImportDeclaration,
|
||||
Modifier,
|
||||
ImportClause,
|
||||
AssertClause,
|
||||
Decorator
|
||||
}
|
||||
|
||||
interface Node {
|
||||
kind: SyntaxKind;
|
||||
}
|
||||
|
||||
interface Declaration extends Node { _declarationBrand: any }
|
||||
interface Statement extends Node { _statementBrand: any };
|
||||
interface Expression extends Node { _expressionBrand: any; }
|
||||
|
||||
interface ImportDeclaration extends Statement { kind: SyntaxKind.ImportDeclaration; }
|
||||
interface Modifier extends Node { kind: SyntaxKind.Modifier; }
|
||||
interface Decorator extends Node { kind: SyntaxKind.Decorator; }
|
||||
interface ImportClause extends Declaration { kind: SyntaxKind.ImportClause; }
|
||||
interface AssertClause extends Node { kind: SyntaxKind.AssertClause; }
|
||||
|
||||
declare function isExpression(node: Node): node is Expression;
|
||||
declare function isAssertClause(node: Node): node is AssertClause;
|
||||
declare function isImportClause(node: Node): node is ImportClause;
|
||||
declare function isModifier(node: Node): node is Modifier;
|
||||
declare function isDecorator(node: Node): node is Decorator;
|
||||
|
||||
declare const updateImportDeclaration: {
|
||||
(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
|
||||
(node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
|
||||
}
|
||||
|
||||
declare function every<T, U extends T>(array: readonly T[], callback: (element: T, index: number) => element is U): array is readonly U[];
|
||||
declare function every<T, U extends T>(array: readonly T[] | undefined, callback: (element: T, index: number) => element is U): array is readonly U[] | undefined;
|
||||
declare function every<T>(array: readonly T[] | undefined, callback: (element: T, index: number) => boolean): boolean;
|
||||
|
||||
declare function isArray(value: any): value is readonly unknown[];
|
||||
|
||||
declare const DISALLOW_DECORATORS: DeprecationOptions;
|
||||
|
||||
buildOverload("updateImportDeclaration")
|
||||
.overload({
|
||||
0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration {
|
||||
return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause);
|
||||
},
|
||||
|
||||
1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration {
|
||||
return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause);
|
||||
},
|
||||
})
|
||||
.bind({
|
||||
0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) =>
|
||||
(other === undefined) &&
|
||||
(modifiers === undefined || every(modifiers, isModifier)) &&
|
||||
(importClause === undefined || !isArray(importClause)) &&
|
||||
(moduleSpecifier === undefined || isExpression(moduleSpecifier)) &&
|
||||
(assertClause === undefined || isAssertClause(assertClause)),
|
||||
|
||||
1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) =>
|
||||
(decorators === undefined || every(decorators, isDecorator)) &&
|
||||
(modifiers === undefined || isArray(modifiers)) &&
|
||||
(importClause === undefined || isImportClause(importClause)) &&
|
||||
(moduleSpecifier !== undefined && isExpression(moduleSpecifier)) &&
|
||||
(assertClause === undefined || isAssertClause(assertClause)),
|
||||
})
|
||||
.deprecate({
|
||||
1: DISALLOW_DECORATORS
|
||||
})
|
||||
.finish();
|
||||
|
||||
|
||||
declare const modifiers: readonly Modifier[] | readonly Decorator[];
|
||||
|
||||
function foo() {
|
||||
every(modifiers, isModifier);
|
||||
every(modifiers, isDecorator);
|
||||
}
|
||||
|
||||
|
||||
//// [coAndContraVariantInferences3.js]
|
||||
"use strict";
|
||||
;
|
||||
buildOverload("updateImportDeclaration")
|
||||
.overload({
|
||||
0: function (node, modifiers, importClause, moduleSpecifier, assertClause) {
|
||||
return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause);
|
||||
},
|
||||
1: function (node, _decorators, modifiers, importClause, moduleSpecifier, assertClause) {
|
||||
return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause);
|
||||
},
|
||||
})
|
||||
.bind({
|
||||
0: function (_a) {
|
||||
var modifiers = _a[1], importClause = _a[2], moduleSpecifier = _a[3], assertClause = _a[4], other = _a[5];
|
||||
return (other === undefined) &&
|
||||
(modifiers === undefined || every(modifiers, isModifier)) &&
|
||||
(importClause === undefined || !isArray(importClause)) &&
|
||||
(moduleSpecifier === undefined || isExpression(moduleSpecifier)) &&
|
||||
(assertClause === undefined || isAssertClause(assertClause));
|
||||
},
|
||||
1: function (_a) {
|
||||
var decorators = _a[1], modifiers = _a[2], importClause = _a[3], moduleSpecifier = _a[4], assertClause = _a[5];
|
||||
return (decorators === undefined || every(decorators, isDecorator)) &&
|
||||
(modifiers === undefined || isArray(modifiers)) &&
|
||||
(importClause === undefined || isImportClause(importClause)) &&
|
||||
(moduleSpecifier !== undefined && isExpression(moduleSpecifier)) &&
|
||||
(assertClause === undefined || isAssertClause(assertClause));
|
||||
},
|
||||
})
|
||||
.deprecate({
|
||||
1: DISALLOW_DECORATORS
|
||||
})
|
||||
.finish();
|
||||
function foo() {
|
||||
every(modifiers, isModifier);
|
||||
every(modifiers, isDecorator);
|
||||
}
|
||||
@@ -0,0 +1,541 @@
|
||||
=== tests/cases/compiler/coAndContraVariantInferences3.ts ===
|
||||
interface DeprecationOptions {
|
||||
>DeprecationOptions : Symbol(DeprecationOptions, Decl(coAndContraVariantInferences3.ts, 0, 0))
|
||||
|
||||
message?: string;
|
||||
>message : Symbol(DeprecationOptions.message, Decl(coAndContraVariantInferences3.ts, 0, 30))
|
||||
|
||||
error?: boolean;
|
||||
>error : Symbol(DeprecationOptions.error, Decl(coAndContraVariantInferences3.ts, 1, 21))
|
||||
|
||||
name?: string;
|
||||
>name : Symbol(DeprecationOptions.name, Decl(coAndContraVariantInferences3.ts, 2, 20))
|
||||
}
|
||||
|
||||
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
||||
>UnionToIntersection : Symbol(UnionToIntersection, Decl(coAndContraVariantInferences3.ts, 4, 1))
|
||||
>U : Symbol(U, Decl(coAndContraVariantInferences3.ts, 6, 25))
|
||||
>U : Symbol(U, Decl(coAndContraVariantInferences3.ts, 6, 25))
|
||||
>k : Symbol(k, Decl(coAndContraVariantInferences3.ts, 6, 48))
|
||||
>U : Symbol(U, Decl(coAndContraVariantInferences3.ts, 6, 25))
|
||||
>k : Symbol(k, Decl(coAndContraVariantInferences3.ts, 6, 81))
|
||||
>I : Symbol(I, Decl(coAndContraVariantInferences3.ts, 6, 89))
|
||||
>I : Symbol(I, Decl(coAndContraVariantInferences3.ts, 6, 89))
|
||||
|
||||
type OverloadDefinitions = { readonly [P in number]: (...args: any[]) => any; };
|
||||
>OverloadDefinitions : Symbol(OverloadDefinitions, Decl(coAndContraVariantInferences3.ts, 6, 114))
|
||||
>P : Symbol(P, Decl(coAndContraVariantInferences3.ts, 8, 39))
|
||||
>args : Symbol(args, Decl(coAndContraVariantInferences3.ts, 8, 54))
|
||||
|
||||
type OverloadBinder<T extends OverloadDefinitions> = (args: OverloadParameters<T>) => OverloadKeys<T> | undefined;
|
||||
>OverloadBinder : Symbol(OverloadBinder, Decl(coAndContraVariantInferences3.ts, 8, 80))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 10, 20))
|
||||
>OverloadDefinitions : Symbol(OverloadDefinitions, Decl(coAndContraVariantInferences3.ts, 6, 114))
|
||||
>args : Symbol(args, Decl(coAndContraVariantInferences3.ts, 10, 54))
|
||||
>OverloadParameters : Symbol(OverloadParameters, Decl(coAndContraVariantInferences3.ts, 12, 76))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 10, 20))
|
||||
>OverloadKeys : Symbol(OverloadKeys, Decl(coAndContraVariantInferences3.ts, 10, 114))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 10, 20))
|
||||
|
||||
type OverloadKeys<T extends OverloadDefinitions> = Extract<keyof T, number>;
|
||||
>OverloadKeys : Symbol(OverloadKeys, Decl(coAndContraVariantInferences3.ts, 10, 114))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 12, 18))
|
||||
>OverloadDefinitions : Symbol(OverloadDefinitions, Decl(coAndContraVariantInferences3.ts, 6, 114))
|
||||
>Extract : Symbol(Extract, Decl(lib.es5.d.ts, --, --))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 12, 18))
|
||||
|
||||
type OverloadParameters<T extends OverloadDefinitions> = Parameters<{ [P in OverloadKeys<T>]: T[P]; }[OverloadKeys<T>]>;
|
||||
>OverloadParameters : Symbol(OverloadParameters, Decl(coAndContraVariantInferences3.ts, 12, 76))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 14, 24))
|
||||
>OverloadDefinitions : Symbol(OverloadDefinitions, Decl(coAndContraVariantInferences3.ts, 6, 114))
|
||||
>Parameters : Symbol(Parameters, Decl(lib.es5.d.ts, --, --))
|
||||
>P : Symbol(P, Decl(coAndContraVariantInferences3.ts, 14, 71))
|
||||
>OverloadKeys : Symbol(OverloadKeys, Decl(coAndContraVariantInferences3.ts, 10, 114))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 14, 24))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 14, 24))
|
||||
>P : Symbol(P, Decl(coAndContraVariantInferences3.ts, 14, 71))
|
||||
>OverloadKeys : Symbol(OverloadKeys, Decl(coAndContraVariantInferences3.ts, 10, 114))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 14, 24))
|
||||
|
||||
type OverloadFunction<T extends OverloadDefinitions> = UnionToIntersection<T[keyof T]>;
|
||||
>OverloadFunction : Symbol(OverloadFunction, Decl(coAndContraVariantInferences3.ts, 14, 120))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 16, 22))
|
||||
>OverloadDefinitions : Symbol(OverloadDefinitions, Decl(coAndContraVariantInferences3.ts, 6, 114))
|
||||
>UnionToIntersection : Symbol(UnionToIntersection, Decl(coAndContraVariantInferences3.ts, 4, 1))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 16, 22))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 16, 22))
|
||||
|
||||
type OverloadBinders<T extends OverloadDefinitions> = { [P in OverloadKeys<T>]: (args: OverloadParameters<T>) => boolean | undefined; };
|
||||
>OverloadBinders : Symbol(OverloadBinders, Decl(coAndContraVariantInferences3.ts, 16, 87))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 18, 21))
|
||||
>OverloadDefinitions : Symbol(OverloadDefinitions, Decl(coAndContraVariantInferences3.ts, 6, 114))
|
||||
>P : Symbol(P, Decl(coAndContraVariantInferences3.ts, 18, 57))
|
||||
>OverloadKeys : Symbol(OverloadKeys, Decl(coAndContraVariantInferences3.ts, 10, 114))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 18, 21))
|
||||
>args : Symbol(args, Decl(coAndContraVariantInferences3.ts, 18, 81))
|
||||
>OverloadParameters : Symbol(OverloadParameters, Decl(coAndContraVariantInferences3.ts, 12, 76))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 18, 21))
|
||||
|
||||
type OverloadDeprecations<T extends OverloadDefinitions> = { [P in OverloadKeys<T>]?: DeprecationOptions; };
|
||||
>OverloadDeprecations : Symbol(OverloadDeprecations, Decl(coAndContraVariantInferences3.ts, 18, 136))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 20, 26))
|
||||
>OverloadDefinitions : Symbol(OverloadDefinitions, Decl(coAndContraVariantInferences3.ts, 6, 114))
|
||||
>P : Symbol(P, Decl(coAndContraVariantInferences3.ts, 20, 62))
|
||||
>OverloadKeys : Symbol(OverloadKeys, Decl(coAndContraVariantInferences3.ts, 10, 114))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 20, 26))
|
||||
>DeprecationOptions : Symbol(DeprecationOptions, Decl(coAndContraVariantInferences3.ts, 0, 0))
|
||||
|
||||
declare function createOverload<T extends OverloadDefinitions>(name: string, overloads: T, binder: OverloadBinders<T>, deprecations?: OverloadDeprecations<T>): UnionToIntersection<T[keyof T]>;
|
||||
>createOverload : Symbol(createOverload, Decl(coAndContraVariantInferences3.ts, 20, 108))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 22, 32))
|
||||
>OverloadDefinitions : Symbol(OverloadDefinitions, Decl(coAndContraVariantInferences3.ts, 6, 114))
|
||||
>name : Symbol(name, Decl(coAndContraVariantInferences3.ts, 22, 63))
|
||||
>overloads : Symbol(overloads, Decl(coAndContraVariantInferences3.ts, 22, 76))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 22, 32))
|
||||
>binder : Symbol(binder, Decl(coAndContraVariantInferences3.ts, 22, 90))
|
||||
>OverloadBinders : Symbol(OverloadBinders, Decl(coAndContraVariantInferences3.ts, 16, 87))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 22, 32))
|
||||
>deprecations : Symbol(deprecations, Decl(coAndContraVariantInferences3.ts, 22, 118))
|
||||
>OverloadDeprecations : Symbol(OverloadDeprecations, Decl(coAndContraVariantInferences3.ts, 18, 136))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 22, 32))
|
||||
>UnionToIntersection : Symbol(UnionToIntersection, Decl(coAndContraVariantInferences3.ts, 4, 1))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 22, 32))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 22, 32))
|
||||
|
||||
declare function createBinder<T extends OverloadDefinitions>(overloads: T, binder: OverloadBinders<T>): OverloadBinder<T>;
|
||||
>createBinder : Symbol(createBinder, Decl(coAndContraVariantInferences3.ts, 22, 192))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 24, 30))
|
||||
>OverloadDefinitions : Symbol(OverloadDefinitions, Decl(coAndContraVariantInferences3.ts, 6, 114))
|
||||
>overloads : Symbol(overloads, Decl(coAndContraVariantInferences3.ts, 24, 61))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 24, 30))
|
||||
>binder : Symbol(binder, Decl(coAndContraVariantInferences3.ts, 24, 74))
|
||||
>OverloadBinders : Symbol(OverloadBinders, Decl(coAndContraVariantInferences3.ts, 16, 87))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 24, 30))
|
||||
>OverloadBinder : Symbol(OverloadBinder, Decl(coAndContraVariantInferences3.ts, 8, 80))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 24, 30))
|
||||
|
||||
interface OverloadBuilder {
|
||||
>OverloadBuilder : Symbol(OverloadBuilder, Decl(coAndContraVariantInferences3.ts, 24, 122))
|
||||
|
||||
overload<T extends OverloadDefinitions>(overloads: T): BindableOverloadBuilder<T>;
|
||||
>overload : Symbol(OverloadBuilder.overload, Decl(coAndContraVariantInferences3.ts, 26, 27))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 27, 13))
|
||||
>OverloadDefinitions : Symbol(OverloadDefinitions, Decl(coAndContraVariantInferences3.ts, 6, 114))
|
||||
>overloads : Symbol(overloads, Decl(coAndContraVariantInferences3.ts, 27, 44))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 27, 13))
|
||||
>BindableOverloadBuilder : Symbol(BindableOverloadBuilder, Decl(coAndContraVariantInferences3.ts, 28, 1))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 27, 13))
|
||||
}
|
||||
|
||||
interface BindableOverloadBuilder<T extends OverloadDefinitions> {
|
||||
>BindableOverloadBuilder : Symbol(BindableOverloadBuilder, Decl(coAndContraVariantInferences3.ts, 28, 1))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 30, 34))
|
||||
>OverloadDefinitions : Symbol(OverloadDefinitions, Decl(coAndContraVariantInferences3.ts, 6, 114))
|
||||
|
||||
bind(binder: OverloadBinders<T>): BoundOverloadBuilder<T>;
|
||||
>bind : Symbol(BindableOverloadBuilder.bind, Decl(coAndContraVariantInferences3.ts, 30, 66))
|
||||
>binder : Symbol(binder, Decl(coAndContraVariantInferences3.ts, 31, 9))
|
||||
>OverloadBinders : Symbol(OverloadBinders, Decl(coAndContraVariantInferences3.ts, 16, 87))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 30, 34))
|
||||
>BoundOverloadBuilder : Symbol(BoundOverloadBuilder, Decl(coAndContraVariantInferences3.ts, 36, 1))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 30, 34))
|
||||
}
|
||||
|
||||
interface FinishableOverloadBuilder<T extends OverloadDefinitions> {
|
||||
>FinishableOverloadBuilder : Symbol(FinishableOverloadBuilder, Decl(coAndContraVariantInferences3.ts, 32, 1))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 34, 36))
|
||||
>OverloadDefinitions : Symbol(OverloadDefinitions, Decl(coAndContraVariantInferences3.ts, 6, 114))
|
||||
|
||||
finish(): OverloadFunction<T>;
|
||||
>finish : Symbol(FinishableOverloadBuilder.finish, Decl(coAndContraVariantInferences3.ts, 34, 68))
|
||||
>OverloadFunction : Symbol(OverloadFunction, Decl(coAndContraVariantInferences3.ts, 14, 120))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 34, 36))
|
||||
}
|
||||
|
||||
interface BoundOverloadBuilder<T extends OverloadDefinitions> extends FinishableOverloadBuilder<T> {
|
||||
>BoundOverloadBuilder : Symbol(BoundOverloadBuilder, Decl(coAndContraVariantInferences3.ts, 36, 1))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 38, 31))
|
||||
>OverloadDefinitions : Symbol(OverloadDefinitions, Decl(coAndContraVariantInferences3.ts, 6, 114))
|
||||
>FinishableOverloadBuilder : Symbol(FinishableOverloadBuilder, Decl(coAndContraVariantInferences3.ts, 32, 1))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 38, 31))
|
||||
|
||||
deprecate(deprecations: OverloadDeprecations<T>): FinishableOverloadBuilder<T>;
|
||||
>deprecate : Symbol(BoundOverloadBuilder.deprecate, Decl(coAndContraVariantInferences3.ts, 38, 100))
|
||||
>deprecations : Symbol(deprecations, Decl(coAndContraVariantInferences3.ts, 39, 14))
|
||||
>OverloadDeprecations : Symbol(OverloadDeprecations, Decl(coAndContraVariantInferences3.ts, 18, 136))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 38, 31))
|
||||
>FinishableOverloadBuilder : Symbol(FinishableOverloadBuilder, Decl(coAndContraVariantInferences3.ts, 32, 1))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 38, 31))
|
||||
}
|
||||
|
||||
declare function buildOverload(name: string): OverloadBuilder;
|
||||
>buildOverload : Symbol(buildOverload, Decl(coAndContraVariantInferences3.ts, 40, 1))
|
||||
>name : Symbol(name, Decl(coAndContraVariantInferences3.ts, 42, 31))
|
||||
>OverloadBuilder : Symbol(OverloadBuilder, Decl(coAndContraVariantInferences3.ts, 24, 122))
|
||||
|
||||
const enum SyntaxKind {
|
||||
>SyntaxKind : Symbol(SyntaxKind, Decl(coAndContraVariantInferences3.ts, 42, 62))
|
||||
|
||||
ImportDeclaration,
|
||||
>ImportDeclaration : Symbol(SyntaxKind.ImportDeclaration, Decl(coAndContraVariantInferences3.ts, 44, 23))
|
||||
|
||||
Modifier,
|
||||
>Modifier : Symbol(SyntaxKind.Modifier, Decl(coAndContraVariantInferences3.ts, 45, 22))
|
||||
|
||||
ImportClause,
|
||||
>ImportClause : Symbol(SyntaxKind.ImportClause, Decl(coAndContraVariantInferences3.ts, 46, 13))
|
||||
|
||||
AssertClause,
|
||||
>AssertClause : Symbol(SyntaxKind.AssertClause, Decl(coAndContraVariantInferences3.ts, 47, 17))
|
||||
|
||||
Decorator
|
||||
>Decorator : Symbol(SyntaxKind.Decorator, Decl(coAndContraVariantInferences3.ts, 48, 17))
|
||||
}
|
||||
|
||||
interface Node {
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences3.ts, 50, 1))
|
||||
|
||||
kind: SyntaxKind;
|
||||
>kind : Symbol(Node.kind, Decl(coAndContraVariantInferences3.ts, 52, 16))
|
||||
>SyntaxKind : Symbol(SyntaxKind, Decl(coAndContraVariantInferences3.ts, 42, 62))
|
||||
}
|
||||
|
||||
interface Declaration extends Node { _declarationBrand: any }
|
||||
>Declaration : Symbol(Declaration, Decl(coAndContraVariantInferences3.ts, 54, 1))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences3.ts, 50, 1))
|
||||
>_declarationBrand : Symbol(Declaration._declarationBrand, Decl(coAndContraVariantInferences3.ts, 56, 36))
|
||||
|
||||
interface Statement extends Node { _statementBrand: any };
|
||||
>Statement : Symbol(Statement, Decl(coAndContraVariantInferences3.ts, 56, 61))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences3.ts, 50, 1))
|
||||
>_statementBrand : Symbol(Statement._statementBrand, Decl(coAndContraVariantInferences3.ts, 57, 34))
|
||||
|
||||
interface Expression extends Node { _expressionBrand: any; }
|
||||
>Expression : Symbol(Expression, Decl(coAndContraVariantInferences3.ts, 57, 58))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences3.ts, 50, 1))
|
||||
>_expressionBrand : Symbol(Expression._expressionBrand, Decl(coAndContraVariantInferences3.ts, 58, 35))
|
||||
|
||||
interface ImportDeclaration extends Statement { kind: SyntaxKind.ImportDeclaration; }
|
||||
>ImportDeclaration : Symbol(ImportDeclaration, Decl(coAndContraVariantInferences3.ts, 58, 60))
|
||||
>Statement : Symbol(Statement, Decl(coAndContraVariantInferences3.ts, 56, 61))
|
||||
>kind : Symbol(ImportDeclaration.kind, Decl(coAndContraVariantInferences3.ts, 60, 47))
|
||||
>SyntaxKind : Symbol(SyntaxKind, Decl(coAndContraVariantInferences3.ts, 42, 62))
|
||||
>ImportDeclaration : Symbol(SyntaxKind.ImportDeclaration, Decl(coAndContraVariantInferences3.ts, 44, 23))
|
||||
|
||||
interface Modifier extends Node { kind: SyntaxKind.Modifier; }
|
||||
>Modifier : Symbol(Modifier, Decl(coAndContraVariantInferences3.ts, 60, 85))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences3.ts, 50, 1))
|
||||
>kind : Symbol(Modifier.kind, Decl(coAndContraVariantInferences3.ts, 61, 33))
|
||||
>SyntaxKind : Symbol(SyntaxKind, Decl(coAndContraVariantInferences3.ts, 42, 62))
|
||||
>Modifier : Symbol(SyntaxKind.Modifier, Decl(coAndContraVariantInferences3.ts, 45, 22))
|
||||
|
||||
interface Decorator extends Node { kind: SyntaxKind.Decorator; }
|
||||
>Decorator : Symbol(Decorator, Decl(coAndContraVariantInferences3.ts, 61, 62))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences3.ts, 50, 1))
|
||||
>kind : Symbol(Decorator.kind, Decl(coAndContraVariantInferences3.ts, 62, 34))
|
||||
>SyntaxKind : Symbol(SyntaxKind, Decl(coAndContraVariantInferences3.ts, 42, 62))
|
||||
>Decorator : Symbol(SyntaxKind.Decorator, Decl(coAndContraVariantInferences3.ts, 48, 17))
|
||||
|
||||
interface ImportClause extends Declaration { kind: SyntaxKind.ImportClause; }
|
||||
>ImportClause : Symbol(ImportClause, Decl(coAndContraVariantInferences3.ts, 62, 64))
|
||||
>Declaration : Symbol(Declaration, Decl(coAndContraVariantInferences3.ts, 54, 1))
|
||||
>kind : Symbol(ImportClause.kind, Decl(coAndContraVariantInferences3.ts, 63, 44))
|
||||
>SyntaxKind : Symbol(SyntaxKind, Decl(coAndContraVariantInferences3.ts, 42, 62))
|
||||
>ImportClause : Symbol(SyntaxKind.ImportClause, Decl(coAndContraVariantInferences3.ts, 46, 13))
|
||||
|
||||
interface AssertClause extends Node { kind: SyntaxKind.AssertClause; }
|
||||
>AssertClause : Symbol(AssertClause, Decl(coAndContraVariantInferences3.ts, 63, 77))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences3.ts, 50, 1))
|
||||
>kind : Symbol(AssertClause.kind, Decl(coAndContraVariantInferences3.ts, 64, 37))
|
||||
>SyntaxKind : Symbol(SyntaxKind, Decl(coAndContraVariantInferences3.ts, 42, 62))
|
||||
>AssertClause : Symbol(SyntaxKind.AssertClause, Decl(coAndContraVariantInferences3.ts, 47, 17))
|
||||
|
||||
declare function isExpression(node: Node): node is Expression;
|
||||
>isExpression : Symbol(isExpression, Decl(coAndContraVariantInferences3.ts, 64, 70))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 66, 30))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences3.ts, 50, 1))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 66, 30))
|
||||
>Expression : Symbol(Expression, Decl(coAndContraVariantInferences3.ts, 57, 58))
|
||||
|
||||
declare function isAssertClause(node: Node): node is AssertClause;
|
||||
>isAssertClause : Symbol(isAssertClause, Decl(coAndContraVariantInferences3.ts, 66, 62))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 67, 32))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences3.ts, 50, 1))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 67, 32))
|
||||
>AssertClause : Symbol(AssertClause, Decl(coAndContraVariantInferences3.ts, 63, 77))
|
||||
|
||||
declare function isImportClause(node: Node): node is ImportClause;
|
||||
>isImportClause : Symbol(isImportClause, Decl(coAndContraVariantInferences3.ts, 67, 66))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 68, 32))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences3.ts, 50, 1))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 68, 32))
|
||||
>ImportClause : Symbol(ImportClause, Decl(coAndContraVariantInferences3.ts, 62, 64))
|
||||
|
||||
declare function isModifier(node: Node): node is Modifier;
|
||||
>isModifier : Symbol(isModifier, Decl(coAndContraVariantInferences3.ts, 68, 66))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 69, 28))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences3.ts, 50, 1))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 69, 28))
|
||||
>Modifier : Symbol(Modifier, Decl(coAndContraVariantInferences3.ts, 60, 85))
|
||||
|
||||
declare function isDecorator(node: Node): node is Decorator;
|
||||
>isDecorator : Symbol(isDecorator, Decl(coAndContraVariantInferences3.ts, 69, 58))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 70, 29))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences3.ts, 50, 1))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 70, 29))
|
||||
>Decorator : Symbol(Decorator, Decl(coAndContraVariantInferences3.ts, 61, 62))
|
||||
|
||||
declare const updateImportDeclaration: {
|
||||
>updateImportDeclaration : Symbol(updateImportDeclaration, Decl(coAndContraVariantInferences3.ts, 72, 13))
|
||||
|
||||
(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 73, 5))
|
||||
>ImportDeclaration : Symbol(ImportDeclaration, Decl(coAndContraVariantInferences3.ts, 58, 60))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 73, 29))
|
||||
>Modifier : Symbol(Modifier, Decl(coAndContraVariantInferences3.ts, 60, 85))
|
||||
>importClause : Symbol(importClause, Decl(coAndContraVariantInferences3.ts, 73, 73))
|
||||
>ImportClause : Symbol(ImportClause, Decl(coAndContraVariantInferences3.ts, 62, 64))
|
||||
>moduleSpecifier : Symbol(moduleSpecifier, Decl(coAndContraVariantInferences3.ts, 73, 113))
|
||||
>Expression : Symbol(Expression, Decl(coAndContraVariantInferences3.ts, 57, 58))
|
||||
>assertClause : Symbol(assertClause, Decl(coAndContraVariantInferences3.ts, 73, 142))
|
||||
>AssertClause : Symbol(AssertClause, Decl(coAndContraVariantInferences3.ts, 63, 77))
|
||||
>ImportDeclaration : Symbol(ImportDeclaration, Decl(coAndContraVariantInferences3.ts, 58, 60))
|
||||
|
||||
(node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 74, 5))
|
||||
>ImportDeclaration : Symbol(ImportDeclaration, Decl(coAndContraVariantInferences3.ts, 58, 60))
|
||||
>decorators : Symbol(decorators, Decl(coAndContraVariantInferences3.ts, 74, 29))
|
||||
>Decorator : Symbol(Decorator, Decl(coAndContraVariantInferences3.ts, 61, 62))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 74, 75))
|
||||
>Modifier : Symbol(Modifier, Decl(coAndContraVariantInferences3.ts, 60, 85))
|
||||
>importClause : Symbol(importClause, Decl(coAndContraVariantInferences3.ts, 74, 119))
|
||||
>ImportClause : Symbol(ImportClause, Decl(coAndContraVariantInferences3.ts, 62, 64))
|
||||
>moduleSpecifier : Symbol(moduleSpecifier, Decl(coAndContraVariantInferences3.ts, 74, 159))
|
||||
>Expression : Symbol(Expression, Decl(coAndContraVariantInferences3.ts, 57, 58))
|
||||
>assertClause : Symbol(assertClause, Decl(coAndContraVariantInferences3.ts, 74, 188))
|
||||
>AssertClause : Symbol(AssertClause, Decl(coAndContraVariantInferences3.ts, 63, 77))
|
||||
>ImportDeclaration : Symbol(ImportDeclaration, Decl(coAndContraVariantInferences3.ts, 58, 60))
|
||||
}
|
||||
|
||||
declare function every<T, U extends T>(array: readonly T[], callback: (element: T, index: number) => element is U): array is readonly U[];
|
||||
>every : Symbol(every, Decl(coAndContraVariantInferences3.ts, 75, 1), Decl(coAndContraVariantInferences3.ts, 77, 138), Decl(coAndContraVariantInferences3.ts, 78, 162))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 77, 23))
|
||||
>U : Symbol(U, Decl(coAndContraVariantInferences3.ts, 77, 25))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 77, 23))
|
||||
>array : Symbol(array, Decl(coAndContraVariantInferences3.ts, 77, 39))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 77, 23))
|
||||
>callback : Symbol(callback, Decl(coAndContraVariantInferences3.ts, 77, 59))
|
||||
>element : Symbol(element, Decl(coAndContraVariantInferences3.ts, 77, 71))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 77, 23))
|
||||
>index : Symbol(index, Decl(coAndContraVariantInferences3.ts, 77, 82))
|
||||
>element : Symbol(element, Decl(coAndContraVariantInferences3.ts, 77, 71))
|
||||
>U : Symbol(U, Decl(coAndContraVariantInferences3.ts, 77, 25))
|
||||
>array : Symbol(array, Decl(coAndContraVariantInferences3.ts, 77, 39))
|
||||
>U : Symbol(U, Decl(coAndContraVariantInferences3.ts, 77, 25))
|
||||
|
||||
declare function every<T, U extends T>(array: readonly T[] | undefined, callback: (element: T, index: number) => element is U): array is readonly U[] | undefined;
|
||||
>every : Symbol(every, Decl(coAndContraVariantInferences3.ts, 75, 1), Decl(coAndContraVariantInferences3.ts, 77, 138), Decl(coAndContraVariantInferences3.ts, 78, 162))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 78, 23))
|
||||
>U : Symbol(U, Decl(coAndContraVariantInferences3.ts, 78, 25))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 78, 23))
|
||||
>array : Symbol(array, Decl(coAndContraVariantInferences3.ts, 78, 39))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 78, 23))
|
||||
>callback : Symbol(callback, Decl(coAndContraVariantInferences3.ts, 78, 71))
|
||||
>element : Symbol(element, Decl(coAndContraVariantInferences3.ts, 78, 83))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 78, 23))
|
||||
>index : Symbol(index, Decl(coAndContraVariantInferences3.ts, 78, 94))
|
||||
>element : Symbol(element, Decl(coAndContraVariantInferences3.ts, 78, 83))
|
||||
>U : Symbol(U, Decl(coAndContraVariantInferences3.ts, 78, 25))
|
||||
>array : Symbol(array, Decl(coAndContraVariantInferences3.ts, 78, 39))
|
||||
>U : Symbol(U, Decl(coAndContraVariantInferences3.ts, 78, 25))
|
||||
|
||||
declare function every<T>(array: readonly T[] | undefined, callback: (element: T, index: number) => boolean): boolean;
|
||||
>every : Symbol(every, Decl(coAndContraVariantInferences3.ts, 75, 1), Decl(coAndContraVariantInferences3.ts, 77, 138), Decl(coAndContraVariantInferences3.ts, 78, 162))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 79, 23))
|
||||
>array : Symbol(array, Decl(coAndContraVariantInferences3.ts, 79, 26))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 79, 23))
|
||||
>callback : Symbol(callback, Decl(coAndContraVariantInferences3.ts, 79, 58))
|
||||
>element : Symbol(element, Decl(coAndContraVariantInferences3.ts, 79, 70))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences3.ts, 79, 23))
|
||||
>index : Symbol(index, Decl(coAndContraVariantInferences3.ts, 79, 81))
|
||||
|
||||
declare function isArray(value: any): value is readonly unknown[];
|
||||
>isArray : Symbol(isArray, Decl(coAndContraVariantInferences3.ts, 79, 118))
|
||||
>value : Symbol(value, Decl(coAndContraVariantInferences3.ts, 81, 25))
|
||||
>value : Symbol(value, Decl(coAndContraVariantInferences3.ts, 81, 25))
|
||||
|
||||
declare const DISALLOW_DECORATORS: DeprecationOptions;
|
||||
>DISALLOW_DECORATORS : Symbol(DISALLOW_DECORATORS, Decl(coAndContraVariantInferences3.ts, 83, 13))
|
||||
>DeprecationOptions : Symbol(DeprecationOptions, Decl(coAndContraVariantInferences3.ts, 0, 0))
|
||||
|
||||
buildOverload("updateImportDeclaration")
|
||||
>buildOverload("updateImportDeclaration") .overload({ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, }) .bind({ 0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) => (other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) && (importClause === undefined || !isArray(importClause)) && (moduleSpecifier === undefined || isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), 1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) && (importClause === undefined || isImportClause(importClause)) && (moduleSpecifier !== undefined && isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), }) .deprecate({ 1: DISALLOW_DECORATORS }) .finish : Symbol(FinishableOverloadBuilder.finish, Decl(coAndContraVariantInferences3.ts, 34, 68))
|
||||
>buildOverload("updateImportDeclaration") .overload({ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, }) .bind({ 0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) => (other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) && (importClause === undefined || !isArray(importClause)) && (moduleSpecifier === undefined || isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), 1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) && (importClause === undefined || isImportClause(importClause)) && (moduleSpecifier !== undefined && isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), }) .deprecate : Symbol(BoundOverloadBuilder.deprecate, Decl(coAndContraVariantInferences3.ts, 38, 100))
|
||||
>buildOverload("updateImportDeclaration") .overload({ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, }) .bind : Symbol(BindableOverloadBuilder.bind, Decl(coAndContraVariantInferences3.ts, 30, 66))
|
||||
>buildOverload("updateImportDeclaration") .overload : Symbol(OverloadBuilder.overload, Decl(coAndContraVariantInferences3.ts, 26, 27))
|
||||
>buildOverload : Symbol(buildOverload, Decl(coAndContraVariantInferences3.ts, 40, 1))
|
||||
|
||||
.overload({
|
||||
>overload : Symbol(OverloadBuilder.overload, Decl(coAndContraVariantInferences3.ts, 26, 27))
|
||||
|
||||
0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration {
|
||||
>0 : Symbol(0, Decl(coAndContraVariantInferences3.ts, 86, 15))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 87, 10))
|
||||
>ImportDeclaration : Symbol(ImportDeclaration, Decl(coAndContraVariantInferences3.ts, 58, 60))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 87, 34))
|
||||
>Modifier : Symbol(Modifier, Decl(coAndContraVariantInferences3.ts, 60, 85))
|
||||
>importClause : Symbol(importClause, Decl(coAndContraVariantInferences3.ts, 87, 78))
|
||||
>ImportClause : Symbol(ImportClause, Decl(coAndContraVariantInferences3.ts, 62, 64))
|
||||
>moduleSpecifier : Symbol(moduleSpecifier, Decl(coAndContraVariantInferences3.ts, 87, 118))
|
||||
>Expression : Symbol(Expression, Decl(coAndContraVariantInferences3.ts, 57, 58))
|
||||
>assertClause : Symbol(assertClause, Decl(coAndContraVariantInferences3.ts, 87, 147))
|
||||
>AssertClause : Symbol(AssertClause, Decl(coAndContraVariantInferences3.ts, 63, 77))
|
||||
>ImportDeclaration : Symbol(ImportDeclaration, Decl(coAndContraVariantInferences3.ts, 58, 60))
|
||||
|
||||
return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause);
|
||||
>updateImportDeclaration : Symbol(updateImportDeclaration, Decl(coAndContraVariantInferences3.ts, 72, 13))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 87, 10))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 87, 34))
|
||||
>importClause : Symbol(importClause, Decl(coAndContraVariantInferences3.ts, 87, 78))
|
||||
>moduleSpecifier : Symbol(moduleSpecifier, Decl(coAndContraVariantInferences3.ts, 87, 118))
|
||||
>assertClause : Symbol(assertClause, Decl(coAndContraVariantInferences3.ts, 87, 147))
|
||||
|
||||
},
|
||||
|
||||
1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration {
|
||||
>1 : Symbol(1, Decl(coAndContraVariantInferences3.ts, 89, 10))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 91, 10))
|
||||
>ImportDeclaration : Symbol(ImportDeclaration, Decl(coAndContraVariantInferences3.ts, 58, 60))
|
||||
>_decorators : Symbol(_decorators, Decl(coAndContraVariantInferences3.ts, 91, 34))
|
||||
>Decorator : Symbol(Decorator, Decl(coAndContraVariantInferences3.ts, 61, 62))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 91, 81))
|
||||
>Modifier : Symbol(Modifier, Decl(coAndContraVariantInferences3.ts, 60, 85))
|
||||
>importClause : Symbol(importClause, Decl(coAndContraVariantInferences3.ts, 91, 125))
|
||||
>ImportClause : Symbol(ImportClause, Decl(coAndContraVariantInferences3.ts, 62, 64))
|
||||
>moduleSpecifier : Symbol(moduleSpecifier, Decl(coAndContraVariantInferences3.ts, 91, 165))
|
||||
>Expression : Symbol(Expression, Decl(coAndContraVariantInferences3.ts, 57, 58))
|
||||
>assertClause : Symbol(assertClause, Decl(coAndContraVariantInferences3.ts, 91, 194))
|
||||
>AssertClause : Symbol(AssertClause, Decl(coAndContraVariantInferences3.ts, 63, 77))
|
||||
>ImportDeclaration : Symbol(ImportDeclaration, Decl(coAndContraVariantInferences3.ts, 58, 60))
|
||||
|
||||
return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause);
|
||||
>updateImportDeclaration : Symbol(updateImportDeclaration, Decl(coAndContraVariantInferences3.ts, 72, 13))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences3.ts, 91, 10))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 91, 81))
|
||||
>importClause : Symbol(importClause, Decl(coAndContraVariantInferences3.ts, 91, 125))
|
||||
>moduleSpecifier : Symbol(moduleSpecifier, Decl(coAndContraVariantInferences3.ts, 91, 165))
|
||||
>assertClause : Symbol(assertClause, Decl(coAndContraVariantInferences3.ts, 91, 194))
|
||||
|
||||
},
|
||||
})
|
||||
.bind({
|
||||
>bind : Symbol(BindableOverloadBuilder.bind, Decl(coAndContraVariantInferences3.ts, 30, 66))
|
||||
|
||||
0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) =>
|
||||
>0 : Symbol(0, Decl(coAndContraVariantInferences3.ts, 95, 11))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 96, 14))
|
||||
>importClause : Symbol(importClause, Decl(coAndContraVariantInferences3.ts, 96, 25))
|
||||
>moduleSpecifier : Symbol(moduleSpecifier, Decl(coAndContraVariantInferences3.ts, 96, 39))
|
||||
>assertClause : Symbol(assertClause, Decl(coAndContraVariantInferences3.ts, 96, 56))
|
||||
>other : Symbol(other, Decl(coAndContraVariantInferences3.ts, 96, 70))
|
||||
|
||||
(other === undefined) &&
|
||||
>other : Symbol(other, Decl(coAndContraVariantInferences3.ts, 96, 70))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
(modifiers === undefined || every(modifiers, isModifier)) &&
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 96, 14))
|
||||
>undefined : Symbol(undefined)
|
||||
>every : Symbol(every, Decl(coAndContraVariantInferences3.ts, 75, 1), Decl(coAndContraVariantInferences3.ts, 77, 138), Decl(coAndContraVariantInferences3.ts, 78, 162))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 96, 14))
|
||||
>isModifier : Symbol(isModifier, Decl(coAndContraVariantInferences3.ts, 68, 66))
|
||||
|
||||
(importClause === undefined || !isArray(importClause)) &&
|
||||
>importClause : Symbol(importClause, Decl(coAndContraVariantInferences3.ts, 96, 25))
|
||||
>undefined : Symbol(undefined)
|
||||
>isArray : Symbol(isArray, Decl(coAndContraVariantInferences3.ts, 79, 118))
|
||||
>importClause : Symbol(importClause, Decl(coAndContraVariantInferences3.ts, 96, 25))
|
||||
|
||||
(moduleSpecifier === undefined || isExpression(moduleSpecifier)) &&
|
||||
>moduleSpecifier : Symbol(moduleSpecifier, Decl(coAndContraVariantInferences3.ts, 96, 39))
|
||||
>undefined : Symbol(undefined)
|
||||
>isExpression : Symbol(isExpression, Decl(coAndContraVariantInferences3.ts, 64, 70))
|
||||
>moduleSpecifier : Symbol(moduleSpecifier, Decl(coAndContraVariantInferences3.ts, 96, 39))
|
||||
|
||||
(assertClause === undefined || isAssertClause(assertClause)),
|
||||
>assertClause : Symbol(assertClause, Decl(coAndContraVariantInferences3.ts, 96, 56))
|
||||
>undefined : Symbol(undefined)
|
||||
>isAssertClause : Symbol(isAssertClause, Decl(coAndContraVariantInferences3.ts, 66, 62))
|
||||
>assertClause : Symbol(assertClause, Decl(coAndContraVariantInferences3.ts, 96, 56))
|
||||
|
||||
1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) =>
|
||||
>1 : Symbol(1, Decl(coAndContraVariantInferences3.ts, 101, 73))
|
||||
>decorators : Symbol(decorators, Decl(coAndContraVariantInferences3.ts, 103, 14))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 103, 26))
|
||||
>importClause : Symbol(importClause, Decl(coAndContraVariantInferences3.ts, 103, 37))
|
||||
>moduleSpecifier : Symbol(moduleSpecifier, Decl(coAndContraVariantInferences3.ts, 103, 51))
|
||||
>assertClause : Symbol(assertClause, Decl(coAndContraVariantInferences3.ts, 103, 68))
|
||||
|
||||
(decorators === undefined || every(decorators, isDecorator)) &&
|
||||
>decorators : Symbol(decorators, Decl(coAndContraVariantInferences3.ts, 103, 14))
|
||||
>undefined : Symbol(undefined)
|
||||
>every : Symbol(every, Decl(coAndContraVariantInferences3.ts, 75, 1), Decl(coAndContraVariantInferences3.ts, 77, 138), Decl(coAndContraVariantInferences3.ts, 78, 162))
|
||||
>decorators : Symbol(decorators, Decl(coAndContraVariantInferences3.ts, 103, 14))
|
||||
>isDecorator : Symbol(isDecorator, Decl(coAndContraVariantInferences3.ts, 69, 58))
|
||||
|
||||
(modifiers === undefined || isArray(modifiers)) &&
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 103, 26))
|
||||
>undefined : Symbol(undefined)
|
||||
>isArray : Symbol(isArray, Decl(coAndContraVariantInferences3.ts, 79, 118))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 103, 26))
|
||||
|
||||
(importClause === undefined || isImportClause(importClause)) &&
|
||||
>importClause : Symbol(importClause, Decl(coAndContraVariantInferences3.ts, 103, 37))
|
||||
>undefined : Symbol(undefined)
|
||||
>isImportClause : Symbol(isImportClause, Decl(coAndContraVariantInferences3.ts, 67, 66))
|
||||
>importClause : Symbol(importClause, Decl(coAndContraVariantInferences3.ts, 103, 37))
|
||||
|
||||
(moduleSpecifier !== undefined && isExpression(moduleSpecifier)) &&
|
||||
>moduleSpecifier : Symbol(moduleSpecifier, Decl(coAndContraVariantInferences3.ts, 103, 51))
|
||||
>undefined : Symbol(undefined)
|
||||
>isExpression : Symbol(isExpression, Decl(coAndContraVariantInferences3.ts, 64, 70))
|
||||
>moduleSpecifier : Symbol(moduleSpecifier, Decl(coAndContraVariantInferences3.ts, 103, 51))
|
||||
|
||||
(assertClause === undefined || isAssertClause(assertClause)),
|
||||
>assertClause : Symbol(assertClause, Decl(coAndContraVariantInferences3.ts, 103, 68))
|
||||
>undefined : Symbol(undefined)
|
||||
>isAssertClause : Symbol(isAssertClause, Decl(coAndContraVariantInferences3.ts, 66, 62))
|
||||
>assertClause : Symbol(assertClause, Decl(coAndContraVariantInferences3.ts, 103, 68))
|
||||
|
||||
})
|
||||
.deprecate({
|
||||
>deprecate : Symbol(BoundOverloadBuilder.deprecate, Decl(coAndContraVariantInferences3.ts, 38, 100))
|
||||
|
||||
1: DISALLOW_DECORATORS
|
||||
>1 : Symbol(1, Decl(coAndContraVariantInferences3.ts, 110, 16))
|
||||
>DISALLOW_DECORATORS : Symbol(DISALLOW_DECORATORS, Decl(coAndContraVariantInferences3.ts, 83, 13))
|
||||
|
||||
})
|
||||
.finish();
|
||||
>finish : Symbol(FinishableOverloadBuilder.finish, Decl(coAndContraVariantInferences3.ts, 34, 68))
|
||||
|
||||
|
||||
declare const modifiers: readonly Modifier[] | readonly Decorator[];
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 116, 13))
|
||||
>Modifier : Symbol(Modifier, Decl(coAndContraVariantInferences3.ts, 60, 85))
|
||||
>Decorator : Symbol(Decorator, Decl(coAndContraVariantInferences3.ts, 61, 62))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(coAndContraVariantInferences3.ts, 116, 68))
|
||||
|
||||
every(modifiers, isModifier);
|
||||
>every : Symbol(every, Decl(coAndContraVariantInferences3.ts, 75, 1), Decl(coAndContraVariantInferences3.ts, 77, 138), Decl(coAndContraVariantInferences3.ts, 78, 162))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 116, 13))
|
||||
>isModifier : Symbol(isModifier, Decl(coAndContraVariantInferences3.ts, 68, 66))
|
||||
|
||||
every(modifiers, isDecorator);
|
||||
>every : Symbol(every, Decl(coAndContraVariantInferences3.ts, 75, 1), Decl(coAndContraVariantInferences3.ts, 77, 138), Decl(coAndContraVariantInferences3.ts, 78, 162))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences3.ts, 116, 13))
|
||||
>isDecorator : Symbol(isDecorator, Decl(coAndContraVariantInferences3.ts, 69, 58))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,420 @@
|
||||
=== tests/cases/compiler/coAndContraVariantInferences3.ts ===
|
||||
interface DeprecationOptions {
|
||||
message?: string;
|
||||
>message : string | undefined
|
||||
|
||||
error?: boolean;
|
||||
>error : boolean | undefined
|
||||
|
||||
name?: string;
|
||||
>name : string | undefined
|
||||
}
|
||||
|
||||
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
||||
>UnionToIntersection : UnionToIntersection<U>
|
||||
>k : U
|
||||
>k : I
|
||||
|
||||
type OverloadDefinitions = { readonly [P in number]: (...args: any[]) => any; };
|
||||
>OverloadDefinitions : { readonly [x: number]: (...args: any[]) => any; }
|
||||
>args : any[]
|
||||
|
||||
type OverloadBinder<T extends OverloadDefinitions> = (args: OverloadParameters<T>) => OverloadKeys<T> | undefined;
|
||||
>OverloadBinder : OverloadBinder<T>
|
||||
>args : Parameters<{ [P in Extract<keyof T, number>]: T[P]; }[Extract<keyof T, number>]>
|
||||
|
||||
type OverloadKeys<T extends OverloadDefinitions> = Extract<keyof T, number>;
|
||||
>OverloadKeys : OverloadKeys<T>
|
||||
|
||||
type OverloadParameters<T extends OverloadDefinitions> = Parameters<{ [P in OverloadKeys<T>]: T[P]; }[OverloadKeys<T>]>;
|
||||
>OverloadParameters : OverloadParameters<T>
|
||||
|
||||
type OverloadFunction<T extends OverloadDefinitions> = UnionToIntersection<T[keyof T]>;
|
||||
>OverloadFunction : OverloadFunction<T>
|
||||
|
||||
type OverloadBinders<T extends OverloadDefinitions> = { [P in OverloadKeys<T>]: (args: OverloadParameters<T>) => boolean | undefined; };
|
||||
>OverloadBinders : OverloadBinders<T>
|
||||
>args : Parameters<{ [P in Extract<keyof T, number>]: T[P]; }[Extract<keyof T, number>]>
|
||||
|
||||
type OverloadDeprecations<T extends OverloadDefinitions> = { [P in OverloadKeys<T>]?: DeprecationOptions; };
|
||||
>OverloadDeprecations : OverloadDeprecations<T>
|
||||
|
||||
declare function createOverload<T extends OverloadDefinitions>(name: string, overloads: T, binder: OverloadBinders<T>, deprecations?: OverloadDeprecations<T>): UnionToIntersection<T[keyof T]>;
|
||||
>createOverload : <T extends OverloadDefinitions>(name: string, overloads: T, binder: OverloadBinders<T>, deprecations?: OverloadDeprecations<T>) => UnionToIntersection<T[keyof T]>
|
||||
>name : string
|
||||
>overloads : T
|
||||
>binder : OverloadBinders<T>
|
||||
>deprecations : OverloadDeprecations<T> | undefined
|
||||
|
||||
declare function createBinder<T extends OverloadDefinitions>(overloads: T, binder: OverloadBinders<T>): OverloadBinder<T>;
|
||||
>createBinder : <T extends OverloadDefinitions>(overloads: T, binder: OverloadBinders<T>) => OverloadBinder<T>
|
||||
>overloads : T
|
||||
>binder : OverloadBinders<T>
|
||||
|
||||
interface OverloadBuilder {
|
||||
overload<T extends OverloadDefinitions>(overloads: T): BindableOverloadBuilder<T>;
|
||||
>overload : <T extends OverloadDefinitions>(overloads: T) => BindableOverloadBuilder<T>
|
||||
>overloads : T
|
||||
}
|
||||
|
||||
interface BindableOverloadBuilder<T extends OverloadDefinitions> {
|
||||
bind(binder: OverloadBinders<T>): BoundOverloadBuilder<T>;
|
||||
>bind : (binder: OverloadBinders<T>) => BoundOverloadBuilder<T>
|
||||
>binder : OverloadBinders<T>
|
||||
}
|
||||
|
||||
interface FinishableOverloadBuilder<T extends OverloadDefinitions> {
|
||||
finish(): OverloadFunction<T>;
|
||||
>finish : () => OverloadFunction<T>
|
||||
}
|
||||
|
||||
interface BoundOverloadBuilder<T extends OverloadDefinitions> extends FinishableOverloadBuilder<T> {
|
||||
deprecate(deprecations: OverloadDeprecations<T>): FinishableOverloadBuilder<T>;
|
||||
>deprecate : (deprecations: OverloadDeprecations<T>) => FinishableOverloadBuilder<T>
|
||||
>deprecations : OverloadDeprecations<T>
|
||||
}
|
||||
|
||||
declare function buildOverload(name: string): OverloadBuilder;
|
||||
>buildOverload : (name: string) => OverloadBuilder
|
||||
>name : string
|
||||
|
||||
const enum SyntaxKind {
|
||||
>SyntaxKind : SyntaxKind
|
||||
|
||||
ImportDeclaration,
|
||||
>ImportDeclaration : SyntaxKind.ImportDeclaration
|
||||
|
||||
Modifier,
|
||||
>Modifier : SyntaxKind.Modifier
|
||||
|
||||
ImportClause,
|
||||
>ImportClause : SyntaxKind.ImportClause
|
||||
|
||||
AssertClause,
|
||||
>AssertClause : SyntaxKind.AssertClause
|
||||
|
||||
Decorator
|
||||
>Decorator : SyntaxKind.Decorator
|
||||
}
|
||||
|
||||
interface Node {
|
||||
kind: SyntaxKind;
|
||||
>kind : SyntaxKind
|
||||
}
|
||||
|
||||
interface Declaration extends Node { _declarationBrand: any }
|
||||
>_declarationBrand : any
|
||||
|
||||
interface Statement extends Node { _statementBrand: any };
|
||||
>_statementBrand : any
|
||||
|
||||
interface Expression extends Node { _expressionBrand: any; }
|
||||
>_expressionBrand : any
|
||||
|
||||
interface ImportDeclaration extends Statement { kind: SyntaxKind.ImportDeclaration; }
|
||||
>kind : SyntaxKind.ImportDeclaration
|
||||
>SyntaxKind : any
|
||||
|
||||
interface Modifier extends Node { kind: SyntaxKind.Modifier; }
|
||||
>kind : SyntaxKind.Modifier
|
||||
>SyntaxKind : any
|
||||
|
||||
interface Decorator extends Node { kind: SyntaxKind.Decorator; }
|
||||
>kind : SyntaxKind.Decorator
|
||||
>SyntaxKind : any
|
||||
|
||||
interface ImportClause extends Declaration { kind: SyntaxKind.ImportClause; }
|
||||
>kind : SyntaxKind.ImportClause
|
||||
>SyntaxKind : any
|
||||
|
||||
interface AssertClause extends Node { kind: SyntaxKind.AssertClause; }
|
||||
>kind : SyntaxKind.AssertClause
|
||||
>SyntaxKind : any
|
||||
|
||||
declare function isExpression(node: Node): node is Expression;
|
||||
>isExpression : (node: Node) => node is Expression
|
||||
>node : Node
|
||||
|
||||
declare function isAssertClause(node: Node): node is AssertClause;
|
||||
>isAssertClause : (node: Node) => node is AssertClause
|
||||
>node : Node
|
||||
|
||||
declare function isImportClause(node: Node): node is ImportClause;
|
||||
>isImportClause : (node: Node) => node is ImportClause
|
||||
>node : Node
|
||||
|
||||
declare function isModifier(node: Node): node is Modifier;
|
||||
>isModifier : (node: Node) => node is Modifier
|
||||
>node : Node
|
||||
|
||||
declare function isDecorator(node: Node): node is Decorator;
|
||||
>isDecorator : (node: Node) => node is Decorator
|
||||
>node : Node
|
||||
|
||||
declare const updateImportDeclaration: {
|
||||
>updateImportDeclaration : { (node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; (node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }
|
||||
|
||||
(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
|
||||
>node : ImportDeclaration
|
||||
>modifiers : readonly Modifier[] | undefined
|
||||
>importClause : ImportClause | undefined
|
||||
>moduleSpecifier : Expression
|
||||
>assertClause : AssertClause | undefined
|
||||
|
||||
(node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
|
||||
>node : ImportDeclaration
|
||||
>decorators : readonly Decorator[] | undefined
|
||||
>modifiers : readonly Modifier[] | undefined
|
||||
>importClause : ImportClause | undefined
|
||||
>moduleSpecifier : Expression
|
||||
>assertClause : AssertClause | undefined
|
||||
}
|
||||
|
||||
declare function every<T, U extends T>(array: readonly T[], callback: (element: T, index: number) => element is U): array is readonly U[];
|
||||
>every : { <T, U extends T>(array: readonly T[], callback: (element: T, index: number) => element is U): array is readonly U[]; <T, U extends T>(array: readonly T[] | undefined, callback: (element: T, index: number) => element is U): array is readonly U[] | undefined; <T>(array: readonly T[] | undefined, callback: (element: T, index: number) => boolean): boolean; }
|
||||
>array : readonly T[]
|
||||
>callback : (element: T, index: number) => element is U
|
||||
>element : T
|
||||
>index : number
|
||||
|
||||
declare function every<T, U extends T>(array: readonly T[] | undefined, callback: (element: T, index: number) => element is U): array is readonly U[] | undefined;
|
||||
>every : { <T, U extends T>(array: readonly T[], callback: (element: T, index: number) => element is U): array is readonly U[]; <T, U extends T>(array: readonly T[] | undefined, callback: (element: T, index: number) => element is U): array is readonly U[] | undefined; <T>(array: readonly T[] | undefined, callback: (element: T, index: number) => boolean): boolean; }
|
||||
>array : readonly T[] | undefined
|
||||
>callback : (element: T, index: number) => element is U
|
||||
>element : T
|
||||
>index : number
|
||||
|
||||
declare function every<T>(array: readonly T[] | undefined, callback: (element: T, index: number) => boolean): boolean;
|
||||
>every : { <T, U extends T>(array: readonly T[], callback: (element: T, index: number) => element is U): array is readonly U[]; <T, U extends T>(array: readonly T[] | undefined, callback: (element: T, index: number) => element is U): array is readonly U[] | undefined; <T>(array: readonly T[] | undefined, callback: (element: T, index: number) => boolean): boolean; }
|
||||
>array : readonly T[] | undefined
|
||||
>callback : (element: T, index: number) => boolean
|
||||
>element : T
|
||||
>index : number
|
||||
|
||||
declare function isArray(value: any): value is readonly unknown[];
|
||||
>isArray : (value: any) => value is readonly unknown[]
|
||||
>value : any
|
||||
|
||||
declare const DISALLOW_DECORATORS: DeprecationOptions;
|
||||
>DISALLOW_DECORATORS : DeprecationOptions
|
||||
|
||||
buildOverload("updateImportDeclaration")
|
||||
>buildOverload("updateImportDeclaration") .overload({ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, }) .bind({ 0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) => (other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) && (importClause === undefined || !isArray(importClause)) && (moduleSpecifier === undefined || isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), 1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) && (importClause === undefined || isImportClause(importClause)) && (moduleSpecifier !== undefined && isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), }) .deprecate({ 1: DISALLOW_DECORATORS }) .finish() : ((node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined) => ImportDeclaration) & ((node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined) => ImportDeclaration)
|
||||
>buildOverload("updateImportDeclaration") .overload({ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, }) .bind({ 0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) => (other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) && (importClause === undefined || !isArray(importClause)) && (moduleSpecifier === undefined || isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), 1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) && (importClause === undefined || isImportClause(importClause)) && (moduleSpecifier !== undefined && isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), }) .deprecate({ 1: DISALLOW_DECORATORS }) .finish : () => ((node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined) => ImportDeclaration) & ((node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined) => ImportDeclaration)
|
||||
>buildOverload("updateImportDeclaration") .overload({ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, }) .bind({ 0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) => (other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) && (importClause === undefined || !isArray(importClause)) && (moduleSpecifier === undefined || isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), 1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) && (importClause === undefined || isImportClause(importClause)) && (moduleSpecifier !== undefined && isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), }) .deprecate({ 1: DISALLOW_DECORATORS }) : FinishableOverloadBuilder<{ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }>
|
||||
>buildOverload("updateImportDeclaration") .overload({ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, }) .bind({ 0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) => (other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) && (importClause === undefined || !isArray(importClause)) && (moduleSpecifier === undefined || isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), 1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) && (importClause === undefined || isImportClause(importClause)) && (moduleSpecifier !== undefined && isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), }) .deprecate : (deprecations: OverloadDeprecations<{ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }>) => FinishableOverloadBuilder<{ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }>
|
||||
>buildOverload("updateImportDeclaration") .overload({ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, }) .bind({ 0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) => (other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) && (importClause === undefined || !isArray(importClause)) && (moduleSpecifier === undefined || isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), 1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) && (importClause === undefined || isImportClause(importClause)) && (moduleSpecifier !== undefined && isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), }) : BoundOverloadBuilder<{ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }>
|
||||
>buildOverload("updateImportDeclaration") .overload({ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, }) .bind : (binder: OverloadBinders<{ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }>) => BoundOverloadBuilder<{ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }>
|
||||
>buildOverload("updateImportDeclaration") .overload({ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, }) : BindableOverloadBuilder<{ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }>
|
||||
>buildOverload("updateImportDeclaration") .overload : <T extends OverloadDefinitions>(overloads: T) => BindableOverloadBuilder<T>
|
||||
>buildOverload("updateImportDeclaration") : OverloadBuilder
|
||||
>buildOverload : (name: string) => OverloadBuilder
|
||||
>"updateImportDeclaration" : "updateImportDeclaration"
|
||||
|
||||
.overload({
|
||||
>overload : <T extends OverloadDefinitions>(overloads: T) => BindableOverloadBuilder<T>
|
||||
>{ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration { return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause); }, } : { 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }
|
||||
|
||||
0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration {
|
||||
>0 : (node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined) => ImportDeclaration
|
||||
>node : ImportDeclaration
|
||||
>modifiers : readonly Modifier[] | undefined
|
||||
>importClause : ImportClause | undefined
|
||||
>moduleSpecifier : Expression
|
||||
>assertClause : AssertClause | undefined
|
||||
|
||||
return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause);
|
||||
>updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) : ImportDeclaration
|
||||
>updateImportDeclaration : { (node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; (node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }
|
||||
>node : ImportDeclaration
|
||||
>modifiers : readonly Modifier[] | undefined
|
||||
>importClause : ImportClause | undefined
|
||||
>moduleSpecifier : Expression
|
||||
>assertClause : AssertClause | undefined
|
||||
|
||||
},
|
||||
|
||||
1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration {
|
||||
>1 : (node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined) => ImportDeclaration
|
||||
>node : ImportDeclaration
|
||||
>_decorators : readonly Decorator[] | undefined
|
||||
>modifiers : readonly Modifier[] | undefined
|
||||
>importClause : ImportClause | undefined
|
||||
>moduleSpecifier : Expression
|
||||
>assertClause : AssertClause | undefined
|
||||
|
||||
return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause);
|
||||
>updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) : ImportDeclaration
|
||||
>updateImportDeclaration : { (node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; (node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }
|
||||
>node : ImportDeclaration
|
||||
>modifiers : readonly Modifier[] | undefined
|
||||
>importClause : ImportClause | undefined
|
||||
>moduleSpecifier : Expression
|
||||
>assertClause : AssertClause | undefined
|
||||
|
||||
},
|
||||
})
|
||||
.bind({
|
||||
>bind : (binder: OverloadBinders<{ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }>) => BoundOverloadBuilder<{ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }>
|
||||
>{ 0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) => (other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) && (importClause === undefined || !isArray(importClause)) && (moduleSpecifier === undefined || isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), 1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) && (importClause === undefined || isImportClause(importClause)) && (moduleSpecifier !== undefined && isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)), } : { 0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]: [node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined] | [node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined]) => boolean; 1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]: [node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined] | [node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined]) => boolean; }
|
||||
|
||||
0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) =>
|
||||
>0 : ([, modifiers, importClause, moduleSpecifier, assertClause, other]: [node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined] | [node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined]) => boolean
|
||||
>([, modifiers, importClause, moduleSpecifier, assertClause, other]) => (other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) && (importClause === undefined || !isArray(importClause)) && (moduleSpecifier === undefined || isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)) : ([, modifiers, importClause, moduleSpecifier, assertClause, other]: [node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined] | [node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined]) => boolean
|
||||
> : undefined
|
||||
>modifiers : readonly Modifier[] | readonly Decorator[] | undefined
|
||||
>importClause : ImportClause | readonly Modifier[] | undefined
|
||||
>moduleSpecifier : Expression | ImportClause | undefined
|
||||
>assertClause : Expression | AssertClause | undefined
|
||||
>other : AssertClause | undefined
|
||||
|
||||
(other === undefined) &&
|
||||
>(other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) && (importClause === undefined || !isArray(importClause)) && (moduleSpecifier === undefined || isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)) : boolean
|
||||
>(other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) && (importClause === undefined || !isArray(importClause)) && (moduleSpecifier === undefined || isExpression(moduleSpecifier)) : boolean
|
||||
>(other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) && (importClause === undefined || !isArray(importClause)) : boolean
|
||||
>(other === undefined) && (modifiers === undefined || every(modifiers, isModifier)) : boolean
|
||||
>(other === undefined) : boolean
|
||||
>other === undefined : boolean
|
||||
>other : AssertClause | undefined
|
||||
>undefined : undefined
|
||||
|
||||
(modifiers === undefined || every(modifiers, isModifier)) &&
|
||||
>(modifiers === undefined || every(modifiers, isModifier)) : boolean
|
||||
>modifiers === undefined || every(modifiers, isModifier) : boolean
|
||||
>modifiers === undefined : boolean
|
||||
>modifiers : readonly Modifier[] | readonly Decorator[] | undefined
|
||||
>undefined : undefined
|
||||
>every(modifiers, isModifier) : boolean
|
||||
>every : { <T, U extends T>(array: readonly T[], callback: (element: T, index: number) => element is U): array is readonly U[]; <T, U extends T>(array: readonly T[] | undefined, callback: (element: T, index: number) => element is U): array is readonly U[] | undefined; <T>(array: readonly T[] | undefined, callback: (element: T, index: number) => boolean): boolean; }
|
||||
>modifiers : readonly Modifier[] | readonly Decorator[]
|
||||
>isModifier : (node: Node) => node is Modifier
|
||||
|
||||
(importClause === undefined || !isArray(importClause)) &&
|
||||
>(importClause === undefined || !isArray(importClause)) : boolean
|
||||
>importClause === undefined || !isArray(importClause) : boolean
|
||||
>importClause === undefined : boolean
|
||||
>importClause : ImportClause | readonly Modifier[] | undefined
|
||||
>undefined : undefined
|
||||
>!isArray(importClause) : boolean
|
||||
>isArray(importClause) : boolean
|
||||
>isArray : (value: any) => value is readonly unknown[]
|
||||
>importClause : ImportClause | readonly Modifier[]
|
||||
|
||||
(moduleSpecifier === undefined || isExpression(moduleSpecifier)) &&
|
||||
>(moduleSpecifier === undefined || isExpression(moduleSpecifier)) : boolean
|
||||
>moduleSpecifier === undefined || isExpression(moduleSpecifier) : boolean
|
||||
>moduleSpecifier === undefined : boolean
|
||||
>moduleSpecifier : Expression | ImportClause | undefined
|
||||
>undefined : undefined
|
||||
>isExpression(moduleSpecifier) : boolean
|
||||
>isExpression : (node: Node) => node is Expression
|
||||
>moduleSpecifier : Expression | ImportClause
|
||||
|
||||
(assertClause === undefined || isAssertClause(assertClause)),
|
||||
>(assertClause === undefined || isAssertClause(assertClause)) : boolean
|
||||
>assertClause === undefined || isAssertClause(assertClause) : boolean
|
||||
>assertClause === undefined : boolean
|
||||
>assertClause : Expression | AssertClause | undefined
|
||||
>undefined : undefined
|
||||
>isAssertClause(assertClause) : boolean
|
||||
>isAssertClause : (node: Node) => node is AssertClause
|
||||
>assertClause : Expression | AssertClause
|
||||
|
||||
1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) =>
|
||||
>1 : ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]: [node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined] | [node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined]) => boolean
|
||||
>([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) => (decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) && (importClause === undefined || isImportClause(importClause)) && (moduleSpecifier !== undefined && isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)) : ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]: [node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined] | [node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined]) => boolean
|
||||
> : undefined
|
||||
>decorators : readonly Modifier[] | readonly Decorator[] | undefined
|
||||
>modifiers : ImportClause | readonly Modifier[] | undefined
|
||||
>importClause : Expression | ImportClause | undefined
|
||||
>moduleSpecifier : Expression | AssertClause | undefined
|
||||
>assertClause : AssertClause | undefined
|
||||
|
||||
(decorators === undefined || every(decorators, isDecorator)) &&
|
||||
>(decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) && (importClause === undefined || isImportClause(importClause)) && (moduleSpecifier !== undefined && isExpression(moduleSpecifier)) && (assertClause === undefined || isAssertClause(assertClause)) : boolean
|
||||
>(decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) && (importClause === undefined || isImportClause(importClause)) && (moduleSpecifier !== undefined && isExpression(moduleSpecifier)) : boolean
|
||||
>(decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) && (importClause === undefined || isImportClause(importClause)) : boolean
|
||||
>(decorators === undefined || every(decorators, isDecorator)) && (modifiers === undefined || isArray(modifiers)) : boolean
|
||||
>(decorators === undefined || every(decorators, isDecorator)) : boolean
|
||||
>decorators === undefined || every(decorators, isDecorator) : boolean
|
||||
>decorators === undefined : boolean
|
||||
>decorators : readonly Modifier[] | readonly Decorator[] | undefined
|
||||
>undefined : undefined
|
||||
>every(decorators, isDecorator) : boolean
|
||||
>every : { <T, U extends T>(array: readonly T[], callback: (element: T, index: number) => element is U): array is readonly U[]; <T, U extends T>(array: readonly T[] | undefined, callback: (element: T, index: number) => element is U): array is readonly U[] | undefined; <T>(array: readonly T[] | undefined, callback: (element: T, index: number) => boolean): boolean; }
|
||||
>decorators : readonly Modifier[] | readonly Decorator[]
|
||||
>isDecorator : (node: Node) => node is Decorator
|
||||
|
||||
(modifiers === undefined || isArray(modifiers)) &&
|
||||
>(modifiers === undefined || isArray(modifiers)) : boolean
|
||||
>modifiers === undefined || isArray(modifiers) : boolean
|
||||
>modifiers === undefined : boolean
|
||||
>modifiers : ImportClause | readonly Modifier[] | undefined
|
||||
>undefined : undefined
|
||||
>isArray(modifiers) : boolean
|
||||
>isArray : (value: any) => value is readonly unknown[]
|
||||
>modifiers : ImportClause | readonly Modifier[]
|
||||
|
||||
(importClause === undefined || isImportClause(importClause)) &&
|
||||
>(importClause === undefined || isImportClause(importClause)) : boolean
|
||||
>importClause === undefined || isImportClause(importClause) : boolean
|
||||
>importClause === undefined : boolean
|
||||
>importClause : Expression | ImportClause | undefined
|
||||
>undefined : undefined
|
||||
>isImportClause(importClause) : boolean
|
||||
>isImportClause : (node: Node) => node is ImportClause
|
||||
>importClause : Expression | ImportClause
|
||||
|
||||
(moduleSpecifier !== undefined && isExpression(moduleSpecifier)) &&
|
||||
>(moduleSpecifier !== undefined && isExpression(moduleSpecifier)) : boolean
|
||||
>moduleSpecifier !== undefined && isExpression(moduleSpecifier) : boolean
|
||||
>moduleSpecifier !== undefined : boolean
|
||||
>moduleSpecifier : Expression | AssertClause | undefined
|
||||
>undefined : undefined
|
||||
>isExpression(moduleSpecifier) : boolean
|
||||
>isExpression : (node: Node) => node is Expression
|
||||
>moduleSpecifier : Expression | AssertClause
|
||||
|
||||
(assertClause === undefined || isAssertClause(assertClause)),
|
||||
>(assertClause === undefined || isAssertClause(assertClause)) : boolean
|
||||
>assertClause === undefined || isAssertClause(assertClause) : boolean
|
||||
>assertClause === undefined : boolean
|
||||
>assertClause : AssertClause | undefined
|
||||
>undefined : undefined
|
||||
>isAssertClause(assertClause) : boolean
|
||||
>isAssertClause : (node: Node) => node is AssertClause
|
||||
>assertClause : AssertClause
|
||||
|
||||
})
|
||||
.deprecate({
|
||||
>deprecate : (deprecations: OverloadDeprecations<{ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }>) => FinishableOverloadBuilder<{ 0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; 1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; }>
|
||||
>{ 1: DISALLOW_DECORATORS } : { 1: DeprecationOptions; }
|
||||
|
||||
1: DISALLOW_DECORATORS
|
||||
>1 : DeprecationOptions
|
||||
>DISALLOW_DECORATORS : DeprecationOptions
|
||||
|
||||
})
|
||||
.finish();
|
||||
>finish : () => ((node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined) => ImportDeclaration) & ((node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined) => ImportDeclaration)
|
||||
|
||||
|
||||
declare const modifiers: readonly Modifier[] | readonly Decorator[];
|
||||
>modifiers : readonly Modifier[] | readonly Decorator[]
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
every(modifiers, isModifier);
|
||||
>every(modifiers, isModifier) : boolean
|
||||
>every : { <T, U extends T>(array: readonly T[], callback: (element: T, index: number) => element is U): array is readonly U[]; <T, U extends T>(array: readonly T[] | undefined, callback: (element: T, index: number) => element is U): array is readonly U[] | undefined; <T>(array: readonly T[] | undefined, callback: (element: T, index: number) => boolean): boolean; }
|
||||
>modifiers : readonly Modifier[] | readonly Decorator[]
|
||||
>isModifier : (node: Node) => node is Modifier
|
||||
|
||||
every(modifiers, isDecorator);
|
||||
>every(modifiers, isDecorator) : boolean
|
||||
>every : { <T, U extends T>(array: readonly T[], callback: (element: T, index: number) => element is U): array is readonly U[]; <T, U extends T>(array: readonly T[] | undefined, callback: (element: T, index: number) => element is U): array is readonly U[] | undefined; <T>(array: readonly T[] | undefined, callback: (element: T, index: number) => boolean): boolean; }
|
||||
>modifiers : readonly Modifier[] | readonly Decorator[]
|
||||
>isDecorator : (node: Node) => node is Decorator
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
//// [coAndContraVariantInferences4.ts]
|
||||
const enum SyntaxKind {
|
||||
Modifier,
|
||||
Decorator,
|
||||
}
|
||||
|
||||
interface Node {
|
||||
kind: SyntaxKind;
|
||||
}
|
||||
|
||||
interface Modifier extends Node { kind: SyntaxKind.Modifier; }
|
||||
interface Decorator extends Node { kind: SyntaxKind.Decorator; }
|
||||
|
||||
declare function isModifier(node: Node): node is Modifier;
|
||||
declare function isDecorator(node: Node): node is Decorator;
|
||||
|
||||
declare function every<T, U extends T>(array: readonly T[], callback: (element: T) => element is U): array is readonly U[];
|
||||
|
||||
declare const modifiers: readonly Decorator[] | readonly Modifier[];
|
||||
|
||||
function foo() {
|
||||
every(modifiers, isModifier);
|
||||
every(modifiers, isDecorator);
|
||||
}
|
||||
|
||||
|
||||
//// [coAndContraVariantInferences4.js]
|
||||
"use strict";
|
||||
function foo() {
|
||||
every(modifiers, isModifier);
|
||||
every(modifiers, isDecorator);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
=== tests/cases/compiler/coAndContraVariantInferences4.ts ===
|
||||
const enum SyntaxKind {
|
||||
>SyntaxKind : Symbol(SyntaxKind, Decl(coAndContraVariantInferences4.ts, 0, 0))
|
||||
|
||||
Modifier,
|
||||
>Modifier : Symbol(SyntaxKind.Modifier, Decl(coAndContraVariantInferences4.ts, 0, 23))
|
||||
|
||||
Decorator,
|
||||
>Decorator : Symbol(SyntaxKind.Decorator, Decl(coAndContraVariantInferences4.ts, 1, 13))
|
||||
}
|
||||
|
||||
interface Node {
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences4.ts, 3, 1))
|
||||
|
||||
kind: SyntaxKind;
|
||||
>kind : Symbol(Node.kind, Decl(coAndContraVariantInferences4.ts, 5, 16))
|
||||
>SyntaxKind : Symbol(SyntaxKind, Decl(coAndContraVariantInferences4.ts, 0, 0))
|
||||
}
|
||||
|
||||
interface Modifier extends Node { kind: SyntaxKind.Modifier; }
|
||||
>Modifier : Symbol(Modifier, Decl(coAndContraVariantInferences4.ts, 7, 1))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences4.ts, 3, 1))
|
||||
>kind : Symbol(Modifier.kind, Decl(coAndContraVariantInferences4.ts, 9, 33))
|
||||
>SyntaxKind : Symbol(SyntaxKind, Decl(coAndContraVariantInferences4.ts, 0, 0))
|
||||
>Modifier : Symbol(SyntaxKind.Modifier, Decl(coAndContraVariantInferences4.ts, 0, 23))
|
||||
|
||||
interface Decorator extends Node { kind: SyntaxKind.Decorator; }
|
||||
>Decorator : Symbol(Decorator, Decl(coAndContraVariantInferences4.ts, 9, 62))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences4.ts, 3, 1))
|
||||
>kind : Symbol(Decorator.kind, Decl(coAndContraVariantInferences4.ts, 10, 34))
|
||||
>SyntaxKind : Symbol(SyntaxKind, Decl(coAndContraVariantInferences4.ts, 0, 0))
|
||||
>Decorator : Symbol(SyntaxKind.Decorator, Decl(coAndContraVariantInferences4.ts, 1, 13))
|
||||
|
||||
declare function isModifier(node: Node): node is Modifier;
|
||||
>isModifier : Symbol(isModifier, Decl(coAndContraVariantInferences4.ts, 10, 64))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences4.ts, 12, 28))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences4.ts, 3, 1))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences4.ts, 12, 28))
|
||||
>Modifier : Symbol(Modifier, Decl(coAndContraVariantInferences4.ts, 7, 1))
|
||||
|
||||
declare function isDecorator(node: Node): node is Decorator;
|
||||
>isDecorator : Symbol(isDecorator, Decl(coAndContraVariantInferences4.ts, 12, 58))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences4.ts, 13, 29))
|
||||
>Node : Symbol(Node, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(coAndContraVariantInferences4.ts, 3, 1))
|
||||
>node : Symbol(node, Decl(coAndContraVariantInferences4.ts, 13, 29))
|
||||
>Decorator : Symbol(Decorator, Decl(coAndContraVariantInferences4.ts, 9, 62))
|
||||
|
||||
declare function every<T, U extends T>(array: readonly T[], callback: (element: T) => element is U): array is readonly U[];
|
||||
>every : Symbol(every, Decl(coAndContraVariantInferences4.ts, 13, 60))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences4.ts, 15, 23))
|
||||
>U : Symbol(U, Decl(coAndContraVariantInferences4.ts, 15, 25))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences4.ts, 15, 23))
|
||||
>array : Symbol(array, Decl(coAndContraVariantInferences4.ts, 15, 39))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences4.ts, 15, 23))
|
||||
>callback : Symbol(callback, Decl(coAndContraVariantInferences4.ts, 15, 59))
|
||||
>element : Symbol(element, Decl(coAndContraVariantInferences4.ts, 15, 71))
|
||||
>T : Symbol(T, Decl(coAndContraVariantInferences4.ts, 15, 23))
|
||||
>element : Symbol(element, Decl(coAndContraVariantInferences4.ts, 15, 71))
|
||||
>U : Symbol(U, Decl(coAndContraVariantInferences4.ts, 15, 25))
|
||||
>array : Symbol(array, Decl(coAndContraVariantInferences4.ts, 15, 39))
|
||||
>U : Symbol(U, Decl(coAndContraVariantInferences4.ts, 15, 25))
|
||||
|
||||
declare const modifiers: readonly Decorator[] | readonly Modifier[];
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences4.ts, 17, 13))
|
||||
>Decorator : Symbol(Decorator, Decl(coAndContraVariantInferences4.ts, 9, 62))
|
||||
>Modifier : Symbol(Modifier, Decl(coAndContraVariantInferences4.ts, 7, 1))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(coAndContraVariantInferences4.ts, 17, 68))
|
||||
|
||||
every(modifiers, isModifier);
|
||||
>every : Symbol(every, Decl(coAndContraVariantInferences4.ts, 13, 60))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences4.ts, 17, 13))
|
||||
>isModifier : Symbol(isModifier, Decl(coAndContraVariantInferences4.ts, 10, 64))
|
||||
|
||||
every(modifiers, isDecorator);
|
||||
>every : Symbol(every, Decl(coAndContraVariantInferences4.ts, 13, 60))
|
||||
>modifiers : Symbol(modifiers, Decl(coAndContraVariantInferences4.ts, 17, 13))
|
||||
>isDecorator : Symbol(isDecorator, Decl(coAndContraVariantInferences4.ts, 12, 58))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
=== tests/cases/compiler/coAndContraVariantInferences4.ts ===
|
||||
const enum SyntaxKind {
|
||||
>SyntaxKind : SyntaxKind
|
||||
|
||||
Modifier,
|
||||
>Modifier : SyntaxKind.Modifier
|
||||
|
||||
Decorator,
|
||||
>Decorator : SyntaxKind.Decorator
|
||||
}
|
||||
|
||||
interface Node {
|
||||
kind: SyntaxKind;
|
||||
>kind : SyntaxKind
|
||||
}
|
||||
|
||||
interface Modifier extends Node { kind: SyntaxKind.Modifier; }
|
||||
>kind : SyntaxKind.Modifier
|
||||
>SyntaxKind : any
|
||||
|
||||
interface Decorator extends Node { kind: SyntaxKind.Decorator; }
|
||||
>kind : SyntaxKind.Decorator
|
||||
>SyntaxKind : any
|
||||
|
||||
declare function isModifier(node: Node): node is Modifier;
|
||||
>isModifier : (node: Node) => node is Modifier
|
||||
>node : Node
|
||||
|
||||
declare function isDecorator(node: Node): node is Decorator;
|
||||
>isDecorator : (node: Node) => node is Decorator
|
||||
>node : Node
|
||||
|
||||
declare function every<T, U extends T>(array: readonly T[], callback: (element: T) => element is U): array is readonly U[];
|
||||
>every : <T, U extends T>(array: readonly T[], callback: (element: T) => element is U) => array is readonly U[]
|
||||
>array : readonly T[]
|
||||
>callback : (element: T) => element is U
|
||||
>element : T
|
||||
|
||||
declare const modifiers: readonly Decorator[] | readonly Modifier[];
|
||||
>modifiers : readonly Decorator[] | readonly Modifier[]
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
every(modifiers, isModifier);
|
||||
>every(modifiers, isModifier) : boolean
|
||||
>every : <T, U extends T>(array: readonly T[], callback: (element: T) => element is U) => array is readonly U[]
|
||||
>modifiers : readonly Decorator[] | readonly Modifier[]
|
||||
>isModifier : (node: Node) => node is Modifier
|
||||
|
||||
every(modifiers, isDecorator);
|
||||
>every(modifiers, isDecorator) : boolean
|
||||
>every : <T, U extends T>(array: readonly T[], callback: (element: T) => element is U) => array is readonly U[]
|
||||
>modifiers : readonly Decorator[] | readonly Modifier[]
|
||||
>isDecorator : (node: Node) => node is Decorator
|
||||
}
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
// @strict: true
|
||||
|
||||
interface DeprecationOptions {
|
||||
message?: string;
|
||||
error?: boolean;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
||||
|
||||
type OverloadDefinitions = { readonly [P in number]: (...args: any[]) => any; };
|
||||
|
||||
type OverloadBinder<T extends OverloadDefinitions> = (args: OverloadParameters<T>) => OverloadKeys<T> | undefined;
|
||||
|
||||
type OverloadKeys<T extends OverloadDefinitions> = Extract<keyof T, number>;
|
||||
|
||||
type OverloadParameters<T extends OverloadDefinitions> = Parameters<{ [P in OverloadKeys<T>]: T[P]; }[OverloadKeys<T>]>;
|
||||
|
||||
type OverloadFunction<T extends OverloadDefinitions> = UnionToIntersection<T[keyof T]>;
|
||||
|
||||
type OverloadBinders<T extends OverloadDefinitions> = { [P in OverloadKeys<T>]: (args: OverloadParameters<T>) => boolean | undefined; };
|
||||
|
||||
type OverloadDeprecations<T extends OverloadDefinitions> = { [P in OverloadKeys<T>]?: DeprecationOptions; };
|
||||
|
||||
declare function createOverload<T extends OverloadDefinitions>(name: string, overloads: T, binder: OverloadBinders<T>, deprecations?: OverloadDeprecations<T>): UnionToIntersection<T[keyof T]>;
|
||||
|
||||
declare function createBinder<T extends OverloadDefinitions>(overloads: T, binder: OverloadBinders<T>): OverloadBinder<T>;
|
||||
|
||||
interface OverloadBuilder {
|
||||
overload<T extends OverloadDefinitions>(overloads: T): BindableOverloadBuilder<T>;
|
||||
}
|
||||
|
||||
interface BindableOverloadBuilder<T extends OverloadDefinitions> {
|
||||
bind(binder: OverloadBinders<T>): BoundOverloadBuilder<T>;
|
||||
}
|
||||
|
||||
interface FinishableOverloadBuilder<T extends OverloadDefinitions> {
|
||||
finish(): OverloadFunction<T>;
|
||||
}
|
||||
|
||||
interface BoundOverloadBuilder<T extends OverloadDefinitions> extends FinishableOverloadBuilder<T> {
|
||||
deprecate(deprecations: OverloadDeprecations<T>): FinishableOverloadBuilder<T>;
|
||||
}
|
||||
|
||||
declare function buildOverload(name: string): OverloadBuilder;
|
||||
|
||||
const enum SyntaxKind {
|
||||
ImportDeclaration,
|
||||
Modifier,
|
||||
ImportClause,
|
||||
AssertClause,
|
||||
Decorator
|
||||
}
|
||||
|
||||
interface Node {
|
||||
kind: SyntaxKind;
|
||||
}
|
||||
|
||||
interface Declaration extends Node { _declarationBrand: any }
|
||||
interface Statement extends Node { _statementBrand: any };
|
||||
interface Expression extends Node { _expressionBrand: any; }
|
||||
|
||||
interface ImportDeclaration extends Statement { kind: SyntaxKind.ImportDeclaration; }
|
||||
interface Modifier extends Node { kind: SyntaxKind.Modifier; }
|
||||
interface Decorator extends Node { kind: SyntaxKind.Decorator; }
|
||||
interface ImportClause extends Declaration { kind: SyntaxKind.ImportClause; }
|
||||
interface AssertClause extends Node { kind: SyntaxKind.AssertClause; }
|
||||
|
||||
declare function isExpression(node: Node): node is Expression;
|
||||
declare function isAssertClause(node: Node): node is AssertClause;
|
||||
declare function isImportClause(node: Node): node is ImportClause;
|
||||
declare function isModifier(node: Node): node is Modifier;
|
||||
declare function isDecorator(node: Node): node is Decorator;
|
||||
|
||||
declare const updateImportDeclaration: {
|
||||
(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
|
||||
(node: ImportDeclaration, decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration;
|
||||
}
|
||||
|
||||
declare function every<T, U extends T>(array: readonly T[], callback: (element: T, index: number) => element is U): array is readonly U[];
|
||||
declare function every<T, U extends T>(array: readonly T[] | undefined, callback: (element: T, index: number) => element is U): array is readonly U[] | undefined;
|
||||
declare function every<T>(array: readonly T[] | undefined, callback: (element: T, index: number) => boolean): boolean;
|
||||
|
||||
declare function isArray(value: any): value is readonly unknown[];
|
||||
|
||||
declare const DISALLOW_DECORATORS: DeprecationOptions;
|
||||
|
||||
buildOverload("updateImportDeclaration")
|
||||
.overload({
|
||||
0(node: ImportDeclaration, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration {
|
||||
return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause);
|
||||
},
|
||||
|
||||
1(node: ImportDeclaration, _decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration {
|
||||
return updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause);
|
||||
},
|
||||
})
|
||||
.bind({
|
||||
0: ([, modifiers, importClause, moduleSpecifier, assertClause, other]) =>
|
||||
(other === undefined) &&
|
||||
(modifiers === undefined || every(modifiers, isModifier)) &&
|
||||
(importClause === undefined || !isArray(importClause)) &&
|
||||
(moduleSpecifier === undefined || isExpression(moduleSpecifier)) &&
|
||||
(assertClause === undefined || isAssertClause(assertClause)),
|
||||
|
||||
1: ([, decorators, modifiers, importClause, moduleSpecifier, assertClause]) =>
|
||||
(decorators === undefined || every(decorators, isDecorator)) &&
|
||||
(modifiers === undefined || isArray(modifiers)) &&
|
||||
(importClause === undefined || isImportClause(importClause)) &&
|
||||
(moduleSpecifier !== undefined && isExpression(moduleSpecifier)) &&
|
||||
(assertClause === undefined || isAssertClause(assertClause)),
|
||||
})
|
||||
.deprecate({
|
||||
1: DISALLOW_DECORATORS
|
||||
})
|
||||
.finish();
|
||||
|
||||
|
||||
declare const modifiers: readonly Modifier[] | readonly Decorator[];
|
||||
|
||||
function foo() {
|
||||
every(modifiers, isModifier);
|
||||
every(modifiers, isDecorator);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// @strict: true
|
||||
|
||||
const enum SyntaxKind {
|
||||
Modifier,
|
||||
Decorator,
|
||||
}
|
||||
|
||||
interface Node {
|
||||
kind: SyntaxKind;
|
||||
}
|
||||
|
||||
interface Modifier extends Node { kind: SyntaxKind.Modifier; }
|
||||
interface Decorator extends Node { kind: SyntaxKind.Decorator; }
|
||||
|
||||
declare function isModifier(node: Node): node is Modifier;
|
||||
declare function isDecorator(node: Node): node is Decorator;
|
||||
|
||||
declare function every<T, U extends T>(array: readonly T[], callback: (element: T) => element is U): array is readonly U[];
|
||||
|
||||
declare const modifiers: readonly Decorator[] | readonly Modifier[];
|
||||
|
||||
function foo() {
|
||||
every(modifiers, isModifier);
|
||||
every(modifiers, isDecorator);
|
||||
}
|
||||
Reference in New Issue
Block a user