mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Move definitions and test in separate folders
This enables each definition to have a readme if necessary. Also a .json metadata file to help with package managers. And last, to have different versions of the definitions.
This commit is contained in:
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
// Type definitions for Humane 3.0
|
||||
// Project: http://wavded.github.com/humane-js/
|
||||
// Definitions by: https://github.com/jmvrbanac
|
||||
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
interface HumaneOptions {
|
||||
queue?: string[];
|
||||
baseCls?: string;
|
||||
addnCls?: string;
|
||||
timeout?: number;
|
||||
waitForMove?: bool;
|
||||
clickToClose?: bool;
|
||||
forceNew?: bool;
|
||||
}
|
||||
|
||||
interface Humane {
|
||||
queue: string[];
|
||||
baseCls: string;
|
||||
addnCls: string;
|
||||
timeout: number;
|
||||
waitForMove: bool;
|
||||
clickToClose: bool;
|
||||
forceNew: bool;
|
||||
|
||||
create(options?: HumaneOptions): Humane;
|
||||
info: Function;
|
||||
error: Function;
|
||||
spawn(options: HumaneOptions): Function;
|
||||
remove(any): void;
|
||||
log(message: string): Humane;
|
||||
log(message: string, callback: Function): Humane;
|
||||
log(message: string, options: HumaneOptions): Humane;
|
||||
log(message: string, callback: Function, options: HumaneOptions): Humane;
|
||||
|
||||
log(listOfMessages: Array): Humane;
|
||||
}
|
||||
|
||||
declare var humane: Humane;
|
||||
@@ -0,0 +1,27 @@
|
||||
/// <reference path="../Definitions/humane-3.0.d.ts" />
|
||||
|
||||
humane.log("Welcome Back");
|
||||
humane.log(["List","of","Items"]);
|
||||
humane.log("Callback when finished", function(){ document.body.style.backgroundColor="#a66000" });
|
||||
humane.log("Options can be passed", { timeout: 4000, clickToClose: true, addnCls: 'humane-error' });
|
||||
|
||||
humane.timeout = 5000;
|
||||
humane.waitForMove = true;
|
||||
humane.clickToClose = true;
|
||||
humane.addnCls = 'humane-info';
|
||||
|
||||
humane.info = humane.spawn({ addnCls: 'humane-libnotify-info', timeout: 1000 });
|
||||
humane.info('Info Themed Notifier');
|
||||
humane.error = humane.spawn({ addnCls: 'humane-libnotify-error', timeout: 1000 });
|
||||
humane.error('Error Themed Notifier');
|
||||
humane.remove(function(){ alert('removed') });
|
||||
|
||||
var bigbox = humane.create({baseCls: 'humane-bigbox', timeout: 1000});
|
||||
bigbox.error = bigbox.spawn({addnCls: 'humane-bigbox-error'});
|
||||
bigbox.log('Oh!').error('No!');
|
||||
|
||||
var libnotify = humane.create({baseCls: 'humane-libnotify', addnCls: 'humane-libnotify-info'});
|
||||
libnotify.log('Notified');
|
||||
|
||||
var jacked = humane.create({baseCls: 'humane-jackedup', addnCls: 'humane-jackedup-success'});
|
||||
jacked.log("What's up here!");
|
||||
Reference in New Issue
Block a user