Closed ziloen closed 1 year ago
I'm not understanding your issue, please describe with an example
In the source code, messageID
has a generic type DataTypeKey
, but in the user's actual type file, the generic type of messageID
changes to string
, and when I expand the ProtocolMap
type, I don't get a type hint at the messageID
// modules.d.ts
declare module "webext-bridge" {
export interface ProtocolMap {
foo: { title: string }
bar: ProtocolWithReturn<CustomDataType, CustomReturnType>;
}
}
// background.ts
onMessage(messageID, ...)
// ^ no type hint and accept any string
Looks the same as #51, feel free to close.