From 81a58a7f4f25b1845ef8185024cba8258ceee9b9 Mon Sep 17 00:00:00 2001 From: adjsky Date: Sun, 10 Mar 2024 18:28:53 +0300 Subject: [PATCH] update docs --- docs/classes/Err.html | 129 ++++++------ docs/classes/Ok.html | 129 ++++++------ docs/classes/ResultError.html | 6 +- docs/functions/combine.html | 2 +- docs/functions/err-1.html | 2 +- docs/functions/errAsync.html | 2 +- docs/functions/fromPromise.html | 2 +- docs/functions/fromThrowable.html | 2 +- docs/functions/ok-1.html | 2 +- docs/functions/okAsync.html | 2 +- docs/index.html | 2 +- docs/interfaces/ResultDeclarations.html | 113 +++++----- docs/types/AsyncResult.html | 260 ++++++++++++++---------- docs/types/Result.html | 2 +- docs/types/UnwrapErrs.html | 6 +- docs/types/UnwrapOks.html | 4 +- 16 files changed, 377 insertions(+), 288 deletions(-) diff --git a/docs/classes/Err.html b/docs/classes/Err.html index b624cc6..a68dde8 100644 --- a/docs/classes/Err.html +++ b/docs/classes/Err.html @@ -31,7 +31,7 @@

Implements

