-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69537ed
commit 491218a
Showing
64 changed files
with
3,970 additions
and
1,689 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,46 +1,81 @@ | ||
import { Pt, Group } from "./Pt"; | ||
import { UIHandler } from "./Types"; | ||
export declare enum UIShape { | ||
Rectangle = 0, | ||
Circle = 1, | ||
Polygon = 2, | ||
Polyline = 3, | ||
Line = 4 | ||
} | ||
import { Group } from "./Pt"; | ||
import { UIHandler, GroupLike, PtLike } from "./Types"; | ||
export declare const UIShape: { | ||
rectangle: string; | ||
circle: string; | ||
polygon: string; | ||
polyline: string; | ||
line: string; | ||
}; | ||
export declare const UIPointerActions: { | ||
up: string; | ||
down: string; | ||
move: string; | ||
drag: string; | ||
uidrag: string; | ||
drop: string; | ||
over: string; | ||
out: string; | ||
enter: string; | ||
leave: string; | ||
all: string; | ||
}; | ||
export declare class UI { | ||
group: Group; | ||
shape: UIShape; | ||
_group: Group; | ||
_shape: string; | ||
protected static _counter: number; | ||
protected _id: string; | ||
protected _actions: { | ||
[key: string]: UIHandler; | ||
[key: string]: UIHandler[]; | ||
}; | ||
protected _states: { | ||
[key: string]: any; | ||
}; | ||
constructor(group: Group, shape: UIShape, states: {}, id?: string); | ||
protected _holds: string[]; | ||
constructor(group: GroupLike, shape: string, states?: { | ||
[key: string]: any; | ||
}, id?: string); | ||
static fromRectangle(group: GroupLike, states: {}, id?: string): UI; | ||
static fromCircle(group: GroupLike, states: {}, id?: string): UI; | ||
static fromPolygon(group: GroupLike, states: {}, id?: string): UI; | ||
static fromUI(ui: UI, states?: object, id?: string): UI; | ||
id: string; | ||
state(key: string): any; | ||
on(key: string, fn: UIHandler): this; | ||
off(key: string): this; | ||
listen(key: string, p: Pt): boolean; | ||
group: Group; | ||
shape: string; | ||
state(key: string, value?: any): any; | ||
on(key: string, fn: UIHandler): number; | ||
off(key: string, which?: number): boolean; | ||
listen(key: string, p: PtLike): boolean; | ||
protected hold(key: string): number; | ||
protected unhold(id?: number): void; | ||
static track(uis: UI[], key: string, p: PtLike): void; | ||
render(fn: (group: Group, states: { | ||
[key: string]: any; | ||
}) => void): void; | ||
protected _trigger(p: Pt): boolean; | ||
toString(): string; | ||
protected _within(p: PtLike): boolean; | ||
protected static _trigger(fns: UIHandler[], target: UI, pt: PtLike, type: string): void; | ||
protected static _addHandler(fns: UIHandler[], fn: UIHandler): number; | ||
protected static _removeHandler(fns: UIHandler[], index: number): boolean; | ||
} | ||
export declare class UIButton extends UI { | ||
_clicks: number; | ||
constructor(group: Group, shape: UIShape, states: {}, id?: string); | ||
readonly clicks: number; | ||
onClick(fn: UIHandler): void; | ||
onHover(over: UIHandler, out: UIHandler): void; | ||
private _hoverID; | ||
constructor(group: GroupLike, shape: string, states?: { | ||
[key: string]: any; | ||
}, id?: string); | ||
onClick(fn: UIHandler): number; | ||
offClick(id: number): boolean; | ||
onHover(enter?: UIHandler, leave?: UIHandler): number[]; | ||
offHover(enterID?: number, leaveID?: number): boolean[]; | ||
} | ||
export declare class UIDragger extends UIButton { | ||
private _draggingID; | ||
private _moveHoldID; | ||
constructor(group: GroupLike, shape: string, states?: { | ||
[key: string]: any; | ||
}, id?: string); | ||
onDrag(fn: UIHandler): number; | ||
offDrag(id: number): boolean; | ||
onDrop(fn: UIHandler): number; | ||
offDrop(id: number): boolean; | ||
} |
Oops, something went wrong.