Skip to content

Commit 579fbd9

Browse files
committed
add typescript definition file
1 parent e2bdedc commit 579fbd9

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

index.d.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
type ConfigOptions = {
2+
quoteMarkdown?: boolean,
3+
copyMarkdown?: boolean,
4+
scopeSelector?: string
5+
}
6+
7+
interface Subscription {
8+
unsubscribe: () => void
9+
}
10+
11+
export function install(container: Element, options?: ConfigOptions): void;
12+
export function uninstall(container: Element): void;
13+
export function subscribe(container: Element, options?: ConfigOptions): Subscription;
14+
export function findContainer(el: Element): Element | undefined;
15+
export function findTextarea(container: Element): HTMLTextAreaElement | undefined;
16+
export function quote(text: string, range: Range): boolean;

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
"version": "0.8.2",
55
"main": "dist/quote-selection.umd.js",
66
"module": "dist/quote-selection.esm.js",
7+
"types": "index.d.ts",
78
"license": "MIT",
89
"repository": "github/quote-selection",
910
"files": [
10-
"dist"
11+
"dist",
12+
"index.d.ts"
1113
],
1214
"scripts": {
1315
"clean": "rm -rf dist",

0 commit comments

Comments
 (0)