import type { SourceLayer } from '../../../factories/create-source-layer.js'; import type { AdditionalTextData, AdditionalTextDataText } from '../../../typings/raw/index.js'; export type LayerSequence = { sourceLayers: SourceLayer[]; additionalTextDataText?: AdditionalTextDataText; }; export declare class TextLayerGroupingservice { private _originalAdditionalTextData; /** @_additionalTextDataWithOctopusSpecialCharacters is used to replace text in merged text layers. * Resulting Octopus has its own special characters for endline and double endline. * SourceLayerText textValue does not have these special characters. */ private _additionalTextDataWithOctopusSpecialCharacters; /** @_additionalTextData field is original additionalTextData cleaned from special characters as input @SourceLayerText * textValue has no special characters. We then match SourceLayerText textValue against this input field. */ private _additionalTextData; /** @_currentMatches field contains matches against incoming block of text with @remainder field * which indicates remaining text to be matched. Matched text is sliced out from the @remainder field. */ private _currentMatches; /** @_layerSequences is result of whole procedure as we need coherent sequence of SourceLayerText which will * form 1 OctopusTextLayer. For other layers than SourceLayerText, is only 1 layer in the sequence. */ private _layerSequences; /** @_lastTextLayerSequence if sequence of SourceTextLayers together with @AditionalTextDataText. We keep this reference * so that we can either push next SourceTextLayer into sequence or start new sequence if next SourceTextLayer is not part * of the sequence */ private _lastTextLayerSequence; static END_LINE: string; static DOUBLE_END_LINE: string; /** these are new special characters found in text END_LINE_UNICODE was easy to google, but T I have no idea what it * is. Opened issue with new special characters being introduced and asked for mapping. * https://gitlab.avcd.cz/opendesign/illustrator-parser-pdfcpu/-/issues/4 */ static END_LINE_UNICODE: string; static TAB: string; static END_LINE_OCTOPUS: string; static DOUBLE_END_LINE_OCTOPUS: string; static OCTOPUS_DICTIONARY: { [x: string]: string; }; static ADDITIONAL_TEXT_DATA_DICTIONARY: { [x: string]: string; }; static SPECIAL_CHARACTERS: string[]; static TEXT_LAYER: string; static OCTOPUS_EXTRA_CHARACTERS: string[]; constructor(additionalTextData: AdditionalTextData); private _replaceAllSpecialCharacters; private _initAdditionalTextData; /** @_getRemainingTextMatches selects all matches which have remainder field starting with * SourceLayerText.textValue and cuts out matching text from the remainder. Sliced out text lenghts * can differ due to trailing hyphens which are not present in AdditionalTextData but can be present in * original text. */ private _getRemainingTextMatches; /** @_setCurrentMatches sets current matches with already text from incoming @SourceLayerText already * sliced out. */ private _setCurrentMatches; /** Whenever we find and use best match in AdditionalTextData, we need to remove it so it does not * get used again. All source texts should be covered by AdditionalTextData once and only once. */ private _eliminateMatchFromAdditionalTextData; /** @_isSourceLayerPartOfLastTextSequence determines if we should start new layerSequence by comparing the * incoming sourceLayerText textvalue to remainders of previous LayerSequence. */ private _isSourceLayerPartOfLastTextSequence; /** @_getBestMatch finds best match according to shortest remainder criteria. * AdditionalTextData can have texts which are longer than input text as some of the texts are hidden, * but we need to put in all text from additonalTextData into octopus. */ private _getBestMatch; /** AdditionalTextData can have texts which are longer than input text as some of the texts are hidden, * but we need to put in all text from additonalTextData into Octopus. Therefore we copy the best match into * LayerSequence so it can be used whole (even the text which is not is SourceLayerText) */ private _addBestMatchToLastTextLayerSequence; private _setNewLastLayerTextSequence; private _pushTextLayer; getLayerSequences(sourceLayers: SourceLayer[]): LayerSequence[]; }