]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/friends.ts
Remove any typing from server
[github/Chocobozzz/PeerTube.git] / server / lib / friends.ts
index 4d56e9eb22a9fd72611e1ec8955a95d40ad2a532..a658201913d9a080c1e34b097d25f7a08b5c8f26 100644 (file)
@@ -38,7 +38,9 @@ import {
   RemoteVideoCreateData,
   RemoteVideoUpdateData,
   RemoteVideoRemoveData,
-  RemoteVideoReportAbuseData
+  RemoteVideoReportAbuseData,
+  ResultList,
+  Pod as FormatedPod
 } from '../../shared'
 
 type QaduParam = { videoId: string, type: RequestVideoQaduType }
@@ -268,8 +270,8 @@ export {
 
 function computeForeignPodsList (host: string, podsScore: { [ host: string ]: number }) {
   // TODO: type res
-  return getForeignPodsList(host).then((res: any) => {
-    const foreignPodsList = res.data
+  return getForeignPodsList(host).then(res => {
+    const foreignPodsList: { host: string }[] = res.data
 
     // Let's give 1 point to the pod we ask the friends list
     foreignPodsList.push({ host })
@@ -302,7 +304,7 @@ function computeWinningPods (hosts: string[], podsScore: { [ host: string ]: num
 }
 
 function getForeignPodsList (host: string) {
-  return new Promise((res, rej) => {
+  return new Promise< ResultList<FormatedPod> >((res, rej) => {
     const path = '/api/' + API_VERSION + '/pods'
 
     request.get(REMOTE_SCHEME.HTTP + '://' + host + path, function (err, response, body) {