web: fix broken typescript references

This built... and then it didn't?  Anyway, the current fix is to
provide type information the AkInterface for the data that consumers
require.
This commit is contained in:
Ken Sternberg 2023-10-20 10:31:44 -07:00
parent e8edbdb4ae
commit 0123bf61ab
1 changed files with 7 additions and 2 deletions

View File

@ -13,10 +13,15 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css";
import { Config, CurrentTenant, UiThemeEnum } from "@goauthentik/api"; import { Config, CurrentTenant, UiThemeEnum } from "@goauthentik/api";
type AkInterface = HTMLElement & { getTheme: () => Promise<UiThemeEnum> }; type AkInterface = HTMLElement & {
getTheme: () => Promise<UiThemeEnum>;
tenant?: CurrentTenant;
uiConfig?: UIConfig;
config?: Config;
};
export const rootInterface = <T extends AkInterface>(): T | undefined => export const rootInterface = <T extends AkInterface>(): T | undefined =>
document.body.querySelector('[data-ak-interface-root]') as T ?? undefined (document.body.querySelector("[data-ak-interface-root]") as T) ?? undefined;
export function ensureCSSStyleSheet(css: CSSStyleSheet | CSSResult): CSSStyleSheet { export function ensureCSSStyleSheet(css: CSSStyleSheet | CSSResult): CSSStyleSheet {
if (css instanceof CSSResult) { if (css instanceof CSSResult) {