{
  "id": "@typed/template#EventHandler.make",
  "canonicalId": "@typed/template/EventHandler#make",
  "symbol": {
    "id": "@typed/template#EventHandler.make",
    "packageName": "@typed/template",
    "moduleName": ".",
    "exportName": "EventHandler.make",
    "kind": "function",
    "signatures": [
      "export declare function make<Ev extends Event, E = never, R = never>(handler: (event: Ev) => void | Effect.Effect<unknown, E, R>, options?: AddEventListenerOptions & EventOptions): EventHandler<Ev, E, R>;"
    ],
    "summary": "Creates a new `EventHandler`.",
    "sections": {
      "Why": "`EventHandler.make` connects an Event-shaped input to an Effect program.\nRendered handlers receive `EventSource`'s non-pooled Proxy: it forwards\nproperties and binds methods to the native event, but overrides\n`currentTarget` with the delegated element and has distinct object identity.",
      "Ownership and lifetime": "`make` only describes the handler. A rendered template installs the listener\nwithin its Effect Scope and removes it when that rendered part is finalized.\nAny Effect returned by the callback keeps its error and required-service\nchannels in the `EventHandler<Ev, E, R>` type.",
      "Event options": "Native `AddEventListenerOptions` are passed through. Typed's convenience\nflags call forwarded native methods before the handler; they do not introduce\na separate propagation or default-action system."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as EventHandler from \"@typed/template/EventHandler\"\nimport { html } from \"@typed/template\"\n\n// Simple handler\nconst clickHandler = EventHandler.make((event) => {\n  console.log(\"Button clicked\")\n})\n\n// Handler with Effect\nconst submitHandler = EventHandler.make((event) =>\n  Effect.gen(function* () {\n    const form = event.target as HTMLFormElement\n    const data = new FormData(form)\n    yield* Effect.sync(() => console.log(\"Submitting:\", data))\n  })\n)\n\n// Handler with options\nconst preventDefaultHandler = EventHandler.make(\n  (event) => console.log(\"Prevented default\"),\n  { preventDefault: true }\n)\n\nconst template = html`<button onclick=${clickHandler}>Click</button>`"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/template/src/EventHandler.ts",
      "line": 344
    },
    "since": "1.0.0",
    "category": "Event handler creation"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/template#EventHandler.make",
    "packageName": "@typed/template",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/template",
    "exportName": "EventHandler",
    "qualifiedName": "EventHandler.make",
    "declarationKey": "declaration:60f98f06ee3c3f776de2db1a",
    "family": "function",
    "signatures": [
      "export declare function make<Ev extends Event, E = never, R = never>(handler: (event: Ev) => void | Effect.Effect<unknown, E, R>, options?: AddEventListenerOptions & EventOptions): EventHandler<Ev, E, R>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/template/src/EventHandler.ts",
        "start": {
          "line": 344,
          "column": 1
        },
        "end": {
          "line": 361,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/template/EventHandler#make"
    ],
    "isAlias": true,
    "parentId": "@typed/template#EventHandler",
    "static": false,
    "importedFrom": "declaration:60f98f06ee3c3f776de2db1a"
  },
  "declaration": {
    "declarationKey": "declaration:60f98f06ee3c3f776de2db1a",
    "name": "make",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function make<Ev extends Event, E = never, R = never>(handler: (event: Ev) => void | Effect.Effect<unknown, E, R>, options?: AddEventListenerOptions & EventOptions): EventHandler<Ev, E, R>;"
        ],
        "typeParameters": [
          "Ev extends Event",
          "E = never",
          "R = never"
        ],
        "sourceSpans": [
          {
            "file": "packages/template/src/EventHandler.ts",
            "start": {
              "line": 344,
              "column": 1
            },
            "end": {
              "line": 361,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function make<Ev extends Event, E = never, R = never>(handler: (event: Ev) => void | Effect.Effect<unknown, E, R>, options?: AddEventListenerOptions & EventOptions): EventHandler<Ev, E, R>;"
    ],
    "typeParameters": [
      "Ev extends Event",
      "E = never",
      "R = never"
    ],
    "summary": "Creates a new `EventHandler`.",
    "sections": {
      "Why": "`EventHandler.make` connects an Event-shaped input to an Effect program.\nRendered handlers receive `EventSource`'s non-pooled Proxy: it forwards\nproperties and binds methods to the native event, but overrides\n`currentTarget` with the delegated element and has distinct object identity.",
      "Ownership and lifetime": "`make` only describes the handler. A rendered template installs the listener\nwithin its Effect Scope and removes it when that rendered part is finalized.\nAny Effect returned by the callback keeps its error and required-service\nchannels in the `EventHandler<Ev, E, R>` type.",
      "Event options": "Native `AddEventListenerOptions` are passed through. Typed's convenience\nflags call forwarded native methods before the handler; they do not introduce\na separate propagation or default-action system."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as EventHandler from \"@typed/template/EventHandler\"\nimport { html } from \"@typed/template\"\n\n// Simple handler\nconst clickHandler = EventHandler.make((event) => {\n  console.log(\"Button clicked\")\n})\n\n// Handler with Effect\nconst submitHandler = EventHandler.make((event) =>\n  Effect.gen(function* () {\n    const form = event.target as HTMLFormElement\n    const data = new FormData(form)\n    yield* Effect.sync(() => console.log(\"Submitting:\", data))\n  })\n)\n\n// Handler with options\nconst preventDefaultHandler = EventHandler.make(\n  (event) => console.log(\"Prevented default\"),\n  { preventDefault: true }\n)\n\nconst template = html`<button onclick=${clickHandler}>Click</button>`"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/template/src/EventHandler.ts",
        "start": {
          "line": 344,
          "column": 1
        },
        "end": {
          "line": 361,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Event handler creation"
  }
}
