From c688f9c7d4250dc48961260367d4eff9ff2a2dfa Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Sat, 28 Mar 2026 17:33:30 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74806=20[scriptabl?= =?UTF-8?q?e-ios]=20fix=20`UITableRow.onSelect`=20type:=20add=20`index`=20?= =?UTF-8?q?param,=20m=E2=80=A6=20by=20@Andrej730?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/scriptable-ios/index.d.ts | 6 ++++-- types/scriptable-ios/scriptable-ios-tests.ts | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/types/scriptable-ios/index.d.ts b/types/scriptable-ios/index.d.ts index fd445b9a1456ba..3dba08dca468d6 100644 --- a/types/scriptable-ios/index.d.ts +++ b/types/scriptable-ios/index.d.ts @@ -6077,12 +6077,14 @@ declare class UITableRow { /** * _Called when the row is selected._ * - * Called when the row is selected when the table is presented. If this has no value, the row cannot be selected. Defaults to null. + * Called when the row is selected when the table is presented. If this has no value, the row cannot be selected. Defaults to `undefined`. + * + * The `index` parameter starts from 1. * * Rows cannot be tapped when the tables is presented in Siri. * @see https://docs.scriptable.app/uitablerow/#onselect */ - onSelect: () => void; + onSelect: ((index: number) => void) | undefined; } /** diff --git a/types/scriptable-ios/scriptable-ios-tests.ts b/types/scriptable-ios/scriptable-ios-tests.ts index 89cc909cc23506..35d588c2dde0b8 100644 --- a/types/scriptable-ios/scriptable-ios-tests.ts +++ b/types/scriptable-ios/scriptable-ios-tests.ts @@ -1031,7 +1031,9 @@ } { - // TODO: UITableRow + const row = new UITableRow(); + // $ExpectType ((index: number) => void) | undefined + row.onSelect; } {