Skip to content
Apertura
API reference

@apertura/ooxml

Shared Office Open XML layer: ZIP container, OPC package, relationships, XML parsing

109 exported symbols · 109 declared here · 0 re-exported

Classes

MediaResolver
class MediaResolver

Resolves package parts into URLs usable by `<img>` and CSS, and owns their lifetime. Two problems are solved here that every naive implementation gets wrong. First, leaks: `URL.createObjectURL` allocates a document-lifetime handle to the underlying blob. A viewer that creates one per image render and never revokes it keeps every version of every image alive for as long as the page lives. The manager hands out URLs and revokes all of them on {@link dispose}. Second, duplication: the same image is routinely referenced from many places (a logo in a header repeated on every page). Caching by part name means the bytes are inflated once and the browser decodes one image instead of dozens.

resolve
(partName: string) => Promise<string | undefined>
Returns a URL for a media part, creating it on first use. Concurrent calls for the same part share one inflate: the pending promise is cached, not just the result. Without that, a page with the same image in twenty places would inflate it twenty times in parallel.
size
number
Number of live object URLs; exposed for diagnostics and leak tests.
dispose
() => void
Revokes every URL handed out by this resolver.
OpcPackage
class OpcPackage

An OPC package (Open Packaging Conventions, ECMA-376 part 2). The shared container of docx, xlsx and pptx: a ZIP archive in which `[Content_Types].xml` assigns MIME types to parts and `.rels` files link parts to each other. Parsing this layer is identical for all three formats, so it lives apart from the format-specific packages.

open
(source: ByteSource, options?: ZipArchiveOptions) => Promise<OpcPackage>
archive
ZipArchive
Direct access to the archive, for cases where the OPC layer gets in the way.
parts
() => ZipEntry[]
All package parts, excluding directories and `.rels` bookkeeping files.
has
(partName: string) => boolean
partSize
(partName: string) => number
Size of a part after decompression, without reading it.
contentType
(partName: string) => string | undefined
MIME type of a part. An exact override is checked first, then the extension default. That order is mandated by the specification: `Override` always beats `Default`.
contentTypes
() => string[]
Every MIME type present in the package; used to identify the format.
findPartByContentType
(contentType: string) => string | undefined
Finds a part by its MIME type. For main parts the result is unique.
readPart
(partName: string) => Promise<Uint8Array>
readPartText
(partName: string) => Promise<string>
readPartXml
(partName: string) => Promise<XmlElement>
Reads a part and parses it as an XML tree.
openPartStream
(partName: string) => Promise<XmlPullParser>
Opens a part as a streaming XML parser. The right entry point for large parts — `document.xml`, worksheets, slides — where building a node tree would cost far more than the parse itself. The part is read uncached, because a streamed part is consumed exactly once.
relationships
(partName?: string) => Promise<Relationship[]>
Relationships of a part. An empty string means package-level relationships (`_rels/.rels`), where the parsing of any OOXML document starts: that is where the pointer to the main part lives.
relationshipMap
(partName?: string) => Promise<ReadonlyMap<string, Relationship>>
Builds an id → relationship index for a part. Resolving relationships by scanning the array is fine for a handful of lookups, but a document with thousands of hyperlinks and images turns that into quadratic work, so the renderer uses the map instead.
relationshipOfType
(type: string, partName?: string) => Promise<Relationship | undefined>
First relationship of the given type; used for single-instance parts.
relationshipsOfType
(type: string, partName?: string) => Promise<Relationship[]>
resolveTarget
(relationship: Relationship, ownerPartName?: string) => string
Resolves a relationship target into an absolute part path. External targets (hyperlinks, linked images) are returned unchanged, since they cannot be turned into an internal path.
mainPart
(relationshipType: string) => Promise<string | undefined>
The main document part, pointed at by a package-level relationship.
XmlPullParser
class XmlPullParser

