@adeu/core 1.6.6 → 1.6.8

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/index.d.cts CHANGED
@@ -40,6 +40,7 @@ declare class DocumentObject {
40
40
  */
41
41
  static load(buffer: Buffer | ArrayBuffer): Promise<DocumentObject>;
42
42
  relateTo(part: Part, relType: string): void;
43
+ relateToExternal(target: string, relType: string): string;
43
44
  save(): Promise<Buffer>;
44
45
  }
45
46
 
@@ -55,8 +56,6 @@ declare class Run {
55
56
  constructor(_element: Element, _parent: any);
56
57
  }
57
58
 
58
- declare function extractTextFromBuffer(buffer: Buffer, cleanView?: boolean): Promise<string>;
59
-
60
59
  interface TextSpan {
61
60
  start: number;
62
61
  end: number;
@@ -201,6 +200,7 @@ declare class RedlineEngine {
201
200
 
202
201
  declare function trim_common_context(target: string, new_val: string): [number, number];
203
202
  declare function generate_edits_from_text(original_text: string, modified_text: string): ModifyText[];
203
+ declare function create_unified_diff(original_text: string, modified_text: string, context_lines?: number): string;
204
204
 
205
205
  declare function apply_edits_to_markdown(markdown_text: string, edits: ModifyText[], include_index?: boolean, highlight_only?: boolean): string;
206
206
 
@@ -238,10 +238,23 @@ interface OutlineNode {
238
238
  }
239
239
  declare function extract_outline(doc: DocumentObject, projected_body: string, body_pages: string[], body_page_offsets: number[], paragraph_offsets?: Record<string, [number, number]> | null): OutlineNode[];
240
240
 
241
- /**
242
- * @adeu/core
243
- * Cross-platform XML Redlining Engine
244
- */
245
- declare const identifyEngine: () => string;
241
+ declare function extractTextFromBuffer(buffer: Buffer, cleanView?: boolean): Promise<string>;
242
+
243
+ interface FinalizeOptions {
244
+ filename: string;
245
+ sanitize_mode?: 'full' | 'keep-markup' | 'baseline';
246
+ accept_all?: boolean;
247
+ protection_mode?: 'read_only' | 'encrypt' | null;
248
+ password?: string | null;
249
+ author?: string | null;
250
+ export_pdf?: boolean;
251
+ }
252
+ interface FinalizeResult {
253
+ reportText: string;
254
+ outBuffer?: Buffer;
255
+ }
256
+ declare function finalize_document(doc: DocumentObject, options: FinalizeOptions): Promise<FinalizeResult>;
257
+
258
+ declare function identifyEngine(): string;
246
259
 
247
- export { BatchValidationError, DocumentMapper, DocumentObject, type OutlineNode, type PageInfo, type PaginationResult, RedlineEngine, type TextSpan, apply_edits_to_markdown, extractTextFromBuffer, extract_outline, generate_edits_from_text, identifyEngine, paginate, split_structural_appendix, trim_common_context };
260
+ export { BatchValidationError, DocumentMapper, DocumentObject, type FinalizeOptions, type FinalizeResult, type OutlineNode, type PageInfo, type PaginationResult, RedlineEngine, type TextSpan, apply_edits_to_markdown, create_unified_diff, extractTextFromBuffer, extract_outline, finalize_document, generate_edits_from_text, identifyEngine, paginate, split_structural_appendix, trim_common_context };
package/dist/index.d.ts CHANGED
@@ -40,6 +40,7 @@ declare class DocumentObject {
40
40
  */
41
41
  static load(buffer: Buffer | ArrayBuffer): Promise<DocumentObject>;
42
42
  relateTo(part: Part, relType: string): void;
43
+ relateToExternal(target: string, relType: string): string;
43
44
  save(): Promise<Buffer>;
44
45
  }
45
46
 
@@ -55,8 +56,6 @@ declare class Run {
55
56
  constructor(_element: Element, _parent: any);
56
57
  }
57
58
 
58
- declare function extractTextFromBuffer(buffer: Buffer, cleanView?: boolean): Promise<string>;
59
-
60
59
  interface TextSpan {
61
60
  start: number;
62
61
  end: number;
@@ -201,6 +200,7 @@ declare class RedlineEngine {
201
200
 
202
201
  declare function trim_common_context(target: string, new_val: string): [number, number];
203
202
  declare function generate_edits_from_text(original_text: string, modified_text: string): ModifyText[];
203
+ declare function create_unified_diff(original_text: string, modified_text: string, context_lines?: number): string;
204
204
 
205
205
  declare function apply_edits_to_markdown(markdown_text: string, edits: ModifyText[], include_index?: boolean, highlight_only?: boolean): string;
206
206
 
@@ -238,10 +238,23 @@ interface OutlineNode {
238
238
  }
239
239
  declare function extract_outline(doc: DocumentObject, projected_body: string, body_pages: string[], body_page_offsets: number[], paragraph_offsets?: Record<string, [number, number]> | null): OutlineNode[];
240
240
 
241
- /**
242
- * @adeu/core
243
- * Cross-platform XML Redlining Engine
244
- */
245
- declare const identifyEngine: () => string;
241
+ declare function extractTextFromBuffer(buffer: Buffer, cleanView?: boolean): Promise<string>;
242
+
243
+ interface FinalizeOptions {
244
+ filename: string;
245
+ sanitize_mode?: 'full' | 'keep-markup' | 'baseline';
246
+ accept_all?: boolean;
247
+ protection_mode?: 'read_only' | 'encrypt' | null;
248
+ password?: string | null;
249
+ author?: string | null;
250
+ export_pdf?: boolean;
251
+ }
252
+ interface FinalizeResult {
253
+ reportText: string;
254
+ outBuffer?: Buffer;
255
+ }
256
+ declare function finalize_document(doc: DocumentObject, options: FinalizeOptions): Promise<FinalizeResult>;
257
+
258
+ declare function identifyEngine(): string;
246
259
 
247
- export { BatchValidationError, DocumentMapper, DocumentObject, type OutlineNode, type PageInfo, type PaginationResult, RedlineEngine, type TextSpan, apply_edits_to_markdown, extractTextFromBuffer, extract_outline, generate_edits_from_text, identifyEngine, paginate, split_structural_appendix, trim_common_context };
260
+ export { BatchValidationError, DocumentMapper, DocumentObject, type FinalizeOptions, type FinalizeResult, type OutlineNode, type PageInfo, type PaginationResult, RedlineEngine, type TextSpan, apply_edits_to_markdown, create_unified_diff, extractTextFromBuffer, extract_outline, finalize_document, generate_edits_from_text, identifyEngine, paginate, split_structural_appendix, trim_common_context };