diff --git a/js/molecules/view/MoleculesScreenView.ts b/js/molecules/view/MoleculesScreenView.ts index 9f746a0..43e3387 100644 --- a/js/molecules/view/MoleculesScreenView.ts +++ b/js/molecules/view/MoleculesScreenView.ts @@ -9,20 +9,20 @@ import Dimension2 from '../../../../dot/js/Dimension2.js'; import { combineOptions } from '../../../../phet-core/js/optionize.js'; import Tandem from '../../../../tandem/js/Tandem.js'; -import Reaction from '../../common/model/Reaction.js'; import RPALConstants from '../../common/RPALConstants.js'; import BeforeAfterNode, { BeforeAfterNodeOptions } from '../../common/view/BeforeAfterNode.js'; import MoleculesEquationNode from '../../common/view/MoleculesEquationNode.js'; import RPALScreenView, { CreateBeforeAfterNodeFunction } from '../../common/view/RPALScreenView.js'; import reactantsProductsAndLeftovers from '../../reactantsProductsAndLeftovers.js'; import MoleculesModel from '../model/MoleculesModel.js'; +import { CreateEquationNodeFunction } from '../../common/view/ReactionBarNode.js'; export default class MoleculesScreenView extends RPALScreenView { public constructor( model: MoleculesModel, tandem: Tandem ) { // Creates an equation for a specified reaction. - const createEquationNode = ( reaction: Reaction ) => new MoleculesEquationNode( reaction ); + const createEquationNode: CreateEquationNodeFunction = reaction => new MoleculesEquationNode( reaction ); // Creates the Before/After interface for a specified reaction. const createBeforeAfterNode: CreateBeforeAfterNodeFunction = diff --git a/js/sandwiches/view/SandwichesScreenView.ts b/js/sandwiches/view/SandwichesScreenView.ts index e7b4a90..43283ff 100644 --- a/js/sandwiches/view/SandwichesScreenView.ts +++ b/js/sandwiches/view/SandwichesScreenView.ts @@ -16,8 +16,8 @@ import ReactantsProductsAndLeftoversStrings from '../../ReactantsProductsAndLeft import SandwichesModel from '../model/SandwichesModel.js'; import SandwichesEquationNode from './SandwichesEquationNode.js'; import SandwichNode from './SandwichNode.js'; -import SandwichRecipe from '../model/SandwichRecipe.js'; import { combineOptions } from '../../../../phet-core/js/optionize.js'; +import { CreateEquationNodeFunction } from '../../common/view/ReactionBarNode.js'; export default class SandwichesScreenView extends RPALScreenView { @@ -29,7 +29,9 @@ export default class SandwichesScreenView extends RPALScreenView { const maxSandwichSize = new Dimension2( maxSandwich.width, maxSandwich.height ); // Creates an equation for a specified reaction. - const createEquationNode = ( reaction: SandwichRecipe ) => new SandwichesEquationNode( reaction, maxSandwichSize ); + //TODO https://github.com/phetsims/reactants-products-and-leftovers/issues/80 TS2345: Argument of type 'Reaction' is not assignable to parameter of type 'SandwichRecipe'. + // @ts-expect-error + const createEquationNode: CreateEquationNodeFunction = reaction => new SandwichesEquationNode( reaction, maxSandwichSize ); // Creates the Before/After interface for a specified reaction. const createBeforeAfterNode: CreateBeforeAfterNodeFunction = @@ -44,8 +46,6 @@ export default class SandwichesScreenView extends RPALScreenView { boxYMargin: 8 // large enough to accommodate the biggest sandwich }, options ) ); - //TODO https://github.com/phetsims/reactants-products-and-leftovers/issues/80 createEquationNode argument - // @ts-expect-error super( model, createEquationNode, createBeforeAfterNode, tandem ); } }