Skip to content

Commit

Permalink
chore(ElementFactory): name templates according to convention
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme authored and nikku committed Apr 18, 2023
1 parent 7930d3f commit d278b44
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/core/ElementFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import { assign } from 'min-dash';
/**
* A factory for model elements.
*
* @template {Connection} [ConnectionType=Connection]
* @template {Label} [LabelType=Label]
* @template {Root} [RootType=Root]
* @template {Shape} [ShapeType=Shape]
* @template {Connection} [T=Connection]
* @template {Label} [U=Label]
* @template {Root} [V=Root]
* @template {Shape} [W=Shape]
*/
export default function ElementFactory() {
this._uid = 12;
Expand All @@ -29,7 +29,7 @@ export default function ElementFactory() {
*
* @param {Partial<Root>} [attrs]
*
* @return {RootType} The created root element.
* @return {V} The created root element.
*/
ElementFactory.prototype.createRoot = function(attrs) {
return this.create('root', attrs);
Expand All @@ -40,7 +40,7 @@ ElementFactory.prototype.createRoot = function(attrs) {
*
* @param {Partial<Label>} [attrs]
*
* @return {LabelType} The created label.
* @return {U} The created label.
*/
ElementFactory.prototype.createLabel = function(attrs) {
return this.create('label', attrs);
Expand All @@ -51,7 +51,7 @@ ElementFactory.prototype.createLabel = function(attrs) {
*
* @param {Partial<Shape>} [attrs]
*
* @return {ShapeType} The created shape.
* @return {W} The created shape.
*/
ElementFactory.prototype.createShape = function(attrs) {
return this.create('shape', attrs);
Expand All @@ -62,7 +62,7 @@ ElementFactory.prototype.createShape = function(attrs) {
*
* @param {Partial<Connection>} [attrs]
*
* @return {ConnectionType} The created connection.
* @return {T} The created connection.
*/
ElementFactory.prototype.createConnection = function(attrs) {
return this.create('connection', attrs);
Expand All @@ -74,30 +74,30 @@ ElementFactory.prototype.createConnection = function(attrs) {
* @overlord
* @param {'root'} type
* @param {Partial<Root>} [attrs]
* @return {RootType}
* @return {V}
*/
/**
* Create a shape.
*
* @overlord
* @param {'shape'} type
* @param {Partial<Shape>} [attrs]
* @return {ShapeType}
* @return {W}
*/
/**
* Create a connection.
*
* @overlord
* @param {'connection'} type
* @param {Partial<Connection>} [attrs]
* @return {ConnectionType}
* @return {T}
*/
/**
* Create a label.
*
* @param {'label'} type
* @param {Partial<Label>} [attrs]
* @return {LabelType}
* @return {U}
*/
ElementFactory.prototype.create = function(type, attrs) {

Expand Down

0 comments on commit d278b44

Please sign in to comment.