mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 12:11:20 -08:00
fix(dpip): [PKG-DPIP-04] preserve factory type and export compatibility
This commit is contained in:
1 parent
80d37d66f8
commit
ef976136a1
31 files changed
+1067
-68
No files matched your search
+49
-18
@@ -1,22 +1,53 @@
|
||||
interface Option {
|
||||
width?: number
|
||||
height?: number
|
||||
placeholder?: string
|
||||
fallbackToVideoPiP?: boolean
|
||||
// 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 artplayerPluginDocumentPipDefinitions {
|
||||
export interface Option {
|
||||
/** Requested window width. @default 480 */
|
||||
width?: number
|
||||
/** Requested window height. @default 270 */
|
||||
height?: number
|
||||
/** Text displayed in the original player container while the window is active. */
|
||||
placeholder?: string
|
||||
/** Use the core video PiP property when Document PiP is unavailable. @default true */
|
||||
fallbackToVideoPiP?: boolean
|
||||
}
|
||||
/** Historical assignable result; preserved for direct and extracted return types. */
|
||||
export interface Result {
|
||||
name: 'artplayerPluginDocumentPip'
|
||||
/** Runtime is a readonly capability snapshot; the published field stays assignable. */
|
||||
isSupported: boolean
|
||||
/** Runtime is a readonly live getter; the published field stays assignable. */
|
||||
isActive: boolean
|
||||
/** Runtime returns Promise<void>; the published void action remains assignable here. */
|
||||
open: () => void
|
||||
/** Runtime returns Promise<void>; the published void action remains assignable here. */
|
||||
close: () => void
|
||||
toggle: () => void
|
||||
}
|
||||
/** Exact view of an unmodified runtime result. */
|
||||
export interface AsyncResult extends Omit<Result, 'isSupported' | 'isActive' | 'open' | 'close'> {
|
||||
readonly isSupported: boolean
|
||||
readonly isActive: boolean
|
||||
open: () => Promise<void>
|
||||
close: () => Promise<void>
|
||||
}
|
||||
/** Exact published factory signature, including compatibility with replacement functions. */
|
||||
export type Factory = (option: Option) => (art: Artplayer) => Result
|
||||
/** Opt-in runtime view with omitted options, self default and precise async actions. */
|
||||
export interface RuntimeFactory {
|
||||
(option?: Option): (art: Artplayer) => AsyncResult
|
||||
readonly default: RuntimeFactory
|
||||
}
|
||||
/** Keep the published callable type; use RuntimeFactory explicitly for its broader runtime shape. */
|
||||
export function artplayerPluginDocumentPip(option: Option): (art: Artplayer) => Result
|
||||
}
|
||||
|
||||
interface Result {
|
||||
name: 'artplayerPluginDocumentPip'
|
||||
isSupported: boolean
|
||||
isActive: boolean
|
||||
open: () => void
|
||||
close: () => void
|
||||
toggle: () => void
|
||||
declare const artplayerPluginDocumentPip: typeof artplayerPluginDocumentPipDefinitions.artplayerPluginDocumentPip
|
||||
declare namespace artplayerPluginDocumentPip {
|
||||
export type Option = artplayerPluginDocumentPipDefinitions.Option
|
||||
export type Result = artplayerPluginDocumentPipDefinitions.Result
|
||||
export type AsyncResult = artplayerPluginDocumentPipDefinitions.AsyncResult
|
||||
export type Factory = artplayerPluginDocumentPipDefinitions.Factory
|
||||
export type RuntimeFactory = artplayerPluginDocumentPipDefinitions.RuntimeFactory
|
||||
}
|
||||
|
||||
declare const artplayerPluginDocumentPip: (option: Option) => (art: Artplayer) => Result
|
||||
|
||||
export default artplayerPluginDocumentPip
|
||||
|
||||
export = artplayerPluginDocumentPip
|
||||
export as namespace artplayerPluginDocumentPip;
|
||||
Reference in new issue
Block a user