{
  "id": "@typed/fx/Fx#mapBoth",
  "canonicalId": "@typed/fx/Fx#mapBoth",
  "symbol": {
    "id": "@typed/fx/Fx#mapBoth",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "mapBoth",
    "kind": "constant",
    "signatures": [
      "export declare const mapBoth: {\n    <E, E2, A, A2>(options: {\n        readonly onFailure: (e: E) => E2;\n        readonly onSuccess: (a: A) => A2;\n    }): <R>(self: Fx<A, E, R>) => Fx<A2, E2, R>;\n    <A, E, R, E2, A2>(self: Fx<A, E, R>, options: {\n        readonly onFailure: (e: E) => E2;\n        readonly onSuccess: (a: A) => A2;\n    }): Fx<A2, E2, R>;\n};"
    ],
    "summary": "Transforms both the success and error channels of an Fx using the provided options.\n\nMirrors `Effect.mapBoth`: `onSuccess` maps emitted values, `onFailure` maps the\ntyped failure (via `Cause.map`); defects and interrupts are preserved.",
    "sections": {
      "Why": "`mapBoth` transforms success values and typed failures together while preserving the rest of an\nEffect `Cause`. Every success still emits once in order; only typed failure values are mapped.",
      "Ownership and lifetime": "Both callbacks are synchronous and the operation acquires no resources. Defects, interruption,\nservice requirements, and source lifetime pass through unchanged."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\n\nconst normalized = Fx.fail(\"offline\").pipe(Fx.mapBoth({\n  onFailure: (message) => new Error(message),\n  onSuccess: (value) => String(value),\n}))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/mapBoth.ts",
      "line": 35
    },
    "since": "1.0.0",
    "category": "Errors and recovery"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#mapBoth",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "mapBoth",
    "qualifiedName": "mapBoth",
    "declarationKey": "declaration:015676827e09e74a917ddb9b",
    "family": "variable",
    "signatures": [
      "export declare const mapBoth: {\n    <E, E2, A, A2>(options: {\n        readonly onFailure: (e: E) => E2;\n        readonly onSuccess: (a: A) => A2;\n    }): <R>(self: Fx<A, E, R>) => Fx<A2, E2, R>;\n    <A, E, R, E2, A2>(self: Fx<A, E, R>, options: {\n        readonly onFailure: (e: E) => E2;\n        readonly onSuccess: (a: A) => A2;\n    }): Fx<A2, E2, R>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/mapBoth.ts",
        "start": {
          "line": 35,
          "column": 14
        },
        "end": {
          "line": 59,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/mapBoth.ts",
        "start": {
          "line": 36,
          "column": 3
        },
        "end": {
          "line": 39,
          "column": 47
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/mapBoth.ts",
        "start": {
          "line": 41,
          "column": 3
        },
        "end": {
          "line": 44,
          "column": 20
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.mapBoth"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:015676827e09e74a917ddb9b",
    "name": "mapBoth",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const mapBoth: {\n    <E, E2, A, A2>(options: {\n        readonly onFailure: (e: E) => E2;\n        readonly onSuccess: (a: A) => A2;\n    }): <R>(self: Fx<A, E, R>) => Fx<A2, E2, R>;\n    <A, E, R, E2, A2>(self: Fx<A, E, R>, options: {\n        readonly onFailure: (e: E) => E2;\n        readonly onSuccess: (a: A) => A2;\n    }): Fx<A2, E2, R>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/mapBoth.ts",
            "start": {
              "line": 35,
              "column": 14
            },
            "end": {
              "line": 59,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<E, E2, A, A2>(options: {\n    readonly onFailure: (e: E) => E2;\n    readonly onSuccess: (a: A) => A2;\n}): <R>(self: Fx<A, E, R>) => Fx<A2, E2, R>;",
          "<A, E, R, E2, A2>(self: Fx<A, E, R>, options: {\n    readonly onFailure: (e: E) => E2;\n    readonly onSuccess: (a: A) => A2;\n}): Fx<A2, E2, R>;"
        ],
        "typeParameters": [
          "E",
          "E2",
          "A",
          "A2",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/mapBoth.ts",
            "start": {
              "line": 36,
              "column": 3
            },
            "end": {
              "line": 39,
              "column": 47
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/mapBoth.ts",
            "start": {
              "line": 41,
              "column": 3
            },
            "end": {
              "line": 44,
              "column": 20
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const mapBoth: {\n    <E, E2, A, A2>(options: {\n        readonly onFailure: (e: E) => E2;\n        readonly onSuccess: (a: A) => A2;\n    }): <R>(self: Fx<A, E, R>) => Fx<A2, E2, R>;\n    <A, E, R, E2, A2>(self: Fx<A, E, R>, options: {\n        readonly onFailure: (e: E) => E2;\n        readonly onSuccess: (a: A) => A2;\n    }): Fx<A2, E2, R>;\n};"
    ],
    "typeParameters": [
      "E",
      "E2",
      "A",
      "A2",
      "R"
    ],
    "summary": "Transforms both the success and error channels of an Fx using the provided options.\n\nMirrors `Effect.mapBoth`: `onSuccess` maps emitted values, `onFailure` maps the\ntyped failure (via `Cause.map`); defects and interrupts are preserved.",
    "sections": {
      "Why": "`mapBoth` transforms success values and typed failures together while preserving the rest of an\nEffect `Cause`. Every success still emits once in order; only typed failure values are mapped.",
      "Ownership and lifetime": "Both callbacks are synchronous and the operation acquires no resources. Defects, interruption,\nservice requirements, and source lifetime pass through unchanged."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\n\nconst normalized = Fx.fail(\"offline\").pipe(Fx.mapBoth({\n  onFailure: (message) => new Error(message),\n  onSuccess: (value) => String(value),\n}))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/mapBoth.ts",
        "start": {
          "line": 35,
          "column": 14
        },
        "end": {
          "line": 59,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/mapBoth.ts",
        "start": {
          "line": 36,
          "column": 3
        },
        "end": {
          "line": 39,
          "column": 47
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/mapBoth.ts",
        "start": {
          "line": 41,
          "column": 3
        },
        "end": {
          "line": 44,
          "column": 20
        }
      }
    ],
    "since": "1.0.0",
    "category": "Errors and recovery"
  }
}
