Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix types for event listeners, remove typedoc #193

Merged
merged 1 commit into from Jul 25, 2021

Conversation

nolanlawson
Copy link
Owner

fixes #191

After looking at dom.d.ts a bit I figured out that I was missing some declarations for addEventListener/removeEventListener, which is why it would fail in strict mode. Unfortunately I couldn't figure out how to make these changes in the .ts files, but we can just put them directly in the .d.ts files and modify those directly, since I'm not really using Typedoc anymore so there's no need to keep it around.

@github-actions
Copy link

github-actions bot commented Jul 25, 2021

📊 Tachometer Benchmark Results

Summary

  • emoji-picker-element-first-load
  • emoji-picker-element-second-load

Results

emoji-picker-element-first-load
emoji-picker-element-second-load

tachometer-reporter-action v2 for Benchmarks

@nolanlawson
Copy link
Owner Author

This is the magic; you need these type: string declarations too:

addEventListener<K extends keyof EmojiPickerEventMap>(type: K, listener: (this: Picker, ev: EmojiPickerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof EmojiPickerEventMap>(type: K, listener: (this: Picker, ev: EmojiPickerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;

@github-actions
Copy link

Size Change: 0 B

Total Size: 41.5 kB

ℹ️ View Unchanged
Filename Size
./bundle.js 41.5 kB

compressed-size-action

@nolanlawson nolanlawson merged commit 8c7bbc7 into master Jul 25, 2021
@nolanlawson nolanlawson mentioned this pull request Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vite TypeScript error when building
1 participant