import type { ReadonlyAry } from "."; import type { Args, GenericFn, GenericResolver } from "../HKT"; /** * Build a readonly array from a type. * * Sig: `(x: T) => ReadonlyArray` * * @example * ```typescript * type R1 = OfReadonly; * // ^?: readonly number[] * type R2 = OfReadonly<42>; * // ^?: readonly (42 | string)[] * ``` */ export type OfReadonly = readonly T[]; interface Resolver extends GenericResolver<[unknown], ReadonlyAry> { on1: ([x]: Args) => [[], ReadonlyAry]; } /** * [Fn] Build a readonly array from a type. * * Sig: `(x: T) => ReadonlyArray` */ export default interface OfReadonlyFn extends GenericFn { def: ([x]: Args) => OfReadonly; }