36 lines
786 B
TypeScript
36 lines
786 B
TypeScript
export enum DataInfoTypeEnum {
|
|||
|
|
|
||
|
|
/**
|
||
|
|
* Discord
|
||
|
|
*/
|
||
|
|
Discord = "Discord",
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Maps a numeric index to a MachineAuthorizationType key-value pair
|
||
|
|
* @param index The numeric index to map
|
||
|
|
* @returns An object with the enum key and its corresponding value
|
||
|
|
*/
|
||
|
|
export function GetDataInfoTypeOption(index: number): string {
|
||
|
|
const keys = Object.keys(DataInfoTypeEnum);
|
||
|
|
switch (index) {
|
||
|
|
case 0:
|
||
|
|
return DataInfoTypeEnum[keys[0] as keyof typeof DataInfoTypeEnum];
|
||
|
|
default:
|
||
|
|
return DataInfoTypeEnum[keys[0] as keyof typeof DataInfoTypeEnum];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取MachineAuthorizationType的选项
|
||
|
|
* @returns
|
||
|
|
*/
|
||
|
|
export function GetDataInfoTypeOptions(): { label: string, value: number }[] {
|
||
|
|
return [
|
||
|
|
{
|
||
|
|
label: "Discord",
|
||
|
|
value: 0
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|