@alauda-fe/common
Version:
Alauda frontend team common codes.
12 lines (11 loc) • 1.17 kB
TypeScript
import { DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions } from 'yaml';
import { KubernetesResource } from '../types/public-api';
export { stringify } from 'yaml';
export declare const parse: <T>(yaml: string, options?: ParseOptions & DocumentOptions & SchemaOptions & ToJSOptions) => T;
export declare const safeParseYaml: <T>(yaml: string, defaultValue?: T, options?: ParseOptions & DocumentOptions & SchemaOptions & ToJSOptions) => T;
export declare const parseAll: <T>(yaml: string) => T[];
export type YamlFilterItem = string | ((resource: KubernetesResource) => string[]);
export declare function yamlFilterField<T extends KubernetesResource>(resource: T, filterList: YamlFilterItem[], deepClone?: boolean): T;
export declare const removeDirtyFieldsBeforeUpdate: <T extends KubernetesResource>(resource: T) => T;
export declare function prefixFilterRuleFactory(prefix: string, path: string[], includeOrStartsWith?: Extract<keyof string, 'includes' | 'startsWith'>): <T extends KubernetesResource>(resource: T) => string[];
export declare function emptyObjectRemoveRuleFactory(path: string[]): <T extends KubernetesResource>(resource: T) => string[];