Skip to content

Commit 0ad2b37

Browse files
author
Rad Azzouz
committed
Update API documentation
1 parent f3dc9a5 commit 0ad2b37

File tree

2 files changed

+41
-37
lines changed

2 files changed

+41
-37
lines changed

index.js

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -315,16 +315,16 @@ class PSPDFKitView extends React.Component {
315315
);
316316
}
317317
};
318-
/**
319-
* Set the left bar button items for the spcified view mode
320-
* Note: The same button item cannot be added to both the left and right bar button items simultaneously.
321-
*
322-
* @param items The list of bar button items. See the full list of button items here: https://pspdfkit.com/api/ios/Classes/PSPDFViewController.html#/Toolbar%20button%20items
323-
* @param viewMode The optional view mode. Can be 'document', 'thumbnails', 'documentEditor' or null.
324-
* @param animated The animated flag.
325-
*
326-
* @platform ios
327-
*/
318+
/**
319+
* Set the left bar button items for the spcified view mode.
320+
* Note: The same button item cannot be added to both the left and right bar button items simultaneously.
321+
*
322+
* @param items The list of bar button items. See the full list of button items here: https://pspdfkit.com/api/ios/Classes/PSPDFViewController.html#/Toolbar%20button%20items
323+
* @param viewMode The optional view mode. Can be 'document', 'thumbnails', 'documentEditor' or null. If `null` is passed, we set the bar button items for all view modes.
324+
* @param animated The animated flag.
325+
*
326+
* @platform ios
327+
*/
328328
setLeftBarButtonItems = function(items, viewMode, animated) {
329329
if (Platform.OS === "ios") {
330330
NativeModules.PSPDFKitViewManager.setLeftBarButtonItems(
@@ -335,13 +335,15 @@ class PSPDFKitView extends React.Component {
335335
);
336336
}
337337
};
338-
/**
339-
* Get the left bar button items for the spcified view mode
340-
*
341-
* @param viewMode The optional view mode. Can be 'document', 'thumbnails', 'documentEditor' or null.
342-
*
343-
* @platform ios
344-
*/
338+
/**
339+
* Get the left bar button items for the spcified view mode.
340+
*
341+
* @param viewMode The optional view mode. Can be 'document', 'thumbnails', 'documentEditor' or null. If `null` is passed, we default to the current view mode.
342+
*
343+
* Returns a promise resolving an array with the following structure:
344+
* ['outlineButtonItem', 'searchButtonItem'] or a dictionary with the following error {'error' : 'Failed to get the left bar button items.'}
345+
* @platform ios
346+
*/
345347
getLeftBarButtonItemsForViewMode = function(viewMode) {
346348
if (Platform.OS === "ios") {
347349
return NativeModules.PSPDFKitViewManager.getLeftBarButtonItemsForViewMode(
@@ -350,16 +352,16 @@ class PSPDFKitView extends React.Component {
350352
);
351353
}
352354
};
353-
/**
354-
* Set the right bar button items for the spcified view mode
355-
* Note: The same button item cannot be added to both the left and right bar button items simultaneously.
356-
*
357-
* @param items The list of bar button items. See the full list of button items here: https://pspdfkit.com/api/ios/Classes/PSPDFViewController.html#/Toolbar%20button%20items
358-
* @param viewMode The optional view mode. Can be 'document', 'thumbnails', 'documentEditor' or null.
359-
* @param animated The animated flag.
360-
*
361-
* @platform ios
362-
*/
355+
/**
356+
* Set the right bar button items for the spcified view mode.
357+
* Note: The same button item cannot be added to both the left and right bar button items simultaneously.
358+
*
359+
* @param items The list of bar button items. See the full list of button items here: https://pspdfkit.com/api/ios/Classes/PSPDFViewController.html#/Toolbar%20button%20items
360+
* @param viewMode The optional view mode. Can be 'document', 'thumbnails', 'documentEditor' or null. If `null` is passed, we set the bar button items for all view modes.
361+
* @param animated The animated flag.
362+
*
363+
* @platform ios
364+
*/
363365
setRightBarButtonItems = function(items, viewMode, animated) {
364366
if (Platform.OS === "ios") {
365367
NativeModules.PSPDFKitViewManager.setRightBarButtonItems(
@@ -370,13 +372,15 @@ class PSPDFKitView extends React.Component {
370372
);
371373
}
372374
};
373-
/**
374-
* Get the right bar button items for the spcified view mode
375-
*
376-
* @param viewMode The optional view mode. Can be 'document', 'thumbnails', 'documentEditor' or null.
377-
*
378-
* @platform ios
379-
*/
375+
/**
376+
* Get the right bar button items for the spcified view mode.
377+
*
378+
* @param viewMode The optional view mode. Can be 'document', 'thumbnails', 'documentEditor' or null. If `null` is passed, we default to the current view mode.
379+
*
380+
* Returns a promise resolving an array with the following structure:
381+
* ['annotationButtonItem', 'documentEditorButtonItem'] or a dictionary with the following error {'error' : 'Failed to get the right bar button items.'}
382+
* @platform ios
383+
*/
380384
getRightBarButtonItemsForViewMode = function(viewMode) {
381385
if (Platform.OS === "ios") {
382386
return NativeModules.PSPDFKitViewManager.getRightBarButtonItemsForViewMode(
@@ -505,7 +509,7 @@ PSPDFKitView.propTypes = {
505509
*/
506510
leftBarButtonItems: PropTypes.array,
507511
/**
508-
* leftBarButtonItems: Can be used to specfiy an array of the right button items.
512+
* rightBarButtonItems: Can be used to specfiy an array of the right button items.
509513
* Note: The same button item cannot be added to both the left and right bar button items simultaneously.
510514
* The full list of button items: https://pspdfkit.com/api/ios/Classes/PSPDFViewController.html#/Toolbar%20button%20items
511515
*

samples/Catalog/Catalog.ios.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ class ToolbarCustomization extends Component {
934934
false
935935
);
936936
}}
937-
title="Update right bar button items for document view mode"
937+
title="Set right bar button items"
938938
/>
939939
</View>
940940

@@ -947,7 +947,7 @@ class ToolbarCustomization extends Component {
947947
);
948948
alert(JSON.stringify(rightBarButtonItems));
949949
}}
950-
title="Get right bar button items for document view mode"
950+
title="Get right bar button items"
951951
/>
952952
</View>
953953
</View>

0 commit comments

Comments
 (0)