The current section, https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html, is huge but at the same time lacking a lot of information.
Questions like https://stackoverflow.com/questions/61097030/how-to-import-custom-typings-into-a-vscode-js-project, https://stackoverflow.com/questions/51982814/reference-definition-from-ts-check-js-file etc... are not answered. Rather, one has to search github issues and trial and error, to get a solution.
//@ts-check is powerful but difficult to actually use, once you use it on anything apart from extremely simple code.