mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
use a better type for plugin options, one that can be extended (#39218)
* use a better type for plugin options, one that can be extended * fix lint issue and add a test case
This commit is contained in:
parent
0bd57b50be
commit
ddb94b86a0
6
types/video.js/index.d.ts
vendored
6
types/video.js/index.d.ts
vendored
@ -6710,7 +6710,7 @@ declare namespace videojs {
|
||||
nativeControlsForTouch?: boolean;
|
||||
notSupportedMessage?: string;
|
||||
playbackRates?: number[];
|
||||
plugins?: any;
|
||||
plugins?: VideoJsPlayerPluginOptions;
|
||||
poster?: string;
|
||||
preload?: string;
|
||||
sourceOrder?: boolean;
|
||||
@ -6720,3 +6720,7 @@ declare namespace videojs {
|
||||
tracks?: videojs.TextTrackOptions[];
|
||||
width?: number;
|
||||
}
|
||||
|
||||
export interface VideoJsPlayerPluginOptions {
|
||||
[pluginName: string]: any;
|
||||
}
|
||||
|
||||
4
types/video.js/video.js-some-plugin.d.ts
vendored
4
types/video.js/video.js-some-plugin.d.ts
vendored
@ -7,4 +7,8 @@ declare module 'video.js' {
|
||||
interface VideoJsPlayer {
|
||||
somePluginDefinedInAugmentation(options?: {}): this;
|
||||
}
|
||||
|
||||
interface VideoJsPlayerPluginOptions {
|
||||
somePluginDefinedInAugmentation: {};
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,4 +120,10 @@ function testPlugin(player: videojs.Player, options: {}) {
|
||||
|
||||
function testAugmentation(player: videojs.Player) {
|
||||
player.somePluginDefinedInAugmentation();
|
||||
videojs("example_video_2", {
|
||||
plugins: {
|
||||
somePluginDefinedInAugmentation: {},
|
||||
someOtherPluginNotTyped: {}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user