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

✨Introduce API to create text spans #88

Merged
merged 1 commit into from
Oct 5, 2024
Merged

✨Introduce API to create text spans #88

merged 1 commit into from
Oct 5, 2024

Commits on Oct 5, 2024

  1. ✨Introduce API to create text spans

    This commit introduces the function `span()` to create text spans more
    conveniently. Using this function provides better tool support since the
    tooling can suggest text properties and values. Since the function
    returns objects with a specific type, less type annotations are
    required.
    
    For example, the following line of code
    
    ```ts
    let block = { text: ['Hello ', { text: 'World!', fontWeight: 'bold' }] };
    ```
    
    can now be replaced with:
    
    ```ts
    let block = { text: ['Hello ', span('World!', { fontWeight: 'bold' })]);
    ```
    ralfstx committed Oct 5, 2024
    Configuration menu
    Copy the full SHA
    189fc3b View commit details
    Browse the repository at this point in the history