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 addModule() types #49

Merged
merged 1 commit into from
Jun 28, 2023
Merged

🏷️ Fix addModule() types #49

merged 1 commit into from
Jun 28, 2023

Conversation

alecgibson
Copy link
Collaborator

At the moment, since @ts-expect-error doesn't apply to type definitions, we get a downstream compilation error:

TS2416: Property 'addModule' in type 'BaseTheme' is not assignable to the same property in base type 'Theme'.
  Type '(name: string) => unknown' is not assignable to type '{ (name: "clipboard"): Clipboard; (name: "keyboard"): Keyboard; (name: "uploader"): Uploader; (name: "history"): History; (name: "selection"): Selection; (name: string): unknown; }'.
    Type '{}' is missing the following properties from type 'Clipboard': matchers, addMatcher, convert, convertHTML, and 8 more.

10     addModule(name: string): unknown;

This change updates the Base class to have the same signature as for addModule() as its parent class.

At the moment, since `@ts-expect-error` [doesn't apply][1] to type
definitions, we get a downstream compilation error:

```
TS2416: Property 'addModule' in type 'BaseTheme' is not assignable to the same property in base type 'Theme'.
  Type '(name: string) => unknown' is not assignable to type '{ (name: "clipboard"): Clipboard; (name: "keyboard"): Keyboard; (name: "uploader"): Uploader; (name: "history"): History; (name: "selection"): Selection; (name: string): unknown; }'.
    Type '{}' is missing the following properties from type 'Clipboard': matchers, addMatcher, convert, convertHTML, and 8 more.

10     addModule(name: string): unknown;
```

This change updates the `Base` class to have the same signature as
for `addModule()` as its parent class.

[1]: microsoft/TypeScript#38628
@alecgibson alecgibson merged commit 4c326c4 into main Jun 28, 2023
@alecgibson alecgibson deleted the fix-theme-types branch June 28, 2023 14:25
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.

2 participants