I'm looking for a way to extend the type hints in monaco editor (like Object, String or Boolean) with my own king of type. The goal is that the editor knows the type and can provide code completion to the specific type.
All the previous examples I found are by inserting strings on addExtraLib but this is not professional:
monaco.languages.typescript.javascriptDefaults.addExtraLib([
'declare class MyClass {',
' count: number',
'}'
].join('\n'));
What I am looking for is to provide e.g. following .d.ts file or any file to let the editor know of my type, to better automate the process:
// myclass.d.ts
export class MyClass = {
count: number
}
Is there something I am missing out?