Skip to content

mediaFileName — @gj-kit/expo-media

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

import { mediaFileName } from '@gj-kit/expo-media/core';
/**
* 전신의 `defaultMediaFileName`·`inferFileName`·`inferWebFileName` **3종을 하나로 통합**(§5.7.2-③).
*
* `fileName`이 있으면 그대로 쓰고, 없으면 `${prefix}-${now}.${ext}`(전신 규칙 보존).
* ⚠ `now`는 결정론적 테스트를 위한 주입구다 — 생략 시 `Date.now()`로 전신과 동일하게 동작한다
* (§5.4.1-15). 전신은 `Date.now()`를 직접 호출해 파일명 규칙에 테스트가 없었다.
* ⚠ `prefix` 기본값은 `'media'`다 — 전신 `'photo'`에서 바꿨다(§5.4.1-13). 호스트는 항상 자기
* 프리픽스를 주입하므로 이관 영향이 0이며, 라이브러리 이름과의 일관성을 택했다.
*/
declare function mediaFileName(input: {
readonly fileName?: string | null | undefined;
readonly contentType: MediaContentType;
readonly prefix?: string | undefined;
readonly now?: number | undefined;
}): string;

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: ./core
  • Source: GitHub