UNPKG

@alauda-fe/common

Version:

Alauda frontend team common codes.

40 lines (39 loc) 1.85 kB
/** * @packageDocumentation * @module notification */ import { DialogService, NotificationConfig, NotificationService } from '@alauda/ui'; import { HttpErrorResponse, HttpRequest } from '@angular/common/http'; import { Injector } from '@angular/core'; import { Callback, Status } from '../core/public-api'; import { TimeService } from '../core/services/public-api'; import { FeedbackNotificationProps } from './feedback-notification/component'; import * as i0 from "@angular/core"; export interface NotificationHttpRequest<T = unknown> extends HttpRequest<T> { requestAt?: number; } export type FeedbackNotificationPropsWithEvents = Omit<FeedbackNotificationProps, 'content' | 'primary' | 'secondary'> & Partial<{ content: unknown; summary: unknown; primary: string | true; secondary: string | true; onPrimary: Callback; onSecondary: Callback; }>; export type FeedbackNotificationConfig = Omit<NotificationConfig, 'contentRef'>; export declare class NotificationUtilService { private readonly injector; private readonly dialog; private readonly time; private readonly notification; constructor(injector: Injector, dialog: DialogService, time: TimeService, notification: NotificationService); viewDetail(json: unknown, title?: string, notificationId?: string): void; createFeedback(config: FeedbackNotificationConfig, { content, onPrimary, onSecondary, pre, primary, secondary, summary, }?: FeedbackNotificationPropsWithEvents): void; private normalizeJson; notify(status: Status): void; notify(req: NotificationHttpRequest, res: HttpErrorResponse): Promise<void>; private getResErrorMessage; private getAllHeaders; static ɵfac: i0.ɵɵFactoryDeclaration<NotificationUtilService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NotificationUtilService>; }