{
  "id": "@typed/guard#bind",
  "canonicalId": "@typed/guard#bind",
  "symbol": {
    "id": "@typed/guard#bind",
    "packageName": "@typed/guard",
    "moduleName": ".",
    "exportName": "bind",
    "kind": "constant",
    "signatures": [
      "export declare const bind: {\n    <O extends object, K extends PropertyKey, B, E2, R2>(key: K, f: GuardInput<O, B, E2, R2>): <G extends GuardInput<any, O, any, any>>(guard: G & RecordOutputConstraint<NoInfer<Guard.Output<G>>> & (K extends NoInfer<Guard.Output<G> extends infer A ? (A extends unknown ? keyof A : never) : never> ? never : unknown)) => Guard<Guard.Input<G>, Guard.Output<G> & {\n        [k in K]: B;\n    }, Guard.Error<G> | E2, Guard.Services<G> | R2>;\n    <G extends GuardInput<any, any, any, any>, K extends PropertyKey, B, E2, R2>(guard: G & RecordOutputConstraint<NoInfer<Guard.Output<G>>>, key: Exclude<K, NoInfer<Guard.Output<G> extends infer O ? (O extends unknown ? keyof O : never) : never>>, f: GuardInput<NoInfer<Guard.Output<G>>, B, E2, R2>): Guard<Guard.Input<G>, Guard.Output<G> & {\n        [k in K]: B;\n    }, Guard.Error<G> | E2, Guard.Services<G> | R2>;\n};"
    ],
    "summary": "Runs `f` on a matched object and adds its matched value under a new key. The\nkey must not already exist. Enumerable getters and proxy traps may execute\nduring the object spread.",
    "sections": {
      "Why": "Dependent record construction runs the second Guard only after the base matches, preserves `None`, and unions both error and service channels.",
      "Ownership and lifetime": "Construction acquires no resources; each successful bind creates a fresh plain object and the dependent Effect follows the invocation lifetime."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { bind, bindTo, liftPredicate, map } from \"@typed/guard\"\nconst base = bindTo(liftPredicate((u: unknown): u is string => typeof u === \"string\"), \"text\")\nconst nonEmptyLength = map(liftPredicate((record: { readonly text: string }) => record.text.length > 0), (record) => record.text.length)\nconst sized = bind(base, \"length\", nonEmptyLength)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/guard/src/index.ts",
      "line": 1224
    },
    "since": "1.0.0",
    "category": "Record construction"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/guard#bind",
    "packageName": "@typed/guard",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/guard",
    "exportName": "bind",
    "qualifiedName": "bind",
    "declarationKey": "declaration:5a30058f5044bab44885a3db",
    "family": "variable",
    "signatures": [
      "export declare const bind: {\n    <O extends object, K extends PropertyKey, B, E2, R2>(key: K, f: GuardInput<O, B, E2, R2>): <G extends GuardInput<any, O, any, any>>(guard: G & RecordOutputConstraint<NoInfer<Guard.Output<G>>> & (K extends NoInfer<Guard.Output<G> extends infer A ? (A extends unknown ? keyof A : never) : never> ? never : unknown)) => Guard<Guard.Input<G>, Guard.Output<G> & {\n        [k in K]: B;\n    }, Guard.Error<G> | E2, Guard.Services<G> | R2>;\n    <G extends GuardInput<any, any, any, any>, K extends PropertyKey, B, E2, R2>(guard: G & RecordOutputConstraint<NoInfer<Guard.Output<G>>>, key: Exclude<K, NoInfer<Guard.Output<G> extends infer O ? (O extends unknown ? keyof O : never) : never>>, f: GuardInput<NoInfer<Guard.Output<G>>, B, E2, R2>): Guard<Guard.Input<G>, Guard.Output<G> & {\n        [k in K]: B;\n    }, Guard.Error<G> | E2, Guard.Services<G> | R2>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 1224,
          "column": 14
        },
        "end": {
          "line": 1283,
          "column": 3
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 1225,
          "column": 3
        },
        "end": {
          "line": 1241,
          "column": 5
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 1243,
          "column": 3
        },
        "end": {
          "line": 1255,
          "column": 5
        }
      }
    ],
    "aliases": [],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:5a30058f5044bab44885a3db",
    "name": "bind",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const bind: {\n    <O extends object, K extends PropertyKey, B, E2, R2>(key: K, f: GuardInput<O, B, E2, R2>): <G extends GuardInput<any, O, any, any>>(guard: G & RecordOutputConstraint<NoInfer<Guard.Output<G>>> & (K extends NoInfer<Guard.Output<G> extends infer A ? (A extends unknown ? keyof A : never) : never> ? never : unknown)) => Guard<Guard.Input<G>, Guard.Output<G> & {\n        [k in K]: B;\n    }, Guard.Error<G> | E2, Guard.Services<G> | R2>;\n    <G extends GuardInput<any, any, any, any>, K extends PropertyKey, B, E2, R2>(guard: G & RecordOutputConstraint<NoInfer<Guard.Output<G>>>, key: Exclude<K, NoInfer<Guard.Output<G> extends infer O ? (O extends unknown ? keyof O : never) : never>>, f: GuardInput<NoInfer<Guard.Output<G>>, B, E2, R2>): Guard<Guard.Input<G>, Guard.Output<G> & {\n        [k in K]: B;\n    }, Guard.Error<G> | E2, Guard.Services<G> | R2>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/guard/src/index.ts",
            "start": {
              "line": 1224,
              "column": 14
            },
            "end": {
              "line": 1283,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<O extends object, K extends PropertyKey, B, E2, R2>(key: K, f: GuardInput<O, B, E2, R2>): <G extends GuardInput<any, O, any, any>>(guard: G & RecordOutputConstraint<NoInfer<Guard.Output<G>>> & (K extends NoInfer<Guard.Output<G> extends infer A ? (A extends unknown ? keyof A : never) : never> ? never : unknown)) => Guard<Guard.Input<G>, Guard.Output<G> & {\n    [k in K]: B;\n}, Guard.Error<G> | E2, Guard.Services<G> | R2>;",
          "<G extends GuardInput<any, any, any, any>, K extends PropertyKey, B, E2, R2>(guard: G & RecordOutputConstraint<NoInfer<Guard.Output<G>>>, key: Exclude<K, NoInfer<Guard.Output<G> extends infer O ? (O extends unknown ? keyof O : never) : never>>, f: GuardInput<NoInfer<Guard.Output<G>>, B, E2, R2>): Guard<Guard.Input<G>, Guard.Output<G> & {\n    [k in K]: B;\n}, Guard.Error<G> | E2, Guard.Services<G> | R2>;"
        ],
        "typeParameters": [
          "O extends object",
          "K extends PropertyKey",
          "B",
          "E2",
          "R2",
          "G extends GuardInput<any, any, any, any>"
        ],
        "sourceSpans": [
          {
            "file": "packages/guard/src/index.ts",
            "start": {
              "line": 1225,
              "column": 3
            },
            "end": {
              "line": 1241,
              "column": 5
            }
          },
          {
            "file": "packages/guard/src/index.ts",
            "start": {
              "line": 1243,
              "column": 3
            },
            "end": {
              "line": 1255,
              "column": 5
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const bind: {\n    <O extends object, K extends PropertyKey, B, E2, R2>(key: K, f: GuardInput<O, B, E2, R2>): <G extends GuardInput<any, O, any, any>>(guard: G & RecordOutputConstraint<NoInfer<Guard.Output<G>>> & (K extends NoInfer<Guard.Output<G> extends infer A ? (A extends unknown ? keyof A : never) : never> ? never : unknown)) => Guard<Guard.Input<G>, Guard.Output<G> & {\n        [k in K]: B;\n    }, Guard.Error<G> | E2, Guard.Services<G> | R2>;\n    <G extends GuardInput<any, any, any, any>, K extends PropertyKey, B, E2, R2>(guard: G & RecordOutputConstraint<NoInfer<Guard.Output<G>>>, key: Exclude<K, NoInfer<Guard.Output<G> extends infer O ? (O extends unknown ? keyof O : never) : never>>, f: GuardInput<NoInfer<Guard.Output<G>>, B, E2, R2>): Guard<Guard.Input<G>, Guard.Output<G> & {\n        [k in K]: B;\n    }, Guard.Error<G> | E2, Guard.Services<G> | R2>;\n};"
    ],
    "typeParameters": [
      "O extends object",
      "K extends PropertyKey",
      "B",
      "E2",
      "R2",
      "G extends GuardInput<any, any, any, any>"
    ],
    "summary": "Runs `f` on a matched object and adds its matched value under a new key. The\nkey must not already exist. Enumerable getters and proxy traps may execute\nduring the object spread.",
    "sections": {
      "Why": "Dependent record construction runs the second Guard only after the base matches, preserves `None`, and unions both error and service channels.",
      "Ownership and lifetime": "Construction acquires no resources; each successful bind creates a fresh plain object and the dependent Effect follows the invocation lifetime."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { bind, bindTo, liftPredicate, map } from \"@typed/guard\"\nconst base = bindTo(liftPredicate((u: unknown): u is string => typeof u === \"string\"), \"text\")\nconst nonEmptyLength = map(liftPredicate((record: { readonly text: string }) => record.text.length > 0), (record) => record.text.length)\nconst sized = bind(base, \"length\", nonEmptyLength)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 1224,
          "column": 14
        },
        "end": {
          "line": 1283,
          "column": 3
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 1225,
          "column": 3
        },
        "end": {
          "line": 1241,
          "column": 5
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 1243,
          "column": 3
        },
        "end": {
          "line": 1255,
          "column": 5
        }
      }
    ],
    "since": "1.0.0",
    "category": "Record construction"
  }
}
