This commit is contained in:
abraaoalves 2016-03-01 19:01:41 -03:00
parent 55c750ace8
commit 1ea67ceea4
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,5 @@
/// <reference path="./jquery-truncate-html.d.ts" />
jQuery('<p>Stuff and <i>Nonsense</i></p>').truncate({
length: 13
}).html();

View File

@ -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 ITruncateOptions{
length?: number;
stripTags?: boolean;
words?: boolean;
noBreaks?: boolean;
ellipsis?: string;
}
interface jQuery{
truncate(options: ITruncateOptions) : jQuery;
}
interface JQueryStatic {
truncate(html: string, options: ITruncateOptions) : string;
}