Modification du fichier de configuration de TypeScript (notamment mode STRICT) + adaptation de la classe vCarousel

This commit is contained in:
Fabrice PENHOËT 2021-08-03 18:19:50 +02:00
parent bf78ef21d5
commit 687cef9a74
4 changed files with 20 additions and 14 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -16,12 +16,12 @@ interface videoDOM
export class vCarousel export class vCarousel
{ {
private _vContainers: videoDOM[] = []; private _vContainers: videoDOM[] = [];
private _firstVideoId: string; private _firstVideoId: string|undefined = undefined;
private _playFirstVideo: boolean = false; private _playFirstVideo: boolean = false;
private _playNextVideos: boolean = false; private _playNextVideos: boolean = false;
private _noStop: boolean = false; private _noStop: boolean = false;
private nbVContainers: number = 0; private nbVContainers: number = 0;
private _currentVideo: HTMLMediaElement; private _currentVideo: HTMLMediaElement|undefined = undefined;
// Les ids reçus doivent correspondre à des éléments HTML contenant une vidéo. // Les ids reçus doivent correspondre à des éléments HTML contenant une vidéo.
set vContainers(vContainersIds: string[]) set vContainers(vContainersIds: string[])
@ -47,13 +47,13 @@ export class vCarousel
} }
// Si this._firstVideoId a été fourni, on vérifie qu'il est présent dans la liste des conteneurs de vidéos. // Si this._firstVideoId a été fourni, on vérifie qu'il est présent dans la liste des conteneurs de vidéos.
set firstVideoId(firstVideo: string) set firstVideoId(firstVideo: string|undefined)
{ {
if((firstVideo!=="" && this._vContainers.findIndex(video => video.id === firstVideo) !== -1) || (firstVideo==="")) if((firstVideo!=="" && this._vContainers.findIndex(video => video.id === firstVideo) !== -1) || (firstVideo===""))
this._firstVideoId=firstVideo; this._firstVideoId=firstVideo;
} }
get firstVideoId() : string get firstVideoId() : string|undefined
{ {
return this._firstVideoId; return this._firstVideoId;
} }
@ -73,7 +73,7 @@ export class vCarousel
this._noStop=noStop; this._noStop=noStop;
} }
get currentVideo() : HTMLMediaElement get currentVideo() : HTMLMediaElement|undefined
{ {
return this._currentVideo; return this._currentVideo;
} }

View File

@ -1,14 +1,16 @@
{ {
"compilerOptions": "compilerOptions":
{ {
"outDir": "./src", "outDir": "./src/build",
"noImplicitAny": true, "module": "ES6",
"module": "es6",
"removeComments": true,
"target": "es5", "target": "es5",
"jsx": "react", "strict":true,
"allowJs": true "removeComments": true,
"allowJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
}, },
"include": ["src/*.ts"], "include": ["src/*.ts"],
"exclude": ["node_modules", "**/*.spec.ts"] "exclude": ["src/build"]
} }