From a38712b3aaa9b80d40588bbd2d360d64477e0831 Mon Sep 17 00:00:00 2001 From: Michael Kauzmann Date: Tue, 9 Jul 2024 12:45:56 -0600 Subject: [PATCH] fix type problems, https://github.com/phetsims/scenery/issues/1641 Signed-off-by: Michael Kauzmann --- js/util/GatedVisibleProperty.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/js/util/GatedVisibleProperty.ts b/js/util/GatedVisibleProperty.ts index 5cb8375db..871a96c97 100644 --- a/js/util/GatedVisibleProperty.ts +++ b/js/util/GatedVisibleProperty.ts @@ -22,7 +22,7 @@ import StrictOmit from '../../../phet-core/js/types/StrictOmit.js'; type SelfOptions = { selfVisibleInitiallyVisible?: boolean; - selfVisiblePropertyOptions: StrictOmit, 'tandem'>; + selfVisiblePropertyOptions?: BooleanPropertyOptions; }; type ParentOptions = DerivedPropertyOptions; type GatedVisiblePropertyOptions = SelfOptions & StrictOmit; @@ -30,19 +30,19 @@ type GatedVisiblePropertyOptions = SelfOptions & StrictOmit { public readonly selfVisibleProperty: TProperty; - public constructor( providedVisibleProperty: TReadOnlyProperty, tandem: Tandem, providedOptions?: GatedVisiblePropertyOptions ) { + public constructor( providedVisibleProperty: TReadOnlyProperty, parentTandem: Tandem, providedOptions?: GatedVisiblePropertyOptions ) { const options = optionize()( { selfVisibleInitiallyVisible: true, selfVisiblePropertyOptions: { - tandem: tandem.createTandem( 'selfVisibleProperty' ), + tandem: parentTandem.createTandem( 'selfVisibleProperty' ), phetioFeatured: true, phetioDocumentation: 'Provides an additional way to toggle the visibility for the PhET-iO Element.' }, - tandem: tandem.createTandem( 'visibleProperty' ), - phetioValueType: BooleanIO, - phetioDocumentation: null + tandem: parentTandem.createTandem( 'visibleProperty' ), + phetioValueType: BooleanIO + // see below for phetioDocumentation }, providedOptions ); const selfVisibleProperty = new BooleanProperty( options.selfVisibleInitiallyVisible, options.selfVisiblePropertyOptions ); @@ -50,8 +50,11 @@ class GatedVisibleProperty extends DerivedProperty2 { options.phetioDocumentation = `Whether the PhET-iO Element is visible, see ${selfVisibleProperty.tandem.name} for customization.`; } - super( [ providedVisibleProperty, selfVisibleProperty ], - ( providedVisible, selfVisible ) => providedVisible && selfVisible, options ); + super( + [ providedVisibleProperty, selfVisibleProperty ], + ( providedVisible, selfVisible ) => providedVisible && selfVisible, + options + ); this.selfVisibleProperty = selfVisibleProperty; }