HomePhabricator
Diffusion Comm f14949dbc9d7

[lib] Replace Shape<> with $ReadOnly<Partial<>> in MultimediaUploadExtras

Description

[lib] Replace Shape<> with $ReadOnly<Partial<>> in MultimediaUploadExtras

Summary:
Alongside my attempts to replace $Shape with Partial in the preceding diffs, I'm also looking to replace our custom type Shape.

Doing this for MultimediaUploadExtras revealed a type error. We can't pass dimensions in as MultimediaUploadExtras in native/avatars/avatar-hooks.js on line 71, because dimensions is read-only but MultimediaUploadExtras is not, implying that the call to callUploadMultimedia might mutate it, which would be a type error.

We resolve this by making MultimediaUploadExtras read-only. Also including updates to MultimediaUploadCallbacks, which I made read-only as well as converting to use Partial. (Though this was not necessitated by any type errors.)

Depends on D10085

Test Plan: Flow

Reviewers: bartek, michal

Reviewed By: bartek

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D10086

Details

Provenance
ashoatAuthored on Nov 28 2023, 8:06 PM
Reviewer
bartek
Differential Revision
D10086: [lib] Replace Shape<> with $ReadOnly<Partial<>> in MultimediaUploadExtras
Parents
rCOMMad9cf36bcf29: [flow] Convert all remaining $Shape to $Partial
Branches
Unknown
Tags
Unknown