Skip to content

DurableFileStoreAdapter — @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 { DurableFileStoreAdapter } from '@gj-kit/expo-media';
/**
* App-owned persistent-file storage seam.
*
* This is deliberately separate from `FileSystemAdapter`: upload code needs a
* cache directory plus base64 reads, whereas an application attachment store
* needs a durable root plus directory creation. Keeping the contracts apart
* avoids making every upload-only adapter pretend it can persist user files.
*/
interface DurableFileStoreAdapter {
/** App-owned durable root URI. It must identify a directory, or return null when unavailable. */
rootDirectory(): string | null;
/** Creates a directory and all missing parents. Repeating the call must be safe. */
ensureDirectory(uri: string): Promise<void>;
/** Same discriminated stat contract as the upload file-system seam. */
stat(uri: string): Promise<FileStat>;
copy(input: {
readonly from: string;
readonly to: string;
}): Promise<void>;
/** Idempotent best-effort removal. */
remove(uri: string): Promise<void>;
}

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