diff --git a/js/LinkableElement.ts b/js/LinkableElement.ts new file mode 100644 index 00000000..347e2b58 --- /dev/null +++ b/js/LinkableElement.ts @@ -0,0 +1,11 @@ +// Copyright 2023, University of Colorado Boulder +import PhetioObject from './PhetioObject.js'; + +/** + * When linking a PhET-iO Element via PhetioObject.addLinkedElement it uses this type. + * @see PhetioObject.addLinkedElement + * + * @author Sam Reid (PhET Interactive Simulations) + */ +type LinkableElement = Pick; +export default LinkableElement; \ No newline at end of file diff --git a/js/PhetioObject.ts b/js/PhetioObject.ts index e84dd9ae..cfb6f07c 100644 --- a/js/PhetioObject.ts +++ b/js/PhetioObject.ts @@ -28,6 +28,7 @@ import tandemNamespace from './tandemNamespace.js'; import IOType from './types/IOType.js'; import IntentionalAny from '../../phet-core/js/types/IntentionalAny.js'; import Disposable, { DisposableOptions } from '../../axon/js/Disposable.js'; +import LinkableElement from './LinkableElement.js'; // constants const PHET_IO_ENABLED = Tandem.PHET_IO_ENABLED; @@ -139,8 +140,6 @@ export type PhetioObjectOptions = SelfOptions & ParentOptions; type PhetioObjectMetadataKeys = keyof ( StrictOmit ) | 'phetioType'; export type PhetioObjectMetadataInput = Pick; -export type LinkableElement = Pick; - class PhetioObject extends Disposable { // assigned in initializePhetioObject - see docs at DEFAULTS declaration @@ -580,8 +579,7 @@ class PhetioObject extends Disposable { * association which is rendered in Studio as a "symbolic" link or hyperlink. Many common code UI elements use this * automatically. To keep client sites simple, this has a graceful opt-out mechanism which makes this function a * no-op if either this PhetioObject or the target PhetioObject is not instrumented. - * @param element - the target element. Must be instrumented for a LinkedElement to be created-- - * - otherwise it gracefully opts out + * @param element - the target element. Must be instrumented for a LinkedElement to be created-- otherwise gracefully opts out * @param [options] */ public addLinkedElement( element: LinkableElement, options?: LinkedElementOptions ): void {