Skip to content

Commit

Permalink
Specify type alias for empty self options, see #214
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed May 24, 2023
1 parent 52b2037 commit b0d4e58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion js/common/view/CAVObjectNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import PickRequired from '../../../../phet-core/js/types/PickRequired.js';
import Multilink from '../../../../axon/js/Multilink.js';
import optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js';

type SelfOptions = EmptySelfOptions;

export type CAVObjectNodeOptions =

// Take all options from NodeOptions, but do not allow passing through inputEnabledProperty since it requires special handling in multilink
Expand All @@ -36,7 +38,7 @@ export default class CAVObjectNode extends Node {
modelRadius: number,
providedOptions?: CAVObjectNodeOptions ) {

const options = optionize<CAVObjectNodeOptions, EmptySelfOptions, NodeOptions>()( {
const options = optionize<CAVObjectNodeOptions, SelfOptions, NodeOptions>()( {
cursor: 'pointer'
}, providedOptions );
super( options );
Expand Down
3 changes: 2 additions & 1 deletion js/common/view/DragIndicatorArrowNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ import PickRequired from '../../../../phet-core/js/types/PickRequired.js';
import optionize, { EmptySelfOptions } from '../../../../phet-core/js/optionize.js';
import { NodeOptions } from '../../../../scenery/js/imports.js';

type SelfOptions = EmptySelfOptions;
type DragIndicatorArrowNodeOptions = PickRequired<ArrowNodeOptions, 'tandem'> & Pick<ArrowNodeOptions, 'visible'> & NodeOptions;

export default class DragIndicatorArrowNode extends ArrowNode {

public constructor( options: DragIndicatorArrowNodeOptions ) {

super( 0, 0, 35, 0, optionize<DragIndicatorArrowNodeOptions, EmptySelfOptions, ArrowNodeOptions>()( {
super( 0, 0, 35, 0, optionize<DragIndicatorArrowNodeOptions, SelfOptions, ArrowNodeOptions>()( {
headHeight: 8,
headWidth: 12,
tailWidth: 5,
Expand Down

0 comments on commit b0d4e58

Please sign in to comment.