croco-html 0.2.7 → 0.2.9

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.
@@ -1,10 +1,11 @@
1
1
  import { HtmlBodyTag } from "../models/models";
2
+ import { HtmlExtractionOptions } from "./HtmlExtractionMethods";
2
3
  import { InterfaceBlock } from "./InterfaceBlock";
3
4
  export declare class BodyTagsExtensions {
4
5
  static getDescription(tagName: string): string;
5
6
  static toHtml(bodyTags: HtmlBodyTag[]): string;
6
7
  static imageTagToHtml(imageTag: HtmlBodyTag): string;
7
- static getBodyTags(html: string): HtmlBodyTag[];
8
+ static getBodyTags(html: string, options: HtmlExtractionOptions): HtmlBodyTag[];
8
9
  static sanitizeInnerHtml(html: string): string;
9
10
  static toBodyTag(data: InterfaceBlock): HtmlBodyTag;
10
11
  }
@@ -1,9 +1,13 @@
1
1
  import { InterfaceBlock } from "./InterfaceBlock";
2
2
  import { GenericTextTag } from "./TextSimpleMethods";
3
+ export interface HtmlExtractionOptions {
4
+ useCustomDomain: boolean;
5
+ domain: string;
6
+ }
3
7
  export declare class HtmlExtractionMethods {
4
8
  static ExtractHeaderTag(elem: HTMLElement, tagName: string): GenericTextTag;
5
9
  static Extractors: {
6
- [x: string]: ((elem: HTMLElement) => import("./ImageMethods").FileImageTag) | ((elem: HTMLElement) => {
10
+ [x: string]: ((elem: HTMLElement, options: HtmlExtractionOptions) => import("./ImageMethods").FileImageTag) | ((elem: HTMLElement, options: HtmlExtractionOptions) => {
7
11
  type: string;
8
12
  data: import("./TableMethods").TableData;
9
13
  validationResult: import("./TableMethods").BaseApiResponse;
@@ -22,15 +26,15 @@ export declare class HtmlExtractionMethods {
22
26
  data: import("./TableMethods").TableData;
23
27
  validationResult: import("./TableMethods").BaseApiResponse;
24
28
  bootstrapHtml: string;
25
- }) | ((elem: HTMLElement) => import("./TextMethods").RichTextData) | ((elem: HTMLElement) => {
29
+ }) | ((elem: HTMLElement, options: HtmlExtractionOptions) => import("./TextMethods").RichTextData) | ((elem: HTMLElement, options: HtmlExtractionOptions) => {
26
30
  type: string;
27
31
  data: {
28
32
  innerHTML: string;
29
33
  };
30
- }) | ((elem: HTMLElement) => GenericTextTag) | ((elem: HTMLElement) => import("./VideoMethods").ExternalVideoTag);
31
- TEXT: (elem: HTMLElement) => import("./TextSimpleMethods").SimpleTextTag;
32
- "FILE-IMAGE": (elem: HTMLElement) => import("./ImageMethods").FileImageTag;
33
- TABLE: (elem: HTMLElement) => {
34
+ }) | ((elem: HTMLElement, options: HtmlExtractionOptions) => GenericTextTag) | ((elem: HTMLElement, options: HtmlExtractionOptions) => import("./VideoMethods").ExternalVideoTag);
35
+ TEXT: (elem: HTMLElement, options: HtmlExtractionOptions) => import("./TextSimpleMethods").SimpleTextTag;
36
+ "FILE-IMAGE": (elem: HTMLElement, options: HtmlExtractionOptions) => import("./ImageMethods").FileImageTag;
37
+ TABLE: (elem: HTMLElement, options: HtmlExtractionOptions) => {
34
38
  type: string;
35
39
  data: import("./TableMethods").TableData;
36
40
  validationResult: import("./TableMethods").BaseApiResponse;
@@ -50,20 +54,20 @@ export declare class HtmlExtractionMethods {
50
54
  validationResult: import("./TableMethods").BaseApiResponse;
51
55
  bootstrapHtml: string;
52
56
  };
53
- "RICH-TEXT": (elem: HTMLElement) => import("./TextMethods").RichTextData;
54
- "HTML-RAW": (elem: HTMLElement) => {
57
+ "RICH-TEXT": (elem: HTMLElement, options: HtmlExtractionOptions) => import("./TextMethods").RichTextData;
58
+ "HTML-RAW": (elem: HTMLElement, options: HtmlExtractionOptions) => {
55
59
  type: string;
56
60
  data: {
57
61
  innerHTML: string;
58
62
  };
59
63
  };
60
- H1: (elem: HTMLElement) => GenericTextTag;
61
- H2: (elem: HTMLElement) => GenericTextTag;
62
- H3: (elem: HTMLElement) => GenericTextTag;
63
- H4: (elem: HTMLElement) => GenericTextTag;
64
- H5: (elem: HTMLElement) => GenericTextTag;
65
- H6: (elem: HTMLElement) => GenericTextTag;
64
+ H1: (elem: HTMLElement, options: HtmlExtractionOptions) => GenericTextTag;
65
+ H2: (elem: HTMLElement, options: HtmlExtractionOptions) => GenericTextTag;
66
+ H3: (elem: HTMLElement, options: HtmlExtractionOptions) => GenericTextTag;
67
+ H4: (elem: HTMLElement, options: HtmlExtractionOptions) => GenericTextTag;
68
+ H5: (elem: HTMLElement, options: HtmlExtractionOptions) => GenericTextTag;
69
+ H6: (elem: HTMLElement, options: HtmlExtractionOptions) => GenericTextTag;
66
70
  };
67
- static transformHtmlElementToBlocks(element: HTMLElement): InterfaceBlock[];
68
- static transformHtmlStringToBlocks(value: string): InterfaceBlock[];
71
+ static transformHtmlElementToBlocks(element: HTMLElement, options: HtmlExtractionOptions): InterfaceBlock[];
72
+ static transformHtmlStringToBlocks(value: string, options: HtmlExtractionOptions): InterfaceBlock[];
69
73
  }
@@ -1,3 +1,4 @@
1
+ import { HtmlExtractionOptions } from "./HtmlExtractionMethods";
1
2
  export declare class FileImageTagDataConsts {
2
3
  static TagName: string;
3
4
  static FileIdAttrName: string;
@@ -11,7 +12,7 @@ export interface FileImageTagData {
11
12
  fileId: number;
12
13
  }
13
14
  export declare class ImageMethods {
14
- static buildUrl(fileId: number): string;
15
- static buildSmallUrl(fileId: number): string;
16
- static ExtractImage(elem: HTMLElement): FileImageTag;
15
+ static buildUrl(fileId: number, options: HtmlExtractionOptions): string;
16
+ static buildSmallUrl(fileId: number, options: HtmlExtractionOptions): string;
17
+ static ExtractImage(elem: HTMLElement, options: HtmlExtractionOptions): FileImageTag;
17
18
  }
@@ -1,3 +1,4 @@
1
+ import { HtmlExtractionOptions } from './HtmlExtractionMethods';
1
2
  import { InterfaceBlock } from "./InterfaceBlock";
2
3
  export interface BaseApiResponse {
3
4
  isSucceeded: boolean;
@@ -32,7 +33,7 @@ export declare class TableTypes {
32
33
  static readonly TableRowColumn = "table-row-column";
33
34
  }
34
35
  export declare class TableMethods {
35
- static getTableFromHtmlTag(tableTag: HTMLTableElement): {
36
+ static getTableFromHtmlTag(tableTag: HTMLTableElement, options: HtmlExtractionOptions): {
36
37
  type: string;
37
38
  data: TableData;
38
39
  validationResult: BaseApiResponse;
@@ -54,5 +55,5 @@ export declare class TableMethods {
54
55
  };
55
56
  static checkTable(tableData: TableData): BaseApiResponse;
56
57
  static getHeader(tableTag: HTMLTableElement): TableHeaderData;
57
- static getTableRows(tableTag: HTMLTableElement): Array<TableRowData>;
58
+ static getTableRows(tableTag: HTMLTableElement, options: HtmlExtractionOptions): Array<TableRowData>;
58
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "croco-html",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=15.0.0",
6
6
  "@angular/core": ">=15.0.0",