Open meszaros-lajos-gyorgy opened 1 year ago
I see the other type is also listed in the next line, but typescript doesn't recognise it as an overload
My current workaround so far is:
import hq from 'alias-hq'
type TsOrJsConfig = {
rootUrl: string
baseUrl: string
paths: Record<string, string[]>
}
type PluginCallback = (params: TsOrJsConfig) => any
const get = hq.get as (plugin: string | PluginCallback) => any
// ... use get instead of hq.get
Hey there!
Sorry about that.
I should add type definitions (or migrate to TS) I suppose!
Let me look at that in the next couple of days.
See:
The following line says that the method's first parameter is a string: https://github.com/davestewart/alias-hq/blob/main/src/index.js#L247
and vscode is yelling about it in my typescript project as expected: