| 74 | public register(input: ModifierConstructor): Modifier; |
| 75 | public register(input: PluginConstructor, options?: PluginOptions): Plugin; |
| 76 | public register(input: any, options?: Record<string, any>) { |
| 77 | if (input instanceof Draggable) { |
| 78 | return this.draggables.register(input.id, input as T); |
| 79 | } |
| 80 | |
| 81 | if (input instanceof Droppable) { |
| 82 | return this.droppables.register(input.id, input as U); |
| 83 | } |
| 84 | |
| 85 | if (input.prototype instanceof Modifier) { |
| 86 | return this.modifiers.register(input, options); |
| 87 | } |
| 88 | |
| 89 | if (input.prototype instanceof Sensor) { |
| 90 | return this.sensors.register(input, options); |
| 91 | } |
| 92 | |
| 93 | if (input.prototype instanceof Plugin) { |
| 94 | return this.plugins.register(input, options); |
| 95 | } |
| 96 | |
| 97 | throw new Error('Invalid instance type'); |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Unregisters an entity, plugin, sensor, or modifier. |