Skip to content

Commit

Permalink
Merge pull request #4484 from WiXSL/fix-jsdocs
Browse files Browse the repository at this point in the history
Fix some jsDocs definitions.
  • Loading branch information
djhi authored Mar 9, 2020
2 parents 94b0828 + 8350b11 commit 3d16941
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/ra-core/src/auth/useLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const useLogin = (): Login => {
/**
* Log a user in by calling the authProvider.login() method
*
* @param {object} params Login parameters to pass to the authProvider. May contain username/email, password, etc
* @param {Object} params Login parameters to pass to the authProvider. May contain username/email, password, etc
* @param {string} pathName The path to redirect to after login. By default, redirects to the home page, or to the last page visited after deconnexion.
*
* @return {Promise} The authProvider response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const defaultFilter = {};
* @param {string} option.basePath basepath to current resource
* @param {number} option.page the page number
* @param {number} option.perPage the number of item per page
* @param {object} option.sort the sort to apply to the referenced records
* @param {Object} option.sort the sort to apply to the referenced records
*
* @returns {ReferenceManyProps} The reference many props
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/controller/useListParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export const parseQueryFromLocation = ({ search }) => {
* To check if the user has custom params, we must compare the params
* to these initial values.
*
* @param {object} params
* @param {Object} params
*/
export const hasCustomParams = (params: ListParams) => {
return (
Expand Down
6 changes: 3 additions & 3 deletions packages/ra-core/src/controller/usePaginationState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { Pagination } from '../types';
* @type {Object}
* @property {number} page: The page number.
* @property {number} perPage: The number of item per page.
* @property {function} setPage: Set the page number
* @property {function} setPerPage: Set the per page number
* @property {function} setPagination: Set page and perPage pagination numbers
* @property {Function} setPage: Set the page number
* @property {Function} setPerPage: Set the per page number
* @property {Function} setPagination: Set page and perPage pagination numbers
*/
export interface PaginationProps {
page: number;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/controller/useSortState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const defaultSort = { field: 'id', order: 'DESC' };
* @typedef SortProps
* @type {Object}
* @property {Object} sort: the sort object.
* @property {String} sort.field: the sort object.
* @property {string} sort.field: the sort object.
* @property {'ASC' | 'DESC'} sort.order: the sort object.
* @property {setSort} setSort
* @property {setSortField} setSortField
Expand Down
4 changes: 2 additions & 2 deletions packages/ra-core/src/dataProvider/useQueryWithStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ const defaultTotalSelector = () => null;
* @param {string} options.action Redux action type
* @param {Function} options.onSuccess Side effect function to be executed upon success of failure, e.g. { onSuccess: response => refresh() } }
* @param {Function} options.onFailure Side effect function to be executed upon failure, e.g. { onFailure: error => notify(error.message) } }
* @param {function} dataSelector Redux selector to get the result. Required.
* @param {function} totalSelector Redux selector to get the total (optional, only for LIST queries)
* @param {Function} dataSelector Redux selector to get the result. Required.
* @param {Function} totalSelector Redux selector to get the total (optional, only for LIST queries)
*
* @returns The current request state. Destructure as { data, total, error, loading, loaded }.
*
Expand Down
8 changes: 4 additions & 4 deletions packages/ra-core/src/form/FormWithRedirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import FormContext from './FormContext';
* />
* );
*
* @typedef {object} Props the props you can use (other props are injected by Create or Edit)
* @prop {object} initialValues
* @prop {function} validate
* @prop {function} save
* @typedef {Object} Props the props you can use (other props are injected by Create or Edit)
* @prop {Object} initialValues
* @prop {Function} validate
* @prop {Function} save
* @prop {boolean} submitOnEnter
* @prop {string} redirect
*
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/i18n/TranslationUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface AllNavigatorLanguage extends NavigatorLanguage {
* </Admin>
* );
*
* @param {String} defaultLocale Defaults to 'en'
* @param {string} defaultLocale Defaults to 'en'
*/
export const resolveBrowserLocale = (defaultLocale = DEFAULT_LOCALE) => {
// from http://blog.ksol.fr/user-locale-detection-browser-javascript/
Expand Down
4 changes: 2 additions & 2 deletions packages/ra-core/src/inference/inferElementFromValues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ const hasType = (type, types) => typeof types[type] !== 'undefined';
* );
* // null
*
* @param {String} name Property name, e.g. 'date_of_birth'
* @param {[mixed]} values an array of values from which to determine the type, e.g. [12, 34.4, 43]
* @param {string} name Property name, e.g. 'date_of_birth'
* @param {any[]} values an array of values from which to determine the type, e.g. [12, 34.4, 43]
* @param {Object} types A set of components indexed by type. The string type is the only required one
*
* @return InferredElement
Expand Down
6 changes: 3 additions & 3 deletions packages/ra-ui-materialui/src/form/SimpleForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import CardContentInner from '../layout/CardContentInner';
* </Create>
* );
*
* @typedef {object} Props the props you can use (other props are injected by Create or Edit)
* @typedef {Object} Props the props you can use (other props are injected by Create or Edit)
* @prop {ReactElement[]} children Input elements
* @prop {object} initialValues
* @prop {function} validate
* @prop {Object} initialValues
* @prop {Function} validate
* @prop {boolean} submitOnEnter
* @prop {string} redirect
* @prop {ReactElement} toolbar The element displayed at the bottom of the form, contzining the SaveButton
Expand Down
6 changes: 3 additions & 3 deletions packages/ra-ui-materialui/src/form/TabbedForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ import TabbedFormTabs, { getTabFullPath } from './TabbedFormTabs';
* </Edit>
* );
*
* @typedef {object} Props the props you can use (other props are injected by Create or Edit)
* @typedef {Object} Props the props you can use (other props are injected by Create or Edit)
* @prop {ReactElement[]} FormTab elements
* @prop {object} initialValues
* @prop {function} validate
* @prop {Object} initialValues
* @prop {Function} validate
* @prop {boolean} submitOnEnter
* @prop {string} redirect
* @prop {ReactElement} toolbar The element displayed at the bottom of the form, contzining the SaveButton
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/layout/LinearProgress.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const useStyles = makeStyles(
* @see ReferenceField
* @see ReferenceInput
*
* @param {object} classes CSS class names
* @param {Object} classes CSS class names
*/
const LinearProgress = props => {
const { classes: classesOverride, className, ...rest } = props;
Expand Down

0 comments on commit 3d16941

Please sign in to comment.