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:
parent
e8edbdb4ae
commit
0123bf61ab
|
@ -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) {
|
||||||
|
|
Reference in New Issue