Skip to content

Commit 09dbea0

Browse files
committed
fix: unexported type
1 parent 5d77c84 commit 09dbea0

File tree

3 files changed

+65
-4
lines changed

3 files changed

+65
-4
lines changed

src/imagepicker.android.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import * as application from "tns-core-modules/application";
22
import * as imageAssetModule from "tns-core-modules/image-asset";
33
import * as permissions from "nativescript-permissions";
44

5+
import { ImagePickerMediaType, Options } from "./imagepicker.common";
6+
export * from "./imagepicker.common";
7+
58
class UriHelper {
69
public static _calculateFileUri(uri: android.net.Uri) {
710
let DocumentsContract = (<any>android.provider).DocumentsContract;
@@ -133,9 +136,9 @@ class UriHelper {
133136
}
134137

135138
export class ImagePicker {
136-
private _options;
139+
private _options: Options;
137140

138-
constructor(options) {
141+
constructor(options: Options) {
139142
this._options = options;
140143
}
141144

@@ -226,6 +229,6 @@ export class ImagePicker {
226229
}
227230
}
228231

229-
export function create(options?): ImagePicker {
232+
export function create(options?: Options): ImagePicker {
230233
return new ImagePicker(options);
231234
}

src/imagepicker.common.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
export enum ImagePickerMediaType {
2+
Any = 0,
3+
Image = 1,
4+
Video = 2
5+
}
6+
7+
/**
8+
* Provide options for the image picker.
9+
*/
10+
export interface Options {
11+
/**
12+
* Set the picker mode. Supported modes: "single" or "multiple" (default).
13+
*/
14+
mode?: string;
15+
16+
/**
17+
* Set the minumum number of selected assets in iOS
18+
*/
19+
minimumNumberOfSelection?: number;
20+
21+
/**
22+
* Set the maximum number of selected assets in iOS
23+
*/
24+
maximumNumberOfSelection?: number;
25+
26+
/**
27+
* Display the number of selected assets in iOS
28+
*/
29+
showsNumberOfSelectedAssets?: boolean;
30+
31+
/**
32+
* Display prompt text when selecting assets in iOS
33+
*/
34+
prompt?: string;
35+
36+
/**
37+
* Set the number of columns in Portrait in iOS
38+
*/
39+
numberOfColumnsInPortrait?: number;
40+
41+
/**
42+
* Set the number of columns in Landscape in iOS
43+
*/
44+
numberOfColumnsInLandscape?: number;
45+
46+
/**
47+
* Set the media type (image/video/any) to pick
48+
*/
49+
mediaType?: ImagePickerMediaType;
50+
51+
android?: {
52+
/**
53+
* Provide a reason for permission request to access external storage on api levels above 23.
54+
*/
55+
read_external_storage?: string;
56+
};
57+
}

src/imagepicker.ios.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import * as data_observable from "tns-core-modules/data/observable";
22
import * as imageAssetModule from "tns-core-modules/image-asset";
3-
import { Options, ImagePickerMediaType } from ".";
3+
import { Options, ImagePickerMediaType } from "./imagepicker.common";
44
import { View } from "tns-core-modules/ui/core/view/view";
55
import * as utils from "tns-core-modules/utils/utils";
6+
export * from "./imagepicker.common";
67

78
const defaultAssetCollectionSubtypes: NSArray<any> = NSArray.arrayWithArray(<any>[
89
PHAssetCollectionSubtype.SmartAlbumRecentlyAdded,

0 commit comments

Comments
 (0)