mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
a bit more definitions for jsPlumb. Still, this file miss a lot of definitions from jsPlumb
This commit is contained in:
41
jsplumb/jquery.jsPlumb.d.ts
vendored
41
jsplumb/jquery.jsPlumb.d.ts
vendored
@@ -5,7 +5,9 @@
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
interface jsPlumb {
|
||||
declare var jsPlumb: jsPlumbInstance;
|
||||
|
||||
interface jsPlumbInstance {
|
||||
setRenderMode(renderMode: string): string;
|
||||
bind(event: string, callback: (e) => void ): void;
|
||||
unbind(event?: string): void;
|
||||
@@ -17,16 +19,26 @@ interface jsPlumb {
|
||||
addEndpoint(ep: string): any;
|
||||
removeClass(el: any, clazz: string): void;
|
||||
hasClass(el: any, clazz: string): void;
|
||||
draggable(el: any, container?: DragContainer): void;
|
||||
connect(connection: ConnectParams): void;
|
||||
draggable(el: string, options?: DragOptions): jsPlumbInstance;
|
||||
draggable(ids: string[], options?: DragOptions): jsPlumbInstance;
|
||||
connect(connection: ConnectParams, referenceParams?: ConnectParams): Connection;
|
||||
makeSource(el: string, options: SourceOptions): void;
|
||||
makeTarget(el: string, options: TargetOptions): void;
|
||||
repaintEverything(): void;
|
||||
detachEveryConnection(): void;
|
||||
detachAllConnections(el: string): void;
|
||||
removeAllEndpoints(el: any): void;
|
||||
removeAllEndpoints(el: string, recurse?: boolean): jsPlumbInstance;
|
||||
removeAllEndpoints(el: Element, recurse?: boolean): jsPlumbInstance;
|
||||
select(params: SelectParams): Connections;
|
||||
getConnections(options?: any, flat?: any): any[];
|
||||
getConnections(options?: any, flat?: any): any[];
|
||||
deleteEndpoint(uuid: string, doNotRepaintAfterwards?: boolean): jsPlumbInstance;
|
||||
deleteEndpoint(endpoint: Endpoint, doNotRepaintAfterwards?: boolean): jsPlumbInstance;
|
||||
repaint(el: string): jsPlumbInstance;
|
||||
repaint(el: Element): jsPlumbInstance;
|
||||
|
||||
SVG: string;
|
||||
CANVAS: string;
|
||||
VML: string;
|
||||
}
|
||||
|
||||
interface Defaults {
|
||||
@@ -36,6 +48,8 @@ interface Defaults {
|
||||
ConnectionsDetachable?: boolean;
|
||||
ReattachConnections?: boolean;
|
||||
ConnectionOverlays?: any[][];
|
||||
Container?: any; // string(selector or id) or element
|
||||
DragOptions?: DragOptions;
|
||||
}
|
||||
|
||||
interface PaintStyle {
|
||||
@@ -62,8 +76,8 @@ interface Connections {
|
||||
}
|
||||
|
||||
interface ConnectParams {
|
||||
source: string;
|
||||
target: string;
|
||||
source?: any; // string, element or endpoint
|
||||
target?: any; // string, element or endpoint
|
||||
detachable?: boolean;
|
||||
deleteEndpointsOnDetach?: boolean;
|
||||
endPoint?: string;
|
||||
@@ -72,8 +86,8 @@ interface ConnectParams {
|
||||
label?: string;
|
||||
}
|
||||
|
||||
interface DragContainer {
|
||||
containment: string;
|
||||
interface DragOptions {
|
||||
containment?: string;
|
||||
}
|
||||
|
||||
interface SourceOptions {
|
||||
@@ -103,3 +117,12 @@ interface SelectParams {
|
||||
source: string;
|
||||
target: string;
|
||||
}
|
||||
|
||||
interface Connection {
|
||||
setDetachable(detachable: boolean): void;
|
||||
setParameter<T>(name: string, value: T): void;
|
||||
endpoints: Endpoint[];
|
||||
}
|
||||
|
||||
interface Endpoint {
|
||||
}
|
||||
Reference in New Issue
Block a user