UNPKG

typesxml

Version:

Open source XML library written in TypeScript

77 lines (76 loc) 3.25 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 { AttributeInfo, Grammar, GrammarType, ValidationResult } from '../grammar/Grammar.js'; import { SchemaAttributeDecl } from './SchemaAttributeDecl.js'; import { SchemaElementDecl } from './SchemaElementDecl.js'; export declare class SchemaGrammar implements Grammar { private elementDecls; private complexTypeDecls; private simpleTypeDecls; private targetNamespaces; private namespaceDeclarations; private globalAttributeDecls; private importedGrammars; private typeHierarchy; private xsiTypeByDepth; private depth; private wildcardSkipDepth; private wildcardParentDecls; private nilDepths; private activeScopes; private completedKeys; private elementPath; private documentIds; private documentIdrefs; private defaultNsStack; private childNamespacesByDepth; constructor(); addTargetNamespace(namespace: string): void; addNamespaceDeclaration(prefix: string, uri: string): void; addGlobalAttributeDecl(decl: SchemaAttributeDecl): void; addImportedGrammar(namespace: string, grammar: SchemaGrammar): void; addComplexTypeDecl(typeName: string, decl: SchemaElementDecl): void; addSimpleTypeDecl(typeName: string, decl: SchemaElementDecl): void; addTypeHierarchyEntry(typeName: string, baseTypeName: string, method: string): void; mergeFrom(other: SchemaGrammar): void; addElementDecl(decl: SchemaElementDecl): void; getElementDecl(name: string): SchemaElementDecl | undefined; getElementTextDefault(element: string): string | undefined; validateElement(element: string, namespace: string, children: string[], text: string): ValidationResult; validateAttributes(element: string, attributes: Map<string, string>): ValidationResult; getElementAttributes(element: string): Map<string, AttributeInfo>; getDefaultAttributes(element: string): Map<string, string>; resolveEntity(_name: string): string | undefined; getGrammarType(): GrammarType; getTargetNamespaces(): Set<string>; getNamespaceDeclarations(): Map<string, string>; private anyAttributeCovers; private resolvePrefix; private fixedValueMatches; private buildElementKey; private validateTokenForType; private localName; private lookupElementDecl; private getBlockedDerivationMethod; private getFinalBlockedMethod; private isTypeDerivedFrom; private parseSelectorSegments; private parseFieldPath; private parseFieldAlternatives; private selectorMatchesAtDepth; private collectTextFieldsFromElement; private collectDescendantFieldsFromElement; private commitTuple; private validateKeyrefScope; private collectAttributeFields; private tupleKey; }