import { type IsEqual } from "../common"; type ComputeResult = Extract extends infer InferredResult extends GenericString ? IsEqual extends true ? GenericString & `${GenericSearchString}${string}` : InferredResult : never; /** * Checks whether a string starts with a substring. * * **Supported call styles:** * - Classic: `startsWith(input, searchString)` → returns a boolean * - Curried: `startsWith(searchString)` → returns a function waiting for the input * - Classic predicate: `startsWith(input, searchString)` → narrows the string type * - Curried predicate: `startsWith(searchString)` → narrows the string type * * The input string is not mutated. * * ```ts * const maybeValue = true ? "DuploJS" : "NestJS"; * * if (S.startsWith(maybeValue, "Du")) { * // maybeValue is "DuploJS" * } * * pipe( * maybeValue, * when( * S.startsWith("Du"), * (value) => { * // value is "DuploJS" * }, * ), * ); * * S.startsWith("DuploJS", "Du"); // true * * ``` * * @remarks * - Predicate overloads (type guards) narrow the output type * - Uses the same semantics as [`String.prototype.startsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) * * @see https://utils.duplojs.dev/en/v1/api/string/startsWith * * @namespace S * */ export declare function startsWith(searchString: GenericSearchString): (input: GenericString) => input is ComputeResult; export declare function startsWith(input: GenericString, searchString: GenericSearchString): input is ComputeResult; export {};