UNPKG

@veltdev/types

Version:

Velt is an SDK to add collaborative features to your product within minutes. Example: Comments like Figma, Frame.io, Google docs or sheets, Recording like Loom, Huddles like Slack and much more.

86 lines (69 loc) 2.03 kB
import { Observable } from "rxjs"; import { RewriterAskAiRequest, RewriterAskAiResponse, RewriterReplaceTextRequest, RewriterReplaceTextResponse, RewriterAddCommentRequest, RewriterAddCommentResponse, RewriterEventTypesMap } from "../data/rewriter-events.data.model"; export declare class RewriterElement { /** * To enable rewriter feature */ enableRewriter: () => void; /** * To disable rewriter feature */ disableRewriter: () => void; /** * To enable the default rewriter UI on text selection */ enableDefaultUI: () => void; /** * To disable the default rewriter UI on text selection */ disableDefaultUI: () => void; /** * Subscribe to rewriter events */ on: <T extends keyof RewriterEventTypesMap>(action: T) => Observable<RewriterEventTypesMap[T]>; /** * Call AI with the currently selected text */ askAi: (request: RewriterAskAiRequest) => Promise<RewriterAskAiResponse>; /** * Replace the selected text in the DOM with the given text */ replaceText: (request: RewriterReplaceTextRequest) => Promise<RewriterReplaceTextResponse>; /** * Add a comment annotation on the selected text with the given text as comment body */ addComment: (request: RewriterAddCommentRequest) => Promise<RewriterAddCommentResponse>; constructor(); /** * To enable rewriter feature */ private _enableRewriter; /** * To disable rewriter feature */ private _disableRewriter; /** * To enable the default rewriter UI on text selection */ private _enableDefaultUI; /** * To disable the default rewriter UI on text selection */ private _disableDefaultUI; /** * Subscribe to rewriter events */ private _on; /** * Call AI with the currently selected text */ private _askAi; /** * Replace the selected text in the DOM with the given text */ private _replaceText; /** * Add a comment annotation on the selected text with the given text as comment body */ private _addComment; }