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

Bug: flow types not exported to TS definitions. #2844

Closed
richburdon opened this issue Aug 17, 2022 · 1 comment · Fixed by #2847
Closed

Bug: flow types not exported to TS definitions. #2844

richburdon opened this issue Aug 17, 2022 · 1 comment · Fixed by #2847

Comments

@richburdon
Copy link

Lexical version:

    "@lexical/react": "~0.3.11",

Steps To Reproduce

This seems to be a regression: TS types are missing.

import {
  ProviderAwareness, ProviderFactory, UserState
} from '@lexical/react/LexicalCollaborationPlugin';

The current behavior

TS2305: Module '"@lexical/react/LexicalCollaborationPlugin"' has no exported member 'UserState'.

The expected behavior

Types were previously exported, but currently the types defined in LexicalCollaborationPlugin.js.flow are missing from LexicalCollaborationPlugin.d.ts

@thegreatercurve
Copy link
Contributor

ProviderAwareness and UserState are now exported from lexical-yjs. It's an error for it to still be in Flow.

We removed ProviderFactory, but can create your own version of the type using something like the below:

import {WebsocketProvider as ProviderFactory} from 'y-websocket';

type ProviderFactory = (
  id: string,
  yjsDocMap: Map<string, Doc>,
) -> WebsocketProvider

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 a pull request may close this issue.

2 participants