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 #3814

Merged
merged 1 commit into from
Jun 29, 2023
Merged

Conversation

alecgibson
Copy link
Contributor

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
@luin luin merged commit 0bccbf2 into slab:develop Jun 29, 2023
@alecgibson alecgibson deleted the base-theme-add-module branch June 29, 2023 14:56
luin pushed a commit to cmrd-senya/quill that referenced this pull request Aug 7, 2023
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
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