{
  "id": "@typed/guard#provideService",
  "canonicalId": "@typed/guard#provideService",
  "symbol": {
    "id": "@typed/guard#provideService",
    "packageName": "@typed/guard",
    "moduleName": ".",
    "exportName": "provideService",
    "kind": "constant",
    "signatures": [
      "export declare const provideService: {\n    <Id, S>(tag: Context.Service<Id, S>, service: S): <I, O, E, R>(guard: GuardInput<I, O, E, R>) => Guard<I, O, E, Exclude<R, Id>>;\n    <I, O, E, R, Id, S>(guard: GuardInput<I, O, E, R>, tag: Context.Service<Id, S>, service: S): Guard<I, O, E, Exclude<R, Id>>;\n};"
    ],
    "summary": "Provides one concrete service to a Guard.",
    "sections": {
      "Why": "Targeted service provision removes only the selected identifier from the Guard environment.",
      "Ownership and lifetime": "This combinator acquires no resources and reuses the supplied service for each invocation."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { provideService } 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 = provideService(requiresFlag, Flag, { enabled: true })"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/guard/src/index.ts",
      "line": 830
    },
    "since": "1.0.0",
    "category": "Services"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/guard#provideService",
    "packageName": "@typed/guard",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/guard",
    "exportName": "provideService",
    "qualifiedName": "provideService",
    "declarationKey": "declaration:f776463d5922ef512c4406fa",
    "family": "variable",
    "signatures": [
      "export declare const provideService: {\n    <Id, S>(tag: Context.Service<Id, S>, service: S): <I, O, E, R>(guard: GuardInput<I, O, E, R>) => Guard<I, O, E, Exclude<R, Id>>;\n    <I, O, E, R, Id, S>(guard: GuardInput<I, O, E, R>, tag: Context.Service<Id, S>, service: S): Guard<I, O, E, Exclude<R, Id>>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 830,
          "column": 14
        },
        "end": {
          "line": 855,
          "column": 3
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 831,
          "column": 3
        },
        "end": {
          "line": 834,
          "column": 84
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 835,
          "column": 3
        },
        "end": {
          "line": 839,
          "column": 37
        }
      }
    ],
    "aliases": [],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:f776463d5922ef512c4406fa",
    "name": "provideService",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const provideService: {\n    <Id, S>(tag: Context.Service<Id, S>, service: S): <I, O, E, R>(guard: GuardInput<I, O, E, R>) => Guard<I, O, E, Exclude<R, Id>>;\n    <I, O, E, R, Id, S>(guard: GuardInput<I, O, E, R>, tag: Context.Service<Id, S>, service: S): Guard<I, O, E, Exclude<R, Id>>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/guard/src/index.ts",
            "start": {
              "line": 830,
              "column": 14
            },
            "end": {
              "line": 855,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<Id, S>(tag: Context.Service<Id, S>, service: S): <I, O, E, R>(guard: GuardInput<I, O, E, R>) => Guard<I, O, E, Exclude<R, Id>>;",
          "<I, O, E, R, Id, S>(guard: GuardInput<I, O, E, R>, tag: Context.Service<Id, S>, service: S): Guard<I, O, E, Exclude<R, Id>>;"
        ],
        "typeParameters": [
          "Id",
          "S",
          "I",
          "O",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/guard/src/index.ts",
            "start": {
              "line": 831,
              "column": 3
            },
            "end": {
              "line": 834,
              "column": 84
            }
          },
          {
            "file": "packages/guard/src/index.ts",
            "start": {
              "line": 835,
              "column": 3
            },
            "end": {
              "line": 839,
              "column": 37
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const provideService: {\n    <Id, S>(tag: Context.Service<Id, S>, service: S): <I, O, E, R>(guard: GuardInput<I, O, E, R>) => Guard<I, O, E, Exclude<R, Id>>;\n    <I, O, E, R, Id, S>(guard: GuardInput<I, O, E, R>, tag: Context.Service<Id, S>, service: S): Guard<I, O, E, Exclude<R, Id>>;\n};"
    ],
    "typeParameters": [
      "Id",
      "S",
      "I",
      "O",
      "E",
      "R"
    ],
    "summary": "Provides one concrete service to a Guard.",
    "sections": {
      "Why": "Targeted service provision removes only the selected identifier from the Guard environment.",
      "Ownership and lifetime": "This combinator acquires no resources and reuses the supplied service for each invocation."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { provideService } 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 = provideService(requiresFlag, Flag, { enabled: true })"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 830,
          "column": 14
        },
        "end": {
          "line": 855,
          "column": 3
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 831,
          "column": 3
        },
        "end": {
          "line": 834,
          "column": 84
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 835,
          "column": 3
        },
        "end": {
          "line": 839,
          "column": 37
        }
      }
    ],
    "since": "1.0.0",
    "category": "Services"
  }
}
