mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-16 01:26:16 -08:00
refactor(audio): [PKG-AUDIO-04] migrate strict source and compatible type entries
This commit is contained in:
1 parent
9c07ea830c
commit
13c898c149
31 files changed
+18923
-90
No files matched your search
+48
-36
@@ -1,40 +1,52 @@
|
||||
interface Option {
|
||||
/**
|
||||
* Audio track URL
|
||||
*/
|
||||
url: string
|
||||
|
||||
/**
|
||||
* Time offset in seconds between video and audio
|
||||
* Positive value means audio plays ahead of video
|
||||
* Negative value means audio plays behind video
|
||||
* @default 0
|
||||
*/
|
||||
offset?: number
|
||||
|
||||
/**
|
||||
* Synchronization threshold in seconds
|
||||
* @default 0.3
|
||||
*/
|
||||
sync?: number
|
||||
// Generated from the package public declaration by yarn build:ts. Do not edit.
|
||||
/* eslint-disable ts/no-redeclare -- Callable and public type namespace intentionally merge. */
|
||||
declare namespace artplayerPluginAudioTrackDefinitions {
|
||||
export interface Option {
|
||||
/**
|
||||
* Audio track URL
|
||||
*/
|
||||
url: string
|
||||
/**
|
||||
* Time offset in seconds between video and audio
|
||||
* Positive value means audio plays ahead of video
|
||||
* Negative value means audio plays behind video
|
||||
* @default 0
|
||||
*/
|
||||
offset?: number
|
||||
/**
|
||||
* Synchronization threshold in seconds
|
||||
* @default 0.3
|
||||
*/
|
||||
sync?: number
|
||||
}
|
||||
export type UpdateOption = Partial<Option>
|
||||
export interface Result {
|
||||
name: 'artplayerPluginAudioTrack'
|
||||
/**
|
||||
* The audio element
|
||||
*/
|
||||
audio: HTMLAudioElement
|
||||
/**
|
||||
* Historical update signature. Runtime also accepts partial options.
|
||||
* Import the /runtime entry for the precise partial-update signature.
|
||||
*/
|
||||
update: (option: Option) => void
|
||||
}
|
||||
export interface RuntimeResult extends Result {
|
||||
/** Update selected fields without replacing the audio element. */
|
||||
update: (option: UpdateOption) => void
|
||||
}
|
||||
/** Precise typing for the same runtime factory, without changing legacy inference. */
|
||||
export type RuntimeFactory = (option: Option) => (art: Artplayer) => RuntimeResult
|
||||
export function artplayerPluginAudioTrack(option: Option): (art: Artplayer) => Result
|
||||
}
|
||||
|
||||
interface Result {
|
||||
name: 'artplayerPluginAudioTrack'
|
||||
/**
|
||||
* The audio element
|
||||
*/
|
||||
audio: HTMLAudioElement
|
||||
|
||||
/**
|
||||
* Update option
|
||||
*/
|
||||
update: (option: Option) => void
|
||||
declare const artplayerPluginAudioTrack: typeof artplayerPluginAudioTrackDefinitions.artplayerPluginAudioTrack
|
||||
declare namespace artplayerPluginAudioTrack {
|
||||
export type Option = artplayerPluginAudioTrackDefinitions.Option
|
||||
export type UpdateOption = artplayerPluginAudioTrackDefinitions.UpdateOption
|
||||
export type Result = artplayerPluginAudioTrackDefinitions.Result
|
||||
export type RuntimeResult = artplayerPluginAudioTrackDefinitions.RuntimeResult
|
||||
export type RuntimeFactory = artplayerPluginAudioTrackDefinitions.RuntimeFactory
|
||||
}
|
||||
|
||||
declare const artplayerPluginAudioTrack: (option: Option) => (art: Artplayer) => Result
|
||||
|
||||
export default artplayerPluginAudioTrack
|
||||
|
||||
export = artplayerPluginAudioTrack
|
||||
export as namespace artplayerPluginAudioTrack;
|
||||
Reference in new issue
Block a user