1.1.6 • Published 6 months ago

@types/rr-notifications v1.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/rr-notifications

Summary

This package contains type definitions for rr-notifications (https://thegrinder.github.io/rr-notifications).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rr-notifications.

index.d.ts

// Type definitions for rr-notifications 1.1
// Project: https://thegrinder.github.io/rr-notifications
// Definitions by: Robbie Moore <https://github.com/RobbieGM>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="react" />

export interface NotificationsContextType {
    showNotification(payload?: NotificationPayload): void;
    removeNotification(id: string): () => void;
}

/**
 * The payload of each notification is described by this interface. Users of
 * this types package should use declaration merging to add their own standard
 * properties to this interface, since the library leaves it up to the user.
 */
// tslint:disable-next-line:no-empty-interface
export interface NotificationPayload {}

export const NotificationsContext: React.Context<NotificationsContextType>;

export function useNotification(): NotificationsContextType;

export const NotificationsProvider: React.FC<{
    /** Render prop which passes down removeNotification function and notification payload */
    renderNotification(args: { removeNotification: () => void; payload: NotificationPayload }): JSX.Element;
    /** Fixed position where all notifications are displayed */
    position?: [string, string, string, string] | undefined;
    /** Duration of the show and hide animations in milliseconds */
    animationDuration?: number | undefined;
    /** Animation timing function / cubic-bezier */
    animationEasing?: string | undefined;
    /** Time in milliseconds after which the notification is automatically dismissed */
    dismissAfter?: number | undefined;
    /**
     * Horizontal direction which notification appears from. If not provided, the notification will
     * appear from top or bottom, depending on position prop
     */
    slideFromSide?: 'right' | 'left' | undefined;
}>;

Additional Details

  • Last updated: Thu, 08 Jul 2021 22:42:13 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

These definitions were written by Robbie Moore.

1.1.6

6 months ago

1.1.5

6 months ago

1.1.4

7 months ago

1.1.3

7 months ago

1.1.2

8 months ago

1.1.1

3 years ago

1.1.0

4 years ago