Add license, use ReadonlyArray

pull/44/head
Franklin Tse 5 years ago
parent 4e6b0876e9
commit ce4171a3b7

41
types/easymde.d.ts vendored

@ -1,3 +1,24 @@
// This file is based on https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/simplemde/index.d.ts,
// which is written by Scalesoft <https://github.com/Scalesoft> and licensed under the MIT license:
//
// 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.
/// <reference types="codemirror"/> /// <reference types="codemirror"/>
declare namespace EasyMDE { declare namespace EasyMDE {
@ -14,10 +35,10 @@ declare namespace EasyMDE {
} }
interface InsertTextOptions { interface InsertTextOptions {
horizontalRule?: string[]; horizontalRule?: ReadonlyArray<string>;
image?: string[]; image?: ReadonlyArray<string>;
link?: string[]; link?: ReadonlyArray<string>;
table?: string[]; table?: ReadonlyArray<string>;
} }
interface ParsingOptions { interface ParsingOptions {
@ -31,7 +52,7 @@ declare namespace EasyMDE {
codeSyntaxHighlighting: boolean; codeSyntaxHighlighting: boolean;
} }
interface ShortcutsArray { interface Shortcuts {
[action: string]: string | undefined | null; [action: string]: string | undefined | null;
toggleBlockquote?: string | null; toggleBlockquote?: string | null;
toggleBold?: string | null; toggleBold?: string | null;
@ -69,7 +90,7 @@ declare namespace EasyMDE {
blockStyles?: BlockStyleOptions; blockStyles?: BlockStyleOptions;
element?: HTMLElement; element?: HTMLElement;
forceSync?: boolean; forceSync?: boolean;
hideIcons?: string[]; hideIcons?: ReadonlyArray<string>;
indentWithTabs?: boolean; indentWithTabs?: boolean;
initialValue?: string; initialValue?: string;
insertTexts?: InsertTextOptions; insertTexts?: InsertTextOptions;
@ -79,13 +100,13 @@ declare namespace EasyMDE {
previewRender?: (markdownPlaintext: string, previewElement: HTMLElement) => string; previewRender?: (markdownPlaintext: string, previewElement: HTMLElement) => string;
promptURLs?: boolean; promptURLs?: boolean;
renderingConfig?: RenderingOptions; renderingConfig?: RenderingOptions;
shortcuts?: ShortcutsArray; shortcuts?: Shortcuts;
showIcons?: string[]; showIcons?: ReadonlyArray<string>;
spellChecker?: boolean; spellChecker?: boolean;
status?: boolean|Array<string|StatusBarItem>; status?: boolean|ReadonlyArray<string|StatusBarItem>;
styleSelectedText?: boolean; styleSelectedText?: boolean;
tabSize?: number; tabSize?: number;
toolbar?: boolean|Array<string|ToolbarIcon>; toolbar?: boolean|ReadonlyArray<string|ToolbarIcon>;
toolbarTips?: boolean; toolbarTips?: boolean;
} }
} }

Loading…
Cancel
Save