Skip to content

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.

fix: export necessary types from ui package

Wenzhao Huc64831091a75
diff --git a/packages/ui/src/components/notification/Notification.tsx b/packages/ui/src/components/notification/Notification.tsx
index a65cbac9ef..8589b2c00d 100644
--- a/packages/ui/src/components/notification/Notification.tsx
+++ b/packages/ui/src/components/notification/Notification.tsx
@@ -33,7 +33,7 @@ const iconMap = {
error: <ErrorSingle className={styles.notificationIconError} />,
};
-export interface INotificationMethodOptions {
+export interface INotificationOptions {
/**
* Component type, optional success, warning, error
*/
@@ -64,9 +64,9 @@ export interface INotificationMethodOptions {
lines?: number;
}
-export const notificationObserver = new Subject<INotificationMethodOptions>();
+export const notificationObserver = new Subject<INotificationOptions>();
-export const PureContent = (props: INotificationMethodOptions) => {
+export const PureContent = (props: INotificationOptions) => {
const { type, content, title, lines = 0 } = props;
const contentClassName = clsx(styles.notificationContent, {
@@ -132,7 +132,7 @@ export function Notification() {
}
export const notification = {
- show: (options: INotificationMethodOptions) => {
+ show: (options: INotificationOptions) => {
notificationObserver.next(options);
},
};
diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts
index c8748cfa33..6b523240fb 100644
--- a/packages/ui/src/index.ts
+++ b/packages/ui/src/index.ts
@@ -66,6 +66,7 @@ export { DesktopMenuService, IMenuService } from './services/menu/menu.service';
export { DesktopMessageService } from './services/message/desktop-message.service';
export { IMessageService } from './services/message/message.service';
export { DesktopNotificationService } from './services/notification/desktop-notification.service';
+export { type NotificationType, type INotificationOptions } from './components/notification/Notification';
export { INotificationService } from './services/notification/notification.service';
export { DesktopPlatformService, IPlatformService } from './services/platform/platform.service';
export { DesktopGlobalZoneService } from './services/global-zone/desktop-global-zone.service';
diff --git a/packages/ui/src/services/notification/desktop-notification.service.ts b/packages/ui/src/services/notification/desktop-notification.service.ts
index 2ba10ceaf1..7d96db0eb8 100644
--- a/packages/ui/src/services/notification/desktop-notification.service.ts
+++ b/packages/ui/src/services/notification/desktop-notification.service.ts
@@ -18,7 +18,7 @@ import { Disposable, toDisposable } from '@univerjs/core';
import { type IDisposable, Inject, Injector } from '@wendellhu/redi';
import { connectInjector } from '@wendellhu/redi/react-bindings';
-import type { INotificationMethodOptions } from '../../components/notification/Notification';
+import type { INotificationOptions } from '../../components/notification/Notification';
import { notification, Notification } from '../../components/notification/Notification';
import { DesktopUIPart, IUIPartsService } from '../parts/parts.service';
import type { INotificationService } from './notification.service';
@@ -33,7 +33,7 @@ export class DesktopNotificationService extends Disposable implements INotificat
this._initUIPart();
}
- show(params: INotificationMethodOptions): IDisposable {
+ show(params: INotificationOptions): IDisposable {
notification.show(params);
return toDisposable(() => { /* empty */ });
diff --git a/packages/ui/src/services/notification/notification.service.ts b/packages/ui/src/services/notification/notification.service.ts
index 5578d33581..fed86de828 100644
--- a/packages/ui/src/services/notification/notification.service.ts
+++ b/packages/ui/src/services/notification/notification.service.ts
@@ -17,10 +17,10 @@
import type { IDisposable } from '@wendellhu/redi';
import { createIdentifier } from '@wendellhu/redi';
-import type { INotificationMethodOptions } from '../../components/notification/Notification';
+import type { INotificationOptions } from '../../components/notification/Notification';
export const INotificationService = createIdentifier<INotificationService>('univer.notification-service');
export interface INotificationService {
- show(params: INotificationMethodOptions): IDisposable;
+ show(params: INotificationOptions): IDisposable;
}