docs(): update docs

This commit is contained in:
Ibby 2016-12-06 09:52:39 -05:00
parent d5ac89996f
commit ae6a3cda7a
16 changed files with 351 additions and 331 deletions

View File

@ -1,9 +1,113 @@
import { Cordova, CordovaProperty, Plugin } from './plugin';
import { Observable } from 'rxjs/Observable';
declare var navigator: any;
export interface MediaFile {
/**
* The name of the file, without path information.
*/
name: string;
/**
* The full path of the file, including the name.
*/
fullPath: string;
/**
* The file's mime type
*/
type: string;
/**
* The date and time when the file was last modified.
*/
lastModifiedDate: Date;
/**
* The size of the file, in bytes.
*/
size: number;
/**
* Retrieves the format information of the media file.
* @param {Function} successCallback
* @param {Function} errorCallback
*/
getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any);
}
export interface MediaFileData {
/**
* The actual format of the audio and video content.
*/
codecs: string;
/**
* The average bitrate of the content. The value is zero for images.
*/
bitrate: number;
/**
* The height of the image or video in pixels. The value is zero for audio clips.
*/
height: number;
/**
* The width of the image or video in pixels. The value is zero for audio clips.
*/
width: number;
/**
* The length of the video or sound clip in seconds. The value is zero for images.
*/
duration: number;
}
export interface CaptureError {
code: string;
}
export interface CaptureAudioOptions {
/**
* Maximum number of audio clips. Defaults to 1.
* On iOS you can only record one file.
*/
limit?: number;
/**
* Maximum duration of an audio sound clip, in seconds. This does not work on Android devices.
*/
duration?: number;
}
export interface CaptureImageOptions {
/**
* Maximum number of images to capture. This limit is not supported on iOS, only one image will be taken per invocation.
*/
limit?: number;
}
export interface CaptureVideoOptions {
/**
* Maximum number of video clips to record. This value is ignored on iOS, only one video clip can be taken per invocation.
*/
limit?: number;
/**
* Maximum duration per video clip. This will be ignored on BlackBerry.
*/
duration?: number;
/**
* Quality of the video. This parameter can only be used with Android.
*/
quality?: number;
}
export interface ConfigurationData {
/**
* The ASCII-encoded lowercase string representing the media type.
*/
type: string;
/**
* The height of the image or video in pixels. The value is zero for sound clips.
*/
height: number;
/**
* The width of the image or video in pixels. The value is zero for sound clips.
*/
width: number;
}
/**
* @name Media Capture
* @description
@ -20,6 +124,14 @@ declare var navigator: any;
* );
*
* ```
* @interfaces
* MediaFile
* MediaFileData
* CaptureError
* CaptureAudioOptions
* CaptureImageOptions
* CaptureVideoOptions
* ConfigurationData
*/
@Plugin({
pluginName: 'MediaCapture',
@ -52,7 +164,7 @@ export class MediaCapture {
/**
* Start the audio recorder application and return information about captured audio clip files.
* @param options
* @returns {Promise<MediaFile[]>}
* @returns {Promise<MediaFile[]>}
*/
@Cordova({
callbackOrder: 'reverse'
@ -100,122 +212,3 @@ export class MediaCapture {
static onPendingCaptureError(): Observable<CaptureError> { return; }
}
/**
* Encapsulates properties of a media capture file.
*/
export interface MediaFile {
/**
* The name of the file, without path information.
*/
name: string;
/**
* The full path of the file, including the name.
*/
fullPath: string;
/**
* The file's mime type
*/
type: string;
/**
* The date and time when the file was last modified.
*/
lastModifiedDate: Date;
/**
* The size of the file, in bytes.
*/
size: number;
/**
* Retrieves the format information of the media file.
* @param {Function} successCallback
* @param {Function} errorCallback
*/
getFormatData(successCallback: (data: MediaFileData) => any, errorCallback?: (err: any) => any);
}
/**
* Encapsulates format information about a media file.
*/
export interface MediaFileData {
/**
* The actual format of the audio and video content.
*/
codecs: string;
/**
* The average bitrate of the content. The value is zero for images.
*/
bitrate: number;
/**
* The height of the image or video in pixels. The value is zero for audio clips.
*/
height: number;
/**
* The width of the image or video in pixels. The value is zero for audio clips.
*/
width: number;
/**
* The length of the video or sound clip in seconds. The value is zero for images.
*/
duration: number;
}
/**
* Encapsulates the error code resulting from a failed media capture operation.
*/
export interface CaptureError {
code: string;
}
/**
* Encapsulates audio capture configuration options.
*/
export interface CaptureAudioOptions {
/**
* Maximum number of audio clips. Defaults to 1.
* On iOS you can only record one file.
*/
limit?: number;
/**
* Maximum duration of an audio sound clip, in seconds. This does not work on Android devices.
*/
duration?: number;
}
/**
* Encapsulates image capture configuration options.
*/
export interface CaptureImageOptions {
/**
* Maximum number of images to capture. This limit is not supported on iOS, only one image will be taken per invocation.
*/
limit?: number;
}
/**
* Encapsulates video capture configuration options.
*/
export interface CaptureVideoOptions {
/**
* Maximum number of video clips to record. This value is ignored on iOS, only one video clip can be taken per invocation.
*/
limit?: number;
/**
* Maximum duration per video clip. This will be ignored on BlackBerry.
*/
duration?: number;
/**
* Quality of the video. This parameter can only be used with Android.
*/
quality?: number;
}
/**
* Encapsulates a set of media capture parameters that a device supports.
*/
export interface ConfigurationData {
/**
* The ASCII-encoded lowercase string representing the media type.
*/
type: string;
/**
* The height of the image or video in pixels. The value is zero for sound clips.
*/
height: number;
/**
* The width of the image or video in pixels. The value is zero for sound clips.
*/
width: number;
}

View File

@ -1,5 +1,18 @@
import { Plugin, Cordova } from './plugin';
import { Observable } from 'rxjs/Observable';
export interface MusicControlsOptions {
track: string;
artist: string;
cover: string;
isPlaying: boolean;
dismissable: boolean;
hasPrev: boolean;
hasNext: boolean;
hasClose: boolean;
ticker: string;
}
/**
* @name MusicControls
* @description
@ -71,6 +84,8 @@ import { Observable } from 'rxjs/Observable';
*
*
* ```
* @interfaces
* MusicControlsOptions
*/
@Plugin({
pluginName: 'MusicControls',
@ -79,6 +94,7 @@ import { Observable } from 'rxjs/Observable';
repo: 'https://github.com/homerours/cordova-music-controls-plugin'
})
export class MusicControls {
/**
* Create the media controls
* @param options {MusicControlsOptions}
@ -115,15 +131,5 @@ export class MusicControls {
*/
@Cordova({sync: true})
static updateIsPlaying(isPlaying: boolean): void {}
}
export interface MusicControlsOptions {
track: string;
artist: string;
cover: string;
isPlaying: boolean;
dismissable: boolean;
hasPrev: boolean;
hasNext: boolean;
hasClose: boolean;
ticker: string;
}

View File

@ -1,4 +1,20 @@
import { Plugin, Cordova } from './plugin';
export interface NativeTransitionOptions {
direction?: string;
duration?: number;
slowdownfactor?: number;
slidePixels?: number;
iosdelay?: number;
androiddelay?: number;
winphonedelay?: number;
fixedPixelsTop?: number;
fixedPixelsBottom?: number;
action?: string;
origin?: string;
href?: string;
}
/**
* @name NativePageTransitions
* @description
@ -6,9 +22,9 @@ import { Plugin, Cordova } from './plugin';
*
* @usage
* ```
* import {NativePageTransitions, TransitionOptions} from 'ionic-native';
* import {NativePageTransitions, NativeTransitionOptions} from 'ionic-native';
*
* let options: TransitionOptions = {
* let options: NativeTransitionOptions = {
* direction: 'up',
* duration: 500,
* slowdownfactor: 3,
@ -36,60 +52,46 @@ import { Plugin, Cordova } from './plugin';
export class NativePageTransitions {
/**
* Perform a slide animation
* @param options {TransitionOptions} Options for the transition
* @param options {NativeTransitionOptions} Options for the transition
* @returns {Promise<any>}
*/
@Cordova()
static slide(options: TransitionOptions): Promise<any> { return; }
static slide(options: NativeTransitionOptions): Promise<any> { return; }
/**
* Perform a flip animation
* @param options {TransitionOptions} Options for the transition
* @param options {NativeTransitionOptions} Options for the transition
* @returns {Promise<any>}
*/
@Cordova()
static flip(options: TransitionOptions): Promise<any> { return; }
static flip(options: NativeTransitionOptions): Promise<any> { return; }
/**
* Perform a fade animation
* @param options {TransitionOptions} Options for the transition
* @param options {NativeTransitionOptions} Options for the transition
* @returns {Promise<any>}
*/
@Cordova({platforms: ['iOS', 'Android']})
static fade(options: TransitionOptions): Promise<any> { return; }
static fade(options: NativeTransitionOptions): Promise<any> { return; }
/**
* Perform a slide animation
* @param options {TransitionOptions} Options for the transition
* @param options {NativeTransitionOptions} Options for the transition
* @returns {Promise<any>}
*/
@Cordova({platforms: ['iOS', 'Android']})
static drawer(options: TransitionOptions): Promise<any> { return; }
static drawer(options: NativeTransitionOptions): Promise<any> { return; }
/**
* Perform a slide animation
* @param options {TransitionOptions} Options for the transition
* @param options {NativeTransitionOptions} Options for the transition
* @returns {Promise<any>}
*/
@Cordova({platforms: ['iOS']})
static curl(options: TransitionOptions): Promise<any> { return; }
static curl(options: NativeTransitionOptions): Promise<any> { return; }
}
export interface TransitionOptions {
direction?: string;
duration?: number;
slowdownfactor?: number;
slidePixels?: number;
iosdelay?: number;
androiddelay?: number;
winphonedelay?: number;
fixedPixelsTop?: number;
fixedPixelsBottom?: number;
action?: string;
origin?: string;
href?: string;
}

View File

@ -1,6 +1,69 @@
import { Cordova, Plugin } from './plugin';
import { Observable } from 'rxjs/Observable';
export interface OneSignalNotification {
app_id: string;
contents: any;
headings?: any;
isIos?: boolean;
isAndroid?: boolean;
isWP?: boolean;
isWP_WNS?: boolean;
isAdm?: boolean;
isChrome?: boolean;
isChromeWeb?: boolean;
isSafari?: boolean;
isAnyWeb?: boolean;
included_segments?: string[];
excluded_segments?: string[];
include_player_ids?: string[];
include_ios_tokens?: string[];
include_android_reg_ids?: string[];
include_wp_uris?: string[];
include_wp_wns_uris?: string[];
include_amazon_reg_ids?: string[];
include_chrome_reg_ids?: string[];
include_chrome_web_reg_ids?: string[];
app_ids?: string[];
tags?: any[];
ios_badgeType?: string;
ios_badgeCount?: number;
ios_sound?: string;
android_sound?: string;
adm_sound?: string;
wp_sound?: string;
wp_wns_sound?: string;
data?: any;
buttons?: any;
small_icon?: string;
large_icon?: string;
big_picture?: string;
adm_small_icon?: string;
adm_large_icon?: string;
adm_big_picture?: string;
chrome_icon?: string;
chrome_big_picture?: string;
chrome_web_icon?: string;
firefox_icon?: string;
url?: string;
send_after?: string;
delayed_option?: string;
delivery_time_of_day?: string;
android_led_color?: string;
android_accent_color?: string;
android_visibility?: number;
content_available?: boolean;
amazon_background_data?: boolean;
template_id?: string;
android_group?: string;
android_group_message?: any;
adm_group?: string;
adm_group_message?: any;
ttl?: number;
priority?: number;
ios_category?: string;
}
/**
* @name OneSignal
* @description
@ -27,7 +90,8 @@ import { Observable } from 'rxjs/Observable';
*
* OneSignal.endInit();
* ```
*
* @interfaces
* OneSignalNotification
*/
@Plugin({
pluginName: 'OneSignal',
@ -230,66 +294,3 @@ export class OneSignal {
}): void { }
}
export interface OneSignalNotification {
app_id: string;
contents: any;
headings?: any;
isIos?: boolean;
isAndroid?: boolean;
isWP?: boolean;
isWP_WNS?: boolean;
isAdm?: boolean;
isChrome?: boolean;
isChromeWeb?: boolean;
isSafari?: boolean;
isAnyWeb?: boolean;
included_segments?: string[];
excluded_segments?: string[];
include_player_ids?: string[];
include_ios_tokens?: string[];
include_android_reg_ids?: string[];
include_wp_uris?: string[];
include_wp_wns_uris?: string[];
include_amazon_reg_ids?: string[];
include_chrome_reg_ids?: string[];
include_chrome_web_reg_ids?: string[];
app_ids?: string[];
tags?: any[];
ios_badgeType?: string;
ios_badgeCount?: number;
ios_sound?: string;
android_sound?: string;
adm_sound?: string;
wp_sound?: string;
wp_wns_sound?: string;
data?: any;
buttons?: any;
small_icon?: string;
large_icon?: string;
big_picture?: string;
adm_small_icon?: string;
adm_large_icon?: string;
adm_big_picture?: string;
chrome_icon?: string;
chrome_big_picture?: string;
chrome_web_icon?: string;
firefox_icon?: string;
url?: string;
send_after?: string;
delayed_option?: string;
delivery_time_of_day?: string;
android_led_color?: string;
android_accent_color?: string;
android_visibility?: number;
content_available?: boolean;
amazon_background_data?: boolean;
template_id?: string;
android_group?: string;
android_group_message?: any;
adm_group?: string;
adm_group_message?: any;
ttl?: number;
priority?: number;
ios_category?: string;
}

View File

@ -59,6 +59,8 @@ export interface PrintOptions {
*
* Printer.print(content, options).then(onSuccess, onError);
* ```
* @interfaces
* PrintOptions
*/
@Plugin({
pluginName: 'Printer',

View File

@ -1,5 +1,15 @@
import { Cordova, Plugin } from './plugin';
export interface SafariViewControllerOptions {
url?: string;
hidden?: boolean;
toolbarColor?: string;
animated?: boolean;
showDefaultShareMenuItem?: boolean;
enterReaderModeIfAvailable?: boolean;
tintColor?: string;
transition?: string;
}
/**
* @name SafariViewController
@ -37,6 +47,8 @@ import { Cordova, Plugin } from './plugin';
* }
* );
* ```
* @interfaces
* SafariViewControllerOptions
*/
@Plugin({
pluginName: 'SafariViewController',
@ -91,14 +103,3 @@ export class SafariViewController {
static mayLaunchUrl(url: string): Promise<any> { return; }
}
export interface SafariViewControllerOptions {
url?: string;
hidden?: boolean;
toolbarColor?: string;
animated?: boolean;
showDefaultShareMenuItem?: boolean;
enterReaderModeIfAvailable?: boolean;
tintColor?: string;
transition?: string;
}

View File

@ -38,6 +38,9 @@ export interface SmsOptionsAndroid {
* // Send a text message using default options
* SMS.send('416123456', 'Hello world!');
* ```
* @interfaces
* SmsOptions
* SmsOptionsAndroid
*/
@Plugin({
pluginName: 'SMS',

View File

@ -1,5 +1,11 @@
import { Cordova, Plugin } from './plugin';
export interface SpinnerDialogIOSOptions {
overlayOpacity?: number;
textColorRed?: number;
textColorGreen?: number;
textColorBlue?: number;
}
/**
* @name Spinner Dialog
@ -13,6 +19,8 @@ import { Cordova, Plugin } from './plugin';
*
* SpinnerDialog.hide();
* ```
* @interfaces
* SpinnerDialogIOSOptions
*/
@Plugin({
pluginName: 'SpinnerDialog',
@ -44,10 +52,3 @@ export class SpinnerDialog {
static hide(): void {}
}
export interface SpinnerDialogIOSOptions {
overlayOpacity?: number;
textColorRed?: number;
textColorGreen?: number;
textColorBlue?: number;
}

View File

@ -1,4 +1,20 @@
import { Plugin, Cordova } from './plugin';
export interface StreamingVideoOptions {
successCallback?: Function;
errorCallback?: Function;
orientation?: string;
}
export interface StreamingAudioOptions {
bgColor?: string;
bgImage?: string;
bgImageScale?: string;
initFullscreen?: boolean;
successCallback?: Function;
errorCallback?: Function;
}
/**
* @name StreamingMedia
* @description
@ -17,6 +33,9 @@ import { Plugin, Cordova } from './plugin';
* StreamingMedia.('https://path/to/video/stream', options);
*
* ```
* @interfaces
* StreamingVideoOptions
* StreamingAudioOptions
*/
@Plugin({
pluginName: 'StreamingMedia',
@ -61,18 +80,3 @@ export class StreamingMedia {
static resumeAudio(): void { }
}
export interface StreamingVideoOptions {
successCallback?: Function;
errorCallback?: Function;
orientation?: string;
}
export interface StreamingAudioOptions {
bgColor?: string;
bgImage?: string;
bgImageScale?: string;
initFullscreen?: boolean;
successCallback?: Function;
errorCallback?: Function;
}

View File

@ -23,6 +23,8 @@ export interface TTSOptions {
* .catch((reason: any) => console.log(reason));
*
* ```
* @interfaces
* TTSOptions
*/
@Plugin({
pluginName: 'TextToSpeech',

View File

@ -142,6 +142,9 @@ export interface ThemeableBrowserOptions {
*
* ```
* We suggest that you refer to the plugin's repository for additional information on usage that may not be covered here.
* @interfaces
* ThemeableBrowserButton
* ThemeableBrowserOptions
*/
@Plugin({
pluginName: 'ThemeableBrowser',

View File

@ -1,7 +1,6 @@
import { Cordova, Plugin } from './plugin';
import { Observable } from 'rxjs/Observable';
export interface ToastOptions {
/**
* Message to display
@ -35,6 +34,7 @@ export interface ToastOptions {
verticalPadding?: number;
};
}
/**
* @name Toast
* @description

View File

@ -1,5 +1,23 @@
import { Plugin, Cordova } from './plugin';
export interface TwitterConnectResponse {
/**
* Twitter Username
*/
userName: string;
/**
* Twitter User ID
*/
userId: string;
/**
* Twitter OAuth Secret
*/
secret: string;
/**
* Twitter OAuth Token
*/
token: string;
}
/**
* @name Twitter Connect
@ -25,6 +43,8 @@ import { Plugin, Cordova } from './plugin';
*
* TwitterConnect.logout().then(onLogoutSuccess, onLogoutError);
* ```
* @interfaces
* TwitterConnectResponse
*/
@Plugin({
pluginName: 'TwitterConnect',
@ -54,21 +74,4 @@ export class TwitterConnect {
@Cordova()
static showUser(): Promise<any> {return; }
}
export interface TwitterConnectResponse {
/**
* Twitter Username
*/
userName: string;
/**
* Twitter User ID
*/
userId: string;
/**
* Twitter OAuth Secret
*/
secret: string;
/**
* Twitter OAuth Token
*/
token: string;
}

View File

@ -135,6 +135,12 @@ export interface VideoInfo {
* .catch((error: any) => console.log('video transcode error', error));
*
* ```
* @interfaces
* TranscodeOptions
* TrimOptions
* CreateThumbnailOptions
* GetVideoInfoOptions
* VideoInfo
*/
@Plugin({
pluginName: 'VideoEditor',

View File

@ -36,6 +36,8 @@ export interface VideoOptions {
* });
*
* ```
* @interfaces
* VideoOptions
*/
@Plugin({
pluginName: 'VideoPlayer',

View File

@ -1,62 +1,5 @@
import { Plugin, Cordova } from './plugin';
/**
* @name ZBar
* @description
* The ZBar Scanner Plugin allows you to scan 2d barcodes.
*
* Requires Cordova plugin: `cordova-plugin-cszbar`. For more info, please see the [zBar plugin docs](https://github.com/tjwoon/csZBar).
*
* @usage
* ```
* import { ZBar } from 'ionic-native';
*
* let zBarOptions = {
* flash: "off",
* drawSight: false
* };
*
* ZBar.scan(zBarOptions)
* .then(result => {
* console.log(result); // Scanned code
* })
* .catch(error => {
* console.log(error); // Error message
* });
*
* ```
*
* @advanced
* zBar options
*
* | Option | Type | Values | Defaults |
* |--------------------|-----------|-----------------------------------------------------------------------------------------|
* | text_title |`string?` | | `"Scan QR Code"` (Android only) |
* | text_instructions |`string?` | | `"Please point your camera at the QR code."` (Android only) |
* | camera |`string?` | `"front"`, `"back"`, | `"back"` |
* | flash |`string?` | `"on"`, `"off"`, `"auto"` | `"auto"` |
* | drawSight |`boolean?` | `true`, `false` | `true` (Draws red line in center of scanner) |
*
*/
@Plugin({
pluginName: 'ZBar',
plugin: 'cordova-plugin-cszbar',
pluginRef: 'cloudSky.zBar',
repo: 'https://github.com/tjwoon/csZBar',
platforms: ['Android', 'iOS']
})
export class ZBar {
/**
* Open the scanner
* @param options { ZBarOptions } Scan options
* @returns {Promise<any>} Returns a Promise that resolves with the scanned string, or rejects with an error.
*/
@Cordova()
static scan(options: ZBarOptions): Promise<any> { return; }
}
export interface ZBarOptions {
/**
* A string representing the title text (Android only).
@ -90,3 +33,51 @@ export interface ZBarOptions {
*/
drawSight?: boolean;
}
/**
* @name ZBar
* @description
* The ZBar Scanner Plugin allows you to scan 2d barcodes.
*
* Requires Cordova plugin: `cordova-plugin-cszbar`. For more info, please see the [zBar plugin docs](https://github.com/tjwoon/csZBar).
*
* @usage
* ```
* import { ZBar } from 'ionic-native';
*
* let zBarOptions = {
* flash: "off",
* drawSight: false
* };
*
* ZBar.scan(zBarOptions)
* .then(result => {
* console.log(result); // Scanned code
* })
* .catch(error => {
* console.log(error); // Error message
* });
*
* ```
*
* @interfaces
* ZBarOptions
*/
@Plugin({
pluginName: 'ZBar',
plugin: 'cordova-plugin-cszbar',
pluginRef: 'cloudSky.zBar',
repo: 'https://github.com/tjwoon/csZBar',
platforms: ['Android', 'iOS']
})
export class ZBar {
/**
* Open the scanner
* @param options { ZBarOptions } Scan options
* @returns {Promise<any>} Returns a Promise that resolves with the scanned string, or rejects with an error.
*/
@Cordova()
static scan(options: ZBarOptions): Promise<any> { return; }
}