-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: create typescript declaration files
- Loading branch information
Showing
8 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/// <reference path="typings/svgjs.d.ts" /> | ||
import { EventBase } from './lib/util/EventBase'; | ||
export declare enum Categories { | ||
'sign&symptom' = 1, | ||
'diagnosis' = 2, | ||
'assessment' = 3, | ||
'treatment' = 4, | ||
"index" = 5, | ||
"drug" = 6, | ||
"body location" = 7, | ||
"frequency" = 8, | ||
"value" = 9, | ||
"change" = 10, | ||
"modifier" = 11, | ||
"time" = 12, | ||
} | ||
export declare class Annotator extends EventBase { | ||
svg: any; | ||
group: {}; | ||
lines: {}; | ||
category: { | ||
id: number; | ||
fill: string; | ||
boader: string; | ||
highlight: string; | ||
text: string; | ||
}[]; | ||
lcategory: { | ||
id: number; | ||
text: string; | ||
}[]; | ||
labelsSVG: any[]; | ||
linkable: boolean; | ||
underscorable: boolean; | ||
progress: number; | ||
visible: { | ||
'relation': boolean; | ||
'highlight': boolean; | ||
'label': boolean; | ||
}; | ||
private state; | ||
private style; | ||
private puncLen; | ||
private renderPerLines; | ||
private draw; | ||
private raw; | ||
private label_line_map; | ||
private labels; | ||
private background; | ||
private baseTop; | ||
private baseLeft; | ||
private maxWidth; | ||
private selectionCallback; | ||
constructor(container: any, width?: number, height?: number); | ||
private init(); | ||
private clear(); | ||
import(raw: String, labels: any, relations: any): void; | ||
stringify(): void; | ||
enableSelection(): void; | ||
disableSelection(): void; | ||
setVisiblity(component: string, visible: boolean): void; | ||
exportPNG(scale?: number): void; | ||
resize(width: any, height: any): void; | ||
private render(startAt); | ||
private selectionEventHandler(); | ||
private selectionParagraphEventHandler(); | ||
private posInLine(x, y); | ||
private requestAnimeFrame(callback); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/// <reference path="../typings/svgjs.d.ts" /> | ||
export declare class Draw { | ||
private board; | ||
private margin; | ||
private lineHeight; | ||
private shoulder; | ||
private needExtend; | ||
private style_user_select_none; | ||
constructor(board: any); | ||
highlight(selector: any, color?: string): any; | ||
textline(lineNo: any, content: any, left: any, top: any): any; | ||
annotation(id: any, cid: any, selector: any): void; | ||
label(id: any, cid: any, selector: any): void; | ||
relation(srcId: any, dstId: any, text?: string): void; | ||
underscore(paragraph: any): void; | ||
bracket(cid: any, x1: any, y1: any, x2: any, y2: any, width: any, q?: number): any; | ||
private moveLineRight(lineNo, padding); | ||
private extendAnnotationLine(lineNo, type); | ||
private underscoreLine(lineNo, start, end); | ||
private calcAnnotationTop(text, selector); | ||
private calcRelationTop(lineNo, width, height, top, left); | ||
private isCollisionInLine(lineNo, width, height, left, top); | ||
private isCollision(x1, y1, w1, h1, x2, y2, w2, h2); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export declare class Label { | ||
id: any; | ||
category: any; | ||
pos: number[]; | ||
lineNo: any; | ||
constructor(id: any, category: any, pos: any); | ||
isTruncate(pos: any): boolean; | ||
} | ||
export declare class LabelContainer { | ||
private labels; | ||
private lineMap; | ||
create(id: any, category: any, pos: any): void; | ||
push(label: Label): void; | ||
get(id: any): any; | ||
readonly length: number; | ||
gen(label: any): any[]; | ||
private insert(target); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/// <reference path="../../typings/svgjs.d.ts" /> | ||
export declare class Line { | ||
svg: any; | ||
constructor(id: any, width: any, height: any); | ||
group(): void; | ||
extend(lineNo: any): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export declare class Paragraph { | ||
startLine: any; | ||
endLine: any; | ||
startOffset: any; | ||
endOffset: any; | ||
startPos: any; | ||
endPos: any; | ||
private context; | ||
constructor(context: any, startLine: any, startOffset: any, endLine: any, endOffset: any); | ||
calcPos(lineNo: any, offset: any): number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export declare class EventBase { | ||
private listeners; | ||
emit(event: string, args?: any): boolean; | ||
on(event: string, listener: (target: EventBase, args?: any) => any): number; | ||
private off(event); | ||
offById(event: string, id: number): void; | ||
offAll(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/// <reference path="../../typings/svgjs.d.ts" /> | ||
export declare class TextSelector { | ||
static rect(): { | ||
width: number; | ||
height: number; | ||
left: number; | ||
top: number; | ||
}; | ||
static lineNo(): number; | ||
static init(): { | ||
startOffset: number; | ||
endOffset: number; | ||
startNode: Node; | ||
endNode: Node; | ||
tspan: SVGTextContentElement; | ||
}; | ||
static paragraph(): { | ||
startOffset: number; | ||
endOffset: number; | ||
startLineNo: number; | ||
endLineNo: number; | ||
}; | ||
} | ||
export declare class SelectorDummyException extends Error { | ||
constructor(message: any); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export declare class Util { | ||
static height(node: any): any; | ||
static width(node: any): any; | ||
static top(node: any): any; | ||
static left(node: any): any; | ||
} |