{"version":3,"sources":["../../../../src/transpiler/enumeration/enumeration.ts"],"sourcesContent":["import {\n  type TypedNodeModel,\n  formatNodeType,\n  NodeType,\n} from '../../types/index';\n\ntype Positif = number | `${number}`;\ntype Negatif = `-${number}`;\ntype Numbers = Positif | Negatif;\n\ntype Equal = Numbers;\ntype EqualString = `=${Numbers}`;\ntype Superior = `>${Numbers}`;\ntype SuperiorOrEqual = `>=${Numbers}`;\ntype Inferior = `<${Numbers}`;\ntype InferiorOrEqual = `<=${Numbers}`;\n\nexport type EnterFormat =\n  | Equal\n  | EqualString\n  | Superior\n  | SuperiorOrEqual\n  | Inferior\n  | InferiorOrEqual;\n\nexport type EnumerationContentState<Content> = Partial<\n  Record<EnterFormat, Content>\n> & {\n  fallback?: Content;\n};\n\nexport type EnumerationContent<Content = unknown> = TypedNodeModel<\n  NodeType.Enumeration,\n  EnumerationContentState<Content>\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to pick a content based on a quantity.\n *\n * Usage:\n *\n * ```ts\n * enu({\n *  '<=-2.3': 'You have less than -2.3',\n *  '<1': 'You have less than one',\n *  '2': 'You have two',\n *  '>=3': 'You have three or more',\n * });\n * ```\n *\n * > The order of the keys will define the priority of the content.\n *\n */\nconst enumeration = <Content>(content?: EnumerationContentState<Content>) =>\n  formatNodeType(NodeType.Enumeration, content);\n\nexport { enumeration as enu };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAIO;AAmDP,MAAM,cAAc,CAAU,gBAC5B,6BAAe,sBAAS,aAAa,OAAO;","names":[]}