Skip to content

PickedAsset — @gj-kit/expo-media

A public type from @gj-kit/expo-media. The signature below is taken directly from the 0.6.1 release declaration.

import { PickedAsset } from '@gj-kit/expo-media';
type PickedAsset = {
readonly uri: string;
/**
* 기기 라이브러리 원본 식별자(iOS PhotoKit localIdentifier / Android MediaStore id).
* 없을 수 있다(웹 File 드롭, 카메라 캡처).
*
* ⚠ **왜 필요한가**: 소비자의 dedup 1차 키다 —
* `apps/mobile/src/photos/pendingPhotos.ts:43`
* ``pickerAssetDedupKey = `asset:${asset.assetId ?? asset.uri}` ``
* uri 폴백만 남으면 스테이징 사본 uri가 resolve마다 재생성되므로(§7 하드닝 2) 같은 사진을
* 두 번 선택했을 때 dedup이 통과해버린다. 전신은 `resolveDeviceAssetForUpload`가
* `assetId: asset.id`를 채워 device 자산과 picker 자산의 동일성을 유지했다
* — devicePhotoLibrary.ts:364. 새 설계에서는 `toPickedAsset`이 그 역할을 한다(§5.4-④).
*/
readonly assetId?: string | undefined;
readonly fileName?: string | undefined;
readonly mimeType?: string | undefined;
readonly width?: number | undefined;
readonly height?: number | undefined;
/**
* ⚠ 어댑터는 **원시값 그대로** 넘긴다. 네이티브는 ms, 웹은 s이며 정규화는 core가 한다
* (§7 하드닝 4 — 정규화 지점을 하나로 고정. 어댑터가 변환하면 이중 변환이 된다).
*
* 전신 사고: expo-image-picker 웹이 `HTMLVideoElement.duration`(초)을 그대로 전달해
* 20분 영상이 1200ms로 저장됐고, 어떤 길이 캡도 그것을 통과시켰다.
*/
readonly durationRaw?: number | undefined;
readonly exif?: Readonly<Record<string, unknown>> | undefined;
/**
* 어댑터가 "실제로 스트리밍될 파일"을 stat해 확인한 크기. 있으면 최우선.
* 전신의 뒷문 프로퍼티 `__photoKitVerifiedSizeBytes`를 정식 필드로 승격(§7 하드닝 3).
*/
readonly verifiedSizeBytes?: number | undefined;
/**
* ⚠ 신뢰 금지 — 최후 폴백이다(§7 하드닝 3).
* Android가 `quality < 1`로 재인코딩할 때 `asset.fileSize`는 **원본** 크기를 보고하므로
* 스토리지가 실제로 받은 바이트와 어긋나 서버가 업로드를 거절한다.
* 필드명이 곧 신뢰도다: `verifiedSizeBytes`(실측) > file-system stat > `reportedSizeBytes`(자칭).
*/
readonly reportedSizeBytes?: number | undefined;
};

This declaration is the source of truth for parameters, optionality, generics, return values, and public union/type contracts. Check the package golden path and this subpath’s import conditions for required environment, permission, and error boundaries before calling it.

  • Package: @gj-kit/expo-media
  • Version: 0.6.1
  • Public entry: .
  • Source: GitHub