ErasedType Class
Erased type which can be used to expose a opaque/erased version of a type without referencing the actual type.
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 ErasedType<out Name = unknown>
Type Parameters
| Parameter | Default | Description |
|---|---|---|
| Name | unknown |
Remarks
This similar to the type erasure pattern, but for erasing types at the package boundary.
This can be used to implement the TypeScript typing for the handle pattern, allowing code outside of a package to have a reference/handle to something in the package in a type safe way without the package having to publicly export the types of the object. This should not be confused with the more specific IFluidHandle which is also named after this design pattern.
Recommended usage is to use interface instead of type so tooling (such as tsc and refactoring tools) uses the type name instead of expanding it.