{
  "id": "@typed/guard#encode",
  "canonicalId": "@typed/guard#encode",
  "symbol": {
    "id": "@typed/guard#encode",
    "packageName": "@typed/guard",
    "moduleName": ".",
    "exportName": "encode",
    "kind": "constant",
    "signatures": [
      "export declare const encode: {\n    <S extends Schema.Top>(schema: S): <I, E = never, R = never>(guard: GuardInput<I, S[\"Type\"], E, R>) => Guard<I, S[\"Encoded\"], Schema.SchemaError | E, R | S[\"EncodingServices\"]>;\n    <I, E, R, S extends Schema.Top>(guard: GuardInput<I, S[\"Type\"], E, R>, schema: S): Guard<I, S[\"Encoded\"], Schema.SchemaError | E, R | S[\"EncodingServices\"]>;\n};"
    ],
    "summary": "Encodes each matched schema Type to its Encoded representation.",
    "sections": {
      "Why": "The composed Guard preserves source non-match and errors while adding schema failures and encoding service requirements.",
      "Ownership and lifetime": "Construction acquires no resources; encoding starts only for `Some` and follows that invocation's lifetime."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { encode, liftPredicate } from \"@typed/guard\"\nimport { Schema } from \"effect\"\nconst text = encode(liftPredicate((u: unknown): u is number => typeof u === \"number\"), Schema.NumberFromString)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/guard/src/index.ts",
      "line": 1011
    },
    "since": "1.0.0",
    "category": "Schema decoding and encoding"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/guard#encode",
    "packageName": "@typed/guard",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/guard",
    "exportName": "encode",
    "qualifiedName": "encode",
    "declarationKey": "declaration:ca560ad3602278e42e7d05e9",
    "family": "variable",
    "signatures": [
      "export declare const encode: {\n    <S extends Schema.Top>(schema: S): <I, E = never, R = never>(guard: GuardInput<I, S[\"Type\"], E, R>) => Guard<I, S[\"Encoded\"], Schema.SchemaError | E, R | S[\"EncodingServices\"]>;\n    <I, E, R, S extends Schema.Top>(guard: GuardInput<I, S[\"Type\"], E, R>, schema: S): Guard<I, S[\"Encoded\"], Schema.SchemaError | E, R | S[\"EncodingServices\"]>;\n};"
    ],
    "sourceSpans": [
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 1011,
          "column": 14
        },
        "end": {
          "line": 1034,
          "column": 3
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 1012,
          "column": 3
        },
        "end": {
          "line": 1016,
          "column": 82
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 1018,
          "column": 3
        },
        "end": {
          "line": 1021,
          "column": 80
        }
      }
    ],
    "aliases": [],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:ca560ad3602278e42e7d05e9",
    "name": "encode",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const encode: {\n    <S extends Schema.Top>(schema: S): <I, E = never, R = never>(guard: GuardInput<I, S[\"Type\"], E, R>) => Guard<I, S[\"Encoded\"], Schema.SchemaError | E, R | S[\"EncodingServices\"]>;\n    <I, E, R, S extends Schema.Top>(guard: GuardInput<I, S[\"Type\"], E, R>, schema: S): Guard<I, S[\"Encoded\"], Schema.SchemaError | E, R | S[\"EncodingServices\"]>;\n};"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/guard/src/index.ts",
            "start": {
              "line": 1011,
              "column": 14
            },
            "end": {
              "line": 1034,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      },
      {
        "family": "call-signature",
        "syntaxKind": "CallSignature",
        "signatures": [
          "<S extends Schema.Top>(schema: S): <I, E = never, R = never>(guard: GuardInput<I, S[\"Type\"], E, R>) => Guard<I, S[\"Encoded\"], Schema.SchemaError | E, R | S[\"EncodingServices\"]>;",
          "<I, E, R, S extends Schema.Top>(guard: GuardInput<I, S[\"Type\"], E, R>, schema: S): Guard<I, S[\"Encoded\"], Schema.SchemaError | E, R | S[\"EncodingServices\"]>;"
        ],
        "typeParameters": [
          "S extends Schema.Top",
          "I",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/guard/src/index.ts",
            "start": {
              "line": 1012,
              "column": 3
            },
            "end": {
              "line": 1016,
              "column": 82
            }
          },
          {
            "file": "packages/guard/src/index.ts",
            "start": {
              "line": 1018,
              "column": 3
            },
            "end": {
              "line": 1021,
              "column": 80
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const encode: {\n    <S extends Schema.Top>(schema: S): <I, E = never, R = never>(guard: GuardInput<I, S[\"Type\"], E, R>) => Guard<I, S[\"Encoded\"], Schema.SchemaError | E, R | S[\"EncodingServices\"]>;\n    <I, E, R, S extends Schema.Top>(guard: GuardInput<I, S[\"Type\"], E, R>, schema: S): Guard<I, S[\"Encoded\"], Schema.SchemaError | E, R | S[\"EncodingServices\"]>;\n};"
    ],
    "typeParameters": [
      "S extends Schema.Top",
      "I",
      "E",
      "R"
    ],
    "summary": "Encodes each matched schema Type to its Encoded representation.",
    "sections": {
      "Why": "The composed Guard preserves source non-match and errors while adding schema failures and encoding service requirements.",
      "Ownership and lifetime": "Construction acquires no resources; encoding starts only for `Some` and follows that invocation's lifetime."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { encode, liftPredicate } from \"@typed/guard\"\nimport { Schema } from \"effect\"\nconst text = encode(liftPredicate((u: unknown): u is number => typeof u === \"number\"), Schema.NumberFromString)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 1011,
          "column": 14
        },
        "end": {
          "line": 1034,
          "column": 3
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 1012,
          "column": 3
        },
        "end": {
          "line": 1016,
          "column": 82
        }
      },
      {
        "file": "packages/guard/src/index.ts",
        "start": {
          "line": 1018,
          "column": 3
        },
        "end": {
          "line": 1021,
          "column": 80
        }
      }
    ],
    "since": "1.0.0",
    "category": "Schema decoding and encoding"
  }
}
