{
  "id": "@typed/ui#Dom.composeRefs",
  "canonicalId": "@typed/ui/Dom/Refs#composeRefs",
  "symbol": {
    "id": "@typed/ui#Dom.composeRefs",
    "packageName": "@typed/ui",
    "moduleName": ".",
    "exportName": "Dom.composeRefs",
    "kind": "function",
    "signatures": [
      "export declare function composeRefs<const First extends RefInput | null | undefined, const Second extends RefInput | null | undefined = undefined>(first: First, second?: Second): ComposedRef<First, Second> | undefined;"
    ],
    "summary": "Composes two element refs in order.",
    "sections": {
      "Why": "A component's internal ref and a caller's ref both need the real mounted\nnode. Each return value may be void, Effect, Stream, or Fx, and composition\nnormalizes those forms without hiding failures or services.",
      "Ownership and lifetime": "The first ref runs before the second. Streams and Fx values are drained in\nthe caller's Scope and interrupted on unmount. The function throws\nsynchronously when both refs claim hydration ownership because applying two\nserialized states to one element is ambiguous."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { composeRefs } from \"@typed/ui/Dom/Refs\"\nimport { Effect } from \"effect\"\n\nconst ref = composeRefs(\n  (element: HTMLButtonElement) => Effect.sync(() => element.focus()),\n  (element: HTMLButtonElement) => console.log(element)\n)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/ui/src/Dom/Refs.ts",
      "line": 74
    },
    "since": "1.0.0",
    "category": "Ref composition"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/ui#Dom.composeRefs",
    "packageName": "@typed/ui",
    "packageVersion": "1.0.0-beta.13",
    "moduleName": ".",
    "consumerSpecifier": "@typed/ui",
    "exportName": "Dom",
    "qualifiedName": "Dom.composeRefs",
    "declarationKey": "declaration:6f4cd1d63454e9a9f1fcfadc",
    "family": "function",
    "signatures": [
      "export declare function composeRefs<const First extends RefInput | null | undefined, const Second extends RefInput | null | undefined = undefined>(first: First, second?: Second): ComposedRef<First, Second> | undefined;"
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/Dom/Refs.ts",
        "start": {
          "line": 74,
          "column": 1
        },
        "end": {
          "line": 97,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/ui/Dom#composeRefs",
      "@typed/ui/Dom/Refs#composeRefs",
      "@typed/ui/Dom/index#composeRefs",
      "@typed/ui/index#Dom.composeRefs"
    ],
    "isAlias": true,
    "parentId": "@typed/ui#Dom",
    "static": false,
    "importedFrom": "declaration:6f4cd1d63454e9a9f1fcfadc"
  },
  "declaration": {
    "declarationKey": "declaration:6f4cd1d63454e9a9f1fcfadc",
    "name": "composeRefs",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function composeRefs<const First extends RefInput | null | undefined, const Second extends RefInput | null | undefined = undefined>(first: First, second?: Second): ComposedRef<First, Second> | undefined;"
        ],
        "typeParameters": [
          "const First extends RefInput | null | undefined",
          "const Second extends RefInput | null | undefined = undefined"
        ],
        "sourceSpans": [
          {
            "file": "packages/ui/src/Dom/Refs.ts",
            "start": {
              "line": 74,
              "column": 1
            },
            "end": {
              "line": 97,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function composeRefs<const First extends RefInput | null | undefined, const Second extends RefInput | null | undefined = undefined>(first: First, second?: Second): ComposedRef<First, Second> | undefined;"
    ],
    "typeParameters": [
      "const First extends RefInput | null | undefined",
      "const Second extends RefInput | null | undefined = undefined"
    ],
    "summary": "Composes two element refs in order.",
    "sections": {
      "Why": "A component's internal ref and a caller's ref both need the real mounted\nnode. Each return value may be void, Effect, Stream, or Fx, and composition\nnormalizes those forms without hiding failures or services.",
      "Ownership and lifetime": "The first ref runs before the second. Streams and Fx values are drained in\nthe caller's Scope and interrupted on unmount. The function throws\nsynchronously when both refs claim hydration ownership because applying two\nserialized states to one element is ambiguous."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { composeRefs } from \"@typed/ui/Dom/Refs\"\nimport { Effect } from \"effect\"\n\nconst ref = composeRefs(\n  (element: HTMLButtonElement) => Effect.sync(() => element.focus()),\n  (element: HTMLButtonElement) => console.log(element)\n)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/Dom/Refs.ts",
        "start": {
          "line": 74,
          "column": 1
        },
        "end": {
          "line": 97,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Ref composition"
  }
}
