refactor(ambilight): [PKG-AMBILIGHT-04] preserve published types and dual CommonJS exports

This commit is contained in:
Harvey Zhao committed 2026-09-12 11:50:22 +08:00
1 parent 6caee44dbf
commit 959cccf515
30 files changed
+877 -69

No files matched your search

@@ -9,6 +9,23 @@ failures are skipped and retried, allowing a later readable source to recover.
Internal modules and compatibility tests are documented in [ARCHITECTURE.md](ARCHITECTURE.md).
## Usage and TypeScript
```ts
import type { Option } from 'artplayer-plugin-ambilight'
import artplayerPluginAmbilight from 'artplayer-plugin-ambilight'
const option: Option = { blur: '50px', opacity: 0.5, frequency: 10, duration: 0.3 }
// Add to ArtPlayer's plugins option:
const plugins = [artplayerPluginAmbilight(option)]
```
Options can be omitted. `require('artplayer-plugin-ambilight')` and the historical
`require('artplayer-plugin-ambilight').default` refer to the same factory. The
`/legacy` entry remains available. The historical `zIndex` input is accepted but
ignored; the grid uses 9. Option fields stay optional as in version 1.1.0; code
extracting their types should account for `undefined`.
## Demo
[https://artplayer.org](https://artplayer.org/?libs=./uncompiled/artplayer-plugin-ambilight/index.js&example=ambilight)