xobuilder-extractor
Version:
> **A sophisticated web application that converts HTML and CSS to JSON layout through an intelligent multi-step flow process with AI validation.**
52 lines (51 loc) • 2.54 kB
TypeScript
import { GetStylesAEPInput, GetStylesInput } from './application/use-case/get-styles.use-case';
import { RawDataEEPV2 } from './domains/entities/general.entity';
import { ResultStyles, StylesResult } from './domains/entities/style.entity';
import { HtmlParsedResult } from './utils/get-value-html-parse';
import { Html2XojlConvertedInput, Html2XojlConvertedOutput } from './domains/ports/html-2-xojl.port';
export type { RawDataEEPV2, TrackElementData, } from './domains/entities/general.entity';
/**
* Convert html to xojl structure and get the entities
* @param input - The input to convert html to xojl structure
* @returns The data of the converted html to xojl structure
*/
export declare const Html2XojlConverted: (input: Html2XojlConvertedInput) => Promise<Html2XojlConvertedOutput>;
/**
* Parse the HTML and CSS string to get the minified parsed HTML and CSS, this parse is used for LLM easy detect XOJL structure
* @param html - The HTML string to parse
* @param css - The CSS string to parse
* @returns The parsed HTML and CSS
*/
export declare const parseHtml: (html: string, css: string) => HtmlParsedResult;
/**
* Get the styles of the a collection selector in selector
* @param input - The input to get the styles
* @returns The css and properties of the selector
*/
export declare const getStyles: (input: GetStylesInput) => StylesResult;
/**
* Get the raw styles and properties of the XOJL element
* This function convert css is styles field of element to styles of properties and minify css as input for LLM
* @param type - The type of the HTML
* @param cssText - The CSS string to parse
* @returns The raw styles and properties of the XOJL element
*/
export declare const getStylesAEP: (data: GetStylesAEPInput) => Promise<ResultStyles>;
/**
* Get the expanded element properties
* This function full fill entities of XOJL element from it properties from getStylesAEP and data LLM convert element's properties
* @param data - The data to get the expanded element properties
* @returns Entities of XOJL element
*/
export declare const getEEP: (data: RawDataEEPV2[]) => Promise<Record<string, any>>;
/**
* Minify the HTML and CSS structure
* It reduce script tag, optimize styles content in style tag, remove global selectors, remove unused selectors
* @param html - The HTML string to parse
* @param css - The CSS string to parse
* @returns The minified HTML and CSS
*/
export declare const minifyHtmlCssStructure: (html: string, css: string) => {
cleanHTML: string;
cleanCSS: string;
};