Created
March 20, 2013 16:39
-
-
Save t0yv0/5206160 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Capture: http://docs.phonegap.com/en/2.5.0/cordova_media_capture_capture.md.html | |
module Capture { | |
interface ConfigurationData { | |
type: string; | |
height: number; | |
width: number; | |
} | |
interface CaptureCB { | |
call(mediaFiles: MediaFile[]) : void; | |
} | |
interface MediaFileData { | |
codecs: string; | |
bitrate: number; | |
height: number; | |
width: number; | |
duration: number; | |
} | |
interface MediaFile { | |
name: string; | |
fullPath: string; | |
type: string; | |
lastModifiedDate: Date; | |
size: number; | |
getFormatData(successCallback: (data: MediaFileData) => void, errorCallback?: () => void); | |
} | |
interface CaptureException { | |
code: CaptureError; | |
} | |
interface CaptureAudioOptions { | |
limit?: number; | |
duration?: number; | |
mode?: ConfigurationData; | |
} | |
interface CaptureImageOptions { | |
limit? : number; | |
mode?: ConfigurationData; | |
} | |
interface CaptureVideoOptions { | |
limit? : number; | |
duration?: number; | |
mode?: ConfigurationData; | |
} | |
interface CaptureCB { | |
(mediaFiles: MediaFile[]) : void; | |
} | |
interface CaptureErrorCB { | |
(error: CaptureException) : void; | |
} | |
} | |
enum CaptureError { | |
CAPTURE_INTERNAL_ERR, | |
CAPTURE_APPLICATION_BUSY, | |
CAPTURE_INVALID_ARGUMENT, | |
CAPTURE_NO_MEDIA_FILES, | |
CAPTURE_NOT_SUPPORTED | |
} | |
module navigator.device.capture { | |
var supportedAudioModes: Capture.ConfigurationData[]; | |
var supportedImageModes: Capture.ConfigurationData[]; | |
var supportedVideoModes: Capture.ConfigurationData[]; | |
function captureAudio(captureSuccess: Capture.CaptureCB, captureError: Capture.CaptureError, options?: Capture.AudioOptions) {}; | |
function captureImage(captureSuccess: Capture.CaptureCB, captureError: Capture.CaptureError, options?: Capture.ImageOptions) {}; | |
function captureVideo(captureSuccess: Capture.CaptureCB, captureError: Capture.CaptureError, options?: Capture.VideoOptions) {}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment