ActivityPub-federated video streaming platform using P2P directly in your web browser
NoImplicitAny flag true (#1157)
BO41244b4ae3973b
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.tsindex 25b303f44f..9a9298825f 100644--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts@@ -62,7 +62,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {}ngOnInit () {- const formGroupData = {+ const formGroupData: any = {instanceName: this.customConfigValidatorsService.INSTANCE_NAME,instanceShortDescription: this.customConfigValidatorsService.INSTANCE_SHORT_DESCRIPTION,instanceDescription: null,@@ -202,7 +202,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {}private updateForm () {- const data = {+ const data: any = {instanceName: this.customConfig.instance.name,instanceShortDescription: this.customConfig.instance.shortDescription,instanceDescription: this.customConfig.instance.description,diff --git a/client/src/app/+admin/users/user-edit/user-edit.ts b/client/src/app/+admin/users/user-edit/user-edit.tsindex 99ce5804b7..a4d696e699 100644--- a/client/src/app/+admin/users/user-edit/user-edit.ts+++ b/client/src/app/+admin/users/user-edit/user-edit.ts@@ -7,7 +7,7 @@ export abstract class UserEdit extends FormReactive {videoQuotaOptions: { value: string, label: string }[] = []videoQuotaDailyOptions: { value: string, label: string }[] = []- roles = Object.keys(USER_ROLE_LABELS).map(key => ({ value: key.toString(), label: USER_ROLE_LABELS[key] }))+ roles = Object.keys(USER_ROLE_LABELS).map((key: any) => ({ value: key.toString(), label: USER_ROLE_LABELS[key] }))protected abstract serverService: ServerServiceprotected abstract configService: ConfigServicediff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/users/user-list/user-list.component.tsindex ab22507223..0d7f88d2ba 100644--- a/client/src/app/+admin/users/user-list/user-list.component.ts+++ b/client/src/app/+admin/users/user-list/user-list.component.ts@@ -45,12 +45,12 @@ export class UserListComponent extends RestTable implements OnInit {{label: this.i18n('Ban'),handler: users => this.openBanUserModal(users),- isDisplayed: users => users.every(u => u.blocked === false)+ isDisplayed: users => users.every((u: any) => u.blocked === false)},{label: this.i18n('Unban'),handler: users => this.unbanUsers(users),- isDisplayed: users => users.every(u => u.blocked === true)+ isDisplayed: users => users.every((u: any) => u.blocked === true)}]}diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.tsindex 56697030be..f2b8a4e26f 100644--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts+++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts@@ -17,7 +17,7 @@ import { VideoChannelValidatorsService } from '@app/shared/forms/form-validatorsstyleUrls: [ './my-account-video-channel-edit.component.scss' ]})export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelEdit implements OnInit, OnDestroy {- @ViewChild('avatarfileInput') avatarfileInput+ @ViewChild('avatarfileInput') avatarfileInput: anyerror: stringdiff --git a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts b/client/src/app/+my-account/my-account-videos/my-account-videos.component.tsindex 7560f01289..52307f09e7 100644--- a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts+++ b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts@@ -66,7 +66,7 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni}isInSelectionMode () {- return Object.keys(this.checkedVideos).some(k => this.checkedVideos[ k ] === true)+ return Object.keys(this.checkedVideos).some((k: any) => this.checkedVideos[ k ] === true)}getVideosObservable (page: number) {@@ -81,7 +81,7 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIniasync deleteSelectedVideos () {const toDeleteVideosIds = Object.keys(this.checkedVideos)- .filter(k => this.checkedVideos[ k ] === true)+ .filter((k: any) => this.checkedVideos[ k ] === true).map(k => parseInt(k, 10))const res = await this.confirmService.confirm(@@ -168,9 +168,10 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni}private spliceVideosById (id: number) {- for (const key of Object.keys(this.loadedPages)) {+ let key: any+ for (key of Object.keys(this.loadedPages)) {const videos = this.loadedPages[ key ]- const index = videos.findIndex(v => v.id === id)+ const index = videos.findIndex((v: any) => v.id === id)if (index !== -1) {videos.splice(index, 1)diff --git a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.tsindex 7437b939ad..eb3f9404f8 100644--- a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts+++ b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts@@ -49,7 +49,8 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni.catch((_) => _) // Called when closing (cancel) the modal without validating, do nothing}- search (event) {+ // TODO: typing+ search (event: any) {const query = event.querythis.userService.autocomplete(query).subscribe(diff --git a/client/src/app/+my-account/shared/actor-avatar-info.component.ts b/client/src/app/+my-account/shared/actor-avatar-info.component.tsindex 7b80b1ed43..b4505a7f28 100644--- a/client/src/app/+my-account/shared/actor-avatar-info.component.ts+++ b/client/src/app/+my-account/shared/actor-avatar-info.component.ts@@ -10,7 +10,7 @@ import { Account } from '@app/shared/account/account.model'styleUrls: [ './actor-avatar-info.component.scss' ]})export class ActorAvatarInfoComponent {- @ViewChild('avatarfileInput') avatarfileInput+ @ViewChild('avatarfileInput') avatarfileInput: any@Input() actor: VideoChannel | Accountdiff --git a/client/src/app/app.module.ts b/client/src/app/app.module.tsindex 34e890b40d..3711994422 100644--- a/client/src/app/app.module.ts+++ b/client/src/app/app.module.ts@@ -69,7 +69,7 @@ export function metaFactory (serverService: ServerService): MetaLoader {providers: [{provide: TRANSLATIONS,- useFactory: (locale) => {+ useFactory: (locale: string) => {// On dev mode, test localizationif (isOnDevLocale()) {locale = buildFileLocale(getDevLocale())diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.tsindex 9c36b946e3..5315c8b1d8 100644--- a/client/src/app/core/auth/auth.service.ts+++ b/client/src/app/core/auth/auth.service.ts@@ -221,7 +221,7 @@ export class AuthService {}refreshUserInformation () {- const obj = {+ const obj: any = {access_token: this.user.getAccessToken(),refresh_token: null,token_type: this.user.getTokenType(),diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.tsindex 2f1ef1fc23..1663a052c2 100644--- a/client/src/app/core/server/server.service.ts+++ b/client/src/app/core/server/server.service.ts@@ -155,7 +155,7 @@ export class ServerService {.pipe(switchMap(translations => {return this.http.get(ServerService.BASE_VIDEO_URL + attributeName)- .pipe(map(data => ({ data, translations })))+ .pipe(map((data: any) => ({ data, translations })))})).subscribe(({ data, translations }) => {diff --git a/client/src/app/core/theme/theme.service.ts b/client/src/app/core/theme/theme.service.tsindex a6eef08984..50c19ecac3 100644--- a/client/src/app/core/theme/theme.service.ts+++ b/client/src/app/core/theme/theme.service.ts@@ -5,7 +5,7 @@ import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage'export class ThemeService {private theme = document.querySelector('body')private darkTheme = false- private previousTheme = {}+ private previousTheme: { [ id: string ]: string } = {}constructor () {// initialise the alternative theme with dark theme colors@@ -33,7 +33,7 @@ export class ThemeService {}}- private switchProperty (property, newValue?) {+ private switchProperty (property: string, newValue?: string) {const propertyOldvalue = window.getComputedStyle(this.theme).getPropertyValue('--' + property)this.theme.style.setProperty('--' + property, (newValue) ? newValue : this.previousTheme[property])this.previousTheme[property] = propertyOldvaluediff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.tsindex 95926f5f0d..348700c09f 100644--- a/client/src/app/menu/menu.component.ts+++ b/client/src/app/menu/menu.component.ts@@ -18,7 +18,7 @@ export class MenuComponent implements OnInit {userHasAdminAccess = falsehelpVisible = false- private routesPerRight = {+ private routesPerRight: any = {[UserRight.MANAGE_USERS]: '/admin/users',[UserRight.MANAGE_SERVER_FOLLOW]: '/admin/friends',[UserRight.MANAGE_VIDEO_ABUSES]: '/admin/moderation/video-abuses',diff --git a/client/src/app/search/advanced-search.model.ts b/client/src/app/search/advanced-search.model.tsindex 033fa9bba8..1d6c89282e 100644--- a/client/src/app/search/advanced-search.model.ts+++ b/client/src/app/search/advanced-search.model.ts@@ -53,7 +53,7 @@ export class AdvancedSearch {}containsValues () {- const obj = this.toUrlObject()+ const obj: any = this.toUrlObject()for (const k of Object.keys(obj)) {if (k === 'sort') continue // Exception@@ -113,7 +113,7 @@ export class AdvancedSearch {size () {let acc = 0- const obj = this.toUrlObject()+ const obj: any = this.toUrlObject()for (const k of Object.keys(obj)) {if (k === 'sort') continue // Exceptiondiff --git a/client/src/app/shared/buttons/action-dropdown.component.ts b/client/src/app/shared/buttons/action-dropdown.component.tsindex 022ab5ee81..9877f639dd 100644--- a/client/src/app/shared/buttons/action-dropdown.component.ts+++ b/client/src/app/shared/buttons/action-dropdown.component.ts@@ -2,9 +2,9 @@ import { Component, Input } from '@angular/core'export type DropdownAction<T> = {label?: string- handler?: (T) => any- linkBuilder?: (T) => (string | number)[]- isDisplayed?: (T) => boolean+ handler?: (T: any) => any+ linkBuilder?: (T: any) => (string | number)[]+ isDisplayed?: (T: any) => boolean}@Component({diff --git a/client/src/app/shared/buttons/button.component.ts b/client/src/app/shared/buttons/button.component.tsindex 967cb14097..cccf98bc3a 100644--- a/client/src/app/shared/buttons/button.component.ts+++ b/client/src/app/shared/buttons/button.component.ts@@ -8,9 +8,9 @@ import { Component, Input } from '@angular/core'export class ButtonComponent {@Input() label = ''- @Input() className = undefined- @Input() icon = undefined- @Input() title = undefined+ @Input() className: any = undefined+ @Input() icon: any = undefined+ @Input() title: any = undefinedgetTitle () {return this.title || this.labeldiff --git a/client/src/app/shared/buttons/edit-button.component.ts b/client/src/app/shared/buttons/edit-button.component.tsindex 7abaacc26b..ea552663ac 100644--- a/client/src/app/shared/buttons/edit-button.component.ts+++ b/client/src/app/shared/buttons/edit-button.component.ts@@ -8,5 +8,5 @@ import { Component, Input } from '@angular/core'export class EditButtonComponent {@Input() label: string- @Input() routerLink = []+ @Input() routerLink: any = []}diff --git a/client/src/app/shared/misc/help.component.ts b/client/src/app/shared/misc/help.component.tsindex ba0452e778..ccce1ccfa5 100644--- a/client/src/app/shared/misc/help.component.ts+++ b/client/src/app/shared/misc/help.component.ts@@ -60,7 +60,7 @@ export class HelpComponent implements OnInit, OnChanges {}private createMarkdownList (rules: string[]) {- const rulesToText = {+ const rulesToText: any = {'emphasis': this.i18n('Emphasis'),'link': this.i18n('Links'),'newline': this.i18n('New lines'),diff --git a/client/src/app/shared/misc/peertube-local-storage.ts b/client/src/app/shared/misc/peertube-local-storage.tsindex 260f994b64..fb5c45acf8 100644--- a/client/src/app/shared/misc/peertube-local-storage.ts+++ b/client/src/app/shared/misc/peertube-local-storage.ts@@ -6,7 +6,7 @@ class MemoryStorage {[key: string]: any[index: number]: string- getItem (key) {+ getItem (key: any) {const stringKey = String(key)if (valuesMap.has(key)) {return String(valuesMap.get(stringKey))@@ -15,11 +15,11 @@ class MemoryStorage {return null}- setItem (key, val) {+ setItem (key: any, val: any) {valuesMap.set(String(key), String(val))}- removeItem (key) {+ removeItem (key: any) {valuesMap.delete(key)}diff --git a/client/src/app/shared/misc/utils.ts b/client/src/app/shared/misc/utils.tsindex c8b7ebc67b..78be2e5dda 100644--- a/client/src/app/shared/misc/utils.ts+++ b/client/src/app/shared/misc/utils.ts@@ -102,7 +102,7 @@ function objectToFormData (obj: any, form?: FormData, namespace?: string) {return fd}-function lineFeedToHtml (obj: object, keyToNormalize: string) {+function lineFeedToHtml (obj: any, keyToNormalize: string) {return immutableAssign(obj, {[keyToNormalize]: obj[keyToNormalize].replace(/\r?\n|\r/g, '<br />')})diff --git a/client/src/app/shared/overview/videos-overview.model.ts b/client/src/app/shared/overview/videos-overview.model.tsindex cf02bdb3de..c8eafc8e81 100644--- a/client/src/app/shared/overview/videos-overview.model.ts+++ b/client/src/app/shared/overview/videos-overview.model.ts@@ -16,4 +16,5 @@ export class VideosOverview implements VideosOverviewServer {tag: stringvideos: Video[]}[]+ [key: string]: any}diff --git a/client/src/app/shared/rest/rest-extractor.service.ts b/client/src/app/shared/rest/rest-extractor.service.tsindex 6492aa66de..934f6c618a 100644--- a/client/src/app/shared/rest/rest-extractor.service.ts+++ b/client/src/app/shared/rest/rest-extractor.service.ts@@ -33,7 +33,7 @@ export class RestExtractor {return this.applyToResultListData(result, this.convertDateToHuman, [ fieldsToConvert ])}- convertDateToHuman (target: object, fieldsToConvert: string[]) {+ convertDateToHuman (target: any, fieldsToConvert: string[]) {fieldsToConvert.forEach(field => target[field] = dateToHuman(target[field]))return target@@ -83,7 +83,7 @@ export class RestExtractor {errorMessage = err}- const errorObj = {+ const errorObj: any = {message: errorMessage,status: undefined,body: undefineddiff --git a/client/src/app/shared/rest/rest.service.ts b/client/src/app/shared/rest/rest.service.tsindex 4560c20249..41824a18f8 100644--- a/client/src/app/shared/rest/rest.service.ts+++ b/client/src/app/shared/rest/rest.service.ts@@ -32,7 +32,7 @@ export class RestService {return newParams}- addObjectParams (params: HttpParams, object: object) {+ addObjectParams (params: HttpParams, object: any) {for (const name of Object.keys(object)) {const value = object[name]if (!value) continuediff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.tsindex 7c840ffa70..e6b6120541 100644--- a/client/src/app/shared/users/user.model.ts+++ b/client/src/app/shared/users/user.model.ts@@ -43,6 +43,7 @@ export class User implements UserServerModel {blocked: booleanblockedReason?: string+ [key: string]: anyconstructor (hash: UserConstructorHash) {this.id = hash.iddiff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/video/abstract-video-list.tsindex 1f43f974c3..87814d4ba1 100644--- a/client/src/app/shared/video/abstract-video-list.ts+++ b/client/src/app/shared/video/abstract-video-list.ts@@ -27,7 +27,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {sort: VideoSortField = '-publishedAt'categoryOneOf?: numberdefaultSort: VideoSortField = '-publishedAt'- syndicationItems = []+ syndicationItems: any = []loadOnInit = truemarginContent = true@@ -59,7 +59,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {private resizeSubscription: Subscriptionabstract getVideosObservable (page: number): Observable<{ videos: Video[], totalVideos: number}>- abstract generateSyndicationList ()+ abstract generateSyndicationList (): anyget user () {return this.authService.getUser()@@ -209,7 +209,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {}protected setNewRouteParams () {- const paramsObject = this.buildRouteParams()+ const paramsObject: any = this.buildRouteParams()const queryParams = Object.keys(paramsObject).map(p => p + '=' + paramsObject[p]).join('&')this.location.replaceState(this.currentRoute, queryParams)diff --git a/client/src/app/shared/video/video-edit.model.ts b/client/src/app/shared/video/video-edit.model.tsindex 0046be9645..a62277e045 100644--- a/client/src/app/shared/video/video-edit.model.ts+++ b/client/src/app/shared/video/video-edit.model.ts@@ -25,6 +25,7 @@ export class VideoEdit implements VideoUpdate {uuid?: stringid?: numberscheduleUpdate?: VideoScheduleUpdate+ [key: string]: anyconstructor (video?: Video & { tags: string[], commentsEnabled: boolean, support: string, thumbnailUrl: string, previewUrl: string }) {if (video) {@@ -49,7 +50,7 @@ export class VideoEdit implements VideoUpdate {}}- patch (values: Object) {+ patch (values: any) {Object.keys(values).forEach((key) => {this[ key ] = values[ key ]})diff --git a/client/src/app/shared/video/video-feed.component.ts b/client/src/app/shared/video/video-feed.component.tsindex 6922153c0d..be6c80c3fa 100644--- a/client/src/app/shared/video/video-feed.component.ts+++ b/client/src/app/shared/video/video-feed.component.ts@@ -6,5 +6,5 @@ import { Component, Input } from '@angular/core'templateUrl: './video-feed.component.html'})export class VideoFeedComponent {- @Input() syndicationItems+ @Input() syndicationItems: any}diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/video/video.service.tsindex 724a0bde94..6283cf84d8 100644--- a/client/src/app/shared/video/video.service.ts+++ b/client/src/app/shared/video/video.service.ts@@ -276,7 +276,7 @@ export class VideoService implements VideosProvider {return this.authHttp.get(environment.apiUrl + descriptionPath).pipe(- map(res => res[ 'description' ]),+ map((res: any) => res[ 'description' ]),catchError(err => this.restExtractor.handleError(err)))}diff --git a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.tsindex 07c33030aa..a2c9237ad2 100644--- a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts+++ b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts@@ -19,7 +19,7 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni@ViewChild('modal') modal: ElementRef- videoCaptionLanguages = []+ videoCaptionLanguages: any = []private openedModal: NgbModalRefprivate closingModal = false@@ -73,7 +73,7 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnInithis.hide()const languageId = this.form.value[ 'language' ]- const languageObject = this.videoCaptionLanguages.find(l => l.id === languageId)+ const languageObject = this.videoCaptionLanguages.find((l: any) => l.id === languageId)this.captionAdded.emit({language: languageObject,diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.tsindex eb9396d70b..a56733e575 100644--- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts@@ -48,7 +48,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {calendarTimezone: stringcalendarDateFormat: string- private schedulerInterval+ private schedulerInterval: anyprivate firstPatchDone = falseprivate initialVideoCaptions: string[] = []@@ -77,13 +77,13 @@ export class VideoEditComponent implements OnInit, OnDestroy {}updateForm () {- const defaultValues = {+ const defaultValues: any = {nsfw: 'false',commentsEnabled: 'true',waitTranscoding: 'true',tags: []}- const obj = {+ const obj: any = {name: this.videoValidatorsService.VIDEO_NAME,privacy: this.videoValidatorsService.VIDEO_PRIVACY,channelId: this.videoValidatorsService.VIDEO_CHANNEL,diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.tsindex 0f7184ff8e..9a50e2ab2b 100644--- a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts+++ b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts@@ -23,7 +23,7 @@ import { VideoImportService } from '@app/shared/video-import'})export class VideoImportTorrentComponent extends VideoSend implements OnInit, CanComponentDeactivate {@Output() firstStepDone = new EventEmitter<string>()- @ViewChild('torrentfileInput') torrentfileInput+ @ViewChild('torrentfileInput') torrentfileInput: anyvideoFileName: stringmagnetUri = ''diff --git a/client/src/app/videos/+video-edit/video-add-components/video-send.ts b/client/src/app/videos/+video-edit/video-add-components/video-send.tsindex 6d1bac3f23..cf9d47cbe0 100644--- a/client/src/app/videos/+video-edit/video-add-components/video-send.ts+++ b/client/src/app/videos/+video-edit/video-add-components/video-send.ts@@ -30,7 +30,7 @@ export abstract class VideoSend extends FormReactive implements OnInit, CanCompoprotected videoService: VideoServiceprotected videoCaptionService: VideoCaptionService- abstract canDeactivate ()+ abstract canDeactivate (): anyngOnInit () {this.buildForm({})diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.tsindex 941dc5441e..fa6ee0c23e 100644--- a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts+++ b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts@@ -25,7 +25,7 @@ import { VideoCaptionService } from '@app/shared/video-caption'})export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy, CanComponentDeactivate {@Output() firstStepDone = new EventEmitter<string>()- @ViewChild('videofileInput') videofileInput+ @ViewChild('videofileInput') videofileInput: any// So that it can be accessed in the templatereadonly SPECIAL_SCHEDULED_PRIVACY = VideoEdit.SPECIAL_SCHEDULED_PRIVACYdiff --git a/client/src/app/videos/+video-watch/comment/linkifier.service.ts b/client/src/app/videos/+video-watch/comment/linkifier.service.tsindex 3f4072efd2..9ad419a69b 100644--- a/client/src/app/videos/+video-watch/comment/linkifier.service.ts+++ b/client/src/app/videos/+video-watch/comment/linkifier.service.ts@@ -1,7 +1,7 @@import { Injectable } from '@angular/core'import { getAbsoluteAPIUrl } from '@app/shared/misc/utils'-import * as linkify from 'linkifyjs'-import * as linkifyHtml from 'linkifyjs/html'+const linkify = require('linkifyjs')+const linkifyHtml = require('linkifyjs/html')@Injectable()export class LinkifierService {@@ -40,7 +40,7 @@ export class LinkifierService {const TT_UNDERSCORE = TT.UNDERSCOREconst TT_DOT = TT.DOT- function MENTION (value) {+ function MENTION (value: any) {this.v = value}diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts b/client/src/app/videos/+video-watch/comment/video-comment-add.component.tsindex fb7de0e048..ba3c0398ec 100644--- a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts+++ b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts@@ -76,7 +76,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnInit {this.formValidated()}- openVisitorModal (event) {+ openVisitorModal (event: any) {if (this.user === null) { // we only open it for visitors// fixing ng-bootstrap ModalService and the "Expression Changed After It Has Been Checked" Errorevent.srcElement.blur()diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.ts b/client/src/app/videos/+video-watch/comment/video-comment.component.tsindex e90008de9b..9824707860 100644--- a/client/src/app/videos/+video-watch/comment/video-comment.component.ts+++ b/client/src/app/videos/+video-watch/comment/video-comment.component.ts@@ -26,7 +26,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {@Output() resetReply = new EventEmitter()sanitizedCommentHTML = ''- newParentComments = []+ newParentComments: any = []constructor (private linkifierService: LinkifierService,diff --git a/client/src/app/videos/+video-watch/comment/video-comment.model.ts b/client/src/app/videos/+video-watch/comment/video-comment.model.tsindex fe591811ee..824fb24c30 100644--- a/client/src/app/videos/+video-watch/comment/video-comment.model.ts+++ b/client/src/app/videos/+video-watch/comment/video-comment.model.ts@@ -14,7 +14,7 @@ export class VideoComment implements VideoCommentServerModel {account: AccountInterfacetotalReplies: numberby: string- accountAvatarUrl+ accountAvatarUrl: stringconstructor (hash: VideoCommentServerModel) {this.id = hash.iddiff --git a/client/src/app/videos/+video-watch/comment/video-comment.service.ts b/client/src/app/videos/+video-watch/comment/video-comment.service.tsindex 9bcb4b7de9..7d9c2d0ad8 100644--- a/client/src/app/videos/+video-watch/comment/video-comment.service.ts+++ b/client/src/app/videos/+video-watch/comment/video-comment.service.ts@@ -32,7 +32,7 @@ export class VideoCommentService {return this.authHttp.post(url, normalizedComment).pipe(- map(data => this.extractVideoComment(data['comment'])),+ map((data: any) => this.extractVideoComment(data['comment'])),catchError(err => this.restExtractor.handleError(err)))}@@ -43,7 +43,7 @@ export class VideoCommentService {return this.authHttp.post(url, normalizedComment).pipe(- map(data => this.extractVideoComment(data[ 'comment' ])),+ map((data: any) => this.extractVideoComment(data[ 'comment' ])),catchError(err => this.restExtractor.handleError(err)))}diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.ts b/client/src/app/videos/+video-watch/comment/video-comments.component.tsindex c864d82b70..4c1bdf2dd8 100644--- a/client/src/app/videos/+video-watch/comment/video-comments.component.ts+++ b/client/src/app/videos/+video-watch/comment/video-comments.component.ts@@ -35,7 +35,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {threadComments: { [ id: number ]: VideoCommentThreadTree } = {}threadLoading: { [ id: number ]: boolean } = {}- syndicationItems = []+ syndicationItems: any = []private sub: Subscriptiondiff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.tsindex c5deddf050..ed5e723c93 100644--- a/client/src/app/videos/+video-watch/video-watch.component.ts+++ b/client/src/app/videos/+video-watch/video-watch.component.ts@@ -7,7 +7,7 @@ import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-suppimport { MetaService } from '@ngx-meta/core'import { NotificationsService } from 'angular2-notifications'import { forkJoin, Subscription } from 'rxjs'-import * as videojs from 'video.js'+const videojs = require('video.js')import 'videojs-hotkeys'import { Hotkey, HotkeysService } from 'angular2-hotkeys'import * as WebTorrent from 'webtorrent'@@ -45,7 +45,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {@ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent@ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent- player: videojs.Player+ player: anyplayerElement: HTMLVideoElementuserRating: UserVideoRateType = nullvideo: VideoDetails = null@@ -435,7 +435,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {this.zone.runOutsideAngular(async () => {videojs(this.playerElement, videojsOptions, function () {self.player = this- this.on('customError', (event, data) => self.handleError(data.err))+ this.on('customError', (data: any) => self.handleError(data.err))addContextMenu(self.player, self.video.embedUrl)})@@ -448,7 +448,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {this.checkUserRating()}- private setRating (nextRating) {+ private setRating (nextRating: string) {let methodswitch (nextRating) {case 'like':@@ -466,11 +466,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {.subscribe(() => {// Update the video like attribute- this.updateVideoRating(this.userRating, nextRating)- this.userRating = nextRating+ this.updateVideoRating(this.userRating, nextRating as VideoRateType)+ this.userRating = nextRating as UserVideoRateType},- err => this.notificationsService.error(this.i18n('Error'), err.message)+ (err: any) => this.notificationsService.error(this.i18n('Error'), err.message))}diff --git a/client/src/assets/player/peertube-chunk-store.ts b/client/src/assets/player/peertube-chunk-store.tsindex 767e468219..ac3f9e6548 100644--- a/client/src/assets/player/peertube-chunk-store.ts+++ b/client/src/assets/player/peertube-chunk-store.ts@@ -40,15 +40,15 @@ export class PeertubeChunkStore extends EventEmitter {// If the store is fullprivate memoryChunks: { [ id: number ]: Buffer | true } = {}private databaseName: string- private putBulkTimeout- private cleanerInterval+ private putBulkTimeout: any+ private cleanerInterval: anyprivate db: ChunkDatabaseprivate expirationDB: ExpirationDatabaseprivate readonly length: numberprivate readonly lastChunkLength: numberprivate readonly lastChunkIndex: number- constructor (chunkLength: number, opts) {+ constructor (chunkLength: number, opts: any) {super()this.databaseName = 'webtorrent-chunks-'@@ -113,13 +113,13 @@ export class PeertubeChunkStore extends EventEmitter {}, PeertubeChunkStore.BUFFERING_PUT_MS)}- get (index: number, opts, cb) {+ get (index: number, opts: any, cb: any): any {if (typeof opts === 'function') return this.get(index, null, opts)// IndexDB could be slow, use our memory index firstconst memoryChunk = this.memoryChunks[index]if (memoryChunk === undefined) {- const err = new Error('Chunk not found')+ const err = new Error('Chunk not found') as anyerr['notFound'] = truereturn process.nextTick(() => cb(err))@@ -146,11 +146,11 @@ export class PeertubeChunkStore extends EventEmitter {})}- close (db) {+ close (db: any) {return this.destroy(db)}- async destroy (cb) {+ async destroy (cb: any) {try {if (this.pendingPut) {clearTimeout(this.putBulkTimeout)@@ -225,7 +225,7 @@ export class PeertubeChunkStore extends EventEmitter {}}- private nextTick (cb, err, val?) {+ private nextTick (cb: any, err: Error, val?: any) {process.nextTick(() => cb(err, val), undefined)}}diff --git a/client/src/assets/player/peertube-link-button.ts b/client/src/assets/player/peertube-link-button.tsindex 715207bc07..b03952b476 100644--- a/client/src/assets/player/peertube-link-button.ts+++ b/client/src/assets/player/peertube-link-button.ts@@ -1,11 +1,10 @@-import * as videojs from 'video.js'import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'import { buildVideoLink } from './utils'const Button: VideoJSComponentInterface = videojsUntyped.getComponent('Button')class PeerTubeLinkButton extends Button {- constructor (player: videojs.Player, options) {+ constructor (player: any, options: any) {super(player, options)}diff --git a/client/src/assets/player/peertube-load-progress-bar.ts b/client/src/assets/player/peertube-load-progress-bar.tsindex aedc641e4a..ee8a6cd81c 100644--- a/client/src/assets/player/peertube-load-progress-bar.ts+++ b/client/src/assets/player/peertube-load-progress-bar.ts@@ -4,7 +4,7 @@ const Component: VideoJSComponentInterface = videojsUntyped.getComponent('Componclass PeerTubeLoadProgressBar extends Component {- constructor (player, options) {+ constructor (player: any, options: any) {super(player, options)this.partEls_ = []this.on(player, 'progress', this.update)diff --git a/client/src/assets/player/peertube-player.ts b/client/src/assets/player/peertube-player.tsindex 792662b6c1..ef9e7fcc06 100644--- a/client/src/assets/player/peertube-player.ts+++ b/client/src/assets/player/peertube-player.ts@@ -75,12 +75,12 @@ function getVideojsOptions (options: {enableVolumeScroll: false,enableModifiersForNumbers: false,- fullscreenKey: function (event) {+ fullscreenKey: function (event: any) {// fullscreen with the f key or Ctrl+Enterreturn event.key === 'f' || (event.ctrlKey && event.key === 'Enter')},- seekStep: function (event) {+ seekStep: function (event: any) {// mimic VLC seek behavior, and default to 5 (original value is 5).if (event.ctrlKey && event.altKey) {return 5 * 60@@ -95,26 +95,26 @@ function getVideojsOptions (options: {customKeys: {increasePlaybackRateKey: {- key: function (event) {+ key: function (event: any) {return event.key === '>'},- handler: function (player) {+ handler: function (player: any) {player.playbackRate((player.playbackRate() + 0.1).toFixed(2))}},decreasePlaybackRateKey: {- key: function (event) {+ key: function (event: any) {return event.key === '<'},- handler: function (player) {+ handler: function (player: any) {player.playbackRate((player.playbackRate() - 0.1).toFixed(2))}},frameByFrame: {- key: function (event) {+ key: function (event: any) {return event.key === '.'},- handler: function (player, options, event) {+ handler: function (player: any) {player.pause()// Calculate movement distance (assuming 30 fps)const dist = 1 / 30diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.tsindex 5cebab6d9a..03def186e5 100644--- a/client/src/assets/player/peertube-videojs-plugin.ts+++ b/client/src/assets/player/peertube-videojs-plugin.ts@@ -1,11 +1,11 @@-import * as videojs from 'video.js'+const videojs = require('video.js')import * as WebTorrent from 'webtorrent'import { VideoFile } from '../../../../shared/models/videos/video.model'import { renderVideo } from './video-renderer'import './settings-menu-button'import { PeertubePluginOptions, UserWatching, VideoJSCaption, VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'import { isMobile, timeToInt, videoFileMaxByResolution, videoFileMinByResolution } from './utils'-import * as CacheChunkStore from 'cache-chunk-store'+const CacheChunkStore = require('cache-chunk-store')import { PeertubeChunkStore } from './peertube-chunk-store'import {getAverageBandwidthInStore,@@ -61,11 +61,11 @@ class PeerTubePlugin extends Plugin {private player: anyprivate currentVideoFile: VideoFile- private torrent: WebTorrent.Torrent+ private torrent: anyprivate videoCaptions: VideoJSCaption[]- private renderer- private fakeRenderer+ private renderer: any+ private fakeRenderer: anyprivate destoyingFakeRenderer = falseprivate autoResolution = true@@ -73,17 +73,17 @@ class PeerTubePlugin extends Plugin {private isAutoResolutionObservation = falseprivate playerRefusedP2P = false- private videoViewInterval- private torrentInfoInterval- private autoQualityInterval- private userWatchingVideoInterval- private addTorrentDelay- private qualityObservationTimer- private runAutoQualitySchedulerTimer+ private videoViewInterval: any+ private torrentInfoInterval: any+ private autoQualityInterval: any+ private userWatchingVideoInterval: any+ private addTorrentDelay: any+ private qualityObservationTimer: any+ private runAutoQualitySchedulerTimer: anyprivate downloadSpeeds: number[] = []- constructor (player: videojs.Player, options: PeertubePluginOptions) {+ constructor (player: any, options: PeertubePluginOptions) {super(player, options)// Disable auto play on iOS@@ -273,7 +273,7 @@ class PeerTubePlugin extends Plugin {const oldTorrent = this.torrentconst torrentOptions = {- store: (chunkLength, storeOpts) => new CacheChunkStore(new PeertubeChunkStore(chunkLength, storeOpts), {+ store: (chunkLength: any, storeOpts: any) => new CacheChunkStore(new PeertubeChunkStore(chunkLength, storeOpts), {max: 100})}@@ -304,7 +304,7 @@ class PeerTubePlugin extends Plugin {if (err) return this.fallbackToHttp(options, done)- return this.tryToPlay(err => {+ return this.tryToPlay((err: Error) => {if (err) return done(err)if (options.seek) this.seek(options.seek)@@ -316,7 +316,7 @@ class PeerTubePlugin extends Plugin {}, options.delay || 0)})- this.torrent.on('error', err => console.error(err))+ this.torrent.on('error', (err: any) => console.error(err))this.torrent.on('warning', (err: any) => {// We don't support HTTP tracker but we don't care -> we use the web socket tracker@@ -350,7 +350,7 @@ class PeerTubePlugin extends Plugin {const playPromise = this.player.play()if (playPromise !== undefined) {return playPromise.then(done)- .catch(err => {+ .catch((err: Error) => {if (err.message.indexOf('The play() request was interrupted by a call to pause()') !== -1) {return}@@ -627,7 +627,7 @@ class PeerTubePlugin extends Plugin {this.player.options_.inactivityTimeout = saveInactivityTimeout}- const settingsDialog = this.player.children_.find(c => c.name_ === 'SettingsDialog')+ const settingsDialog = this.player.children_.find((c: any) => c.name_ === 'SettingsDialog')this.player.controlBar.on('mouseenter', () => disableInactivity())settingsDialog.on('mouseenter', () => disableInactivity())@@ -641,7 +641,7 @@ class PeerTubePlugin extends Plugin {return this.videoFiles[Math.floor(this.videoFiles.length / 2)]}- private stopTorrent (torrent: WebTorrent.Torrent) {+ private stopTorrent (torrent: any) {torrent.pause()// Pause does not remove actual peers (in particular the webseed peer)torrent.removePeer(torrent[ 'ws' ])@@ -703,7 +703,7 @@ class PeerTubePlugin extends Plugin {const percent = time / this.player_.duration()return percent >= 1 ? 1 : percent}- SeekBar.prototype.handleMouseMove = function handleMouseMove (event) {+ SeekBar.prototype.handleMouseMove = function handleMouseMove (event: any) {let newTime = this.calculateDistance(event) * this.player_.duration()if (newTime === this.player_.duration()) {newTime = newTime - 0.1diff --git a/client/src/assets/player/peertube-videojs-typings.ts b/client/src/assets/player/peertube-videojs-typings.tsindex b117007aff..98a33077d2 100644--- a/client/src/assets/player/peertube-videojs-typings.ts+++ b/client/src/assets/player/peertube-videojs-typings.ts@@ -1,4 +1,4 @@-import * as videojs from 'video.js'+const videojs = require('video.js')import { VideoFile } from '../../../../shared/models/videos/video.model'import { PeerTubePlugin } from './peertube-videojs-plugin'@@ -11,9 +11,9 @@ declare namespace videojs {interface VideoJSComponentInterface {_player: videojs.Player- new (player: videojs.Player, options?: any)+ new (player: videojs.Player, options?: any): any- registerComponent (name: string, obj: any)+ registerComponent (name: string, obj: any): any}type VideoJSCaption = {diff --git a/client/src/assets/player/resolution-menu-button.ts b/client/src/assets/player/resolution-menu-button.tsindex d53a241519..91818efc94 100644--- a/client/src/assets/player/resolution-menu-button.ts+++ b/client/src/assets/player/resolution-menu-button.ts@@ -1,4 +1,3 @@-import * as videojs from 'video.js'import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'import { ResolutionMenuItem } from './resolution-menu-item'@@ -7,7 +6,7 @@ const MenuButton: VideoJSComponentInterface = videojsUntyped.getComponent('MenuBclass ResolutionMenuButton extends MenuButton {label: HTMLElement- constructor (player: videojs.Player, options) {+ constructor (player: any, options: any) {super(player, options)this.player = playerdiff --git a/client/src/assets/player/resolution-menu-item.ts b/client/src/assets/player/resolution-menu-item.tsindex 0ab0f53b54..afe490abbf 100644--- a/client/src/assets/player/resolution-menu-item.ts+++ b/client/src/assets/player/resolution-menu-item.ts@@ -1,10 +1,9 @@-import * as videojs from 'video.js'import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'const MenuItem: VideoJSComponentInterface = videojsUntyped.getComponent('MenuItem')class ResolutionMenuItem extends MenuItem {- constructor (player: videojs.Player, options) {+ constructor (player: any, options: any) {const currentResolutionId = player.peertube().getCurrentResolutionId()options.selectable = trueoptions.selected = options.id === currentResolutionId@@ -18,7 +17,7 @@ class ResolutionMenuItem extends MenuItem {player.peertube().on('autoResolutionUpdate', () => this.updateSelection())}- handleClick (event) {+ handleClick (event: any) {if (this.id === -1 && this.player_.peertube().isAutoResolutionForbidden()) returnsuper.handleClick(event)diff --git a/client/src/assets/player/settings-menu-button.ts b/client/src/assets/player/settings-menu-button.tsindex b51c52506b..f0ccb5862b 100644--- a/client/src/assets/player/settings-menu-button.ts+++ b/client/src/assets/player/settings-menu-button.ts@@ -1,7 +1,7 @@// Author: Yanko Shterev// Thanks https://github.com/yshterev/videojs-settings-menu-import * as videojs from 'video.js'+const videojs = require('video.js')import { SettingsMenuItem } from './settings-menu-item'import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'import { toTitleCase } from './utils'@@ -11,7 +11,7 @@ const Menu: VideoJSComponentInterface = videojsUntyped.getComponent('Menu')const Component: VideoJSComponentInterface = videojsUntyped.getComponent('Component')class SettingsButton extends Button {- constructor (player: videojs.Player, options) {+ constructor (player: any, options: any) {super(player, options)this.playerComponent = player@@ -48,7 +48,7 @@ class SettingsButton extends Button {}}- onDisposeSettingsItem (event, name: string) {+ onDisposeSettingsItem (name: string) {if (name === undefined) {let children = this.menu.children()@@ -74,7 +74,7 @@ class SettingsButton extends Button {}}- onAddSettingsItem (event, data) {+ onAddSettingsItem (data: any) {const [ entry, options ] = datathis.addMenuItem(entry, options)@@ -120,7 +120,7 @@ class SettingsButton extends Button {this.resetChildren()}- getComponentSize (element) {+ getComponentSize (element: any) {let width: number = nulllet height: number = null@@ -178,7 +178,7 @@ class SettingsButton extends Button {this.panelChild.addChild(this.menu)}- addMenuItem (entry, options) {+ addMenuItem (entry: any, options: any) {const openSubMenu = function () {if (videojsUntyped.dom.hasClass(this.el_, 'open')) {videojsUntyped.dom.removeClass(this.el_, 'open')@@ -218,7 +218,7 @@ class SettingsButton extends Button {}class SettingsPanel extends Component {- constructor (player: videojs.Player, options) {+ constructor (player: any, options: any) {super(player, options)}@@ -232,7 +232,7 @@ class SettingsPanel extends Component {}class SettingsPanelChild extends Component {- constructor (player: videojs.Player, options) {+ constructor (player: any, options: any) {super(player, options)}@@ -246,7 +246,7 @@ class SettingsPanelChild extends Component {}class SettingsDialog extends Component {- constructor (player: videojs.Player, options) {+ constructor (player: any, options: any) {super(player, options)this.hide()}diff --git a/client/src/assets/player/settings-menu-item.ts b/client/src/assets/player/settings-menu-item.tsindex 665ce6fc20..2d752b62ed 100644--- a/client/src/assets/player/settings-menu-item.ts+++ b/client/src/assets/player/settings-menu-item.ts@@ -1,7 +1,6 @@// Author: Yanko Shterev// Thanks https://github.com/yshterev/videojs-settings-menu-import * as videojs from 'video.js'import { toTitleCase } from './utils'import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'@@ -10,7 +9,7 @@ const component: VideoJSComponentInterface = videojsUntyped.getComponent('Componclass SettingsMenuItem extends MenuItem {- constructor (player: videojs.Player, options, entry: string, menuButton: VideoJSComponentInterface) {+ constructor (player: any, options: any, entry: string, menuButton: VideoJSComponentInterface) {super(player, options)this.settingsButton = menuButton@@ -55,7 +54,7 @@ class SettingsMenuItem extends MenuItem {this.transitionEndHandler = this.onTransitionEnd.bind(this)}- onSubmenuClick (event) {+ onSubmenuClick (event: any) {let target = nullif (event.type === 'tap') {@@ -150,7 +149,7 @@ class SettingsMenuItem extends MenuItem {** @method PrefixedEvent*/- PrefixedEvent (element, type, callback, action = 'addEvent') {+ PrefixedEvent (element: any, type: any, callback: any, action = 'addEvent') {let prefix = ['webkit', 'moz', 'MS', 'o', '']for (let p = 0; p < prefix.length; p++) {@@ -166,7 +165,7 @@ class SettingsMenuItem extends MenuItem {}}- onTransitionEnd (event) {+ onTransitionEnd (event: any) {if (event.propertyName !== 'margin-right') {return}@@ -229,7 +228,7 @@ class SettingsMenuItem extends MenuItem {)}- update (event?: Event) {+ update (event?: any) {let target = nulllet subMenu = this.subMenu.name()diff --git a/client/src/assets/player/theater-button.ts b/client/src/assets/player/theater-button.tsindex 5cf0b64255..b761f6030d 100644--- a/client/src/assets/player/theater-button.ts+++ b/client/src/assets/player/theater-button.ts@@ -6,7 +6,7 @@ class TheaterButton extends Button {private static readonly THEATER_MODE_CLASS = 'vjs-theater-enabled'- constructor (player, options) {+ constructor (player: any, options: any) {super(player, options)const enabled = getStoredTheater()diff --git a/client/src/assets/player/utils.ts b/client/src/assets/player/utils.tsindex cf4f60f558..46081c0d2e 100644--- a/client/src/assets/player/utils.ts+++ b/client/src/assets/player/utils.ts@@ -12,7 +12,7 @@ const dictionaryBytes: Array<{max: number, type: string}> = [{ max: 1073741824, type: 'MB' },{ max: 1.0995116e12, type: 'GB' }]-function bytes (value) {+function bytes (value: any) {const format = dictionaryBytes.find(d => value < d.max) || dictionaryBytes[dictionaryBytes.length - 1]const calc = Math.floor(value / (format.max / 1024)).toString()diff --git a/client/src/assets/player/video-renderer.ts b/client/src/assets/player/video-renderer.tsindex 2cb05a4482..a3415937b9 100644--- a/client/src/assets/player/video-renderer.ts+++ b/client/src/assets/player/video-renderer.ts@@ -1,9 +1,9 @@// Thanks: https://github.com/feross/render-media// TODO: use render-media once https://github.com/feross/render-media/issues/32 is fixed-import * as MediaElementWrapper from 'mediasource'+const MediaElementWrapper = require('mediasource')import { extname } from 'path'-import * as videostream from 'videostream'+const videostream = require('videostream')const VIDEOSTREAM_EXTS = ['.m4a',@@ -17,7 +17,7 @@ type RenderMediaOptions = {}function renderVideo (- file,+ file: any,elem: HTMLVideoElement,opts: RenderMediaOptions,callback: (err: Error, renderer: any) => void@@ -27,11 +27,11 @@ function renderVideo (return renderMedia(file, elem, opts, callback)}-function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, callback: (err: Error, renderer?: any) => void) {+function renderMedia (file: any, elem: HTMLVideoElement, opts: RenderMediaOptions, callback: (err: Error, renderer?: any) => void) {const extension = extname(file.name).toLowerCase()- let preparedElem = undefined+ let preparedElem: any = undefinedlet currentTime = 0- let renderer+ let renderer: anytry {if (VIDEOSTREAM_EXTS.indexOf(extension) >= 0) {@@ -45,7 +45,7 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, cafunction useVideostream () {prepareElem()- preparedElem.addEventListener('error', function onError (err) {+ preparedElem.addEventListener('error', function onError (err: Error) {preparedElem.removeEventListener('error', onError)return callback(err)@@ -58,7 +58,7 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, caconst codecs = getCodec(file.name, useVP9)prepareElem()- preparedElem.addEventListener('error', function onError (err) {+ preparedElem.addEventListener('error', function onError (err: Error) {preparedElem.removeEventListener('error', onError)// Try with vp9 before returning an error@@ -102,7 +102,7 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, ca}}-function validateFile (file) {+function validateFile (file: any) {if (file == null) {throw new Error('file cannot be null or undefined')}diff --git a/client/src/assets/player/webtorrent-info-button.ts b/client/src/assets/player/webtorrent-info-button.tsindex deef253cea..5b9d0a4013 100644--- a/client/src/assets/player/webtorrent-info-button.ts+++ b/client/src/assets/player/webtorrent-info-button.ts@@ -65,7 +65,7 @@ class WebtorrentInfoButton extends Button {subDivHttp.appendChild(subDivHttpText)div.appendChild(subDivHttp)- this.player_.peertube().on('torrentInfo', (event, data) => {+ this.player_.peertube().on('torrentInfo', (data: any) => {// We are in HTTP fallbackif (!data) {subDivHttp.className = 'vjs-peertube-displayed'diff --git a/client/src/main.ts b/client/src/main.tsindex f456e89c5d..dee9621808 100644--- a/client/src/main.ts+++ b/client/src/main.ts@@ -8,7 +8,7 @@ import { hmrBootstrap } from './hmr'import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'import { buildFileLocale } from '../../shared'-let providers = []+let providers: any[] = []if (environment.production) {enableProdMode()}diff --git a/client/src/polyfills.ts b/client/src/polyfills.tsindex eec30760df..dfe45b5911 100644--- a/client/src/polyfills.ts+++ b/client/src/polyfills.ts@@ -18,24 +18,26 @@* BROWSER POLYFILLS*/-/** IE9, IE10 and IE11 requires all of the following polyfills. **/+/**+ * IE9, IE10 and IE11 requires all of the following polyfills.+ */// For Google Bot-import 'core-js/es6/symbol';-import 'core-js/es6/object';-import 'core-js/es6/function';-import 'core-js/es6/parse-int';-import 'core-js/es6/parse-float';-import 'core-js/es6/number';-import 'core-js/es6/math';-import 'core-js/es6/string';-import 'core-js/es6/date';-import 'core-js/es6/array';-import 'core-js/es6/regexp';-import 'core-js/es6/map';-import 'core-js/es6/weak-map';-import 'core-js/es6/set';-import 'core-js/es7/object';+import 'core-js/es6/symbol'+import 'core-js/es6/object'+import 'core-js/es6/function'+import 'core-js/es6/parse-int'+import 'core-js/es6/parse-float'+import 'core-js/es6/number'+import 'core-js/es6/math'+import 'core-js/es6/string'+import 'core-js/es6/date'+import 'core-js/es6/array'+import 'core-js/es6/regexp'+import 'core-js/es6/map'+import 'core-js/es6/weak-map'+import 'core-js/es6/set'+import 'core-js/es7/object'/** IE10 and IE11 requires the following for NgClass support on SVG elements */// import 'classlist.js'; // Run `npm install --save classlist.js`.@@ -43,17 +45,18 @@ import 'core-js/es7/object';/** IE10 and IE11 requires the following for the Reflect API. */// For Google Bot-import 'core-js/es6/reflect';+import 'core-js/es6/reflect'-/** Evergreen browsers require these. **/+/**+ * Evergreen browsers require these.+ */// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.import 'core-js/es7/reflect'-/*** Required to support Web Animations `@angular/platform-browser/animations`.* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation- **/+ */// import 'web-animations-js'; // Run `npm install --save web-animations-js`./**@@ -70,19 +73,17 @@ import 'core-js/es7/reflect'*/// (window as any).__Zone_enable_cross_context_check = true;-/**************************************************************************************************** Zone JS is required by default for Angular itself.*/import 'zone.js/dist/zone' // Included with Angular CLI.-/**************************************************************************************************** APPLICATION IMPORTS*/// global/process polyfills-;(window as any).global = window;-;(window as any).process = require('process/');-;(window as any).Buffer = require('buffer/').Buffer;+;(window as any).global = window+;(window as any).process = require('process/')+;(window as any).Buffer = require('buffer/').Bufferdiff --git a/client/src/shims/noop.ts b/client/src/shims/noop.tsindex 899b69bf3a..086a60e32b 100644--- a/client/src/shims/noop.ts+++ b/client/src/shims/noop.ts@@ -1,3 +1,3 @@// Does nothing. Used to shim out node.js modules// which are no-ops in the browser.-export const NOOP = 0\ No newline at end of file+export const NOOP = 0diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.tsindex ea3436c7c8..e5a2d208a3 100644--- a/client/src/standalone/videos/embed.ts+++ b/client/src/standalone/videos/embed.ts@@ -17,7 +17,7 @@ import 'core-js/es6/set'// For google bot that uses Chrome 41 and does not understand fetchimport 'whatwg-fetch'-import * as vjs from 'video.js'+const vjs = require('video.js')import * as Channel from 'jschannel'import { peertubeTranslate, ResultList, VideoDetails } from '../../../../shared'@@ -304,7 +304,7 @@ class PeerTubeEmbed {this.playerOptions = videojsOptionsthis.player = vjs(this.videoContainerId, videojsOptions, () => {- this.player.on('customError', (event, data) => this.handleError(data.err))+ this.player.on('customError', (data: any) => this.handleError(data.err))window[ 'videojsPlayer' ] = this.playerdiff --git a/client/src/standalone/videos/test-embed.ts b/client/src/standalone/videos/test-embed.tsindex dba331e90b..b750c2ee6a 100644--- a/client/src/standalone/videos/test-embed.ts+++ b/client/src/standalone/videos/test-embed.ts@@ -66,11 +66,11 @@ window.addEventListener('load', async () => {updateRates()})- let updateResolutions = resolutions => {+ let updateResolutions = ((resolutions: any) => {let resolutionListEl = document.querySelector('#resolution-list')resolutionListEl.innerHTML = ''- resolutions.forEach(resolution => {+ resolutions.forEach((resolution: any) => {if (resolution.active) {let itemEl = document.createElement('strong')itemEl.innerText = `${resolution.label} (active)`@@ -87,7 +87,7 @@ window.addEventListener('load', async () => {resolutionListEl.appendChild(itemEl)}})- }+ })player.getResolutions().then(resolutions => updateResolutions(resolutions))diff --git a/client/src/typings.d.ts b/client/src/typings.d.tsindex ef5c7bd620..9615434ac6 100644--- a/client/src/typings.d.ts+++ b/client/src/typings.d.ts@@ -2,4 +2,5 @@declare var module: NodeModule;interface NodeModule {id: string;+ [key: string]: any}diff --git a/client/tsconfig.json b/client/tsconfig.jsonindex 431ea7d91b..ef80445db0 100644--- a/client/tsconfig.json+++ b/client/tsconfig.json@@ -7,7 +7,8 @@"moduleResolution": "node","emitDecoratorMetadata": true,"experimentalDecorators": true,- "noImplicitAny": false,+ "noImplicitAny": true,+ "suppressImplicitAnyIndexErrors":true,"alwaysStrict": true,"target": "es5","typeRoots": [diff --git a/shared/models/i18n/i18n.ts b/shared/models/i18n/i18n.tsindex 5c3249452e..9278c043b6 100644--- a/shared/models/i18n/i18n.ts+++ b/shared/models/i18n/i18n.ts@@ -1,6 +1,6 @@export const LOCALE_FILES = [ 'player', 'server' ]-export const I18N_LOCALES = {+export const I18N_LOCALES: any = {'en-US': 'English','fr-FR': 'Français','eu-ES': 'Euskara',@@ -17,7 +17,7 @@ export const I18N_LOCALES = {'zh-Hans-CN': '简体中文(中国)'}-const I18N_LOCALE_ALIAS = {+const I18N_LOCALE_ALIAS: any = {'en': 'en-US','fr': 'fr-FR','eu': 'eu-ES',diff --git a/shared/models/overviews/videos-overview.ts b/shared/models/overviews/videos-overview.tsindex ee009d94c7..8c87857634 100644--- a/shared/models/overviews/videos-overview.ts+++ b/shared/models/overviews/videos-overview.ts@@ -15,4 +15,5 @@ export interface VideosOverview {tag: stringvideos: Video[]}[]+ [key: string]: any}diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.tsindex 3afd36fcdb..c5156d9f3a 100644--- a/shared/models/server/custom-config.model.ts+++ b/shared/models/server/custom-config.model.ts@@ -55,6 +55,7 @@ export interface CustomConfig {'480p': boolean'720p': boolean'1080p': boolean+ [key: string]: boolean}}diff --git a/shared/models/users/user.model.ts b/shared/models/users/user.model.tsindex 8147dc48e8..06a6602063 100644--- a/shared/models/users/user.model.ts+++ b/shared/models/users/user.model.ts@@ -20,4 +20,5 @@ export interface User {blockedReason?: stringvideoQuotaUsed?: number+ [key: string]: any}