mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
* Rename the humane types to humane-js to match the package name * Improve humane-js types - define the exported CommonJS API instead of documenting the global variable from the UMD pattern - fix the list of available options - use proper signatures for various functions instead of generic Function types - use optional parameters instead of function overload without extra params for proper types * Enable the strict linting rules for the humane-js types
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
// Type definitions for Humane 3.2
|
|
// Project: http://wavded.github.com/humane-js/
|
|
// Definitions by: jmvrbanac <https://github.com/jmvrbanac>, stof <https://github.com/stof>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
interface HumaneMessageOptions {
|
|
addnCls?: string;
|
|
timeout?: number;
|
|
waitForMove?: boolean;
|
|
clickToClose?: boolean;
|
|
}
|
|
|
|
interface HumaneOptions extends HumaneMessageOptions {
|
|
baseCls?: string;
|
|
container?: Element;
|
|
}
|
|
|
|
type completionCallback = () => void;
|
|
type logMessage = string | ReadonlyArray<string>;
|
|
|
|
interface SpawnLogFunction {
|
|
(message: logMessage, options?: HumaneMessageOptions): Humane;
|
|
(message: logMessage, callback?: completionCallback, options?: HumaneMessageOptions): Humane;
|
|
}
|
|
|
|
interface Humane {
|
|
queue: string[];
|
|
baseCls: string;
|
|
container: Element;
|
|
addnCls: string;
|
|
timeout: number;
|
|
waitForMove: boolean;
|
|
clickToClose: boolean;
|
|
|
|
create(options?: HumaneOptions): Humane;
|
|
info?: SpawnLogFunction;
|
|
error?: SpawnLogFunction;
|
|
spawn(options: HumaneMessageOptions): SpawnLogFunction;
|
|
remove(cb?: completionCallback): void;
|
|
log(message: logMessage, options?: HumaneMessageOptions): Humane;
|
|
log(message: logMessage, callback?: completionCallback, options?: HumaneMessageOptions): Humane;
|
|
}
|
|
|
|
declare var humane: Humane;
|
|
|
|
export = humane;
|