PageSourceSearch

https://react-native-documents.github.io/docs/doc-picker-api

html react-native-documents.github.io collected 2026-10-03 09:49:38 UTC 80,755 bytes, 491 lines download raw bytes

1<!doctype html><html lang=en dir=ltr class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-doc-picker-api/index" data-has-hydrated=false><head><meta charset=UTF-8><meta name=generator content="Docusaurus v3.9.2"><title data-rh=true>document-picker API | React Native document picker & viewer</title><meta data-rh=true name=viewport content="width=device-width, initial-scale=1.0"/><meta data-rh=true name=twitter:card content=summary_large_image /><meta data-rh=true property=og:image content=https://react-native-documents.github.io/img/docusaurus-social-card.jpg /><meta data-rh=true name=twitter:image content=https://react-native-documents.github.io/img/docusaurus-social-card.jpg /><meta data-rh=true property=og:url content=https://react-native-documents.github.io/docs/doc-picker-api /><meta data-rh=true property=og:locale content=en /><meta data-rh=true name=docusaurus_locale content=en /><meta data-rh=true name=docsearch:language content=en /><meta data-rh=true name=docusaurus_version content=current /><meta data-rh=true name=docusaurus_tag content=docs-default-current /><meta data-rh=true name=docsearch:version content=current /><meta data-rh=true name=docsearch:docusaurus_tag content=docs-default-current /><meta data-rh=true property=og:title content="document-picker API | React Native document picker & viewer"/><meta data-rh=true name=description content="Type Aliases"/><meta data-rh=true property=og:description content="Type Aliases"/><link data-rh=true rel=icon href=/img/favicon.ico /><link data-rh=true rel=canonical href=https://react-native-documents.github.io/docs/doc-picker-api /><link data-rh=true rel=alternate href=https://react-native-documents.github.io/docs/doc-picker-api hreflang=en /><link data-rh=true rel=alternate href=https://react-native-documents.github.io/docs/doc-picker-api hreflang=x-default />
1<script data-rh=true type=application/ld+json>{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","item":"https://react-native-documents.github.io/docs/doc-picker-api/","name":"document-picker API","position":1}]}</script>
1<link rel=stylesheet href=/assets/css/styles.2afa629e.css />
1<script src=/assets/js/runtime~main.b9aee65b.js defer></script>
1<script src=/assets/js/main.aa4c1fce.js defer></script>
1</head><body class=navigation-with-keyboard><svg style="display: none;"><defs>
2<symbol id=theme-svg-external-link viewBox="0 0 24 24"><path fill=currentColor d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"/></symbol>
3</defs></svg>
4<script>!function(){var t=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();document.documentElement.setAttribute("data-theme",t||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")),document.documentElement.setAttribute("data-theme-choice",t||"system")}(),function(){try{for(var[t,e]of new URLSearchParams(window.location.search).entries())if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}(),document.documentElement.setAttribute("data-announcement-bar-initially-dismissed",function(){try{return"true"===localStorage.getItem("docusaurus.announcement.dismiss")}catch(t){}return!1}())</script>
4<div id=__docusaurus><link rel=preload as=image href=/img/logo.png /><div role=region aria-label="Skip to main content"><a class=skipToContent_fXgn href=#__docusaurus_skipToContent_fallback>Skip to main content</a></div><div class="theme-announcement-bar announcementBar_mb4j" role=banner><div class=announcementBarPlaceholder_vyr4></div><div class="content_knG7 announcementBarContent_xLdY">Find these packages useful? Say thanks by <a target=_blank href=https://github.com/sponsors/vonovak>sponsoring</a> the author on GitHub!</div><button type=button aria-label=Close class="clean-btn close closeButton_CVFx announcementBarClose_gvF7"><svg viewBox="0 0 15 15" width=14 height=14><g stroke=currentColor stroke-width=3.1><path d="M.75.75l13.5 13.5M14.25.75L.75 14.25"/></g></svg></button></div><nav aria-label=Main class="theme-layout-navbar navbar navbar--fixed-top"><div class=navbar__inner><div class="theme-layout-navbar-left navbar__items"><button aria-label="Toggle navigation bar" aria-expanded=false class="navbar__toggle clean-btn" type=button><svg width=30 height=30 viewBox="0 0 30 30" aria-hidden=true><path stroke=currentColor stroke-linecap=round stroke-miterlimit=10 stroke-width=2 d="M4 7h22M4 15h22M4 23h22"/></svg></button><a class=navbar__brand href=/><div class=navbar__logo><img src=/img/logo.png alt="My Site Logo" class="themedComponent_mlkZ themedComponent--light_NVdE"/><img src=/img/logo.png alt="My Site Logo" class="themedComponent_mlkZ themedComponent--dark_xIcU"/></div><b class="navbar__title text--truncate">RN Document picker & viewer</b></a><a class="navbar__item navbar__link" href=/docs/install>Guides</a><a aria-current=page class="navbar__item navbar__link navbar__link--active" href=/docs/doc-picker-api>Picker API</a><a class="navbar__item navbar__link" href=/docs/doc-viewer-api>Viewer API</a><div class="navbar__item dropdown dropdown--hoverable"><a href=# aria-haspopup=true aria-expanded=false role=button class=navbar__link>LLMs</a><ul class=dropdown__menu><li><a href=/llms.txt target=_blank rel="noopener noreferrer" class=dropdown__link>llms.txt<svg width=12 height=12 aria-label="(opens in new tab)" class=iconExternalLink_nPIU><use href=#theme-svg-external-link /></svg></a><li><a href=/llms-full.txt target=_blank rel="noopener noreferrer" class=dropdown__link>llms-full.txt<svg width=12 height=12 aria-label="(opens in new tab)" class=iconExternalLink_nPIU><use href=#theme-svg-external-link /></svg></a></ul></div></div><div class="theme-layout-navbar-right navbar__items navbar__items--right"><a href=https://github.com/react-native-documents/document-picker/tree/main/example target=_blank rel="noopener noreferrer" class="navbar__item navbar__link">Example app</a><a href=https://github.com/react-native-documents/document-picker target=_blank rel="noopener noreferrer" class="navbar__item navbar__link">GitHub<svg width=13.5 height=13.5 aria-label="(opens in new tab)" class=iconExternalLink_nPIU><use href=#theme-svg-external-link /></svg></a><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type=button disabled title="system mode" aria-label="Switch between dark and light mode (currently system mode)"><svg viewBox="0 0 24 24" width=24 height=24 aria-hidden=true class="toggleIcon_g3eP lightToggleIcon_pyhR"><path fill=currentColor d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"/></svg><svg viewBox="0 0 24 24" width=24 height=24 aria-hidden=true class="toggleIcon_g3eP darkToggleIcon_
4wfgR"><path fill=currentColor d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"/></svg><svg viewBox="0 0 24 24" width=24 height=24 aria-hidden=true class="toggleIcon_g3eP systemToggleIcon_QzmC"><path fill=currentColor d="m12 21c4.971 0 9-4.029 9-9s-4.029-9-9-9-9 4.029-9 9 4.029 9 9 9zm4.95-13.95c1.313 1.313 2.05 3.093 2.05 4.95s-0.738 3.637-2.05 4.95c-1.313 1.313-3.093 2.05-4.95 2.05v-14c1.857 0 3.637 0.737 4.95 2.05z"/></svg></button></div><div class=navbarSearchContainer_Bca1><div class=navbar__search><span aria-label="expand searchbar" role=button class=search-icon tabindex=0></span><input id=search_input_react type=search placeholder=Loading... aria-label=Search class="navbar__search-input search-bar" disabled/></div></div></div></div><div role=presentation class=navbar-sidebar__backdrop></div></nav><div id=__docusaurus_skipToContent_fallback class="theme-layout-main main-wrapper mainWrapper_z2l0"><div class=docsWrapper_hBAB><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type=button></button><div class=docRoot_UBD9><aside class="theme-doc-sidebar-container docSidebarContainer_YfHR"><div class=sidebarViewport_aRkj><div class=sidebar_njMd><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG menuWithAnnouncementBar_GW3s"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link menu__link--active" aria-current=page href=/docs/doc-picker-api><span title="document-picker API" class=linkLabel_WmDU>document-picker API</span></a></ul></nav></div></div></aside><main class=docMainContainer_TBSr><div class="container padding-top--md padding-bottom--lg"><div class=row><div class="col docItemCol_VOVn"><div class=docItemContainer_Djhp><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label=Breadcrumbs><ul class=breadcrumbs><li class=breadcrumbs__item><a aria-label="Home page" class=breadcrumbs__link href=/><svg viewBox="0 0 24 24" class=breadcrumbHomeIcon_YNFT><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill=currentColor /></svg></a><li class="breadcrumbs__item breadcrumbs__item--active"><span class=breadcrumbs__link>document-picker API</span></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type=button class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>document-picker API</h1></header>
5<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id=type-aliases>Type Aliases<a href=#type-aliases class=hash-link aria-label="Direct link to Type Aliases" title="Direct link to Type Aliases" translate=no>​</a></h2>
6<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=bookmarkingresponse>BookmarkingResponse<a href=#bookmarkingresponse class=hash-link aria-label="Direct link to BookmarkingResponse" title="Direct link to BookmarkingResponse" translate=no>​</a></h3>
7<blockquote>
8<p><strong>BookmarkingResponse</strong> = { <code>bookmark</code>: <code>string</code>; <code>bookmarkStatus</code>: <code>"success"</code>; } | { <code>bookmarkError</code>: <code>string</code>; <code>bookmarkStatus</code>: <code>"error"</code>; }</p>
9</blockquote>
10<p>If you've requested long-term access to a directory or file, this object is returned in the response.
11In order to access the same directory or file in the future, you must store the <code>bookmark</code> opaque string,
12and then pass it to the document viewer if you want to preview the file.</p>
13<p>See the Document viewer sources on how to retrieve the file from the bookmark, if you need to do that (advanced use case).</p>
14<hr/>
15<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=filetocopy>FileToCopy<a href=#filetocopy class=hash-link aria-label="Direct link to FileToCopy" title="Direct link to FileToCopy" translate=no>​</a></h3>
16<blockquote>
17<p><strong>FileToCopy</strong> = { <code>convertVirtualFileToType?</code>: <code>string</code>; <code>fileName</code>: <code>string</code>; <code>uri</code>: <code>string</code>; }</p>
18</blockquote>
19<p>Parameter of <a href=#keeplocalcopy class="">keepLocalCopy</a>. Object type representing the file(s) whose copy should be kept in the app's storage.</p>
20<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=properties>Properties<a href=#properties class=hash-link aria-label="Direct link to Properties" title="Direct link to Properties" translate=no>​</a></h4>
21<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=convertvirtualfiletotype>
21convertVirtualFileToType?<a href=#convertvirtualfiletotype class=hash-link aria-label="Direct link to convertVirtualFileToType?" title="Direct link to convertVirtualFileToType?" translate=no>​</a></h5>
22<blockquote>
23<p><code>optional</code> <strong>convertVirtualFileToType</strong>: <code>string</code></p>
24</blockquote>
25<p>Only for Android virtual files: the type of the file to export to. For example, <code>application/pdf</code> or <code>text/plain</code>.
26Use one of the values from <code>convertibleToMimeTypes</code> from the response of the <code>pick()</code> method: <a href=#documentpickerresponse class="">DocumentPickerResponse</a>.</p>
27<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=filename>fileName<a href=#filename class=hash-link aria-label="Direct link to fileName" title="Direct link to fileName" translate=no>​</a></h5>
28<blockquote>
29<p><strong>fileName</strong>: <code>string</code></p>
30</blockquote>
31<p>The name of the resulting file, with the file extension. You can use the <code>name</code> field from the response of the <code>pick()</code> method.</p>
32<p>Example: someFile.pdf</p>
33<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=uri>uri<a href=#uri class=hash-link aria-label="Direct link to uri" title="Direct link to uri" translate=no>​</a></h5>
34<blockquote>
35<p><strong>uri</strong>: <code>string</code></p>
36</blockquote>
37<p>The uri to keep a local copy of. This would be a <code>content://</code> uri (Android), or a <code>file://</code> uri (iOS) that the user has previously picked.</p>
38<hr/>
39<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=isknowntypeoptions>IsKnownTypeOptions<a href=#isknowntypeoptions class=hash-link aria-label="Direct link to IsKnownTypeOptions" title="Direct link to IsKnownTypeOptions" translate=no>​</a></h3>
40<blockquote>
41<p><strong>IsKnownTypeOptions</strong> = { <code>kind</code>: <code>"UTType"</code> | <code>"mimeType"</code> | <code>"extension"</code>; <code>value</code>: <code>string</code>; }</p>
42</blockquote>
43<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=properties-1>Properties<a href=#properties-1 class=hash-link aria-label="Direct link to Properties" title="Direct link to Properties" translate=no>​</a></h4>
44<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=kind>kind<a href=#kind class=hash-link aria-label="Direct link to kind" title="Direct link to kind" translate=no>​</a></h5>
45<blockquote>
46<p><strong>kind</strong>: <code>"UTType"</code> | <code>"mimeType"</code> | <code>"extension"</code></p>
47</blockquote>
48<p>the kind of value you're passing</p>
49<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=value>value<a href=#value class=hash-link aria-label="Direct link to value" title="Direct link to value" translate=no>​</a></h5>
50<blockquote>
51<p><strong>value</strong>: <code>string</code></p>
52</blockquote>
53<p>the value you're checking, for example: <code>application/pdf</code>, <code>com.adobe.pdf</code>, <code>pdf</code></p>
54<hr/>
55<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=isknowntyperesponse>IsKnownTypeResponse<a href=#isknowntyperesponse class=hash-link aria-label="Direct link to IsKnownTypeResponse" title="Direct link to IsKnownTypeResponse" translate=no>​</a></h3>
56<blockquote>
57<p><strong>IsKnownTypeResponse</strong> = { <code>isKnown</code>: <code>boolean</code>; <code>mimeType</code>: <code>string</code> | <code>null</code>; <code>preferredFilenameExtension</code>: <code>string</code> | <code>null</code>; <code>UTType</code>: <code>string</code> | <code>null</code>; }</p>
58</blockquote>
59<p>The result of calling <a href=#isknowntype class="">isKnownType</a></p>
60<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=properties-2>Properties<a href=#properties-2 class=hash-link aria-label="Direct link to Properties" title="Direct link to Properties" translate=no>​</a></h4>
61<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=isknown>isKnown<a href=#isknown class=hash-link aria-label="Direct link to isKnown" title="Direct link to isKnown" translate=no>​</a></h5>
62<blockquote>
63<p><strong>isKnown</strong>: <code>boolean</code></p>
64</blockquote>
65<p>On iOS, this is true if the type is known to the device. That means it can be used with the document picker to filter what files can be picked.
66On Android, this is true if the internal mime type database contains the given value.</p>
67<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=mimetype>mimeType<a href=#mimetype class=hash-link aria-label="Direct link to mimeType" title="Direct link to mimeType" translate=no>​</a></h5>
68<blockquote>
69<p><strong>mimeType</strong>: <code>string</code> | <code>null</code></p>
70</blockquote>
71<p>the mime type for the given value, if any</p>
72<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=preferredfilenameextension>preferredFilenameExtension<a href=#preferredfilenameextension class=hash-link aria-label="Direct link to preferredFilenameExtension" title="Direct link to preferredFilenameExtension" translate=no>​</a></h5>
73<blockquote>
74<p><strong>
74preferredFilenameExtension</strong>: <code>string</code> | <code>null</code></p>
75</blockquote>
76<p>the preferred filename extension for the given value, if any</p>
77<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=uttype>UTType<a href=#uttype class=hash-link aria-label="Direct link to UTType" title="Direct link to UTType" translate=no>​</a></h5>
78<blockquote>
79<p><strong>UTType</strong>: <code>string</code> | <code>null</code></p>
80</blockquote>
81<p>the UTType identifier for the given value, if any</p>
82<hr/>
83<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=keeplocalcopyoptions>KeepLocalCopyOptions<a href=#keeplocalcopyoptions class=hash-link aria-label="Direct link to KeepLocalCopyOptions" title="Direct link to KeepLocalCopyOptions" translate=no>​</a></h3>
84<blockquote>
85<p><strong>KeepLocalCopyOptions</strong> = { <code>destination</code>: <code>"cachesDirectory"</code> | <code>"documentDirectory"</code>; <code>files</code>: <a href=#nonemptyarray class=""><code>NonEmptyArray</code></a>&lt;<a href=#filetocopy class=""><code>FileToCopy</code></a>>; }</p>
86</blockquote>
87<p>options for <a href=#keeplocalcopy class="">keepLocalCopy</a></p>
88<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=properties-3>Properties<a href=#properties-3 class=hash-link aria-label="Direct link to Properties" title="Direct link to Properties" translate=no>​</a></h4>
89<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=destination>destination<a href=#destination class=hash-link aria-label="Direct link to destination" title="Direct link to destination" translate=no>​</a></h5>
90<blockquote>
91<p><strong>destination</strong>: <code>"cachesDirectory"</code> | <code>"documentDirectory"</code></p>
92</blockquote>
93<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=files>files<a href=#files class=hash-link aria-label="Direct link to files" title="Direct link to files" translate=no>​</a></h5>
94<blockquote>
95<p><strong>files</strong>: <a href=#nonemptyarray class=""><code>NonEmptyArray</code></a>&lt;<a href=#filetocopy class=""><code>FileToCopy</code></a>></p>
96</blockquote>
97<hr/>
98<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=keeplocalcopyresponse>KeepLocalCopyResponse<a href=#keeplocalcopyresponse class=hash-link aria-label="Direct link to KeepLocalCopyResponse" title="Direct link to KeepLocalCopyResponse" translate=no>​</a></h3>
99<blockquote>
100<p><strong>KeepLocalCopyResponse</strong> = <a href=#nonemptyarray class=""><code>NonEmptyArray</code></a>&lt;<a href=#localcopyresponse class=""><code>LocalCopyResponse</code></a>></p>
101</blockquote>
102<p>Result of the call to <a href=#keeplocalcopy class="">keepLocalCopy</a>. Please note the promise always resolves, even if there was an error processing any uri(s) (as indicated by the <code>status</code> field, and <code>copyError</code> field).</p>
103<hr/>
104<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=localcopyresponse>LocalCopyResponse<a href=#localcopyresponse class=hash-link aria-label="Direct link to LocalCopyResponse" title="Direct link to LocalCopyResponse" translate=no>​</a></h3>
105<blockquote>
106<p><strong>LocalCopyResponse</strong> = { <code>localUri</code>: <code>string</code>; <code>sourceUri</code>: <code>string</code>; <code>status</code>: <code>"success"</code>; } | { <code>copyError</code>: <code>string</code>; <code>sourceUri</code>: <code>string</code>; <code>status</code>: <code>"error"</code>; }</p>
107</blockquote>
108<p>Indicates, for each Uri that was passed to <a href=#keeplocalcopy class="">keepLocalCopy</a>, whether the local copy was successfully created or not.</p>
109<p>If the copy was successful, the status field is <code>success</code> and <code>localUri</code> contains the local Uri.
110If the copy was not successful, the status field is <code>error</code> and <code>copyError</code> field contains the error message.</p>
111<hr/>
112<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=nonemptyarray>NonEmptyArray<a href=#nonemptyarray class=hash-link aria-label="Direct link to NonEmptyArray" title="Direct link to NonEmptyArray" translate=no>​</a></h3>
113<blockquote>
114<p><strong>NonEmptyArray</strong>&lt;<code>T</code>> = [<code>T</code>, <code>...T[]</code>]</p>
115</blockquote>
116<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=type-parameters>Type Parameters<a href=#type-parameters class=hash-link aria-label="Direct link to Type Parameters" title="Direct link to Type Parameters" translate=no>​</a></h4>
117<table><thead><tr><th>
117Type Parameter<tbody><tr><td><code>T</code></table>
118<hr/>
119<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=predefinedfiletypes>PredefinedFileTypes<a href=#predefinedfiletypes class=hash-link aria-label="Direct link to PredefinedFileTypes" title="Direct link to PredefinedFileTypes" translate=no>​</a></h3>
120<blockquote>
121<p><strong>PredefinedFileTypes</strong> = <code>Flatten</code>&lt;<code>AllMimeTypes</code>> | <code>AllAppleUTIs</code></p>
122</blockquote>
123<p>You'd rarely use this type directly.
124It represents the predefined file types which are exported as <code>types</code> and can be used to limit the kinds of files that can be picked.</p>
125<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=example>Example<a href=#example class=hash-link aria-label="Direct link to Example" title="Direct link to Example" translate=no>​</a></h4>
126<div class="language-ts codeBlockContainer_Ckt0 theme-code-block" style=--prism-color:#393A34;--prism-background-color:#f6f8fa><div class=codeBlockContent_QJqH><pre tabindex=0 class="prism-code language-ts codeBlock_bY9V thin-scrollbar" style=color:#393A34;background-color:#f6f8fa><code class=codeBlockLines_e6Vv><span class=token-line style=color:#393A34><span class="token keyword" style=color:#00009f>import</span><span class="token plain"> </span><span class="token punctuation" style=color:#393A34>{</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">  pick</span><span class="token punctuation" style=color:#393A34>,</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">  types</span><span class="token punctuation" style=color:#393A34>,</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain"></span><span class="token punctuation" style=color:#393A34>}</span><span class="token plain"> </span><span class="token keyword" style=color:#00009f>from</span><span class="token plain"> </span><span class="token string" style=color:#e3116c>'@react-native-documents/picker'</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain"></span><span class="token comment" style=color:#999988;font-style:italic>// ...</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain"></span><span class="token keyword" style=color:#00009f>const</span><span class="token plain"> result </span><span class="token operator" style=color:#393A34>=</span><span class="token plain"> </span><span class="token keyword" style=color:#00009f>await</span><span class="token plain"> </span><span class="token function" style=color:#d73a49>pick</span><span class="token punctuation" style=color:#393A34>(</span><span class="token punctuation" style=color:#393A34>{</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">  type</span><span class="token operator" style=color:#393A34>:</span><span class="token plain"> </span><span class="token punctuation" style=color:#393A34>[</span><span class="token plain">types</span><span class="token punctuation" style=color:#393A34>.</span><span class="token plain">pdf</span><span class="token punctuation" style=color:#393A34>,</span><span class="token plain"> types</span><span class="token punctuation" style=color:#393A34>.</span><span class="token plain">docx</span><span class="token punctuation" style=color:#393A34>]</span><span class="token punctuation" style=color:#393A34>,</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain"></span><span class="token punctuation" style=color:#393A34>}</span><span class="token punctuation" style=color:#393A34>)</span><br/></span></code></pre></div></div>
127<hr/>
128<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=presentationstyle>PresentationStyle<a href=#presentationstyle class=hash-link aria-label="Direct link to PresentationStyle" title="Direct link to PresentationStyle" translate=no>​</a></h3>
129<blockquote>
130<p><strong>PresentationStyle</strong> = <code>"fullScreen"</code> | <code>"pageSheet"</code> | <code>"formSheet"</code> | <code>"overFullScreen"</code> | <code>undefined</code></p>
131</blockquote>
132<p>iOS only. Configure the presentation style of the picker.</p>
133<hr/>
134<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=releaselongtermaccessresult>ReleaseLongTermAccessResult<a href=#releaselongtermaccessresult class=hash-link aria-label="Direct link to ReleaseLongTermAccessResult" title="Direct link to ReleaseLongTermAccessResult" translate=no>​</a></h3>
135<blockquote>
136<p><strong>ReleaseLongTermAccessResult</strong> = ({ <code>status</code>: <code>"success"</code>; <code>uri</code>: <code>string</code>; } | { <code>errorMessage</code>: <code>string</code>; <code>status</code>: <code>"error"</code>; <code>uri</code>: <code>string</code>; })[]</p>
137</blockquote>
138<p>For each uri whose release was requested, the result contains an object with the uri and a status.</p>
139<hr/>
140<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=transitionstyle>TransitionStyle<a href=#transitionstyle class=hash-link aria-label="Direct link to TransitionStyle" title="Direct link to TransitionStyle" translate=no>​</a></h3>
141<blockquote>
142<p><strong>TransitionStyle</strong> = <code>"coverVertical"</code> | <code>"flipHorizontal"</code> | <code>"crossDissolve"</code> | <code>"partialCurl"</code> | <code>undefined</code></p>
143</blockquote>
144<p>iOS only. Configure the transition style of the picker.</p>
145<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id=variables>Variables<a href=#variables class=hash-link aria-label="Direct link to Variables" title="Direct link to Variables" translate=no>​</a></h2>
146<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=errorcodes>errorCodes<a href=#errorcodes class=hash-link aria-label="Direct link to errorCodes" title="Direct link to errorCodes" translate=no>​</a></h3>
147<blockquote>
148<p><code>const</code> <strong>errorCodes</strong>: <code>Readonly</code>&lt;{ <code>IN_PROGRESS</code>: <code>"ASYNC_OP_IN_PROGRESS"</code>; <code>NULL_PRESENTER</code>: <code>"NULL_PRESENTER"</code>; <code>OPERATION_CANCELED</code>: <code>
148"OPERATION_CANCELED"</code>; <code>UNABLE_TO_OPEN_FILE_TYPE</code>: <code>"UNABLE_TO_OPEN_FILE_TYPE"</code>; }></p>
149</blockquote>
150<p>Error codes that can be returned by the module, and are available on the <code>code</code> property of the error.</p>
151<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=example-1>Example<a href=#example-1 class=hash-link aria-label="Direct link to Example" title="Direct link to Example" translate=no>​</a></h4>
152<div class="language-ts codeBlockContainer_Ckt0 theme-code-block" style=--prism-color:#393A34;--prism-background-color:#f6f8fa><div class=codeBlockContent_QJqH><pre tabindex=0 class="prism-code language-ts codeBlock_bY9V thin-scrollbar" style=color:#393A34;background-color:#f6f8fa><code class=codeBlockLines_e6Vv><span class=token-line style=color:#393A34><span class="token plain">  </span><span class="token keyword" style=color:#00009f>const</span><span class="token plain"> </span><span class="token function-variable function" style=color:#d73a49>handleError</span><span class="token plain"> </span><span class="token operator" style=color:#393A34>=</span><span class="token plain"> </span><span class="token punctuation" style=color:#393A34>(</span><span class="token plain">err</span><span class="token operator" style=color:#393A34>:</span><span class="token plain"> </span><span class="token builtin">unknown</span><span class="token punctuation" style=color:#393A34>)</span><span class="token plain"> </span><span class="token operator" style=color:#393A34>=></span><span class="token plain"> </span><span class="token punctuation" style=color:#393A34>{</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">    </span><span class="token keyword" style=color:#00009f>if</span><span class="token plain"> </span><span class="token punctuation" style=color:#393A34>(</span><span class="token function" style=color:#d73a49>isErrorWithCode</span><span class="token punctuation" style=color:#393A34>(</span><span class="token plain">err</span><span class="token punctuation" style=color:#393A34>)</span><span class="token punctuation" style=color:#393A34>)</span><span class="token plain"> </span><span class="token punctuation" style=color:#393A34>{</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">      </span><span class="token keyword" style=color:#00009f>switch</span><span class="token plain"> </span><span class="token punctuation" style=color:#393A34>(</span><span class="token plain">err</span><span class="token punctuation" style=color:#393A34>.</span><span class="token plain">code</span><span class="token punctuation" style=color:#393A34>)</span><span class="token plain"> </span><span class="token punctuation" style=color:#393A34>{</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">        </span><span class="token keyword" style=color:#00009f>case</span><span class="token plain"> errorCodes</span><span class="token punctuation" style=color:#393A34>.</span><span class="token constant" style=color:#36acaa>IN_PROGRESS</span><span class="token operator" style=color:#393A34>:</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">          </span><span class="token operator" style=color:#393A34>...</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">          </span><span class="token keyword" style=color:#00009f>break</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">        </span><span class="token keyword" style=color:#00009f>case</span><span class="token plain"> errorCodes</span><span class="token punctuation" style=color:#393A34>.</span><span class="token constant" style=color:#36acaa>UNABLE_TO_OPEN_FILE_TYPE</span><span class="token operator" style=color:#393A34>:</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">          </span><span class="token operator" style=color:#393A34>...</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">          </span><span class="token keyword" style=color:#00009f>break</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">        </span><span class="token keyword" style=color:#00009f>case</span><span class="token plain"> errorCodes</span><span class="token punctuation" style=color:#393A34>.</span><span class="token constant" style=color:#36acaa>OPERATION_CANCELED</span><span class="token operator" style=color:#393A34>:</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">          </span><span class="token comment" style=color:#999988;font-style:italic>
152// ignore</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">          </span><span class="token keyword" style=color:#00009f>break</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">        </span><span class="token keyword" style=color:#00009f>default</span><span class="token operator" style=color:#393A34>:</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">          </span><span class="token builtin">console</span><span class="token punctuation" style=color:#393A34>.</span><span class="token function" style=color:#d73a49>error</span><span class="token punctuation" style=color:#393A34>(</span><span class="token plain">err</span><span class="token punctuation" style=color:#393A34>)</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">      </span><span class="token punctuation" style=color:#393A34>}</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">    </span><span class="token punctuation" style=color:#393A34>}</span><span class="token plain"> </span><span class="token keyword" style=color:#00009f>else</span><span class="token plain"> </span><span class="token punctuation" style=color:#393A34>{</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">       </span><span class="token builtin">console</span><span class="token punctuation" style=color:#393A34>.</span><span class="token function" style=color:#d73a49>error</span><span class="token punctuation" style=color:#393A34>(</span><span class="token plain">err</span><span class="token punctuation" style=color:#393A34>)</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">    </span><span class="token punctuation" style=color:#393A34>}</span><span class="token plain"></span><br/></span><span class=token-line style=color:#393A34><span class="token plain">  </span><span class="token punctuation" style=color:#393A34>}</span><br/></span></code></pre></div></div>
153<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id=functions>Functions<a href=#functions class=hash-link aria-label="Direct link to Functions" title="Direct link to Functions" translate=no>​</a></h2>
154<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=iserrorwithcode>isErrorWithCode()<a href=#iserrorwithcode class=hash-link aria-label="Direct link to isErrorWithCode()" title="Direct link to isErrorWithCode()" translate=no>​</a></h3>
155<blockquote>
156<p><strong>isErrorWithCode</strong>(<code>error</code>: <code>any</code>): <code>error is NativeModuleError</code></p>
157</blockquote>
158<p>TypeScript helper to check if an object has the <code>code</code> property.
159This is used to avoid <code>as</code> casting when you access the <code>code</code> property on errors returned by the module.</p>
160<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=parameters>Parameters<a href=#parameters class=hash-link aria-label="Direct link to Parameters" title="Direct link to Parameters" translate=no>​</a></h4>
161<table><thead><tr><th>Parameter<th>Type<tbody><tr><td><code>error</code><td><code>any</code></table>
162<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=returns>Returns<a href=#returns class=hash-link aria-label="Direct link to Returns" title="Direct link to Returns" translate=no>​</a></h4>
163<p><code>error is NativeModuleError</code></p>
164<hr/>
165<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=releaselongtermaccess>releaseLongTermAccess()<a href=#releaselongtermaccess class=hash-link aria-label="Direct link to releaseLongTermAccess()" title="Direct link to releaseLongTermAccess()" translate=no>​</a></h3>
166<blockquote>
167<p><strong>releaseLongTermAccess</strong>(<code>uris</code>: <code>string</code>[]): <code>Promise</code>&lt;<a href=#releaselongtermaccessresult class=""><code>ReleaseLongTermAccessResult</code></a>></p>
168</blockquote>
169<p>Android only - Releases long-term access to the given URIs. There's no need to call this method on iOS - there's no iOS equivalent.</p>
170<p>See <a href=https://developer.android.com/reference/android/content/ContentResolver#releasePersistableUriPermission(android.net.Uri,%20int) target=_blank rel="noopener noreferrer" class="">Android documentation</a> for more information.</p>
171<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=parameters-1>Parameters<a href=#parameters-1 class=hash-link aria-label="Direct link to Parameters" title="Direct link to Parameters" translate=no>​</a></h4>
172<table><thead><tr><th>Parameter<th>Type<tbody><tr><td><code>uris</code><td><code>string</code>[]</table>
173<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=returns-1>Returns<a href=#returns-1 class=hash-link aria-label="Direct link to Returns" title="Direct link to Returns" translate=no>​</a></h4>
174<p><code>Promise</code>&lt;<a href=#releaselongtermaccessresult class=""><code>ReleaseLongTermAccessResult</code></a>></p>
175<hr/>
176<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=releasesecureaccess>releaseSecureAccess()<a href=#releasesecureaccess class=hash-link aria-label="Direct link to releaseSecureAccess()" title="Direct link to releaseSecureAccess()" translate=no>​</a></h3>
177<blockquote>
178<p><strong>releaseSecureAccess</strong>(<code>uris</code>: <code>string</code>[]): <code>Promise</code>&lt;<code>null</code>></p>
179</blockquote>
180<p>iOS only - Releases (stops) secure access to the given URIs. Use with URIs obtained with Open mode or with the Directory Picker.
181See <a href=https://developer.apple.com/documentation/foundation/nsurl/1413736-stopaccessingsecurityscopedresou target=_blank rel="noopener noreferrer" class="">iOS documentation</a> for more information.
182There's no need to call this method on Android - there's no equivalent method on Android.</p>
183<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=parameters-2>Parameters<a href=#parameters-2 class=hash-link aria-label="Direct link to Parameters" title="Direct link to Parameters" translate=no>​</a></h4>
184<table><thead><tr><th>Parameter<th>Type<tbody><tr><td><code>uris</code><td><code>string</code>[]</table>
185<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=returns-2>Returns<a href=#returns-2 class=hash-link aria-label="Direct link to Returns" title="Direct link to Returns" translate=no>​</a></h4>
186<p><code>Promise</code>&lt;<code>null</code>></p>
187<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id=documentpicker>DocumentPicker<a href=#documentpicker class=hash-link aria-label="Direct link to DocumentPicker" title="Direct link to DocumentPicker" translate=no>​</a></h2>
188<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=isknowntype>isKnownType()<a href=#isknowntype class=hash-link aria-label="Direct link to isKnownType()" title="Direct link to isKnownType()" translate=no>​</a></h3>
189<blockquote>
190<p><strong>isKnownType</strong>(<code>options</code>: <a href=#isknowntypeoptions class=""><code>IsKnownTypeOptions</code></a>): <a href=#isknowntyperesponse class=""><code>IsKnownTypeResponse</code></a></p>
191</blockquote>
192<p>Checks if the given value (which can be a file extension, UTType identifier or mime) is known to the system.
193Also returns the mime type which you can use to filter files on Android.</p>
194<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=parameters-3>Parameters<a href=#parameters-3 class=hash-link aria-label="Direct link to Parameters" title="Direct link to Parameters" translate=no>​</a></h4>
195<table><thead><tr><th>Parameter<th>Type<tbody><tr><td><code>options</code><td><a href=#isknowntypeoptions class=""><code>IsKnownTypeOptions</code></a></table>
196<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=returns-3>Returns<a href=#returns-3 class=hash-link aria-label="Direct link to Returns" title="Direct link to Returns" translate=no>​</a></h4>
197<p><a href=#isknowntyperesponse class=""><code>IsKnownTypeResponse</code></a></p>
198<hr/>
199<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=keeplocalcopy>keepLocalCopy()<a href=#keeplocalcopy class=hash-link aria-label="Direct link to keepLocalCopy()" title="Direct link to keepLocalCopy()" translate=no>​</a></h3>
200<blockquote>
201<p><strong>keepLocalCopy</strong>(<code>options</code>: <a href=#keeplocalcopyoptions class=""><code>KeepLocalCopyOptions</code></a>): <code>Promise</code>&lt;[<a href=#localcopyresponse class=""><code>LocalCopyResponse</code></a>, <code>...LocalCopyResponse[]</code>]></p>
202</blockquote>
203<p>Makes the file available in the app's storage. The behavior is different on iOS and Android, and for simple use cases (such as uploading file to remote server), you may 
203not need to call this method at all.</p>
204<p>On Android, it can be used to "convert" a <code>content://</code> Uri into a local file. It also "exports" virtual files (such as Google docs or sheets) into local files.</p>
205<p>However, note that for some use cases, such as uploading the picked file to a server, you may not need to call <code>keepLocalCopy</code> at all. React Native's <code>fetch</code> can handle <code>content://</code> uris.</p>
206<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=parameters-4>Parameters<a href=#parameters-4 class=hash-link aria-label="Direct link to Parameters" title="Direct link to Parameters" translate=no>​</a></h4>
207<table><thead><tr><th>Parameter<th>Type<tbody><tr><td><code>options</code><td><a href=#keeplocalcopyoptions class=""><code>KeepLocalCopyOptions</code></a></table>
208<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=returns-4>Returns<a href=#returns-4 class=hash-link aria-label="Direct link to Returns" title="Direct link to Returns" translate=no>​</a></h4>
209<p><code>Promise</code>&lt;[<a href=#localcopyresponse class=""><code>LocalCopyResponse</code></a>, <code>...LocalCopyResponse[]</code>]></p>
210<hr/>
211<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=pick>pick()<a href=#pick class=hash-link aria-label="Direct link to pick()" title="Direct link to pick()" translate=no>​</a></h3>
212<blockquote>
213<p><strong>pick</strong>&lt;<code>O</code>>(<code>options?</code>: <code>O</code>): <code>PickResponse</code>&lt;<code>O</code>></p>
214</blockquote>
215<p>The method for picking a file, both for <code>import</code> and <code>open</code> modes.</p>
216<p>For result types, see <a href=#documentpickerresponse class="">DocumentPickerResponse</a> or <a href=#documentpickerresponseopenlongterm class="">DocumentPickerResponseOpenLongTerm</a>.</p>
217<p>For options, see <a href=#documentpickeroptionsimport class="">DocumentPickerOptionsImport</a>, <a href=#documentpickeroptionsopenonce class="">DocumentPickerOptionsOpenOnce</a> or <a href=#documentpickeroptionsopenlongterm class="">DocumentPickerOptionsOpenLongTerm</a>.</p>
218<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=type-parameters-1>Type Parameters<a href=#type-parameters-1 class=hash-link aria-label="Direct link to Type Parameters" title="Direct link to Type Parameters" translate=no>​</a></h4>
219<table><thead><tr><th>Type Parameter<tbody><tr><td><code>O</code> <em>extends</em> <code>DocumentPickerOptions</code></table>
220<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=parameters-5>Parameters<a href=#parameters-5 class=hash-link aria-label="Direct link to Parameters" title="Direct link to Parameters" translate=no>​</a></h4>
221<table><thead><tr><th>Parameter<th>Type<tbody><tr><td><code>options?</code><td><code>O</code></table>
222<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=returns-5>Returns<a href=#returns-5 class=hash-link aria-label="Direct link to Returns" title="Direct link to Returns" translate=no>​</a></h4>
223<p><code>PickResponse</code>&lt;<code>O</code>></p>
224<hr/>
225<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=pickdirectory>pickDirectory()<a href=#pickdirectory class=hash-link aria-label="Direct link to pickDirectory()" title="Direct link to pickDirectory()" translate=no>​</a></h3>
226<blockquote>
227<p><strong>pickDirectory</strong>&lt;<code>O</code>>(<code>options?</code>: <code>O</code>): <a href=#pickdirectoryresponse class=""><code>PickDirectoryResponse</code></a>&lt;<code>O</code>></p>
228</blockquote>
229<p>Opens a directory picker.</p>
230<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=type-parameters-2>Type Parameters<a href=#type-parameters-2 class=hash-link aria-label="Direct link to Type Parameters" title="Direct link to Type Parameters" translate=no>​</a></h4>
231<table><thead><tr><th>Type Parameter<tbody><tr><td><code>O</code> <em>extends</em> <a href=#directorypickeroptions class=""><code>DirectoryPickerOptions</code></a></table>
232<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=parameters-6>Parameters<a href=#parameters-6 class=hash-link aria-label="Direct link to Parameters" title="Direct link to Parameters" translate=no>​</a></h4>
233<table><thead><tr><th>
233Parameter<th>Type<tbody><tr><td><code>options?</code><td><code>O</code></table>
234<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=returns-6>Returns<a href=#returns-6 class=hash-link aria-label="Direct link to Returns" title="Direct link to Returns" translate=no>​</a></h4>
235<p><a href=#pickdirectoryresponse class=""><code>PickDirectoryResponse</code></a>&lt;<code>O</code>></p>
236<hr/>
237<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=savedocuments>saveDocuments()<a href=#savedocuments class=hash-link aria-label="Direct link to saveDocuments()" title="Direct link to saveDocuments()" translate=no>​</a></h3>
238<blockquote>
239<p><strong>saveDocuments</strong>(<code>options</code>: <a href=#savedocumentsoptions class=""><code>SaveDocumentsOptions</code></a>): <code>Promise</code>&lt;[<a href=#savedocumentsresponse class=""><code>SaveDocumentsResponse</code></a>, <code>...SaveDocumentsResponse[]</code>]></p>
240</blockquote>
241<p>The method for opening a "save as" dialog and saving source file(s) to a new location.</p>
242<p>On Android, only one file can be saved at a time.</p>
243<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=parameters-7>Parameters<a href=#parameters-7 class=hash-link aria-label="Direct link to Parameters" title="Direct link to Parameters" translate=no>​</a></h4>
244<table><thead><tr><th>Parameter<th>Type<tbody><tr><td><code>options</code><td><a href=#savedocumentsoptions class=""><code>SaveDocumentsOptions</code></a></table>
245<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=returns-7>Returns<a href=#returns-7 class=hash-link aria-label="Direct link to Returns" title="Direct link to Returns" translate=no>​</a></h4>
246<p><code>Promise</code>&lt;[<a href=#savedocumentsresponse class=""><code>SaveDocumentsResponse</code></a>, <code>...SaveDocumentsResponse[]</code>]></p>
247<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id=pick-types>pick() types<a href=#pick-types class=hash-link aria-label="Direct link to pick() types" title="Direct link to pick() types" translate=no>​</a></h2>
248<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=documentpickeroptionsbase>DocumentPickerOptionsBase<a href=#documentpickeroptionsbase class=hash-link aria-label="Direct link to DocumentPickerOptionsBase" title="Direct link to DocumentPickerOptionsBase" translate=no>​</a></h3>
249<blockquote>
250<p><strong>DocumentPickerOptionsBase</strong> = { <code>allowMultiSelection?</code>: <code>boolean</code>; <code>allowVirtualFiles?</code>: <code>boolean</code>; <code>presentationStyle?</code>: <a href=#presentationstyle-2 class=""><code>PresentationStyle</code></a>; <code>transitionStyle?</code>: <a href=#transitionstyle-2 class=""><code>TransitionStyle</code></a>; <code>type?</code>: <code>string</code> | <a href=#predefinedfiletypes class=""><code>PredefinedFileTypes</code></a> | (<a href=#predefinedfiletypes class=""><code>PredefinedFileTypes</code></a> | <code>string</code>)[]; }</p>
251</blockquote>
252<p>Base options object for the document picker.
253You'd rarely use this type directly, but instead use one of</p>
254<p><a href=#documentpickeroptionsimport class="">DocumentPickerOptionsImport</a>, <a href=#documentpickeroptionsopenonce class="">DocumentPickerOptionsOpenOnce</a> or <a href=#documentpickeroptionsopenlongterm class="">DocumentPickerOptionsOpenLongTerm</a></p>
255<p>which extend this type</p>
256<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=properties-4>Properties<a href=#properties-4 class=hash-link aria-label="Direct link to Properties" title="Direct link to Properties" translate=no>​</a></h4>
257<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=allowmultiselection>allowMultiSelection?<a href=#allowmultiselection class=hash-link aria-label="Direct link to allowMultiSelection?" title="Direct link to allowMultiSelection?" translate=no>​</a></h5>
258<blockquote>
259<p><code>optional</code> <strong>allowMultiSelection</strong>: <code>boolean</code></p>
260</blockquote>
261<p>Whether to allow multiple files to be picked. False by default.</p>
262<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=allowvirtualfiles>allowVirtualFiles?<a href=#allowvirtualfiles class=hash-link aria-label="Direct link to allowVirtualFiles?" title="Direct link to allowVirtualFiles?" translate=no>​</a></h5>
263<blockquote>
264<p><code>optional</code> <strong>allowVirtualFiles</strong>: <code>boolean</code></p>
265</blockquote>
266<p>Android only - Whether to allow virtual files (such as Google docs or sheets) to be picked. False by default.</p>
267<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=presentationstyle-1>presentationStyle?<a href=#presentationstyle-1 class=hash-link aria-label="Direct link to presentationStyle?" title="Direct link to presentationStyle?" translate=no>​</a></h5>
268<blockquote>
269<p><code>optional</code> <strong>presentationStyle</strong>: <a href=#presentationstyle-2 class=""><code>PresentationStyle</code></a></p>
270</blockquote>
271<p>iOS only - Controls how the picker is presented, e.g. on an iPad you may want to present it fullscreen. Defaults to <code>pageSheet</code>.</p>
272<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=transitionstyle-1>transitionStyle?<a href=#transitionstyle-1 class=hash-link aria-label="Direct link to transitionStyle?" title="Direct link to transitionStyle?" translate=no>​</a></h5>
273<blockquote>
274<p><code>optional</code> <strong>transitionStyle</strong>: <a href=#transitionstyle-2 class=""><code>TransitionStyle</code></a></p>
275</blockquote>
276<p>iOS only - Configures the transition style of the picker. Defaults to coverVertical, when the picker is presented, its view slides up from the bottom of the screen.</p>
277<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=type>type?<a href=#type class=hash-link aria-label="Direct link to type?" title="Direct link to type?" translate=no>​</a></h5>
278<blockquote>
279<p><code>optional</code> <strong>type</strong>: <code>string</code> | <a href=#predefinedfiletypes class=""><code>PredefinedFileTypes</code></a> | (<a href=#predefinedfiletypes class=""><code>PredefinedFileTypes</code></a> | <code>string</code>)[]</p>
280</blockquote>
281<p>Specify file type(s) that you want to pick. Use <code>types</code> for some predefined values.</p>
282<hr/>
283<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=documentpickeroptionsimport>DocumentPickerOptionsImport<a href=#documentpickeroptionsimport class=hash-link aria-label="Direct link to DocumentPickerOptionsImport" title="Direct link to DocumentPickerOptionsImport" translate=no>​</a></h3>
284<blockquote>
285<p><strong>DocumentPickerOptionsImport</strong> = <a href=#documentpickeroptionsbase class=""><code>DocumentPickerOptionsBase</code></a> & { <code>mode?</code>: <code>"import"</code>; <code>requestLongTermAccess?</code>: <code>never</code>; }</p>
286</blockquote>
287<p>Present the document picker in import mode.</p>
288<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=type-declaration>Type Declaration<a href=#type-declaration class=hash-link aria-label="Direct link to Type Declaration" title="Direct link to Type Declaration" translate=no>​</a></h4>
289<table><thead><tr><th>
289Name<th>Type<tbody><tr><td><code>mode?</code><td><code>"import"</code><tr><td><code>requestLongTermAccess?</code><td><code>never</code></table>
290<hr/>
291<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=documentpickeroptionsopenlongterm>DocumentPickerOptionsOpenLongTerm<a href=#documentpickeroptionsopenlongterm class=hash-link aria-label="Direct link to DocumentPickerOptionsOpenLongTerm" title="Direct link to DocumentPickerOptionsOpenLongTerm" translate=no>​</a></h3>
292<blockquote>
293<p><strong>DocumentPickerOptionsOpenLongTerm</strong> = <a href=#documentpickeroptionsbase class=""><code>DocumentPickerOptionsBase</code></a> & { <code>mode</code>: <code>"open"</code>; <code>requestLongTermAccess</code>: <code>true</code>; }</p>
294</blockquote>
295<p>Present the document picker in open mode, with long-term permissions to access the opened file.</p>
296<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=type-declaration-1>Type Declaration<a href=#type-declaration-1 class=hash-link aria-label="Direct link to Type Declaration" title="Direct link to Type Declaration" translate=no>​</a></h4>
297<table><thead><tr><th>Name<th>Type<tbody><tr><td><code>mode</code><td><code>"open"</code><tr><td><code>requestLongTermAccess</code><td><code>true</code></table>
298<hr/>
299<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=documentpickeroptionsopenonce>DocumentPickerOptionsOpenOnce<a href=#documentpickeroptionsopenonce class=hash-link aria-label="Direct link to DocumentPickerOptionsOpenOnce" title="Direct link to DocumentPickerOptionsOpenOnce" translate=no>​</a></h3>
300<blockquote>
301<p><strong>DocumentPickerOptionsOpenOnce</strong> = <a href=#documentpickeroptionsbase class=""><code>DocumentPickerOptionsBase</code></a> & { <code>mode</code>: <code>"open"</code>; <code>requestLongTermAccess?</code>: <code>false</code>; }</p>
302</blockquote>
303<p>Present the document picker in open mode, with permissions to access the file for a limited time (until the app terminates).</p>
304<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=type-declaration-2>Type Declaration<a href=#type-declaration-2 class=hash-link aria-label="Direct link to Type Declaration" title="Direct link to Type Declaration" translate=no>​</a></h4>
305<table><thead><tr><th>Name<th>Type<tbody><tr><td><code>mode</code><td><code>"open"</code><tr><td><code>requestLongTermAccess?</code><td><code>false</code></table>
306<hr/>
307<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=documentpickerresponse>DocumentPickerResponse<a href=#documentpickerresponse class=hash-link aria-label="Direct link to DocumentPickerResponse" title="Direct link to DocumentPickerResponse" translate=no>​</a></h3>
308<blockquote>
309<p><strong>DocumentPickerResponse</strong> = { <code>convertibleToMimeTypes</code>: <a href=#virtualfilemeta class=""><code>VirtualFileMeta</code></a>[] | <code>null</code>; <code>error</code>: <code>string</code> | <code>null</code>; <code>hasRequestedType</code>: <code>boolean</code>; <code>isVirtual</code>: <code>boolean</code> | <code>null</code>; <code>name</code>: <code>string</code> | <code>null</code>; <code>nativeType</code>: <code>string</code> | <code>null</code>; <code>size</code>: <code>number</code> | <code>null</code>; <code>type</code>: <code>string</code> | <code>null</code>; <code>uri</code>: <code>string</code>; }</p>
310</blockquote>
311<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=properties-5>Properties<a href=#properties-5 class=hash-link aria-label="Direct link to Properties" title="Direct link to Properties" translate=no>​</a></h4>
312<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=convertibletomimetypes>convertibleToMimeTypes<a href=#convertibletomimetypes class=hash-link aria-label="Direct link to convertibleToMimeTypes" title="Direct link to convertibleToMimeTypes" translate=no>​</a></h5>
313<blockquote>
314<p><strong>convertibleToMimeTypes</strong>: <a href=#virtualfilemeta class=""><code>VirtualFileMeta</code></a>[] | <code>null</code></p>
315</blockquote>
316<p>Android: The target types the virtual file can be converted to. Useful for <a href=#keeplocalcopy class="">keepLocalCopy</a>.
317This field is only present if <code>isVirtual</code> is true, and only on Android 7.0+. Always <code>null</code> on iOS.</p>
318<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=error>error<a href=#error class=hash-link aria-label="Direct link to error" title="Direct link to error" translate=no>​</a></h5>
319<blockquote>
320<p><strong>error</strong>: <code>string</code> | <code>null</code></p>
321</blockquote>
322<p>Error in case the file metadata could not be obtained.</p>
323<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=hasrequestedtype>hasRequestedType<a href=#hasrequestedtype class=hash-link aria-label="Direct link to hasRequestedType" title="Direct link to hasRequestedType" translate=no>​</a></h5>
324<blockquote>
325<p><strong>hasRequestedType</strong>: <code>boolean</code></p>
326</blockquote>
327<p>Android: Some document providers on Android (especially those popular in Asia, it seems)
328do not respect the request for limiting selectable file types.
329<code>hasRequestedType</code> is false if the user picked a file that does not have one of the requested types.</p>
330<p>You need to do your own post-processing and display an error to the user if this is important to your app.</p>
331<p>Always <code>true</code> on iOS.</p>
332<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=isvirtual>isVirtual<a href=#isvirtual class=hash-link aria-label="Direct link to isVirtual" title="Direct link to isVirtual" translate=no>​</a></h5>
333<blockquote>
334<p><strong>isVirtual</strong>: <code>boolean</code> | <code>null</code></p>
335</blockquote>
336<p>Android: whether the file is a virtual file (such as Google docs or sheets). This is <code>null</code> on pre-Android 7.0 devices. On iOS, it's always <code>false</code>.</p>
337<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=name>name<a href=#name class=hash-link aria-label="Direct link to name" title="Direct link to name" translate=no>​</a></h5>
338<blockquote>
339<p><strong>name</strong>: <code>string</code> | <code>null</code></p>
340</blockquote>
341<p>The name of the picked file, including the extension. It's very unlikely that it'd be <code>null</code> but in theory, it can happen.</p>
342<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=nativetype>nativeType<a href=#nativetype class=hash-link aria-label="Direct link to nativeType" title="Direct link to nativeType" translate=no>​</a></h5>
343<blockquote>
344<p><strong>nativeType</strong>: <code>string</code> | <code>null</code></p>
345</blockquote>
346<p>The "native" type of the picked file: on Android, this is the MIME type. On iOS, it is the UTType identifier.</p>
347<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=size>size<a href=#size class=hash-link aria-label="Direct link to size" title="Direct link to size" translate=no>​</a></h5>
348<blockquote>
349<p><strong>size</strong>: <code>number</code> | <code>null</code></p>
350</blockquote>
351<p>The size of the picked file in bytes.</p>
352<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=type-1>type<a href=#type-1 class=hash-link aria-label="Direct link to type" title="Direct link to type" translate=no>​</a></h5>
353<blockquote>
354<p><strong>type</strong>: <code>string</code> | <code>null</code></p>
355</blockquote>
356<p>The MIME type of the picked file.</p>
357<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=uri-1>uri<a href=#uri-1 class=hash-link aria-label="Direct link to uri" title="Direct link to uri" translate=no>​</a></h5>
358<blockquote>
359<p><strong>uri</strong>: <code>string</code></p>
360</blockquote>
361<p>The URI of the picked file. This is a percent-encoded <code>content://</code> uri (Android), or a <code>file://</code> uri (iOS).</p>
362<hr/>
363<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=documentpickerresponseopenlongterm>DocumentPickerResponseOpenLongTerm<a href=#documentpickerresponseopenlongterm class=hash-link aria-label="Direct link to DocumentPickerResponseOpenLongTerm" title="Direct link to DocumentPickerResponseOpenLongTerm" translate=no>​</a></h3>
364<blockquote>
365<p><strong>DocumentPickerResponseOpenLongTerm</strong> = <a href=#documentpickerresponse class=""><code>DocumentPickerResponse</code></a> & <a href=#bookmarkingresponse class=""><code>BookmarkingResponse</code></a></p>
366</blockquote>
367<p>The result of calling <a href=#pick class="">pick</a> with <code>mode: 'open'</code> and <code>requestLongTermAccess: true</code></p>
368<hr/>
369<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=virtualfilemeta>VirtualFileMeta<a href=#virtualfilemeta class=hash-link aria-label="Direct link to VirtualFileMeta" title="Direct link to VirtualFileMeta" translate=no>​</a></h3>
370<blockquote>
371<p><strong>VirtualFileMeta</strong> = { <code>extension</code>: <code>string</code> | <code>null</code>; <code>mimeType</code>: <code>string</code>; }</p>
372</blockquote>
373<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=properties-6>Properties<a href=#properties-6 class=hash-link aria-label="Direct link to Properties" title="Direct link to Properties" translate=no>​</a></h4>
374<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=extension>extension<a href=#extension class=hash-link aria-label="Direct link to extension" title="Direct link to extension" translate=no>​</a></h5>
375<blockquote>
376<p><strong>extension</strong>: <code>string</code> | <code>null</code></p>
377</blockquote>
378<p>The registered extension for the given MIME type. Note that some MIME types map to multiple extensions.</p>
379<p>This call returns the most common extension for the given MIME type.</p>
380<p>Example: <code>pdf</code></p>
381<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=mimetype-1>mimeType<a href=#mimetype-1 class=hash-link aria-label="Direct link to mimeType" title="Direct link to mimeType" translate=no>​</a></h5>
382<blockquote>
383<p><strong>mimeType</strong>: <code>string</code></p>
384</blockquote>
385<p>The MIME type of the file. This is necessary to export the virtual file to a local file.</p>
386<p>Example: <code>application/pdf</code></p>
387<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id=pickdirectory-types>pickDirectory() types<a href=#pickdirectory-types class=hash-link aria-label="Direct link to pickDirectory() types" title="Direct link to pickDirectory() types" translate=no>​</a></h2>
388<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=directorypickeroptions>DirectoryPickerOptions<a href=#directorypickeroptions class=hash-link aria-label="Direct link to DirectoryPickerOptions" title="Direct link to DirectoryPickerOptions" translate=no>​</a></h3>
389<blockquote>
390<p><strong>DirectoryPickerOptions</strong> = <a href=#directorypickeroptionsbase class=""><code>DirectoryPickerOptionsBase</code></a> & { <code>requestLongTermAccess</code>: <code>boolean</code>; }</p>
391</blockquote>
392<p>Options for <a href=#pickdirectory class="">pickDirectory</a>.</p>
393<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=type-declaration-3>Type Declaration<a href=#type-declaration-3 class=hash-link aria-label="Direct link to Type Declaration" title="Direct link to Type Declaration" translate=no>​</a></h4>
394<table><thead><tr><th>
394Name<th>Type<tbody><tr><td><code>requestLongTermAccess</code><td><code>boolean</code></table>
395<hr/>
396<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=directorypickeroptionsbase>DirectoryPickerOptionsBase<a href=#directorypickeroptionsbase class=hash-link aria-label="Direct link to DirectoryPickerOptionsBase" title="Direct link to DirectoryPickerOptionsBase" translate=no>​</a></h3>
397<blockquote>
398<p><strong>DirectoryPickerOptionsBase</strong> = { <code>presentationStyle?</code>: <a href=#presentationstyle-2 class=""><code>PresentationStyle</code></a>; <code>transitionStyle?</code>: <a href=#transitionstyle-2 class=""><code>TransitionStyle</code></a>; }</p>
399</blockquote>
400<p>Base options object for the directory picker. They only slightly influence the appearance of the picker modal on iOS.
401You'd rarely use this type directly, but instead use <a href=#directorypickeroptions class="">DirectoryPickerOptions</a></p>
402<p>which extend this type</p>
403<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=properties-7>Properties<a href=#properties-7 class=hash-link aria-label="Direct link to Properties" title="Direct link to Properties" translate=no>​</a></h4>
404<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=presentationstyle-2>presentationStyle?<a href=#presentationstyle-2 class=hash-link aria-label="Direct link to presentationStyle?" title="Direct link to presentationStyle?" translate=no>​</a></h5>
405<blockquote>
406<p><code>optional</code> <strong>presentationStyle</strong>: <a href=#presentationstyle-2 class=""><code>PresentationStyle</code></a></p>
407</blockquote>
408<p>iOS only - Controls how the picker is presented, e.g. on an iPad you may want to present it fullscreen. Defaults to <code>pageSheet</code>.</p>
409<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=transitionstyle-2>transitionStyle?<a href=#transitionstyle-2 class=hash-link aria-label="Direct link to transitionStyle?" title="Direct link to transitionStyle?" translate=no>​</a></h5>
410<blockquote>
411<p><code>optional</code> <strong>transitionStyle</strong>: <a href=#transitionstyle-2 class=""><code>TransitionStyle</code></a></p>
412</blockquote>
413<p>iOS only - Configures the transition style of the picker. Defaults to coverVertical, when the picker is presented, its view slides up from the bottom of the screen.</p>
414<hr/>
415<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=directorypickerresponse>DirectoryPickerResponse<a href=#directorypickerresponse class=hash-link aria-label="Direct link to DirectoryPickerResponse" title="Direct link to DirectoryPickerResponse" translate=no>​</a></h3>
416<blockquote>
417<p><strong>DirectoryPickerResponse</strong> = { <code>uri</code>: <code>string</code>; }</p>
418</blockquote>
419<p>This object represents the response from the directory picker, when long-term access was not requested.</p>
420<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=properties-8>Properties<a href=#properties-8 class=hash-link aria-label="Direct link to Properties" title="Direct link to Properties" translate=no>​</a></h4>
421<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=uri-2>uri<a href=#uri-2 class=hash-link aria-label="Direct link to uri" title="Direct link to uri" translate=no>​</a></h5>
422<blockquote>
423<p><strong>uri</strong>: <code>string</code></p>
424</blockquote>
425<p>The (percent-encoded) directory selected by user.</p>
426<hr/>
427<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=directorypickerresponselongterm>DirectoryPickerResponseLongTerm<a href=#directorypickerresponselongterm class=hash-link aria-label="Direct link to DirectoryPickerResponseLongTerm" title="Direct link to DirectoryPickerResponseLongTerm" translate=no>​</a></h3>
428<blockquote>
429<p><strong>DirectoryPickerResponseLongTerm</strong> = <a href=#directorypickerresponse class=""><code>DirectoryPickerResponse</code></a> & <a href=#bookmarkingresponse class=""><code>BookmarkingResponse</code></a></p>
430</blockquote>
431<p>This object represents the response from the directory picker, when long-term access was requested.</p>
432<hr/>
433<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=pickdirectoryresponse>PickDirectoryResponse<a href=#pickdirectoryresponse class=hash-link aria-label="Direct link to PickDirectoryResponse" title="Direct link to PickDirectoryResponse" translate=no>​</a></h3>
434<blockquote>
435<p><strong>PickDirectoryResponse</strong>&lt;<code>O</code>> = <code>Promise</code>&lt;<code>O</code> <em>extends</em> <code>DirectoryPickerOptionsLongTerm</code> ? <a href=#directorypickerresponselongterm class=""><code>DirectoryPickerResponseLongTerm</code></a> : <a href=#directorypickerresponse class=""><code>DirectoryPickerResponse</code></a>></p>
436</blockquote>
437<p>You likely won't use this type directly, but instead use <a href=#directorypickerresponse class="">DirectoryPickerResponse</a> or <a href=#directorypickerresponselongterm class="">DirectoryPickerResponseLongTerm</a>.</p>
438<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=type-parameters-3>Type Parameters<a href=#type-parameters-3 class=hash-link aria-label="Direct link to Type Parameters" title="Direct link to Type Parameters" translate=no>​</a></h4>
439<table><thead><tr><th>
439Type Parameter<tbody><tr><td><code>O</code> <em>extends</em> <a href=#directorypickeroptions class=""><code>DirectoryPickerOptions</code></a></table>
440<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id=savedocuments-types>saveDocuments() types<a href=#savedocuments-types class=hash-link aria-label="Direct link to saveDocuments() types" title="Direct link to saveDocuments() types" translate=no>​</a></h2>
441<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=savedocumentsoptions>SaveDocumentsOptions<a href=#savedocumentsoptions class=hash-link aria-label="Direct link to SaveDocumentsOptions" title="Direct link to SaveDocumentsOptions" translate=no>​</a></h3>
442<blockquote>
443<p><strong>SaveDocumentsOptions</strong> = { <code>copy?</code>: <code>boolean</code>; <code>fileName?</code>: <code>string</code>; <code>mimeType?</code>: <code>string</code>; <code>sourceUris</code>: <code>string</code>[]; }</p>
444</blockquote>
445<p>Options object for the <a href=#savedocuments class="">saveDocuments</a> method. <code>sourceUris</code> is the only required field.</p>
446<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=properties-9>Properties<a href=#properties-9 class=hash-link aria-label="Direct link to Properties" title="Direct link to Properties" translate=no>​</a></h4>
447<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=copy>copy?<a href=#copy class=hash-link aria-label="Direct link to copy?" title="Direct link to copy?" translate=no>​</a></h5>
448<blockquote>
449<p><code>optional</code> <strong>copy</strong>: <code>boolean</code></p>
450</blockquote>
451<p>iOS-only: Whether to copy the file to a new location, or move it (default).
452On Android, file is always copied.</p>
453<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=filename-1>fileName?<a href=#filename-1 class=hash-link aria-label="Direct link to fileName?" title="Direct link to fileName?" translate=no>​</a></h5>
454<blockquote>
455<p><code>optional</code> <strong>fileName</strong>: <code>string</code></p>
456</blockquote>
457<p>Android-only: The suggested title of the file to be stored, which will be pre-filled in the UI.
458On iOS, the target name is taken from the source uri, and is changeable only when exactly one file is being saved.</p>
459<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=mimetype-2>mimeType?<a href=#mimetype-2 class=hash-link aria-label="Direct link to mimeType?" title="Direct link to mimeType?" translate=no>​</a></h5>
460<blockquote>
461<p><code>optional</code> <strong>mimeType</strong>: <code>string</code></p>
462</blockquote>
463<p>Android-only: The MIME type of the file to be stored.
464It is recommended to provide this value, otherwise the system tries to infer it from the sourceUri using ContentResolver.</p>
465<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=sourceuris>sourceUris<a href=#sourceuris class=hash-link aria-label="Direct link to sourceUris" title="Direct link to sourceUris" translate=no>​</a></h5>
466<blockquote>
467<p><strong>sourceUris</strong>: <code>string</code>[]</p>
468</blockquote>
469<p>The source URIs of the files to save, percentage-encoded. Android only allows to save one file at a time, iOS allows multiple.</p>
470<hr/>
471<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id=savedocumentsresponse>SaveDocumentsResponse<a href=#savedocumentsresponse class=hash-link aria-label="Direct link to SaveDocumentsResponse" title="Direct link to SaveDocumentsResponse" translate=no>​</a></h3>
472<blockquote>
473<p><strong>SaveDocumentsResponse</strong> = { <code>error</code>: <code>string</code> | <code>null</code>; <code>name</code>: <code>string</code> | <code>null</code>; <code>uri</code>: <code>string</code>; }</p>
474</blockquote>
475<p>The result of calling <a href=#savedocuments class="">saveDocuments</a>. It is very unlikely that the metadata fields would be <code>null</code>, but in theory, it can happen.</p>
476<h4 class="anchor anchorTargetStickyNavbar_Vzrq" id=properties-10>Properties<a href=#properties-10 class=hash-link aria-label="Direct link to Properties" title="Direct link to Properties" translate=no>​</a></h4>
477<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=error-1>error<a href=#error-1 class=hash-link aria-label="Direct link to error" title="Direct link to error" translate=no>​</a></h5>
478<blockquote>
479<p><strong>error</strong>: <code>string</code> | <code>null</code></p>
480</blockquote>
481<p>Error in case the file could not be written or some metadata could not be obtained.</p>
482<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=name-1>name<a href=#name-1 class=hash-link aria-label="Direct link to name" title="Direct link to name" translate=no>​</a></h5>
483<blockquote>
484<p><strong>name</strong>: <code>string</code> | <code>null</code></p>
485</blockquote>
486<p>The name of the file that user entered, including extension.</p>
487<h5 class="anchor anchorTargetStickyNavbar_Vzrq" id=uri-3>uri<a href=#uri-3 class=hash-link aria-label="Direct link to uri" title="Direct link to uri" translate=no>​</a></h5>
488<blockquote>
489<p><strong>uri</strong>: <code>string</code></p>
490</blockquote>
491<p>The target URI - the one user saved to. This is a percent-encoded <code>content://</code> uri (Android), or a <code>file://</code> uri (iOS).</div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col noPrint_WFHX"><a href=https://github.com/react-native-documents/document-picker/edit/main/docs/docs/doc-picker-api/index.md target=_blank rel="noopener noreferrer" class=theme-edit-this-page><svg fill=currentColor height=20 width=20 viewBox="0 0 40 40" class=iconEdit_Z9Sw aria-hidden=true><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"/></g></svg>Edit this page</a></div><div class="col lastUpdated_JAkA"></div></div></footer></article><nav class="docusaurus-mt-lg pagination-nav" aria-label="Docs pages"></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href=#type-aliases class="table-of-contents__link toc-highlight">Type Aliases</a><ul><li><a href=#bookmarkingresponse class="table-of-contents__link toc-highlight">BookmarkingResponse</a><li><a href=#filetocopy class="table-of-contents__link toc-highlight">FileToCopy</a><li><a href=#isknowntypeoptions class="table-of-contents__link toc-highlight">IsKnownTypeOptions</a><li><a href=#isknowntyperesponse class="table-of-contents__link toc-highlight">IsKnownTypeResponse</a><li><a href=#keeplocalcopyoptions class="table-of-contents__link toc-highlight">KeepLocalCopyOptions</a><li><a href=#keeplocalcopyresponse class="table-of-contents__link toc-highlight">KeepLocalCopyResponse</a><li><a href=#localcopyresponse class="table-of-contents__link toc-highlight">LocalCopyResponse</a><li><a href=#nonemptyarray class="table-of-contents__link toc-highlight">NonEmptyArray</a><li><a href=#predefinedfiletypes class="table-of-contents__link toc-highlight">PredefinedFileTypes</a><li><a href=#presentationstyle class="table-of-contents__link toc-highlight">PresentationStyle</a><li><a href=#releaselongtermaccessresult class="table-of-contents__link toc-highlight">ReleaseLongTermAccessResult</a><li><a href=#transitionstyle class="table-of-contents__link toc-highlight">TransitionStyle</a></ul><li><a href=#variables class="table-of-contents__link toc-highlight">Variables</a><ul><li><a href=#errorcodes class="table-of-contents__link toc-highlight">errorCodes</a></ul><li><a href=#functions class="table-of-contents__link toc-highlight">Functions</a><ul><li><a href=#iserrorwithcode class="table-of-contents__link toc-highlight">isErrorWithCode()</a><li><a href=#releaselongtermaccess class="table-of-contents__link toc-highlight">releaseLongTermAccess()</a><li><a href=#releasesecureaccess class="table-of-contents__link toc-highlight">releaseSecureAccess()</a></ul><li><a href=#documentpicker class="table-of-contents__link toc-highlight">DocumentPicker</a><ul><li><a href=#isknowntype class="table-of-contents__link toc-highlight">isKnownType()</a><li><a href=#keeplocalcopy class="table-of-contents__link toc-highlight">keepLocalCopy()</a><li><a href=#pick class="table-of-contents__link toc-highlight">pick()</a><li><a href=#pickdirectory class="table-of-contents__link toc-highlight">pickDirectory()</a><li><a href=#savedocuments class="table-of-contents__link toc-highlight">saveDocuments()</a></ul><li><a href=#pick-types class="table-of-contents__link toc-highlight">pick() types</a><ul><li><a href=#documentpickeroptionsbase class="table-of-contents__link toc-highlight">DocumentPickerOptionsBase</a><li><a href=#documentpickeroptionsimport class="table-of-contents__link toc-highlight">DocumentPickerOptionsImport</a><li><a href=#documentpickeroptionsopenlongterm class="table-of-contents__link toc-highlight">DocumentPickerOptionsOpenLongTerm</a><li>
491<a href=#documentpickeroptionsopenonce class="table-of-contents__link toc-highlight">DocumentPickerOptionsOpenOnce</a><li><a href=#documentpickerresponse class="table-of-contents__link toc-highlight">DocumentPickerResponse</a><li><a href=#documentpickerresponseopenlongterm class="table-of-contents__link toc-highlight">DocumentPickerResponseOpenLongTerm</a><li><a href=#virtualfilemeta class="table-of-contents__link toc-highlight">VirtualFileMeta</a></ul><li><a href=#pickdirectory-types class="table-of-contents__link toc-highlight">pickDirectory() types</a><ul><li><a href=#directorypickeroptions class="table-of-contents__link toc-highlight">DirectoryPickerOptions</a><li><a href=#directorypickeroptionsbase class="table-of-contents__link toc-highlight">DirectoryPickerOptionsBase</a><li><a href=#directorypickerresponse class="table-of-contents__link toc-highlight">DirectoryPickerResponse</a><li><a href=#directorypickerresponselongterm class="table-of-contents__link toc-highlight">DirectoryPickerResponseLongTerm</a><li><a href=#pickdirectoryresponse class="table-of-contents__link toc-highlight">PickDirectoryResponse</a></ul><li><a href=#savedocuments-types class="table-of-contents__link toc-highlight">saveDocuments() types</a><ul><li><a href=#savedocumentsoptions class="table-of-contents__link toc-highlight">SaveDocumentsOptions</a><li><a href=#savedocumentsresponse class="table-of-contents__link toc-highlight">SaveDocumentsResponse</a></ul></ul></div></div></div></div></main></div></div></div><footer class="theme-layout-footer footer footer--dark"><div class="container container-fluid"><div class="footer__bottom text--center"><div class=footer__copyright>Copyright © 2026 <a href=https://github.com/vonovak target=”_blank”>Vojtech Novak</a>. Built with Docusaurus.</div></div></div></footer></div></body>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.