Browse Source

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

master
Fabrice PENHOËT 11 months ago
parent
commit
687cef9a74
  1. 4
      public/JS/example.app.js
  2. 4
      public/JS/exampleFlickity.app.js
  3. 10
      src/vCarousel.ts
  4. 16
      tsconfig.json

4
public/JS/example.app.js

File diff suppressed because one or more lines are too long

4
public/JS/exampleFlickity.app.js

File diff suppressed because one or more lines are too long

10
src/vCarousel.ts

@ -16,12 +16,12 @@ interface videoDOM
export class vCarousel
{
private _vContainers: videoDOM[] = [];
private _firstVideoId: string;
private _firstVideoId: string|undefined = undefined;
private _playFirstVideo: boolean = false;
private _playNextVideos: boolean = false;
private _noStop: boolean = false;
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.
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.
set firstVideoId(firstVideo: string)
set firstVideoId(firstVideo: string|undefined)
{
if((firstVideo!=="" && this._vContainers.findIndex(video => video.id === firstVideo) !== -1) || (firstVideo===""))
this._firstVideoId=firstVideo;
}
get firstVideoId() : string
get firstVideoId() : string|undefined
{
return this._firstVideoId;
}
@ -73,7 +73,7 @@ export class vCarousel
this._noStop=noStop;
}
get currentVideo() : HTMLMediaElement
get currentVideo() : HTMLMediaElement|undefined
{
return this._currentVideo;
}

16
tsconfig.json

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