1 | import { __assign } from "tslib";
|
2 |
|
3 | var AbstractRenderer =
|
4 |
|
5 | function () {
|
6 | function AbstractRenderer(config) {
|
7 | this.plugins = [];
|
8 | this.config = __assign({
|
9 | |
10 |
|
11 |
|
12 | enableDirtyCheck: true,
|
13 |
|
14 | |
15 |
|
16 |
|
17 | enableAutoRendering: true,
|
18 |
|
19 | |
20 |
|
21 |
|
22 | enableDirtyRectangleRendering: true,
|
23 | enableDirtyRectangleRenderingDebug: false
|
24 | }, config);
|
25 | }
|
26 |
|
27 | AbstractRenderer.prototype.registerPlugin = function (plugin) {
|
28 | this.plugins.push(plugin);
|
29 | };
|
30 |
|
31 | AbstractRenderer.prototype.unregisterPlugin = function (plugin) {
|
32 | var index = this.plugins.findIndex(function (p) {
|
33 | return p === plugin;
|
34 | });
|
35 |
|
36 | if (index > -1) {
|
37 | this.plugins.splice(index, 1);
|
38 | }
|
39 | };
|
40 |
|
41 | AbstractRenderer.prototype.getPlugins = function () {
|
42 | return this.plugins;
|
43 | };
|
44 |
|
45 | AbstractRenderer.prototype.getPlugin = function (name) {
|
46 | return this.plugins.find(function (plugin) {
|
47 | return plugin.name === name;
|
48 | });
|
49 | };
|
50 |
|
51 | AbstractRenderer.prototype.getConfig = function () {
|
52 | return this.config;
|
53 | };
|
54 |
|
55 | AbstractRenderer.prototype.setConfig = function (config) {
|
56 | Object.assign(this.config, config);
|
57 | };
|
58 |
|
59 | return AbstractRenderer;
|
60 | }();
|
61 |
|
62 | export { AbstractRenderer }; |
\ | No newline at end of file |