-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add re-export serializeForClipboard function from prosemirror-v…
…iew (#107)
- Loading branch information
Showing
3 changed files
with
22 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type {Slice} from 'prosemirror-model'; | ||
import type {EditorView} from 'prosemirror-view'; | ||
|
||
declare module 'prosemirror-view' { | ||
type SerializeForClipboard = ( | ||
view: EditorView, | ||
slice: Slice, | ||
) => {dom: HTMLElement; text: string}; | ||
|
||
// internal export | ||
export const __serializeForClipboard: SerializeForClipboard; | ||
} | ||
|
||
import {__serializeForClipboard} from 'prosemirror-view'; | ||
|
||
if (!__serializeForClipboard) | ||
throw new Error('__serializeForClipboard not exported from prosemirror-view module.'); | ||
|
||
export {__serializeForClipboard as serializeForClipboard}; |