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

Update JSXSlackTemplateTag type: Accept readonly string array as template #312

Merged
merged 2 commits into from
Feb 11, 2024

Conversation

yhatt
Copy link
Owner

@yhatt yhatt commented Jan 11, 2024

TypeScript built-in TemplateStringsArray type (used by htm) requires having raw propoerty.

interface TemplateStringsArray extends ReadonlyArray<string> {
    readonly raw: readonly string[];
}

raw is not supported by jsx-slack, so I updated JSXSlackTemplateTag type to accept just a readonly string array as template.

This change prevents type error in the (rare) case of directly use jsxslack as a function, just like jsxslack([...], ...).

Related: #311

@yhatt yhatt merged commit 1e56115 into main Feb 11, 2024
4 checks passed
@yhatt yhatt deleted the fix-template-literal-tag-type branch February 11, 2024 07:18
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.

1 participant