@alauda-fe/common
Version:
Alauda frontend team common codes.
26 lines (25 loc) • 1.2 kB
TypeScript
import { TranslateService } from '../../translate/public-api';
import * as i0 from "@angular/core";
type ResourceType = 'cpu' | 'memory';
interface ResourceInfo {
icon: string;
formatter: (rawData: number | string, locale?: string) => string;
}
export declare class ResourceLabelComponent {
readonly translate: TranslateService;
rawValue: string | number;
default: string;
type: ResourceType;
noIcon: boolean;
get formattedDefault(): string;
labelIconMapper: Record<ResourceType, ResourceInfo>;
constructor(translate: TranslateService);
formatCPU(rawData: number | string): string;
formatMemory(rawData: number | string): string;
private getResourceUnit;
private formatCpuUnit;
private formatMemoryUnit;
static ɵfac: i0.ɵɵFactoryDeclaration<ResourceLabelComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ResourceLabelComponent, "acl-resource-label", never, { "rawValue": { "alias": "rawValue"; "required": false; }; "default": { "alias": "default"; "required": false; }; "type": { "alias": "type"; "required": false; }; "noIcon": { "alias": "noIcon"; "required": false; }; }, {}, never, never, true, never>;
}
export {};