From 9dfbef22096ce3c0aafbc38fa5a94d365536e109 Mon Sep 17 00:00:00 2001 From: Christopher Manouvrier Date: Wed, 16 Jan 2019 13:20:03 +1100 Subject: [PATCH 1/3] fix(prosemirror-model): schema.marks typo --- types/prosemirror-model/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From 02cc3207a80a1ed38460c3b7dd09ed1ae2dc4276 Mon Sep 17 00:00:00 2001 From: Christopher Manouvrier Date: Wed, 16 Jan 2019 17:32:39 +1100 Subject: [PATCH 2/3] fix(prosemirror-state): Improve the generic typings --- types/prosemirror-state/index.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/types/prosemirror-state/index.d.ts b/types/prosemirror-state/index.d.ts index 7ecf0f3c13..2db5ec4faa 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: Transaction[], 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: Transaction[] }; /** * 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 From 9c8127471d79f5b497d30223f35a4f15d93d8de7 Mon Sep 17 00:00:00 2001 From: Christopher Manouvrier Date: Wed, 16 Jan 2019 17:42:49 +1100 Subject: [PATCH 3/3] fix(prosemirror-state): Lint issue on generic array --- types/prosemirror-state/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/prosemirror-state/index.d.ts b/types/prosemirror-state/index.d.ts index 2db5ec4faa..235665983c 100644 --- a/types/prosemirror-state/index.d.ts +++ b/types/prosemirror-state/index.d.ts @@ -71,7 +71,7 @@ export interface PluginSpec { */ appendTransaction?: | (( - transactions: Transaction[], + transactions: Array>, oldState: EditorState, newState: EditorState ) => Transaction | null | undefined | void) @@ -452,7 +452,7 @@ 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. */