@xylabs/hex
Version:
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
17 lines • 688 B
TypeScript
import type { Brand } from '@xylabs/typeof';
import * as z from 'zod';
/** Branded type representing a validated lowercase hex string. */
export type BrandedHex = Brand<Lowercase<string>, {
readonly __hex: true;
}>;
/** Zod schema that validates and transforms a string into a branded Hex type. */
export declare const HexZod: z.ZodPipe<z.ZodString, z.ZodTransform<BrandedHex, string>>;
/** Configuration of validation and output format */
export interface HexConfig {
bitLength?: number;
byteSize?: number;
prefix?: boolean;
}
/** A validated hex string type, inferred from the HexZod schema. */
export type Hex = z.infer<typeof HexZod>;
//# sourceMappingURL=hex.d.ts.map