Skip to content

Commit

Permalink
mark the ImportAssertions as deprecated (#57012)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tarasyuk authored Jan 18, 2024
1 parent 744f77a commit 5364494
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
8 changes: 7 additions & 1 deletion src/harness/fourslashInterfaceImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 1043,12 @@ export namespace Completion {
kindModifiers: "declare",
sortText: SortText.GlobalsOrKeywords,
});
const deprecatedInterfaceEntry = (name: string): ExpectedCompletionEntryObject => ({
name,
kind: "interface",
kindModifiers: "deprecated,declare",
sortText: "z15" as SortText,
});
const typeEntry = (name: string): ExpectedCompletionEntryObject => ({
name,
kind: "type",
Expand Down Expand Up @@ -1128,7 1134,7 @@ export namespace Completion {
interfaceEntry("TemplateStringsArray"),
interfaceEntry("ImportMeta"),
interfaceEntry("ImportCallOptions"),
interfaceEntry("ImportAssertions"),
deprecatedInterfaceEntry("ImportAssertions"),
interfaceEntry("ImportAttributes"),
varEntry("Math"),
varEntry("Date"),
Expand Down
1 change: 1 addition & 0 deletions src/lib/es5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 626,7 @@ interface ImportCallOptions {

/**
* The type for the `assert` property of the optional second argument to `import()`.
* @deprecated
*/
interface ImportAssertions {
[key: string]: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 584,6 @@ Info seq [hh:mm:ss:mss] response:
"kindModifiers": "declare",
"sortText": "15"
},
{
"name": "ImportAssertions",
"kind": "interface",
"kindModifiers": "declare",
"sortText": "15"
},
{
"name": "ImportAttributes",
"kind": "interface",
Expand Down Expand Up @@ -1161,6 1155,12 @@ Info seq [hh:mm:ss:mss] response:
"fileName": "/node_modules/fp-ts/index.d.ts",
"isPackageJsonImport": true
}
},
{
"name": "ImportAssertions",
"kind": "interface",
"kindModifiers": "deprecated,declare",
"sortText": "z15"
}
]
}
Expand Down

0 comments on commit 5364494

Please sign in to comment.