import { type SlashPath, type SlashPathFolder } from '@dereekb/util'; import { type ReadFirestoreModelKeyInput } from '../../firestore/collection/collection'; /** * Base storage path prefix for all model-related files. * * All model storage files are nested under `/model/` in the storage bucket. */ export declare const BASE_MODEL_STORAGE_FILE_PATH: SlashPathFolder; /** * Pre-configured {@link slashPathFactory} that produces absolute paths under {@link BASE_MODEL_STORAGE_FILE_PATH}. */ export declare const MODEL_STORAGE_FILE_SLASH_PATH_FACTORY: import("@dereekb/util").SlashPathFactory; /** * Configuration for {@link modelStorageSlashPathFactory}. */ export interface ModelStorageSlashPathFactoryConfig { /** * Additional base path segment appended after `/model/`. * * For example, `'uploads'` produces paths like `/model/uploads//...`. */ readonly basePath?: string; } /** * Factory that generates storage {@link SlashPath} values for Firestore model documents. * * Takes a model document or key as input and returns a storage path rooted under `/model//`. * An optional additional path can be appended. */ export type ModelStorageSlashPathFactory = (input: ReadFirestoreModelKeyInput, path?: SlashPath) => SlashPath; /** * Creates a {@link ModelStorageSlashPathFactory} that maps Firestore model keys to storage paths. * * The generated paths follow the convention `/model/[basePath/]/[path]`. * * @param config - optional base path to nest under * @returns a {@link ModelStorageSlashPathFactory} that maps Firestore model keys to storage paths * * @example * ```ts * const pathFactory = modelStorageSlashPathFactory({ basePath: 'avatars' }); * const path = pathFactory(userDocument, 'profile.png'); * // path === '/model/avatars/users/abc123/profile.png' * ``` */ export declare function modelStorageSlashPathFactory(config?: ModelStorageSlashPathFactoryConfig): ModelStorageSlashPathFactory;