A streaming (pull) XML parser. This is the foundation of the whole OOXML layer and the reason large documents stay fast. Building a full node tree for a 40 MB `document.xml` costs several hundred megabytes and a second of allocation before any useful work starts. A pull parser lets the consumer walk the file once and build only the domain model it actually needs, allocating nothing per element it chooses to skip. Design notes that matter for performance: - Element and namespace names are interned. A document contains millions of `w:t`/`w:r`/`w:p` tags but only a few dozen distinct names, so interning turns name comparison into pointer comparison and removes almost all string allocation. - Attributes are parsed lazily. Most elements are visited without their attributes ever being read, so they are only materialised on demand. - Text is decoded lazily. Whitespace-only text between tags is extremely common and is skipped without ever becoming a JavaScript string. The parser deliberately supports no DTD or external entities: office files never use them, and processing them is a well-known vulnerability class (XXE).

intern
(value: string) => string
Interns a string so repeated names share one allocation.
event
XmlEvent
localName
string
Local name of the current element, without its prefix. Interned.
namespace
string
Namespace URI of the current element. Interned.
prefix
string
depth
number
Nesting depth; the root element sits at depth 1.
isWhitespace
boolean
Whether the current `Text` event holds only whitespace. Lets a caller that materialises a tree drop indentation without having to inspect the text, and without the parser deciding that whitespace is never content — which for OOXML is false.
text
string
Text of the current `Text` event, decoded on first access.
next
() => boolean
Advances to the next event. Returns `false` once the document has been fully consumed.
onSkip
((namespace: string, localName: string, parent: string) => void) | undefined
Called for every element a reader passes over. A skipped element is an element the viewer draws nothing for, whether it was skipped because nobody has written the reader yet or because the element carries nothing a page can show. The two are indistinguishable from here and deliberately so: the point of the hook is an inventory of what a corpus contains and this parser walks past, measured rather than remembered, so that a gap is a line in a report instead of a note in a document saying it should be looked at one day. Static, and off unless something sets it: the readers are hot loops and a per-instance option would have to be threaded through every one of them.
onUnusedAttribute
((namespace: string, localName: string, attribute: string, parent: string) => void) | undefined
Called for every attribute of a start tag that no reader asked for. The element-level hook alone tells half the truth. A reader that takes `w:line` and `w:lineRule` from `w:spacing` and walks past `w:beforeAutospacing` has read the element, so nothing is reported — and the attribute that changes the spacing above every paragraph is invisible to the inventory. Attributes are where most of the remaining specification lives, so they are counted the same way elements are. `attribute` is the key as the attribute map holds it: a bare name for an unprefixed attribute, `namespace|local` for a qualified one. Costs a full attribute parse per element, so it is only paid when someone installs the hook — which is the coverage report and the strict mode, never a reader.
consumeElement
() => void
Passes over an element the reader has already acted on. The same walk as `skipElement`, without the report: an element with no attributes and no children — a tab, a soft hyphen, a footnote mark — is read by its name alone and then stepped over, and counting that as something the parser does not know buries the real gaps under the parser's own idiom. Five thousand tabs stood at the head of the list that way.
skipElement
() => void
Skips the entire subtree of the current element. The single most valuable operation for performance: the document parser can decide from the element name alone that a branch is irrelevant (revision metadata, spell-check state, rendering hints) and discard it without allocating anything. Must be called while positioned on a `StartElement`.
attr
(name: string, namespace?: string) => string | undefined
Value of an attribute of the current start tag, or `undefined`.
attributes
() => ReadonlyMap<string, string>
All attributes of the current start tag, keyed as `name` or `ns|name`.
readElementText
() => string
Reads the concatenated text content of the current element and consumes it. Positioned on a `StartElement`, it returns everything up to the matching end tag, ignoring nested markup. This is the common case for `<w:t>`, `<a:t>` and similar leaf elements.
namespaceFor
(prefix: string) => string
Resolves a namespace prefix against the declarations currently in scope. Needed wherever markup names a namespace by prefix in an attribute value rather than on an element — `mc:Choice/@Requires` being the case that matters, since deciding whether a document's newer markup can be read at all means turning those prefixes into namespaces.
ZipArchive
class ZipArchive

Random-access ZIP archive reader. Works on top of a {@link ByteSource} rather than an in-memory buffer: listing the contents of a 100 MB xlsx only requires reading a few kilobytes of central directory at the end of the file. Individual entries are inflated on demand, which is essential for large workbooks where most of the weight sits in one or two sheets that may never be opened.

