UNPKG

@ts-for-gir/lib

Version:

Typescript .d.ts generator from GIR for gjs

75 lines (74 loc) 2.55 kB
/** * Removes line breaks and consecutive white spaces from a given string * @param str * @returns */ export declare const cleanString: (str: string) => string; /** * Get the first character of a string * @param str The string to get the first character from * @returns The first character */ export declare const getFirstChar: (str: string) => string; /** * Get the last character of a string * @param str The string to get the last character from * @returns The last character */ export declare const getLastChar: (str: string) => string; /** * Check if the first character of a string is numeric * @param str The string to check * @returns Whether the first character is numeric or not */ export declare const isFirstCharNumeric: (str: string) => boolean; /** * Convert a string to camelCase, keeps the first alphabet character as it is. * @param str The string to convert * @returns The converted string */ export declare const camelCase: (str: string) => string; /** * Convert a string to `lowerCamelCase` * @param str The string to convert * @returns The converted string */ export declare const lowerCamelCase: (str: string) => string; /** * Convert a string to `PascalCase` * @param str The string to convert * @returns The converted string */ export declare const pascalCase: (str: string) => string; /** Alias for {@link pascalCase} */ export declare const upperCamelCase: (str: string) => string; /** * Convert a string to `snake_case` * @param str The string to convert * @returns The converted string */ export declare const snakeCase: (str: string) => string; /** * Convert a string to `kebab-case` * @param str The string to convert * @returns The converted string */ export declare const kebabCase: (str: string) => string; /** Alias for {@link kebabCase} */ export declare const slugCase: (str: string) => string; export declare const underscores: (str: string) => string; /** * Add indents to a string * @param indents The number of indents * @param spaceForIndent The number of spaces for each indent * @returns The indented string */ export declare const generateIndent: (indents?: number, spaceForIndent?: number) => string; /** * Merge a large array of strings by using a smaller chunk size * @param target The target array to merge into * @param source The source array to merge from * @param chunkSize The size of the chunks to merge * @returns The merged array */ export declare const mergeLargeStringArray: (target: string[], source: string[], chunkSize?: number) => string[];