@types/prosemirror-state
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -25,3 +25,3 @@ // Type definitions for prosemirror-state 1.2 | ||
*/ | ||
export interface PluginSpec<S extends Schema = any> { | ||
export interface PluginSpec<T = any, S extends Schema = any> { | ||
/** | ||
@@ -37,3 +37,3 @@ * The [view props](#view.EditorProps) added by this plugin. Props | ||
*/ | ||
state?: StateField<any, S> | null; | ||
state?: StateField<T, S> | null; | ||
/** | ||
@@ -45,3 +45,3 @@ * Can be used to make this a keyed plugin. You can have only one | ||
*/ | ||
key?: PluginKey<S> | null; | ||
key?: PluginKey<T, S> | null; | ||
/** | ||
@@ -88,7 +88,7 @@ * When the plugin needs to interact with the editor view, or | ||
*/ | ||
export class Plugin<S extends Schema = any> { | ||
export class Plugin<T = any, S extends Schema = any> { | ||
/** | ||
* Create a plugin. | ||
*/ | ||
constructor(spec: PluginSpec<S>); | ||
constructor(spec: PluginSpec<T, S>); | ||
/** | ||
@@ -101,7 +101,7 @@ * The [props](#view.EditorProps) exported by this plugin. | ||
*/ | ||
spec: { [key: string]: any }; | ||
spec: PluginSpec<T, S>; | ||
/** | ||
* Extract the plugin's state field from an editor state. | ||
*/ | ||
getState(state: EditorState<S>): any; | ||
getState(state: EditorState<S>): T; | ||
} | ||
@@ -114,3 +114,3 @@ /** | ||
*/ | ||
export interface StateField<T, S extends Schema = Schema> { | ||
export interface StateField<T = any, S extends Schema = Schema> { | ||
/** | ||
@@ -147,3 +147,3 @@ * Initialize the value of the field. `config` will be the object | ||
*/ | ||
export class PluginKey<S extends Schema = any> { | ||
export class PluginKey<T = any, S extends Schema = any> { | ||
/** | ||
@@ -157,3 +157,3 @@ * Create a plugin key. | ||
*/ | ||
get(state: EditorState<S>): Plugin<S> | null | undefined; | ||
get(state: EditorState<S>): Plugin<T, S> | null | undefined; | ||
/** | ||
@@ -451,3 +451,3 @@ * Get the plugin's state from an editor state. | ||
*/ | ||
plugins: Array<Plugin<S>>; | ||
plugins: Array<Plugin<any, S>>; | ||
/** | ||
@@ -477,3 +477,3 @@ * Apply the given transaction to produce a new state. | ||
*/ | ||
reconfigure(config: { schema?: S | null; plugins?: Array<Plugin<S>> | null }): EditorState<S>; | ||
reconfigure(config: { schema?: S | null; plugins?: Array<Plugin<any, S>> | null }): EditorState<S>; | ||
/** | ||
@@ -484,3 +484,3 @@ * Serialize this state to JSON. If you want to serialize the state | ||
*/ | ||
toJSON(pluginFields?: { [name: string]: Plugin<S> } | string | number): { [key: string]: any }; | ||
toJSON(pluginFields?: { [name: string]: Plugin<any, S> } | string | number): { [key: string]: any }; | ||
/** | ||
@@ -494,3 +494,3 @@ * Create a new state. | ||
storedMarks?: Mark[] | null; | ||
plugins?: Array<Plugin<S>> | null; | ||
plugins?: Array<Plugin<any, S>> | null; | ||
}): EditorState<S>; | ||
@@ -505,5 +505,5 @@ /** | ||
static fromJSON<S extends Schema = any>( | ||
config: { schema: S; plugins?: Array<Plugin<S>> | null }, | ||
config: { schema: S; plugins?: Array<Plugin<any, S>> | null }, | ||
json: { [key: string]: any }, | ||
pluginFields?: { [name: string]: Plugin<S> } | ||
pluginFields?: { [name: string]: Plugin<any, S> } | ||
): EditorState<S>; | ||
@@ -605,7 +605,7 @@ } | ||
*/ | ||
setMeta(key: string | Plugin | PluginKey, value: any): Transaction; | ||
setMeta(key: string | Plugin<any, S> | PluginKey<any, S>, value: any): Transaction; | ||
/** | ||
* Retrieve a metadata property for a given name or plugin. | ||
*/ | ||
getMeta(key: string | Plugin | PluginKey): any; | ||
getMeta(key: string | Plugin<any, S> | PluginKey<any, S>): any; | ||
/** | ||
@@ -612,0 +612,0 @@ * Returns true if this transaction doesn't contain any metadata, |
{ | ||
"name": "@types/prosemirror-state", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "TypeScript definitions for prosemirror-state", | ||
@@ -32,3 +32,4 @@ "license": "MIT", | ||
"type": "git", | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/prosemirror-state" | ||
}, | ||
@@ -41,4 +42,4 @@ "scripts": {}, | ||
}, | ||
"typesPublisherContentHash": "56c268693dfdf4d3f74c91b3fed7170c5322d0aca41780c836be5fb3de113c99", | ||
"typesPublisherContentHash": "a4cffd32415a30d750b5f8e9b2413d214a600da20c4c0a4143a3c6c86edd48a9", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Wed, 13 Feb 2019 21:04:45 GMT | ||
* Last updated: Tue, 26 Feb 2019 22:39:33 GMT | ||
* Dependencies: @types/prosemirror-model, @types/prosemirror-transform, @types/prosemirror-view | ||
@@ -14,0 +14,0 @@ * Global values: none |
24327