Skip to content

Commit c688f9c

Browse files
authored
🤖 Merge PR DefinitelyTyped#74806 [scriptable-ios] fix UITableRow.onSelect type: add index param, m… by @Andrej730
1 parent 083439f commit c688f9c

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎types/scriptable-ios/index.d.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6077,12 +6077,14 @@ declare class UITableRow {
60776077
/**
60786078
* _Called when the row is selected._
60796079
*
6080-
* Called when the row is selected when the table is presented. If this has no value, the row cannot be selected. Defaults to null.
6080+
* Called when the row is selected when the table is presented. If this has no value, the row cannot be selected. Defaults to `undefined`.
6081+
*
6082+
* The `index` parameter starts from 1.
60816083
*
60826084
* Rows cannot be tapped when the tables is presented in Siri.
60836085
* @see https://docs.scriptable.app/uitablerow/#onselect
60846086
*/
6085-
onSelect: () => void;
6087+
onSelect: ((index: number) => void) | undefined;
60866088
}
60876089

60886090
/**

‎types/scriptable-ios/scriptable-ios-tests.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,9 @@
10311031
}
10321032

10331033
{
1034-
// TODO: UITableRow
1034+
const row = new UITableRow();
1035+
// $ExpectType ((index: number) => void) | undefined
1036+
row.onSelect;
10351037
}
10361038

10371039
{

0 commit comments

Comments
 (0)