PickOptions
Tunes the system photo picker for mediaPicker.pick(): what it offers, how many assets the user may choose, and their size.
Usage
Pick a photo and hand its local file to an upload function.
This type is used by mediaPicker.pick
// Pick a photo and hand its local file to an upload function.
import { mediaPicker, type MediaAsset, type MediaType } from 'kuito';
export async function choosePhoto(upload: (asset: MediaAsset) => Promise<void>) {
const mediaTypes: MediaType[] = ['images'];
const result = await mediaPicker.pick({ mediaTypes });
if (!result.canceled && result.assets[0]) await upload(result.assets[0]);
}Type declaration
export type PickOptions = CaptureOptions & {
/** How many assets the user may pick: 1, the default, or 0 for no limit. */
selectionLimit?: number;
};Members 6
| Name | Type | Required | Description |
|---|---|---|---|
mediaTypes | PickerMediaType | PickerMediaType[] | No | What the picker offers: 'images' (the default), 'videos', or both. |
quality | number | No | JPEG quality of written images, 0 to 1. 1, the default, keeps the most detail. |
maxWidth | number | No | Images wider than this are scaled down to fit, keeping their aspect ratio. In pixels. |
maxHeight | number | No | Images taller than this are scaled down to fit, keeping their aspect ratio. In pixels. |
allowsEditing | boolean | No | iOS: crop the image, or trim the video, in the system editor before it resolves. |
selectionLimit | number | No | How many assets the user may pick: 1, the default, or 0 for no limit. |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.