Skip to content

BinaryUploads — @gj-kit/expo-media

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

import { BinaryUploads } from '@gj-kit/expo-media';
interface BinaryUploads<TAsset, TCollectionId extends string = string> {
uploadBinary(input: {
readonly source: NamedBinarySource;
readonly collectionId?: TCollectionId | null | undefined;
/**
* JPEG APP1 파싱이 실패했을 때 **필드 단위로** 병합될 EXIF(§5.3 `mediaMetadataFromJpeg` 규칙 ②).
* 웹 피커 경로가 `asset.exif`를 여기로 넘긴다(전신 uploader.ts:709 · §5.7.4).
* 없으면 촬영 시각과 위치가 조용히 유실된다 — 이 인자가 복원된 이유다(G6).
*/
readonly fallbackExif?: Readonly<Record<string, unknown>> | undefined;
/**
* 동영상 포스터. **3상태를 보존한다**(전신 `BlobVideoUploadInput.posterBlob`, uploader.ts:566-569):
* `undefined` = 어댑터로 자동 추출 / `null` = 포스터 없음(추출 시도 금지) / 값 = 주어진 포스터.
* 이 3상태를 2상태로 접으면 "포스터를 일부러 안 만든다"를 표현할 방법이 사라진다.
*/
readonly poster?: BinarySource | null | undefined;
/**
* 동영상 재생시간(**밀리초**). 이미지에는 무시된다.
* ⚠ 초 단위를 넣지 마라 — 웹의 `HTMLVideoElement.duration`은 **초**다. 호출자가
* `normalizeDurationMs`(§7 하드닝 4)를 거쳐 넘겨야 한다. 20분 동영상이 1200ms로
* 저장되면 어떤 duration 상한도 통과한다. `createPickerFlows`의 웹 경로는 이미 거친다.
*/
readonly durationMs?: number | null | undefined;
/**
* 동영상 픽셀 치수. 이미지에는 무시된다(이미지 치수는 서버가 바이트에서 읽는다).
* ⚠ `BinarySource`만으로는 DOM 없이 복원할 수 없으므로 **호출자가 주지 않으면 영구 유실**이다 —
* 전신 `BlobVideoUploadInput.width/height`(uploader.ts:86-87)가 완료 페이로드로 가던 값이다.
*/
readonly dimensions?: {
readonly width?: number | null | undefined;
readonly height?: number | null | undefined;
} | undefined;
}): Promise<UploadResult<TAsset>>;
/**
* 웹 드롭 다건.
* ⚠ 첫 presign **이전에** 배치 전체를 검증한다 — 혼합 드롭 부분 업로드 방지(§7 하드닝 10).
* ⚠ 검증은 `maxFiles` slice **이후**에 수행한다(전신 uploader.ts:623→630 순서 보존).
* 규칙의 거처는 `webBatch.ts`다.
*/
uploadDropped(files: readonly NamedBinarySource[], options?: {
readonly collectionId?: TCollectionId | null | undefined;
readonly maxFiles?: number | undefined;
} | undefined): Promise<readonly UploadResult<TAsset>[]>;
}

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