mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-09-22 12:09:35 +02:00
Add BxIconRaw tyoe
This commit is contained in:
@@ -83,3 +83,5 @@ export const BxIcon = {
|
||||
UPLOAD: iconUpload,
|
||||
AUDIO: iconSpeakerHigh,
|
||||
} as const;
|
||||
|
||||
export type BxIconRaw = (typeof BxIcon)[keyof typeof BxIcon];
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import type { BxIcon } from "@utils/bx-icon";
|
||||
import type { BxIconRaw } from "@utils/bx-icon";
|
||||
import { setNearby } from "./navigation-utils";
|
||||
import type { NavigationNearbyElements } from "@/modules/ui/dialog/navigation-dialog";
|
||||
import type { PresetRecord, AllPresets } from "@/types/presets";
|
||||
@@ -43,7 +43,7 @@ export type BxButtonOptions = Partial<{
|
||||
style: ButtonStyle;
|
||||
url: string;
|
||||
classes: string[];
|
||||
icon: typeof BxIcon;
|
||||
icon: BxIconRaw;
|
||||
label: string;
|
||||
secondaryText: HTMLElement | string;
|
||||
title: string;
|
||||
@@ -149,8 +149,8 @@ function createElement<T extends keyof HTMLElementTagNameMap>(elmName: T, props?
|
||||
|
||||
|
||||
const domParser = new DOMParser();
|
||||
export function createSvgIcon(icon: typeof BxIcon) {
|
||||
return domParser.parseFromString(icon.toString(), 'image/svg+xml').documentElement;
|
||||
export function createSvgIcon(icon: BxIconRaw) {
|
||||
return domParser.parseFromString(icon, 'image/svg+xml').documentElement;
|
||||
}
|
||||
|
||||
const ButtonStyleIndices = Object.keys(ButtonStyleClass).map(i => parseInt(i));
|
||||
|
Reference in New Issue
Block a user