{
  "id": "@typed/ui/NativeDialog#ref",
  "canonicalId": "@typed/ui/NativeDialog#ref",
  "symbol": {
    "id": "@typed/ui/NativeDialog#ref",
    "packageName": "@typed/ui",
    "moduleName": "NativeDialog",
    "exportName": "ref",
    "kind": "function",
    "signatures": [
      "export declare function ref<S extends State, E, R>(state: RefSubject.RefSubject<S, E, R>, options?: Options): (element: HTMLDialogElement) => Effect.Effect<void, E, R | Scope.Scope>;"
    ],
    "summary": "Creates a scoped ref that drives a real `HTMLDialogElement` from state.",
    "sections": {
      "Why": "The ref delegates open/close, top-layer placement, focus handling, and modal\ninertness to `showModal()`, `show()`, and `close()`. It does not reproduce a\ndialog with ordinary divs or synthetic events.",
      "Ownership and lifetime": "Applying the ref forks an observer in the current Effect Scope. Modal opening\nwaits for a detached host to connect; a newer state or Scope finalization cancels\nthat pending connection check. Hidden documents may defer the check until animation\nframes resume. Finalization does not close state owned elsewhere or remove\nthe element. `Dialog.Content` handles native `cancel`, `close`, and `toggle`\nevents and composes exactly one hydration owner."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Dialog from \"@typed/ui/Dialog\"\nimport * as NativeDialog from \"@typed/ui/NativeDialog\"\n\nconst program = Effect.gen(function* () {\n  const state = yield* Dialog.makeState()\n  return NativeDialog.ref(state, { modal: true })\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/ui/src/NativeDialog.ts",
      "line": 68
    },
    "since": "1.0.0",
    "category": "Native synchronization"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/ui/NativeDialog#ref",
    "packageName": "@typed/ui",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": "NativeDialog",
    "consumerSpecifier": "@typed/ui/NativeDialog",
    "exportName": "ref",
    "qualifiedName": "ref",
    "declarationKey": "declaration:81bb554c7c10d62b48a4f2c0",
    "family": "function",
    "signatures": [
      "export declare function ref<S extends State, E, R>(state: RefSubject.RefSubject<S, E, R>, options?: Options): (element: HTMLDialogElement) => Effect.Effect<void, E, R | Scope.Scope>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/NativeDialog.ts",
        "start": {
          "line": 68,
          "column": 1
        },
        "end": {
          "line": 92,
          "column": 2
        }
      }
    ],
    "aliases": [],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:81bb554c7c10d62b48a4f2c0",
    "name": "ref",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function ref<S extends State, E, R>(state: RefSubject.RefSubject<S, E, R>, options?: Options): (element: HTMLDialogElement) => Effect.Effect<void, E, R | Scope.Scope>;"
        ],
        "typeParameters": [
          "S extends State",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/ui/src/NativeDialog.ts",
            "start": {
              "line": 68,
              "column": 1
            },
            "end": {
              "line": 92,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function ref<S extends State, E, R>(state: RefSubject.RefSubject<S, E, R>, options?: Options): (element: HTMLDialogElement) => Effect.Effect<void, E, R | Scope.Scope>;"
    ],
    "typeParameters": [
      "S extends State",
      "E",
      "R"
    ],
    "summary": "Creates a scoped ref that drives a real `HTMLDialogElement` from state.",
    "sections": {
      "Why": "The ref delegates open/close, top-layer placement, focus handling, and modal\ninertness to `showModal()`, `show()`, and `close()`. It does not reproduce a\ndialog with ordinary divs or synthetic events.",
      "Ownership and lifetime": "Applying the ref forks an observer in the current Effect Scope. Modal opening\nwaits for a detached host to connect; a newer state or Scope finalization cancels\nthat pending connection check. Hidden documents may defer the check until animation\nframes resume. Finalization does not close state owned elsewhere or remove\nthe element. `Dialog.Content` handles native `cancel`, `close`, and `toggle`\nevents and composes exactly one hydration owner."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Dialog from \"@typed/ui/Dialog\"\nimport * as NativeDialog from \"@typed/ui/NativeDialog\"\n\nconst program = Effect.gen(function* () {\n  const state = yield* Dialog.makeState()\n  return NativeDialog.ref(state, { modal: true })\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/NativeDialog.ts",
        "start": {
          "line": 68,
          "column": 1
        },
        "end": {
          "line": 92,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Native synchronization"
  }
}
