Skip to content

feat(types): add VideoRenditionInfo types with typed resolution#1186

Open
sjelfull wants to merge 1 commit intomainfrom
dam-1038-video-rendition-types
Open

feat(types): add VideoRenditionInfo types with typed resolution#1186
sjelfull wants to merge 1 commit intomainfrom
dam-1038-video-rendition-types

Conversation

@sjelfull
Copy link
Member

@sjelfull sjelfull commented Feb 17, 2026

Summary

Adds rendition type definitions to @sanity/client to match the backend response shape.

Part of DAM-1038

Changes

Types (src/types.ts)

  • VideoRenditionInfoPublicurl + resolution
  • VideoRenditionInfoSigned — extends public with token + expiresAt
  • VideoRenditionInfo — union type
  • renditions? field added to VideoPlaybackInfo

The resolution property is typed as '1080p' | '480p' | '270p' | (string & {}) — gives IDE autocomplete for known values while accepting any string for future resolutions.

Exports (src/media-library.ts)

Re-exports all 3 rendition types from the media library entry point.

Documentation (README.md)

  • Added rendition examples to both public and signed playback info responses
  • Added "Downloading MP4 renditions" section with usage example

Note

Subtitle types have been split into a separate PR (#1191) for independent rollout.

@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
tsdocs-client Ignored Ignored Feb 27, 2026 5:34pm

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 88.06% 3979 / 4518
🔵 Statements 88.06% 3979 / 4518
🔵 Functions 85.67% 317 / 370
🔵 Branches 89.13% 1173 / 1316
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/media-library.ts 90.47% 75% 100% 90.47% 58-59
src/types.ts 100% 100% 100% 100%
Generated in workflow #4085 for commit 8190893 by the Vitest Coverage Report Action

@sjelfull sjelfull force-pushed the dam-1038-video-rendition-types branch from d0ef0a9 to 6934261 Compare February 17, 2026 22:34
@sjelfull sjelfull force-pushed the dam-1038-video-rendition-types branch from 6934261 to 22ba2d2 Compare February 26, 2026 20:39
@sjelfull sjelfull changed the title feat(types): add VideoRenditionInfo and VideoSubtitleInfo types feat(types): add VideoRenditionInfo types with typed resolution Feb 26, 2026
@sjelfull sjelfull requested a review from rdunk February 26, 2026 20:52
@sjelfull sjelfull force-pushed the dam-1038-video-rendition-types branch from 22ba2d2 to 8242fe6 Compare February 26, 2026 20:56
@sjelfull sjelfull marked this pull request as ready for review February 26, 2026 21:09
@sjelfull sjelfull force-pushed the dam-1038-video-rendition-types branch from 8242fe6 to 930208d Compare February 26, 2026 21:09
Copy link
Member

@rdunk rdunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion for an improvement, it's not crucial but slightly better DX I think.

- Add VideoRenditionInfoPublic, VideoRenditionInfoSigned, and
  VideoRenditionInfo union type for MP4 renditions
- Add renditions field to VideoPlaybackInfo interface
- Type resolution with known values (1080p, 480p, 270p) plus string fallback
- Add rendition examples to README playback info documentation
- Re-export rendition types from media-library entry point

Co-Authored-By: Claude <noreply@anthropic.com>
@sjelfull sjelfull force-pushed the dam-1038-video-rendition-types branch from 930208d to 8190893 Compare February 27, 2026 17:34
@rdunk rdunk self-requested a review February 27, 2026 19:45
Copy link
Member

@rdunk rdunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants