mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-17 10:01:20 -08:00
fix(types): [PKG-FACTORY-01] preserve published factory compatibility
This commit is contained in:
1 parent
1117107032
commit
c4c7491e16
35 files changed
+670
-229
No files matched your search
+18
-11
@@ -1,7 +1,7 @@
|
||||
// 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 artplayerPluginAmbilight {
|
||||
interface Option {
|
||||
declare namespace artplayerPluginAmbilightDefinitions {
|
||||
export interface Option {
|
||||
/** CSS blur radius. @default '50px' */
|
||||
blur?: string
|
||||
/** Grid cell opacity. @default 0.5 */
|
||||
@@ -13,23 +13,30 @@ declare namespace artplayerPluginAmbilight {
|
||||
/** Background color transition duration in seconds. @default 0.3 */
|
||||
duration?: number
|
||||
}
|
||||
interface Result {
|
||||
export interface Result {
|
||||
name: 'artplayerPluginAmbilight'
|
||||
/** Start sampling; does nothing after the player is destroyed. */
|
||||
start: () => void
|
||||
/** Stop sampling while retaining the last colors. */
|
||||
stop: () => void
|
||||
}
|
||||
interface Callable {
|
||||
/** Published 1.1.0 factory shape; the options argument remains required. */
|
||||
export type Callable = (option: Option) => (art: Artplayer) => Result
|
||||
export type Factory = Callable
|
||||
/** Accurate optional invocation and CommonJS self alias, exposed by /runtime. */
|
||||
export interface RuntimeFactory {
|
||||
(option?: Option): (art: Artplayer) => Result
|
||||
/** Keep Parameters extraction identical to the published 1.1.0 signature. */
|
||||
(option: Option): (art: Artplayer) => Result
|
||||
}
|
||||
interface Factory extends Callable {
|
||||
/** Same function, including historical require(package).default calls. */
|
||||
readonly default: Factory
|
||||
readonly default: RuntimeFactory
|
||||
}
|
||||
export const artplayerPluginAmbilight: (option: Option) => (art: Artplayer) => Result
|
||||
}
|
||||
declare const artplayerPluginAmbilight: typeof artplayerPluginAmbilightDefinitions.artplayerPluginAmbilight
|
||||
declare namespace artplayerPluginAmbilight {
|
||||
export type Option = artplayerPluginAmbilightDefinitions.Option
|
||||
export type Result = artplayerPluginAmbilightDefinitions.Result
|
||||
export type Callable = artplayerPluginAmbilightDefinitions.Callable
|
||||
export type Factory = artplayerPluginAmbilightDefinitions.Factory
|
||||
export type RuntimeFactory = artplayerPluginAmbilightDefinitions.RuntimeFactory
|
||||
}
|
||||
declare const artplayerPluginAmbilight: artplayerPluginAmbilight.Factory
|
||||
export = artplayerPluginAmbilight
|
||||
export as namespace artplayerPluginAmbilight;
|
||||
+21
-14
@@ -1,21 +1,28 @@
|
||||
// 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 artplayerProxyCanvas {
|
||||
declare namespace artplayerProxyCanvasDefinitions {
|
||||
/** Runs after drawing and bitmap release, before the draw event. */
|
||||
type Option = (ctx: CanvasRenderingContext2D, video: HTMLVideoElement) => void
|
||||
/** Preserve the exact published return type and its assignability. */
|
||||
type Result = HTMLCanvasElement
|
||||
/** Opt-in view of supported enumerable media members; native Canvas members win. */
|
||||
type MediaCanvas = HTMLCanvasElement & Pick<HTMLVideoElement, Exclude<keyof HTMLVideoElement, keyof HTMLCanvasElement>>
|
||||
interface Callable {
|
||||
/** Keep Parameters extraction optional, as published in 1.1.0. */
|
||||
(option?: Option): (art: Artplayer) => Result
|
||||
}
|
||||
interface Factory extends Callable {
|
||||
/** Same factory, for historical require(package).default calls. */
|
||||
readonly default: Factory
|
||||
export type Option = (ctx: CanvasRenderingContext2D, video: HTMLVideoElement) => void
|
||||
/** Preserve the exact published 1.1.0 return type and its assignability. */
|
||||
export type Result = HTMLCanvasElement
|
||||
export type Factory = (option?: Option) => (art: Artplayer) => Result
|
||||
export type Callable = Factory
|
||||
/** Explicit view of forwarded media members; native Canvas members win. */
|
||||
export type MediaCanvas = HTMLCanvasElement & Pick<HTMLVideoElement, Exclude<keyof HTMLVideoElement, keyof HTMLCanvasElement>>
|
||||
/** Opt-in runtime identity; the historical root factory has no required properties. */
|
||||
export interface RuntimeFactory extends Factory {
|
||||
readonly default: RuntimeFactory
|
||||
}
|
||||
export const artplayerProxyCanvas: (option?: Option) => (art: Artplayer) => Result
|
||||
}
|
||||
declare const artplayerProxyCanvas: typeof artplayerProxyCanvasDefinitions.artplayerProxyCanvas
|
||||
declare namespace artplayerProxyCanvas {
|
||||
export type Option = artplayerProxyCanvasDefinitions.Option
|
||||
export type Result = artplayerProxyCanvasDefinitions.Result
|
||||
export type Factory = artplayerProxyCanvasDefinitions.Factory
|
||||
export type Callable = artplayerProxyCanvasDefinitions.Callable
|
||||
export type MediaCanvas = artplayerProxyCanvasDefinitions.MediaCanvas
|
||||
export type RuntimeFactory = artplayerProxyCanvasDefinitions.RuntimeFactory
|
||||
}
|
||||
declare const artplayerProxyCanvas: artplayerProxyCanvas.Factory
|
||||
export = artplayerProxyCanvas
|
||||
export as namespace artplayerProxyCanvas;
|
||||
Reference in new issue
Block a user