Files
upload-gltf/lib/constants.ts
T
2026-04-14 14:18:40 +02:00

30 lines
1.1 KiB
TypeScript

// ---------------------------------------------------------------------------
// Shared constants — used by both client and server
// ---------------------------------------------------------------------------
export const MODEL_EXTENSIONS = new Set(['.glb', '.gltf'])
export const TEXTURE_EXTENSIONS = new Set(['.png', '.jpg', '.jpeg', '.webp'])
export const ALL_ALLOWED_EXTENSIONS = new Set([...MODEL_EXTENSIONS, ...TEXTURE_EXTENSIONS])
export const REQUIRED_TEXTURES = ['roughness', 'normal', 'metalness', 'color', 'displace'] as const
export const VALID_DESTINATIONS = new Set([
'farm', 'map', 'powergrid', 'workshop', 'general', 'environment',
] as const)
export const DESTINATIONS = [
{ value: 'farm', label: 'Farm' },
{ value: 'map', label: 'Map' },
{ value: 'powergrid', label: 'Powergrid' },
{ value: 'workshop', label: 'Workshop' },
{ value: 'general', label: 'General' },
{ value: 'environment', label: 'Environment' },
] as const
export type Destination = typeof DESTINATIONS[number]['value']
export const TMP_DIR = '/tmp/assets'
/** Maximum file size in bytes (100 MB) */
export const MAX_FILE_SIZE = 100 * 1024 * 1024