Skip to content

Commit 4bc4360

Browse files
committed
Upgrade typescript to 4.8
1 parent b7a7ef3 commit 4bc4360

File tree

2 files changed

+53
-57
lines changed

2 files changed

+53
-57
lines changed

lib/Bindings/TypeScript.fs

Lines changed: 50 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ module Ts =
442442
abstract isImportEqualsDeclaration: node: Node -> bool
443443
abstract isImportDeclaration: node: Node -> bool
444444
abstract isImportClause: node: Node -> bool
445+
abstract isImportTypeAssertionContainer: node: Node -> bool
445446
abstract isAssertClause: node: Node -> bool
446447
abstract isAssertEntry: node: Node -> bool
447448
abstract isNamespaceImport: node: Node -> bool
@@ -657,6 +658,27 @@ module Ts =
657658
abstract formatDiagnostic: diagnostic: Diagnostic * host: FormatDiagnosticsHost -> string
658659
abstract formatDiagnosticsWithColorAndContext: diagnostics: Diagnostic[] * host: FormatDiagnosticsHost -> string
659660
abstract flattenDiagnosticMessageText: diag: U2<string, DiagnosticMessageChain> option * newLine: string * ?indent: float -> string
661+
/// Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly
662+
/// provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file.
663+
abstract getModeForFileReference: ref: U2<FileReference, string> * containingFileMode: obj -> ModuleKind option
664+
/// <summary>
665+
/// Calculates the final resolution mode for an import at some index within a file's imports list. This is generally the explicitly
666+
/// 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).
667+
/// If you have an actual import node, prefer using getModeForUsageLocation on the reference string node.
668+
/// </summary>
669+
/// <param name="file">File to fetch the resolution mode within</param>
670+
/// <param name="index">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</param>
671+
abstract getModeForResolutionAtIndex: file: SourceFile * index: float -> ModuleKind option
672+
/// <summary>
673+
/// Calculates the final resolution mode for a given module reference node. This is generally the explicitly provided resolution mode, if
674+
/// one exists, or the mode of the containing source file. (Excepting import=require, which is always commonjs, and dynamic import, which is always esm).
675+
/// Notably, this function always returns <c>undefined</c> if the containing file has an <c>undefined</c> <c>impliedNodeFormat</c> - this field is only set when
676+
/// <c>moduleResolution</c> is <c>node16</c>+.
677+
/// </summary>
678+
/// <param name="file">The file the import or import-like reference is contained within</param>
679+
/// <param name="usage">The module reference string</param>
680+
/// <returns>The final resolution mode of the import</returns>
681+
abstract getModeForUsageLocation: file: {| impliedNodeFormat: obj option |} * usage: StringLiteralLike -> ModuleKind option
660682
abstract getConfigFileParsingDiagnostics: configFileParseResult: ParsedCommandLine -> Diagnostic[]
661683
/// <summary>
662684
/// 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 =
21782200
inherit Token<'TKind>
21792201

21802202
type DotToken =
2181-
inherit PunctuationToken<SyntaxKind>
2203+
PunctuationToken<SyntaxKind>
21822204

21832205
type DotDotDotToken =
2184-
inherit PunctuationToken<SyntaxKind>
2206+
PunctuationToken<SyntaxKind>
21852207

21862208
type QuestionToken =
2187-
inherit PunctuationToken<SyntaxKind>
2209+
PunctuationToken<SyntaxKind>
21882210

21892211
type ExclamationToken =
2190-
inherit PunctuationToken<SyntaxKind>
2212+
PunctuationToken<SyntaxKind>
21912213

21922214
type ColonToken =
2193-
inherit PunctuationToken<SyntaxKind>
2215+
PunctuationToken<SyntaxKind>
21942216

21952217
type EqualsToken =
2196-
inherit PunctuationToken<SyntaxKind>
2218+
PunctuationToken<SyntaxKind>
21972219

21982220
type AsteriskToken =
2199-
inherit PunctuationToken<SyntaxKind>
2221+
PunctuationToken<SyntaxKind>
22002222

22012223
type EqualsGreaterThanToken =
2202-
inherit PunctuationToken<SyntaxKind>
2224+
PunctuationToken<SyntaxKind>
22032225

22042226
type PlusToken =
2205-
inherit PunctuationToken<SyntaxKind>
2227+
PunctuationToken<SyntaxKind>
22062228

22072229
type MinusToken =
2208-
inherit PunctuationToken<SyntaxKind>
2230+
PunctuationToken<SyntaxKind>
22092231

