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.

76 lines
1.3 KiB

8 months ago
import State from './_state.ts'
8 months ago
/**
* Docket
*
* Is used to hold all data and configs that run through the actions
*
* @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 Docket {
// config for action
private config: object
// data
private data: object
private options: object
private db: object
8 months ago
private states: array
8 months ago
/**
*
*
* @param object config
*
*/
public constructor(config: object, db: object) {
this.config = config
this.db = db
8 months ago
this.states = []
8 months ago
}
public getData() {
return this.data
}
public setData(data: object) {
return this.data = data
}
public setOptions(options): object {
this.options = options
}
public getConfig(): object {
return this.config
}
public getDb(): object {
return this.db
}
8 months ago
public addState(value: State) {
this.states.push(value)
}
public hasState(value: State) {
let result = false
for (let index in this.states) {
if (this.states[index] == value) {
result = true
break
}
}
return result
}
8 months ago
}
export default Docket