import { ISimpleType , union , literal , assertIsString , devMode } from "../../internal" ; hidden export type UnionStringArray < T extends string [ ] > = T [ number ] ; export function enumeration < T extends string > ( options ) ; export function enumeration < T extends string > ( name , options ) ; param name param options returns export function enumeration ( name , options ? ) { const realOptions = typeof name === "string" ? options ! : name ; if ( devMode ( ) ) { realOptions . forEach ( ( option , i ) => { assertIsString ( option , i + 1 ) ; } ) ; } const type = union ( ... realOptions . map ( ( option ) => literal ( "" + option ) ) ) ; if ( typeof name === "string" ) type . name = name ; return type ; }