diff --git a/src/fullcalendar/eventSources/eventSource.js b/src/fullcalendar/eventSources/eventSource.js index 6f73327704..98e9833662 100644 --- a/src/fullcalendar/eventSources/eventSource.js +++ b/src/fullcalendar/eventSources/eventSource.js @@ -12,7 +12,7 @@ import { eventSourceFunction } from './eventSourceFunction.js' /** * Returns a function to generate a FullCalendar event-source based on the Vuex calendar model * - * @return {function(*=): {backgroundColor: *, borderColor: *, className: *, id: *, textColor: *, events: events}} + * @return {(calendar: object) => {id: string, backgroundColor: string, borderColor: string, editable?: boolean, events: (info: {start: Date, end: Date, timeZone: string}, successCallback: (events: object[]) => void, failureCallback: (error: Error) => void) => Promise}} */ export default function() { const fetchedTimeRangesStore = useFetchedTimeRangesStore() diff --git a/src/fullcalendar/interaction/eventClick.js b/src/fullcalendar/interaction/eventClick.js index c2e1cb4f25..1b25d7eebf 100644 --- a/src/fullcalendar/interaction/eventClick.js +++ b/src/fullcalendar/interaction/eventClick.js @@ -23,7 +23,7 @@ import { errorCatchAsync } from '../utils/errors.js' * @param {Window} window The window object * @param {boolean} isWidget Whether the calendar is embedded in a widget * @param {object} ref The ref object of CalendarGrid component - * @return {Function} + * @return {(info: {event: EventDef}) => Promise} */ export default function(router, route, window, isWidget = false, ref = undefined) { const widgetStore = useWidgetStore() diff --git a/src/fullcalendar/interaction/eventDrop.js b/src/fullcalendar/interaction/eventDrop.js index 5b059f4b82..f46c14b6c2 100644 --- a/src/fullcalendar/interaction/eventDrop.js +++ b/src/fullcalendar/interaction/eventDrop.js @@ -18,7 +18,7 @@ import { errorCatchAsync } from '../utils/errors.js' * Returns a function to drop an event at a different position * * @param {object} fcAPI The fullcalendar api - * @return {Function} + * @return {(info: {event: EventDef, delta: object, revert: () => void}) => Promise} */ export default function(fcAPI) { const calendarsStore = useCalendarsStore() diff --git a/src/fullcalendar/interaction/eventResize.js b/src/fullcalendar/interaction/eventResize.js index 739479029a..9b209447a7 100644 --- a/src/fullcalendar/interaction/eventResize.js +++ b/src/fullcalendar/interaction/eventResize.js @@ -12,7 +12,7 @@ import logger from '@/utils/logger.js' /** * Returns a function to resize an event * - * @return {Function} + * @return {(info: {event: EventDef, startDelta: object, endDelta: object, revert: () => void}) => Promise} */ export default function() { const calendarsStore = useCalendarsStore() diff --git a/src/fullcalendar/interaction/select.js b/src/fullcalendar/interaction/select.js index 1d3666afde..298e21b78c 100644 --- a/src/fullcalendar/interaction/select.js +++ b/src/fullcalendar/interaction/select.js @@ -14,7 +14,7 @@ import { errorCatch } from '../utils/errors.js' * @param {object} router The Vue router * @param {object} route The Vue route * @param {Window} window The window object - * @return {Function} + * @return {(info: {start: Date, end: Date, allDay: boolean}) => void} */ export default function(router, route, window) { const settingsStore = useSettingsStore() diff --git a/src/fullcalendar/utils/errors.js b/src/fullcalendar/utils/errors.js index f8294167d0..b2d9171d20 100644 --- a/src/fullcalendar/utils/errors.js +++ b/src/fullcalendar/utils/errors.js @@ -8,10 +8,11 @@ import logger from '@/utils/logger.js' /** * Wraps a FullCalendar hook function with error logging * - * @param {Function} hookFn The hook function to wrap + * @template {(...args: unknown[]) => unknown} T + * @param {T} hookFn The hook function to wrap * @param {string} hookName The name of the hook for logging - * @param {*} [defaultReturn] The default return value if the hook throws an error - * @return {Function} The wrapped hook function + * @param {ReturnType} [defaultReturn] The default return value if the hook throws an error + * @return {T} The wrapped hook function */ export function errorCatch(hookFn, hookName, defaultReturn = undefined) { return function(...args) { @@ -27,9 +28,10 @@ export function errorCatch(hookFn, hookName, defaultReturn = undefined) { /** * Wraps an async FullCalendar hook function with error logging * - * @param {Function} hookFn The async hook function to wrap + * @template {(...args: unknown[]) => unknown} T + * @param {T} hookFn The async hook function to wrap * @param {string} hookName The name of the hook for logging - * @return {Function} The wrapped async hook function + * @return {(...args: Parameters) => Promise>|undefined>} The wrapped async hook function */ export function errorCatchAsync(hookFn, hookName) { return async function(...args) { diff --git a/src/mixins/EditorMixin.js b/src/mixins/EditorMixin.js index 71e4eb68ef..1b1a4c9615 100644 --- a/src/mixins/EditorMixin.js +++ b/src/mixins/EditorMixin.js @@ -156,7 +156,7 @@ export default { * Returns the color of the calendar selected by the user * This is used to color illustration * - * @return {string|*} + * @return {string} */ selectedCalendarColor() { if (!this.selectedCalendar) { @@ -939,7 +939,7 @@ export default { * * @param {object} to The route to navigate to * @param {object} from The route coming from - * @param {Function} next Function to be called when ready to load the next view + * @param {(vm?: object) => void} next Function to be called when ready to load the next view */ async beforeRouteEnter(to, from, next) { if (to.name === 'NewFullView' || to.name === 'NewPopoverView') { @@ -1014,7 +1014,7 @@ export default { * * @param {object} to The route to navigate to * @param {object} from The route coming from - * @param {Function} next Function to be called when ready to load the next view + * @param {(vm?: object) => void} next Function to be called when ready to load the next view */ async beforeRouteUpdate(to, from, next) { // If we are in the New Event dialog, we want to update the selected time @@ -1092,7 +1092,7 @@ export default { * * @param {object} to The route to navigate to * @param {object} from The route coming from - * @param {Function} next Function to be called when ready to load the next view + * @param {(vm?: object) => void} next Function to be called when ready to load the next view */ async beforeRouteLeave(to, from, next) { // requiresActionOnRouteLeave is false when an action like deleting / saving / cancelling was already taken. diff --git a/src/models/principal.js b/src/models/principal.js index e9e053c467..dda4bdeb86 100644 --- a/src/models/principal.js +++ b/src/models/principal.js @@ -16,7 +16,7 @@ import { mapDavToRoomPrincipalProperties } from '@/models/principal/principal' * Creates a complete principal-object based on given props * * @param {object} props Principal-props already provided - * @return {any} + * @return {object} */ function getDefaultPrincipalObject(props) { return { // Id of the principal diff --git a/src/models/rfcProps.js b/src/models/rfcProps.js index f6635d051d..51758400dc 100644 --- a/src/models/rfcProps.js +++ b/src/models/rfcProps.js @@ -8,7 +8,15 @@ import { getDefaultCategories } from '../defaults/defaultCategories.js' /** * Gets all supported RFC properties * - * @return {{color: {readableName: *, icon: string, multiple: boolean, info: *}, timeTransparency: {readableName: *, defaultValue: string, icon: string, multiple: boolean, options: *[], info: *}, description: {readableName: *, icon: string, placeholder: *, defaultNumberOfRows: number}, location: {readableName: *, icon: string, placeholder: *}, categories: {readableName: *, icon: string, multiple: boolean, options: *, tagPlaceholder: *, placeholder: *, info: *}, accessClass: {readableName: *, defaultValue: string, icon: string, options: *[], multiple: boolean, info: *}, status: {readableName: *, defaultValue: string, icon: string, options: *[], multiple: boolean, info: *}}} + * @return {{ + * accessClass: {readableName: string, icon: string, options: {value: string, label: string}[], multiple: boolean, info: string, defaultValue: string}, + * location: {readableName: string, placeholder: string, icon: string}, + * description: {readableName: string, placeholder: string, icon: string, defaultNumberOfRows: number}, + * status: {readableName: string, icon: string, options: {value: string, label: string}[], multiple: boolean, info: string, defaultValue: string}, + * timeTransparency: {readableName: string, icon: string, multiple: boolean, info: string, options: {value: string, label: string}[], defaultValue: string}, + * categories: {readableName: string, icon: string, multiple: boolean, info: string, placeholder: string, tagPlaceholder: string, options: {value: string, label: string}[]}, + * color: {readableName: string, icon: string, multiple: boolean, info: string}, + * }} */ function getRFCProperties() { return { diff --git a/src/models/schedulingObject.js b/src/models/schedulingObject.js index 18ae380373..5ae16afe47 100644 --- a/src/models/schedulingObject.js +++ b/src/models/schedulingObject.js @@ -152,7 +152,7 @@ function mapCalendarJsToSchedulingObject(calendarComponent) { * Extracts the first object from the calendar-component * * @param {CalendarComponent} calendarComponent The calendar-component - * @return {any} First VEvent / VJournal / VTodo / VFreeBusy + * @return {object|undefined} First VEvent / VJournal / VTodo / VFreeBusy */ function getFirstObjectFromCalendarComponent(calendarComponent) { const vObjectIterator = calendarComponent.getVObjectIterator() diff --git a/src/services/attachmentService.js b/src/services/attachmentService.js index 3e81c89a7e..8391c2cd97 100644 --- a/src/services/attachmentService.js +++ b/src/services/attachmentService.js @@ -43,7 +43,7 @@ async function shareFile(path) { * @param {string} path The file path from the user's root directory. e.g. `/myfile.txt` * @param {string} sharedWith The user id to share the file with * @param {number} permissions The share permissions bitmask - * @return {Promise<[{path: string, permissions, scope: string, name: string, backend: string, type: string},{path: string, permissions: *, scope: string, name: string, backend: string, type: string}]>} + * @return {Promise<{path: string, permissions: number, scope: string, name: string, backend: string, type: string}>} */ async function shareFileWith(path, sharedWith, permissions = 17) { try { diff --git a/src/utils/alarms.js b/src/utils/alarms.js index 5e7e0fbadc..8c4bfbb102 100644 --- a/src/utils/alarms.js +++ b/src/utils/alarms.js @@ -105,7 +105,7 @@ export function getTotalSecondsFromAmountAndUnitForTimedEvents(amount, unit, isB * Gets the amount of days / weeks, unit, hours and minutes from total seconds * * @param {number} totalSeconds Total amount of seconds - * @return {{amount: *, unit: *, hours: *, minutes: *}} + * @return {{amount: number, unit: string, hours: number, minutes: number}} */ export function getAmountHoursMinutesAndUnitForAllDayEvents(totalSeconds) { const dayFactor = getFactorForAlarmUnit('days') diff --git a/src/utils/color.js b/src/utils/color.js index ec11991a88..976c0618e8 100644 --- a/src/utils/color.js +++ b/src/utils/color.js @@ -73,7 +73,7 @@ export function uidToHexColor(uid) { * Detects a color from a given string * * @param {string} color The color to get the real RGB hex string from - * @return {string|boolean|*} String if color detected, boolean if not + * @return {string|boolean} String if color detected, boolean if not */ export function detectColor(color) { if (/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/.test(color)) { // #ff00ff and #f0f