{
  "id": "@typed/ui/NativeDetails#ref",
  "canonicalId": "@typed/ui/NativeDetails#ref",
  "symbol": {
    "id": "@typed/ui/NativeDetails#ref",
    "packageName": "@typed/ui",
    "moduleName": "NativeDetails",
    "exportName": "ref",
    "kind": "function",
    "signatures": [
      "export declare function ref<S extends State, E, R>(state: RefSubject.RefSubject<S, E, R>): (element: HTMLDetailsElement) => Effect.Effect<void, E, R | Scope.Scope>;"
    ],
    "summary": "Creates a scoped ref that synchronizes state to a native `<details>` element.",
    "sections": {
      "Why": "`<details>` already owns disclosure rendering and keyboard behavior. This ref\nonly applies pushed `open` state to that real element; the public Disclosure\ncomponent listens to native `toggle` events for the reverse direction.",
      "Ownership and lifetime": "Applying the ref forks one observer in the current Effect Scope. Scope\nfinalization interrupts it; the state remains owned by its original Scope and\nthe DOM element remains owned by its renderer. Use only one hydration ref\nowner for an element."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Disclosure from \"@typed/ui/Disclosure\"\nimport * as NativeDetails from \"@typed/ui/NativeDetails\"\n\nconst program = Effect.gen(function* () {\n  const state = yield* Disclosure.makeState()\n  return NativeDetails.ref(state)\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/ui/src/NativeDetails.ts",
      "line": 41
    },
    "since": "1.0.0",
    "category": "Native synchronization"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/ui/NativeDetails#ref",
    "packageName": "@typed/ui",
    "packageVersion": "1.0.0-beta.13",
    "moduleName": "NativeDetails",
    "consumerSpecifier": "@typed/ui/NativeDetails",
    "exportName": "ref",
    "qualifiedName": "ref",
    "declarationKey": "declaration:4132392204b34db9358780a8",
    "family": "function",
    "signatures": [
      "export declare function ref<S extends State, E, R>(state: RefSubject.RefSubject<S, E, R>): (element: HTMLDetailsElement) => Effect.Effect<void, E, R | Scope.Scope>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/NativeDetails.ts",
        "start": {
          "line": 41,
          "column": 1
        },
        "end": {
          "line": 58,
          "column": 2
        }
      }
    ],
    "aliases": [],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:4132392204b34db9358780a8",
    "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>): (element: HTMLDetailsElement) => Effect.Effect<void, E, R | Scope.Scope>;"
        ],
        "typeParameters": [
          "S extends State",
          "E",
          "R"
        ],
        "sourceSpans": [
          {
            "file": "packages/ui/src/NativeDetails.ts",
            "start": {
              "line": 41,
              "column": 1
            },
            "end": {
              "line": 58,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function ref<S extends State, E, R>(state: RefSubject.RefSubject<S, E, R>): (element: HTMLDetailsElement) => Effect.Effect<void, E, R | Scope.Scope>;"
    ],
    "typeParameters": [
      "S extends State",
      "E",
      "R"
    ],
    "summary": "Creates a scoped ref that synchronizes state to a native `<details>` element.",
    "sections": {
      "Why": "`<details>` already owns disclosure rendering and keyboard behavior. This ref\nonly applies pushed `open` state to that real element; the public Disclosure\ncomponent listens to native `toggle` events for the reverse direction.",
      "Ownership and lifetime": "Applying the ref forks one observer in the current Effect Scope. Scope\nfinalization interrupts it; the state remains owned by its original Scope and\nthe DOM element remains owned by its renderer. Use only one hydration ref\nowner for an element."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Disclosure from \"@typed/ui/Disclosure\"\nimport * as NativeDetails from \"@typed/ui/NativeDetails\"\n\nconst program = Effect.gen(function* () {\n  const state = yield* Disclosure.makeState()\n  return NativeDetails.ref(state)\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/NativeDetails.ts",
        "start": {
          "line": 41,
          "column": 1
        },
        "end": {
          "line": 58,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Native synchronization"
  }
}
