/** Upper-cases the first character of the string if not empty. */ export declare function upperCaseFirst(s: string): string; /** * Converts standard boolean string values to a boolean: `always`, `true`, `y`, * `yes` for true; `n`, `no`, `never`, `false` for false (case-insensitive). */ export declare function parseBoolean(s: string): boolean; /** * Builds a function which checks whether a string matches the input glob. * Details on the globbing logic can be found in the underlying implementation: * https://github.com/micromatch/picomatch. The following options are different * from the default: * * + `bash` is true, * + `dot` is true, */ export declare function globPredicate(glob: string): GlobPredicate; /** Convenience more explicit type-alias. */ export type GlobPredicate = (s: string) => boolean; /** * Utility class for generating a mapping using globs as keys. This is useful * for example to control log level overrides and other environment-based * settings. */ export declare class GlobMapper { private readonly entries; readonly fallback: V | undefined; private constructor(); /** * Builds a new mapping from the input spec. Specs are comma-separated lists * of `=` entries. Both globs and values are trimmed from * whitespace. An optional mapping function (the second argument) can be * applied to each value. * * Later values override earlier ones when multiple matches occur. This allows * setting a global default first and overriding it for later entries. For * example `*=info,bar=trace` will yield the value `info` for everything * except `bar`. As a convenience, it's possible to omit the `=` part in * spec entries, which is interpreted as a global default (same as `*`). * * Details on the globbing logic can be found in the underlying * implementation: https://github.com/micromatch/picomatch. This class uses * the same options as `globPredicate` above. */ static forSpec(spec: string): GlobMapper; static forSpec(spec: string, fn: (s: string) => V): GlobMapper; /** * Returns a mapper which accepts booleans as values. These must be written in * a form compatible with `parseBoolean`. For example: `y` (always true`), * `n,foo=y` (false except for `foo`). */ static predicating(spec: string): GlobMapper; /** Returns the mapper's value for a given string */ map(arg: string): V | undefined; } /** Splits input on comma and trims each element. */ export declare function commaSeparated(str: string): ReadonlyArray; /** * Returns a sentence starting with "Please" and non-empty alternatives joined * with "or". */ export declare function please(...alts: (string | undefined)[]): string;