From ce4171a3b724df18ee581f35720e6e8bf2c085cf Mon Sep 17 00:00:00 2001 From: Franklin Tse Date: Wed, 16 Jan 2019 22:07:52 +0800 Subject: [PATCH] Add license, use ReadonlyArray --- types/easymde.d.ts | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/types/easymde.d.ts b/types/easymde.d.ts index 423f7dd..efe951c 100644 --- a/types/easymde.d.ts +++ b/types/easymde.d.ts @@ -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 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. + /// declare namespace EasyMDE { @@ -14,10 +35,10 @@ declare namespace EasyMDE { } interface InsertTextOptions { - horizontalRule?: string[]; - image?: string[]; - link?: string[]; - table?: string[]; + horizontalRule?: ReadonlyArray; + image?: ReadonlyArray; + link?: ReadonlyArray; + table?: ReadonlyArray; } interface ParsingOptions { @@ -31,7 +52,7 @@ declare namespace EasyMDE { codeSyntaxHighlighting: boolean; } - interface ShortcutsArray { + interface Shortcuts { [action: string]: string | undefined | null; toggleBlockquote?: string | null; toggleBold?: string | null; @@ -69,7 +90,7 @@ declare namespace EasyMDE { blockStyles?: BlockStyleOptions; element?: HTMLElement; forceSync?: boolean; - hideIcons?: string[]; + hideIcons?: ReadonlyArray; indentWithTabs?: boolean; initialValue?: string; insertTexts?: InsertTextOptions; @@ -79,13 +100,13 @@ declare namespace EasyMDE { previewRender?: (markdownPlaintext: string, previewElement: HTMLElement) => string; promptURLs?: boolean; renderingConfig?: RenderingOptions; - shortcuts?: ShortcutsArray; - showIcons?: string[]; + shortcuts?: Shortcuts; + showIcons?: ReadonlyArray; spellChecker?: boolean; - status?: boolean|Array; + status?: boolean|ReadonlyArray; styleSelectedText?: boolean; tabSize?: number; - toolbar?: boolean|Array; + toolbar?: boolean|ReadonlyArray; toolbarTips?: boolean; } }