{
  "id": "@typed/fx#Fx.Fx",
  "canonicalId": "@typed/fx/Fx#Fx",
  "symbol": {
    "id": "@typed/fx#Fx.Fx",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.Fx",
    "kind": "interface",
    "signatures": [
      "export interface Fx<A, E = never, R = never> extends Pipeable {\n    readonly [FxTypeId]: Fx.Variance<A, E, R>;\n    readonly run: <RSink>(sink: Sink.Sink<A, E, RSink>) => Effect.Effect<unknown, never, R | RSink>;\n}",
      "export declare namespace Fx {\n    type Any = Fx<any, any, any>;\n    interface Variance<A, E, R> {\n        readonly _A: Types.Covariant<A>;\n        readonly _E: Types.Covariant<E>;\n        readonly _R: Types.Covariant<R>;\n    }\n    type Success<T> = [\n        T\n    ] extends [\n        never\n    ] ? never : T extends Fx<infer _A, infer _E, infer _R> ? _A : never;\n    type Error<T> = [\n        T\n    ] extends [\n        never\n    ] ? never : T extends Fx<infer _A, infer _E, infer _R> ? _E : never;\n    type Services<T> = [\n        T\n    ] extends [\n        never\n    ] ? never : [\n        T\n    ] extends [\n        Fx<infer _A, infer _E, infer _R>\n    ] ? _R : never;\n    interface Service<Self, Id extends string, A, E> extends Fx<A, E, Self> {\n        readonly id: Id;\n        readonly service: Context.Service<Self, Fx<A, E>>;\n        readonly make: <R = never>(fx: Fx<A, E, R> | Effect.Effect<Fx<A, E, R>, E, R>) => Layer<Self, E, Exclude<R, Scope.Scope>>;\n    }\n    interface Class<Self, Id extends string, A, E> extends Service<Self, Id, A, E> {\n        new (): Service<Self, Id, A, E>;\n    }\n}"
    ],
    "summary": "`Fx` is a reactive stream of values that supports concurrency, error handling,\nand context management, fully integrated with the Effect ecosystem.\n\nConceptually, an `Fx<A, E, R>` is a push-based stream that:\n- Emits values of type `A`\n- Can fail with an error of type `E`\n- Requires a context/environment of type `R`\n\nUnlike a standard `Effect` which produces a single value, `Fx` can produce\n0, 1, or many values over time. It is similar to RxJS Observables or\nAsyncIterables, but built on top of Effect's fiber-based concurrency model.",
    "sections": {
      "Why": "Browser events, clocks, sockets, and users decide when work exists. `Fx`\nmodels that producer-driven direction while retaining Effect's explicit\nsuccess, error, and service channels. An `Effect`, `Stream`, `Promise`,\n`ReadableStream`, iterable, or custom source can participate through an\nexplicit constructor; `Fx` extends the Effect ecosystem rather than\nreplacing it.",
      "Ownership and lifetime": "Constructing an `Fx` starts no work. Calling `run` returns an `Effect` whose\nrunning fiber and `Scope` own subscriptions, child fibers, and finalizers.\nInterruption propagates through that Effect lifetime. The supplied `Sink`\ncontributes its requirements to `run`; failures are delivered to the Sink,\nwhich is why the returned Effect itself cannot fail.",
      "Composition": "The type parameters follow Effect's `A`, `E`, `R` vocabulary. Consequently,\nan `Fx<RenderEvent, E, R>` can describe arbitrary UI without hiding its\nfailures or required services.",
      "Effect foundations": "`Fx` execution is an [Effect](https://effect.website/docs/v4/api/effect/Effect),\nresource ownership uses [Scope](https://effect.website/docs/v4/api/effect/Scope),\nconcurrent runs use [Fiber](https://effect.website/docs/v4/api/effect/Fiber), and\nfailures retain Effect's structured [Cause](https://effect.website/docs/v4/api/effect/Cause).",
      "Property: [[computed:[FxTypeId]]]": "Identifies this value as an `Fx` and records its success, error, and service variance.",
      "Property: [[computed:[FxTypeId]]]: Why": "The marker makes `Fx` distinguishable at runtime without executing it, while its\ntype carries the three channels through structural composition.",
      "Property: [[computed:[FxTypeId]]]: Ownership and lifetime": "Reading the marker starts no work and acquires no resources.",
      "Property: run": "Connects this producer to a `Sink` and returns the `Effect` that owns the connection.",
      "Property: run: Why": "Keeping execution behind an `Effect` preserves typed services, structured\nconcurrency, and interruption instead of starting hidden work during construction.\nValues are offered to the sink in the order chosen by this `Fx`; the producer may\nemit zero, one, or many values.",
      "Property: run: Ownership and lifetime": "Work starts when the returned `Effect` runs. Its fiber owns the subscription and\nany child scopes. Interrupting it interrupts the producer and runs its finalizers.\nProducer failures are delivered to `sink.onFailure`, so they are not repeated in\nthe returned Effect's error channel."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst keys: Fx.Fx<KeyboardEvent> = Fx.callback((emit) => {\n  const onKey = (event: KeyboardEvent) => emit.succeed(event)\n  document.addEventListener(\"keydown\", onKey)\n  return Effect.sync(() => document.removeEventListener(\"keydown\", onKey))\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/Fx.ts",
      "line": 72
    },
    "since": "1.0.0",
    "category": "Type contracts"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.Fx",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.Fx",
    "declarationKey": "declaration:91e7953d83f14d4e30d0660e",
    "family": "interface",
    "signatures": [
      "export interface Fx<A, E = never, R = never> extends Pipeable {\n    readonly [FxTypeId]: Fx.Variance<A, E, R>;\n    readonly run: <RSink>(sink: Sink.Sink<A, E, RSink>) => Effect.Effect<unknown, never, R | RSink>;\n}",
      "export declare namespace Fx {\n    type Any = Fx<any, any, any>;\n    interface Variance<A, E, R> {\n        readonly _A: Types.Covariant<A>;\n        readonly _E: Types.Covariant<E>;\n        readonly _R: Types.Covariant<R>;\n    }\n    type Success<T> = [\n        T\n    ] extends [\n        never\n    ] ? never : T extends Fx<infer _A, infer _E, infer _R> ? _A : never;\n    type Error<T> = [\n        T\n    ] extends [\n        never\n    ] ? never : T extends Fx<infer _A, infer _E, infer _R> ? _E : never;\n    type Services<T> = [\n        T\n    ] extends [\n        never\n    ] ? never : [\n        T\n    ] extends [\n        Fx<infer _A, infer _E, infer _R>\n    ] ? _R : never;\n    interface Service<Self, Id extends string, A, E> extends Fx<A, E, Self> {\n        readonly id: Id;\n        readonly service: Context.Service<Self, Fx<A, E>>;\n        readonly make: <R = never>(fx: Fx<A, E, R> | Effect.Effect<Fx<A, E, R>, E, R>) => Layer<Self, E, Exclude<R, Scope.Scope>>;\n    }\n    interface Class<Self, Id extends string, A, E> extends Service<Self, Id, A, E> {\n        new (): Service<Self, Id, A, E>;\n    }\n}"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 72,
          "column": 1
        },
        "end": {
          "line": 112,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 114,
          "column": 1
        },
        "end": {
          "line": 395,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 89,
          "column": 3
        },
        "end": {
          "line": 89,
          "column": 45
        }
      },
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 111,
          "column": 3
        },
        "end": {
          "line": 111,
          "column": 99
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#Fx"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:91e7953d83f14d4e30d0660e"
  },
  "declaration": {
    "declarationKey": "declaration:91e7953d83f14d4e30d0660e",
    "name": "Fx",
    "family": "interface",
    "facets": [
      {
        "family": "interface",
        "syntaxKind": "InterfaceDeclaration",
        "signatures": [
          "export interface Fx<A, E = never, R = never> extends Pipeable {\n    readonly [FxTypeId]: Fx.Variance<A, E, R>;\n    readonly run: <RSink>(sink: Sink.Sink<A, E, RSink>) => Effect.Effect<unknown, never, R | RSink>;\n}"
        ],
        "typeParameters": [
          "A",
          "E = never",
          "R = never"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/Fx.ts",
            "start": {
              "line": 72,
              "column": 1
            },
            "end": {
              "line": 112,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "namespace",
        "syntaxKind": "ModuleDeclaration",
        "signatures": [
          "export declare namespace Fx {\n    type Any = Fx<any, any, any>;\n    interface Variance<A, E, R> {\n        readonly _A: Types.Covariant<A>;\n        readonly _E: Types.Covariant<E>;\n        readonly _R: Types.Covariant<R>;\n    }\n    type Success<T> = [\n        T\n    ] extends [\n        never\n    ] ? never : T extends Fx<infer _A, infer _E, infer _R> ? _A : never;\n    type Error<T> = [\n        T\n    ] extends [\n        never\n    ] ? never : T extends Fx<infer _A, infer _E, infer _R> ? _E : never;\n    type Services<T> = [\n        T\n    ] extends [\n        never\n    ] ? never : [\n        T\n    ] extends [\n        Fx<infer _A, infer _E, infer _R>\n    ] ? _R : never;\n    interface Service<Self, Id extends string, A, E> extends Fx<A, E, Self> {\n        readonly id: Id;\n        readonly service: Context.Service<Self, Fx<A, E>>;\n        readonly make: <R = never>(fx: Fx<A, E, R> | Effect.Effect<Fx<A, E, R>, E, R>) => Layer<Self, E, Exclude<R, Scope.Scope>>;\n    }\n    interface Class<Self, Id extends string, A, E> extends Service<Self, Id, A, E> {\n        new (): Service<Self, Id, A, E>;\n    }\n}"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/Fx.ts",
            "start": {
              "line": 114,
              "column": 1
            },
            "end": {
              "line": 395,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "property",
        "syntaxKind": "PropertySignature",
        "signatures": [
          "readonly [FxTypeId]: Fx.Variance<A, E, R>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/Fx.ts",
            "start": {
              "line": 89,
              "column": 3
            },
            "end": {
              "line": 89,
              "column": 45
            }
          }
        ],
        "static": false,
        "readonly": true,
        "optional": false
      },
      {
        "family": "property",
        "syntaxKind": "PropertySignature",
        "signatures": [
          "readonly run: <RSink>(sink: Sink.Sink<A, E, RSink>) => Effect.Effect<unknown, never, R | RSink>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/Fx.ts",
            "start": {
              "line": 111,
              "column": 3
            },
            "end": {
              "line": 111,
              "column": 99
            }
          }
        ],
        "static": false,
        "readonly": true,
        "optional": false
      }
    ],
    "signatures": [
      "export interface Fx<A, E = never, R = never> extends Pipeable {\n    readonly [FxTypeId]: Fx.Variance<A, E, R>;\n    readonly run: <RSink>(sink: Sink.Sink<A, E, RSink>) => Effect.Effect<unknown, never, R | RSink>;\n}",
      "export declare namespace Fx {\n    type Any = Fx<any, any, any>;\n    interface Variance<A, E, R> {\n        readonly _A: Types.Covariant<A>;\n        readonly _E: Types.Covariant<E>;\n        readonly _R: Types.Covariant<R>;\n    }\n    type Success<T> = [\n        T\n    ] extends [\n        never\n    ] ? never : T extends Fx<infer _A, infer _E, infer _R> ? _A : never;\n    type Error<T> = [\n        T\n    ] extends [\n        never\n    ] ? never : T extends Fx<infer _A, infer _E, infer _R> ? _E : never;\n    type Services<T> = [\n        T\n    ] extends [\n        never\n    ] ? never : [\n        T\n    ] extends [\n        Fx<infer _A, infer _E, infer _R>\n    ] ? _R : never;\n    interface Service<Self, Id extends string, A, E> extends Fx<A, E, Self> {\n        readonly id: Id;\n        readonly service: Context.Service<Self, Fx<A, E>>;\n        readonly make: <R = never>(fx: Fx<A, E, R> | Effect.Effect<Fx<A, E, R>, E, R>) => Layer<Self, E, Exclude<R, Scope.Scope>>;\n    }\n    interface Class<Self, Id extends string, A, E> extends Service<Self, Id, A, E> {\n        new (): Service<Self, Id, A, E>;\n    }\n}"
    ],
    "typeParameters": [
      "A",
      "E = never",
      "R = never"
    ],
    "summary": "`Fx` is a reactive stream of values that supports concurrency, error handling,\nand context management, fully integrated with the Effect ecosystem.\n\nConceptually, an `Fx<A, E, R>` is a push-based stream that:\n- Emits values of type `A`\n- Can fail with an error of type `E`\n- Requires a context/environment of type `R`\n\nUnlike a standard `Effect` which produces a single value, `Fx` can produce\n0, 1, or many values over time. It is similar to RxJS Observables or\nAsyncIterables, but built on top of Effect's fiber-based concurrency model.",
    "sections": {
      "Why": "Browser events, clocks, sockets, and users decide when work exists. `Fx`\nmodels that producer-driven direction while retaining Effect's explicit\nsuccess, error, and service channels. An `Effect`, `Stream`, `Promise`,\n`ReadableStream`, iterable, or custom source can participate through an\nexplicit constructor; `Fx` extends the Effect ecosystem rather than\nreplacing it.",
      "Ownership and lifetime": "Constructing an `Fx` starts no work. Calling `run` returns an `Effect` whose\nrunning fiber and `Scope` own subscriptions, child fibers, and finalizers.\nInterruption propagates through that Effect lifetime. The supplied `Sink`\ncontributes its requirements to `run`; failures are delivered to the Sink,\nwhich is why the returned Effect itself cannot fail.",
      "Composition": "The type parameters follow Effect's `A`, `E`, `R` vocabulary. Consequently,\nan `Fx<RenderEvent, E, R>` can describe arbitrary UI without hiding its\nfailures or required services.",
      "Effect foundations": "`Fx` execution is an [Effect](https://effect.website/docs/v4/api/effect/Effect),\nresource ownership uses [Scope](https://effect.website/docs/v4/api/effect/Scope),\nconcurrent runs use [Fiber](https://effect.website/docs/v4/api/effect/Fiber), and\nfailures retain Effect's structured [Cause](https://effect.website/docs/v4/api/effect/Cause).",
      "Property: [[computed:[FxTypeId]]]": "Identifies this value as an `Fx` and records its success, error, and service variance.",
      "Property: [[computed:[FxTypeId]]]: Why": "The marker makes `Fx` distinguishable at runtime without executing it, while its\ntype carries the three channels through structural composition.",
      "Property: [[computed:[FxTypeId]]]: Ownership and lifetime": "Reading the marker starts no work and acquires no resources.",
      "Property: run": "Connects this producer to a `Sink` and returns the `Effect` that owns the connection.",
      "Property: run: Why": "Keeping execution behind an `Effect` preserves typed services, structured\nconcurrency, and interruption instead of starting hidden work during construction.\nValues are offered to the sink in the order chosen by this `Fx`; the producer may\nemit zero, one, or many values.",
      "Property: run: Ownership and lifetime": "Work starts when the returned `Effect` runs. Its fiber owns the subscription and\nany child scopes. Interrupting it interrupts the producer and runs its finalizers.\nProducer failures are delivered to `sink.onFailure`, so they are not repeated in\nthe returned Effect's error channel."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport { Fx } from \"@typed/fx\"\n\nconst keys: Fx.Fx<KeyboardEvent> = Fx.callback((emit) => {\n  const onKey = (event: KeyboardEvent) => emit.succeed(event)\n  document.addEventListener(\"keydown\", onKey)\n  return Effect.sync(() => document.removeEventListener(\"keydown\", onKey))\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 72,
          "column": 1
        },
        "end": {
          "line": 112,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 114,
          "column": 1
        },
        "end": {
          "line": 395,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 89,
          "column": 3
        },
        "end": {
          "line": 89,
          "column": 45
        }
      },
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 111,
          "column": 3
        },
        "end": {
          "line": 111,
          "column": 99
        }
      }
    ],
    "since": "1.0.0",
    "category": "Type contracts"
  }
}
