mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Added "External Ambient Module Declarations" for most modules.
Now they are required by module name e.g require("file-system") instead of by file name.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import appModule = require("application/application");
|
||||
import appModule = require("application");
|
||||
|
||||
var REQUEST_IMAGE_CAPTURE: number = 1;
|
||||
var REQUEST_SELECT_PICTURE: number = 2;
|
||||
|
||||
69
camera/camera.d.ts
vendored
69
camera/camera.d.ts
vendored
@@ -1,36 +1,39 @@
|
||||
|
||||
import promises = require("promises/promises");
|
||||
import imageSource = require("image-source/image-source");
|
||||
declare module "camera" {
|
||||
|
||||
export declare enum CameraPosition {
|
||||
FRONT = 0,
|
||||
BACK = 1,
|
||||
import promises = require("promises/promises");
|
||||
import imageSource = require("image-source/image-source");
|
||||
|
||||
enum CameraPosition {
|
||||
FRONT = 0,
|
||||
BACK = 1,
|
||||
}
|
||||
|
||||
enum FlashMode {
|
||||
AUTO = 0, // default
|
||||
ON = 1,
|
||||
OFF = 2
|
||||
}
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* Specifies which Camera to use.
|
||||
*/
|
||||
cameraPosition?: CameraPosition;
|
||||
|
||||
/**
|
||||
* Specifies flash mode.
|
||||
*/
|
||||
flashMode?: FlashMode;
|
||||
}
|
||||
|
||||
// TODO most of hardware related parts need to handle onPause and onResume of the calling activities
|
||||
class CameraManager {
|
||||
takePicture(params: any, onSuccess: (imageData: any) => any, onError?: (error: any) => any);
|
||||
|
||||
// options { useSavedPhotos: true }
|
||||
pictureFromLibrary(params: any, onSuccess: (imageData: any) => any, onError?: (error: any) => any);
|
||||
}
|
||||
|
||||
var takePicture: (options?: Options) => promises.Promise<imageSource.ImageSource>;
|
||||
}
|
||||
|
||||
export declare enum FlashMode {
|
||||
AUTO = 0, // default
|
||||
ON = 1,
|
||||
OFF = 2
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* Specifies which Camera to use
|
||||
*/
|
||||
cameraPosition?: CameraPosition;
|
||||
|
||||
/**
|
||||
* Specifies flash mode
|
||||
*/
|
||||
flashMode?: FlashMode;
|
||||
}
|
||||
|
||||
// TODO most of hardware related parts need to handle onPause and onResume of the calling activities
|
||||
export declare class CameraManager {
|
||||
takePicture(params: any, onSuccess: (imageData: any) => any, onError?: (error: any) => any);
|
||||
|
||||
// options { useSavedPhotos: true }
|
||||
pictureFromLibrary(params: any, onSuccess: (imageData: any) => any, onError?: (error: any) => any);
|
||||
}
|
||||
|
||||
export declare var takePicture: (options?: Options) => promises.Promise<imageSource.ImageSource>;
|
||||
|
||||
Reference in New Issue
Block a user