mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
new types for angular-notifications (angular plugin)
This commit is contained in:
parent
383a3bc8e6
commit
4889743ea8
12
angular-notifications/angular-notifications-tests.ts
Normal file
12
angular-notifications/angular-notifications-tests.ts
Normal file
@ -0,0 +1,12 @@
|
||||
/// <reference path="angular-notifications.d.ts" />
|
||||
|
||||
var myapp = angular.module("myapp", ["notifications"]);
|
||||
|
||||
myapp.controller("MyController", ["$scope", "notifications",
|
||||
function ($scope:ng.IScope, $notifications:angular.notifications.INotificationFactory) { // <-- Inject notifications
|
||||
|
||||
var userData = {'some': 'data', 'optional': true};
|
||||
$notification.info("Something happened", "here is the content of what happened", userData);
|
||||
|
||||
}
|
||||
]);
|
||||
82
angular-notifications/angular-notifications.d.ts
vendored
Normal file
82
angular-notifications/angular-notifications.d.ts
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
// Type definitions for angular-notifications
|
||||
// Project: https://github.com/DerekRies/angular-notifications
|
||||
// Definitions by: Tomasz Ducin <https://github.com/ducin/DefinitelyTyped>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module angular.notifications {
|
||||
|
||||
interface IAnimation {
|
||||
duration: number;
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
interface ISettings {
|
||||
info: IAnimation;
|
||||
warning: IAnimation;
|
||||
error: IAnimation;
|
||||
success: IAnimation;
|
||||
progress: IAnimation;
|
||||
custom: IAnimation;
|
||||
details: boolean;
|
||||
localStorage: boolean;
|
||||
html5Mode: boolean;
|
||||
html5DefaultIcon: string;
|
||||
}
|
||||
|
||||
interface INotification {
|
||||
type: string;
|
||||
image: string;
|
||||
icon: string;
|
||||
title: string;
|
||||
content: string;
|
||||
timestamp: string;
|
||||
userData: string;
|
||||
}
|
||||
|
||||
interface INotificationFactory extends angular.IModule {
|
||||
|
||||
/* ========== SETTINGS RELATED METHODS =============*/
|
||||
|
||||
disableHtml5Mode(): void;
|
||||
disableType(notificationType: string): void;
|
||||
enableHtml5Mode(): void;
|
||||
enableType(notificationType: string): void;
|
||||
getSettings(): ISettings;
|
||||
toggleType(notificationType: string): void;
|
||||
toggleHtml5Mode(): void;
|
||||
requestHtml5ModePermissions(): boolean;
|
||||
|
||||
/* ============ QUERYING RELATED METHODS ============*/
|
||||
|
||||
getAll(): Array<INotification>;
|
||||
getQueue(): Array<INotification>;
|
||||
|
||||
/* ============== NOTIFICATION METHODS ==============*/
|
||||
|
||||
info(title): INotification;
|
||||
info(title, content): INotification;
|
||||
info(title, content, userData): INotification;
|
||||
error(title): INotification;
|
||||
error(title, content): INotification;
|
||||
error(title, content, userData): INotification;
|
||||
success(title): INotification;
|
||||
success(title, content): INotification;
|
||||
success(title, content, userData): INotification;
|
||||
warning(title): INotification;
|
||||
warning(title, content): INotification;
|
||||
warning(title, content, userData): INotification;
|
||||
awesomeNotify(type, icon, title, content, userData): INotification;
|
||||
notify(image, title, content, userData): INotification;
|
||||
makeNotification(type: string, image: string, icon: string, title: string, content: string, userData: string): INotification;
|
||||
|
||||
/* ============ PERSISTENCE METHODS ============ */
|
||||
|
||||
save(): void;
|
||||
restore(): void;
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user