{
  "id": "@typed/fx/Fx#Fx.Service",
  "canonicalId": "@typed/fx/Fx#Fx.Service",
  "symbol": {
    "id": "@typed/fx/Fx#Fx.Service",
    "packageName": "@typed/fx",
    "moduleName": "Fx",
    "exportName": "Fx.Service",
    "kind": "interface",
    "signatures": [
      "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}"
    ],
    "summary": "An `Fx` whose implementation is obtained from an Effect service.",
    "sections": {
      "Why": "Long-lived producers can be selected and replaced through Effect's service graph\nwhile remaining directly usable as `Fx<A, E, Self>`.",
      "Ownership and lifetime": "The service declaration owns nothing. A layer made with `make` owns the supplied\nproducer for that layer's scope; each run reads the installed service.",
      "Property: id": "Stable diagnostic identifier used to create the Effect service.",
      "Property: id: Why": "Keeps the service identity visible to diagnostics and tooling.",
      "Property: id: Ownership and lifetime": "Reading the identifier starts no work and owns no resource.",
      "Property: make": "Builds a layer from an `Fx`, or from an `Effect` that acquires one.",
      "Property: make: Why": "Connects producer acquisition directly to Effect's service graph.",
      "Property: make: Ownership and lifetime": "Scope is removed from the layer requirements because layer acquisition supplies\nit. Other services and typed failures remain visible.",
      "Property: service": "Effect service tag containing the installed producer.",
      "Property: service: Why": "Exposes the underlying Effect service for direct context and layer composition.",
      "Property: service: Ownership and lifetime": "The tag is inert; the layer that installs its value owns the producer lifetime."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport type { Fx as FxModel } from \"@typed/fx/Fx\"\n\nclass Ticks extends Fx.Service<Ticks, number>()(\"app/Ticks\") {}\nconst service: FxModel.Service<Ticks, \"app/Ticks\", number, never> = Ticks"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/Fx.ts",
      "line": 296
    },
    "since": "1.0.0",
    "category": "Providing services"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx/Fx#Fx.Service",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.7",
    "moduleName": "Fx",
    "consumerSpecifier": "@typed/fx/Fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.Service",
    "declarationKey": "declaration:af7d9bece340c3b307c6bbe2",
    "family": "interface",
    "signatures": [
      "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}"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 296,
          "column": 3
        },
        "end": {
          "line": 348,
          "column": 4
        }
      },
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 312,
          "column": 5
        },
        "end": {
          "line": 312,
          "column": 21
        }
      },
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 345,
          "column": 5
        },
        "end": {
          "line": 347,
          "column": 50
        }
      },
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 328,
          "column": 5
        },
        "end": {
          "line": 328,
          "column": 55
        }
      }
    ],
    "aliases": [
      "@typed/fx#Fx.Fx.Service"
    ],
    "isAlias": false,
    "parentId": "@typed/fx/Fx#Fx",
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:af7d9bece340c3b307c6bbe2",
    "name": "Service",
    "family": "interface",
    "facets": [
      {
        "family": "interface",
        "syntaxKind": "InterfaceDeclaration",
        "signatures": [
          "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}"
        ],
        "typeParameters": [
          "Self",
          "Id extends string",
          "A",
          "E"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/Fx.ts",
            "start": {
              "line": 296,
              "column": 3
            },
            "end": {
              "line": 348,
              "column": 4
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "property",
        "syntaxKind": "PropertySignature",
        "signatures": [
          "readonly id: Id;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/Fx.ts",
            "start": {
              "line": 312,
              "column": 5
            },
            "end": {
              "line": 312,
              "column": 21
            }
          }
        ],
        "static": false,
        "readonly": true,
        "optional": false
      },
      {
        "family": "property",
        "syntaxKind": "PropertySignature",
        "signatures": [
          "readonly make: <R = never>(fx: Fx<A, E, R> | Effect.Effect<Fx<A, E, R>, E, R>) => Layer<Self, E, Exclude<R, Scope.Scope>>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/Fx.ts",
            "start": {
              "line": 345,
              "column": 5
            },
            "end": {
              "line": 347,
              "column": 50
            }
          }
        ],
        "static": false,
        "readonly": true,
        "optional": false
      },
      {
        "family": "property",
        "syntaxKind": "PropertySignature",
        "signatures": [
          "readonly service: Context.Service<Self, Fx<A, E>>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/Fx.ts",
            "start": {
              "line": 328,
              "column": 5
            },
            "end": {
              "line": 328,
              "column": 55
            }
          }
        ],
        "static": false,
        "readonly": true,
        "optional": false
      }
    ],
    "signatures": [
      "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}"
    ],
    "typeParameters": [
      "Self",
      "Id extends string",
      "A",
      "E"
    ],
    "summary": "An `Fx` whose implementation is obtained from an Effect service.",
    "sections": {
      "Why": "Long-lived producers can be selected and replaced through Effect's service graph\nwhile remaining directly usable as `Fx<A, E, Self>`.",
      "Ownership and lifetime": "The service declaration owns nothing. A layer made with `make` owns the supplied\nproducer for that layer's scope; each run reads the installed service.",
      "Property: id": "Stable diagnostic identifier used to create the Effect service.",
      "Property: id: Why": "Keeps the service identity visible to diagnostics and tooling.",
      "Property: id: Ownership and lifetime": "Reading the identifier starts no work and owns no resource.",
      "Property: make": "Builds a layer from an `Fx`, or from an `Effect` that acquires one.",
      "Property: make: Why": "Connects producer acquisition directly to Effect's service graph.",
      "Property: make: Ownership and lifetime": "Scope is removed from the layer requirements because layer acquisition supplies\nit. Other services and typed failures remain visible.",
      "Property: service": "Effect service tag containing the installed producer.",
      "Property: service: Why": "Exposes the underlying Effect service for direct context and layer composition.",
      "Property: service: Ownership and lifetime": "The tag is inert; the layer that installs its value owns the producer lifetime."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Fx } from \"@typed/fx\"\nimport type { Fx as FxModel } from \"@typed/fx/Fx\"\n\nclass Ticks extends Fx.Service<Ticks, number>()(\"app/Ticks\") {}\nconst service: FxModel.Service<Ticks, \"app/Ticks\", number, never> = Ticks"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 296,
          "column": 3
        },
        "end": {
          "line": 348,
          "column": 4
        }
      },
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 312,
          "column": 5
        },
        "end": {
          "line": 312,
          "column": 21
        }
      },
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 345,
          "column": 5
        },
        "end": {
          "line": 347,
          "column": 50
        }
      },
      {
        "file": "packages/fx/src/Fx/Fx.ts",
        "start": {
          "line": 328,
          "column": 5
        },
        "end": {
          "line": 328,
          "column": 55
        }
      }
    ],
    "since": "1.0.0",
    "category": "Providing services"
  }
}
