You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
960 B
47 lines
960 B
8 months ago
|
import ActionInterface from './actionInterface.ts'
|
||
|
import Docket from './../docket.ts'
|
||
|
|
||
|
/**
|
||
|
* Action
|
||
|
*
|
||
|
* @author Björn Hase <me@herr-hase.wtf>
|
||
|
* @license http://opensource.org/licenses/MIT The MIT License
|
||
|
* @link https://git.node001.net/HerrHase/super-hog.git
|
||
|
*
|
||
|
*/
|
||
|
class Action implements ActionInterface {
|
||
|
|
||
|
private docket: Docket
|
||
|
private data: object
|
||
|
private result: object
|
||
|
private options: object
|
||
|
private config: object
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
*
|
||
|
*
|
||
|
*/
|
||
|
public constructor(docket: Docket, options: object = {}) {
|
||
|
this.docket = docket
|
||
|
this.data = docket.getData()
|
||
|
|
||
|
// current data will be set as data
|
||
|
this.result = this.data
|
||
|
|
||
|
this.options = options
|
||
|
this.config = docket.getConfig()
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* set result as data
|
||
|
*
|
||
|
*/
|
||
|
public getDocket() {
|
||
|
this.docket.setData(this.result)
|
||
|
return this.docket
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default Action
|