Skip to content

VexMediaDocument

Defined in: packages/core/src/documents/types.ts:77

Type for media documents returned from Convex queries.

Extends VexDocument with all required media fields: alt, filename, mimeType, size, storageId, deleted, src (the file URL), and optional width/height. Use this instead of TDocument in media collection views to avoid casting fields like row.original.src as string.

const src = doc.src; // string | undefined, no cast needed
const alt = doc.alt ?? "";

TDocument for the base document type with custom shape support

[key: string]: unknown

Field values defined by the collection schema.

_creationTime: number

Defined in: packages/core/src/documents/types.ts:23

Unix timestamp (milliseconds) when the document was created.

VexDocument._creationTime


_id: string

Defined in: packages/core/src/documents/types.ts:21

Convex document ID string.

VexDocument._id


alt: string

Defined in: packages/core/src/documents/types.ts:79

Alt text for accessibility and SEO.


deleted: boolean

Defined in: packages/core/src/documents/types.ts:89

Whether this media item has been soft-deleted.


filename: string

Defined in: packages/core/src/documents/types.ts:81

Original filename of the uploaded file.


optional height?: number

Defined in: packages/core/src/documents/types.ts:95

Image height in pixels (if applicable).


mimeType: string

Defined in: packages/core/src/documents/types.ts:83

MIME type (e.g., “image/jpeg”, “application/pdf”).


size: number

Defined in: packages/core/src/documents/types.ts:85

File size in bytes.


src: string

Defined in: packages/core/src/documents/types.ts:91

URL to the file.


storageId: string

Defined in: packages/core/src/documents/types.ts:87

Storage adapter ID for the uploaded file.


optional width?: number

Defined in: packages/core/src/documents/types.ts:93

Image width in pixels (if applicable).