Skip to main content

ErasedBaseType Class

Used to mark a @sealed interface in a strongly typed way to prevent external implementations.

This API is reserved for internal system use and should not be imported directly. It may change at any time without notice.

For more information about our API support guarantees, see here.

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Signature

/** @sealed */
export declare abstract class ErasedBaseType<out Name = unknown>

Type Parameters

ParameterDefaultDescription
Nameunknown

Remarks

This is an alternative to ErasedType which is more ergonomic to implement in the case where the implementation can extend ErasedTypeImplementation.

Users of interfaces extending this should never refer to anything about this class: migrating the type branding to another mechanism, like ErasedType should be considered a non-breaking change.

Constructors

ConstructorAlertsDescription
(constructor)()BetaThis class should never exist at runtime, so make it un-constructable.

Methods

MethodAlertsReturn TypeDescription
brand(dummy)BetaNameCompile time only marker to make type checking more strict. This method will not exist at runtime and accessing it is invalid.

Constructor Details

(constructor)

This class should never exist at runtime, so make it un-constructable.

This API is reserved for internal system use and should not be imported directly. It may change at any time without notice.

For more information about our API support guarantees, see here.

Signature

protected constructor();

Method Details

brand

Compile time only marker to make type checking more strict. This method will not exist at runtime and accessing it is invalid.

This API is reserved for internal system use and should not be imported directly. It may change at any time without notice.

For more information about our API support guarantees, see here.

Signature

protected abstract brand(dummy: never): Name;

Parameters

ParameterTypeDescription
dummynever

Returns

Return type: Name