XmlDtdElement.d.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * Copyright (C) 2016-2019 Michael Kourlas
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /**
  17. * The options used to create a new element declaration.
  18. */
  19. export interface IXmlDtdElementOptions {
  20. /**
  21. * The text of the declaration.
  22. */
  23. charData: string;
  24. }
  25. /**
  26. * Represents an element declaration in a document type definition.
  27. *
  28. * An element declaration is structured as follows, where `{text}` is the
  29. * text of the declaration:
  30. *
  31. * ```xml
  32. * <!ELEMENT {text}>
  33. * ```
  34. */
  35. export default class XmlDtdElement<Parent> {
  36. private readonly _validation;
  37. private readonly _parent;
  38. private _charData;
  39. constructor(parent: Parent, validation: boolean, options: IXmlDtdElementOptions);
  40. /**
  41. * Gets the text of this element declaration.
  42. */
  43. get charData(): string;
  44. /**
  45. * Sets the text of this element declaration.
  46. */
  47. set charData(charData: string);
  48. /**
  49. * Returns an XML string representation of this element declaration.
  50. */
  51. toString(): string;
  52. /**
  53. * Returns the parent of this element declaration.
  54. */
  55. up(): Parent;
  56. }