Update Drop and Tether typings

This is a breaking change that simplifies the definition files
and exports the right thing for the external modules.
Previously, the external module export was wrong
(the global `Drop` and `Tether` constructors are exported
when these libraries are imported in CommonJS, not the
namespaces as the typings suggested).
This commit is contained in:
Adi Dahiya
2016-01-27 18:53:39 -05:00
parent 86dbea8fc3
commit bc8c22045f
2 changed files with 41 additions and 47 deletions
+14 -17
View File
@@ -1,14 +1,22 @@
// Type definitions for Tether v0.6
// Type definitions for Tether v1.1
// Project: http://github.hubspot.com/tether/
// Definitions by: Adi Dahiya <https://github.com/adidahiya>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module tether {
// global Tether constructor
declare class Tether {
constructor(options: Tether.ITetherOptions);
interface TetherStatic {
new(options: ITetherOptions): Tether;
}
public setOptions(options: Tether.ITetherOptions): void;
public disable(): void;
public enable(): void;
public destroy(): void;
public position(): void;
public static position(): void;
}
declare namespace Tether {
interface ITetherOptions {
attachment?: string;
classes?: {[className: string]: boolean};
@@ -31,20 +39,9 @@ declare module tether {
pinnedClass?: string;
to?: string | HTMLElement | number[];
}
interface Tether {
setOptions(options: ITetherOptions): void;
disable(): void;
enable(): void;
destroy(): void;
position(): void;
}
}
declare module "tether" {
export = tether;
export = Tether;
}
declare var Tether: tether.TetherStatic;