[video.js] all plugins are optional, so plugins option should be a Partial<> (#39443)

* all plugins are optional, so plugins option should be a Partial<>

* fix whitespace
This commit is contained in:
Joe Flateau 2019-10-25 18:28:36 -04:00 committed by Wesley Wigham
parent 11e61c1409
commit 3c2e0e5af0
3 changed files with 15 additions and 8 deletions

View File

@ -6719,7 +6719,7 @@ declare namespace videojs {
nativeControlsForTouch?: boolean;
notSupportedMessage?: string;
playbackRates?: number[];
plugins?: VideoJsPlayerPluginOptions;
plugins?: Partial<VideoJsPlayerPluginOptions>;
poster?: string;
preload?: string;
sourceOrder?: boolean;

View File

@ -9,6 +9,8 @@ declare module 'video.js' {
}
interface VideoJsPlayerPluginOptions {
somePluginDefinedInAugmentation: {};
somePluginDefinedInAugmentation: {
someRequiredProperty: boolean;
};
}
}

View File

@ -122,12 +122,17 @@ function testPlugin(player: videojs.Player, options: {}) {
function testAugmentation(player: videojs.Player) {
player.somePluginDefinedInAugmentation();
videojs("example_video_2", {
plugins: {
somePluginDefinedInAugmentation: {},
someOtherPluginNotTyped: {}
}
});
videojs('example_video_2', {
plugins: {
somePluginDefinedInAugmentation: {
someRequiredProperty: true
},
someOtherPluginNotTyped: {},
},
});
videojs('example_video_3', {
plugins: {}
});
}
function testLogger() {