import type { Args, Fn1 } from "../HKT"; import type { Nat } from "../Num"; import type { Inc } from "../Num/Int/Inc"; import type { AssertNat } from "../helpers"; /** * Get the length of a string. * * Sig: `(s: string) => Nat` */ export type Length = AssertNat< S extends `${string}${infer R}` ? Inc> : 0 >; /** * [Fn] Get the length of a string. * * Sig: `(s: string) => Nat` */ export default interface LengthFn extends Fn1 { def: ([s]: Args) => Length; }