diff --git a/bluebird-global/index.d.ts b/bluebird-global/index.d.ts index e4c4920501..a705222e9d 100644 --- a/bluebird-global/index.d.ts +++ b/bluebird-global/index.d.ts @@ -80,6 +80,8 @@ declare global { // then: typeof Bluebird.prototype.then; thenReturn: typeof Bluebird.prototype.thenReturn; thenThrow: typeof Bluebird.prototype.thenThrow; + catchReturn: typeof Bluebird.prototype.catchReturn; + catchThrow: typeof Bluebird.prototype.catchThrow; throw: typeof Bluebird.prototype.throw; timeout: typeof Bluebird.prototype.timeout; toJSON: typeof Bluebird.prototype.toJSON; diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index c08a7bdc6b..b9fc8d0cef 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -506,6 +506,15 @@ fooProm = fooProm.thenThrow(err); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +barProm = fooProm.catchReturn(bar); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +// fooProm +fooProm = fooProm.catchThrow(err); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + str = fooProm.toString(); obj = fooProm.toJSON(); diff --git a/bluebird/index.d.ts b/bluebird/index.d.ts index ecacedfd0d..3508a4e742 100644 --- a/bluebird/index.d.ts +++ b/bluebird/index.d.ts @@ -248,6 +248,37 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection; thenThrow(reason: Error): Bluebird; + /** + * Convenience method for: + * + * + * .catch(function() { + * return value; + * }); + * + * + * in the case where `value` doesn't change its value. That means `value` is bound at the time of calling `.catchReturn()` + */ + catchReturn(value: U): Bluebird; + catchReturn(predicate: (error: any) => boolean, value: U): Bluebird; + catchReturn(ErrorClass: new (...args: any[]) => E, value: U): Bluebird; + catchReturn(predicate: Object, value: U): Bluebird; + + /** + * Convenience method for: + * + * + * .catch(function() { + * throw reason; + * }); + * + * Same limitations apply as with `.catchReturn()`. + */ + catchThrow(reason: Error): Bluebird; + catchThrow(predicate: (error: any) => boolean, reason: Error): Bluebird; + catchThrow(ErrorClass: new (...args: any[]) => E, reason: Error): Bluebird; + catchThrow(predicate: Object, reason: Error): Bluebird; + /** * Convert to String. */ diff --git a/enzyme/enzyme-tests.tsx b/enzyme/enzyme-tests.tsx index 82a8dc9822..c7323766f7 100644 --- a/enzyme/enzyme-tests.tsx +++ b/enzyme/enzyme-tests.tsx @@ -37,6 +37,13 @@ namespace ShallowWrapperTest { elementWrapper: ShallowWrapper, {}>, statelessWrapper: ShallowWrapper; + function test_props_state_inferring() { + let wrapper: ShallowWrapper; + wrapper = shallow(); + wrapper.state().stateProperty; + wrapper.props().stringProp.toUpperCase(); + } + function test_shallow_options() { shallow(, { context: { @@ -337,6 +344,13 @@ namespace ReactWrapperTest { elementWrapper: ReactWrapper, {}>, statelessWrapper: ReactWrapper; + function test_prop_state_inferring() { + let wrapper: ReactWrapper; + wrapper = mount(); + wrapper.state().stateProperty; + wrapper.props().stringProp.toUpperCase(); + } + function test_unmount() { reactWrapper = reactWrapper.unmount(); } diff --git a/enzyme/index.d.ts b/enzyme/index.d.ts index fc498ca78a..abb57e36ef 100644 --- a/enzyme/index.d.ts +++ b/enzyme/index.d.ts @@ -546,6 +546,7 @@ export interface MountRendererProps { * @param node * @param [options] */ +export function shallow

(node: ReactElement

, options?: ShallowRendererProps): ShallowWrapper; export function shallow(node: ReactElement

, options?: ShallowRendererProps): ShallowWrapper; /** @@ -553,6 +554,7 @@ export function shallow(node: ReactElement

, options?: ShallowRendererPr * @param node * @param [options] */ +export function mount

(node: ReactElement

, options?: MountRendererProps): ReactWrapper; export function mount(node: ReactElement

, options?: MountRendererProps): ReactWrapper; /** diff --git a/jointjs/index.d.ts b/jointjs/index.d.ts index 95e2b2b7e3..5ce0f187f0 100644 --- a/jointjs/index.d.ts +++ b/jointjs/index.d.ts @@ -6,891 +6,892 @@ /// +import * as Backbone from "backbone"; -declare namespace joint { - export var g: any; - export var V: any; +export as namespace joint; - namespace dia { - interface Size { - width: number; - height: number; - } +export var g: any; +export var V: any; - interface Point { - x: number; - y: number; - } +export namespace dia { + interface Size { + width: number; + height: number; + } - interface BBox extends Point, Size { } + interface Point { + x: number; + y: number; + } - interface TranslateOptions { - restrictedArea?: BBox; - transition?: TransitionOptions; - } + interface BBox extends Point, Size { } - interface TransitionOptions { - delay?: number; - duration?: number; - timingFunction?: (t: number) => number; - valueFunction?: (a: any, b: any) => (t: number) => any; - } + interface TranslateOptions { + restrictedArea?: BBox; + transition?: TransitionOptions; + } - interface DfsBfsOptions { - inbound?: boolean; - outbound?: boolean; - deep?: boolean; - } + interface TransitionOptions { + delay?: number; + duration?: number; + timingFunction?: (t: number) => number; + valueFunction?: (a: any, b: any) => (t: number) => any; + } - interface ExploreOptions { - breadthFirst?: boolean; - deep?: boolean; - } + interface DfsBfsOptions { + inbound?: boolean; + outbound?: boolean; + deep?: boolean; + } - class Graph extends Backbone.Model { - constructor(attributes?: any, options?: { cellNamespace: any }); - addCell(cell: Cell | Cell[]): this; - addCells(cells: Cell[]): this; - resetCells(cells: Cell[], options?: any): this; - getCell(id: string): Cell; - getElements(): Element[]; - getLinks(): Link[]; - getCells(): Cell[]; - getFirstCell(): Cell; - getLastCell(): Cell; - getConnectedLinks(element: Cell, options?: { inbound?: boolean, outbound?: boolean, deep?: boolean }): Link[]; - disconnectLinks(cell: Cell, options?: any): void; - removeLinks(cell: Cell, options?: any): void; - translate(tx: number, ty?: number, options?: TranslateOptions): void; - cloneCells(cells: Cell[]): { [id: string]: Cell }; - getSubgraph(cells: Cell[], options?: { deep?: boolean }): Cell[]; - cloneSubgraph(cells: Cell[], options?: { deep?: boolean }): { [id: string]: Cell }; - dfs(element: Element, iteratee: (element: Element, distance: number) => boolean, options?: DfsBfsOptions, visited?: Object, distance?: number): void; - bfs(element: Element, iteratee: (element: Element, distance: number) => boolean, options?: DfsBfsOptions): void; - search(element: Element, iteratee: (element: Element, distance: number) => boolean, options?: { breadthFirst?: boolean }): void; - getSuccessors(element: Element, options?: ExploreOptions): Element[]; - getPredecessors(element: Element, options?: ExploreOptions): Element[]; - isSuccessor(elementA: Element, elementB: Element): boolean; - isPredecessor(elementA: Element, elementB: Element): boolean; - isSource(element: Element): boolean; - isSink(element: Element): boolean; - getSources(): Element[]; - getSinks(): Element[]; - getNeighbors(element: Element, options?: DfsBfsOptions): Element[]; - isNeighbor(elementA: Element, elementB: Element, options?: { inbound?: boolean, outbound?: boolean; }): boolean; - getCommonAncestor(...cells: Cell[]): Element; - toJSON(): any; - fromJSON(json: any, options?: any): this; - clear(options?: any): this; - findModelsFromPoint(rect: BBox): Element[]; - findModelsUnderElement(element: Element, options?: { searchBy?: 'bbox' | 'center' | 'origin' | 'corner' | 'topRight' | 'bottomLeft' }): Element[]; - getBBox(elements: Element[], options?: any): BBox; - toGraphLib(): any; // graphlib graph object - findModelsInArea(rect: BBox, options?: any): BBox | boolean; - getCellsBBox(cells: Cell[], options?: any): BBox; - getInboundEdges(node: string): Object; - getOutboundEdges(node: string): Object; - hasActiveBatch(name?: string): number | boolean; - maxZIndex(): number; - removeCells(cells: Cell[], options?: any): this; - resize(width: number, height: number, options?: number): this; - resizeCells(width: number, height: number, cells: Cell[], options?: number): this; - set(key: Object | string, value: any, options?: any): this; - startBatch(name: string, data?: Object): any; - stopBatch(name: string, data?: Object): any; - } + interface ExploreOptions { + breadthFirst?: boolean; + deep?: boolean; + } - class Cell extends Backbone.Model { - id: string; - toJSON(): any; - remove(options?: { disconnectLinks?: boolean }): this; - toFront(options?: { deep?: boolean }): this; - toBack(options?: { deep?: boolean }): this; - getAncestors(): Cell[]; - isEmbeddedIn(element: Element, options?: { deep: boolean }): boolean; - prop(key: string): any; - prop(object: any): this; - prop(key: string, value: any, options?: any): this; - removeProp(path: string, options?: any): this; - attr(key: string): any; - attr(object: SVGAttributes): this; - attr(key: string, value: any): this; - clone(): Cell; - clone(opt: { deep?: boolean }): Cell | Cell[]; - removeAttr(path: string | string[], options?: any): this; - transition(path: string, value?: any, options?: TransitionOptions, delim?: string): number; - getTransitions(): string[]; - stopTransitions(path?: string, delim?: string): this; - addTo(graph: Graph, options?: any): this; - isLink(): boolean; - embed(cell: Cell, options?: any): this; - findView(paper: Paper): CellView; - getEmbeddedCells(options?: any): Cell[]; - initialize(options?: any): void; - isElement(): boolean; - isEmbedded(): boolean; - processPorts(): void; - startBatch(name: string, options?: any): this; - stopBatch(name: string, options?: any): this; - unembed(cell: Cell, options?: any): this; - } + class Graph extends Backbone.Model { + constructor(attributes?: any, options?: { cellNamespace: any }); + addCell(cell: Cell | Cell[]): this; + addCells(cells: Cell[]): this; + resetCells(cells: Cell[], options?: any): this; + getCell(id: string): Cell; + getElements(): Element[]; + getLinks(): Link[]; + getCells(): Cell[]; + getFirstCell(): Cell; + getLastCell(): Cell; + getConnectedLinks(element: Cell, options?: { inbound?: boolean, outbound?: boolean, deep?: boolean }): Link[]; + disconnectLinks(cell: Cell, options?: any): void; + removeLinks(cell: Cell, options?: any): void; + translate(tx: number, ty?: number, options?: TranslateOptions): void; + cloneCells(cells: Cell[]): { [id: string]: Cell }; + getSubgraph(cells: Cell[], options?: { deep?: boolean }): Cell[]; + cloneSubgraph(cells: Cell[], options?: { deep?: boolean }): { [id: string]: Cell }; + dfs(element: Element, iteratee: (element: Element, distance: number) => boolean, options?: DfsBfsOptions, visited?: Object, distance?: number): void; + bfs(element: Element, iteratee: (element: Element, distance: number) => boolean, options?: DfsBfsOptions): void; + search(element: Element, iteratee: (element: Element, distance: number) => boolean, options?: { breadthFirst?: boolean }): void; + getSuccessors(element: Element, options?: ExploreOptions): Element[]; + getPredecessors(element: Element, options?: ExploreOptions): Element[]; + isSuccessor(elementA: Element, elementB: Element): boolean; + isPredecessor(elementA: Element, elementB: Element): boolean; + isSource(element: Element): boolean; + isSink(element: Element): boolean; + getSources(): Element[]; + getSinks(): Element[]; + getNeighbors(element: Element, options?: DfsBfsOptions): Element[]; + isNeighbor(elementA: Element, elementB: Element, options?: { inbound?: boolean, outbound?: boolean; }): boolean; + getCommonAncestor(...cells: Cell[]): Element; + toJSON(): any; + fromJSON(json: any, options?: any): this; + clear(options?: any): this; + findModelsFromPoint(rect: BBox): Element[]; + findModelsUnderElement(element: Element, options?: { searchBy?: 'bbox' | 'center' | 'origin' | 'corner' | 'topRight' | 'bottomLeft' }): Element[]; + getBBox(elements: Element[], options?: any): BBox; + toGraphLib(): any; // graphlib graph object + findModelsInArea(rect: BBox, options?: any): BBox | boolean; + getCellsBBox(cells: Cell[], options?: any): BBox; + getInboundEdges(node: string): Object; + getOutboundEdges(node: string): Object; + hasActiveBatch(name?: string): number | boolean; + maxZIndex(): number; + removeCells(cells: Cell[], options?: any): this; + resize(width: number, height: number, options?: number): this; + resizeCells(width: number, height: number, cells: Cell[], options?: number): this; + set(key: Object | string, value: any, options?: any): this; + startBatch(name: string, data?: Object): any; + stopBatch(name: string, data?: Object): any; + } - type Padding = number | { - top?: number; - right?: number; - bottom?: number; - left?: number - }; + class Cell extends Backbone.Model { + id: string; + toJSON(): any; + remove(options?: { disconnectLinks?: boolean }): this; + toFront(options?: { deep?: boolean }): this; + toBack(options?: { deep?: boolean }): this; + getAncestors(): Cell[]; + isEmbeddedIn(element: Element, options?: { deep: boolean }): boolean; + prop(key: string): any; + prop(object: any): this; + prop(key: string, value: any, options?: any): this; + removeProp(path: string, options?: any): this; + attr(key: string): any; + attr(object: SVGAttributes): this; + attr(key: string, value: any): this; + clone(): Cell; + clone(opt: { deep?: boolean }): Cell | Cell[]; + removeAttr(path: string | string[], options?: any): this; + transition(path: string, value?: any, options?: TransitionOptions, delim?: string): number; + getTransitions(): string[]; + stopTransitions(path?: string, delim?: string): this; + addTo(graph: Graph, options?: any): this; + isLink(): boolean; + embed(cell: Cell, options?: any): this; + findView(paper: Paper): CellView; + getEmbeddedCells(options?: any): Cell[]; + initialize(options?: any): void; + isElement(): boolean; + isEmbedded(): boolean; + processPorts(): void; + startBatch(name: string, options?: any): this; + stopBatch(name: string, options?: any): this; + unembed(cell: Cell, options?: any): this; + } - class Element extends Cell { - translate(tx: number, ty?: number, options?: TranslateOptions): this; - position(options?: { parentRelative: boolean }): Point; - position(x: number, y: number, options?: { parentRelative?: boolean }): this; - resize(width: number, height: number, options?: { direction?: 'left' | 'right' | 'top' | 'bottom' | 'top-right' | 'top-left' | 'bottom-left' | 'bottom-right' }): this; - rotate(deg: number, absolute?: boolean, origin?: Point): this; - embed(cell: Cell): this; - unembed(cell: Cell): this; - getEmbeddedCells(options?: ExploreOptions): Cell[]; - fitEmbeds(options?: { deep?: boolean, padding?: Padding }): this; - getBBox(options?: any): BBox; - findView(paper: Paper): ElementView; - isElement(): boolean; - scale(scaleX: number, scaleY: number, origin?: Point, options?: any): this; - addPort(port: any, opt?: any): this; - addPorts(ports: any[], opt?: any): this; - removePort(port: any, opt?: any): this; - hasPorts(): boolean; - hasPort(id: string): boolean; - getPorts(): any[]; - getPort(id: string): any; - getPortIndex(port: any): number; - portProp(portId: string, path: any, value?: any, opt?: any): joint.dia.Element; - } + type Padding = number | { + top?: number; + right?: number; + bottom?: number; + left?: number + }; - interface CSSSelector { - [key: string]: string | number | Object; // Object added to support special attributes like filter http://jointjs.com/api#SpecialAttributes:filter - } + class Element extends Cell { + translate(tx: number, ty?: number, options?: TranslateOptions): this; + position(options?: { parentRelative: boolean }): Point; + position(x: number, y: number, options?: { parentRelative?: boolean }): this; + resize(width: number, height: number, options?: { direction?: 'left' | 'right' | 'top' | 'bottom' | 'top-right' | 'top-left' | 'bottom-left' | 'bottom-right' }): this; + rotate(deg: number, absolute?: boolean, origin?: Point): this; + embed(cell: Cell): this; + unembed(cell: Cell): this; + getEmbeddedCells(options?: ExploreOptions): Cell[]; + fitEmbeds(options?: { deep?: boolean, padding?: Padding }): this; + getBBox(options?: any): BBox; + findView(paper: Paper): ElementView; + isElement(): boolean; + scale(scaleX: number, scaleY: number, origin?: Point, options?: any): this; + addPort(port: any, opt?: any): this; + addPorts(ports: any[], opt?: any): this; + removePort(port: any, opt?: any): this; + hasPorts(): boolean; + hasPort(id: string): boolean; + getPorts(): any[]; + getPort(id: string): any; + getPortIndex(port: any): number; + portProp(portId: string, path: any, value?: any, opt?: any): joint.dia.Element; + } - interface SVGAttributes { - [selector: string]: CSSSelector; - } + interface CSSSelector { + [key: string]: string | number | Object; // Object added to support special attributes like filter http://jointjs.com/api#SpecialAttributes:filter + } - interface CellAttributes { - [key: string]: any; - } + interface SVGAttributes { + [selector: string]: CSSSelector; + } - interface TextAttrs extends SVGAttributes { - text?: { - [key: string]: string | number; - text?: string; - }; - } + interface CellAttributes { + [key: string]: any; + } - interface Label { - position: number; - attrs?: TextAttrs; - } - interface LinkAttributes extends CellAttributes { - source?: Point | { id: string, selector?: string, port?: string }; - target?: Point | { id: string, selector?: string, port?: string }; - labels?: Label[]; - vertices?: Point[]; - smooth?: boolean; - attrs?: TextAttrs; - z?: number; - } - - class Link extends Cell { - markup: string; - labelMarkup: string; - toolMakup: string; - vertexMarkup: string; - arrowHeadMarkup: string; - - constructor(attributes?: LinkAttributes, options?: Object); - disconnect(): this; - label(index?: number): any; - label(index: number, value: Label): this; - reparent(options?: any): Element; - findView(paper: Paper): LinkView; - getSourceElement(): Element; - getTargetElement(): Element; - hasLoop(options?: { deep?: boolean }): boolean; - applyToPoints(fn: Function, options?: any): this; - getRelationshipAncestor(): Element; - isLink(): boolean; - isRelationshipEmbeddedIn(element: Element): boolean; - scale(sx: number, sy: number, origin: Point, optionts?: any): this; - translate(tx: number, ty: number, options?: any): this; - } - - interface ManhattanRouterArgs { - excludeTypes?: string[]; - excludeEnds?: 'source' | 'target'; - startDirections?: ['left' | 'right' | 'top' | 'bottom']; - endDirections?: ['left' | 'right' | 'top' | 'bottom']; - } - - interface PaperOptions extends Backbone.ViewOptions { - el?: string | JQuery | HTMLElement; - width?: number; - height?: number; - origin?: Point; - gridSize?: number; - perpendicularLinks?: boolean; - elementView?: (element: Element) => ElementView | ElementView; - linkView?: (link: Link) => LinkView | LinkView; - defaultLink?: ((cellView: CellView, magnet: SVGElement) => Link) | Link; - defaultRouter?: ((vertices: Point[], args: Object, linkView: LinkView) => Point[]) | { name: string, args?: ManhattanRouterArgs }; - defaultConnector?: ((sourcePoint: Point, targetPoint: Point, vertices: Point[], args: Object, linkView: LinkView) => string) | { name: string, args?: { radius?: number } }; - interactive?: ((cellView: CellView, event: string) => boolean) | boolean | { vertexAdd?: boolean, vertexMove?: boolean, vertexRemove?: boolean, arrowheadMove?: boolean }; - validateMagnet?: (cellView: CellView, magnet: SVGElement) => boolean; - validateConnection?: (cellViewS: CellView, magnetS: SVGElement, cellViewT: CellView, magnetT: SVGElement, end: 'source' | 'target', linkView: LinkView) => boolean; - linkConnectionPoint?: (linkView: LinkView, view: ElementView, magnet: SVGElement, reference: Point) => Point; - snapLinks?: boolean | { radius: number }; - linkPinning?: boolean; - markAvailable?: boolean; - async?: boolean | { batchZise: number }; - embeddingMode?: boolean; - validateEmbedding?: (childView: ElementView, parentView: ElementView) => boolean; - restrictTranslate?: ((elementView: ElementView) => BBox) | boolean; - guard?: (evt: Event, view: CellView) => boolean; - multiLinks?: boolean; - cellViewNamespace?: Object; - /** useful undocumented option */ - clickThreshold?: number; - highlighting?: any; - } - - interface ScaleContentOptions { - padding?: number; - preserveAspectRatio?: boolean; - minScale?: number; - minScaleX?: number; - minScaleY?: number; - maxScale?: number; - maxScaleX?: number; - maxScaleY?: number; - scaleGrid?: number; - fittingBBox?: BBox; - } - - interface FitToContentOptions { - gridWidth?: number; - gridHeight?: number; - padding?: Padding; - allowNewOrigin?: 'negative' | 'positive' | 'any'; - minWidth?: number; - minHeight?: number; - maxWidth?: number; - maxHeight?: number; - } - - class Paper extends Backbone.View { - constructor(options?: PaperOptions); - options: PaperOptions; - svg: SVGElement; - viewport: SVGGElement; - defs: SVGDefsElement; - setDimensions(width: number, height: number): void; - setOrigin(x: number, y: number): void; - scale(sx: number, sy?: number, ox?: number, oy?: number): this; - findView(element: any): CellView; - findViewByModel(model: Cell | string): CellView; - findViewsFromPoint(point: Point): ElementView[]; - findViewsInArea(rect: BBox, options?: { strict?: boolean }): CellView[]; - fitToContent(options?: FitToContentOptions): void; - scaleContentToFit(options?: ScaleContentOptions): void; - getContentBBox(): BBox; - clientToLocalPoint(p: Point): Point; - - rotate(deg: number, ox?: number, oy?: number): Paper; // @todo not released yet though it's in the source code already - - afterRenderViews(): void; - asyncRenderViews(cells: Cell[], options?: any): void; - beforeRenderViews(cells: Cell[]): Cell[]; - cellMouseout(evt: Event): void; - cellMouseover(evt: Event): void; - clearGrid(): this; - contextmenu(evt: Event): void; - createViewForModel(cell: Cell): CellView; - drawGrid(options?: any): this; - fitToContent(gridWidth?: number, gridHeight?: number, padding?: number, options?: any): void; - getArea(): BBox; - getDefaultLink(cellView: CellView, magnet: HTMLElement): Link; - getModelById(id: string): Cell; - getRestrictedArea(): BBox; - guard(evt: Event, view: CellView): boolean; - linkAllowed(linkViewOrModel: LinkView | Link): boolean; - mouseclick(evt: Event): void; - mousedblclick(evt: Event): void; - mousewheel(evt: Event): void; - onCellAdded(cell: Cell, graph: Graph, options: Object): void; - onCellHighlight(cellView: CellView, magnetEl: HTMLElement, options?: any): void; - onCellUnhighlight(cellView: CellView, magnetEl: HTMLElement, options?: any): void; - onRemove(): void; - pointerdown(evt: Event): void; - pointermove(evt: Event): void; - pointerup(evt: Event): void; - remove(): this; - removeView(cell: Cell): CellView; - removeViews(): void; - renderView(cell: Cell): CellView; - resetViews(cellsCollection: Cell[], options: any): void; - resolveHighlighter(options?: any): boolean | Object; - setGridSize(gridSize: number): this; - setInteractivity(value: any): void; - snapToGrid(p: Point): Point; - sortViews(): void; - } - - - interface GradientOptions { - type: 'linearGradient' | 'radialGradient'; - stops: Array<{ - offset: string; - color: string; - opacity?: number; - }>; - } - class CellViewGeneric extends Backbone.View { - getBBox(options?: { useModelGeometry?: boolean }): BBox; - highlight(el?: any, options?: any): this; - unhighlight(el?: any, options?: any): this; - applyFilter(selector: string | HTMLElement, filter: Object): void; - applyGradient(selector: string | HTMLElement, attr: 'fill' | 'stroke', gradient: GradientOptions): void; - can(feature: string): boolean; - findBySelector(selector: string): JQuery; - findMagnet(el: any): HTMLElement; - getSelector(el: HTMLElement, prevSelector: string): string; - getStrokeBBox(el: any): BBox; // string|HTMLElement|Vectorizer - mouseout(evt: Event): void; - mouseover(evt: Event): void; - mousewheel(evt: Event, x: number, y: number, delta: number): void - notify(eventName: string): void; - onChangeAttrs(cell: Cell, attrs: Backbone.ViewOptions, options?: any): this; - onSetTheme(oldTheme: string, newTheme: string): void; - pointerclick(evt: Event, x: number, y: number): void; - pointerdblclick(evt: Event, x: number, y: number): void; - pointerdown(evt: Event, x: number, y: number): void; - pointermove(evt: Event, x: number, y: number): void; - pointerup(evt: Event, x: number, y: number): void; - remove(): this; - setInteractivity(value: any): void; - setTheme(theme: string, options?: any): this; - } - - class CellView extends CellViewGeneric { } - - interface ElementViewAttributes { - style?: string; + interface TextAttrs extends SVGAttributes { + text?: { + [key: string]: string | number; text?: string; - html?: string; - "ref-x"?: string | number; - "ref-y"?: string | number; - "ref-dx"?: number; - "ref-dy"?: number; - "ref-width"?: string | number; - "ref-height"?: string | number; + }; + } + + interface Label { + position: number; + attrs?: TextAttrs; + } + interface LinkAttributes extends CellAttributes { + source?: Point | { id: string, selector?: string, port?: string }; + target?: Point | { id: string, selector?: string, port?: string }; + labels?: Label[]; + vertices?: Point[]; + smooth?: boolean; + attrs?: TextAttrs; + z?: number; + } + + class Link extends Cell { + markup: string; + labelMarkup: string; + toolMakup: string; + vertexMarkup: string; + arrowHeadMarkup: string; + + constructor(attributes?: LinkAttributes, options?: Object); + disconnect(): this; + label(index?: number): any; + label(index: number, value: Label): this; + reparent(options?: any): Element; + findView(paper: Paper): LinkView; + getSourceElement(): Element; + getTargetElement(): Element; + hasLoop(options?: { deep?: boolean }): boolean; + applyToPoints(fn: Function, options?: any): this; + getRelationshipAncestor(): Element; + isLink(): boolean; + isRelationshipEmbeddedIn(element: Element): boolean; + scale(sx: number, sy: number, origin: Point, optionts?: any): this; + translate(tx: number, ty: number, options?: any): this; + } + + interface ManhattanRouterArgs { + excludeTypes?: string[]; + excludeEnds?: 'source' | 'target'; + startDirections?: ['left' | 'right' | 'top' | 'bottom']; + endDirections?: ['left' | 'right' | 'top' | 'bottom']; + } + + interface PaperOptions extends Backbone.ViewOptions { + el?: string | JQuery | HTMLElement; + width?: number; + height?: number; + origin?: Point; + gridSize?: number; + perpendicularLinks?: boolean; + elementView?: (element: Element) => ElementView | ElementView; + linkView?: (link: Link) => LinkView | LinkView; + defaultLink?: ((cellView: CellView, magnet: SVGElement) => Link) | Link; + defaultRouter?: ((vertices: Point[], args: Object, linkView: LinkView) => Point[]) | { name: string, args?: ManhattanRouterArgs }; + defaultConnector?: ((sourcePoint: Point, targetPoint: Point, vertices: Point[], args: Object, linkView: LinkView) => string) | { name: string, args?: { radius?: number } }; + interactive?: ((cellView: CellView, event: string) => boolean) | boolean | { vertexAdd?: boolean, vertexMove?: boolean, vertexRemove?: boolean, arrowheadMove?: boolean }; + validateMagnet?: (cellView: CellView, magnet: SVGElement) => boolean; + validateConnection?: (cellViewS: CellView, magnetS: SVGElement, cellViewT: CellView, magnetT: SVGElement, end: 'source' | 'target', linkView: LinkView) => boolean; + linkConnectionPoint?: (linkView: LinkView, view: ElementView, magnet: SVGElement, reference: Point) => Point; + snapLinks?: boolean | { radius: number }; + linkPinning?: boolean; + markAvailable?: boolean; + async?: boolean | { batchZise: number }; + embeddingMode?: boolean; + validateEmbedding?: (childView: ElementView, parentView: ElementView) => boolean; + restrictTranslate?: ((elementView: ElementView) => BBox) | boolean; + guard?: (evt: Event, view: CellView) => boolean; + multiLinks?: boolean; + cellViewNamespace?: Object; + /** useful undocumented option */ + clickThreshold?: number; + highlighting?: any; + } + + interface ScaleContentOptions { + padding?: number; + preserveAspectRatio?: boolean; + minScale?: number; + minScaleX?: number; + minScaleY?: number; + maxScale?: number; + maxScaleX?: number; + maxScaleY?: number; + scaleGrid?: number; + fittingBBox?: BBox; + } + + interface FitToContentOptions { + gridWidth?: number; + gridHeight?: number; + padding?: Padding; + allowNewOrigin?: 'negative' | 'positive' | 'any'; + minWidth?: number; + minHeight?: number; + maxWidth?: number; + maxHeight?: number; + } + + class Paper extends Backbone.View { + constructor(options?: PaperOptions); + options: PaperOptions; + svg: SVGElement; + viewport: SVGGElement; + defs: SVGDefsElement; + setDimensions(width: number, height: number): void; + setOrigin(x: number, y: number): void; + scale(sx: number, sy?: number, ox?: number, oy?: number): this; + findView(element: any): CellView; + findViewByModel(model: Cell | string): CellView; + findViewsFromPoint(point: Point): ElementView[]; + findViewsInArea(rect: BBox, options?: { strict?: boolean }): CellView[]; + fitToContent(options?: FitToContentOptions): void; + scaleContentToFit(options?: ScaleContentOptions): void; + getContentBBox(): BBox; + clientToLocalPoint(p: Point): Point; + + rotate(deg: number, ox?: number, oy?: number): Paper; // @todo not released yet though it's in the source code already + + afterRenderViews(): void; + asyncRenderViews(cells: Cell[], options?: any): void; + beforeRenderViews(cells: Cell[]): Cell[]; + cellMouseout(evt: Event): void; + cellMouseover(evt: Event): void; + clearGrid(): this; + contextmenu(evt: Event): void; + createViewForModel(cell: Cell): CellView; + drawGrid(options?: any): this; + fitToContent(gridWidth?: number, gridHeight?: number, padding?: number, options?: any): void; + getArea(): BBox; + getDefaultLink(cellView: CellView, magnet: HTMLElement): Link; + getModelById(id: string): Cell; + getRestrictedArea(): BBox; + guard(evt: Event, view: CellView): boolean; + linkAllowed(linkViewOrModel: LinkView | Link): boolean; + mouseclick(evt: Event): void; + mousedblclick(evt: Event): void; + mousewheel(evt: Event): void; + onCellAdded(cell: Cell, graph: Graph, options: Object): void; + onCellHighlight(cellView: CellView, magnetEl: HTMLElement, options?: any): void; + onCellUnhighlight(cellView: CellView, magnetEl: HTMLElement, options?: any): void; + onRemove(): void; + pointerdown(evt: Event): void; + pointermove(evt: Event): void; + pointerup(evt: Event): void; + remove(): this; + removeView(cell: Cell): CellView; + removeViews(): void; + renderView(cell: Cell): CellView; + resetViews(cellsCollection: Cell[], options: any): void; + resolveHighlighter(options?: any): boolean | Object; + setGridSize(gridSize: number): this; + setInteractivity(value: any): void; + snapToGrid(p: Point): Point; + sortViews(): void; + } + + + interface GradientOptions { + type: 'linearGradient' | 'radialGradient'; + stops: Array<{ + offset: string; + color: string; + opacity?: number; + }>; + } + class CellViewGeneric extends Backbone.View { + getBBox(options?: { useModelGeometry?: boolean }): BBox; + highlight(el?: any, options?: any): this; + unhighlight(el?: any, options?: any): this; + applyFilter(selector: string | HTMLElement, filter: Object): void; + applyGradient(selector: string | HTMLElement, attr: 'fill' | 'stroke', gradient: GradientOptions): void; + can(feature: string): boolean; + findBySelector(selector: string): JQuery; + findMagnet(el: any): HTMLElement; + getSelector(el: HTMLElement, prevSelector: string): string; + getStrokeBBox(el: any): BBox; // string|HTMLElement|Vectorizer + mouseout(evt: Event): void; + mouseover(evt: Event): void; + mousewheel(evt: Event, x: number, y: number, delta: number): void + notify(eventName: string): void; + onChangeAttrs(cell: Cell, attrs: Backbone.ViewOptions, options?: any): this; + onSetTheme(oldTheme: string, newTheme: string): void; + pointerclick(evt: Event, x: number, y: number): void; + pointerdblclick(evt: Event, x: number, y: number): void; + pointerdown(evt: Event, x: number, y: number): void; + pointermove(evt: Event, x: number, y: number): void; + pointerup(evt: Event, x: number, y: number): void; + remove(): this; + setInteractivity(value: any): void; + setTheme(theme: string, options?: any): this; + } + + class CellView extends CellViewGeneric { } + + interface ElementViewAttributes { + style?: string; + text?: string; + html?: string; + "ref-x"?: string | number; + "ref-y"?: string | number; + "ref-dx"?: number; + "ref-dy"?: number; + "ref-width"?: string | number; + "ref-height"?: string | number; + ref?: string; + "x-alignment"?: 'middle' | 'right' | number; + "y-alignment"?: 'middle' | 'bottom' | number; + port?: string; + } + class ElementView extends CellViewGeneric { + scale(sx: number, sy: number): void; // @todo Documented in source but not released + finalizeEmbedding(options?: any): void; + getBBox(options?: any): BBox; + pointerdown(evt: Event, x: number, y: number): void; + pointermove(evt: Event, x: number, y: number): void; + pointerup(evt: Event, x: number, y: number): void; + positionRelative(vel: any, bbox: BBox, attributes: ElementViewAttributes, nodesBySelector?: Object): void; // Vectorizer + prepareEmbedding(options?: any): void; + processEmbedding(options?: any): void; + render(): this; + renderMarkup(): void; + resize(): void; + rotate(): void; + translate(model: Backbone.Model, changes?: any, options?: any): void; + update(cell: Cell, renderingOnlyAttrs?: Object): void; + } + + class LinkView extends CellViewGeneric { + options: { + shortLinkLength?: number, + doubleLinkTools?: boolean, + longLinkLength?: number, + linkToolsOffset?: number, + doubleLinkToolsOffset?: number, + sampleInterval: number + }; + getConnectionLength(): number; + sendToken(token: SVGElement, duration?: number, callback?: () => void): void; + addVertex(vertex: Point): number; + getPointAtLength(length: number): Point; // Marked as public api in source but not in the documents + createWatcher(endType: { id: string }): Function; + findRoute(oldVertices: Point[]): Point[]; + getConnectionPoint(end: 'source' | 'target', selectorOrPoint: Element | Point, referenceSelectorOrPoint: Element | Point): Point; + getPathData(vertices: Point[]): any; + onEndModelChange(endType: 'source' | 'target', endModel?: Element, opt?: any): void; + onLabelsChange(): void; + onSourceChange(cell: Cell, sourceEnd: { id: string }, options: any): void; + onTargetChange(cell: Cell, targetEnd: { id: string }, options: any): void; + onToolsChange(): void; + onVerticesChange(cell: Cell, changed: any, options: any): void; + pointerdown(evt: Event, x: number, y: number): void; + pointermove(evt: Event, x: number, y: number): void; + pointerup(evt: Event, x: number, y: number): void; + removeVertex(idx: number): this; + render(): this; + renderArrowheadMarkers(): this; + renderLabels(): this; + renderTools(): this; + renderVertexMarkers(): this; + startArrowheadMove(end: 'source' | 'target', options?: any): void; + startListening(): void; + update(model: any, attributes: any, options?: any): this; + updateArrowheadMarkers(): this; + updateAttributes(): void; + updateConnection(options?: any): void; + updateLabelPositions(): this; + updateToolsPosition(): this; + } +} + +export namespace ui { } + +export namespace shapes { + interface GenericAttributes extends dia.CellAttributes { + position?: dia.Point; + size?: dia.Size; + angle?: number; + attrs?: T; + } + interface ShapeAttrs extends dia.CSSSelector { + fill?: string; + stroke?: string; + r?: string | number; + rx?: string | number; + ry?: string | number; + cx?: string | number; + cy?: string | number; + height?: string | number; + width?: string | number; + transform?: string; + points?: string; + 'stroke-width'?: string | number; + 'ref-x'?: string | number; + 'ref-y'?: string | number; + ref?: string + } + + namespace basic { + class Generic extends dia.Element { + constructor(attributes?: GenericAttributes, options?: Object); + } + interface RectAttrs extends dia.TextAttrs { + rect?: ShapeAttrs; + } + class Rect extends Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Text extends Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + interface CircleAttrs extends dia.TextAttrs { + circle?: ShapeAttrs; + } + class Circle extends Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + interface EllipseAttrs extends dia.TextAttrs { + ellipse?: ShapeAttrs; + } + class Ellipse extends Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + interface PolygonAttrs extends dia.TextAttrs { + polygon?: ShapeAttrs; + } + class Polygon extends Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + interface PolylineAttrs extends dia.TextAttrs { + polyline?: ShapeAttrs; + } + class Polyline extends Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Image extends Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + interface PathAttrs extends dia.TextAttrs { + path?: ShapeAttrs; + } + class Path extends Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + interface RhombusAttrs extends dia.TextAttrs { + path?: ShapeAttrs; + } + class Rhombus extends Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + interface TextBlockAttrs extends dia.TextAttrs { + rect?: ShapeAttrs; + } + class TextBlock extends Generic { + constructor(attributes?: GenericAttributes, options?: Object); + updateSize(cell: dia.Cell, size: dia.Size): void; + updateContent(cell: dia.Cell, content: string): void; + } + } + + namespace chess { + class KingWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class KingBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class QueenWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class QueenBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class RookWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class RookBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class BishopWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class BishopBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class KnightWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class KnightBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class PawnWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class PawnBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + } + + namespace devs { + interface ModelAttributes extends GenericAttributes { + inPorts?: string[]; + outPorts?: string[]; + ports?: Object; + } + class Model extends basic.Generic { + constructor(attributes?: ModelAttributes, options?: Object); + changeInGroup(properties: any, opt?: any): boolean; + changeOutGroup(properties: any, opt?: any): boolean; + createPortItem(group: string, port: string): any; + createPortItems(group: string, ports: string[]): any[]; + addOutPort(port: string, opt?: any): this; + addInPort(port: string, opt?: any): this; + removeOutPort(port: string, opt?: any): this; + removeInPort(port: string, opt?: any): this; + } + class Coupled extends Model { + constructor(attributes?: ModelAttributes, options?: Object); + } + class Atomic extends Model { + constructor(attributes?: ModelAttributes, options?: Object); + } + class Link extends dia.Link { + constructor(attributes?: dia.LinkAttributes, options?: Object); + } + } + + namespace erd { + class Entity extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class WeakEntity extends Entity { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Relationship extends dia.Element { + constructor(attributes?: GenericAttributes, options?: Object); + } + class IdentifyingRelationship extends Relationship { + constructor(attributes?: GenericAttributes, options?: Object); + } + interface AttributeAttrs extends dia.TextAttrs { + ellipse?: ShapeAttrs; + } + class Attribute extends dia.Element { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Multivalued extends Attribute { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Derived extends Attribute { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Key extends Attribute { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Normal extends Attribute { + constructor(attributes?: GenericAttributes, options?: Object); + } + interface ISAAttrs extends dia.Element { + polygon?: ShapeAttrs; + } + class ISA extends dia.Element { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Line extends dia.Link { + constructor(attributes?: dia.LinkAttributes, options?: Object); + cardinality(value: string | number): void; + } + } + + namespace fsa { + class State extends basic.Circle { + constructor(attributes?: GenericAttributes, options?: Object); + } + class StartState extends dia.Element { + constructor(attributes?: GenericAttributes, options?: Object); + } + class EndState extends dia.Element { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Arrow extends dia.Link { + constructor(attributes?: dia.LinkAttributes, options?: Object); + } + } + + namespace logic { + interface LogicAttrs extends ShapeAttrs { ref?: string; - "x-alignment"?: 'middle' | 'right' | number; - "y-alignment"?: 'middle' | 'bottom' | number; + 'ref-x'?: number | string; + 'ref-dx'?: number | string; + 'ref-y'?: number | string; + 'ref-dy'?: number | string; + magnet?: boolean; + 'class'?: string; port?: string; } - class ElementView extends CellViewGeneric { - scale(sx: number, sy: number): void; // @todo Documented in source but not released - finalizeEmbedding(options?: any): void; - getBBox(options?: any): BBox; - pointerdown(evt: Event, x: number, y: number): void; - pointermove(evt: Event, x: number, y: number): void; - pointerup(evt: Event, x: number, y: number): void; - positionRelative(vel: any, bbox: BBox, attributes: ElementViewAttributes, nodesBySelector?: Object): void; // Vectorizer - prepareEmbedding(options?: any): void; - processEmbedding(options?: any): void; - render(): this; - renderMarkup(): void; - resize(): void; - rotate(): void; - translate(model: Backbone.Model, changes?: any, options?: any): void; - update(cell: Cell, renderingOnlyAttrs?: Object): void; + interface IOAttrs extends dia.TextAttrs { + circle?: LogicAttrs; } - - class LinkView extends CellViewGeneric { - options: { - shortLinkLength?: number, - doubleLinkTools?: boolean, - longLinkLength?: number, - linkToolsOffset?: number, - doubleLinkToolsOffset?: number, - sampleInterval: number - }; - getConnectionLength(): number; - sendToken(token: SVGElement, duration?: number, callback?: () => void): void; - addVertex(vertex: Point): number; - getPointAtLength(length: number): Point; // Marked as public api in source but not in the documents - createWatcher(endType: { id: string }): Function; - findRoute(oldVertices: Point[]): Point[]; - getConnectionPoint(end: 'source' | 'target', selectorOrPoint: Element | Point, referenceSelectorOrPoint: Element | Point): Point; - getPathData(vertices: Point[]): any; - onEndModelChange(endType: 'source' | 'target', endModel?: Element, opt?: any): void; - onLabelsChange(): void; - onSourceChange(cell: Cell, sourceEnd: { id: string }, options: any): void; - onTargetChange(cell: Cell, targetEnd: { id: string }, options: any): void; - onToolsChange(): void; - onVerticesChange(cell: Cell, changed: any, options: any): void; - pointerdown(evt: Event, x: number, y: number): void; - pointermove(evt: Event, x: number, y: number): void; - pointerup(evt: Event, x: number, y: number): void; - removeVertex(idx: number): this; - render(): this; - renderArrowheadMarkers(): this; - renderLabels(): this; - renderTools(): this; - renderVertexMarkers(): this; - startArrowheadMove(end: 'source' | 'target', options?: any): void; - startListening(): void; - update(model: any, attributes: any, options?: any): this; - updateArrowheadMarkers(): this; - updateAttributes(): void; - updateConnection(options?: any): void; - updateLabelPositions(): this; - updateToolsPosition(): this; + class Gate extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class IO extends Gate { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Input extends IO { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Output extends IO { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Gate11 extends Gate { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Gate21 extends Gate { + constructor(attributes?: GenericAttributes, options?: Object); + } + interface Image { + 'xlink:href'?: string; + } + interface ImageAttrs extends LogicAttrs { + image?: Image; + } + class Repeater extends Gate11 { + constructor(attributes?: GenericAttributes, options?: Object); + operation(input: any): any; + } + class Note extends Gate11 { + constructor(attributes?: GenericAttributes, options?: Object); + operation(input: any): boolean; + } + class Or extends Gate21 { + constructor(attributes?: GenericAttributes, options?: Object); + operation(input1: any, input2: any): boolean; + } + class And extends Gate21 { + constructor(attributes?: GenericAttributes, options?: Object); + operation(input1: any, input2: any): boolean; + } + class Nor extends Gate21 { + constructor(attributes?: GenericAttributes, options?: Object); + operation(input1: any, input2: any): boolean; + } + class Nand extends Gate21 { + constructor(attributes?: GenericAttributes, options?: Object); + operation(input1: any, input2: any): boolean; + } + class Xor extends Gate21 { + constructor(attributes?: GenericAttributes, options?: Object); + operation(input1: any, input2: any): boolean; + } + class Xnor extends Gate21 { + constructor(attributes?: GenericAttributes, options?: Object); + operation(input1: any, input2: any): boolean; + } + interface WireArgs extends dia.LinkAttributes { + router?: Object; + connector?: Object; + } + class Wire extends dia.Link { + constructor(attributes?: WireArgs, options?: Object); } } - namespace ui { } - - namespace shapes { - interface GenericAttributes extends dia.CellAttributes { - position?: dia.Point; - size?: dia.Size; - angle?: number; - attrs?: T; + namespace org { + interface MemberAttrs { + rect?: ShapeAttrs; + image?: ShapeAttrs; } - interface ShapeAttrs extends dia.CSSSelector { - fill?: string; - stroke?: string; - r?: string | number; - rx?: string | number; - ry?: string | number; - cx?: string | number; - cy?: string | number; - height?: string | number; - width?: string | number; - transform?: string; - points?: string; - 'stroke-width'?: string | number; - 'ref-x'?: string | number; - 'ref-y'?: string | number; - ref?: string + class Member extends dia.Element { + constructor(attributes?: GenericAttributes, options?: Object); } - - namespace basic { - class Generic extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface RectAttrs extends dia.TextAttrs { - rect?: ShapeAttrs; - } - class Rect extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Text extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface CircleAttrs extends dia.TextAttrs { - circle?: ShapeAttrs; - } - class Circle extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface EllipseAttrs extends dia.TextAttrs { - ellipse?: ShapeAttrs; - } - class Ellipse extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface PolygonAttrs extends dia.TextAttrs { - polygon?: ShapeAttrs; - } - class Polygon extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface PolylineAttrs extends dia.TextAttrs { - polyline?: ShapeAttrs; - } - class Polyline extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Image extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface PathAttrs extends dia.TextAttrs { - path?: ShapeAttrs; - } - class Path extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface RhombusAttrs extends dia.TextAttrs { - path?: ShapeAttrs; - } - class Rhombus extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface TextBlockAttrs extends dia.TextAttrs { - rect?: ShapeAttrs; - } - class TextBlock extends Generic { - constructor(attributes?: GenericAttributes, options?: Object); - updateSize(cell: dia.Cell, size: dia.Size): void; - updateContent(cell: dia.Cell, content: string): void; - } - } - - namespace chess { - class KingWhite extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class KingBlack extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class QueenWhite extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class QueenBlack extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class RookWhite extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class RookBlack extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class BishopWhite extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class BishopBlack extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class KnightWhite extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class KnightBlack extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class PawnWhite extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class PawnBlack extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - } - - namespace devs { - interface ModelAttributes extends GenericAttributes { - inPorts?: string[]; - outPorts?: string[]; - ports?: Object; - } - class Model extends basic.Generic { - constructor(attributes?: ModelAttributes, options?: Object); - changeInGroup(properties: any, opt?: any): boolean; - changeOutGroup(properties: any, opt?: any): boolean; - createPortItem(group: string, port: string): any; - createPortItems(group: string, ports: string[]): any[]; - addOutPort(port: string, opt?: any): this; - addInPort(port: string, opt?: any): this; - removeOutPort(port: string, opt?: any): this; - removeInPort(port: string, opt?: any): this; - } - class Coupled extends Model { - constructor(attributes?: ModelAttributes, options?: Object); - } - class Atomic extends Model { - constructor(attributes?: ModelAttributes, options?: Object); - } - class Link extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - } - - namespace erd { - class Entity extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class WeakEntity extends Entity { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Relationship extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - class IdentifyingRelationship extends Relationship { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface AttributeAttrs extends dia.TextAttrs { - ellipse?: ShapeAttrs; - } - class Attribute extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Multivalued extends Attribute { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Derived extends Attribute { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Key extends Attribute { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Normal extends Attribute { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface ISAAttrs extends dia.Element { - polygon?: ShapeAttrs; - } - class ISA extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Line extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - cardinality(value: string | number): void; - } - } - - namespace fsa { - class State extends basic.Circle { - constructor(attributes?: GenericAttributes, options?: Object); - } - class StartState extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - class EndState extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Arrow extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - } - - namespace logic { - interface LogicAttrs extends ShapeAttrs { - ref?: string; - 'ref-x'?: number | string; - 'ref-dx'?: number | string; - 'ref-y'?: number | string; - 'ref-dy'?: number | string; - magnet?: boolean; - 'class'?: string; - port?: string; - } - interface IOAttrs extends dia.TextAttrs { - circle?: LogicAttrs; - } - class Gate extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class IO extends Gate { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Input extends IO { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Output extends IO { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Gate11 extends Gate { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Gate21 extends Gate { - constructor(attributes?: GenericAttributes, options?: Object); - } - interface Image { - 'xlink:href'?: string; - } - interface ImageAttrs extends LogicAttrs { - image?: Image; - } - class Repeater extends Gate11 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input: any): any; - } - class Note extends Gate11 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input: any): boolean; - } - class Or extends Gate21 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input1: any, input2: any): boolean; - } - class And extends Gate21 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input1: any, input2: any): boolean; - } - class Nor extends Gate21 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input1: any, input2: any): boolean; - } - class Nand extends Gate21 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input1: any, input2: any): boolean; - } - class Xor extends Gate21 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input1: any, input2: any): boolean; - } - class Xnor extends Gate21 { - constructor(attributes?: GenericAttributes, options?: Object); - operation(input1: any, input2: any): boolean; - } - interface WireArgs extends dia.LinkAttributes { - router?: Object; - connector?: Object; - } - class Wire extends dia.Link { - constructor(attributes?: WireArgs, options?: Object); - } - } - - namespace org { - interface MemberAttrs { - rect?: ShapeAttrs; - image?: ShapeAttrs; - } - class Member extends dia.Element { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Arrow extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - } - - namespace pn { - class Place extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class PlaceView extends dia.ElementView { - renderTokens(): void; - } - class Transition extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Link extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - } - - namespace uml { - interface ClassAttributes extends GenericAttributes { - name: string[]; - attributes: string[]; - methods: string[]; - } - class Class extends basic.Generic { - constructor(attributes?: ClassAttributes, options?: Object); - getClassName(): string[]; - updateRectangles(): void; - } - class ClassView extends dia.ElementView { - } - class Abstract extends Class { - constructor(attributes?: ClassAttributes, options?: Object); - } - class AbstractView extends ClassView { - constructor(attributes?: ClassAttributes, options?: Object); - } - class Interface extends Class { - constructor(attributes?: ClassAttributes, options?: Object); - } - class InterfaceView extends ClassView { - constructor(attributes?: ClassAttributes, options?: Object); - } - class Generalization extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - class Implementation extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - class Aggregation extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - class Composition extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - class Association extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } - interface StateAttributes extends GenericAttributes { - events?: string[]; - } - class State extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - updateName(): void; - updateEvents(): void; - updatePath(): void; - } - class StartState extends basic.Circle { - constructor(attributes?: GenericAttributes, options?: Object); - } - class EndState extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); - } - class Transition extends dia.Link { - constructor(attributes?: dia.LinkAttributes, options?: Object); - } + class Arrow extends dia.Link { + constructor(attributes?: dia.LinkAttributes, options?: Object); } } - namespace util { - - namespace format { - export function number(specifier: string, value: number): string; + namespace pn { + class Place extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class PlaceView extends dia.ElementView { + renderTokens(): void; + } + class Transition extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Link extends dia.Link { + constructor(attributes?: dia.LinkAttributes, options?: Object); } - - export function uuid(): string; - export function guid(obj?: Object): string; - export function nextFrame(callback: () => void, context?: Object): number; - export function cancelFrame(requestId: number): void; - export function flattenObject(object: Object, delim: string, stop: (node: any) => boolean): any; - export function getByPath(object: Object, path: string, delim: string): any; - export function setByPath(object: Object, path: string, value: Object, delim: string): any; - export function unsetByPath(object: Object, path: string, delim: string): any; - export function breakText(text: string, size: dia.Size, attrs?: dia.SVGAttributes, options?: { svgDocument?: SVGElement }): string; - export function normalizeSides(box: number | { x?: number, y?: number, height?: number, width?: number }): dia.BBox; - export function getElementBBox(el: Element): dia.BBox; - export function setAttributesBySelector(el: Element, attrs: dia.SVGAttributes): void; - export function sortElements(elements: Element[] | string | JQuery, comparator: (a: Element, b: Element) => number): Element[]; - export function shapePerimeterConnectionPoint(linkView: dia.LinkView, view: dia.ElementView, magnet: SVGElement, ref: dia.Point): dia.Point; - export function imageToDataUri(url: string, callback: (err: Error, dataUri: string) => void): void; - - // Not documented but used in examples - /** @deprecated use lodash _.defaultsDeep */ - export function deepSupplement(objects: any, defaultIndicator?: any): any; - - // Private functions - /** @deprecated use lodash _.assign */ - export function mixin(objects: any[]): any; - /** @deprecated use lodash _.defaults */ - export function supplement(objects: any[]): any; - /** @deprecated use lodash _.mixin */ - export function deepMixin(objects: any[]): any; } - namespace layout { - - interface LayoutOptions { - nodeSep?: number; - edgeSep?: number; - rankSep?: number; - rankDir?: 'TB' | 'BT' | 'LR' | 'RL'; - marginX?: number; - marginY?: number; - resizeCluster?: boolean; - setPosition?: (element: dia.Element, position: dia.BBox) => void; - setLinkVertices?: (link: dia.Link, vertices: Position[]) => void; + namespace uml { + interface ClassAttributes extends GenericAttributes { + name: string[]; + attributes: string[]; + methods: string[]; } - - export class DirectedGraph { - static layout(graph: dia.Graph | dia.Cell[], options?: LayoutOptions): dia.BBox; + class Class extends basic.Generic { + constructor(attributes?: ClassAttributes, options?: Object); + getClassName(): string[]; + updateRectangles(): void; + } + class ClassView extends dia.ElementView { + } + class Abstract extends Class { + constructor(attributes?: ClassAttributes, options?: Object); + } + class AbstractView extends ClassView { + constructor(attributes?: ClassAttributes, options?: Object); + } + class Interface extends Class { + constructor(attributes?: ClassAttributes, options?: Object); + } + class InterfaceView extends ClassView { + constructor(attributes?: ClassAttributes, options?: Object); + } + class Generalization extends dia.Link { + constructor(attributes?: dia.LinkAttributes, options?: Object); + } + class Implementation extends dia.Link { + constructor(attributes?: dia.LinkAttributes, options?: Object); + } + class Aggregation extends dia.Link { + constructor(attributes?: dia.LinkAttributes, options?: Object); + } + class Composition extends dia.Link { + constructor(attributes?: dia.LinkAttributes, options?: Object); + } + class Association extends dia.Link { + constructor(attributes?: dia.LinkAttributes, options?: Object); + } + interface StateAttributes extends GenericAttributes { + events?: string[]; + } + class State extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + updateName(): void; + updateEvents(): void; + updatePath(): void; + } + class StartState extends basic.Circle { + constructor(attributes?: GenericAttributes, options?: Object); + } + class EndState extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); + } + class Transition extends dia.Link { + constructor(attributes?: dia.LinkAttributes, options?: Object); } } } + +export namespace util { + + namespace format { + export function number(specifier: string, value: number): string; + } + + export function uuid(): string; + export function guid(obj?: Object): string; + export function nextFrame(callback: () => void, context?: Object): number; + export function cancelFrame(requestId: number): void; + export function flattenObject(object: Object, delim: string, stop: (node: any) => boolean): any; + export function getByPath(object: Object, path: string, delim: string): any; + export function setByPath(object: Object, path: string, value: Object, delim: string): any; + export function unsetByPath(object: Object, path: string, delim: string): any; + export function breakText(text: string, size: dia.Size, attrs?: dia.SVGAttributes, options?: { svgDocument?: SVGElement }): string; + export function normalizeSides(box: number | { x?: number, y?: number, height?: number, width?: number }): dia.BBox; + export function getElementBBox(el: Element): dia.BBox; + export function setAttributesBySelector(el: Element, attrs: dia.SVGAttributes): void; + export function sortElements(elements: Element[] | string | JQuery, comparator: (a: Element, b: Element) => number): Element[]; + export function shapePerimeterConnectionPoint(linkView: dia.LinkView, view: dia.ElementView, magnet: SVGElement, ref: dia.Point): dia.Point; + export function imageToDataUri(url: string, callback: (err: Error, dataUri: string) => void): void; + + // Not documented but used in examples + /** @deprecated use lodash _.defaultsDeep */ + export function deepSupplement(objects: any, defaultIndicator?: any): any; + + // Private functions + /** @deprecated use lodash _.assign */ + export function mixin(objects: any[]): any; + /** @deprecated use lodash _.defaults */ + export function supplement(objects: any[]): any; + /** @deprecated use lodash _.mixin */ + export function deepMixin(objects: any[]): any; +} + +export namespace layout { + + interface LayoutOptions { + nodeSep?: number; + edgeSep?: number; + rankSep?: number; + rankDir?: 'TB' | 'BT' | 'LR' | 'RL'; + marginX?: number; + marginY?: number; + resizeCluster?: boolean; + setPosition?: (element: dia.Element, position: dia.BBox) => void; + setLinkVertices?: (link: dia.Link, vertices: Position[]) => void; + } + + class DirectedGraph { + static layout(graph: dia.Graph | dia.Cell[], options?: LayoutOptions): dia.BBox; + } +} diff --git a/notNeededPackages.json b/notNeededPackages.json index b49c089d9a..e8900fe2d0 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -5,6 +5,12 @@ "typingsPackageName": "ajv", "sourceRepoURL": "https://github.com/epoberezkin/ajv", "asOfVersion": "1.0.0" + }, + { + "libraryName": "Numbro", + "typingsPackageName": "numbro", + "sourceRepoURL": "https://github.com/foretagsplatsen/numbro/", + "asOfVersion": "1.9.3" }, { "libraryName": "antd", diff --git a/numbro/index.d.ts b/numbro/index.d.ts deleted file mode 100644 index ccb0892a0d..0000000000 --- a/numbro/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Type definitions for Numbro.js -// Project: https://github.com/foretagsplatsen/numbro -// Definitions by: Vincent Bortone -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface NumbroLanguage { - delimiters: { - thousands: string; - decimal: string; - }; - abbreviations: { - thousand: string; - million: string; - billion: string; - trillion: string; - }; - ordinal(num: number): string; - currency: { - symbol: string; - }; -} - -interface Numbro { - (value?: any): Numbro; - version: string; - isNumbro: boolean; - language(key: string, values?: NumbroLanguage): Numbro; - zeroFormat(format: string): string; - clone(): Numbro; - format(inputString?: string): string; - formatCurrency(inputString?: string): string; - unformat(inputString: string): number; - value(): number; - valueOf(): number; - set (value: any): Numbro; - add(value: any): Numbro; - subtract(value: any): Numbro; - multiply(value: any): Numbro; - divide(value: any): Numbro; - difference(value: any): number; -} - -declare var numbro: Numbro; - -declare module "numbro" { - - export = numbro; - -} diff --git a/numbro/numbro-tests.ts b/numbro/numbro-tests.ts deleted file mode 100644 index 5b5b762353..0000000000 --- a/numbro/numbro-tests.ts +++ /dev/null @@ -1,43 +0,0 @@ - - -var valueFormat: string = numbro(1000).format('0,0'); -// '1,000' - -var valueUnformat: number = numbro().unformat('($10,000.00)'); -// '-10000' - -var value3: Numbro = numbro(1000); -var added: Numbro = value3.add(10); -// 1010 - -var value4: Numbro = numbro(1000); -var formatValue4a: string = value4.format('0,0'); -// '1,000' -var formatValue4b: number = value4.value(); -// 1000 - -var value5: Numbro = numbro(); -value5.set(1000); -var value5Num: number = value5.value(); -// 1000 - -var value6: Numbro = numbro(1000); -var value: number = 100; -var difference = value6.difference(value); -// 900 - -var value7: Numbro = numbro(0); -numbro.zeroFormat('N/A'); -var zeroString: string = value7.format('0.0'); -// 'N/A' - -var a: Numbro = numbro(1000); -var b: Numbro = numbro(a); -var c: Numbro = a.clone(); - -var aVal: number = a.set(2000).value(); -// 2000 -var bVal: number = b.value(); -// 1000 -var cVal: number = c.add(10).value(); -// 1010 diff --git a/numbro/tsconfig.json b/numbro/tsconfig.json deleted file mode 100644 index 4a55ffe0ab..0000000000 --- a/numbro/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "numbro-tests.ts" - ] -} \ No newline at end of file diff --git a/rappid/index.d.ts b/rappid/index.d.ts index 5cbf07b995..d70023e055 100644 --- a/rappid/index.d.ts +++ b/rappid/index.d.ts @@ -5,33 +5,36 @@ /// -declare namespace joint { - namespace ui { - interface Handle { - name: string; - position: string; - icon: string; - } +import * as joint from 'jointjs'; +import * as Backbone from "backbone"; - class SelectionView extends Backbone.Model { +export as namespace joint; + +export namespace ui { + interface Handle { + name: string; + position: string; + icon: string; + } + + class SelectionView extends Backbone.Model { + paper: joint.dia.Paper; + graph: joint.dia.Graph; + model: Backbone.Collection; + + constructor(opt: { paper: joint.dia.Paper; graph: joint.dia.Graph; - model: Backbone.Collection; + model: Backbone.Collection + }); - constructor(opt: { - paper: joint.dia.Paper; - graph: joint.dia.Graph; - model: Backbone.Collection - }); + createSelectionBox(cellView: joint.dia.CellView): void; + destroySelectionBox(cellView: joint.dia.CellView): void; + startSelecting(evt: any): void; + cancelSelection(): void; - createSelectionBox(cellView: joint.dia.CellView): void; - destroySelectionBox(cellView: joint.dia.CellView): void; - startSelecting(evt: any): void; - cancelSelection(): void; - - addHandle(handle: Handle): void; - removeHandle(name: string): void; - changeHandle(name: string, handle: Handle): void; - } + addHandle(handle: Handle): void; + removeHandle(name: string): void; + changeHandle(name: string, handle: Handle): void; } } diff --git a/react/index.d.ts b/react/index.d.ts index 3bd624521e..cf3afd9661 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -437,7 +437,7 @@ declare namespace React { interface ChangeTargetHTMLProps extends ChangeTargetHTMLAttributes, ClassAttributes { } - interface SVGProps extends SVGAttributes, ClassAttributes { + interface SVGProps extends SVGAttributes, ClassAttributes { } interface DOMAttributes { @@ -2211,7 +2211,25 @@ declare namespace React { // - "number | string" // - "string" // - union of string literals - interface SVGAttributes extends HTMLAttributes { + interface SVGAttributes extends DOMAttributes { + // Attributes which also defined in HTMLAttributes + // See comment in SVGDOMPropertyConfig.js + className?: string; + color?: string; + height?: number | string; + id?: string; + lang?: string; + max?: number | string; + media?: string; + method?: string; + min?: number | string; + name?: string; + style?: CSSProperties; + target?: string; + type?: string; + width?: number | string; + + // SVG Specific attributes accentHeight?: number | string; accumulate?: "none" | "sum"; additive?: "replace" | "sum"; @@ -2404,7 +2422,6 @@ declare namespace React { textRendering?: number | string; to?: number | string; transform?: string; - type?: string; u1?: number | string; u2?: number | string; underlinePosition?: number | string; @@ -2802,61 +2819,61 @@ declare global { wbr: React.HTMLProps; // SVG - svg: React.SVGProps; + svg: React.SVGProps; - animate: React.SVGProps; - circle: React.SVGProps; - clipPath: React.SVGProps; - defs: React.SVGProps; - desc: React.SVGProps; - ellipse: React.SVGProps; - feBlend: React.SVGProps; - feColorMatrix: React.SVGProps; - feComponentTransfer: React.SVGProps; - feComposite: React.SVGProps; - feConvolveMatrix: React.SVGProps; - feDiffuseLighting: React.SVGProps; - feDisplacementMap: React.SVGProps; - feDistantLight: React.SVGProps; - feFlood: React.SVGProps; - feFuncA: React.SVGProps; - feFuncB: React.SVGProps; - feFuncG: React.SVGProps; - feFuncR: React.SVGProps; - feGaussianBlur: React.SVGProps; - feImage: React.SVGProps; - feMerge: React.SVGProps; - feMergeNode: React.SVGProps; - feMorphology: React.SVGProps; - feOffset: React.SVGProps; - fePointLight: React.SVGProps; - feSpecularLighting: React.SVGProps; - feSpotLight: React.SVGProps; - feTile: React.SVGProps; - feTurbulence: React.SVGProps; - filter: React.SVGProps; - foreignObject: React.SVGProps; - g: React.SVGProps; - image: React.SVGProps; - line: React.SVGProps; - linearGradient: React.SVGProps; - marker: React.SVGProps; - mask: React.SVGProps; - metadata: React.SVGProps; - path: React.SVGProps; - pattern: React.SVGProps; - polygon: React.SVGProps; - polyline: React.SVGProps; - radialGradient: React.SVGProps; - rect: React.SVGProps; - stop: React.SVGProps; - switch: React.SVGProps; - symbol: React.SVGProps; - text: React.SVGProps; - textPath: React.SVGProps; - tspan: React.SVGProps; - use: React.SVGProps; - view: React.SVGProps; + animate: React.SVGProps; // TODO: It is SVGAnimateElement but is not in TypeScript's lib.dom.d.ts for now. + circle: React.SVGProps; + clipPath: React.SVGProps; + defs: React.SVGProps; + desc: React.SVGProps; + ellipse: React.SVGProps; + feBlend: React.SVGProps; + feColorMatrix: React.SVGProps; + feComponentTransfer: React.SVGProps; + feComposite: React.SVGProps; + feConvolveMatrix: React.SVGProps; + feDiffuseLighting: React.SVGProps; + feDisplacementMap: React.SVGProps; + feDistantLight: React.SVGProps; + feFlood: React.SVGProps; + feFuncA: React.SVGProps; + feFuncB: React.SVGProps; + feFuncG: React.SVGProps; + feFuncR: React.SVGProps; + feGaussianBlur: React.SVGProps; + feImage: React.SVGProps; + feMerge: React.SVGProps; + feMergeNode: React.SVGProps; + feMorphology: React.SVGProps; + feOffset: React.SVGProps; + fePointLight: React.SVGProps; + feSpecularLighting: React.SVGProps; + feSpotLight: React.SVGProps; + feTile: React.SVGProps; + feTurbulence: React.SVGProps; + filter: React.SVGProps; + foreignObject: React.SVGProps; + g: React.SVGProps; + image: React.SVGProps; + line: React.SVGProps; + linearGradient: React.SVGProps; + marker: React.SVGProps; + mask: React.SVGProps; + metadata: React.SVGProps; + path: React.SVGProps; + pattern: React.SVGProps; + polygon: React.SVGProps; + polyline: React.SVGProps; + radialGradient: React.SVGProps; + rect: React.SVGProps; + stop: React.SVGProps; + switch: React.SVGProps; + symbol: React.SVGProps; + text: React.SVGProps; + textPath: React.SVGProps; + tspan: React.SVGProps; + use: React.SVGProps; + view: React.SVGProps; } } } diff --git a/react/test/index.ts b/react/test/index.ts index 1bf6c8dcc2..f0fee7a00b 100644 --- a/react/test/index.ts +++ b/react/test/index.ts @@ -342,6 +342,9 @@ React.DOM.svg({ xmlns: "http://www.w3.org/2000/svg" }, React.DOM.rect({ + className: 'foobar', + id: 'foo', + color: 'black', x: 22, y: 10, width: 4, diff --git a/session-file-store/session-file-store-tests.ts b/session-file-store/session-file-store-tests.ts index b268aea8b0..ffe3c79bee 100644 --- a/session-file-store/session-file-store-tests.ts +++ b/session-file-store/session-file-store-tests.ts @@ -1,14 +1,13 @@ import FileStore = require("session-file-store"); -const options:FileStore.Options = { +const options: FileStore.Options = { path: "./tmp/sessions/", - logFn:function(a:string) { - + logFn: (a: string) => { } }; const sessionStore = new FileStore(options); -sessionStore.list(function (err: any, file: Array) { +sessionStore.list((err: any, file: Array) => { -}); +}); \ No newline at end of file