open
(source: ByteSource, options?: ZipArchiveOptions) => Promise<ZipArchive>
entries
() => ZipEntry[]
All entries, in central directory order.
names
() => string[]
File names, excluding directories.
has
(name: string) => boolean
entry
(name: string) => ZipEntry | undefined
totalUncompressedSize
() => number
Total uncompressed size of every entry; used for progress reporting.
read
(name: string) => Promise<Uint8Array>
Reads and inflates the contents of an entry. The result is cached, bounded by {@link ZipArchiveOptions.maxCacheBytes}.
readText
(name: string) => Promise<string>
Reads an entry and decodes it as UTF-8; every OOXML part uses that encoding.
readUncached
(name: string) => Promise<Uint8Array>
Reads an entry without touching the cache. Used for one-shot reads of large parts — media files that are immediately turned into a blob URL, for instance — where caching would only waste memory.
clearCache
() => void
Drops every inflated entry held in the cache.
cachedBytes
number
Bytes currently held by the inflate cache; exposed for diagnostics.

Functions

attr
function attr(element: XmlElement, name: string, namespace?: string): string | undefined

Attribute value. Unprefixed attributes are looked up with an empty namespace.

attrBoolean
function attrBoolean(element: XmlElement, name: string, namespace?: string): boolean | undefined

Boolean attribute in the OOXML sense. In the `ST_OnOff` schema `1`, `true` and `on` mean true; the absence of the attribute on a flag element (such as `<w:b/>`) also means true.

attrNumber
function attrNumber(element: XmlElement, name: string, namespace?: string): number | undefined

Numeric attribute value; `undefined` when absent or not a number.

canonicalNamespace
function canonicalNamespace(uri: string): string
child
function child(element: XmlElement, namespace: string, name: string): XmlElement | undefined

First direct child with the given name.

childElements
function childElements(element: XmlElement): XmlElement[]

Direct child elements; text nodes are dropped.

children
function children(element: XmlElement, namespace: string, name: string): XmlElement[]

All direct children with the given name.

decodeDib
function decodeDib(bytes: Uint8Array, bitsOffset?: number): DecodedBitmap | undefined

Decodes a packed DIB — header, palette and bits in one run of bytes.

decodeEntities
function decodeEntities(text: string): string

Expands predefined entities and numeric character references.

descendants
function descendants(element: XmlElement, namespace: string, name: string): XmlElement[]

All descendants at any depth with the given name.

detectOoxmlFormat
function detectOoxmlFormat(pkg: OpcPackage): FormatId | undefined

Determines the concrete OOXML format from the type of the main part. This is the refinement the core cannot make: docx, xlsx and pptx are the same ZIP with the same signature, and only `[Content_Types].xml` tells them apart. File extensions are unreliable — renamed files turn up constantly — so the decision is made from the contents.

encodePng
function encodePng(width: number, height: number, rgba: Uint8Array): Uint8Array

Encodes 8-bit RGBA pixels, top row first, as a PNG.

firstDescendant
function firstDescendant(element: XmlElement, namespace: string, name: string): XmlElement | undefined

First descendant at any depth with the given name.

guessImageType
function guessImageType(bytes: Uint8Array): string

Infers an image MIME type from its magic bytes. `[Content_Types].xml` usually declares media types, but files written by third-party generators often omit the entry for an extension, and a blob with the wrong type simply fails to render.

inflateRaw
function inflateRaw(compressed: Uint8Array, expectedSize?: number): Promise<Uint8Array>
isElement
function isElement(node: XmlNode): node is XmlElement
isEmf
function isEmf(bytes: Uint8Array): boolean
isOnOffTrue
function isOnOffTrue(value: string | undefined): boolean

Interprets an `ST_OnOff` value.

isText
function isText(node: XmlNode): node is XmlText
isUnrenderableImageType
function isUnrenderableImageType(contentType: string): boolean

Image types that no browser can render natively.

