// Source: https://github.com/sindresorhus/type-fest/blob/main/source/internal.d.ts#L49 type Newline = | '\u{A}' // '\n' | '\u{D}' // '\r' ; // Source: https://github.com/sindresorhus/type-fest/blob/main/source/trim.d.ts type TrimStart = S extends `${Newline}${infer R}` ? TrimStart : S; type TrimEnd = S extends `${infer R}${Newline}` ? TrimEnd : S; export type Trim = TrimStart>; /** Trim from the start and end of a string. @example ```js import {trimNewlines} from 'trim-newlines'; trimNewlines('\nšŸ¦„\nšŸ¦„\r\n'); //=> 'šŸ¦„\nšŸ¦„' ``` */ export function trimNewlines(string: S): Trim; /** Trim from the start of a string. @example ```js import {trimNewlinesStart} from 'trim-newlines'; trimNewlinesStart('\nšŸ¦„\r\n'); //=> 'šŸ¦„\r\n' ``` */ export function trimNewlinesStart(string: S): TrimStart; /** Trim from the end of a string. @example ```js import {trimNewlinesEnd} from 'trim-newlines'; trimNewlinesEnd('\nšŸ¦„\r\n'); //=> '\nšŸ¦„' ``` */ export function trimNewlinesEnd(string: S): TrimEnd;