28 lines
723 B
TypeScript
28 lines
723 B
TypeScript
export enum ConversionType {
|
|
ENCODE_BASE64,
|
|
DECODE_BASE64
|
|
}
|
|
|
|
export namespace ConversionType {
|
|
export function getName(type:ConversionType):string {
|
|
switch (type) {
|
|
case ConversionType.DECODE_BASE64:
|
|
return "Decode BASE64";
|
|
case ConversionType.ENCODE_BASE64:
|
|
return "Encode BASE64";
|
|
default:
|
|
return "Unknown";
|
|
}
|
|
}
|
|
|
|
export function of(id:number):ConversionType {
|
|
switch (id) {
|
|
case 0:
|
|
return ConversionType.ENCODE_BASE64;
|
|
case 1:
|
|
return ConversionType.DECODE_BASE64;
|
|
default:
|
|
return undefined;
|
|
}
|
|
}
|
|
}
|