improve types

This commit is contained in:
Philipp Kühn
2021-01-28 09:50:17 +01:00
parent a9c14fbddd
commit 4407d9a3d1
20 changed files with 58 additions and 47 deletions

View File

@@ -1,8 +1,9 @@
import { EditorState } from 'prosemirror-state'
import { Mark, MarkType } from 'prosemirror-model'
import getMarkType from './getMarkType'
import { AnyObject } from '../types'
export default function getMarkAttributes(state: EditorState, typeOrName: string | MarkType) {
export default function getMarkAttributes(state: EditorState, typeOrName: string | MarkType): AnyObject {
const type = getMarkType(typeOrName, state.schema)
const { from, to, empty } = state.selection
let marks: Mark[] = []