Interface ValueClass<T>
interface ValueClass<T extends SerialisesItself = SerialisesItself> {
prototype: T;
fromValue(value: PlainValue): T;
}
prototype: T;
fromValue(value: PlainValue): T;
}
Type Parameters
- T extends SerialisesItself = SerialisesItself
The type of its instances.
Methods
from Value
-
Makes an instance from the value an instance's
toValue()returned. It throws when it cannot.Parameters
- value: PlainValue
Returns T
A class whose instances turn themselves into values, and which makes an instance again from such a value.