isWmf
function isWmf(bytes: Uint8Array): boolean
metafileToSvg
function metafileToSvg(bytes: Uint8Array): string | undefined

Converts a metafile into an SVG document.

namespacePrefix
function namespacePrefix(uri: string): string
normalizePartName
function normalizePartName(partName: string): string

Normalises a part name: no leading slash, forward slashes only.

parseXml
function parseXml(input: string | Uint8Array): XmlElement

Parses XML into a node tree. Built on top of {@link XmlPullParser} so there is exactly one lexer in the codebase. The tree form is the right tool for the small configuration parts of an OOXML package — `styles.xml`, `numbering.xml`, `theme1.xml`, `.rels` — which are read in full, revisited repeatedly, and small enough that the convenience of random access outweighs the allocation cost. For `document.xml`, worksheets and slides, use the pull parser directly: those parts are read once, sequentially, and can be several tens of megabytes.

readCoreProperties
function readCoreProperties(pkg: OpcPackage): Promise<DocumentMetadata>

Reads document metadata from `docProps/core.xml`, `app.xml` and `custom.xml`. Parsing is identical for docx, xlsx and pptx because this is part of OPC, not of any specific format. All three parts are optional: files produced by third-party generators frequently omit them, and their absence must not stop the document from opening.

relationshipsPathFor
function relationshipsPathFor(partName: string): string

Path of a part's `.rels` file: `word/document.xml` → `word/_rels/document.xml.rels`.

resolvePartPath
function resolvePartPath(ownerPartName: string, target: string): string

Resolves a relationship target relative to its owning part. Targets come both absolute (`/word/media/image1.png`) and relative (`../media/image1.png`); both forms appear in files written by real Word.

textContent
function textContent(node: XmlNode): string

All text in the subtree, concatenated in document order.

walk
function walk(element: XmlElement): Generator<XmlElement>

Depth-first traversal of the subtree, including the element itself.

Interfaces

DecodedBitmap
interface DecodedBitmap

Device-independent bitmaps, as a metafile carries them. A DIB is what Windows called an image before there were image formats: a header, a palette when the depth needs one, and rows of pixels stored bottom to top and padded to a multiple of four bytes. Every bitmap inside an EMF or a WMF is one of these, so reading them is the difference between a diagram with its screenshots and a diagram with holes. The two headers that occur are the ancient `BITMAPCOREHEADER` and the `BITMAPINFOHEADER` everything since 1995 writes; both are read, because a metafile pasted from a twenty-year-old document really does contain the first.

width
number
height
number
rgba
Uint8Array<ArrayBufferLike>
8-bit RGBA, top row first.
Relationship
interface Relationship

A relationship between package parts (`.rels`).

id
string
type
string
Relationship type URI; see the `REL_*` constants.
target
string
Target path: relative to the owning part, or absolute from the package root.
targetMode
"Internal" | "External"
XmlAttribute
interface XmlAttribute

An XML attribute with its namespace resolved.

name
string
Local name without the prefix.
namespace
string
Namespace URI; an empty string means the attribute has no namespace.
value
string
XmlElement
interface XmlElement
type
"element"
name
string
Local name without the prefix, e.g. `p` for `<w:p>`.
namespace
string
Resolved namespace URI.
attributes
readonly XmlAttribute[]
children
readonly XmlNode[]
XmlText
interface XmlText
type
"text"
text
string
ZipArchiveOptions
interface ZipArchiveOptions

Options controlling how the archive caches inflated entries.

maxCacheBytes?
number | undefined
Maximum total size of cached inflated entries, in bytes. Caching matters because OOXML parts are read repeatedly (styles.xml is needed both when parsing the document and when rendering it), but an unbounded cache would hold a fully inflated 500 MB document in memory. Defaults to 64 MB, past which the least recently used entries are dropped.
ZipEntry
interface ZipEntry

One entry of the ZIP central directory.

name
string
Path inside the archive, always with forward slashes.
compressedSize
number
uncompressedSize
number
compressionMethod
number
crc32
number
localHeaderOffset
number
Offset of the local file header from the start of the file.
isDirectory
boolean
lastModified
Date | undefined

Type aliases

