/** * 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 type { Injector } from '@univerjs/core'; import type { IThreadComment } from '@univerjs/thread-comment'; import { FUniver } from '@univerjs/core/facade'; import { FTheadCommentBuilder } from './f-thread-comment'; /** * @ignore */ export interface IFUniverSheetsThreadCommentMixin { /** * Create a new thread comment * @returns {FTheadCommentBuilder} The thead comment builder * @example * ```ts * // Create a new comment * const richText = univerAPI.newRichText().insertText('hello univer'); * const commentBuilder = univerAPI.newTheadComment() * .setContent(richText) * .setPersonId('mock-user-id') * .setDateTime(new Date('2025-02-21 14:22:22')) * .setId('mock-comment-id') * .setThreadId('mock-thread-id'); * * // 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); * ``` */ newTheadComment(): FTheadCommentBuilder; } /** * @ignore */ export declare class FUniverSheetsThreadCommentMixin extends FUniver implements IFUniverSheetsThreadCommentMixin { private _getTargetSheet; _initialize(injector: Injector): void; /** * @ignore */ newTheadComment(comment?: IThreadComment): FTheadCommentBuilder; } declare module '@univerjs/core/facade' { interface FUniver extends IFUniverSheetsThreadCommentMixin { } }