From 39be8239d23e88fa71c8f35f155f7eb035be6fc3 Mon Sep 17 00:00:00 2001 From: Steve Shearn Date: Sun, 7 Apr 2013 17:35:11 +1000 Subject: [PATCH 1/2] Added overload for modal so can use backdrop: "static" --- bootstrap/bootstrap.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bootstrap/bootstrap.d.ts b/bootstrap/bootstrap.d.ts index 3247b6a7d3..c06c08f89e 100644 --- a/bootstrap/bootstrap.d.ts +++ b/bootstrap/bootstrap.d.ts @@ -13,6 +13,13 @@ interface ModalOptions { remote?: string; } +interface ModalOptionsBackdropString { + backdrop?: string; // for "static" + keyboard?: bool; + show?: bool; + remote?: string; +} + interface ScrollSpyOptions { offset?: number; } @@ -63,6 +70,7 @@ interface AffixOptions { interface JQuery { modal(options?: ModalOptions): JQuery; + modal(options?: ModalOptionsBackdropString): JQuery; modal(command: string): JQuery; dropdown(): JQuery; From c6c2a7434c4dfc33954ae64397da466f7c630f99 Mon Sep 17 00:00:00 2001 From: Steve Shearn Date: Sun, 7 Apr 2013 17:39:26 +1000 Subject: [PATCH 2/2] Added type basic definitions for jsPlumb. --- jsplumb/jquery.jsPlumb.d.ts | 103 ++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 jsplumb/jquery.jsPlumb.d.ts diff --git a/jsplumb/jquery.jsPlumb.d.ts b/jsplumb/jquery.jsPlumb.d.ts new file mode 100644 index 0000000000..ea55122fad --- /dev/null +++ b/jsplumb/jquery.jsPlumb.d.ts @@ -0,0 +1,103 @@ +// Type definitions for jsPlumb 1.3.16 jQuery adapter. +// Project: http://jsplumb.org +// https://github.com/sporritt/jsplumb +// https://code.google.com/p/jsplumb +// +// Definitions by: Steve Shearn + +/// + +interface jsPlumb { + setRenderMode(renderMode: string): string; + bind(event: string, callback: (e) => void ): void; + unbind(event?: string): void; + ready(callback: () => void): void; + importDefaults(defaults: Defaults): void;// + restoreDefaults(): void; + addClass(el: any, clazz: string): void; + 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; + makeSource(el: string, options: SourceOptions): void; + makeTarget(el: string, options: TargetOptions): void; + repaintEverything(): void; + detachEveryConnection(): void; + detachAllConnections(el: string): void; + select(params: SelectParams): Connections; +} + +interface Defaults { + Endpoint?: any[]; + HoverPaintStyle?: PaintStyle; + ConnectionsDetachable?: bool; + ReattachConnections?: bool; + ConnectionOverlays?: any[][]; +} + +interface PaintStyle { + strokeStyle: string; + lineWidth: number; +} + +interface ArrowOverlay { + location: number; + id: string; + length: number; + foldback: number; +} + +interface LabelOverlay { + label: string; + id: string; + location: number; +} + +interface Connections { + detach(): void; + length: number; +} + +interface ConnectParams { + source: string; + target: string; + detachable?: bool; + deleteEndpointsOnDetach?: bool; + endPoint?: string; + anchor?: string; + anchors?: any[]; + label?: string; +} + +interface DragContainer { + containment: string; +} + +interface SourceOptions { + parent: string; + endpoint?: string; + anchor?: string; + connector?: any[]; + connectorStyle?: PaintStyle; +} + +interface TargetOptions { + isTarget?: bool; + maxConnections?: number; + uniqueEndpoint?: bool; + deleteEndpointsOnDetach?: bool; + endpoint?: string; + dropOptions?: DropOptions; + anchor?: any; +} + +interface DropOptions { + hoverClass: string; +} + +interface SelectParams { + scope?: string; + source: string; + target: string; +} \ No newline at end of file