UNPKG

typesxml

Version:

Open source XML library written in TypeScript

49 lines (48 loc) 1.79 kB
/******************************************************************************* * Copyright (c) 2023-2026 Maxprograms. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 1.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/org/documents/epl-v10.html * * Contributors: * Maxprograms - initial API and implementation *******************************************************************************/ import { ContentParticle } from "./contentParticle.js"; export declare const Cardinality: { readonly NONE: 0; readonly OPTIONAL: 1; readonly ZEROMANY: 2; readonly ONEMANY: 3; }; export declare const ContentModelType: { readonly EMPTY: "EMPTY"; readonly ANY: "ANY"; readonly MIXED: "Mixed"; readonly PCDATA: "#PCDATA"; readonly CHILDREN: "Children"; }; export declare class ContentModel { private content; private type; constructor(content: Array<ContentParticle>, type: typeof ContentModelType[keyof typeof ContentModelType]); static parse(modelString: string): ContentModel; getContent(): Array<ContentParticle>; getType(): typeof ContentModelType[keyof typeof ContentModelType]; validateParentheses(contentString: string): void; parseSpec(modelString: string): ContentModel; isContentParticle(obj: any): boolean; processGroup(group: Array<any>): ContentParticle; toString(): string; isMixed(): boolean; getChildren(): Set<string>; validateChildren(children: string[]): boolean; private matchParticle; private matchNameParticle; private matchSequenceParticle; private matchChoiceParticle; private matchSequenceOnce; private getMinOccurs; private getMaxOccurs; }