@wordinweb/agent 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ATE5QKBU.js → chunk-JK7OGOJB.js} +252 -24
- package/dist/chunk-JK7OGOJB.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +36 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-ATE5QKBU.js.map +0 -1
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -948,6 +948,8 @@ interface Paragraph {
|
|
|
948
948
|
interface TableCellProps {
|
|
949
949
|
/** Preferred width px (from tcW when dxa). */
|
|
950
950
|
width?: number;
|
|
951
|
+
/** Preferred width as a fraction of the table width (from tcW when pct). */
|
|
952
|
+
widthPct?: number;
|
|
951
953
|
/** The source explicitly declares tcW type="auto" (distinct from no tcW). */
|
|
952
954
|
widthAuto?: boolean;
|
|
953
955
|
gridSpan: number;
|
|
@@ -1263,6 +1265,8 @@ declare class Package {
|
|
|
1263
1265
|
private files;
|
|
1264
1266
|
constructor(data: Uint8Array);
|
|
1265
1267
|
static from(data: ArrayBuffer | Uint8Array): Package;
|
|
1268
|
+
/** A package over an already-unzipped entry map (DocxDocument.clone). */
|
|
1269
|
+
static fromFiles(files: Record<string, Uint8Array>): Package;
|
|
1266
1270
|
has(name: string): boolean;
|
|
1267
1271
|
binary(name: string): Uint8Array | undefined;
|
|
1268
1272
|
text(name: string): string | undefined;
|
|
@@ -1848,6 +1852,8 @@ declare class DocxDocument {
|
|
|
1848
1852
|
/** The header part roots, in package order. A watermark is authored into
|
|
1849
1853
|
* every one of them: Word paints it on every page, and a document with a
|
|
1850
1854
|
* first-page or even-page header has more than one header part. */
|
|
1855
|
+
/** The root of the header or footer part at `target`, if this document has one. */
|
|
1856
|
+
headerFooterRoot(target: string): XmlElement | undefined;
|
|
1851
1857
|
headerRoots(): XmlElement[];
|
|
1852
1858
|
/** The footer part roots, in package order — headerRoots' counterpart, for
|
|
1853
1859
|
* operations that walk both bands (the page-number gallery's removal
|
|
@@ -1900,6 +1906,13 @@ declare class DocxDocument {
|
|
|
1900
1906
|
private journalSetAttr;
|
|
1901
1907
|
private normalizePercentageTableGrids;
|
|
1902
1908
|
save(): Uint8Array;
|
|
1909
|
+
/**
|
|
1910
|
+
* An independent copy: what `DocxDocument.load(doc.save())` gives, without
|
|
1911
|
+
* zipping the package and unzipping it again. compareDocuments starts from a
|
|
1912
|
+
* copy of the revised document, and the round trip through the zip was a
|
|
1913
|
+
* third of its time on a document that had not changed at all.
|
|
1914
|
+
*/
|
|
1915
|
+
clone(): DocxDocument;
|
|
1903
1916
|
saveAsync(): Promise<Uint8Array>;
|
|
1904
1917
|
private buildPackage;
|
|
1905
1918
|
private buildPackageFiles;
|
|
@@ -1940,9 +1953,31 @@ declare class DocxDocument {
|
|
|
1940
1953
|
*/
|
|
1941
1954
|
private ensureRelsRoot;
|
|
1942
1955
|
/** Register an external hyperlink relationship and return its rId. */
|
|
1943
|
-
|
|
1956
|
+
/**
|
|
1957
|
+
* Copy the part that `source`'s main-document relationship `relId` points
|
|
1958
|
+
* at into this package, with every part it references in turn (a chart's
|
|
1959
|
+
* embedded workbook, SmartArt's layout, style and colour parts) and their
|
|
1960
|
+
* content types, and add a relationship to it. Returns the new
|
|
1961
|
+
* relationship id, or null when the source has no such internal part.
|
|
1962
|
+
*
|
|
1963
|
+
* compareDocuments needs this for struck content: a removed picture keeps
|
|
1964
|
+
* its w:drawing, and without its image part the result's reject-all
|
|
1965
|
+
* brought the picture back as an empty frame.
|
|
1966
|
+
*/
|
|
1967
|
+
adoptRelFrom(source: DocxDocument, relId: string, scope?: {
|
|
1968
|
+
from?: string | null;
|
|
1969
|
+
into?: string | null;
|
|
1970
|
+
}): string | null;
|
|
1971
|
+
/** Give a part copied from `source` the content type it had there. */
|
|
1972
|
+
private adoptContentType;
|
|
1973
|
+
addHyperlinkRel(url: string, ownerPart?: string | null): string;
|
|
1944
1974
|
/** Retarget an existing external relationship (hyperlink href edit). */
|
|
1945
1975
|
setRelTarget(relId: string, url: string): boolean;
|
|
1976
|
+
/** The relationships owned by `part` (a header or footer part), or by the
|
|
1977
|
+
* document part when null; a header or footer gets a rels root on demand. */
|
|
1978
|
+
private relsOwnerOf;
|
|
1979
|
+
/** The relationships of `part` (a header or footer), or of the document part. */
|
|
1980
|
+
relationshipsOf(part?: string | null): Relationships;
|
|
1946
1981
|
/** The relationships of the part that holds `source`: a header or footer
|
|
1947
1982
|
* part when the element is inside one, else the document part. */
|
|
1948
1983
|
private imageRelsOwner;
|
package/dist/index.js
CHANGED