From 64b6862afcc4f5e91ab04ed2a090a8e513a6728e Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Sat, 5 Mar 2022 08:36:17 -0700 Subject: [PATCH] TypeScript conversion for RectangularPushButton/PushButtonModel (and inherited types), Slider/SliderTrack (and associated types), NumberControl/ArrowButton/NumberDisplay, see https://github.com/phetsims/scenery-phet/issues/726 --- js/Property.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/Property.ts b/js/Property.ts index 410c00e..85ca345 100644 --- a/js/Property.ts +++ b/js/Property.ts @@ -56,7 +56,13 @@ type PropertyOptions = Partial & { } & PhetioObjectOptions; // a Property (can't be a TinyProperty) with all of the value-mutation removed. -export type ReadOnlyProperty = Omit, 'set' | 'reset'> & { readonly value: T; }; +export interface ReadOnlyProperty extends Property { + readonly value: T; + + // Any solution with Omit, 'set' | 'reset'> was failing, as it wasn't assignable to PhetioObject + set: unknown & any; + reset: unknown & any; +} class Property extends PhetioObject implements IProperty {