2021-04-04 14:10:26 +02:00
|
|
|
import BaseTool, { ToolType } from './base';
|
|
|
|
import { BlockAPI, BlockTune as IBlockTune, BlockTuneConstructable } from '../../../types';
|
|
|
|
import { BlockTuneData } from '../../../types/block-tunes/block-tune-data';
|
2021-03-31 22:29:41 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Stub class for BlockTunes
|
|
|
|
*
|
|
|
|
* @todo Implement
|
|
|
|
*/
|
2021-04-04 14:10:26 +02:00
|
|
|
export default class BlockTune extends BaseTool<IBlockTune> {
|
2021-03-31 22:29:41 +02:00
|
|
|
/**
|
|
|
|
* Tool type — Tune
|
|
|
|
*/
|
|
|
|
public type = ToolType.Tune;
|
|
|
|
|
|
|
|
/**
|
2021-04-04 14:10:26 +02:00
|
|
|
* Tool's constructable blueprint
|
2021-03-31 22:29:41 +02:00
|
|
|
*/
|
2021-04-04 14:10:26 +02:00
|
|
|
protected readonly constructable: BlockTuneConstructable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructs new BlockTune instance from constructable
|
|
|
|
*
|
|
|
|
* @param data - Tune data
|
|
|
|
* @param block - Block API object
|
|
|
|
*/
|
|
|
|
public create(data: BlockTuneData, block: BlockAPI): IBlockTune {
|
|
|
|
// eslint-disable-next-line new-cap
|
|
|
|
return new this.constructable({
|
|
|
|
api: this.api.getMethodsForTool(this),
|
2021-07-21 20:33:09 +02:00
|
|
|
config: this.settings,
|
2021-04-04 14:10:26 +02:00
|
|
|
block,
|
|
|
|
data,
|
|
|
|
});
|
2021-03-31 22:29:41 +02:00
|
|
|
}
|
|
|
|
}
|