22102232
type QuestionDotToken =
2211-
inherit PunctuationToken<SyntaxKind>
2233+
PunctuationToken<SyntaxKind>
22122234

22132235
type [<AllowNullLiteral>] KeywordToken<'TKind> =
22142236
inherit Token<'TKind>
@@ -2234,46 +2256,46 @@ module Ts =
22342256
inherit KeywordToken<'TKind>
22352257

22362258
type AbstractKeyword =
2237-
inherit ModifierToken<SyntaxKind>
2259+
ModifierToken<SyntaxKind>
22382260

22392261
type AsyncKeyword =
2240-
inherit ModifierToken<SyntaxKind>
2262+
ModifierToken<SyntaxKind>
22412263

22422264
type ConstKeyword =
2243-
inherit ModifierToken<SyntaxKind>
2265+
ModifierToken<SyntaxKind>
22442266

22452267
type DeclareKeyword =
2246-
inherit ModifierToken<SyntaxKind>
2268+
ModifierToken<SyntaxKind>
22472269

22482270
type DefaultKeyword =
2249-
inherit ModifierToken<SyntaxKind>
2271+
ModifierToken<SyntaxKind>
22502272

22512273
type ExportKeyword =
2252-
inherit ModifierToken<SyntaxKind>
2274+
ModifierToken<SyntaxKind>
22532275

22542276
type InKeyword =
2255-
inherit ModifierToken<SyntaxKind>
2277+
ModifierToken<SyntaxKind>
22562278

22572279
type PrivateKeyword =
2258-
inherit ModifierToken<SyntaxKind>
2280+
ModifierToken<SyntaxKind>
22592281

22602282
type ProtectedKeyword =
2261-
inherit ModifierToken<SyntaxKind>
2283+
ModifierToken<SyntaxKind>
22622284

22632285
type PublicKeyword =
2264-
inherit ModifierToken<SyntaxKind>
2286+
ModifierToken<SyntaxKind>
22652287

22662288
type ReadonlyKeyword =
2267-
inherit ModifierToken<SyntaxKind>
2289+
ModifierToken<SyntaxKind>
22682290

22692291
type OutKeyword =
2270-
inherit ModifierToken<SyntaxKind>
2292+
ModifierToken<SyntaxKind>
22712293

22722294
type OverrideKeyword =
2273-
inherit ModifierToken<SyntaxKind>
2295+
ModifierToken<SyntaxKind>
22742296

22752297
type StaticKeyword =
2276-
inherit ModifierToken<SyntaxKind>
2298+
ModifierToken<SyntaxKind>
22772299

22782300
[<Obsolete("Use `ReadonlyKeyword` instead.")>]
22792301
type ReadonlyToken =
@@ -2296,50 +2318,24 @@ module Ts =
22962318
| [<CompiledValue(124)>] StaticKeyword of StaticKeyword
22972319
[<Emit("$0.kind")>]
22982320
member _.kind : SyntaxKind = jsNative
2299-
static member inline op_ErasedCast(x: AbstractKeyword) = AbstractKeyword x
2300-
static member inline op_ErasedCast(x: AsyncKeyword) = AsyncKeyword x
2301-
static member inline op_ErasedCast(x: ConstKeyword) = ConstKeyword x
2302-
static member inline op_ErasedCast(x: DeclareKeyword) = DeclareKeyword x
2303-
static member inline op_ErasedCast(x: DefaultKeyword) = DefaultKeyword x
2304-
static member inline op_ErasedCast(x: ExportKeyword) = ExportKeyword x
2305-
static member inline op_ErasedCast(x: InKeyword) = InKeyword x
2306-
static member inline op_ErasedCast(x: OutKeyword) = OutKeyword x
2307-
static member inline op_ErasedCast(x: OverrideKeyword) = OverrideKeyword x
2308-
static member inline op_ErasedCast(x: PrivateKeyword) = PrivateKeyword x
2309-
static member inline op_ErasedCast(x: ProtectedKeyword) = ProtectedKeyword x
2310-
static member inline op_ErasedCast(x: PublicKeyword) = PublicKeyword x
2311-
static member inline op_ErasedCast(x: ReadonlyKeyword) = ReadonlyKeyword x
2312-
static member inline op_ErasedCast(x: StaticKeyword) = StaticKeyword x
23132321

