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

[@lexical/code] Feature: export SerializedCodeHighlightNode #7254

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DaniGuardiola
Copy link
Contributor

Description

Export SerializedCodeHighlightNode since it's helpful to consumers.

Test plan

n/a

Copy link

vercel bot commented Feb 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2025 10:44pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2025 10:44pm

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 26, 2025
Copy link
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't sufficient to actually use it outside of this package, you'd also have to export from the entrypoint (index.ts).

In the meantime you should be able to use ReturnType<CodeHighlightNode['exportJSON']> to refer to this value. It might make more sense to use a generic type in your application like type JSONForNode<T extends LexicalNode> = ReturnType<T['exportJSON']> instead of trying to make sure every declared serialization type is exported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants