/** How the file is handled, which decides everything downstream. */ export type AssetFileKind = 'glb-voxelize' | 'glb-keep' | 'vxl' | 'image' | 'audio' | 'json'; export interface AssetFileClass { kind: AssetFileKind; /** The `type` recorded on the world.json asset entry. */ assetType: 'vxl' | 'glb' | 'image' | 'audio' | 'json'; /** What the upload is signed for; the server decides gzip from this. */ contentType: string; /** Lower-case extension without the dot. */ extension: string; } /** Extensions `classifyVideoFile` accepts, for help text and the README. */ export declare const VIDEO_EXTENSIONS: string[]; export interface VideoFileClass { contentType: string; /** Lower-case extension without the dot. */ extension: string; } export declare function classifyVideoFile(filename: string): VideoFileClass; /** Every extension `classifyAssetFile` accepts, for help text and the README. */ export declare const ACCEPTED_EXTENSIONS: string[]; /** * The extension, treating a dotfile as having one. * * `path.extname('.vxl')` is `''` — Node reads a leading dot as the start of the basename, not an * extension — so a file literally named `.vxl` (what an export tool that names by extension alone * produces) fell through to the catch-all and was refused with a message listing `.vxl` among the * types it takes. */ export declare function fileExtension(filename: string): string; export declare function classifyAssetFile(filename: string, options: { keepGlb: boolean; }): AssetFileClass; /** * The asset's name when `--name` is not given: the file's basename without its extension, which * is what the Creator pre-fills its name prompt with. */ export declare function defaultAssetName(filename: string): string; /** * A name the engine can build a filename from. `CREATE_ASSET_FROM_GLB_URL` uploads its bake as * `--.vxl`, and api-server refuses a filename carrying a separator or * `..` — so a name that would trip that fails HERE, before the file has been uploaded and the * browser launched, instead of as an opaque "Failed to upload VXL file" minutes later. * * The length cap and the URL-unsafe set are part of the same job: both produce a failure that only * appears after the upload (or after a ten-minute bake), which is precisely what this is for. */ export declare function validateAssetName(name: string): string; /** * The upload filename: a bare basename, which is all api-server accepts. * * Mirrors `sanitizeUploadFilename` in full — separators AND `..`, as three independent checks. * `path.basename` strips `/` on POSIX but leaves `\`, so a legal `my\model.glb` used to pass here * and then eat a network round-trip to be refused by the server with a message naming nothing the * creator could act on. The URL-unsafe and length checks are here for the same reason as on the * name above. */ export declare function uploadFilename(filePath: string): string; /** * `asset__` — byte-compatible with the engine's `ObjectIdService.generateId` * and with what api-server mints for the generators (`cli-assets.ts`), so an id minted here is * indistinguishable from one minted anywhere else in the system. */ export declare function mintAssetId(now?: () => number, random?: () => number): string; /** * Said once per audio upload that the Creator would have transcoded. The engine plays the file * as-is; this is about download size, and it names the exact command rather than a vague "consider". */ export declare function audioTranscodeNote(extension: string): string | null;