From 9cf7e6a9852e8525aebcb1eeddc926c422e52579 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Mon, 27 Jul 2026 22:29:31 +0200 Subject: [PATCH] fix(media-capture): correct CaptureError.code type to number (#5193) --- .../plugins/media-capture/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/@awesome-cordova-plugins/plugins/media-capture/index.ts b/src/@awesome-cordova-plugins/plugins/media-capture/index.ts index e7b212556..a6ba65963 100644 --- a/src/@awesome-cordova-plugins/plugins/media-capture/index.ts +++ b/src/@awesome-cordova-plugins/plugins/media-capture/index.ts @@ -61,7 +61,16 @@ export interface MediaFileData { } export interface CaptureError { - code: string; + /** + * One of the `CaptureError` codes: + * - `0` - CAPTURE_INTERNAL_ERR: Camera or microphone failed to capture image or sound. + * - `1` - CAPTURE_APPLICATION_BUSY: Camera application or audio capture application is currently serving other capture request. + * - `2` - CAPTURE_INVALID_ARGUMENT: Invalid use of the API (e.g. limit parameter has value less than one). + * - `3` - CAPTURE_NO_MEDIA_FILES: User exited camera application or audio capture application before capturing anything. + * - `4` - CAPTURE_PERMISSION_DENIED: User denied permissions required to perform the capture request. + * - `20` - CAPTURE_NOT_SUPPORTED: The requested capture operation is not supported. + */ + code: number; } export interface CaptureAudioOptions {