canvas-editor-engine 2.2.4 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs
CHANGED
@@ -2531,7 +2531,8 @@ var DrawLayersService = function() {
|
|
2531
2531
|
}
|
2532
2532
|
DrawLayersService.prototype.addLayer = function(layerOptions) {
|
2533
2533
|
var _a;
|
2534
|
-
var layerName = layerOptions
|
2534
|
+
var layerName = layerOptions === null || layerOptions === void 0 ? void 0 : layerOptions.layerName;
|
2535
|
+
var painter = layerOptions === null || layerOptions === void 0 ? void 0 : layerOptions.painter;
|
2535
2536
|
var id = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
|
2536
2537
|
var name = function() {
|
2537
2538
|
if (layerName) return layerName;
|
@@ -2560,6 +2561,11 @@ var DrawLayersService = function() {
|
|
2560
2561
|
return layer.order === order;
|
2561
2562
|
}));
|
2562
2563
|
};
|
2564
|
+
DrawLayersService.prototype.getLayerById = function(layerId) {
|
2565
|
+
return this.layerList.find((function(layer) {
|
2566
|
+
return layer.id === layerId;
|
2567
|
+
}));
|
2568
|
+
};
|
2563
2569
|
DrawLayersService.prototype.addToLayer = function(id, painter) {
|
2564
2570
|
var layerIndex = this.layerList.findIndex((function(layer) {
|
2565
2571
|
return layer.id === id;
|
@@ -10,6 +10,7 @@ export default class DrawLayersService {
|
|
10
10
|
painter?: IPainter;
|
11
11
|
}): void;
|
12
12
|
getLayerByOrder(order: number): ILayer;
|
13
|
+
getLayerById(layerId: ILayer['id']): ILayer;
|
13
14
|
addToLayer(id: ILayer['id'], painter: IPainter): void;
|
14
15
|
updateLayer(id: ILayer['id'], updateData?: ILayerUpdate): void;
|
15
16
|
}
|