Skip to main content
Module

x/docxml/mod.ts>ContentTypesXml

TypeScript (component) library for building and parsing a DOCX file
Go to Latest
class ContentTypesXml
extends XmlFile
import { ContentTypesXml } from "https://deno.land/x/docxml@5.12.0/mod.ts";

Constructors

new
ContentTypesXml(location: string)

Properties

readonly
defaults: Array<ContentTypeDefault>

Methods

protected
toNode(): Document
addDefault(extension: string, contentType: string | FileMime): void

Add a default content type association for a file extension.

addDefaults(defaults: Array<ContentTypeDefault>): void

Add multiple default content type/file extension associations. Useful for cloning an existing content type register.

addOverride(partName: string, contentType: FileMime)

Static Methods

fromArchive(archive: Archive, location: string)

Instantiate this class by looking at the DOCX XML for it.