Open ciscoheat opened 3 years ago
Apologizes if this has already been considered, but in the puppeteer file I see that there are some definitions like on<K extends keyof PageEventObj>, which looks like a good candidate for an enum abstract, similar to:
on<K extends keyof PageEventObj>
export interface PageEventObj { close: undefined; console: ConsoleMessage; dialog: Dialog; ...
Which is transformed to a non-constrained type parameter when used:
function on<K>(eventName : K, ...) : Page;
But since it is well-defined in the keys of the PageEventObj, could you define an enum:
PageEventObj
enum abstract PageEventObjKey(String) { var close; var console; var dialog; }
And use that as a type for eventName?
eventName
Apologizes if this has already been considered, but in the puppeteer file I see that there are some definitions like
on<K extends keyof PageEventObj>
, which looks like a good candidate for an enum abstract, similar to:Which is transformed to a non-constrained type parameter when used:
But since it is well-defined in the keys of the
PageEventObj
, could you define an enum:And use that as a type for
eventName
?