Skip to content

LocalUploadInput — @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 { LocalUploadInput } from '@gj-kit/expo-media';
type LocalUploadInput<TCollectionId extends string = string> = {
readonly uri: string;
readonly fileName?: string | undefined;
readonly contentType?: MediaContentType | undefined;
readonly sizeBytes?: number | undefined;
/**
* ⚠ **주어지면 hasher를 호출하지 않는다**(§7.1 신설 행). 전신 `uploadLocalUriToIntent`는 해시를
* 계산하지 않고 호출자 값을 그대로 전달했다(uploader.ts:57-69의 필드 정의, 440의 전달).
* 동기화 큐가 재시도 간 해시를 캐시하기 때문이다:
* `src/sync/uploadAsset.ts:45-46` — "Reuse the cached hash across retries; only compute
* on first attempt" / `item.contentHash ?? (await hash(source.uri))`.
* 이 필드가 없으면 재시도마다 15MB 파일을 다시 해시한다(순수 TS SHA-256 위에서는 §12-3의
* Hermes 성능 리스크와 곱해진다).
*
* ⚠ 바로 아래 `hashSafely`의 "해시 실패는 업로드를 막지 않는다"와 **나란히** 읽어야 한다 —
* 한쪽만 보면 정반대 구현이 나온다(§7.1의 경고 그대로).
*/
readonly contentHash?: string | undefined;
readonly collectionId?: TCollectionId | null | undefined;
readonly photo?: MediaMetadata | undefined;
readonly durationMs?: number | undefined;
readonly width?: number | undefined;
readonly height?: 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