typesxml
Version:
Open source XML library written in TypeScript
97 lines (96 loc) • 3.8 kB
TypeScript
/*******************************************************************************
* 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 { SchemaAttributeDecl } from './SchemaAttributeDecl.js';
import { SchemaContentModel } from './SchemaContentModel.js';
import { SchemaFacets } from './SchemaTypeValidator.js';
export interface IdentityConstraint {
name: string;
kind: 'key' | 'keyref' | 'unique';
selector: string;
fields: string[];
refer?: string;
}
export declare class SchemaElementDecl {
private name;
private namespace;
private contentModel;
private attributeDecls;
private anyAttribute;
private anyAttributeNamespace;
private anyAttributeProcessContents;
private anyAttributeOwnerNs;
private anyAttributeExcludedNamespaces;
private simpleType;
private textFacets;
private declaredTypeName;
private abstract;
private blockConstraints;
private finalConstraints;
private nillable;
private unionMemberTypes;
private unionAlternatives;
private listItemType;
private identityConstraints;
private fixedValue;
private defaultValue;
private qualified;
constructor(name: string, namespace?: string, contentModel?: SchemaContentModel);
getName(): string;
getNamespace(): string | undefined;
getContentModel(): SchemaContentModel;
setContentModel(model: SchemaContentModel): void;
addAttributeDecl(decl: SchemaAttributeDecl): void;
addAttributeDeclWithKey(name: string, decl: SchemaAttributeDecl): void;
getAttributeDecl(name: string): SchemaAttributeDecl | undefined;
getAttributeDecls(): Map<string, SchemaAttributeDecl>;
setSimpleType(type: string): void;
getSimpleType(): string | undefined;
setTextFacets(facets: SchemaFacets): void;
validateText(value: string): boolean;
hasTextFacets(): boolean;
setAnyAttribute(namespace?: string, processContents?: string, ownerNs?: string, excludedNamespaces?: string[]): void;
allowsAnyAttribute(): boolean;
getAnyAttributeNamespace(): string;
getAnyAttributeProcessContents(): string;
getAnyAttributeOwnerNs(): string | undefined;
getAnyAttributeExcludedNamespaces(): string[] | undefined;
setDeclaredTypeName(typeName: string): void;
getDeclaredTypeName(): string | undefined;
setAbstract(value: boolean): void;
isAbstractElement(): boolean;
setBlockConstraints(constraints: Set<string>): void;
getBlockConstraints(): Set<string>;
setFinalConstraints(constraints: Set<string>): void;
getFinalConstraints(): Set<string>;
setNillable(value: boolean): void;
isNillable(): boolean;
setUnionMemberTypes(types: string[]): void;
getUnionMemberTypes(): string[] | undefined;
setUnionAlternatives(alts: Array<{
facets: SchemaFacets;
baseType: string;
}>): void;
getUnionAlternatives(): Array<{
facets: SchemaFacets;
baseType: string;
}> | undefined;
setListItemType(type: string): void;
getListItemType(): string | undefined;
addIdentityConstraint(constraint: IdentityConstraint): void;
getIdentityConstraints(): IdentityConstraint[] | undefined;
setFixedValue(value: string): void;
getFixedValue(): string | undefined;
setDefaultValue(value: string): void;
getDefaultValue(): string | undefined;
setQualified(value: boolean): void;
isQualified(): boolean;
}