From 4fd9b8f2b5a98bfcde57970b48fed2488a80f356 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 17 Sep 2021 21:53:37 +0300 Subject: add in master snapshot of epubjs --- lib/epub.js/types/annotations.d.ts | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 lib/epub.js/types/annotations.d.ts (limited to 'lib/epub.js/types/annotations.d.ts') diff --git a/lib/epub.js/types/annotations.d.ts b/lib/epub.js/types/annotations.d.ts new file mode 100644 index 0000000..718319d --- /dev/null +++ b/lib/epub.js/types/annotations.d.ts @@ -0,0 +1,53 @@ +import Rendition from "./rendition"; +import View from "./managers/view"; + +export default class Annotations { + constructor(rendition: Rendition); + + add(type: string, cfiRange: string, data?: object, cb?: Function, className?: string, styles?: object): Annotation; + + remove(cfiRange: string, type: string): void; + + highlight(cfiRange: string, data?: object, cb?: Function, className?: string, styles?: object): void; + + underline(cfiRange: string, data?: object, cb?: Function, className?: string, styles?: object): void; + + mark(cfiRange: string, data?: object, cb?: Function): void; + + each(): Array + + private _removeFromAnnotationBySectionIndex(sectionIndex: number, hash: string): void; + + private _annotationsAt(index: number): void; + + private inject(view: View): void; + + private clear(view: View): void; +} + +declare class Annotation { + constructor(options: { + type: string, + cfiRange: string, + data?: object, + sectionIndex?: number, + cb?: Function, + className?: string, + styles?: object + }); + + update(data: object): void; + + attach(view: View): any; + + detach(view: View): any; + + // Event emitters + emit(type: any, ...args: any[]): void; + + off(type: any, listener: any): any; + + on(type: any, listener: any): any; + + once(type: any, listener: any, ...args: any[]): any; +} -- cgit v1.2.3