fix type issue
This commit is contained in:
@@ -1,33 +1,20 @@
|
||||
import { MarkSpec, MarkType } from 'prosemirror-model'
|
||||
import Extension, { ExtensionCallback, ExtensionExtends } from './Extension'
|
||||
import { Editor } from './Editor'
|
||||
|
||||
// export default abstract class Mark extends Extension {
|
||||
|
||||
// constructor(options = {}) {
|
||||
// super(options)
|
||||
// }
|
||||
|
||||
// public extensionType = 'mark'
|
||||
|
||||
// abstract schema(): MarkSpec
|
||||
|
||||
// get type() {
|
||||
// return this.editor.schema.marks[this.name]
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
export interface MarkCallback extends ExtensionCallback {
|
||||
// TODO: fix optional
|
||||
type?: MarkType
|
||||
interface Callback {
|
||||
name: string
|
||||
editor: Editor
|
||||
options: any
|
||||
type: MarkType
|
||||
}
|
||||
|
||||
export interface MarkExtends<Callback = MarkCallback> extends ExtensionExtends<Callback> {
|
||||
export interface MarkExtends extends ExtensionExtends<Callback> {
|
||||
topMark: boolean
|
||||
schema: (params: Callback) => MarkSpec
|
||||
}
|
||||
|
||||
export default class Mark<Options = {}> extends Extension<Options, MarkExtends> {
|
||||
export default class Mark<Options = {}> extends Extension<Options, Callback, MarkExtends> {
|
||||
type = 'mark'
|
||||
|
||||
public schema(value: MarkExtends['schema']) {
|
||||
|
||||
Reference in New Issue
Block a user