Skip to content

Commit

Permalink
fix: some JSDoc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald committed Jan 10, 2024
1 parent 594f870 commit 2e56b14
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/analytics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ export {
} from './interface.js';
export { default as SegmentAnalyticsService } from './SegmentAnalyticsService.js';
export { default as MockAnalyticsService } from './MockAnalyticsService.js';

// Export types too - required for interfaces to be documented by TypeDoc:
/** @typedef {import('./interface.js').AnalyticsService} AnalyticsService */
/** @typedef {import('./interface.js').AnalyticsServiceConstructor} AnalyticsServiceConstructor */
/** @typedef {import('./interface.js').AnalyticsServiceOptions} AnalyticsServiceOptions */
6 changes: 6 additions & 0 deletions src/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ export {
} from './interface.js';
export { default as AxiosJwtAuthService } from './AxiosJwtAuthService.js';
export { default as MockAuthService } from './MockAuthService.js';

// Export types too - required for interfaces to be documented by TypeDoc:
/** @typedef {import('./interface.js').AuthService} AuthService */
/** @typedef {import('./interface.js').AuthServiceConstructor} AuthServiceConstructor */
/** @typedef {import('./interface.js').AuthServiceOptions} AuthServiceOptions */
/** @typedef {import('./interface.js').UserData} UserData */
4 changes: 4 additions & 0 deletions src/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,7 @@ export {
getLanguageList,
getLanguageMessages,
} from './languages.js';

// Export types too - required for interfaces to be documented by TypeDoc:
/** @typedef {import('./lib.js').Messages} Messages */
/** @typedef {import('./lib.js').MessagesByLocale} MessagesByLocale */
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ export {
initializeMockApp,
mockMessages,
} from './testing/index.js';

// Export types too - required for interfaces to be documented by TypeDoc:
/** @typedef {import('./config.js').ConfigDocument} ConfigDocument */
2 changes: 2 additions & 0 deletions src/logging/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ export {
export { default as NewRelicLoggingService } from './NewRelicLoggingService.js';
export { default as MockLoggingService } from './MockLoggingService.js';

// Export types too - required for interfaces to be documented by TypeDoc:
/** @typedef {import('./interface.js').LoggingService} LoggingService */
/** @typedef {import('./interface.js').LoggingServiceConstructor} LoggingServiceConstructor */
6 changes: 3 additions & 3 deletions src/react/AppContext.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

/**
* @typedef {Object} AppContext
* @typedef IAppContext
* @property {import('../auth/interface.js').UserData|null} authenticatedUser
* @property {import('../config.js').ConfigDocument} config
* @property {string} locale
Expand All @@ -20,10 +20,10 @@ import React from 'react';
* If the `App.authenticatedUser` or `App.config` data changes, `AppContext` will be updated
* accordingly and pass those changes onto React components using the context.
*
* `AppContext` is used in a React application like any other `[React Context](https://reactjs.org/docs/context.html)
* `AppContext` is used in a React application like any other [React Context](https://reactjs.org/docs/context.html)
* @memberof module:React
*/
const AppContext = React.createContext(/** @type {AppContext} */ ({
const AppContext = React.createContext(/** @type {IAppContext} */ ({
authenticatedUser: null,
config: {},
locale: '',
Expand Down
3 changes: 3 additions & 0 deletions src/react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ export { default as ErrorPage } from './ErrorPage.jsx';
export { default as LoginRedirect } from './LoginRedirect.jsx';
export { default as PageWrap } from './PageWrap.jsx';
export { useAppEvent } from './hooks.js';

// Export types too - required for interfaces to be documented by TypeDoc:
/** @typedef {import('./AppContext.js').IAppContext} IAppContext */

0 comments on commit 2e56b14

Please sign in to comment.