-
Notifications
You must be signed in to change notification settings - Fork 6
/
CurrentState.ts
34 lines (31 loc) · 1.06 KB
/
CurrentState.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* Copyright (C) 2023 Thirty Meter Telescope International Observatory
* SPDX-License-Identifier: Apache-2.0
*/
import type { Key } from './Key'
import type { Parameter } from './Parameter'
import { ParameterSetType } from './ParameterSetType'
import type { Prefix } from './Prefix'
/**
* A State variable that indicates the 'current' or actual state.
* @category Params
*/
export class CurrentState extends ParameterSetType<CurrentState> {
/**
* @param prefix identifies the target subsystem
* @param stateName identifies the name of the state
* @param paramSet an optional initial set of items (keys with values)
*/
constructor(readonly prefix: Prefix, readonly stateName: string, readonly paramSet: Parameter<Key>[] = []) {
super()
}
/**
* Create a new CurrentState instance when a parameter is added or removed
*
* @param data set of parameters
* @return a new instance of CurrentState with provided data
*/
create(data: Parameter<Key>[]): CurrentState {
return new CurrentState(this.prefix, this.stateName, data)
}
}