콘텐츠로 이동

MemoryFileSystemOptions — @gj-kit/expo-media

@gj-kit/expo-media/testing에서 공개하는 type입니다. package version 0.6.1의 release declaration을 그대로 표시합니다.

import { MemoryFileSystemOptions } from '@gj-kit/expo-media/testing';
type MemoryFileSystemOptions = {
/** 초기 파일 — uri → 바이트. 값은 복사되므로 이후 호출자가 고쳐도 페이크는 흔들리지 않는다. */
readonly files?: Readonly<Record<string, Uint8Array>> | undefined;
/**
* 앱 소유 캐시 디렉토리(끝에 '/'). 기본 `'file:///cache/'`.
* ⚠ **`null`을 줄 수 있다** — "쓸 수 있는 디렉토리가 하나도 없는 기기"가 실제 분기이기 때문이다:
* `StagingCache.uriFor`가 `null`을 반환하는 경로(§5.3)와 `createMediaSaver`가 plain Error를
* 던지는 경로(§5.4-⑥)는 이 값이 없어야만 도달한다.
*/
readonly cacheDirectory?: string | null | undefined;
/** App-owned durable root. Default `'file:///documents/'`; null exercises unavailable storage. */
readonly rootDirectory?: string | null | undefined;
/** 디렉토리로 취급할 uri. 끝이 '/'인 uri는 지정하지 않아도 디렉토리다. */
readonly directories?: readonly string[] | undefined;
/**
* `download`의 응답을 결정한다. 기본은 `{ status: 200 }` + 8바이트 더미.
* ⚠ 3xx·4xx를 돌려주는 수단이 없으면 §7.1의 "다운로드 status **2xx 범위** 검증 + 실패 시
* 임시 파일 정리"를 검증할 방법이 없다. 그래서 상태코드가 주입구다.
*/
readonly download?: ((input: {
readonly url: string;
readonly to: string;
}) => {
readonly status: number;
readonly bytes?: Uint8Array | undefined;
}) | undefined;
};

이 선언은 매개변수, optionality, 제네릭, 반환값, 공개 union/type 계약의 정본입니다. 호출 전 필요한 환경·권한·오류 경계는 패키지 Golden path와 이 subpath의 import 조건을 함께 확인하세요.

  • 패키지: @gj-kit/expo-media
  • 버전: 0.6.1
  • 공개 entry: ./testing
  • 소스: GitHub