diff --git a/types/prosemirror-model/index.d.ts b/types/prosemirror-model/index.d.ts index aa02f9b770..a86037d0f8 100644 --- a/types/prosemirror-model/index.d.ts +++ b/types/prosemirror-model/index.d.ts @@ -1323,7 +1323,7 @@ export class Schema { /** * A map from mark names to mark type objects. */ - marks: { [name in M]: MarkType> } & { [key: string]: NodeType> }; + marks: { [name in M]: MarkType> } & { [key: string]: MarkType> }; /** * The type of the [default top node](#model.SchemaSpec.topNode) * for this schema. diff --git a/types/prosemirror-state/index.d.ts b/types/prosemirror-state/index.d.ts index 7ecf0f3c13..235665983c 100644 --- a/types/prosemirror-state/index.d.ts +++ b/types/prosemirror-state/index.d.ts @@ -33,7 +33,7 @@ export interface PluginSpec { * Allows a plugin to define a [state field](#state.StateField), an * extra slot in the state object in which it can keep its own data. */ - state?: StateField | null; + state?: StateField | null; /** * Can be used to make this a keyed plugin. You can have only one * plugin with a given key in a given state, but it is possible to @@ -60,7 +60,7 @@ export interface PluginSpec { * applied by the state, allowing the plugin to cancel it (by * returning false). */ - filterTransaction?: ((p1: Transaction, p2: EditorState) => boolean) | null; + filterTransaction?: ((p1: Transaction, p2: EditorState) => boolean) | null; /** * Allows the plugin to append another transaction to be applied * after the given array of transactions. When another plugin @@ -71,10 +71,10 @@ export interface PluginSpec { */ appendTransaction?: | (( - transactions: Transaction[], + transactions: Array>, oldState: EditorState, newState: EditorState - ) => Transaction | null | undefined | void) + ) => Transaction | null | undefined | void) | null; } /** @@ -120,7 +120,7 @@ export interface StateField { * constructed state does not yet contain the state from plugins * coming after this one. */ - apply(tr: Transaction, value: T, oldState: EditorState, newState: EditorState): T; + apply(tr: Transaction, value: T, oldState: EditorState, newState: EditorState): T; /** * Convert this field to JSON. Optional, can be left off to disable * JSON serialization for the field. @@ -223,12 +223,12 @@ export class Selection { * Replace the selection with a slice or, if no slice is given, * delete the selection. Will append to the given transaction. */ - replace(tr: Transaction, content?: Slice): void; + replace(tr: Transaction, content?: Slice): void; /** * Replace the selection with the given node, appending the changes * to the given transaction. */ - replaceWith(tr: Transaction, node: ProsemirrorNode): void; + replaceWith(tr: Transaction, node: ProsemirrorNode): void; /** * Convert the selection to a JSON representation. When implementing * this for a custom selection class, make sure to give the object a @@ -444,7 +444,7 @@ export class EditorState { /** * Apply the given transaction to produce a new state. */ - apply(tr: Transaction): EditorState; + apply(tr: Transaction): EditorState; /** * Verbose variant of [`apply`](#state.EditorState.apply) that * returns the precise transactions that were applied (which might @@ -452,11 +452,11 @@ export class EditorState { * hooks](#state.PluginSpec.filterTransaction) of * plugins) along with the new state. */ - applyTransaction(tr: Transaction): { state: EditorState; transactions: Transaction[] }; + applyTransaction(tr: Transaction): { state: EditorState; transactions: Array> }; /** * Start a [transaction](#state.Transaction) from this state. */ - tr: Transaction; + tr: Transaction; /** * Create a new state based on this one, but with an adjusted set of * active plugins. State fields that exist in both sets of plugins