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

ExampleDocWidget is not incompatible with IModel #220

Closed
Max-ChenFei opened this issue Feb 25, 2023 · 0 comments
Closed

ExampleDocWidget is not incompatible with IModel #220

Max-ChenFei opened this issue Feb 25, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Max-ChenFei
Copy link
Contributor

Description

Type ExampleDocModel does not satisfy the constraint IModel

src/factory.ts(15,3): error TS2344: Type 'ExampleDocWidget' does not satisfy the constraint 'IDocumentWidget<Widget, IModel>'.
  Types of property 'context' are incompatible.
    Type 'IContext<ExampleDocModel>' is not assignable to type 'IContext<IModel>'.
      Type 'ExampleDocModel' is not assignable to type 'IModel'.
src/factory.ts(34,40): error TS2344: Type 'ExampleDocModel' does not satisfy the constraint 'IModel'.
src/factory.ts(47,45): error TS2344: Type 'ExampleDocModel' does not satisfy the constraint 'IModel'.
src/index.ts(67,38): error TS2345: Argument of type 'ExampleWidgetFactory' is not assignable to parameter of type 'WidgetFactory'.
  Types of property 'widgetCreated' are incompatible.
    Type 'ISignal<IWidgetFactory<ExampleDocWidget, ExampleDocModel>, ExampleDocWidget>' is not assignable to type 'ISignal<IWidgetFactory<IDocumentWidget<Widget, IModel>, IModel>, IDocumentWidget<Widget, IModel>>'.
      Type 'IWidgetFactory<ExampleDocWidget, ExampleDocModel>' is not assignable to type 'IWidgetFactory<IDocumentWidget<Widget, IModel>, IModel>'.
        Type 'ExampleDocWidget' is not assignable to type 'IDocumentWidget<Widget, IModel>'.
src/index.ts(71,37): error TS2345: Argument of type 'ExampleDocModelFactory' is not assignable to parameter of type 'ModelFactory'.
  The types returned by 'createNew(...)' are incompatible between these types.
    Type 'ExampleDocModel' is not assignable to type 'IModel'.
src/model.ts(144,12): error TS2416: Property 'sharedModel' in type 'ExampleDocModel' is not assignable to the same property in base type 'IModel'.
  Type 'ExampleDoc' is missing the following properties from type 'ISharedDocument': state, getState, setState
src/widget.tsx(30,3): error TS2344: Type 'ExampleDocModel' does not satisfy the constraint 'IModel'.
  Types of property 'sharedModel' are incompatible.
    Type 'ExampleDoc' is not assignable to type 'ISharedDocument'.
src/widget.tsx(32,62): error TS2344: Type 'ExampleDocModel' does not satisfy the constraint 'IModel'.
src/widget.tsx(54,50): error TS2344: Type 'ExampleDocModel' does not satisfy the constraint 'IModel'.
src/widget.tsx(237,47): error TS2344: Type 'ExampleDocModel' does not satisfy the constraint 'IModel'.

Reproduce

  1. cd document
  2. pip install -e .

Context

  • Operating System and version: Windows 10
  • JupyterLab version:
  • Node.js: 16.17.1
  • Python: 3.11
  • Pip 23.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant