import type AppendFn from "./Append"; import type CapitalizeFn from "./Capitalize"; import type ConcatFn from "./Concat"; import type EndsWithFn from "./EndsWith"; import type IsDigitFn from "./IsDigit"; import type LengthFn from "./Length"; import type PrependFn from "./Prepend"; import type RepeatFn from "./Repeat"; import type ReverseFn from "./Reverse"; import type SplitFn from "./Split"; import type StartsWithFn from "./StartsWith"; import type ToCamelCaseFn from "./ToCamelCase"; import type ToCharsFn from "./ToChars"; import type ToLowerFn from "./ToLower"; import type ToSnakeCaseFn from "./ToSnakeCase"; import type ToUpperFn from "./ToUpper"; import type TrimFn from "./Trim"; import type TrimLeftFn from "./TrimLeft"; import type TrimRightFn from "./TrimRight"; import type UncapitalizeFn from "./Uncapitalize"; import type { PartialApply } from "../HKT"; import type { Nat } from "../Num"; /*********** * Methods * ***********/ /** * Methods for `string`. */ export namespace Str { /** * [Fn] Append a string (the 1st argument) to another string (the 2nd argument). * * Sig: `[ext: string](s: string) => string` */ export type Append = PartialApply; /** * [Fn] Prepend a string (the 1st argument) to another string (the 2nd argument). * * Sig: `[prefix: string](s: string) => string` */ export type Prepend = PartialApply; /** * [Fn] Concatenate two strings. * * Sig: `(s1: string, s2: string) => string` */ export type Concat = ConcatFn; /** * [Fn] Check if a string is a digit (i.e. 0-9). * * Sig: `(s: string) => boolean` */ export type IsDigit = IsDigitFn; export type StartsWith = PartialApply; export type EndsWith = PartialApply; /** * [Fn] Returns a list of characters of a string. * * Sig: `(s: string) => List` */ export type ToChars = ToCharsFn; export type Repeat = PartialApply; export type Capitalize = CapitalizeFn; export type Uncapitalize = UncapitalizeFn; /** * [Fn] Convert a string to uppercase. * * Sig: `(s: string) => string` */ export type ToUpper = ToUpperFn; /** * [Fn] Convert a string to lowercase. * * Sig: `(s: string) => string` */ export type ToLower = ToLowerFn; export type ToCamelCase = ToCamelCaseFn; export type ToSnakeCase = ToSnakeCaseFn; export type Trim = PartialApply; export type TrimLeft = PartialApply; export type TrimRight = PartialApply; /** * [Fn] Reverse a string. * * Sig: `(s: string) => string` */ export type Reverse = ReverseFn; /** * [Fn] Get the length of a string. The return type is a {@link Nat} (i.e., a natural * number). * * Sig: `(s: string) => Nat` */ export type Length = LengthFn; /** * [Fn] Split a string by a separator. * * Sig: `[sep: string](s: string) => List` */ export type Split = PartialApply; } /****************** * Static members * ******************/ /** * Empty string. */ export type Str$$Empty = ""; /** * A string that contains only whitespace characters. */ export type Str$$BlankChar = " " | "\t" | "\n" | "\r"; /**************** * Type classes * ****************/ export type { Str$$Monoid } from "./Monoid"; export type { Str$$Semigroup } from "./Semigroup"; export type { Str$$Show } from "./Show";