Skip to content

Commit

Permalink
fix(paste-rules): update typescript type (#1998)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue committed Mar 10, 2023
1 parent b8f563c commit 414fa25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/popular-maps-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'prosemirror-paste-rules': patch
---

Update the type for `BaseRegexPasteRule.getAttributes`. Now you can use `match.groups` in `getAttributes` callback.
2 changes: 1 addition & 1 deletion packages/prosemirror-paste-rules/src/paste-rules-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ interface BaseContentPasteRule extends BaseRegexPasteRule {
*/
getAttributes?:
| Record<string, unknown>
| ((match: string[], isReplacement: boolean) => Record<string, unknown> | undefined);
| ((match: RegExpExecArray, isReplacement: boolean) => Record<string, unknown> | undefined);
}

/**
Expand Down

1 comment on commit 414fa25

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉 Published on https://remirror.io as production
🚀 Deployed on https://640b4dff06d4cc2ab0027587--remirror.netlify.app

Please sign in to comment.