new major change
This commit is contained in:
-21
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
# Installation
|
||||
> `npm install --save @types/quill`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for Quill (https://github.com/quilljs/quill/).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/quill
|
||||
|
||||
Additional Details
|
||||
* Last updated: Mon, 10 Sep 2018 21:54:53 GMT
|
||||
* Dependencies: parchment
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by Sumit <https://github.com/sumitkm>, Guillaume <https://github.com/guillaume-ro-fr>, James Garbutt <https://github.com/43081j>, Aniello Falcone <https://github.com/AnielloFalcone>, Mohammad Hossein Amri <https://github.com/mhamri>.
|
||||
-224
@@ -1,224 +0,0 @@
|
||||
// Type definitions for Quill 1.3
|
||||
// Project: https://github.com/quilljs/quill/
|
||||
// Definitions by: Sumit <https://github.com/sumitkm>
|
||||
// Guillaume <https://github.com/guillaume-ro-fr>
|
||||
// James Garbutt <https://github.com/43081j>
|
||||
// Aniello Falcone <https://github.com/AnielloFalcone>
|
||||
// Mohammad Hossein Amri <https://github.com/mhamri>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Blot } from 'parchment/dist/src/blot/abstract/blot';
|
||||
|
||||
/**
|
||||
* A stricter type definition would be:
|
||||
*
|
||||
* type DeltaOperation ({ insert: any } | { delete: number } | { retain: number }) & OptionalAttributes;
|
||||
*
|
||||
* But this would break a lot of existing code as it would require manual discrimination of the union types.
|
||||
*/
|
||||
export type DeltaOperation = { insert?: any, delete?: number, retain?: number } & OptionalAttributes;
|
||||
export type Sources = "api" | "user" | "silent";
|
||||
|
||||
export interface Key {
|
||||
key: string;
|
||||
shortKey?: boolean;
|
||||
}
|
||||
|
||||
export interface StringMap {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface OptionalAttributes {
|
||||
attributes?: StringMap;
|
||||
}
|
||||
|
||||
export type TextChangeHandler = (delta: DeltaStatic, oldContents: DeltaStatic, source: Sources) => any;
|
||||
export type SelectionChangeHandler = (range: RangeStatic, oldRange: RangeStatic, source: Sources) => any;
|
||||
export type EditorChangeHandler = ((name: "text-change", delta: DeltaStatic, oldContents: DeltaStatic, source: Sources) => any)
|
||||
| ((name: "selection-change", range: RangeStatic, oldRange: RangeStatic, source: Sources) => any);
|
||||
|
||||
export interface KeyboardStatic {
|
||||
addBinding(key: Key, callback: (range: RangeStatic, context: any) => void): void;
|
||||
addBinding(key: Key, context: any, callback: (range: RangeStatic, context: any) => void): void;
|
||||
}
|
||||
|
||||
export interface ClipboardStatic {
|
||||
convert(html?: string): DeltaStatic;
|
||||
addMatcher(selectorOrNodeType: string|number, callback: (node: any, delta: DeltaStatic) => DeltaStatic): void;
|
||||
dangerouslyPasteHTML(html: string, source?: Sources): void;
|
||||
dangerouslyPasteHTML(index: number, html: string, source?: Sources): void;
|
||||
}
|
||||
|
||||
export interface QuillOptionsStatic {
|
||||
debug?: string;
|
||||
modules?: StringMap;
|
||||
placeholder?: string;
|
||||
readOnly?: boolean;
|
||||
theme?: string;
|
||||
formats?: string[];
|
||||
bounds?: HTMLElement | string;
|
||||
scrollingContainer?: HTMLElement | string;
|
||||
strict?: boolean;
|
||||
}
|
||||
|
||||
export interface BoundsStatic {
|
||||
bottom: number;
|
||||
left: number;
|
||||
right: number;
|
||||
top: number;
|
||||
height: number;
|
||||
width: number;
|
||||
}
|
||||
|
||||
export interface DeltaStatic {
|
||||
ops?: DeltaOperation[];
|
||||
retain(length: number, attributes?: StringMap): DeltaStatic;
|
||||
delete(length: number): DeltaStatic;
|
||||
filter(predicate: (op: DeltaOperation) => boolean): DeltaOperation[];
|
||||
forEach(predicate: (op: DeltaOperation) => void): void;
|
||||
insert(text: any, attributes?: StringMap): DeltaStatic;
|
||||
map<T>(predicate: (op: DeltaOperation) => T): T[];
|
||||
partition(predicate: (op: DeltaOperation) => boolean): [DeltaOperation[], DeltaOperation[]];
|
||||
reduce<T>(predicate: (acc: T, curr: DeltaOperation, idx: number, arr: DeltaOperation[]) => T, initial: T): T;
|
||||
chop(): DeltaStatic;
|
||||
length(): number;
|
||||
slice(start?: number, end?: number): DeltaStatic;
|
||||
compose(other: DeltaStatic): DeltaStatic;
|
||||
concat(other: DeltaStatic): DeltaStatic;
|
||||
diff(other: DeltaStatic, index?: number): DeltaStatic;
|
||||
eachLine(predicate: (line: DeltaStatic, attributes: StringMap, idx: number) => any, newline?: string): DeltaStatic;
|
||||
transform(index: number, priority?: boolean): number;
|
||||
transform(other: DeltaStatic, priority: boolean): DeltaStatic;
|
||||
transformPosition(index: number, priority?: boolean): number;
|
||||
}
|
||||
|
||||
export class Delta implements DeltaStatic {
|
||||
constructor(ops?: DeltaOperation[] | { ops: DeltaOperation[] });
|
||||
ops?: DeltaOperation[];
|
||||
retain(length: number, attributes?: StringMap): DeltaStatic;
|
||||
delete(length: number): DeltaStatic;
|
||||
filter(predicate: (op: DeltaOperation) => boolean): DeltaOperation[];
|
||||
forEach(predicate: (op: DeltaOperation) => void): void;
|
||||
insert(text: any, attributes?: StringMap): DeltaStatic;
|
||||
map<T>(predicate: (op: DeltaOperation) => T): T[];
|
||||
partition(predicate: (op: DeltaOperation) => boolean): [DeltaOperation[], DeltaOperation[]];
|
||||
reduce<T>(predicate: (acc: T, curr: DeltaOperation, idx: number, arr: DeltaOperation[]) => T, initial: T): T;
|
||||
chop(): DeltaStatic;
|
||||
length(): number;
|
||||
slice(start?: number, end?: number): DeltaStatic;
|
||||
compose(other: DeltaStatic): DeltaStatic;
|
||||
concat(other: DeltaStatic): DeltaStatic;
|
||||
diff(other: DeltaStatic, index?: number): DeltaStatic;
|
||||
eachLine(predicate: (line: DeltaStatic, attributes: StringMap, idx: number) => any, newline?: string): DeltaStatic;
|
||||
transform(index: number): number;
|
||||
transform(other: DeltaStatic, priority: boolean): DeltaStatic;
|
||||
transformPosition(index: number): number;
|
||||
}
|
||||
|
||||
export interface RangeStatic {
|
||||
index: number;
|
||||
length: number;
|
||||
}
|
||||
|
||||
export class RangeStatic implements RangeStatic {
|
||||
constructor();
|
||||
index: number;
|
||||
length: number;
|
||||
}
|
||||
|
||||
export interface EventEmitter {
|
||||
on(eventName: "text-change", handler: TextChangeHandler): EventEmitter;
|
||||
on(eventName: "selection-change", handler: SelectionChangeHandler): EventEmitter;
|
||||
on(eventName: "editor-change", handler: EditorChangeHandler): EventEmitter;
|
||||
once(eventName: "text-change", handler: TextChangeHandler): EventEmitter;
|
||||
once(eventName: "selection-change", handler: SelectionChangeHandler): EventEmitter;
|
||||
once(eventName: "editor-change", handler: EditorChangeHandler): EventEmitter;
|
||||
off(eventName: "text-change", handler: TextChangeHandler): EventEmitter;
|
||||
off(eventName: "selection-change", handler: SelectionChangeHandler): EventEmitter;
|
||||
off(eventName: "editor-change", handler: EditorChangeHandler): EventEmitter;
|
||||
}
|
||||
|
||||
export class Quill implements EventEmitter {
|
||||
/**
|
||||
* @private Internal API
|
||||
*/
|
||||
root: HTMLDivElement;
|
||||
clipboard: ClipboardStatic;
|
||||
scroll: Blot;
|
||||
keyboard: KeyboardStatic;
|
||||
constructor(container: string | Element, options?: QuillOptionsStatic);
|
||||
deleteText(index: number, length: number, source?: Sources): DeltaStatic;
|
||||
disable(): void;
|
||||
enable(enabled?: boolean): void;
|
||||
getContents(index?: number, length?: number): DeltaStatic;
|
||||
getLength(): number;
|
||||
getText(index?: number, length?: number): string;
|
||||
insertEmbed(index: number, type: string, value: any, source?: Sources): DeltaStatic;
|
||||
insertText(index: number, text: string, source?: Sources): DeltaStatic;
|
||||
insertText(index: number, text: string, format: string, value: any, source?: Sources): DeltaStatic;
|
||||
insertText(index: number, text: string, formats: StringMap, source?: Sources): DeltaStatic;
|
||||
/**
|
||||
* @deprecated Remove in 2.0. Use clipboard.dangerouslyPasteHTML(index: number, html: string, source: Sources)
|
||||
*/
|
||||
pasteHTML(index: number, html: string, source?: Sources): string;
|
||||
/**
|
||||
* @deprecated Remove in 2.0. Use clipboard.dangerouslyPasteHTML(html: string, source: Sources): void;
|
||||
*/
|
||||
pasteHTML(html: string, source?: Sources): string;
|
||||
setContents(delta: DeltaStatic, source?: Sources): DeltaStatic;
|
||||
setText(text: string, source?: Sources): DeltaStatic;
|
||||
update(source?: Sources): void;
|
||||
updateContents(delta: DeltaStatic, source?: Sources): DeltaStatic;
|
||||
|
||||
format(name: string, value: any, source?: Sources): DeltaStatic;
|
||||
formatLine(index: number, length: number, source?: Sources): DeltaStatic;
|
||||
formatLine(index: number, length: number, format: string, value: any, source?: Sources): DeltaStatic;
|
||||
formatLine(index: number, length: number, formats: StringMap, source?: Sources): DeltaStatic;
|
||||
formatText(index: number, length: number, source?: Sources): DeltaStatic;
|
||||
formatText(index: number, length: number, format: string, value: any, source?: Sources): DeltaStatic;
|
||||
formatText(index: number, length: number, formats: StringMap, source?: Sources): DeltaStatic;
|
||||
formatText(range: RangeStatic, format: string, value: any, source?: Sources): DeltaStatic;
|
||||
formatText(range: RangeStatic, formats: StringMap, source?: Sources): DeltaStatic;
|
||||
getFormat(range?: RangeStatic): StringMap;
|
||||
getFormat(index: number, length?: number): StringMap;
|
||||
removeFormat(index: number, length: number, source?: Sources): DeltaStatic;
|
||||
|
||||
blur(): void;
|
||||
focus(): void;
|
||||
getBounds(index: number, length?: number): BoundsStatic;
|
||||
getSelection(focus: true): RangeStatic;
|
||||
getSelection(focus?: false): RangeStatic | null;
|
||||
hasFocus(): boolean;
|
||||
setSelection(index: number, length: number, source?: Sources): void;
|
||||
setSelection(range: RangeStatic, source?: Sources): void;
|
||||
|
||||
// static methods: debug, import, register, find
|
||||
static debug(level: string|boolean): void;
|
||||
static import(path: string): any;
|
||||
static register(path: string, def: any, suppressWarning?: boolean): void;
|
||||
static register(defs: StringMap, suppressWarning?: boolean): void;
|
||||
static find(domNode: Node, bubble?: boolean): Quill | any;
|
||||
|
||||
addContainer(classNameOrDomNode: string|Node, refNode?: Node): any;
|
||||
getModule(name: string): any;
|
||||
|
||||
// Blot interface is not exported on Parchment
|
||||
getIndex(blot: any): number;
|
||||
getLeaf(index: number): any;
|
||||
getLine(index: number): [any, number];
|
||||
getLines(index?: number, length?: number): any[];
|
||||
getLines(range: RangeStatic): any[];
|
||||
|
||||
// EventEmitter methods
|
||||
on(eventName: "text-change", handler: TextChangeHandler): EventEmitter;
|
||||
on(eventName: "selection-change", handler: SelectionChangeHandler): EventEmitter;
|
||||
on(eventName: "editor-change", handler: EditorChangeHandler): EventEmitter;
|
||||
once(eventName: "text-change", handler: TextChangeHandler): EventEmitter;
|
||||
once(eventName: "selection-change", handler: SelectionChangeHandler): EventEmitter;
|
||||
once(eventName: "editor-change", handler: EditorChangeHandler): EventEmitter;
|
||||
off(eventName: "text-change", handler: TextChangeHandler): EventEmitter;
|
||||
off(eventName: "selection-change", handler: SelectionChangeHandler): EventEmitter;
|
||||
off(eventName: "editor-change", handler: EditorChangeHandler): EventEmitter;
|
||||
}
|
||||
|
||||
export default Quill;
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
{
|
||||
"name": "@types/quill",
|
||||
"version": "1.3.10",
|
||||
"description": "TypeScript definitions for Quill",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Sumit",
|
||||
"url": "https://github.com/sumitkm",
|
||||
"githubUsername": "sumitkm"
|
||||
},
|
||||
{
|
||||
"name": "Guillaume",
|
||||
"url": "https://github.com/guillaume-ro-fr",
|
||||
"githubUsername": "guillaume-ro-fr"
|
||||
},
|
||||
{
|
||||
"name": "James Garbutt",
|
||||
"url": "https://github.com/43081j",
|
||||
"githubUsername": "43081j"
|
||||
},
|
||||
{
|
||||
"name": "Aniello Falcone",
|
||||
"url": "https://github.com/AnielloFalcone",
|
||||
"githubUsername": "AnielloFalcone"
|
||||
},
|
||||
{
|
||||
"name": "Mohammad Hossein Amri",
|
||||
"url": "https://github.com/mhamri",
|
||||
"githubUsername": "mhamri"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"parchment": "^1.1.2"
|
||||
},
|
||||
"typesPublisherContentHash": "2483630ee29fdf4f03b09b41c35faff526b532bade15446ac2ce2a4a9ce5e9a3",
|
||||
"typeScriptVersion": "2.0"
|
||||
}
|
||||
Reference in New Issue
Block a user