mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
Added typings for prosemirror-inputrules 0.18.0
This commit is contained in:
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
// Type definitions for prosemirror-inputrules 0.18.0
|
||||
// Project: https://github.com/ProseMirror/prosemirror-inputrules
|
||||
// Definitions by: David Hahn <https://github.com/davidka>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
import { EditorState } from 'prosemirror-state'
|
||||
import { Transaction } from 'prosemirror-state'
|
||||
import { Plugin } from 'prosemirror-state'
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { ProsemirrorNode } from 'prosemirror-model'
|
||||
|
||||
declare module "prosemirror-inputrules" {
|
||||
export class InputRule {
|
||||
constructor(match: RegExp, handler: string | ((state: EditorState, match: string[], start: number, end: number) => Transaction))
|
||||
|
||||
}
|
||||
export function inputRules(config: { rules: InputRule[] }): Plugin
|
||||
export let emDash: InputRule;
|
||||
export let ellipsis: InputRule;
|
||||
export let openDoubleQuote: InputRule;
|
||||
export let closeDoubleQuote: InputRule;
|
||||
export let openSingleQuote: InputRule;
|
||||
export let closeSingleQuote: InputRule;
|
||||
export let smartQuotes: InputRule[];
|
||||
export let allInputRules: InputRule[];
|
||||
export function wrappingInputRule(regexp: RegExp, nodeType: NodeType, getAttrs?: Object | ((p: string[]) => Object | void), joinPredicate?: (p1: string[], p2: ProsemirrorNode) => boolean): InputRule
|
||||
export function textblockTypeInputRule(regexp: RegExp, nodeType: NodeType, getAttrs?: Object | ((p: string[]) => Object | void)): InputRule
|
||||
export function blockQuoteRule(nodeType: NodeType): InputRule
|
||||
export function orderedListRule(nodeType: NodeType): InputRule
|
||||
export function bulletListRule(nodeType: NodeType): InputRule
|
||||
export function codeBlockRule(nodeType: NodeType): InputRule
|
||||
export function headingRule(nodeType: NodeType, maxLevel: number): InputRule
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import * as inputrules from 'prosemirror-inputrules';
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
|
||||
let nodeType = new NodeType();
|
||||
let rule = inputrules.blockQuoteRule(nodeType);
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"prosemirror-inputrules-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user