From 37e5050d69b1a6e8be83abc168f4b8a7e2ef3085 Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Mon, 10 Jan 2022 14:55:59 +0100 Subject: [PATCH] Import type from packages Signed-off-by: Louis Chemineau --- .eslintrc.js | 5 +++++ apps/comments/src/activitytabviewplugin.js | 2 ++ apps/comments/src/utils/cancelableRequest.js | 2 +- core/src/OC/legacy-loader.js | 1 + core/src/OC/menu.js | 1 + core/src/OC/notification.js | 3 ++- core/src/OCP/appconfig.js | 1 - core/src/services/UnifiedSearchService.js | 4 ++-- dist/comments-comments-app.js.map | Bin 83692 -> 83708 bytes dist/comments-comments.js.map | Bin 18299 -> 18344 bytes dist/core-login.js.map | Bin 403293 -> 403403 bytes dist/core-main.js.map | Bin 468871 -> 468981 bytes dist/core-unified-search.js.map | Bin 98758 -> 98783 bytes 13 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 0de6fac902a..f4333f93d21 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -20,4 +20,9 @@ module.exports = { ignores: ['/^[a-z]+(?:-[a-z]+)*:[a-z]+(?:-[a-z]+)*$/u'], }], }, + settings: { + jsdoc: { + mode: 'typescript', + }, + }, } diff --git a/apps/comments/src/activitytabviewplugin.js b/apps/comments/src/activitytabviewplugin.js index d4590886b2c..fbf65ea16e3 100644 --- a/apps/comments/src/activitytabviewplugin.js +++ b/apps/comments/src/activitytabviewplugin.js @@ -21,6 +21,8 @@ * */ +/** @typedef {import('jquery')} jQuery */ + (function() { OCA.Comments.ActivityTabViewPlugin = { diff --git a/apps/comments/src/utils/cancelableRequest.js b/apps/comments/src/utils/cancelableRequest.js index 1b9b33c37dc..7e956d6cfc3 100644 --- a/apps/comments/src/utils/cancelableRequest.js +++ b/apps/comments/src/utils/cancelableRequest.js @@ -25,7 +25,7 @@ import axios from '@nextcloud/axios' /** * Create a cancel token * - * @return {CancelTokenSource} + * @return {import('axios').CancelTokenSource} */ const createCancelToken = () => axios.CancelToken.source() diff --git a/core/src/OC/legacy-loader.js b/core/src/OC/legacy-loader.js index 07efbef0fc6..66687cf4de9 100644 --- a/core/src/OC/legacy-loader.js +++ b/core/src/OC/legacy-loader.js @@ -22,6 +22,7 @@ * */ +/** @typedef {import('jquery')} jQuery */ import $ from 'jquery' import { generateFilePath } from '@nextcloud/router' diff --git a/core/src/OC/menu.js b/core/src/OC/menu.js index 9522650c472..74d1b179ea8 100644 --- a/core/src/OC/menu.js +++ b/core/src/OC/menu.js @@ -23,6 +23,7 @@ */ import _ from 'underscore' +/** @typedef {import('jquery')} jQuery */ import $ from 'jquery' import { menuSpeed } from './constants' diff --git a/core/src/OC/notification.js b/core/src/OC/notification.js index 74499d5241b..f8c8feccd3c 100644 --- a/core/src/OC/notification.js +++ b/core/src/OC/notification.js @@ -26,6 +26,7 @@ */ import _ from 'underscore' +/** @typedef {import('jquery')} jQuery */ import $ from 'jquery' import { showMessage, TOAST_DEFAULT_TIMEOUT, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs' @@ -162,7 +163,7 @@ export default { * @param {number} [options.timeout=7] timeout in seconds, if this is 0 it will show the message permanently * @param {boolean} [options.isHTML=false] an indicator for HTML notifications (true) or text (false) * @param {string} [options.type] notification type - * @return {JQuery} the toast element + * @return {JQuery} the toast element * @deprecated 17.0.0 use the `@nextcloud/dialogs` package */ showTemporary(text, options) { diff --git a/core/src/OCP/appconfig.js b/core/src/OCP/appconfig.js index b4062bdf850..600f63581d3 100644 --- a/core/src/OCP/appconfig.js +++ b/core/src/OCP/appconfig.js @@ -33,7 +33,6 @@ import OC from '../OC/index' * @param {object} [options.data] option data * @param {Function} [options.success] success callback * @param {Function} [options.error] error callback - * @internal */ function call(method, endpoint, options) { if ((method === 'post' || method === 'delete') && OC.PasswordConfirmation.requiresPasswordConfirmation()) { diff --git a/core/src/services/UnifiedSearchService.js b/core/src/services/UnifiedSearchService.js index dde36899869..32567ba6377 100644 --- a/core/src/services/UnifiedSearchService.js +++ b/core/src/services/UnifiedSearchService.js @@ -35,14 +35,14 @@ export const regexFilterNot = /-in:([a-z_-]+)/ig /** * Create a cancel token * - * @return {CancelTokenSource} + * @return {import('axios').CancelTokenSource} */ const createCancelToken = () => axios.CancelToken.source() /** * Get the list of available search providers * - * @return {Array} + * @return {Promise} */ export async function getTypes() { try { diff --git a/dist/comments-comments-app.js.map b/dist/comments-comments-app.js.map index b5196f48e7fff7a57a03e7321225ed7b06d46df8..292337c743662f9639db5895a4809ec474424fd7 100644 GIT binary patch delta 31 ncmaFU%lfC6b;JGp0-3o5`9&of>WLMZ`Nis*dYkXx=S>Fy?Ys^A delta 14 Wcmey<%lf95b;JGpo8RB(O$Pu#ItXw8 diff --git a/dist/comments-comments.js.map b/dist/comments-comments.js.map index cab31c188eff508999fde0434e7f82d8301d5a93..fc6b3d607f849a950a5e182e9827da2f77a34a5f 100644 GIT binary patch delta 68 zcmey}$GD=Oal=#&MuW}MIOLg_GF&!q=js$t)7R2ca44xPNKHviQ>f0&Eyyn_(NNDS WEKMz{RM)Ik$O;6pHd{(N=>PyPNf&Pb delta 33 pcmZ3{&-lBKal=#&#`4Y6IOLg_ES)!R=js%g%%dr=xmH?R2LRA#3jY8A diff --git a/dist/core-login.js.map b/dist/core-login.js.map index 75fdde7149ba70dd57704a212f6a89bd24021e72..4a5c4b772c8203b8bcd0ea2a73b2ab57a5445871 100644 GIT binary patch delta 417 zcmcb6PU7@=i48ukj3%3XT@SJ_=56NpQe!PXVLlBXKD)kaxQ?fb_T=@)Co!6Cb~ zy0~Qe>!c=GPQLp$nK6B{<3HwQn)+H=3JxWe1*s{iX$sYuxdr(}B^v5kg{7%QmFk+c z3R!_5mV%c4^bb!NwWo=*2u$zGViw;%WeMX$F4A->Z=bfFalhd9sDq4#YV9+hGj5;x eoas>%X@*Emf0M_=**?dK8Hic7&v9Zs_yhp0<(a4e delta 319 zcmX?oUgGXKi48ukj7FP%T@SJ_=4|HoQeWTPHZFXtL(t)tm+{ zE}8y1sY&{i@BU3@%-rnwk9pa2zAR?;=?|_k3QnK5h?#wR-x5Y4?&~g(R8!b6%IkSx!#<|CX_EYcS(>cE+;p+#HO) zjOnG!W!R>L}OonRha}Alc&oyLz6h(pwveQ58VB&0F(8CPG OEI`bdxGc}8+VGGZ)KIYKX!W&iB~bG1_ew+8`uw+jdX zO#ugJL}e^TL}!;@2>}%dc}QkUEK_1~mwX8Us|hefL^Mt;WnwRvFbV-<0cp3C3IVj^ zm(cqKAD5e)1PYh%v;!x%!|nm$3YRXl10T2U`2oQZ1w3JHc|NzV3j#4F3LrpfZggdG sZeeVP+%W>T+%W^@T9+=g0~nV-&;<*J5RC(e5RC+f5RC=55RC@qn&=Q&bpQYW diff --git a/dist/core-unified-search.js.map b/dist/core-unified-search.js.map index 07bc890db0de3e5abf915c8055e89f14d9b3844c..18cea6f6265449f4399f47761ef7de010d551f68 100644 GIT binary patch delta 54 zcmX@s%yz$-Z9`U|KxS@1eo={rdSXRpezCfy-sG&n*?a*-`MH_JsWy&9MTwPm&0Im- Kxq=w?=mP*f-V^Kq delta 28 kcmccL%yz7qZ9`Vz