Skip to content

Commit

Permalink
make providedOptions required wherever its type has required fields, #…
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Mar 11, 2023
1 parent 4bfe584 commit f1bfddc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion js/common/view/AreaUnderCurvePlot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class AreaUnderCurvePlot extends Node {
curve: Curve,
chartTransform: ChartTransform,
xProperty: TReadOnlyProperty<number>,
providedOptions?: AreaUnderCurvePlotOptions ) {
providedOptions: AreaUnderCurvePlotOptions ) {

const options = optionize<AreaUnderCurvePlotOptions, SelfOptions, NodeOptions>()( {

Expand Down
2 changes: 1 addition & 1 deletion js/common/view/AreaUnderCurveScrubberNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class AreaUnderCurveScrubberNode extends ScrubberNode {

public constructor( areaUnderCurveScrubber: AreaUnderCurveScrubber,
chartTransform: ChartTransform,
providedOptions?: AreaUnderCurveScrubberNodeOptions ) {
providedOptions: AreaUnderCurveScrubberNodeOptions ) {

const options = optionize<AreaUnderCurveScrubberNodeOptions, SelfOptions, ScrubberNodeOptions>()( {

Expand Down
2 changes: 1 addition & 1 deletion js/common/view/CueingArrowsNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type CueingArrowsNodeOptions = SelfOptions & NodeTranslationOptions &

export default class CueingArrowsNode extends VBox {

public constructor( providedOptions?: CueingArrowsNodeOptions ) {
public constructor( providedOptions: CueingArrowsNodeOptions ) {

const upArrow = new ArrowNode( 0, 0, 0, -ARROW_LENGTH, ARROW_NODE_OPTIONS );
const downArrow = new ArrowNode( 0, 0, 0, ARROW_LENGTH, ARROW_NODE_OPTIONS );
Expand Down
2 changes: 1 addition & 1 deletion js/common/view/CurveManipulationWidthSlider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type CurveManipulationWidthSliderOptions = SelfOptions & PickRequired<HSliderOpt
export default class CurveManipulationWidthSlider extends HSlider {

public constructor( curveManipulationWidthProperty: Property<number>,
providedOptions?: CurveManipulationWidthSliderOptions ) {
providedOptions: CurveManipulationWidthSliderOptions ) {

// an array of numbers corresponding to the positions of the ticks (in model coordinate)
const tickValues = [ ...Array( NUMBER_OF_TICKS ) ].map( ( x, i ) =>
Expand Down
5 changes: 3 additions & 2 deletions js/common/view/GraphsNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ import CalculusGrapherPreferences from '../model/CalculusGrapherPreferences.js';
import CurvePoint from '../model/CurvePoint.js';
import AreaUnderCurveScrubberNode from './AreaUnderCurveScrubberNode.js';
import TangentScrubberNode from './TangentScrubberNode.js';
import PickRequired from '../../../../phet-core/js/types/PickRequired.js';

const GRAPH_NODE_Y_SPACING = 20; // vertical space between GraphNode instances, in view coordinates

type SelfOptions = EmptySelfOptions;

type GraphsNodeOptions = SelfOptions & StrictOmit<NodeOptions, 'children'>;
type GraphsNodeOptions = SelfOptions & StrictOmit<NodeOptions, 'children'> & PickRequired<NodeOptions, 'tandem'>;

export default class GraphsNode extends Node {

Expand Down Expand Up @@ -67,7 +68,7 @@ export default class GraphsNode extends Node {

private readonly graphSetsAnimator: GraphSetsAnimator;

public constructor( model: CalculusGrapherModel, providedOptions?: GraphsNodeOptions ) {
public constructor( model: CalculusGrapherModel, providedOptions: GraphsNodeOptions ) {

const options = optionize<GraphsNodeOptions, SelfOptions, NodeOptions>()( {

Expand Down
2 changes: 1 addition & 1 deletion js/common/view/TangentScrubberNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class TangentScrubberNode extends ScrubberNode {

public constructor( tangentScrubber: TangentScrubber,
chartTransform: ChartTransform,
providedOptions?: TangentScrubberNodeOptions ) {
providedOptions: TangentScrubberNodeOptions ) {

const options = optionize<TangentScrubberNodeOptions, SelfOptions, ScrubberNodeOptions>()( {

Expand Down

0 comments on commit f1bfddc

Please sign in to comment.