mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #8346 from AbraaoAlves/jquery-truncate-html
Added jquery-truncate-html definitions
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
/// <reference path="./jquery-truncate-html.d.ts" />
|
||||
|
||||
|
||||
function truncateHtmlString(): string {
|
||||
return $.truncate('<p>Stuff and <i>Nonsense</i></p>', {
|
||||
length: 13
|
||||
});
|
||||
}
|
||||
|
||||
function truncateVirtualElement (): JQuery {
|
||||
return $('<p>Stuff and <i>Nonsense</i></p>').truncate({
|
||||
length: 13
|
||||
});
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// Type definitions for jQuery-truncate-html.js
|
||||
// Project: https://github.com/kbwood/timeentry
|
||||
// Definitions by: Abraão Alves <https://github.com/abraaoalves>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
interface TruncateOptions{
|
||||
length?: number;
|
||||
stripTags?: boolean;
|
||||
words?: boolean;
|
||||
noBreaks?: boolean;
|
||||
ellipsis?: string;
|
||||
}
|
||||
|
||||
interface JQuery{
|
||||
truncate(options: TruncateOptions) : JQuery;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
truncate(html: string, options: TruncateOptions) : string;
|
||||
}
|
||||
Reference in New Issue
Block a user