UNPKG

@alauda-fe/common

Version:

Alauda frontend team common codes.

31 lines (30 loc) 2.69 kB
import { KubernetesResource, OwnerReference } from '../types/public-api'; export declare const assemble: (subdomain: string, domain: string, type: string) => string; export declare const k8sSubGroup: import("ts-toolbelt/out/Function/Curry").Curry<(subdomain: string, type: string) => string>; export declare const k8sGroup: import("ts-toolbelt/out/Function/Curry").Curry<(type: string) => string>; export declare const subdomainGroup: import("ts-toolbelt/out/Function/Curry").Curry<(subdomain: string, type: string) => string>; export declare const domainGroup: (type: string) => string; export declare const getSubdomainLabel: import("ts-toolbelt/out/Function/Curry").Curry<(subdomain: string, type: string, resource: KubernetesResource) => string>; export declare const getDomainLabel: import("ts-toolbelt/out/Function/Curry").Curry<(type: string, resource: KubernetesResource) => string>; export declare const getLabel: import("ts-toolbelt/out/Function/Curry").Curry<(key: string, resource: KubernetesResource) => string>; export declare const getSubdomainAnnotation: import("ts-toolbelt/out/Function/Curry").Curry<(subdomain: string, type: string, resource: KubernetesResource) => string>; export declare const getDomainAnnotation: import("ts-toolbelt/out/Function/Curry").Curry<(type: string, resource: KubernetesResource) => string>; export declare const getAnnotation: import("ts-toolbelt/out/Function/Curry").Curry<(key: string, resource: KubernetesResource) => string>; export declare const assignLabels: (value: Record<string, string>) => <R extends KubernetesResource>(resource: R) => R; export declare const assignAnnotations: (value: Record<string, string>) => <R extends KubernetesResource>(resource: R) => R; export declare function getGlobalNs(): string; export declare function createOwnerReference(owner: KubernetesResource, { blockOwnerDeletion, controller, }?: Partial<{ blockOwnerDeletion: boolean; controller: boolean; }>): OwnerReference; export declare const K8S_BINARY_UNITS: readonly ["Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi"]; export declare const K8S_DECIMAL_UNITS: readonly ["m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"]; export declare function parseQuantity(value: string): Quantity; export declare function convertQuantityUnit(targetUnit: QuantityUnit): (source: Quantity) => Quantity; export declare function convertQuantityUnit(targetUnit: QuantityUnit, source: Quantity): Quantity; export declare function getProjectNs(project: string, cluster: string): string; export interface Quantity { value: number; unit: QuantityUnit; } export type QuantityUnit = (typeof K8S_BINARY_UNITS)[number] | (typeof K8S_DECIMAL_UNITS)[number];