Merge pull request #55 from driftyco/fix-interfaces

Fix interfaces
This commit is contained in:
Ibrahim Hadeed 2016-03-13 20:41:20 -04:00
commit 83f48bb65d
8 changed files with 64 additions and 58 deletions

View File

@ -29,6 +29,7 @@ import {Facebook} from './plugins/facebook';
import {Flashlight} from './plugins/flashlight';
import {Geolocation} from './plugins/geolocation';
import {Globalization} from './plugins/globalization';
import {Hotspot} from './plugins/hotspot';
import {ImagePicker} from './plugins/imagepicker';
import {Keyboard} from './plugins/keyboard';
import {LaunchNavigator} from './plugins/launchnavigator';
@ -39,6 +40,7 @@ import {Splashscreen} from './plugins/splashscreen';
import {StatusBar} from './plugins/statusbar';
import {Toast} from './plugins/toast';
import {TouchID} from './plugins/touchid';
import {Vibration} from './plugins/vibration';
export {
ActionSheet,
@ -65,6 +67,7 @@ export {
Flashlight,
Geolocation,
Globalization,
Hotspot,
ImagePicker,
Keyboard,
LaunchNavigator,
@ -74,7 +77,8 @@ export {
Splashscreen,
StatusBar,
Toast,
TouchID
TouchID,
Vibration
}
export * from './plugins/plugin';
@ -105,6 +109,7 @@ window['IonicNative'] = {
Flashlight: Flashlight,
Geolocation: Geolocation,
Globalization: Globalization,
Hotspot: Hotspot,
ImagePicker: ImagePicker,
Keyboard: Keyboard,
LaunchNavigator: LaunchNavigator,
@ -114,7 +119,8 @@ window['IonicNative'] = {
Splashscreen: Splashscreen,
StatusBar: StatusBar,
Toast: Toast,
TouchID: TouchID
TouchID: TouchID,
Vibration: Vibration
};
// To help developers using cordova, we listen for the device ready event and

View File

@ -20,47 +20,47 @@ export interface datePickerOptions {
* Type: Date | empty String
* Default: empty String
*/
minDate: Date,
minDate?: Date,
/**
* Platforms: iOS, Android, Windows
* Platforms?: iOS, Android, Windows
* Maximum date
* Type: Date | empty String
* Default: empty String
* Type?: Date | empty String
* Default?: empty String
*/
maxDate: Date,
maxDate?: Date,
/**
* Platforms: Android
* Platforms?: Android
* Label for the dialog title. If empty, uses android default (Set date/Set time).
* Type: String
* Default: empty String
* Type?: String
* Default?: empty String
*/
titleText: string,
titleText?: string,
/**
* Platforms: Android
* Platforms?: Android
* Label of BUTTON_POSITIVE (done button) on Android
*/
okText: string,
okText?: string,
// TODO complete documentation here, and copy params & docs to main plugin docs
cancelText: string,
todayText: string,
nowText: string,
is24Hour: boolean,
androidTheme: number,
allowOldDate: boolean,
allowFutureDates: boolean,
doneButtonLabel: string,
doneButtonColor: string,
cancelButtonLabel: string,
cancelButtonColor: string,
x: number,
y: number,
minuteInterval: number,
popoverArrowDirection: string,
locale: string
cancelText?: string,
todayText?: string,
nowText?: string,
is24Hour?: boolean,
androidTheme?: number,
allowOldDate?: boolean,
allowFutureDates?: boolean,
doneButtonLabel?: string,
doneButtonColor?: string,
cancelButtonLabel?: string,
cancelButtonColor?: string,
x?: number,
y?: number,
minuteInterval?: number,
popoverArrowDirection?: string,
locale?: string
}
/**

View File

@ -30,12 +30,12 @@ export interface CompassOptions {
/**
* How often to retrieve the compass heading in milliseconds. (Number) (Default: 100)
*/
frequency : number,
frequency? : number,
/**
* The change in degrees required to initiate a watchHeading success callback. When this value is set, frequency is ignored. (Number)
*/
filter : number
filter? : number
}

View File

@ -69,7 +69,7 @@ export interface GeolocationOptions {
* retrieve the real current position. If set to Infinity the device must
* return a cached position regardless of its age. Default: 0.
*/
maximumAge: number;
maximumAge?: number;
/**
* Is a positive long value representing the maximum length of time
@ -77,7 +77,7 @@ export interface GeolocationOptions {
* position. The default value is Infinity, meaning that getCurrentPosition()
* won't return until the position is available.
*/
timeout: number;
timeout?: number;
/**
* Indicates the application would like to receive the best possible results.
@ -88,7 +88,7 @@ export interface GeolocationOptions {
* responding more quickly and/or using less power. Default: false.
* @type {boolean}
*/
enableHighAccuracy: boolean;
enableHighAccuracy?: boolean;
}

View File

@ -6,43 +6,43 @@ export interface launchNavigatorOptions {
* iOS, Android, Windows
* If true, the plugin will NOT attempt to use the geolocation plugin to determine the current device position when the start location parameter is omitted. Defaults to false.
*/
disableAutoGeolocation : boolean,
disableAutoGeolocation? : boolean,
/**
* iOS, Android, Windows
* Transportation mode for navigation: "driving", "walking" or "transit". Defaults to "driving" if not specified.
*/
transportMode : string,
transportMode? : string,
/**
* iOS
* If true, plugin will attempt to launch Google Maps instead of Apple Maps. If Google Maps is not available, it will fall back to Apple Maps.
*/
preferGoogleMaps : boolean,
preferGoogleMaps? : boolean,
/**
* iOS
* If using Google Maps and the app has a URL scheme, passing this to Google Maps will display a button which returns to the app.
*/
urlScheme : string,
urlScheme? : string,
/**
* iOS
* If using Google Maps with a URL scheme, this specifies the text of the button in Google Maps which returns to the app. Defaults to "Back" if not specified.
*/
backButtonText : string,
backButtonText? : string,
/**
* iOS
* If true, debug log output will be generated by the plugin. Defaults to false.
*/
enableDebug : boolean,
enableDebug? : boolean,
/**
* Android
* Navigation mode in which to open Google Maps app: "maps" or "turn-by-turn". Defaults to "maps" if not specified.
*/
navigationMode : string,
navigationMode? : string,
}

View File

@ -194,64 +194,64 @@ export interface Notification {
* A unique identifier required to clear, cancel, update or retrieve the local notification in the future
* Default: 0
*/
id : number,
id? : number,
/**
* First row of the notification
* Default: Empty string (iOS) or the app name (Android)
*/
title : string,
title? : string,
/**
* Second row of the notification
* Default: Empty string
*/
text : string,
text? : string,
/**
* The interval at which to reschedule the local notification. That can be a value of second, minute, hour, day, week, month or year
* Default: 0 (which means that the system triggers the local notification once)
*/
every : string,
every? : string,
/**
* The date and time when the system should deliver the local notification. If the specified value is nil or is a date in the past, the local notification is delivered immediately.
* Default: now ~ new Date()
*/
at : any,
firstAt : any,
at? : any,
firstAt? : any,
/**
* The number currently set as the badge of the app icon in Springboard (iOS) or at the right-hand side of the local notification (Android)
* Default: 0 (which means don't show a number)
*/
badge : number,
badge? : number,
/**
* Uri of the file containing the sound to play when an alert is displayed
* Default: res://platform_default
*/
sound : string,
sound? : string,
/**
* Arbitrary data, objects will be encoded to JSON string
* Default: null
*/
data : any,
data? : any,
/**
* ANDROID ONLY
* Uri of the icon that is shown in the ticker and notification
* Default: res://icon
*/
icon : string,
icon? : string,
/**
* ANDROID ONLY
* Uri of the resource (only res://) to use in the notification layouts. Different classes of devices may return different sizes
* Default: res://ic_popup_reminder
*/
smallIcon : string,
smallIcon? : string,
/**
@ -261,12 +261,12 @@ export interface Notification {
* - They do not have an 'X' close button, and are not affected by the "Clear all" button
* Default: false
*/
ongoing : boolean,
ongoing? : boolean,
/**
* ANDROID ONLY
* ARGB value that you would like the LED on the device to blink
* Default: FFFFFF
*/
led : string
led? : string
}

View File

@ -232,7 +232,7 @@ export interface AndroidPushOptions {
* If the array contains one or more strings each string will be used to
* subscribe to a GcmPubSub topic.
*/
topics: string[];
topics?: string[];
}
export interface PushOptions {

View File

@ -8,9 +8,9 @@ export interface smsOptions {
/**
* Set to true to replace \n by a new line. Default: false
*/
replaceLineBreaks : boolean,
replaceLineBreaks? : boolean,
android : smsOptionsAndroid
android? : smsOptionsAndroid
}
@ -19,7 +19,7 @@ export interface smsOptionsAndroid {
/**
* Set to "INTENT" to send SMS with the native android SMS messaging. Leaving it empty will send the SMS without opening any app.
*/
intent : string
intent? : string
}