mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 17:43:49 +08:00

* fix: enforce type imports so that the bundler ignores types * chore: add changeset * fix: export types with export type keyword
22 lines
527 B
TypeScript
22 lines
527 B
TypeScript
import { newlineInCode as originalNewlineInCode } from '@tiptap/pm/commands'
|
|
|
|
import type { RawCommands } from '../types.js'
|
|
|
|
declare module '@tiptap/core' {
|
|
interface Commands<ReturnType> {
|
|
newlineInCode: {
|
|
/**
|
|
* Add a newline character in code.
|
|
* @example editor.commands.newlineInCode()
|
|
*/
|
|
newlineInCode: () => ReturnType
|
|
}
|
|
}
|
|
}
|
|
|
|
export const newlineInCode: RawCommands['newlineInCode'] =
|
|
() =>
|
|
({ state, dispatch }) => {
|
|
return originalNewlineInCode(state, dispatch)
|
|
}
|