Skip to content

Commit

Permalink
add typescript definition file
Browse files Browse the repository at this point in the history
  • Loading branch information
koddsson committed Sep 11, 2019
1 parent e2bdedc commit 579fbd9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
type ConfigOptions = {
quoteMarkdown?: boolean,
copyMarkdown?: boolean,
scopeSelector?: string
}

interface Subscription {
unsubscribe: () => void
}

export function install(container: Element, options?: ConfigOptions): void;
export function uninstall(container: Element): void;
export function subscribe(container: Element, options?: ConfigOptions): Subscription;
export function findContainer(el: Element): Element | undefined;
export function findTextarea(container: Element): HTMLTextAreaElement | undefined;
export function quote(text: string, range: Range): boolean;
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
"version": "0.8.2",
"main": "dist/quote-selection.umd.js",
"module": "dist/quote-selection.esm.js",
"types": "index.d.ts",
"license": "MIT",
"repository": "github/quote-selection",
"files": [
"dist"
"dist",
"index.d.ts"
],
"scripts": {
"clean": "rm -rf dist",
Expand Down

0 comments on commit 579fbd9

Please sign in to comment.