UNPKG

@nexim/upload-types

Version:

TypeScript types and interfaces for Nexim Media Upload Service, including image preset configurations and file handling types

35 lines (26 loc) 978 B
[@nexim/upload-types](../README.md) / FileDetail # Type Alias: FileDetail > **FileDetail** = `object` & \{ `type`: `"file"`; \} \| \{ `type`: `"image"`; `variants`: `string`[]; \} Details about an uploaded file stored in the system. Includes common fields and type-specific fields using a discriminated union. ## Type Declaration | Name | Type | Description | | ------------- | -------- | --------------------------------------- | | `description` | `string` | Description of the file for maintenance | | `userId` | `string` | ID of the user who uploaded the file | ## Example ```ts // Regular file type const fileDetail: FileDetail = { userId: 'user_123', description: 'Monthly report', type: 'file', }; // Image file with multiple variants const imageDetail: FileDetail = { userId: 'user_456', description: 'Product photo', type: 'image', variants: ['@1x.jpeg', '@1x.webp', '@2x.jpeg', '@2x.webp'], }; ```