Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed Sep 26, 2022
1 parent 3b30901 commit 3987d2c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 46 deletions.
8 changes: 8 additions & 0 deletions examples/standalone/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "dist",
"types": ["./node_modules/@oplayer/ui/src/shims-oplayer"]
}
}
64 changes: 18 additions & 46 deletions packages/ui/src/shims-oplayer.d.ts
Original file line number Diff line number Diff line change
@@ -1,49 +1,21 @@
// import { PlayerEventName, PlayerListener } from '@oplayer/core/src/types'
import { Player } from '@oplayer/core'
import { Setting, MenuBar, SubtitleSource, Thumbnails } from './types'

//TODO: 扩展 PlayerEventName
// NEED PR
declare module '@oplayer/core' {
export interface Player {
registerSetting: (setting: Setting | Setting[]) => void
unRegisterSetting: (key: string) => void
selectSetting: (key: string, value: boolean | number) => void
updateSettingLabel: (key: string, text: string) => void

// declare global {
// module '@oplayer/core' {
// export * from '@oplayer/core'
// interface Player {
// readonly on: (
// name:
// | PlayerEventName
// | PlayerListener
// | 'ui:notice'
// | 'ui:controllerchange'
// | 'ui:subtitlechange' // Switch existing subtitles eg: switch Chinese subtitles to English subtitles
// | 'ui:subtitleconfigchange' // Modify existing subtitles eg: Add English subtitles
// | 'ui:settingloaded'
// | 'ui:settingshow'
// | 'ui:settinghide'
// | 'ui:settingadd'
// | 'ui:settingremove',
// listener?: PlayerListener,
// options?: { once: boolean }
// ) => this
// }
// }
// }
registerMenu: (menu: MenuBar) => void
unRegisterMenu: (key: string) => void
selectMenu: (key: string, value: boolean | number) => void

// declare module '@oplayer/core' {
// interface Player {
// readonly on: (
// name:
// | PlayerEventName
// | PlayerListener
// | 'ui:notice'
// | 'ui:controllerchange'
// | 'ui:subtitlechange' // Switch existing subtitles eg: switch Chinese subtitles to English subtitles
// | 'ui:subtitleconfigchange' // Modify existing subtitles eg: Add English subtitles
// | 'ui:settingloaded'
// | 'ui:settingshow'
// | 'ui:settinghide'
// | 'ui:settingadd'
// | 'ui:settingremove',
// listener?: PlayerListener,
// options?: { once: boolean }
// ) => this
// }
// }
registerHotKey: (map: { key: string; fn: Function }[]) => void
unRegisterHotKey: (key: string[]) => void

changeSubtitleSource: (source: SubtitleSource[]) => void
changeThumbnailsSource: (src: string) => void
}
}

1 comment on commit 3987d2c

@vercel
Copy link

@vercel vercel bot commented on 3987d2c Sep 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

oplayer – ./

oplayer.vercel.app
oplayer-git-main-shiyiya.vercel.app
oplayer-shiyiya.vercel.app

Please sign in to comment.