From 2d9a0bbd9b63c8a4ede3a61b18698211491fe09b Mon Sep 17 00:00:00 2001 From: Eddy Verbruggen Date: Wed, 2 May 2018 12:11:14 +0200 Subject: [PATCH] Allow more than one button/listitem TypeScript 2.6 doesn't allow a type defined as `[string]` to have more than 1 item. TypeScript 2.8 also rejects the [{}] style used for `buttons`. With this PR merged, the Arrays are allowed to have multiple objects. --- src/index.d.ts | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/index.d.ts b/src/index.d.ts index 44d996e..0f458cd 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -33,29 +33,27 @@ export interface DialogOptions { cancellable?: boolean; headerView?: any; // nativeView footerView?: any; // nativeView - onDismiss?: Function; // calback for dismiss - buttons?: [ - { - text: string; // title - buttonStyle: CFAlertActionStyle; - buttonAlignment?: CFAlertActionAlignment; - textColor?: string; - backgroundColor?: string; - onClick: Function; - } - ]; + onDismiss?: Function; // callback for dismiss + buttons?: Array<{ + text: string; // title + buttonStyle: CFAlertActionStyle; + buttonAlignment?: CFAlertActionAlignment; + textColor?: string; + backgroundColor?: string; + onClick: Function; + }>; simpleList?: { - items: [string]; + items: Array; onClick: Function; }; singleChoiceList?: { - items: [string]; + items: Array; selectedItem: number; onClick: Function; }; multiChoiceList?: { - items: [string]; - selectedItems: [boolean]; + items: Array; + selectedItems: Array; onClick: Function; }; }