DefinitelyTyped/angular-ui-notification/index.d.ts
Dominik Broj b734356f8e Fix angular-ui-notification (#13363)
* augment angular module to avoid Promise redefinition

* fix linter errors

* Revert "fix linter errors"

this prevents breaking changes in old code due to the renaming of the interfaces

This reverts commit 2c44a32a4b9a82abed6e42c1b4b51c57efa28a6e.
2016-12-27 18:48:08 -05:00

67 lines
2.1 KiB
TypeScript

// Type definitions for angular-ui-notification
// Project: https://github.com/alexcrack/angular-ui-notification
// Definitions by: Kamil Rojewski <https://github.com/krojew/DefinitelyTyped>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="angular" />
import * as angular from 'angular';
declare module 'angular' {
export namespace uiNotification {
type XPosition = 'right' | 'left' | 'center';
type YPosition = 'top' | 'bottom';
type MessageType = 'primary' | 'info' | 'success' | 'warning' | 'error';
interface IGlobalMessageOptions {
delay?: number;
startTop?: number;
startRight?: number;
verticalSpacing?: number;
horizontalSpacing?: number;
positionX?: XPosition;
positionY?: YPosition;
replaceMessage?: boolean;
templateUrl?: string;
onClose?: (element: any) => any;
closeOnClick?: boolean;
maxCount?: number;
}
interface IMessageOptions {
title?: string;
message?: string;
templateUrl?: string;
delay?: number;
type?: MessageType;
positionX?: XPosition;
positionY?: YPosition;
replaceMessage?: boolean;
closeOnClick?: boolean;
}
interface INotificationScope {
kill(isHard: boolean): void;
}
interface INotificationProvider {
setOptions(options: IGlobalMessageOptions): void;
}
type Message = string | IMessageOptions;
interface INotificationService {
primary(message: Message): IPromise<INotificationScope>;
info(message: Message): IPromise<INotificationScope>;
success(message: Message): IPromise<INotificationScope>;
warning(message: Message): IPromise<INotificationScope>;
error(message: Message): IPromise<INotificationScope>;
clearAll(): void;
(message: Message, type?: MessageType): IPromise<INotificationScope>;
}
}
}