ReSharper 2024.2 Help

Context actions for TypeScript

ReSharper provides the following context actions for TypeScript:

Name

Description

Change visibility modifier

Changes visibility of class and module members

Convert field to parameter-property

Introduces parameter-property declared as a constructor parameter from class field

Convert 'if' to 'switch' for enums

If a variable is subsequently checked in 'if's with enum values, replaces 'if' with a 'switch'

Convert member assigned by a lambda expression to function member

Type member, which is assigned by a lambda expression, generally may be converted to function member. Not guaranteed to work correctly if you have implicit method invocations via 'apply'.

Convert parameter-property to field

Introduces field from parameter-property declared in constructor

Create derived type

Creates class that implements interface or inherits class

Create from Usage

Creates class, interface, enum, module, member function, or member property from usage

For more information, refer to generate code from usage.

Create overload without parameter

Creates overload signature with an absence of specified parameter. Subsequent parameters in the main signature may be marked as optional if needed.

Create paired accessor

Creates paired accessor for currently implemented one

Dotted name to nested module

Creates nested module for dotted name segment. For example, converts 'module A.B.C' to 'module 'A.B' with nested module 'C'.

Import type or type element

Imports modules, classes, variable, interfaces, enums declared somewhere else

Inline type alias

Inlines a type alias, i.e. replaces its usages with the corresponding type and removes the type alias declaration

Introduce type alias

Introduces a new type alias for selection

Match file name with type name

Renames current file to match the name of the only top-level type declared therein

Move type to another file to match its name

Moves current type to another file so that its name matches the name of the type

Nested module to dotted name

Merges nested single exported module as dotted name. For example, converts 'module A.B' with nested exported 'module C' to 'module A.B.C'.

Replace alias with qualifier

Replaces alias with fully qualified name

Specify return type explicitly

Specifies function return type explicitly if it may be derived from returned values

Specify type explicitly

Specify variable type explicitly for declaration with assignment

Last modified: 11 February 2024