diff --git a/src/api/index.ts b/src/api/index.ts index 25bf636cf85c..fa9567654e84 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -3,7 +3,7 @@ import {setFetchMethod as setFetch} from './fetch'; import {DEFAULT_THEME} from '../defaults'; import type {Theme, DynamicThemeFix} from '../definitions'; import {ThemeEngine} from '../generators/theme-engines'; -import {createOrUpdateDynamicThemeInternal, removeDynamicTheme} from '../inject/dynamic-theme'; +import {createOrUpdateDynamicTheme, removeDynamicTheme} from '../inject/dynamic-theme'; import {collectCSS} from '../inject/dynamic-theme/css-collection'; import {isMatchMediaChangeEventListenerSupported} from '../utils/platform'; @@ -17,7 +17,7 @@ const isIFrame = (() => { } })(); -export function enable(themeOptions: Partial | null = {}, fixes: DynamicThemeFix | null = null): void { +export function enable(themeOptions: Partial | null = {}, fixes: DynamicThemeFix[] | null = null): void { const theme = {...DEFAULT_THEME, ...themeOptions}; if (theme.engine !== ThemeEngine.dynamicTheme) { @@ -41,7 +41,7 @@ export function disable(): void { const darkScheme = matchMedia('(prefers-color-scheme: dark)'); let store = { themeOptions: null as Partial | null, - fixes: null as DynamicThemeFix | null, + fixes: null as DynamicThemeFix[] | null, }; function handleColorScheme(): void { @@ -52,7 +52,7 @@ function handleColorScheme(): void { } } -export function auto(themeOptions: Partial | false = {}, fixes: DynamicThemeFix | null = null): void { +export function auto(themeOptions: Partial | false = {}, fixes: DynamicThemeFix[] | null = null): void { if (themeOptions) { store = {themeOptions, fixes}; handleColorScheme();