import type { Returns, Join, Showable, UnionToTuple } from '@traversable/registry'; import { symbol } from '@traversable/registry'; import { t } from '@traversable/schema'; export { neverToString as never, unknownToString as unknown, anyToString as any, voidToString as void, nullToString as null, undefinedToString as undefined, symbolToString as symbol, booleanToString as boolean, integerToString as integer, bigintToString as bigint, numberToString as number, stringToString as string, eqToString as eq, refToString as ref, arrayToString as array, recordToString as record, unionToString as union, intersectToString as intersect, optionalToString as optional, tupleToString as tuple, objectToString as object, }; declare const Symbol_optional: typeof symbol.optional; export declare function toType(x: unknown): string; export declare namespace toType { export var eq: (x: S) => toType.eq; export var ref: (id: Id) => toType.ref; export var intersect: (xs: S) => toType.intersect; export var union: (xs: S) => toType.union; export var record: (x: S) => toType.record; export var tuple: (xs: S) => toType.tuple; export var optional: (x: S) => toType.optional; export var array: (x: S) => toType.array; export var object: >(xs: S) => toType.object; export var never: "never"; export var unknown: "unknown"; export var any: "any"; var _a: "void"; export var undefined: "undefined"; var _b: "null"; export var symbol: "symbol"; export var boolean: "boolean"; export var integer: "number"; export var number: "number"; export var bigint: "bigint"; export var string: "string"; export { _a as void, _b as null }; } export declare namespace toType { export type eq = [_] extends [never] ? [T] extends [symbol] ? 'symbol' : string : [T] extends [string] ? `'${_}'` : _; export type ref = `${Id & string}`; export type intersect = never | [T] extends [readonly []] ? 'unknown' : `(${Join<{ [I in keyof T]: Returns; }, ' & '>})`; export type union = never | [T] extends [readonly []] ? 'never' : `(${Join<{ [I in keyof T]: Returns; }, ' | '>})`; /** @ts-expect-error */ export type record = never | `Record}>`; export type tuple = never | `[${Join<{ [I in keyof T]: `${ /** @ts-expect-error */ T[I] extends { [Symbol_optional]: any; } ? `_?: ${Returns}` : Returns}`; }, ', '>}]`; /** @ts-expect-error */ export type optional = never | `(${Returns} | undefined)`; /** @ts-expect-error */ export type array = `(${Returns})[]`; export { object_ as object }; export type object_> = never | [keyof T] extends [never] ? '{}' : `{ ${Join<{ [I in keyof _]: `'${_[I]}${T[_[I]] extends { [Symbol_optional]: any; } ? `'?` : `'`}: ${Returns}`; }, ', '>} }`; } interface neverToString { toType(): typeof toType.never; } interface unknownToString { toType(): typeof toType.unknown; } interface anyToString { toType(): typeof toType.any; } interface voidToString { toType(): typeof toType.void; } interface nullToString { toType(): typeof toType.null; } interface undefinedToString { toType(): typeof toType.undefined; } interface bigintToString { toType(): typeof toType.bigint; } interface symbolToString { toType(): typeof toType.symbol; } interface booleanToString { toType(): typeof toType.boolean; } interface integerToString { toType(): typeof toType.integer; } interface numberToString { toType(): typeof toType.number; } interface stringToString { toType(): typeof toType.string; } declare function neverToString(): "never"; declare function unknownToString(): "unknown"; declare function anyToString(): "any"; declare function voidToString(): "void"; declare function undefinedToString(): "undefined"; declare function nullToString(): "null"; declare function symbolToString(): "symbol"; declare function booleanToString(): "boolean"; declare function integerToString(): "number"; declare function bigintToString(): "bigint"; declare function numberToString(): "number"; declare function stringToString(): "string"; interface eqToString { toType(): Returns>; } interface refToString { toType(): Returns>; } interface arrayToString { toType(): Returns>; } interface optionalToString { toType(): Returns>; [Symbol_optional]: number; } interface recordToString { toType(): Returns>; } interface unionToString { toType(): Returns>; } interface intersectToString { toType(): Returns>; } interface tupleToString { toType(): Returns>; } interface objectToString> { toType(): Returns>; } declare function eqToString(this: t.eq): toType.eq; declare function refToString(this: t.ref): `${Id & string}`; declare function arrayToString(this: t.array): `(${Returns})[]`; declare function optionalToString(this: t.optional): `(${Returns} | undefined)`; declare function recordToString(this: t.record): `Record}>`; declare function unionToString(this: t.union): toType.union; declare function intersectToString(this: t.intersect): toType.intersect; declare function tupleToString(this: t.tuple): `[${Join<{ [I in keyof S]: `${S[I] extends { [symbol_optional]: any; } ? `_?: ${Returns}` : Returns}`; }, ", ", "">}]`; declare function objectToString(this: t.object): toType.object T) => void : never : never : never) extends (_: infer _) => void ? _ : never) extends () => infer X ? X : never>>; //# sourceMappingURL=toType.d.ts.map