Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions docs/docs/doc-viewer-api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,41 @@ options for viewing a document

If you're trying to open a file that you have long-term permission to access, you should use the `bookmark` option (provided by the DocumentPicker module).

## Variables

### errorCodes

> `const` **errorCodes**: `Readonly`\<\{`IN_PROGRESS`: `"ASYNC_OP_IN_PROGRESS"`;`OPERATION_CANCELED`: `"OPERATION_CANCELED"`;`UNABLE_TO_OPEN_FILE_TYPE`: `"UNABLE_TO_OPEN_FILE_TYPE"`; \}\>

#### Type declaration

| Name | Type |
| ------ | ------ |
| `IN_PROGRESS` | `"ASYNC_OP_IN_PROGRESS"` |
| `OPERATION_CANCELED` | `"OPERATION_CANCELED"` |
| `UNABLE_TO_OPEN_FILE_TYPE` | `"UNABLE_TO_OPEN_FILE_TYPE"` |

## Functions

### isErrorWithCode()

> **isErrorWithCode**(`error`: `any`): `error is NativeModuleError`

TypeScript helper to check if an object has the `code` property.
This is used to avoid `as` casting when you access the `code` property on errors returned by the module.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `error` | `any` |

#### Returns

`error is NativeModuleError`

***

### viewDocument()

> **viewDocument**(`data`: [`ViewDocumentOptions`](index.md#viewdocumentoptions)): `Promise`\<`null`\>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sponsor-only/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ There's the improved (list of changes below) picker package (called `@react-nati

### Windows

Windows is not supported at the moment. While there is Windows-related code in the public module, it's not maintained and probably does not work.
Windows is not supported at the moment but you can try your luck [here](https://github.com/ClaudiuHBann/document-picker-windows). While there was Windows-related code in the public module, it was not maintained and probably does not work.

### How do I know it works?

Expand Down
4 changes: 3 additions & 1 deletion docs/docs/sponsor-only/license.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ sidebar_position: 80
sidebar_label: License
---

The module is licensed under MIT
# License

The module is licensed under MIT, giving you the ability to use all of it for free in your projects, allowing modifications to your liking.
2 changes: 1 addition & 1 deletion docs/docs/sponsor-only/picker/directory-picker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 6
---

# Directory Picker
# Directory picker

This module allows you to pick a directory from the file system. The chosen directory can then be used for file I/O operations.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sponsor-only/picker/integrating-on-android.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 10
---

# Android Usage Notes
# Android usage notes

:::tip
The TL;DR version is: the Open and Import modes on Android aren't too different in practice, and you can usually use either one, often combined with [`keepLocalCopy`](./keeping-local-copy.mdx).
Expand Down
3 changes: 2 additions & 1 deletion docs/docs/sponsor-only/picker/keeping-local-copy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ return (
destination: 'documentDirectory',
})
if (copyResult.status === 'success') {
// do something
// do something with the local copy:
console.log(copyResult.localUri)
}
} catch (err) {
// see error handling
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/sponsor-only/viewer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ return (
title="view the last imported file"
onPress={() => {
const uriToOpen = 'file:///path/to/your/file'
viewDocument({ uri: uriToOpen }).catch(handleError)
viewDocument({ uri: uriToOpen, mimeType: 'some-mime' }).catch(handleError)
}}
/>
)
Expand Down
25 changes: 12 additions & 13 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ const config: Config = {
[
'classic',
{
gtag: {
trackingID: 'G-V1JZZG12TG',
anonymizeIP: true,
},
docs: {
sidebarPath: './sidebars.ts',
editUrl: 'https://github.com/react-native-documents/document-picker/edit/main/docs',
Expand Down Expand Up @@ -130,13 +126,16 @@ const config: Config = {
],

themeConfig: {
// announcementBar: {
// id: 'announcementBar',
// content:
// '<a target="_blank" href="https://github.com/reactwg/react-native-new-architecture/discussions/154">Bridgeless mode</a> is now available in the premium module!',
// isCloseable: true,
// },
announcementBar: {
id: 'announcementBar',
content:
'Find these packages useful? Say thanks by <a target="_blank" href="https://github.com/sponsors/vonovak">sponsoring</a> the author on GitHub!',
// isCloseable: true,
},
// Replace with your project's social card
colorMode: {
respectPrefersColorScheme: true,
},
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'RN Document picker & viewer',
Expand All @@ -154,12 +153,12 @@ const config: Config = {
{ to: 'docs/doc-picker-api', label: 'Picker API', position: 'left' },
{ to: 'docs/doc-viewer-api', label: 'Viewer API', position: 'left' },
{
to: '/example',
to: 'https://github.com/react-native-documents/document-picker/tree/main/packages/example',
label: 'Example app',
position: 'left',
position: 'right',
},
{
href: '/github-repo',
href: 'https://github.com/react-native-documents/document-picker',
label: 'GitHub',
position: 'right',
},
Expand Down
3 changes: 0 additions & 3 deletions docs/src/pages/example.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/src/pages/github-repo.md

This file was deleted.

Loading