/**
 * Copyright 2023-present DreamNum Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import * as UniverCore from '@univerjs/core';
import { FRange } from '@univerjs/sheets/facade';
import * as ThreadComment from '@univerjs/thread-comment';
import { FTheadCommentBuilder, FThreadComment } from './f-thread-comment';
export type ISheetCellCommentCreateOptions = Pick<ThreadComment.ICreateThreadCommentOptions, 'attachments' | 'authorName' | 'dateTime' | 'id' | 'personId' | 'threadId'>;
/**
 * @ignore
 */
export interface IFRangeSheetsThreadCommentMixin {
    /**
     * Get the comment of the start cell in the current range.
     * @returns {FThreadComment | null} The comment of the start cell in the current range. If the cell does not have a comment, return `null`.
     * @example
     * ```ts
     * const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
     * if (!fWorksheet) return;
     * const range = fWorksheet.getActiveRange();
     * const comment = range.getComment();
     * ```
     */
    getComment(): UniverCore.Nullable<FThreadComment>;
    /**
     * Get the comments in the current range.
     * @returns {FThreadComment[]} The comments in the current range.
     * @example
     * ```ts
     * const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
     * if (!fWorksheet) return;
     * const range = fWorksheet.getActiveRange();
     * const comments = range.getComments();
     * comments.forEach((comment) => {
     *   console.log(comment.getRichText());
     * });
     * ```
     */
    getComments(): FThreadComment[];
    /**
     * Add a comment to the start cell in the current range.
     * @param content The content of the comment.
     * @param [options] Optional stable IDs, author, attachments, and creation time.
     * @returns {Promise<boolean>} Whether the comment is added successfully.
     * @throws {TypeError} If the content is empty.
     * @example
     * ```ts
     * await univerAPI.getActiveWorkbook()
     *   .getActiveSheet()
     *   .getRange('A1')
     *   .addCommentAsync('Verify this value.', { id: 'review-a1' });
     *
     * // Create a new comment
     * const richText = univerAPI.newRichText().insertText('hello univer');
     * const commentBuilder = univerAPI.newTheadComment()
     *   .setContent(richText);
     * console.log(commentBuilder.content.toPlainText());
     *
     * // Add the comment to the cell A1
     * const fWorkbook = univerAPI.getActiveWorkbook();
     * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
     * if (!fWorksheet) return;
     * const cell = fWorksheet.getRange('A1');
     * const result = await cell.addCommentAsync(commentBuilder);
     * console.log(result);
     * ```
     */
    addCommentAsync(content: ThreadComment.ThreadCommentContent | FTheadCommentBuilder, options?: ISheetCellCommentCreateOptions): Promise<boolean>;
    /**
     * Clear the comment of the start cell in the current range.
     * @returns {Promise<boolean>} Whether the comment is cleared successfully.
     * @example
     * ```ts
     * const range = univerAPI.getActiveWorkbook().getActiveSheet().getRange('A1');
     * const success = await range.clearCommentAsync();
     * console.log(success);
     * ```
     */
    clearCommentAsync(): Promise<boolean>;
    /**
     * Clear all of the comments in the current range.
     * @returns {Promise<boolean>} Whether the comments are cleared successfully.
     * @example
     * ```ts
     * const fWorksheet = univerAPI.getActiveWorkbook().getSheetByName('Sheet1');
     * if (!fWorksheet) return;
     * const range = fWorksheet.getActiveRange();
     * const success = await range.clearCommentsAsync();
     * ```
     */
    clearCommentsAsync(): Promise<boolean>;
}
/**
 * @ignore
 */
export declare class FRangeSheetsThreadCommentMixin extends FRange implements IFRangeSheetsThreadCommentMixin {
    private _dependencies;
    _initialize(injector: UniverCore.Injector): void;
    private _getCommentDataInRange;
    private _getStartCellCommentData;
    getComment(): UniverCore.Nullable<FThreadComment>;
    getComments(): FThreadComment[];
    addCommentAsync(content: ThreadComment.ThreadCommentContent | FTheadCommentBuilder, options?: ISheetCellCommentCreateOptions): Promise<boolean>;
    clearCommentAsync(): Promise<boolean>;
    clearCommentsAsync(): Promise<boolean>;
}
declare module '@univerjs/sheets/facade' {
    interface FRange extends IFRangeSheetsThreadCommentMixin {
    }
}
