Skip to content

Commit

Permalink
Update outdated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yishn committed Mar 22, 2023
1 parent 99290fb commit 0ec1a4b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/enum.ts
Expand Up @@ -5,9 +5,11 @@ declare const enumMutable: unique symbol;
const enumFactory = Symbol();

/**
* Create an enum type by defining all your variants in a class with
* the `Variant<T>()` function. The data type contained in the variants
* cannot be `undefined`. The variant name cannot be `_` as it is reserved.
* Create an enum type by defining all your variants in a class with the
* `Variant<T>()` function.
*
* The data type contained in the variants cannot be `undefined`. The variant
* name cannot be `_` as it is reserved.
*
* Then use the helper type `Enum` to create your enum type. To construct enums
* easier, you can use `Enum.factory()`.
Expand All @@ -22,9 +24,7 @@ const enumFactory = Symbol();
* type Message = Enum<MessageVariants>;
* ```
*
* It's also possible to create generic enum types. Mark any generic variants as
* type `unknown` in your variants object and supply the generic type in the
* type definition itself:
* It's also possible to create generic enum types:
*
* ```ts
* class MessageVariants<T> {
Expand Down Expand Up @@ -82,7 +82,7 @@ export class NonExhaustiveMatcherError extends Error {

export namespace Enum {
/**
* Creates easier constructors for the given enum type.
* Creates easier constructors for the given enum variants.
*
* ```ts
* class MessageVariants {
Expand Down

0 comments on commit 0ec1a4b

Please sign in to comment.