{
  "id": "@typed/ui/index#Dialog.requestClose",
  "canonicalId": "@typed/ui/Dialog#requestClose",
  "symbol": {
    "id": "@typed/ui/index#Dialog.requestClose",
    "packageName": "@typed/ui",
    "moduleName": "index",
    "exportName": "Dialog.requestClose",
    "kind": "function",
    "signatures": [
      "export declare function requestClose(state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>, returnValue?: string): Effect.Effect<void>;"
    ],
    "summary": "Requests the native dialog close lifecycle, including its cancel event.",
    "sections": {
      "Why": "The browser's `requestClose()` is cancelable. The fallback dispatches a real\ncancelable `cancel` event and calls `close()` only when it is accepted, so\nuser handlers retain the same veto point.",
      "Ownership and lifetime": "The Effect consults the dialog currently registered for the hydrated state;\nregistration is removed when `Content`'s Scope closes. No dialog is retained\nafter that finalizer."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Dialog from \"@typed/ui/Dialog\"\n\nconst program = Effect.gen(function* () {\n  const state = yield* Dialog.makeState({ open: true })\n  yield* Dialog.requestClose(state)\n})"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/ui/src/Dialog.ts",
      "line": 174
    },
    "since": "1.0.0",
    "category": "Cancelable dismissal"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/ui/index#Dialog.requestClose",
    "packageName": "@typed/ui",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": "index",
    "consumerSpecifier": "@typed/ui/index",
    "exportName": "Dialog",
    "qualifiedName": "Dialog.requestClose",
    "declarationKey": "declaration:b4fb6481ee01849ac98a978d",
    "family": "function",
    "signatures": [
      "export declare function requestClose(state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>, returnValue?: string): Effect.Effect<void>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/Dialog.ts",
        "start": {
          "line": 174,
          "column": 1
        },
        "end": {
          "line": 188,
          "column": 2
        }
      }
    ],
    "aliases": [
      "@typed/ui#Dialog.requestClose",
      "@typed/ui/Dialog#requestClose"
    ],
    "isAlias": true,
    "parentId": "@typed/ui/index#Dialog",
    "static": false,
    "importedFrom": "declaration:b4fb6481ee01849ac98a978d"
  },
  "declaration": {
    "declarationKey": "declaration:b4fb6481ee01849ac98a978d",
    "name": "requestClose",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function requestClose(state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>, returnValue?: string): Effect.Effect<void>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/ui/src/Dialog.ts",
            "start": {
              "line": 174,
              "column": 1
            },
            "end": {
              "line": 188,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function requestClose(state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>, returnValue?: string): Effect.Effect<void>;"
    ],
    "typeParameters": [],
    "summary": "Requests the native dialog close lifecycle, including its cancel event.",
    "sections": {
      "Why": "The browser's `requestClose()` is cancelable. The fallback dispatches a real\ncancelable `cancel` event and calls `close()` only when it is accepted, so\nuser handlers retain the same veto point.",
      "Ownership and lifetime": "The Effect consults the dialog currently registered for the hydrated state;\nregistration is removed when `Content`'s Scope closes. No dialog is retained\nafter that finalizer."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { Effect } from \"effect\"\nimport * as Dialog from \"@typed/ui/Dialog\"\n\nconst program = Effect.gen(function* () {\n  const state = yield* Dialog.makeState({ open: true })\n  yield* Dialog.requestClose(state)\n})"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/Dialog.ts",
        "start": {
          "line": 174,
          "column": 1
        },
        "end": {
          "line": 188,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Cancelable dismissal"
  }
}
