From 1ea67ceea476ea5b226130ced5f2cef247eedaab Mon Sep 17 00:00:00 2001 From: abraaoalves Date: Tue, 1 Mar 2016 19:01:41 -0300 Subject: [PATCH] ad files --- .../jquery-truncate-html-tests.ts | 5 +++++ .../jquery-truncate-html.d.ts | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 jquery-truncate-html/jquery-truncate-html-tests.ts create mode 100644 jquery-truncate-html/jquery-truncate-html.d.ts diff --git a/jquery-truncate-html/jquery-truncate-html-tests.ts b/jquery-truncate-html/jquery-truncate-html-tests.ts new file mode 100644 index 0000000000..fe043601b0 --- /dev/null +++ b/jquery-truncate-html/jquery-truncate-html-tests.ts @@ -0,0 +1,5 @@ +/// + +jQuery('

Stuff and Nonsense

').truncate({ + length: 13 +}).html(); diff --git a/jquery-truncate-html/jquery-truncate-html.d.ts b/jquery-truncate-html/jquery-truncate-html.d.ts new file mode 100644 index 0000000000..d7f4abaa3b --- /dev/null +++ b/jquery-truncate-html/jquery-truncate-html.d.ts @@ -0,0 +1,22 @@ +// Type definitions for jQuery-truncate-html.js +// Project: https://github.com/kbwood/timeentry +// Definitions by: Abraão Alves +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +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; +}