• The single, logic-level dialog primitive.

    Renders template (or content) with data, shows the buttons (a single confirming ok button by default), and resolves to:

    • the callback return value, when a callback is provided;
    • otherwise { action, data } — the pressed button's action plus the parsed form data;
    • null if the dialog is dismissed (unless rejectClose is set, which rejects instead).

    All Foundry/DOM work — template rendering, FormDataExtended form parsing, and DialogV2 — lives here at the boundary, so callers in the logic layer describe the dialog purely and receive a plain-object result.

    Parameters

    Returns Promise<any>

    The dialog result (see above), or null if dismissed.

    Error if the spec supplies neither content nor template.