mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-03 12:48:45 +08:00
3b378ad58f
* add typings into package.json * add typings for global instance api * add common component definition * add layout components' definition * add icons definition * add component size definition * add component description * add button definition * add radio definition * add checkbox definition * add input definitions * add input-number definition * add select definition * add cascader definition * add switch definition * add slider definition * add time picker definition * add date picker definition * add upload definition * add rate definition * add color picker definition * add form definition * add tooltip definition * add table definition * rename TextAlignment to Horizontal alignment * add tag definition * add progress definition * add tree definition * add pagination definition * add badge definition * add alert definition * fix typo * Loading: add definition * Message: add definition * Loading: remove unnecessary declare keyword * MessageBox: add definition * Notification: add definition * Menu: add definition * Tabs: add definition * Breadcrumb: add definition * Dropdown: add definition * Steps: add definition * Dialog: add definition * Popover: add definition * Card: add definition * Carousel: add definition * Collapse: add definition * Loading: update description * some $message method params should be optional * Select: update definition * DatePicker: update definition
71 lines
1.9 KiB
TypeScript
71 lines
1.9 KiB
TypeScript
import Vue, { VNode } from 'vue'
|
|
import { MessageType } from './message'
|
|
|
|
/** Notification Component */
|
|
export declare class ElNotificationComponent extends Vue {
|
|
/** Close the Notification instance */
|
|
close ()
|
|
}
|
|
|
|
export interface ElNotificationOptions {
|
|
/** Title */
|
|
title: string
|
|
|
|
/** Description text */
|
|
message: string | VNode
|
|
|
|
/** Notification type */
|
|
type: MessageType
|
|
|
|
/** Custom icon's class. It will be overridden by type */
|
|
iconClass: string
|
|
|
|
/** Custom class name for Notification */
|
|
customClass: string
|
|
|
|
/** Duration before close. It will not automatically close if set 0 */
|
|
duration: number
|
|
|
|
/** Callback function when closed */
|
|
onClose: () => void
|
|
|
|
/** Offset from the top edge of the screen. Every Notification instance of the same moment should have the same offset */
|
|
offset: number
|
|
}
|
|
|
|
export interface ElNotification {
|
|
/** Show a notification */
|
|
(options: ElNotificationOptions): ElNotificationComponent
|
|
|
|
/** Show a success notification */
|
|
success (message: string | VNode): ElNotificationComponent
|
|
|
|
/** Show a success notification */
|
|
success (options: ElNotificationOptions): ElNotificationComponent
|
|
|
|
/** Show a warning notification */
|
|
warning (message: string | VNode): ElNotificationComponent
|
|
|
|
/** Show a warning notification */
|
|
warning (options: ElNotificationOptions): ElNotificationComponent
|
|
|
|
/** Show an info notification */
|
|
info (message: string | VNode): ElNotificationComponent
|
|
|
|
/** Show an info notification */
|
|
info (options: ElNotificationOptions): ElNotificationComponent
|
|
|
|
/** Show an error notification */
|
|
error (message: string | VNode): ElNotificationComponent
|
|
|
|
/** Show an error notification */
|
|
error (options: ElNotificationOptions): ElNotificationComponent
|
|
}
|
|
|
|
declare module 'vue/types/vue' {
|
|
interface Vue {
|
|
/** Displays a global notification message at the upper right corner of the page */
|
|
$notify: ElNotification
|
|
}
|
|
}
|