@azure-tools/codegen
Version:
Autorest Code generator common and base classes
48 lines • 3.48 kB
TypeScript
import { TextPossibilities } from "./file-generator";
export declare const lineCommentPrefix = "//";
export declare const docCommentPrefix = "///";
export declare const EOL = "\n";
export declare const CommaChar = ", ";
export declare function capitalize(str: string): string;
export declare function uncapitalize(str: string): string;
export declare function join<T>(items: Array<T>, separator: string): string;
export declare function joinComma<T>(items: Array<T>, mapFn: (item: T) => string): string;
export interface IHasName {
name: string;
}
export declare function sortByName(a: IHasName, b: IHasName): number;
export declare function setIndentation(spaces: number): void;
export declare function trimDots(content: string): string;
export declare function toMap<T>(source: Array<T>, eachFn: (item: T) => string): Map<string, Array<T>>;
export declare function fixEOL(content: string): string;
export declare function indent(content: string, factor?: number): string;
export declare function comment(content: string, prefix?: string, factor?: number, maxLength?: number): string;
export declare function docComment(content: string, prefix?: string, factor?: number, maxLength?: number): string;
export declare function dotCombine(prefix: string, content: string): string;
export declare function map<T, U>(dictionary: Record<string, T>, callbackfn: (key: string, value: T) => U, thisArg?: any): Array<U>;
export declare function ToMap<T>(dictionary: Record<string, T>): Map<string, T>;
export declare function __selectMany<T>(multiArray: Array<Array<T>>): Array<T>;
export declare function pall<T, U>(array: Array<T>, callbackfn: (value: T, index: number, array: Array<T>) => Promise<U>, thisArg?: any): Promise<Array<U>>;
export declare function deconstruct(identifier: string | Array<string>): Array<string>;
export declare function isCapitalized(identifier: string): boolean;
export declare function convert(num: number): Iterable<string>;
export declare function fixLeadingNumber(identifier: Array<string>): Array<string>;
export declare function removeProhibitedPrefix(identifier: string, prohibitedPrefix: string, skipIdentifiers?: Array<string>): string;
export declare function isEqual(s1: string, s2: string): boolean;
export declare function removeSequentialDuplicates(identifier: Iterable<string>): string[];
export declare function pascalCase(identifier: string | Array<string>, removeDuplicates?: boolean): string;
export declare function camelCase(identifier: string | Array<string>): string;
export declare function getPascalIdentifier(name: string): string;
export declare function escapeString(text: string | undefined): string;
/** emits c# to get the name of a property - uses nameof when it can, and uses a literal when it's an array value. */
export declare function nameof(text: string): string;
export declare function getRegions(source: string, prefix?: string, postfix?: string): Generator<{
name: string;
start: string;
content: string;
end: string;
}, void, unknown>;
export declare function setRegion(source: string, region: string, content: TextPossibilities, prepend?: boolean, prefix?: string, postfix?: string): string;
export declare function _setRegion(source: string, region: string, content: TextPossibilities, prepend?: boolean, prefix?: string, postfix?: string): string;
export declare function selectName(nameOptions: Array<string>, reservedNames: Set<string>): string;
//# sourceMappingURL=text-manipulation.d.ts.map