Skip to content

PickRequired

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/phet-core/blob/main/js/types/PickRequired.ts for the most up-to-date information.

Overview

Type PickRequired

Use PickRequired to pick properties of a type T and make them required. This is useful when picking superclass options that you want to expose in a subclass API. It makes life a little easier because you have to fiddle with fewer '<' and '>' characters.

Example: type MyClassOptions = PickRequired<PhetioObjectOptions, 'tandem' | 'phetioDocumentation'>; Result:

@author Chris Malley (PixelZoom, Inc.)

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

Pick<Required<T>, list>

Source Code

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