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; } {