XmlNode
type XmlNode = XmlElement | XmlText

Values

CONTENT_TYPE_DOCX
CONTENT_TYPE_DOCX: "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"

Content types of main parts; used to identify the document format.

CONTENT_TYPE_DOCX_TEMPLATE
CONTENT_TYPE_DOCX_TEMPLATE: "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml"
CONTENT_TYPE_PPTX
CONTENT_TYPE_PPTX: "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"
CONTENT_TYPE_PPTX_SLIDESHOW
CONTENT_TYPE_PPTX_SLIDESHOW: "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml"
CONTENT_TYPE_PPTX_TEMPLATE
CONTENT_TYPE_PPTX_TEMPLATE: "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml"
CONTENT_TYPE_XLSX
CONTENT_TYPE_XLSX: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"
CONTENT_TYPE_XLSX_TEMPLATE
CONTENT_TYPE_XLSX_TEMPLATE: "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"
NS_CONTENT_TYPES
NS_CONTENT_TYPES: "http://schemas.openxmlformats.org/package/2006/content-types"

OPC package parts: content types and relationships.

NS_CORE_PROPERTIES
NS_CORE_PROPERTIES: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties"

Document metadata.

NS_CUSTOM_PROPERTIES
NS_CUSTOM_PROPERTIES: "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
NS_DC
NS_DC: "http://purl.org/dc/elements/1.1/"
NS_DC_TERMS
NS_DC_TERMS: "http://purl.org/dc/terms/"
NS_DOC_PROPS_VTYPES
NS_DOC_PROPS_VTYPES: "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"
NS_DRAWING
NS_DRAWING: "http://schemas.openxmlformats.org/drawingml/2006/main"

DrawingML — shared graphics for all three formats.

NS_DRAWING_CHART
NS_DRAWING_CHART: "http://schemas.openxmlformats.org/drawingml/2006/chart"
NS_DRAWING_DIAGRAM
NS_DRAWING_DIAGRAM: "http://schemas.openxmlformats.org/drawingml/2006/diagram"

SmartArt: the diagram definition, and the shapes Word laid out from it. The definition namespace is part of the standard, but the laid-out result is not: Word writes it under a Microsoft namespace as an extension. That drawing is what makes SmartArt viewable at all without reimplementing the diagram layout algorithms, so a reader that ignores extension parts renders nothing.

NS_DRAWING_DIAGRAM_SHAPE
NS_DRAWING_DIAGRAM_SHAPE: "http://schemas.microsoft.com/office/drawing/2008/diagram"
NS_DRAWING_PICTURE
NS_DRAWING_PICTURE: "http://schemas.openxmlformats.org/drawingml/2006/picture"
NS_DRAWING_SPREADSHEET
NS_DRAWING_SPREADSHEET: "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
NS_DRAWING_WORDPROCESSING
NS_DRAWING_WORDPROCESSING: "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
NS_EXTENDED_PROPERTIES
NS_EXTENDED_PROPERTIES: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
NS_MARKUP_COMPATIBILITY
NS_MARKUP_COMPATIBILITY: "http://schemas.openxmlformats.org/markup-compatibility/2006"

Markup Compatibility and Extensibility: `mc:AlternateContent` fallbacks.

NS_MATH
NS_MATH: "http://schemas.openxmlformats.org/officeDocument/2006/math"

Office Math Markup Language, used for equations.

NS_OFFICE_EXCEL_MAIN
NS_OFFICE_EXCEL_MAIN: "http://schemas.microsoft.com/office/excel/2006/main"
NS_OFFICE_RELATIONSHIPS
NS_OFFICE_RELATIONSHIPS: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"

The `r:id` reference namespace used inside document parts.

NS_PACKAGE_RELATIONSHIPS
NS_PACKAGE_RELATIONSHIPS: "http://schemas.openxmlformats.org/package/2006/relationships"
NS_PRESENTATION
NS_PRESENTATION: "http://schemas.openxmlformats.org/presentationml/2006/main"

PresentationML — pptx.

NS_SPREADSHEET
NS_SPREADSHEET: "http://schemas.openxmlformats.org/spreadsheetml/2006/main"