23142322
type [<TypeScriptTaggedUnion("kind")>] [<RequireQualifiedAccess>] AccessibilityModifier =
23152323
| [<CompiledValue(121)>] PrivateKeyword of PrivateKeyword
23162324
| [<CompiledValue(122)>] ProtectedKeyword of ProtectedKeyword
23172325
| [<CompiledValue(123)>] PublicKeyword of PublicKeyword
2318-
static member inline op_ErasedCast(x: PrivateKeyword) = PrivateKeyword x
2319-
static member inline op_ErasedCast(x: ProtectedKeyword) = ProtectedKeyword x
2320-
static member inline op_ErasedCast(x: PublicKeyword) = PublicKeyword x
23212326

23222327
type [<TypeScriptTaggedUnion("kind")>] [<RequireQualifiedAccess>] ParameterPropertyModifier =
23232328
| [<CompiledValue(121)>] PrivateKeyword of PrivateKeyword
23242329
| [<CompiledValue(122)>] ProtectedKeyword of ProtectedKeyword
23252330
| [<CompiledValue(123)>] PublicKeyword of PublicKeyword
23262331
| [<CompiledValue(145)>] ReadonlyKeyword of ReadonlyKeyword
2327-
static member inline op_ErasedCast(x: PrivateKeyword) = PrivateKeyword x
2328-
static member inline op_ErasedCast(x: ProtectedKeyword) = ProtectedKeyword x
2329-
static member inline op_ErasedCast(x: PublicKeyword) = PublicKeyword x
2330-
static member inline op_ErasedCast(x: ReadonlyKeyword) = ReadonlyKeyword x
23312332

23322333
type [<TypeScriptTaggedUnion("kind")>] [<RequireQualifiedAccess>] ClassMemberModifier =
23332334
| [<CompiledValue(121)>] PrivateKeyword of PrivateKeyword
23342335
| [<CompiledValue(122)>] ProtectedKeyword of ProtectedKeyword
23352336
| [<CompiledValue(123)>] PublicKeyword of PublicKeyword
23362337
| [<CompiledValue(145)>] ReadonlyKeyword of ReadonlyKeyword
23372338
| [<CompiledValue(124)>] StaticKeyword of StaticKeyword
2338-
static member inline op_ErasedCast(x: PrivateKeyword) = PrivateKeyword x
2339-
static member inline op_ErasedCast(x: ProtectedKeyword) = ProtectedKeyword x
2340-
static member inline op_ErasedCast(x: PublicKeyword) = PublicKeyword x
2341-
static member inline op_ErasedCast(x: ReadonlyKeyword) = ReadonlyKeyword x
2342-
static member inline op_ErasedCast(x: StaticKeyword) = StaticKeyword x
23432339

23442340
type ModifiersArray =
23452341
Modifier[]
@@ -6720,7 +6716,7 @@ Use typeAcquisition.enable instead.")>]
67206716
[<Emit("$0($1...)")>] abstract Invoke: nodes: 'T[] * visitor: Visitor option * ?test: (Node -> bool) * ?start: float * ?count: float -> 'T[]
67216717
[<Emit("$0($1...)")>] abstract Invoke: nodes: 'T[] option * visitor: Visitor option * ?test: (Node -> bool) * ?start: float * ?count: float -> 'T[] option
67226718

6723-
type VisitResult<'T> =
6719+
type VisitResult<'T when 'T :> Node> =
67246720
U2<'T, 'T[]> option
67256721

67266722
type [<AllowNullLiteral>] Printer =
@@ -7751,8 +7747,8 @@ Use typeAcquisition.enable instead.")>]
77517747
abstract skipDestructiveCodeActions: bool option with get, set
77527748

77537749
type [<StringEnum>] [<RequireQualifiedAccess>] CompletionsTriggerCharacter =
7754-
| [<CompiledName(".")>] Dot
7755-
| [<CompiledName("\"")>] DoubleQuote
7750+
| [<CompiledName(".")>] Period
7751+
| [<CompiledName("\"")>] Backslash
77567752
| [<CompiledName("'")>] SingleQuote
77577753
| [<CompiledName("`")>] BackQuote
77587754
| [<CompiledName("/")>] Slash

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,9 +2352,9 @@ type-is@~1.6.18:
23522352
mime-types "~2.1.24"
23532353

23542354
2355-
version "4.7.2"
2356-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.2.tgz#1f9aa2ceb9af87cca227813b4310fff0b51593c4"
2357-
integrity sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==
2355+
version "4.7.4"
2356+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
2357+
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==
23582358

23592359
[email protected], unpipe@~1.0.0:
23602360
version "1.0.0"

0 commit comments

Comments
 (0)