From 2dc362b17edb24f6f465ef1ee46596eee1c071ce Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Thu, 3 Mar 2022 18:05:31 -0700 Subject: [PATCH] Adding ReadOnlyProperty type in Property --- js/Property.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/Property.ts b/js/Property.ts index 128d290..794a8e4 100644 --- a/js/Property.ts +++ b/js/Property.ts @@ -55,6 +55,9 @@ type PropertyOptions = Partial & { isValidValue?: any } & PhetioObjectOptions; +// a Property (can't be a TinyProperty) with all of the value-mutation removed. +export type ReadOnlyProperty = Omit, 'set' | 'reset'> & { readonly value: T; }; + class Property extends PhetioObject implements IProperty { // Unique identifier for this Property.