New BCL approach & BuildTasks

This commit is contained in:
atanasovg
2014-03-12 18:26:58 +02:00
commit 39b505384a
42 changed files with 2907 additions and 0 deletions

24
Camera/camera.android.ts Normal file
View File

@@ -0,0 +1,24 @@
export module tk {
export module io {
var REQUEST_IMAGE_CAPTURE: number = 1;
var REQUEST_SELECT_PICTURE: number = 2;
export class CameraManager {
public takePicture(params: any, onSuccess: (imageData: any) => any, onError?: (error: any) => any) {
//var takePictureIntent = new android.content.Intent('android.media.action.IMAGE_CAPTURE');
//if (takePictureIntent.resolveActivity(UI.Application.android.context.getPackageManager()) !== null) {
// UI.Application.android.currentActivity.startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
//}
}
// options { useSavedPhotos: true }
public pictureFromLibrary(params: any, onSuccess: (imageData: any) => any, onError?: (error: any) => any) {
//var readPictureIntent = new android.content.Intent();
//readPictureIntent.setType('image/*');
//readPictureIntent.setAction('android.intent.action.GET_CONTENT');
//UI.Application.android.currentActivity.startActivityForResult(android.content.Intent.createChooser(readPictureIntent,
// 'Select Picture'), REQUEST_SELECT_PICTURE);
}
}
}
}

22
Camera/camera.d.ts vendored Normal file
View File

@@ -0,0 +1,22 @@
export declare module tk {
export module camera {
export enum CameraPosition {
FRONT = 0,
BACK = 1,
}
export enum FlashMode {
AUTO = 0, // default
ON = 1,
OFF = 2
}
// TODO most of hardware related parts need to handle onPause and onResume of the calling activities
export 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);
}
}
}

15
Camera/camera.ios.ts Normal file
View File

@@ -0,0 +1,15 @@
export module tk {
export module io {
var REQUEST_IMAGE_CAPTURE: number = 1;
var REQUEST_SELECT_PICTURE: number = 2;
export class CameraManager {
public takePicture(params: any, onSuccess: (imageData: any) => any, onError?: (error: any) => any) {
}
// options { useSavedPhotos: true }
public pictureFromLibrary(params: any, onSuccess: (imageData: any) => any, onError?: (error: any) => any) {
}
}
}
}