mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-04 01:00:05 +00:00
Merge pull request #365 from vbortone/feature/jquery.livestampjs
Type definitions for Livestamp.js
This commit is contained in:
15
jquery.livestampjs/jquery.livestampjs-tests.ts
Normal file
15
jquery.livestampjs/jquery.livestampjs-tests.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// Tests for Livestamp.js type definitions
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
/// <reference path="../moment/moment.d.ts"/>
|
||||
/// <reference path="jquery.livestampjs.d.ts"/>
|
||||
|
||||
$('#test1').livestamp(new Date('June 18, 1987'));
|
||||
$('#test2').livestamp(1362282933);
|
||||
$('#test3').livestamp('destroy');
|
||||
$('#test4').livestamp(moment(new Date('June 18, 1987')));
|
||||
|
||||
$.livestamp.update();
|
||||
$.livestamp.pause();
|
||||
$.livestamp.resume();
|
||||
$.livestamp.interval(340);
|
||||
var result:number = $.livestamp.interval();
|
||||
27
jquery.livestampjs/jquery.livestampjs.d.ts
vendored
Normal file
27
jquery.livestampjs/jquery.livestampjs.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// Type definitions for Livestamp.js
|
||||
// A simple, unobtrusive jQuery plugin that provides auto-updating timeago text to your timestamped HTML elements using Moment.js.
|
||||
// Project: http://http://mattbradley.github.com/livestampjs/
|
||||
// Definitions by: Vincent Bortone <https://github.com/vbortone/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
/// <reference path="../moment/moment.d.ts"/>
|
||||
|
||||
interface LivestampGlobal {
|
||||
update(): void;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
interval(): number;
|
||||
interval(interval: number): void;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
livestamp: LivestampGlobal;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
livestamp(date: Date): JQuery;
|
||||
livestamp(moment: Moment): JQuery;
|
||||
livestamp(timestamp: number): JQuery;
|
||||
livestamp(timestamp: string): JQuery;
|
||||
}
|
||||
Reference in New Issue
Block a user