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 { Node, NodeType } from 'prosemirror-model'
import getNodeType from './getNodeType'
import { AnyObject } from '../types'
export default function getNodeAttributes(state: EditorState, typeOrName: string | NodeType) {
export default function getNodeAttributes(state: EditorState, typeOrName: string | NodeType): AnyObject {
const type = getNodeType(typeOrName, state.schema)
const { from, to } = state.selection
let nodes: Node[] = []