From 4bc4360a17ac2b56138014932412114698933c70 Mon Sep 17 00:00:00 2001 From: cannorin Date: Mon, 29 Aug 2022 17:11:23 +0900 Subject: [PATCH] Upgrade typescript to 4.8 --- lib/Bindings/TypeScript.fs | 104 ++++++++++++++++++------------------- yarn.lock | 6 +-- 2 files changed, 53 insertions(+), 57 deletions(-) diff --git a/lib/Bindings/TypeScript.fs b/lib/Bindings/TypeScript.fs index 93db86c3..b8de843b 100644 --- a/lib/Bindings/TypeScript.fs +++ b/lib/Bindings/TypeScript.fs @@ -442,6 +442,7 @@ module Ts = abstract isImportEqualsDeclaration: node: Node -> bool abstract isImportDeclaration: node: Node -> bool abstract isImportClause: node: Node -> bool + abstract isImportTypeAssertionContainer: node: Node -> bool abstract isAssertClause: node: Node -> bool abstract isAssertEntry: node: Node -> bool abstract isNamespaceImport: node: Node -> bool @@ -657,6 +658,27 @@ module Ts = abstract formatDiagnostic: diagnostic: Diagnostic * host: FormatDiagnosticsHost -> string abstract formatDiagnosticsWithColorAndContext: diagnostics: Diagnostic[] * host: FormatDiagnosticsHost -> string abstract flattenDiagnosticMessageText: diag: U2 option * newLine: string * ?indent: float -> string + /// Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly + /// provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file. + abstract getModeForFileReference: ref: U2 * containingFileMode: obj -> ModuleKind option + /// + /// Calculates the final resolution mode for an import at some index within a file's imports list. This is generally the explicitly + /// defined mode of the import if provided, or, if not, the mode of the containing file (with some exceptions: import=require is always commonjs, dynamic import is always esm). + /// If you have an actual import node, prefer using getModeForUsageLocation on the reference string node. + /// + /// File to fetch the resolution mode within + /// Index into the file's complete resolution list to get the resolution of - this is a concatenation of the file's imports and module augmentations + abstract getModeForResolutionAtIndex: file: SourceFile * index: float -> ModuleKind option + /// + /// Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if + /// one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm). + /// Notably, this function always returns undefined if the containing file has an undefined impliedNodeFormat - this field is only set when + /// moduleResolution is node16+. + /// + /// The file the import or import-like reference is contained within + /// The module reference string + /// The final resolution mode of the import + abstract getModeForUsageLocation: file: {| impliedNodeFormat: obj option |} * usage: StringLiteralLike -> ModuleKind option abstract getConfigFileParsingDiagnostics: configFileParseResult: ParsedCommandLine -> Diagnostic[] /// /// A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the @@ -2178,37 +2200,37 @@ module Ts = inherit Token<'TKind> type DotToken = - inherit PunctuationToken + PunctuationToken type DotDotDotToken = - inherit PunctuationToken + PunctuationToken type QuestionToken = - inherit PunctuationToken + PunctuationToken type ExclamationToken = - inherit PunctuationToken + PunctuationToken type ColonToken = - inherit PunctuationToken + PunctuationToken type EqualsToken = - inherit PunctuationToken + PunctuationToken type AsteriskToken = - inherit PunctuationToken + PunctuationToken type EqualsGreaterThanToken = - inherit PunctuationToken + PunctuationToken type PlusToken = - inherit PunctuationToken + PunctuationToken type MinusToken = - inherit PunctuationToken + PunctuationToken type QuestionDotToken = - inherit PunctuationToken + PunctuationToken type [] KeywordToken<'TKind> = inherit Token<'TKind> @@ -2234,46 +2256,46 @@ module Ts = inherit KeywordToken<'TKind> type AbstractKeyword = - inherit ModifierToken + ModifierToken type AsyncKeyword = - inherit ModifierToken + ModifierToken type ConstKeyword = - inherit ModifierToken + ModifierToken type DeclareKeyword = - inherit ModifierToken + ModifierToken type DefaultKeyword = - inherit ModifierToken + ModifierToken type ExportKeyword = - inherit ModifierToken + ModifierToken type InKeyword = - inherit ModifierToken + ModifierToken type PrivateKeyword = - inherit ModifierToken + ModifierToken type ProtectedKeyword = - inherit ModifierToken + ModifierToken type PublicKeyword = - inherit ModifierToken + ModifierToken type ReadonlyKeyword = - inherit ModifierToken + ModifierToken type OutKeyword = - inherit ModifierToken + ModifierToken type OverrideKeyword = - inherit ModifierToken + ModifierToken type StaticKeyword = - inherit ModifierToken + ModifierToken [] type ReadonlyToken = @@ -2296,38 +2318,17 @@ module Ts = | [] StaticKeyword of StaticKeyword [] member _.kind : SyntaxKind = jsNative - static member inline op_ErasedCast(x: AbstractKeyword) = AbstractKeyword x - static member inline op_ErasedCast(x: AsyncKeyword) = AsyncKeyword x - static member inline op_ErasedCast(x: ConstKeyword) = ConstKeyword x - static member inline op_ErasedCast(x: DeclareKeyword) = DeclareKeyword x - static member inline op_ErasedCast(x: DefaultKeyword) = DefaultKeyword x - static member inline op_ErasedCast(x: ExportKeyword) = ExportKeyword x - static member inline op_ErasedCast(x: InKeyword) = InKeyword x - static member inline op_ErasedCast(x: OutKeyword) = OutKeyword x - static member inline op_ErasedCast(x: OverrideKeyword) = OverrideKeyword x - static member inline op_ErasedCast(x: PrivateKeyword) = PrivateKeyword x - static member inline op_ErasedCast(x: ProtectedKeyword) = ProtectedKeyword x - static member inline op_ErasedCast(x: PublicKeyword) = PublicKeyword x - static member inline op_ErasedCast(x: ReadonlyKeyword) = ReadonlyKeyword x - static member inline op_ErasedCast(x: StaticKeyword) = StaticKeyword x type [] [] AccessibilityModifier = | [] PrivateKeyword of PrivateKeyword | [] ProtectedKeyword of ProtectedKeyword | [] PublicKeyword of PublicKeyword - static member inline op_ErasedCast(x: PrivateKeyword) = PrivateKeyword x - static member inline op_ErasedCast(x: ProtectedKeyword) = ProtectedKeyword x - static member inline op_ErasedCast(x: PublicKeyword) = PublicKeyword x type [] [] ParameterPropertyModifier = | [] PrivateKeyword of PrivateKeyword | [] ProtectedKeyword of ProtectedKeyword | [] PublicKeyword of PublicKeyword | [] ReadonlyKeyword of ReadonlyKeyword - static member inline op_ErasedCast(x: PrivateKeyword) = PrivateKeyword x - static member inline op_ErasedCast(x: ProtectedKeyword) = ProtectedKeyword x - static member inline op_ErasedCast(x: PublicKeyword) = PublicKeyword x - static member inline op_ErasedCast(x: ReadonlyKeyword) = ReadonlyKeyword x type [] [] ClassMemberModifier = | [] PrivateKeyword of PrivateKeyword @@ -2335,11 +2336,6 @@ module Ts = | [] PublicKeyword of PublicKeyword | [] ReadonlyKeyword of ReadonlyKeyword | [] StaticKeyword of StaticKeyword - static member inline op_ErasedCast(x: PrivateKeyword) = PrivateKeyword x - static member inline op_ErasedCast(x: ProtectedKeyword) = ProtectedKeyword x - static member inline op_ErasedCast(x: PublicKeyword) = PublicKeyword x - static member inline op_ErasedCast(x: ReadonlyKeyword) = ReadonlyKeyword x - static member inline op_ErasedCast(x: StaticKeyword) = StaticKeyword x type ModifiersArray = Modifier[] @@ -6720,7 +6716,7 @@ Use typeAcquisition.enable instead.")>] [] abstract Invoke: nodes: 'T[] * visitor: Visitor option * ?test: (Node -> bool) * ?start: float * ?count: float -> 'T[] [] abstract Invoke: nodes: 'T[] option * visitor: Visitor option * ?test: (Node -> bool) * ?start: float * ?count: float -> 'T[] option - type VisitResult<'T> = + type VisitResult<'T when 'T :> Node> = U2<'T, 'T[]> option type [] Printer = @@ -7751,8 +7747,8 @@ Use typeAcquisition.enable instead.")>] abstract skipDestructiveCodeActions: bool option with get, set type [] [] CompletionsTriggerCharacter = - | [] Dot - | [] DoubleQuote + | [] Period + | [] Backslash | [] SingleQuote | [] BackQuote | [] Slash diff --git a/yarn.lock b/yarn.lock index 906eefab..21fd8aeb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2352,9 +2352,9 @@ type-is@~1.6.18: mime-types "~2.1.24" typescript@4.7: - version "4.7.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.2.tgz#1f9aa2ceb9af87cca227813b4310fff0b51593c4" - integrity sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A== + version "4.7.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" + integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0"