Skip to content

Commit

Permalink
fix(ElementFactory): change type declaration to accept any property
Browse files Browse the repository at this point in the history
Closes #774
  • Loading branch information
philippfromme authored and nikku committed Apr 18, 2023
1 parent ca6869a commit 5184244
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/core/ElementFactory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,35 @@ const shape1 = elementFactory.create('shape', {
x: 100,
y: 100,
width: 100,
height: 100
height: 100,
foo: 'bar'
});

const shape2 = elementFactory.create('shape', {
id: 'shape2',
x: 100,
y: 100,
width: 100,
height: 100
height: 100,
foo: 'bar'
});

elementFactory.create('connection', {
id: 'connection',
source: shape1,
target: shape2,
waypoints: []
waypoints: [],
foo: 'bar'
});

elementFactory.create('root', {
id: 'root'
id: 'root',
foo: 'bar'
});

elementFactory.create('label', {
id: 'label'
id: 'label',
foo: 'bar'
});

elementFactory.create('connection');
Expand Down
1 change: 1 addition & 0 deletions lib/model/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface ModelBaseAttrs {
parent?: Base;
incoming?: Connection[];
outgoing?: Connection[];
[key: string]: any;
}

export interface ModelAttrsShape extends ModelBaseAttrs {
Expand Down

0 comments on commit 5184244

Please sign in to comment.