Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
chore: optimize typings in univer
Wenzhao Huf117337de77a
diff --git a/packages/network/src/index.ts b/packages/network/src/index.tsindex 6b2133a7fc..557113126b 100644--- a/packages/network/src/index.ts+++ b/packages/network/src/index.ts@@ -3,4 +3,9 @@ export { HTTPService } from './services/http/http.service';export { XHRHTTPImplementation } from './services/http/implementations/xhr';export { HTTPRequest } from './services/http/request';export { HTTPResponse } from './services/http/response';-export { type ISocket, ISocketService, WebSocketService } from './services/web-socket/web-socket.service';+export {+ type ISocket,+ ISocketService,+ type SocketBodyType,+ WebSocketService,+} from './services/web-socket/web-socket.service';diff --git a/packages/network/src/services/web-socket/web-socket.service.ts b/packages/network/src/services/web-socket/web-socket.service.tsindex 9e9bc7aa13..30f3cd5361 100644--- a/packages/network/src/services/web-socket/web-socket.service.ts+++ b/packages/network/src/services/web-socket/web-socket.service.ts@@ -2,6 +2,8 @@ import { Disposable, DisposableCollection, Nullable, toDisposable } from '@univeimport { createIdentifier } from '@wendellhu/redi';import { Observable } from 'rxjs';+export type SocketBodyType = string | ArrayBufferLike | Blob | ArrayBufferView;+/*** This service is responsible for establishing bidi-directional connection to a remote server.*/@@ -23,7 +25,7 @@ export interface ISocket {/*** Send a message to the remote server.*/- send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;+ send(data: SocketBodyType): void;close$: Observable<[ISocket, CloseEvent]>;error$: Observable<[ISocket, Event]>;@@ -46,7 +48,7 @@ export class WebSocketService extends Disposable implements ISocketService {connection.close(code, reason);disposables.dispose();},- send: (data: string | ArrayBufferLike | Blob | ArrayBufferView) => {+ send: (data: SocketBodyType) => {connection.send(data);},open$: new Observable((subscriber) => {diff --git a/packages/ui-plugin-sheets/src/commands/commands/clipboard.command.ts b/packages/ui-plugin-sheets/src/commands/commands/clipboard.command.tsindex 2a6609bb99..1a3e48e6e2 100644--- a/packages/ui-plugin-sheets/src/commands/commands/clipboard.command.ts+++ b/packages/ui-plugin-sheets/src/commands/commands/clipboard.command.ts@@ -24,7 +24,7 @@ export const SheetCutCommand: IMultiCommand = {multi: true,priority: 1000,preconditions: whenEditorNotActivated,- handler: async (accessor, params) => {+ handler: async (accessor) => {const sheetClipboardService = accessor.get(ISheetClipboardService);return sheetClipboardService.cut();},