SpreadsheetML — xlsx.

NS_SPREADSHEET_X14
NS_SPREADSHEET_X14: "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"

The two namespaces Excel's own extensions live in. Everything added after the schema was published — sparklines, the newer conditional formats, slicers — is written inside an `extLst` under these, so that a reader of the published schema steps over what it cannot know.

NS_VML
NS_VML: "urn:schemas-microsoft-com:vml"

VML: the legacy vector format still emitted by Word for text boxes and shapes.

NS_VML_OFFICE
NS_VML_OFFICE: "urn:schemas-microsoft-com:office:office"
NS_VML_WORD
NS_VML_WORD: "urn:schemas-microsoft-com:office:word"
NS_WORD_2010
NS_WORD_2010: "http://schemas.microsoft.com/office/word/2010/wordml"

Word 2010+ extensions, where later features such as `w14:` live.

NS_WORD_2012
NS_WORD_2012: "http://schemas.microsoft.com/office/word/2012/wordml"
NS_WORD_DRAWING_2010
NS_WORD_DRAWING_2010: "http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"
NS_WORD_SHAPE
NS_WORD_SHAPE: "http://schemas.microsoft.com/office/word/2010/wordprocessingShape"

Shapes and text boxes as Word has written them since 2010. These appear only inside `mc:AlternateContent`, paired with a VML fallback for readers that predate them. The modern branch is the one that carries the text of a text box as ordinary WordprocessingML.

NS_WORD_SHAPE_GROUP
NS_WORD_SHAPE_GROUP: "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"
NS_WORDPROCESSING
NS_WORDPROCESSING: "http://schemas.openxmlformats.org/wordprocessingml/2006/main"

WordprocessingML — docx.

NS_XML
NS_XML: "http://www.w3.org/XML/1998/namespace"

The reserved `xml:` namespace, needed for `xml:space="preserve"`.

REL_ALT_CHUNK
REL_ALT_CHUNK: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk"
REL_CHART
REL_CHART: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"
REL_COMMENTS
REL_COMMENTS: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"
REL_COMMENTS_EXTENDED
REL_COMMENTS_EXTENDED: "http://schemas.microsoft.com/office/2011/relationships/commentsExtended"
REL_CORE_PROPERTIES
REL_CORE_PROPERTIES: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"
REL_CUSTOM_PROPERTIES
REL_CUSTOM_PROPERTIES: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties"
REL_DRAWING
REL_DRAWING: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing"
REL_ENDNOTES
REL_ENDNOTES: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes"
REL_EXTENDED_PROPERTIES
REL_EXTENDED_PROPERTIES: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"
REL_FONT
REL_FONT: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/font"
REL_FONT_TABLE
REL_FONT_TABLE: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"
REL_FOOTER
REL_FOOTER: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer"
REL_FOOTNOTES
REL_FOOTNOTES: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes"
REL_HEADER
REL_HEADER: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header"
REL_HYPERLINK
REL_HYPERLINK: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"
REL_IMAGE
REL_IMAGE: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
REL_NUMBERING
REL_NUMBERING: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"
REL_OFFICE_DOCUMENT
REL_OFFICE_DOCUMENT: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"

Relationship types used to locate the key parts of a document.

REL_SETTINGS
REL_SETTINGS: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"
REL_SHARED_STRINGS
REL_SHARED_STRINGS: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings"
REL_SLIDE
REL_SLIDE: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide"
REL_SLIDE_LAYOUT
REL_SLIDE_LAYOUT: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"
REL_SLIDE_MASTER
REL_SLIDE_MASTER: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"
REL_STYLES
REL_STYLES: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"
REL_TABLE
REL_TABLE: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table"
REL_THEME
REL_THEME: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"
REL_WORKSHEET
REL_WORKSHEET: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"

Enums

XmlEvent
XmlEvent: typeof XmlEvent

Kind of the event the pull parser is currently positioned on. Numeric rather than string-valued, so the hot dispatch loop in the document parser compares integers. A plain enum rather than a `const enum` because the values cross package boundaries, which ambient const enums cannot do under `verbatimModuleSyntax`.