docutils-ts
Version:
Port of the Python Docutils library to TypeScript
29 lines (28 loc) • 807 B
JavaScript
class StateFactory {
constructor(args) {
this.stateClasses = [];
this.args = args;
if (args && args.stateClasses && args.stateClasses.length) {
this.stateClasses = args.stateClasses;
}
else {
this.stateClasses = [];
}
}
createState(stateName, stateMachine) {
if (typeof stateName === 'undefined') {
throw new Error('Need argument stateName');
}
if (typeof stateMachine === 'undefined') {
throw new Error('Need argument stateMAchine');
}
throw new Error('unimpp');
}
getStateClasses() {
return this.stateClasses;
}
withStateClasses(stateClasses) {
return new StateFactory({ stateClasses });
}
}
export default StateFactory;