[media-library] add doc comments in source, correct types #13936
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
Fixes ENG-1458
To utilize the auto generation feature for API section on the docs website the package source code must contain the relevant documentation.
How
This PR moves the current documentation of
MediaLibrary
API - https://docs.expo.io/versions/latest/sdk/media-library - with minor tweaks and additions to the package source code.This was one of the most demanding conversion so far mainly by the shear amount of content and types variation, however not 100% complete, there are still small parts and descriptions missing, it should be way more complete than the current version of the page.
To full support the migration to automated docs extraction I had to introduce few improvements and fixes to the code:
AlbumType
andMediaSubtype
orientation
key to theAsset
typePermissionResponse
andMediaLibraryAssetsChangeEvent
typesEXPermissionResponse
,Subscription
I have also added small fix for the
Event Subscription
section, which should now include also method using plural oflisterner
.However there is still a room for improvement, especially I have in mind
MediaType
andSortBy
constants, which definitely should be redefined to way simpler construction, so I did not touch their "internal" types likeMediaTypeValue
,MediaTypeObject
orSortByValue
.Also I'm not sure why
removeSubscription
method exist, it was not earlier listed in the docs.Test Plan
The changes and generated content have been tests running docs website on
localhost
.Preview
Checklist
expo build
(eg: updated@expo/xdl
).expo prebuild
& EAS Build (eg: updated a module plugin).