Skip to content

Commit

Permalink
Merge pull request DefinitelyTyped#6662 from kwiateusz/toastr-update
Browse files Browse the repository at this point in the history
Toastr and mCustomScrollbar update
  • Loading branch information
borisyankov committed Nov 11, 2015
2 parents bfd9e1d + 17d5157 commit e8659ef
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 20 deletions.
8 changes: 4 additions & 4 deletions mCustomScrollbar/mCustomScrollbar-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class SimpleTestAllParams {
this.element = $(".content");

this.element.mCustomScrollbar({
set_width: false,
set_height: false,
horizontalScroll: false,
setWidth: false,
setHeight: false,
axis: "y",
scrollInertia: 950,
mouseWheel: true,
mouseWheelPixels: "auto",
Expand Down Expand Up @@ -147,4 +147,4 @@ class DisableDestroyTest {
});
});
}
}
}
36 changes: 31 additions & 5 deletions mCustomScrollbar/mCustomScrollbar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,27 @@ declare module MCustomScrollbar {
/**
* Set the width of your content (overwrites CSS width), value in pixels (integer) or percentage (string)
*/
set_width?: any;
setWidth?: any;
/**
* Set the height of your content (overwirtes CSS height), value in pixels (integer) or percentage (string)
*/
set_height?: any;
setHeight?: any;
/**
* Add horizontal scrollbar (default is vertical), value: true, false
* Define content’s scrolling axis (the type of scrollbars added to the element: vertical and/of horizontal).
* Available values: "y", "x", "yx". y -vertical, x - horizontal
*/
axis?: string;
/**
* Always keep scrollbar(s) visible, even when there’s nothing to scroll.
* 0 – disable (default)
* 1 – keep dragger rail visible
* 2 – keep all scrollbar components (dragger, rail, buttons etc.) visible
*/
alwaysShowScrollbar?: number;
/**
* Enable or disable auto-expanding the scrollbar when cursor is over or dragging the scrollbar.
*/
horizontalScroll?: boolean;
autoExpandScrollbar?: boolean;
/**
* Scrolling inertia (easing), value in milliseconds (0 for no scrolling inertia)
*/
Expand Down Expand Up @@ -119,6 +131,12 @@ declare module MCustomScrollbar {
* User defined callback function, triggered while scrolling
*/
whileScrolling?: () => void;
/**
* Set the behavior of calling onTotalScroll and onTotalScrollBack offsets.
* By default, callback offsets will trigger repeatedly while content is scrolling within the offsets.
* Set alwaysTriggerOffsets: false when you need to trigger onTotalScroll and onTotalScrollBack callbacks once, each time scroll end or beginning is reached.
*/
alwaysTriggerOffsets?: boolean;
}
/**
* Set a scrollbar ready-to-use theme. See themes demo for all themes - http://manos.malihu.gr/tuts/custom-scrollbar-plugin/scrollbar_themes_demo.html
Expand All @@ -132,10 +150,18 @@ declare module MCustomScrollbar {
*/
scrollInertia?: number;
/**
* Scroll-to animation easing, values: "linear", "easeOut", "easeInOut".
*/
scrollEasing?: string;
/**
* Scroll scrollbar dragger (instead of content) to a number of pixels, values: true, false
*/
moveDragger?: boolean;
/**
* Set a timeout for the method (the default timeout is 60 ms in order to work with automatic scrollbar update), value in milliseconds.
*/
timeout?: number;
/**
* Trigger user defined callback after scroll-to completes, value: true, false
*/
callbacks?: boolean;
Expand Down Expand Up @@ -163,4 +189,4 @@ interface JQuery {
* @param options Override default options
*/
mCustomScrollbar(options?: MCustomScrollbar.CustomScrollbarOptions): JQuery;
}
}
27 changes: 16 additions & 11 deletions toastr/toastr.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,26 @@ interface ToastrOptions {
* Set newest toast to appear on top
**/
newestOnTop?: boolean;

/**
* Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to the previous toast based on their message content.
*/
preventDuplicates?: boolean;

/**
* Visually indicates how long before a toast expires.
*/
progressBar?: boolean;

/**
* The element to put the toastr container
**/
target?: string;
/**
* Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to the previous toast based on their message content.
*/
preventDuplicates?: boolean;
/**
* Visually indicates how long before a toast expires.
*/
progressBar?: boolean;
/**
* Function to execute on toast click
*/
onclick?: () => void;
/**
* Set if toastr should parse containing html
**/
allowHtml?: boolean;
}

interface ToastrDisplayMethod {
Expand Down

0 comments on commit e8659ef

Please sign in to comment.