diff --git a/js/common/view/RAPKeyboardHelpContent.ts b/js/common/view/RAPKeyboardHelpContent.ts index 237b85ad..b54f79ec 100644 --- a/js/common/view/RAPKeyboardHelpContent.ts +++ b/js/common/view/RAPKeyboardHelpContent.ts @@ -10,21 +10,25 @@ import BasicActionsKeyboardHelpSection from '../../../../scenery-phet/js/keyboar import KeyboardHelpIconFactory from '../../../../scenery-phet/js/keyboard/help/KeyboardHelpIconFactory.js'; import KeyboardHelpSection from '../../../../scenery-phet/js/keyboard/help/KeyboardHelpSection.js'; import SliderControlsKeyboardHelpSection from '../../../../scenery-phet/js/keyboard/help/SliderControlsKeyboardHelpSection.js'; -import TwoColumnKeyboardHelpContent from '../../../../scenery-phet/js/keyboard/help/TwoColumnKeyboardHelpContent.js'; +import TwoColumnKeyboardHelpContent, { TwoColumnKeyboardHelpContentOptions } from '../../../../scenery-phet/js/keyboard/help/TwoColumnKeyboardHelpContent.js'; import LetterKeyNode from '../../../../scenery-phet/js/keyboard/LetterKeyNode.js'; import NumberKeyNode from '../../../../scenery-phet/js/keyboard/NumberKeyNode.js'; import TextKeyNode from '../../../../scenery-phet/js/keyboard/TextKeyNode.js'; import ratioAndProportion from '../../ratioAndProportion.js'; import ratioAndProportionStrings from '../../ratioAndProportionStrings.js'; import { NodeOptions } from '../../../../scenery/js/imports.js'; +import { EmptySelfOptions } from '../../../../phet-core/js/optionize.js'; + +type SelfOptions = EmptySelfOptions; +export type RAPKeyboardHelpContentOptions = SelfOptions & TwoColumnKeyboardHelpContentOptions; class RAPKeyboardHelpContent extends TwoColumnKeyboardHelpContent { /** * @param challengeHelpSection - keyboard help section for determining how to change the target ratio - * @param [options] - TODO: use TwoColumnKeyboardHelpContentOptions when available, https://github.com/phetsims/ratio-and-proportion/issues/404 + * @param [providedOptions] */ - public constructor( challengeHelpSection: KeyboardHelpSection, options?: NodeOptions ) { + public constructor( challengeHelpSection: KeyboardHelpSection, providedOptions?: RAPKeyboardHelpContentOptions ) { const moveLeftOrRightHandHelpSection = new SliderControlsKeyboardHelpSection( { headingString: ratioAndProportionStrings.moveHandsIndividually, @@ -42,7 +46,7 @@ class RAPKeyboardHelpContent extends TwoColumnKeyboardHelpContent { const leftContent = [ moveLeftOrRightHandHelpSection, new BothHandsHelpSection() ]; const rightContent = [ challengeHelpSection, basicActionsHelpSection ]; - super( leftContent, rightContent, options ); + super( leftContent, rightContent, providedOptions ); } } diff --git a/js/create/view/CreateScreenKeyboardHelpContent.ts b/js/create/view/CreateScreenKeyboardHelpContent.ts index a6ca1e9b..c4b1c7db 100644 --- a/js/create/view/CreateScreenKeyboardHelpContent.ts +++ b/js/create/view/CreateScreenKeyboardHelpContent.ts @@ -9,10 +9,13 @@ import KeyboardHelpIconFactory from '../../../../scenery-phet/js/keyboard/help/KeyboardHelpIconFactory.js'; import KeyboardHelpSection from '../../../../scenery-phet/js/keyboard/help/KeyboardHelpSection.js'; import TextKeyNode from '../../../../scenery-phet/js/keyboard/TextKeyNode.js'; -import RAPKeyboardHelpContent from '../../common/view/RAPKeyboardHelpContent.js'; +import RAPKeyboardHelpContent, { RAPKeyboardHelpContentOptions } from '../../common/view/RAPKeyboardHelpContent.js'; import ratioAndProportion from '../../ratioAndProportion.js'; import ratioAndProportionStrings from '../../ratioAndProportionStrings.js'; -import { NodeOptions } from '../../../../scenery/js/imports.js'; +import { EmptySelfOptions } from '../../../../phet-core/js/optionize.js'; + +type SelfOptions = EmptySelfOptions; +type CreateScreenKeyboardHelpContentOptions = SelfOptions & RAPKeyboardHelpContentOptions; class CreateScreenKeyboardHelpContent extends RAPKeyboardHelpContent { public constructor() { @@ -22,8 +25,7 @@ class CreateScreenKeyboardHelpContent extends RAPKeyboardHelpContent { class MyChallengeHelpSection extends KeyboardHelpSection { - // TODO: use KeyboardHelpSectionOptions when possible, https://github.com/phetsims/ratio-and-proportion/issues/404 - public constructor( options?: NodeOptions ) { + public constructor( options?: CreateScreenKeyboardHelpContentOptions ) { const setHandRatioValue = KeyboardHelpSection.labelWithIcon( ratioAndProportionStrings.setHandRatioValue, KeyboardHelpIconFactory.upDownArrowKeysRowIcon(), {