/** @public */ export declare const Antidote: { launchAntidoteWebCorrector: (noeud: NodeOrListOfNodes, createWindow?: CreateWindowAntidoteWebFunction, appliedCorrectionFunction?: AppliedCorrectionFunction) => void; launchAntidoteCorrector: (noeud: NodeOrListOfNodes, createWindow?: CreateWindowAntidoteWebFunction, appliedCorrectionFunction?: AppliedCorrectionFunction) => void; AppUrl: string; AppOrigin: string; }; /** @public */ export declare const AntidoteConnector: { isDetected: () => boolean; announcePresence: () => void; launchCorrector: (listeNoeuds: HTMLElement[]) => void; getWebSocketPort: () => Promise; }; /** @public */ export declare interface AntidoteMessage { cdaw_version?: string; type?: string; message?: string; _dib105?: string; _dib100?: { _dib30: string; _dib31: number; _dib32: number; _dib99: string; }[]; _dib106?: boolean; _dib29?: boolean; _dib99?: string; _dib49?: number; _dib50?: number; _dib37?: string; _dib81?: string; _dib92?: string; debutContexte?: number; finContexte?: number; } /** @public */ export declare interface AntidoteWebWindow { sendMessageToAntidoteWeb(jsonMessage: AntidoteMessage): void; initializeCommunicationAntidoteWeb(): void; showDocument(): void; returnToDocument(): void; } /** * Copyright (c) 2025 Druide informatique * This software is licensed under the MIT License. * Ce logiciel est autorisé sous licence MIT. */ /** * List of the different detection types returned by Anti-Oops!. */ /** @public */ export declare enum AntiOopsDetectionType { errors = "errors", typography = "typography", attachments = "attachments", inactiveLanguage = "inactiveLanguage", abrasiveTone = "abrasiveTone" } /** @public */ export declare type AppliedCorrectionFunction = () => void; /** @public */ export declare function applyCorrection(node: HTMLElement, rangeToCorrect: StringRange, rangeToVerify?: StringRange): boolean; /** @public */ export declare function aWebMessageHandler(event: MessageEvent): void; /** * Copyright (c) 2025 Druide informatique * This software is licensed under the MIT License. * Ce logiciel est autorisé sous licence MIT. */ /** * Enumeration indicating the type of correction cache identifier to use */ /** @public */ export declare enum CacheIdentifierType { forcePath = "forcePath" } /** @public */ export declare class ConnectixAgent { private impl; constructor(wordProcessorAgent: WordProcessorAgent, getWebSocketPort: () => Promise); connectWithAntidote(): Promise; launchCorrector(): void; launchDictionaries(): void; launchGuides(): void; launchAntiOops(subject: string, body: string, recipients: [string] | undefined, id: string): void; close(): void; } /** @public */ export declare function createCordovaWindow(): AntidoteWebWindow; /** @public */ export declare function createPostMessageAntidoteWebWindow(): AntidoteWebWindow | null; /** @public */ export declare type CreateWindowAntidoteWebFunction = () => AntidoteWebWindow | null; /** * Copyright (c) 2025 Druide informatique * This software is licensed under the MIT License. * Ce logiciel est autorisé sous licence MIT. */ /** * Enumeration of the document types supported by Antidote. These correspond to the markup styles * supported by Antidote. Antidote will filter tags and commands in these file types so that only * textual portions are corrected. */ /** @public */ declare enum DocumentType_2 { text = "text", markdown = "markdown", latex = "latex", subrip = "subrip", html = "html" } export { DocumentType_2 as DocumentType } /** * Copyright (c) 2025 Druide informatique * This software is licensed under the MIT License. * Ce logiciel est autorisé sous licence MIT. */ /** @public */ export declare interface Message { /** JSON serialization */ toJSON(): string; } /** @public */ export declare type NodeOrListOfNodes = HTMLElement | HTMLElement[]; /** * Parameters when receiving the message that indicates whether a replacement is still possible. */ /** @public */ export declare interface ParamsAllowEdit { /** * Identifier of the text zone where verification should occur. */ zoneId: string; /** * String expected at the location specified by positions `position_start` and `position_end`. */ context: string; /** * Start position of `context`. */ positionStart: number; /** * End position of `context`. */ positionEnd: number; } /** * Parameters when a text zone request is made to the WordProcessorAgent. */ /** @public */ export declare interface ParamsGetZonesToCorrect { /** * Indicates whether only the selection's text zones should be returned or the entire document. */ forActiveSelection?: boolean; } /** * Parameters when receiving a new correction state. */ /** @public */ export declare interface ParamsNewCorrectionMemory { /** * Binary data of the correction state. Save it in a location that will be available during a subsequent * correction session with the same document(s). */ data: Uint8Array | string; } /** * Parameters when receiving the message to perform a replacement in the original text. */ /** @public */ export declare interface ParamsReplace { /** * Identifier of the text zone where the replacement should occur. */ zoneId: string; /** * String to replace in the text. */ newString: string; /** * Start position of the replacement. */ positionStartReplace: number; /** * End position of the replacement. */ positionReplaceEnd: number; } /** * Parameters when receiving a response from Anti-Oops!. */ /** @public */ export declare interface ParamsResponseAntiOops { /** * Identifier string provided in the Anti-Oops! request (see AntiOopsOutgoingRequest) */ id: string; /** * Error string if a communication or protocol error occurred (Optional) */ errorCode: string | undefined; /** * List of detections identified by Antidote in the Anti-Oops! request */ detections: [AntiOopsDetectionType] | undefined; } /** * Parameters when receiving the selection change message. */ /** @public */ export declare interface ParamsSelect { /** * Identifier of the text zone where the selection should be made. */ zoneId: string; /** * Start position of the selection to change. */ positionStart: number; /** * End position of the selection to change. */ positionEnd: number; } /** @public */ export declare function retrieveText(node: HTMLElement): string; /** @public */ export declare function selectInterval(element: HTMLElement, start: number, end: number): void; /** * Copyright (c) 2025 Druide informatique * This software is licensed under the MIT License. * Ce logiciel est autorisé sous licence MIT. */ /** * Type representing the settings for Antidote. */ /** @public */ export declare type Settings = unknown; /** @public */ export declare interface StringRange { start: number; end: number; string: string; } /** * Class representing a text zone to be corrected. */ /** @public */ export declare interface StyleInfo { /** * Start position of the style. */ positionStart: number; /** * End position of the style. */ positionEnd: number; /** * Type of text style. */ style: TextStyle; } /** * Copyright (c) 2025 Druide informatique * This software is licensed under the MIT License. * Ce logiciel est autorisé sous licence MIT. */ /** * Enumeration of the types of text styles applied to the text. */ /** @public */ export declare enum TextStyle { bold = "bold", italic = "italic", superscript = "superscript", subscript = "subscript", strike = "strike" } /** * Class representing a text zone to be corrected. */ /** @public */ export declare interface TextZoneConnectix { /** String corresponding to the text to correct. */ text: string; /** Identifier of the text zone. Must be unique and allow easy retrieval of the zone by this string. */ zoneId: string; /** Start position of the selection in the word processor. Undefined if no selection. */ positionSelectionStart?: number; /** End position of the selection in the word processor. Undefined if no selection. */ positionSelectionEnd?: number; /** Indicates whether this zone has focus (i.e., receives keyboard events). */ zoneIsFocused: boolean; /** List of styles present in `text` */ styleInfo?: StyleInfo[]; } /** * Abstract class representing a word processor that allows correction with Antidote of one or more documents with * one or more text zones. * * The mandatory methods to implement are `configuration`, `zones_to_correct` and `correct_into_word_processor`. The * other methods can be left empty and implemented only as needed for the specific application. */ /** @public */ export declare abstract class WordProcessorAgent { /** * Method called when the communication between WordProcessorAgent and Antidote is established. This is the place * to perform necessary initializations before the call that requests text zones. */ sessionStarted(): void; /** * Method called when the communication between WordProcessorAgent and Antidote is broken. This occurs, among other * things, when the correction window, dictionaries, guides, or Antidote itself closes. */ sessionEnded(): void; /** * Method called when the communication between WordProcessorAgent and Antidote is broken. This occurs, among other * things, when the correction window, dictionaries, guides, or Antidote itself closes. * * Args: * params (ParamsReplace): The parameters indicating where and what to replace in the original text. * * Return: * Indicates whether the replacement was possible. */ abstract correctIntoWordProcessor(params: ParamsReplace): boolean; /** * Indicates whether the text zones to be corrected are still available. For example, the document has closed and * therefore the text may no longer necessarily be correctable. * * Return: * Boolean indicating if the text zones are still accessible and correctable. */ textZonesAvailable(): boolean; /** * Méthode obligatoire : retourne la configuration du texteur. */ abstract configuration(): WordProcessorConfiguration; /** * Returns the path of the document being corrected. Antidote uses this to manage the correction state and * to retrieve ignored and applied detections from a previous correction session with the same text. * * https://www.antidote.info/en/documentation/user-guide/settings/corrector-settings/general-panel#remember-the-status-of-previous-corrections-between-sessions * * Return: * A string corresponding to the document path. Returning an empty string is possible so that Antidote * does not manage the correction state. */ documentPath(): string; /** * Indicates whether it is possible to make a correction at the location specified in `ParamsAllowEdit`. The idea is * to verify if the text Antidote received for correction is still valid for making corrections without losing data or * overwriting characters that would lead to corruption of the text. * * Args: * params (ParamsAllowEdit): parameter with positions and string to check. * * Return: * Boolean indicating whether the string (context) is within the interval and the positions in `params`. */ abstract allowEdit(params: ParamsAllowEdit): boolean; /** * Request to change the selection in the word processor according to the zone and positions specified in `params`. * * Args: * params (ParamsSelect): parameter indicating the zone and positions where to make the selection. */ selectInterval(_params: ParamsSelect): void; /** * Called when a new correction state is available. The data should be saved in a place where it can be provided again * during a subsequent correction session. This data may be supplied in the word processor configuration at the start * of the correction session (see `self.configuration`). * * Args: * params (ParamsNewCorrectionMemory): parameter containing the data corresponding to the correction state. */ newCorrectionMemory(_params: ParamsNewCorrectionMemory): void; /** * Called when Antidote requests to set focus on the selection in edit mode; that is, after this call, * the user should be able to start typing directly into the text being corrected. */ putFocusOnDocument(): void; /** * Called when Antidote requests to bring the word processor to the foreground. */ returnToWordProcessor(): void; /** * Method called when Antidote responds to an Anti-Oops! request. */ responseAntiOops(_params: ParamsResponseAntiOops): void; /** * Called when Antidote requests to send the document. */ send(): void; /** * Request text zones to be corrected by Antidote. It is possible to return only one zone with an * empty `zone_id`. If there are multiple zones, it is mandatory that the `zone_id`s are unique. * * Args: * params (ParamsGetZonesToCorrect): parameter indicating what text zones to return. See * `ParamsGetZonesToCorrect` for details. * * Returns: * List of `TextZone` indicating the text to correct. */ abstract zonesToCorrect(params: ParamsGetZonesToCorrect): TextZoneConnectix[]; } /** @public */ export declare class WordProcessorAgentTextArea extends WordProcessorAgent { private fieldsToCorrect; constructor(fieldsToCorrect: HTMLElement[]); correctIntoWordProcessor(params: ParamsReplace): boolean; configuration(): WordProcessorConfiguration; allowEdit(params: ParamsAllowEdit): boolean; selectInterval(params: ParamsSelect): void; zonesToCorrect(_params: ParamsGetZonesToCorrect): TextZoneConnectix[]; } /** @public */ export declare interface WordProcessorConfiguration { /** * Document title. Will be displayed in Antidote corrector's title bar. */ documentTitle?: string; /** * Carriage return type (e.g., "\\n", "\\r", "\\r\\n"). */ carriageReturn?: string; /** * Type indicating how to handle the correction state cache. */ cacheIdType?: CacheIdentifierType; /** * Indicates if carriage returns can be inserted from the corrector. */ allowCarriageReturn?: boolean; /** * Indicates if the word processor allows non‑breaking space usage. */ allowNBSpace?: boolean; /** * Indicates if the word processor allows fine space usage. */ allowThinSpace?: boolean; /** * Indicates whether the context allows sending an email from Antidote (Anti-Oops!). */ allowSending?: boolean; /** * Indicates if it is possible to replace text without necessarily making a selection. */ replaceWithoutSelection?: boolean; /** * Data representing the state of the last correction. */ correctionMemory?: Uint8Array | string; /** * Indicates the document type that will be corrected. */ activeMarkup?: DocumentType_2; /** * JSON data corresponding to settings used during correction. If None, the user's settings will be used. */ antidoteSettings?: Settings; } export { }