+
  • Defined in packages/resulto/src/result.ts:608
  • @@ -99,14 +99,14 @@

    Parameters

    error: E

    Returns Err<T, E>

    +
  • Defined in packages/resulto/src/result.ts:609
  • Properties

    error: E
    +
  • Defined in packages/resulto/src/result.ts:609
  • Methods

    @@ -125,7 +125,7 @@

    Returns

    +
  • Defined in packages/resulto/src/result.ts:689
  • +
  • Defined in packages/resulto/src/result.ts:693
  • +
  • Defined in packages/resulto/src/result.ts:697
  • +
  • Defined in packages/resulto/src/result.ts:631
  • +
  • Defined in packages/resulto/src/result.ts:655
  • +
  • Defined in packages/resulto/src/result.ts:639
  • +
  • Defined in packages/resulto/src/result.ts:647
  • +
  • Defined in packages/resulto/src/result.ts:729
  • +
  • Defined in packages/resulto/src/result.ts:709
  • +
  • Defined in packages/resulto/src/result.ts:721
  • +
  • Defined in packages/resulto/src/result.ts:673
  • +
  • Defined in packages/resulto/src/result.ts:681
  • +
  • Defined in packages/resulto/src/result.ts:659
  • +
  • Defined in packages/resulto/src/result.ts:663
  • +
  • Defined in packages/resulto/src/result.ts:619
  • +
  • Defined in packages/resulto/src/result.ts:623
  • +
  • Defined in packages/resulto/src/result.ts:611
  • +
  • Defined in packages/resulto/src/result.ts:615
  • +
  • Defined in packages/resulto/src/result.ts:627
  • +
  • Defined in packages/resulto/src/result.ts:651
  • +
  • Defined in packages/resulto/src/result.ts:635
  • +
  • Defined in packages/resulto/src/result.ts:643
  • +
  • Defined in packages/resulto/src/result.ts:725
  • +
  • Defined in packages/resulto/src/result.ts:701
  • +
  • Defined in packages/resulto/src/result.ts:705
  • +
  • Defined in packages/resulto/src/result.ts:669
  • +
  • Defined in packages/resulto/src/result.ts:677
  • +
  • Defined in packages/resulto/src/result.ts:685
  • +
  • Defined in packages/resulto/src/result.ts:713
  • +
  • Defined in packages/resulto/src/result.ts:717
  • +
  • Defined in packages/resulto/src/result.ts:563
    • @@ -155,15 +155,16 @@

      Returns

    +
  • Defined in packages/resulto/src/result.ts:567
  • +
  • Defined in packages/resulto/src/result.ts:571
  • +
  • Defined in packages/resulto/src/result.ts:502
  • +
  • Defined in packages/resulto/src/result.ts:529
  • +
  • Defined in packages/resulto/src/result.ts:510
  • +
  • Defined in packages/resulto/src/result.ts:518
  • +
  • Defined in packages/resulto/src/result.ts:603
  • +
  • Defined in packages/resulto/src/result.ts:583
  • +
  • Defined in packages/resulto/src/result.ts:595
  • +
  • Defined in packages/resulto/src/result.ts:547
  • +
  • Defined in packages/resulto/src/result.ts:555
  • +
  • Defined in packages/resulto/src/result.ts:533
  • +
  • Defined in packages/resulto/src/result.ts:539
  • +
  • Defined in packages/resulto/src/result.ts:490
  • +
  • Defined in packages/resulto/src/result.ts:494
  • +
  • Defined in packages/resulto/src/result.ts:482
  • +
  • Defined in packages/resulto/src/result.ts:486
  • +
  • Defined in packages/resulto/src/result.ts:498
  • +
  • Defined in packages/resulto/src/result.ts:525
  • +
  • Defined in packages/resulto/src/result.ts:506
  • +
  • Defined in packages/resulto/src/result.ts:514
  • +
  • Defined in packages/resulto/src/result.ts:599
  • +
  • Defined in packages/resulto/src/result.ts:575
  • +
  • Defined in packages/resulto/src/result.ts:579
  • +
  • Defined in packages/resulto/src/result.ts:543
  • +
  • Defined in packages/resulto/src/result.ts:551
  • +
  • Defined in packages/resulto/src/result.ts:559
  • +
  • Defined in packages/resulto/src/result.ts:587
  • +
  • Defined in packages/resulto/src/result.ts:591
  • Returns AsyncResult<U, E | F>

    -
    -

    See

    ResultDeclarations.andThen for details.

    -
  • asyncAndThen:function
    • +

      Calls f if the result is Ok, otherwise returns the Err value.

      +

      This function can be used for control flow based on AsyncResult values.

      +

      Use this method instead of AsyncResult.andThen when the provided +f returns promise.

      +

      Type Parameters

        @@ -92,16 +98,20 @@

        Parameters

      • f: Fn<T, Promise<Result<U, F>>>
  • Returns AsyncResult<U, E | F>

    -
  • asyncMap:function
    • +

      Maps an AsyncResult<T, E> to AsyncResult<U, E> by applying a function +f to a contained Ok value, leaving an Err value untouched.

      +

      This function can be used to compose the results of two functions.

      +

      Use this method instead of AsyncResult.map when the provided f +returns promise.

      +

      Type Parameters

        @@ -113,16 +123,21 @@

        Parameters

      • f: Fn<T, Promise<U>>
  • Returns AsyncResult<U, E>

    -
    -

    See

    ResultDeclarations.asyncMap for details.

    -
  • asyncMapErr:function
    • +

      Maps an AsyncResult<T, E> to AsyncResult<T, F> by applying a function +to a contained Err value, leaving an Ok value untouched.

      +

      This function can be used to pass through a successful result while +handling an error.

      +

      Use this method instead of AsyncResult.mapErr when the provided f +returns promise.

      +

      Type Parameters

        @@ -134,16 +149,19 @@

        Parameters

      • f: ErrFn<E, Promise<F>>
  • Returns AsyncResult<T, F>

    -
    -

    See

    ResultDeclarations.asyncMapErr for details.

    -
  • asyncMapOr:function
    • +

      Returns the provided value (if Err), or applies a function to the +contained value (if Ok).

      +

      Use this method instead of AsyncResult.mapOr when the provided f +returns promise.

      +

      Type Parameters

        @@ -157,16 +175,22 @@
        value: f: Fn<T, Promise<U>>
  • Returns Promise<U>

    -
    -

    See

    ResultDeclarations.asyncMapOr for details.

    -
  • asyncMapOrElse:function
    • +

      Maps an AsyncResult<T, E> to Promise<U> by applying function +fallbackFn to a contained Err value, or function f to a contained +Ok value.

      +

      This function can be used to unpack a successful result while handling an +error.

      +

      Use this method instead of AsyncResult.mapOrElse when the provided +fallbackFn or f return promise.

      +

      Type Parameters

        @@ -180,16 +204,19 @@
        fallbackFn:
        f: Fn<T, U | Promise<U>>
  • Returns Promise<U>

    -
  • asyncMatch:function
    • +

      Calls okFn if the result is Ok, otherwise calls errFn.

      +

      Both okFn and errFn must have the same return type.

      +

      Use this method instead of AsyncResult.match when the provided +okFn or errFn return promise.

      +

      Type Parameters

        @@ -203,16 +230,19 @@
        okFn: errFn: ErrFn<E, U | Promise<U>>
  • Returns Promise<U>

    -
    -

    See

    ResultDeclarations.asyncMatch for details.

    -
  • asyncOrElse:function
    • +

      Calls f if the result is Err, otherwise returns the Ok value.

      +

      This function can be used for control flow based on AsyncResult values.

      +

      Use this method instead of AsyncResult.orElse when the provided f +returns promise.

      +

      Type Parameters

        @@ -226,16 +256,18 @@

        Parameters

      • f: ErrFn<E, Promise<Result<U, F>>>
  • Returns AsyncResult<T | U, F>

    -
    -

    See

    ResultDeclarations.asyncOrElse for details.

    -
  • asyncUnwrapOrElse:function
    • +

      Returns the contained Ok value or computes it from a f.

      +

      Use this method instead of AsyncResult.unwrapOrElse when the +provided f returns promise.

      +

      Type Parameters

        @@ -247,80 +279,84 @@

        Parameters

      • f: ErrFn<E, Promise<U>>
  • Returns Promise<T | U>

    -
  • expect:function
    • +

      Returns the contained Ok value.

      +

      This function may throw UnwrapError (if Err).

      +

      Parameters

      • msg: string

      Returns Promise<T>

      -
      -

      See

      ResultDeclarations.expect for details.

      -
  • +
  • Defined in packages/resulto/src/result.ts:368
  • expectErr:function
    • +

      Returns the contained Err value.

      +

      This function may throw UnwrapError (if Ok).

      +

      Parameters

      • msg: string

      Returns Promise<E>

      -
      -

      See

      ResultDeclarations.expectErr for details.

      -
  • +
  • Defined in packages/resulto/src/result.ts:382
  • inspect:function
  • +
  • Defined in packages/resulto/src/result.ts:349
  • inspectErr:function
  • +
  • Defined in packages/resulto/src/result.ts:354
  • map:function
    • +

      Maps an AsyncResult<T, E> to AsyncResult<U, E> by applying a function +f to a contained Ok value, leaving an Err value untouched.

      +

      This function can be used to compose the results of two functions.

      +

      Type Parameters

        @@ -332,16 +368,19 @@

        Parameters

      • f: Fn<T, U>
  • Returns AsyncResult<U, E>

    -
    -

    See

    ResultDeclarations.map for details.

    -
  • mapErr:function
  • +
  • Defined in packages/resulto/src/result.ts:291
  • mapOr:function
  • +
  • Defined in packages/resulto/src/result.ts:309
  • mapOrElse:function
  • +
  • Defined in packages/resulto/src/result.ts:328
  • match:function
  • +
  • Defined in packages/resulto/src/result.ts:463
  • or:function
  • +
  • Defined in packages/resulto/src/result.ts:416
  • orElse:function
  • +
  • Defined in packages/resulto/src/result.ts:423
  • tap:function
  • +
  • Defined in packages/resulto/src/result.ts:361
  • unwrap:function
  • +
  • Defined in packages/resulto/src/result.ts:375
  • unwrapErr:function
  • +
  • Defined in packages/resulto/src/result.ts:389
  • unwrapOr:function
  • +
  • Defined in packages/resulto/src/result.ts:438
  • unwrapOrElse:function
  • +
  • Defined in packages/resulto/src/result.ts:448
  • +
  • Defined in packages/resulto/src/result.ts:258
  • +
  • Defined in packages/resulto/src/utility.ts:21