{
  "id": "@typed/guard#provideServiceEffect",
  "canonicalId": "@typed/guard#provideServiceEffect",
  "symbol": {
    "id": "@typed/guard#provideServiceEffect",
    "packageName": "@typed/guard",
    "moduleName": ".",
    "exportName": "provideServiceEffect",
    "kind": "constant",
    "signatures": [
      "export declare const provideServiceEffect: {\n    <Id, S, E2, R2>(tag: Context.Service<Id, S>, service: Effect.Effect<S, E2, R2>): <I, O, E, R>(guard: GuardInput<I, O, E, R>) => Guard<I, O, E | E2, Exclude<R, Id> | R2>;\n    <I, O, E, R, Id, S, E2, R2>(guard: GuardInput<I, O, E, R>, tag: Context.Service<Id, S>, service: Effect.Effect<S, E2, R2>): Guard<I, O, E | E2, Exclude<R, Id> | R2>;\n};"
    ],
    "summary": "Provides a service produced by an Effect to a Guard.",
    "sections": {
      "Why": "Effectful provision makes acquisition errors and required services explicit in the composed Guard channels.",
      "Ownership and lifetime": "The service Effect runs for each Guard invocation and is interrupted with that invocation; scoped resources follow the surrounding Scope."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { provideServiceEffect } from \"@typed/guard\"\nimport type { Guard } from \"@typed/guard\"\nimport { Context, Effect, Option } from \"effect\"\nconst Flag = Context.Service<{ readonly enabled: boolean }>(\"Flag\")\nconst requiresFlag: Guard<boolean, boolean, never, Context.Service.Identifier<typeof Flag>> = (input) => Effect.map(Effect.service(Flag), ({ enabled }) => enabled && input ? Option.some(input) : Option.none())\nconst guard = provideServiceEffect(requiresFlag, Flag, Effect.succeed({ enabled: true }))"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/guard/src/index.ts",
      "line": 876
    },
    "since": "1.0.0",
    "category": "Services"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/guard#provideServiceEffect",
    "packageName": "@typed/guard",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/guard",
    "exportName": "provideServiceEffect",
    "qualifiedName": "provideServiceEffect",
    "declarationKey": "declaration:ae1048d834600a6affff18c4",
    "family": "variable",
    "signatures": [
      "export declare const provideServiceEffect: {\n    <Id, S, E2, R2>(tag: Context.Service<Id, S>, service: Effect.Effect<S, E2, R2>): <I, O, E, R>(guard: GuardInput<I, O, E, R>) => Guard<I, O, E | E2, Exclude<R, Id> | R2>;\n    <I, O, E, R, Id, S, E2, R2>(guard: GuardInput<I, O, E, R>, tag: Context.Service<Id, S>, service: Effect.Effect<S, E2, R2>): Guard<I, O, E | E2, Exclude<R, Id> | R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 876,
          "column": 14
        },
        "end": {
          "line": 903,
          "column": 3
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 877,
          "column": 3
        },
        "end": {
          "line": 880,
          "column": 94
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 881,
          "column": 3
        },
        "end": {
          "line": 885,
          "column": 47
        }
      }
    ],
    "aliases": [],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:ae1048d834600a6affff18c4",
    "name": "provideServiceEffect",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const provideServiceEffect: {\n    <Id, S, E2, R2>(tag: Context.Service<Id, S>, service: Effect.Effect<S, E2, R2>): <I, O, E, R>(guard: GuardInput<I, O, E, R>) => Guard<I, O, E | E2, Exclude<R, Id> | R2>;\n    <I, O, E, R, Id, S, E2, R2>(guard: GuardInput<I, O, E, R>, tag: Context.Service<Id, S>, service: Effect.Effect<S, E2, R2>): Guard<I, O, E | E2, Exclude<R, Id> | R2>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/guard/src/index.ts",
            "start": {
              "line": 876,
              "column": 14
            },
            "end": {
              "line": 903,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<Id, S, E2, R2>(tag: Context.Service<Id, S>, service: Effect.Effect<S, E2, R2>): <I, O, E, R>(guard: GuardInput<I, O, E, R>) => Guard<I, O, E | E2, Exclude<R, Id> | R2>;",
          "<I, O, E, R, Id, S, E2, R2>(guard: GuardInput<I, O, E, R>, tag: Context.Service<Id, S>, service: Effect.Effect<S, E2, R2>): Guard<I, O, E | E2, Exclude<R, Id> | R2>;"
        ],
        "typeParameters": [
          "Id",
          "S",
          "E2",
          "R2",
          "I",
          "O",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/guard/src/index.ts",
            "start": {
              "line": 877,
              "column": 3
            },
            "end": {
              "line": 880,
              "column": 94
            }
          },
          {
            "file": "packages/guard/src/index.ts",
            "start": {
              "line": 881,
              "column": 3
            },
            "end": {
              "line": 885,
              "column": 47
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const provideServiceEffect: {\n    <Id, S, E2, R2>(tag: Context.Service<Id, S>, service: Effect.Effect<S, E2, R2>): <I, O, E, R>(guard: GuardInput<I, O, E, R>) => Guard<I, O, E | E2, Exclude<R, Id> | R2>;\n    <I, O, E, R, Id, S, E2, R2>(guard: GuardInput<I, O, E, R>, tag: Context.Service<Id, S>, service: Effect.Effect<S, E2, R2>): Guard<I, O, E | E2, Exclude<R, Id> | R2>;\n};"
    ],
    "typeParameters": [
      "Id",
      "S",
      "E2",
      "R2",
      "I",
      "O",
      "E",
      "R"
    ],
    "summary": "Provides a service produced by an Effect to a Guard.",
    "sections": {
      "Why": "Effectful provision makes acquisition errors and required services explicit in the composed Guard channels.",
      "Ownership and lifetime": "The service Effect runs for each Guard invocation and is interrupted with that invocation; scoped resources follow the surrounding Scope."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { provideServiceEffect } from \"@typed/guard\"\nimport type { Guard } from \"@typed/guard\"\nimport { Context, Effect, Option } from \"effect\"\nconst Flag = Context.Service<{ readonly enabled: boolean }>(\"Flag\")\nconst requiresFlag: Guard<boolean, boolean, never, Context.Service.Identifier<typeof Flag>> = (input) => Effect.map(Effect.service(Flag), ({ enabled }) => enabled && input ? Option.some(input) : Option.none())\nconst guard = provideServiceEffect(requiresFlag, Flag, Effect.succeed({ enabled: true }))"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 876,
          "column": 14
        },
        "end": {
          "line": 903,
          "column": 3
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 877,
          "column": 3
        },
        "end": {
          "line": 880,
          "column": 94
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 881,
          "column": 3
        },
        "end": {
          "line": 885,
          "column": 47
        }
      }
    ],
    "since": "1.0.0",
    "category": "Services"
  }
}
