Skip to content

RequiredOption

Overview

Allows grabbing the type of a required option out of a type. For example if we have

type SelfOptions = { something?: number | string | Property<Ray2>; };

This can be used in a field of the type as:

something: RequiredOption<SelfOptions, 'something'>;

@author Jonathan Olson <jonathan.olson@colorado.edu>

Type RequiredOption

import type { RequiredOption } from 'scenerystack/phet-core';

NotUndefined<Options[ Name ]>

Source Code

See the source for RequiredOption.ts in the phet-core repository.