{"version":3,"file":"nodeType.mjs","names":[],"sources":["../../src/nodeType.ts"],"sourcesContent":["export const TRANSLATION = 'translation' as const;\nexport const ENUMERATION = 'enumeration' as const;\nexport const PLURAL = 'plural' as const;\nexport const CONDITION = 'condition' as const;\nexport const INSERTION = 'insertion' as const;\nexport const FILE = 'file' as const;\nexport const OBJECT = 'object' as const;\nexport const ARRAY = 'array' as const;\nexport const NESTED = 'nested' as const;\nexport const REACT_NODE = 'reactNode' as const;\nexport const PREACT_NODE = 'preactNode' as const;\nexport const SOLID_NODE = 'solidNode' as const;\nexport const MARKDOWN = 'markdown' as const;\nexport const HTML = 'html' as const;\nexport const TEXT = 'text' as const;\nexport const NUMBER = 'number' as const;\nexport const BOOLEAN = 'boolean' as const;\nexport const GENDER = 'gender' as const;\nexport const NULL = 'null' as const;\nexport const UNKNOWN = 'unknown' as const;\n\n/**\n * NodeType strings that correspond to plugins that can be conditionally\n * removed from the bundle when unused.\n */\nexport const PLUGIN_NODE_TYPES: readonly [\n  typeof TRANSLATION,\n  typeof ENUMERATION,\n  typeof PLURAL,\n  typeof CONDITION,\n  typeof INSERTION,\n  typeof GENDER,\n  typeof NESTED,\n  typeof FILE,\n  typeof MARKDOWN,\n  typeof HTML,\n  typeof REACT_NODE,\n  typeof PREACT_NODE,\n  typeof SOLID_NODE,\n] = [\n  TRANSLATION,\n  ENUMERATION,\n  PLURAL,\n  CONDITION,\n  INSERTION,\n  GENDER,\n  NESTED,\n  FILE,\n  MARKDOWN,\n  HTML,\n  REACT_NODE,\n  PREACT_NODE,\n  SOLID_NODE,\n] as const;\n\nexport type NodeType =\n  | typeof TRANSLATION\n  | typeof ENUMERATION\n  | typeof PLURAL\n  | typeof CONDITION\n  | typeof INSERTION\n  | typeof FILE\n  | typeof OBJECT\n  | typeof ARRAY\n  | typeof NESTED\n  | typeof REACT_NODE\n  | typeof PREACT_NODE\n  | typeof SOLID_NODE\n  | typeof MARKDOWN\n  | typeof HTML\n  | typeof TEXT\n  | typeof NUMBER\n  | typeof BOOLEAN\n  | typeof GENDER\n  | typeof NULL\n  | typeof UNKNOWN;\n\ntype AdditionalAttributesType = {\n  [key: string]: unknown;\n};\n\nexport type TypedNodeModel<\n  T extends NodeType,\n  Content,\n  AdditionalAttributes extends AdditionalAttributesType = {},\n> = {\n  nodeType: T;\n} & {\n  [K in T]: Content;\n} & AdditionalAttributes;\n\nexport const formatNodeType = <\n  T extends NodeType,\n  Content = unknown,\n  AdditionalAttributes extends AdditionalAttributesType = {},\n>(\n  nodeType: T,\n  content: Content,\n  additionalAttributes?: { [key: string]: unknown }\n) =>\n  ({\n    ...additionalAttributes,\n    nodeType,\n    [nodeType]: content,\n  }) as TypedNodeModel<T, Content, AdditionalAttributes>;\n"],"mappings":";AAAA,MAAa,cAAc;AAC3B,MAAa,cAAc;AAC3B,MAAa,SAAS;AACtB,MAAa,YAAY;AACzB,MAAa,YAAY;AACzB,MAAa,OAAO;AACpB,MAAa,SAAS;AACtB,MAAa,QAAQ;AACrB,MAAa,SAAS;AACtB,MAAa,aAAa;AAC1B,MAAa,cAAc;AAC3B,MAAa,aAAa;AAC1B,MAAa,WAAW;AACxB,MAAa,OAAO;AACpB,MAAa,OAAO;AACpB,MAAa,SAAS;AACtB,MAAa,UAAU;AACvB,MAAa,SAAS;AACtB,MAAa,OAAO;AACpB,MAAa,UAAU;;;;;AAMvB,MAAa,oBAcT;CACF;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAsCD,MAAa,kBAKX,UACA,SACA,0BAEC;CACC,GAAG;CACH;EACC,WAAW;CACb"}