UNPKG

kubernetes-fluent-client

Version:

A @kubernetes/client-node fluent API wrapper that leverages K8s Server Side Apply.

97 lines 4.27 kB
import { GenerateOptions } from "./generate.js"; /** * Normalizes indentation for TypeScript lines to a consistent format. * * @param lines The generated TypeScript lines. * @returns The lines with normalized indentation. */ export declare function normalizeIndentation(lines: string[]): string[]; /** * Normalizes the indentation of a single line to use two spaces instead of four. * * @param line The line of code to normalize. * @returns The line with normalized indentation. */ export declare function normalizeLineIndentation(line: string): string; /** * Normalizes spacing between property names and types in TypeScript lines. * * @param lines The generated TypeScript lines. * @returns The lines with normalized property spacing. */ export declare function normalizePropertySpacing(lines: string[]): string[]; /** * Processes a single line inside a class extending `GenericKind`. * * @param line The current line of code. * @param genericKindProperties The list of properties from `GenericKind`. * @param foundInterfaces The set of found interfaces in the file. * @returns The modified line. */ export declare function modifyAndNormalizeClassProperties(line: string, genericKindProperties: string[], foundInterfaces: Set<string>): string; /** * Normalizes lines after processing, including indentation, spacing, and removing unnecessary lines. * * @param lines The lines of the file content. * @param opts The options for processing. * @returns The normalized lines. */ export declare function normalizeIndentationAndSpacing(lines: string[], opts: GenerateOptions): string[]; /** * Removes lines containing `[property: string]: any;` from TypeScript files. * * @param lines The generated TypeScript lines. * @param opts The options for processing. * @returns The lines with `[property: string]: any;` removed. */ export declare function removePropertyStringAny(lines: string[], opts: GenerateOptions): string[]; /** * Applies ESLint and property modifiers to a line of code. * * @param line - The current line of code. * @param genericKindProperties - The list of properties from `GenericKind`. * @param foundInterfaces - The set of found interfaces in the file. * @returns The modified line. */ export declare function modifyPropertiesAndAddEslintDirective(line: string, genericKindProperties: string[], foundInterfaces: Set<string>): string; /** * Adds an ESLint disable comment for `[key: string]: any` if it's not part of `GenericKind`. * * @param line The current line of code. * @param genericKindProperties The list of properties from `GenericKind`. * @returns The modified line with the ESLint disable comment. */ export declare function processEslintDisable(line: string, genericKindProperties: string[]): string; /** * Applies property modifiers to a line of code. * * @param line The current line of code. * @param genericKindProperties The list of properties from `GenericKind`. * @param foundInterfaces The set of found interfaces in the file. * @returns The modified line. */ export declare function addDeclareAndOptionalModifiersToProperties(line: string, genericKindProperties: string[], foundInterfaces: Set<string>): string; /** * Adds the `declare` keyword to `GenericKind` properties. * * @param line The current line of code. * @param genericKindProperties The list of properties from `GenericKind`. * @returns The modified line with the `declare` keyword, if applicable. */ export declare function addDeclareToGenericKindProperties(line: string, genericKindProperties: string[]): string; /** * Makes a property optional if its type matches one of the found interfaces and it is not already optional. * * @param line The current line of code. * @param foundInterfaces The set of found interfaces in the file. * @returns The modified line with the optional `?` symbol. */ export declare function makePropertiesOptional(line: string, foundInterfaces: Set<string>): string; /** * Generates a regular expression to match a property pattern in TypeScript. * * @param prop The property name to match. * @returns A regular expression to match the property pattern. */ export declare function getPropertyPattern(prop: string): RegExp; //# sourceMappingURL=normalization.d.ts.map