{
  "id": "@typed/fx#Fx.provideService",
  "canonicalId": "@typed/fx/Fx#provideService",
  "symbol": {
    "id": "@typed/fx#Fx.provideService",
    "packageName": "@typed/fx",
    "moduleName": ".",
    "exportName": "Fx.provideService",
    "kind": "constant",
    "signatures": [
      "export declare const provideService: {\n    <Id, S>(tag: Context.Service<Id, S>, service: S): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, Exclude<R, Id>>;\n    <A, E, R, Id, S>(fx: Fx<A, E, R>, tag: Context.Service<Id, S>, service: S): Fx<A, E, Exclude<R, Id>>;\n};"
    ],
    "summary": "Provides one existing service value to the entire Fx run.",
    "sections": {
      "Why": "This is the precise single-service form of {@link provideContext}, useful for\ntests and application edges where the instance is already owned.",
      "Ownership and lifetime": "The service value is captured and reused for every subscription. It is not\nacquired or finalized here; its caller owns its lifetime. The matching\nservice identifier is removed from `R`, while values, errors, ordering, and\ninterruption remain those of the source."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Context, Effect } from \"effect\"\nimport { provideService } from \"@typed/fx/Fx\"\nimport { fromEffect } from \"@typed/fx/Fx\"\n\nclass Config extends Context.Service<Config, { readonly url: string }>()(\"Config\") {}\nconst runnable = provideService(\n  fromEffect(Effect.map(Config, (x) => x.url)),\n  Config,\n  { url: \"/api\" }\n)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/fx/src/Fx/combinators/provide.ts",
      "line": 155
    },
    "since": "1.0.0",
    "category": "Providing services"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/fx#Fx.provideService",
    "packageName": "@typed/fx",
    "packageVersion": "2.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/fx",
    "exportName": "Fx",
    "qualifiedName": "Fx.provideService",
    "declarationKey": "declaration:4f1015344311fef44bca1420",
    "family": "variable",
    "signatures": [
      "export declare const provideService: {\n    <Id, S>(tag: Context.Service<Id, S>, service: S): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, Exclude<R, Id>>;\n    <A, E, R, Id, S>(fx: Fx<A, E, R>, tag: Context.Service<Id, S>, service: S): Fx<A, E, Exclude<R, Id>>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/provide.ts",
        "start": {
          "line": 155,
          "column": 14
        },
        "end": {
          "line": 172,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/provide.ts",
        "start": {
          "line": 156,
          "column": 3
        },
        "end": {
          "line": 159,
          "column": 61
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/provide.ts",
        "start": {
          "line": 160,
          "column": 3
        },
        "end": {
          "line": 164,
          "column": 31
        }
      }
    ],
    "aliases": [
      "@typed/fx/Fx#provideService"
    ],
    "isAlias": true,
    "parentId": "@typed/fx#Fx",
    "static": false,
    "importedFrom": "declaration:4f1015344311fef44bca1420"
  },
  "declaration": {
    "declarationKey": "declaration:4f1015344311fef44bca1420",
    "name": "provideService",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const provideService: {\n    <Id, S>(tag: Context.Service<Id, S>, service: S): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, Exclude<R, Id>>;\n    <A, E, R, Id, S>(fx: Fx<A, E, R>, tag: Context.Service<Id, S>, service: S): Fx<A, E, Exclude<R, Id>>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/provide.ts",
            "start": {
              "line": 155,
              "column": 14
            },
            "end": {
              "line": 172,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<Id, S>(tag: Context.Service<Id, S>, service: S): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, Exclude<R, Id>>;",
          "<A, E, R, Id, S>(fx: Fx<A, E, R>, tag: Context.Service<Id, S>, service: S): Fx<A, E, Exclude<R, Id>>;"
        ],
        "typeParameters": [
          "Id",
          "S",
          "A",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/fx/src/Fx/combinators/provide.ts",
            "start": {
              "line": 156,
              "column": 3
            },
            "end": {
              "line": 159,
              "column": 61
            }
          },
          {
            "file": "packages/fx/src/Fx/combinators/provide.ts",
            "start": {
              "line": 160,
              "column": 3
            },
            "end": {
              "line": 164,
              "column": 31
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const provideService: {\n    <Id, S>(tag: Context.Service<Id, S>, service: S): <A, E, R>(fx: Fx<A, E, R>) => Fx<A, E, Exclude<R, Id>>;\n    <A, E, R, Id, S>(fx: Fx<A, E, R>, tag: Context.Service<Id, S>, service: S): Fx<A, E, Exclude<R, Id>>;\n};"
    ],
    "typeParameters": [
      "Id",
      "S",
      "A",
      "E",
      "R"
    ],
    "summary": "Provides one existing service value to the entire Fx run.",
    "sections": {
      "Why": "This is the precise single-service form of {@link provideContext}, useful for\ntests and application edges where the instance is already owned.",
      "Ownership and lifetime": "The service value is captured and reused for every subscription. It is not\nacquired or finalized here; its caller owns its lifetime. The matching\nservice identifier is removed from `R`, while values, errors, ordering, and\ninterruption remain those of the source."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Context, Effect } from \"effect\"\nimport { provideService } from \"@typed/fx/Fx\"\nimport { fromEffect } from \"@typed/fx/Fx\"\n\nclass Config extends Context.Service<Config, { readonly url: string }>()(\"Config\") {}\nconst runnable = provideService(\n  fromEffect(Effect.map(Config, (x) => x.url)),\n  Config,\n  { url: \"/api\" }\n)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/fx/src/Fx/combinators/provide.ts",
        "start": {
          "line": 155,
          "column": 14
        },
        "end": {
          "line": 172,
          "column": 2
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/provide.ts",
        "start": {
          "line": 156,
          "column": 3
        },
        "end": {
          "line": 159,
          "column": 61
        }
      },
      {
        "file": "packages/fx/src/Fx/combinators/provide.ts",
        "start": {
          "line": 160,
          "column": 3
        },
        "end": {
          "line": 164,
          "column": 31
        }
      }
    ],
    "since": "1.0.0",
    "category": "Providing services"
  }
}
