Skip to content

Commit

Permalink
types: fix untyped model when using ElementView/LinkView (#2585)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelspiss authored Mar 25, 2024
1 parent 7bba234 commit 9f0241e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/joint-core/types/joint.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -913,18 +913,18 @@ export namespace dia {
}
}

class ElementView extends CellViewGeneric<Element> {
class ElementView<E extends Element = Element> extends CellViewGeneric<E> {

update(element?: Element, renderingOnlyAttrs?: { [key: string]: any }): void;
update(element?: E, renderingOnlyAttrs?: { [key: string]: any }): void;

setInteractivity(value: boolean | ElementView.InteractivityOptions): void;

getDelegatedView(): ElementView | null;

findPortNode(portId: string | number): SVGElement | null;
findPortNode(portId: string | number, selector: string): Element | null;
findPortNode(portId: string | number, selector: string): E | null;

findPortNodes(portId: string | number, groupSelector: string): Element[];
findPortNodes(portId: string | number, groupSelector: string): E[];

protected renderMarkup(): void;

Expand Down Expand Up @@ -999,14 +999,14 @@ export namespace dia {

}

interface Options extends mvc.ViewOptions<Link, SVGElement> {
interface Options<L extends Link = Link> extends mvc.ViewOptions<L, SVGElement> {
labelsLayer?: Paper.Layers | string | false;
}
}

class LinkView extends CellViewGeneric<Link> {
class LinkView<L extends Link = Link> extends CellViewGeneric<L> {

options: LinkView.Options;
options: LinkView.Options<L>;
sourceAnchor: g.Point;
targetAnchor: g.Point;

Expand Down

0 comments on commit 9f0241e

Please sign in to comment.