Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/docxml/mod.ts>ContentTypesXml

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

Constructors

new
ContentTypesXml(location: string)

Properties

readonly
defaults: Array<ContentTypeDefault>

Methods

protected
toNode(): Document
addDefault(extension: string, contentType: 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)
getType(location: string): FileMime | undefined

Static Methods

fromArchive(archive: Archive, location: string)

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