Skip to content

FakeUploadApiOptions — @gj-kit/expo-media

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

import { FakeUploadApiOptions } from '@gj-kit/expo-media/testing';
type FakeUploadApiOptions<TAsset> = {
/** 완료 페이로드 → 호스트 자산. 테스트가 무엇을 자산으로 볼지 직접 정한다. */
readonly asset: (input: MediaUploadCompletion) => TAsset;
/**
* 중복 판정.
* ⚠ `UploadResult.duplicate`는 **필수 필드**다(§6.1-⑯) — 옵셔널이면 호스트가 판정을
* 돌려주지 않을 때 킷이 "새로 만들어졌다"로 오독하고, 중복 취소 경로가 사용자의 예전
* 사진을 지운다. 그 분기를 유닛에서 돌리려면 여기에 주입구가 있어야 한다.
*/
readonly duplicateWhen?: ((input: MediaUploadCompletion) => boolean) | undefined;
/** 오브젝트 키 결정. 기본 `objects/<순번>-<fileName>`. */
readonly objectName?: ((input: MediaUploadIntentRequest, index: number) => string) | undefined;
/** 서명 URL 발급. 기본은 §7 하드닝 8용 서명 URL 픽스처다. */
readonly uploadUrl?: ((objectName: string) => string) | undefined;
/** presign 응답 헤더. 기본 `{ 'content-type': <요청 contentType> }`. */
readonly headers?: ((input: MediaUploadIntentRequest) => Readonly<Record<string, string>>) | 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: ./testing
  • Source: GitHub