store_value.ts 495 B

1234567891011121314151617181920212223242526
  1. import { IStoreValue } from "./istore_value";
  2. import { Type } from "../../typeSystem/type";
  3. export class StoreValue implements IStoreValue {
  4. public type: Type;
  5. public id?: String;
  6. public isConst: boolean;
  7. public value: any;
  8. constructor(type: Type, value: any, id?:String, isConst = false) {
  9. this.type = type;
  10. this.id = id;
  11. this.isConst = isConst
  12. this.value = value;
  13. }
  14. get (): any {
  15. return this.value;
  16. }
  17. inStore () {
  18. return this.id != null;
  19. }
  20. }