Referencia de API
API de Utilidades y Tipos
Referencia de SchemaLocations, CurrencyDecimals, RegimenCapitalRemover, SatNsDefinitionsMover, helpers DOM/XML y tipos TypeScript.
Referencia de las clases utilitarias, funciones globales y tipos exportados en @nodecfdi/cfdi-core y @nodecfdi/cfdi-core/types.
SchemaLocations
constructor(pairs?: Record<string, string>)size: number/length: number(getters)isEmpty(): booleanpairs(): Record<string, string>has(namespace: string): booleangetNamespacesWithoutLocation(): string[]hasAnyNamespaceWithoutLocation(): booleanappend(namespace: string, location: string): voidremove(namespace: string): voidasString(): string[Symbol.iterator](): IterableIterator<[string, string]>static fromString(schemaLocationValue: string, includeLastUnpairedItem?: boolean): SchemaLocationsstatic fromStringStrictXsd(schemaLocationValue: string): SchemaLocations
CurrencyDecimals
constructor(currency: string, decimals: number)currency(): stringdecimals(): numberround(value: Decimal.Value): DecimaldoesNotExceedDecimals(value: string): booleanstatic decimalsCount(value: string): numberstatic newFromKnownCurrencies(currency: string, defaultDecimals?: number): CurrencyDecimalsstatic knownCurrencyDecimals(currency: string): number
RegimenCapitalRemover
constructor(...suffixes: string[])remove(name: string): stringstatic createDefault(): RegimenCapitalRemover
SatNsDefinitionsMover
move(root: XmlNodeInterface): void
Funciones de formato y números
formatNumber(value: Decimal.Value, decimals?: number): stringformatDatetime(value: Date | number, useUtc?: boolean): stringtoFloat(value: string): numberroundNumber(num: Decimal.Value, precision: number): number
Funciones DOM y XML
getParser(): DOMParsergetSerializer(): XMLSerializergetDomImplementation(): DOMImplementationisNode(nodo: unknown): nodo is Node & { nodeType: number }isElement(nodo: unknown): nodo is ElementisAttribute(nodo: unknown): nodo is AttrisText(nodo: unknown): nodo is TextisDocument(nodo: unknown): nodo is DocumentisCDataSection(nodo: unknown): nodo is CDATASectiondocumentElement(document: Document): ElementownerDocument(node: Node): DocumentnewDocument(document?: Document): DocumentnewDocumentContent(content: string): DocumentisValidXmlName(name: string): booleancreateDomElement(makeElement: () => Element, errorMessage: string, content: string): ElementcreateElement(document: Document, name: string, content?: string): Element
Tipos (@nodecfdi/cfdi-core/types)
AttributeName<T extends string = string>AttributesRecord<T extends string = string>XmlNodeInterface<TAttributes extends string = string>ContainerWithAttributeInterfaceNamespaceFilter
Re-exportaciones externas
- Desde
@xmldom/xmldom:Attr,CDATASection,Document,DOMImplementation,DOMParser,Element,MIME_TYPE,NAMESPACE,Node,onErrorStopParsing,Text,XMLSerializer. - Desde
decimal.js:Decimal.
