From 62026840474ca1cd5e46e658e59cf14fcf014418 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Fri, 23 Oct 2026 10:51:26 +0200 Subject: [PATCH 1/2] docs: fix callback types and callSync() note --- docs/docs/types/callbacks.md | 2 +- docs/docs/types/typing-system.md | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/docs/types/callbacks.md b/docs/docs/types/callbacks.md index 5853b39e1d..4c9f5b170e 100644 --- a/docs/docs/types/callbacks.md +++ b/docs/docs/types/callbacks.md @@ -171,7 +171,7 @@ func callResultAsync(callback: any Callback<(), Double>) async throws { :::warning -For a JS callback, `callSync()` requires the caller to be on its originating runtime's dispatcher; otherwise it throws. +For a JS callback, `callSync()` must be called on the thread of the JS Runtime the callback came from. Debug builds assert this. ::: diff --git a/docs/docs/types/typing-system.md b/docs/docs/types/typing-system.md index ad530e3163..2916243dd1 100644 --- a/docs/docs/types/typing-system.md +++ b/docs/docs/types/typing-system.md @@ -120,20 +120,20 @@ These are all the types Nitro supports out of the box: (T...) => void - std::function<void (T...)> - @escaping (T...) -> Void + Callback<void(T...)> + any Callback<(T...), Void> (T...) -> Unit (T...) => R - std::function<std::shared_ptr<Promise<R>> (T...)> - @escaping (T...) -> Promise<R> + Callback<R(T...)> + any Callback<(T...), R> (T...) -> Promise<R> - Sync<(T...) => R> - std::function<R (T...)> - @escaping (T...) -> R + Inline<(T...) => R> + InlineCallback<R(T...)> + some InlineCallback<(T...), R> (T...) -> R From 16cba8e786b688d3cf8515d6c8aab9c2551bafe5 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Fri, 23 Oct 2026 10:53:54 +0200 Subject: [PATCH 2/2] docs: use #1974 Kotlin callback types and full Swift InlineCallback type --- docs/docs/types/callbacks.md | 2 +- docs/docs/types/typing-system.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/docs/types/callbacks.md b/docs/docs/types/callbacks.md index 4c9f5b170e..70643a6107 100644 --- a/docs/docs/types/callbacks.md +++ b/docs/docs/types/callbacks.md @@ -171,7 +171,7 @@ func callResultAsync(callback: any Callback<(), Double>) async throws { :::warning -For a JS callback, `callSync()` must be called on the thread of the JS Runtime the callback came from. Debug builds assert this. +For a JS callback, `callSync()` must be called on the thread of the JS Runtime the callback came from. ::: diff --git a/docs/docs/types/typing-system.md b/docs/docs/types/typing-system.md index 2916243dd1..fe4832ec94 100644 --- a/docs/docs/types/typing-system.md +++ b/docs/docs/types/typing-system.md @@ -122,19 +122,19 @@ These are all the types Nitro supports out of the box: (T...) => void Callback<void(T...)> any Callback<(T...), Void> - (T...) -> Unit + Callback<(T...) -> Unit> (T...) => R Callback<R(T...)> any Callback<(T...), R> - (T...) -> Promise<R> + Callback<(T...) -> R> Inline<(T...) => R> InlineCallback<R(T...)> - some InlineCallback<(T...), R> - (T...) -> R + some InlineCallback<(T...), R> & ~Copyable & ~Escapable + Callback<(T...) -> R> Record<string, T>