From c7a2374b86f8cb79d293be28dd53346a8627705f Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Sun, 8 Nov 2015 12:08:32 +0100 Subject: [PATCH 01/13] added media queries utils conform to foundation spec --- foundation/foundation.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/foundation/foundation.d.ts b/foundation/foundation.d.ts index a51e47ae9..ce782fd92 100644 --- a/foundation/foundation.d.ts +++ b/foundation/foundation.d.ts @@ -304,6 +304,16 @@ declare module Foundation { add_custom_rule(rule : string, media : string) : void; image_loaded(images : JQuery, callback : (...args : any[]) => any) : void; random_str(length? : number) : string; + is_small_only(): boolean; + is_small_up(): boolean; + is_medium_only(): boolean; + is_medium_up(): boolean; + is_large_only(): boolean; + is_large_up(): boolean; + is_xlarge_only(): boolean; + is_xlarge_up(): boolean; + is_xxlarge_only(): boolean; + is_xxlarge_up(): boolean; }; } } From 288805ab6ecdd11305d39168abaaeba9e4924650 Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Thu, 3 Dec 2015 08:28:19 +0100 Subject: [PATCH 02/13] added type defs for foundation-sites 6.0.4 --- foundation-sites/foundation.d.ts | 426 +++++++++++++++++++++++++++++++ 1 file changed, 426 insertions(+) create mode 100644 foundation-sites/foundation.d.ts diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts new file mode 100644 index 000000000..c72a93ba1 --- /dev/null +++ b/foundation-sites/foundation.d.ts @@ -0,0 +1,426 @@ +// Type definitions for Foundation Sites v6.0.4 +// Project: http://foundation.zurb.com/ +// Definitions by: Sam Vloeberghs +// Definitions by: Michał Wrześniewski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Foundation { + + // http://foundation.zurb.com/sites/docs/abide.html#javascript-reference + export interface Abide { + requiredCheck: (element:Object) => boolean; + findLabel: (element:Object) => boolean; + addErrorClasses: (element:Object) => void; + removeErrorClasses: (element:Object) => void; + validateInput: (element:Object, form:Object) => void; + validateForm: (element:Object) => void; + validateText: (element:Object) => boolean; + validateRadio: (group:String) => boolean; + resetform: ($form:Object) => void; + } + + interface IAbidePaterns { + alpha?: RegExp; + alpha_numeric?: RegExp; + integer?: RegExp; + number?: RegExp; + card?: RegExp; + cvv?: RegExp; + email ?: RegExp; + url?: RegExp; + domain?: RegExp; + datetime?: RegExp; + date?: RegExp; + time?: RegExp; + dateISO?: RegExp; + month_day_year?: RegExp; + day_month_year?: RegExp; + color?: RegExp; + } + + interface IAbideOptions { + slideSpeed?: number + multiOpen?: boolean; + } + + // http://foundation.zurb.com/sites/docs/accordion.html#javascript-reference + export interface Accordion { + toggle: ($target:JQuery) => void; + down: ($target:JQuery, firstTime:boolean) => void; + up: ($target:JQuery) => void; + destroy: () => void; + } + + interface IAccordionOptions { + slideSpeed?: number + multiOpen?: boolean; + } + + // http://foundation.zurb.com/sites/docs/accordion-menu.html#javascript-reference + export interface AccordionMenu { + toggle: ($target:JQuery) => void; + down: ($target:JQuery, firstTime:boolean) => void; + up: ($target:JQuery) => void; + destroy: () => void; + } + + // http://foundation.zurb.com/sites/docs/drilldown-menu.html#javascript-reference + export interface Drilldown { + _hideAll: ($elem:JQuery) => void; + _show: ($elem:JQuery) => void; + _hide: ($elem:JQuery) => void; + destroy: () => void; + } + + interface IDrilldownOptions { + backButton?: String; + wrapper?: String + closeOnClick?: boolean + } + + // http://foundation.zurb.com/sites/docs/dropdown.html#javascript-reference + export interface Dropdown { + getPositionClass: () => String; + open: () => void; + close: () => void; + toggle: () => void; + destroy: () => void; + } + + interface IDropdownOptions { + hoverDelay?: number; + hover?: boolean; + vOffset?: number; + hOffset?: number; + positionClass?: String; + trapFocus?: boolean; + autoFocus?: boolean; + } + + // http://foundation.zurb.com/sites/docs/dropdown-menu.html#javascript-reference + export interface DropdownMenu { + destroy: () => void; + } + + interface IDropdownMenuOptions { + disableHover?: boolean; + autoclose?: boolean; + hoverDelay?: number; + clickOpen?: boolean; + closingTime?: number; + alignments?: String; + verticalClasss?: String; + rightClasss?: String; + } + + // http://foundation.zurb.com/sites/docs/equalizer.html#javascript-reference + export interface Equalizer { + getHeights: (element:Object) => Array; + applyHeight: ($eqParent:Object, heights:Array) => void; + destroy: () => void; + } + + interface IEqualizerOptions { + equalizeOnStack?: boolean; + throttleInterval?: number; + } + + // http://foundation.zurb.com/sites/docs/interchange.html#javascript-reference + export interface Interchange { + replace: (path:String) => void; + destroy: () => void; + } + + interface IInterchangeOptions { + rules?: Array + } + + // http://foundation.zurb.com/sites/docs/magellan.html#javascript-reference + export interface Magellan { + calcPoints: () => void; + reflow: () => void; + destroy: () => void; + } + + interface IMagellanOptions { + animationDuration?: number; + animationEasing?: String; + threshold?: number; + activeClass?: String; + deepLinking?: boolean; + } + + // http://foundation.zurb.com/sites/docs/offcanvas.html#javascript-reference + export interface OffCanvas { + open: (event:Object, trigger:JQuery) => void; + toggle: (event:Object, trigger:JQuery) => void; + close: () => void; + destroy: () => void; + } + + interface IOffCanvasOptions { + closeOnClick?: boolean; + transitionTime?: number; + position?: String; + forceTop?: boolean; + isRevealed?: boolean; + revealOn?: String; + autoFocus?: boolean; + revealClass?: String; + } + + // http://foundation.zurb.com/sites/docs/orbit.html#javascript-reference + export interface Orbit { + changeSlide: (isLTR:boolean, chosenSlide?:Object, idx?:number) => void; + geoSync: () => void; + destroy: () => void; + } + + interface IOrbitOptions { + bullets?: boolean; + navButtons?: boolean; + animInFromRight?: String; + animOutToRight?: String; + animInFromLeft?: String; + animOutToLeft?: String; + autoPlay?: boolean; + timerDelay?: number; + infiniteWrap?: boolean; + swipe?: boolean; + pauseOnHover?: boolean; + accessible?: boolean; + containerClass?: String; + slideClass?: String; + boxOfBullets?: String; + nextClass?: String; + prevClass?: String; + } + + // http://foundation.zurb.com/sites/docs/reveal.html#javascript-reference + export interface Reveal { + open: () => void; + toggle: () => void; + close: () => void; + destroy: () => void; + } + + interface IRevealOptions { + animationIn?: String; + animationOut?: String; + showDelay?: number; + hideDelay?: number; + closeOnClick?: boolean; + closeOnEsc?: boolean; + multipleOpened?: boolean; + vOffset?: number; + hOffset?: number; + fullScreen?: boolean; + btmOffsetPct?: number; + overlay?: boolean; + resetOnClose?: boolean; + } + + // http://foundation.zurb.com/sites/docs/slider.html#javascript-reference + export interface Slider { + destroy: () => void; + } + + interface ISliderOptions { + start?: number; + end?: number; + step?: number; + initialStart ?: number; + initialEnd?: number; + binding?: boolean; + clickSelect?: boolean; + vertical?: boolean; + draggable?: boolean; + disabled?: boolean; + doubleSided?: boolean; + decimal?: number; + moveTime?: number; + disabledClass?: String; + } + + // http://foundation.zurb.com/sites/docs/sticky.html#javascript-reference + export interface Sticky { + _pauseListeners: (scrollListener:String) => void; + _calc: (checkSizes:boolean, scroll:number) => void; + destroy: () => void; + emCalc: (number:any) => void; + } + + interface IStickyOptions { + container?: String; + stickTo?: String; + anchor?: String; + topAnchor?: String; + btmAnchor?: String; + marginTop?: number; + marginBottom?: number; + stickyOn?: String; + stickyClass?: String; + containerClass?: String; + checkEvery?: number; + } + + // http://foundation.zurb.com/sites/docs/tabs.html#javascript-reference + export interface Tabs { + _handleTabChange: ($target:JQuery) => void; + selectTab: ($target:JQuery) => void; + destroy: () => void; + } + + interface ITabsOptions { + animate?: boolean; + } + + // http://foundation.zurb.com/sites/docs/toggler.html#javascript-reference + export interface Toggler { + toggle: () => void; + destroy: () => void; + } + + interface ITogglerOptions { + animate?: boolean; + } + + // http://foundation.zurb.com/sites/docs/tooltip.html#javascript-reference + export interface Tooltip { + show: () => void; + hide: () =>void; + toggle: () => void; + destroy: () => void; + } + + interface ITooltipOptions { + hoverDelay?: number; + fadeInDuration?: number; + fadeOutDuration?: number; + disableHover?: boolean; + templateClasses?: String; + tooltipClass?: String; + triggerClass?: String; + showOn?: String; + template?: String; + tipText?: String; + clickOpen?: boolean; + positionClass?: String; + vOffset?: number; + hOffset?:number; + } + + // Utilities + // --------- + + export interface Box { + ImNotTouchingYou: (element:Object, parent?:Object, lrOnly?:boolean, tbOnly?:boolean) => boolean; + GetDimensions: (element:Object) => Object; + GetOffsets: (element:Object, anchor:Object, position:String, vOffset:number, hOffset:number, isOverflow:boolean) => Object; + } + + export interface KeyBoard { + parseKey: (event:any) => String; + findFocusable: ($element:Object) => Object; + } + + export interface MediaQuery { + get: (size:String) => String; + atLeast: (size:String) => boolean; + queries:Array; + current:any; + } + + export interface Motion { + animateIn: (element:Object, animation:any, cb:Function) => void; + animateOut: (element:Object, animation:any, cb:Function) => void; + } + + interface Move { + // TODO + } + + interface Nest { + // TODO + } + + export interface Timer { + start: () => void; + restart: () => void; + pause: () => void; + } + + interface Touch { + // TODO :extension on jQuery + } + + interface Triggers { + // TODO :extension on jQuery + } + + export interface InterChange { + destroy: () => void; + } + interface IInterChangeOptions { + rules ?: Array; + } + interface ITooltipOptions { + hoverDelay ?: number; + fadeInDuration ?: number; + fadeOutDuration ?: number; + disableHover ?: boolean; + templateClasses ?: String; + tooltipClass ?: String; + triggerClass ?: String; + showOn ?: String; + template ?: String; + tipText ?: String; + clickOpenr ?: boolean; + positionClass ?: String; + vOffset ?: number; + hOffset ?: number; + } + + interface FoundationStatic { + version : String; + + rtl: () => boolean; + plugin: (plugin:Object, name:String) => void; + registerPlugin: (plugin:Object) => void; + unregisterPlugin: (plugin:Object) => void; + GetYoDigits: (length:number, namespace?:String) => String; + reflow: (elem:Object, plugins?:Array|String) => void; + getFnName: (fofn:String) => String; + transitionend: () => String; + + util : { + throttle(func:(...args:any[]) => any, delay:number) : (...args:any[]) => any; + }; + onImagesLoaded: (images:Object, cb:Function) => void; + + Abide: (element:Object, options:IAbideOptions) => void; + Accordion: (element:Object, options:IAccordionOptions) => void; + Dropdown: (element:Object, options:IDropdownOptions) => void; + DropdownMenu: (element:Object, options:IDropdownMenuOptions) => void; + Equalizer: (element:Object, options:IEqualizerOptions) => void; + Interchange: (element:Object, options:IInterChangeOptions) => void; + Magellan: (element:Object, options:IMagellanOptions) => void; + OffCanvas: (element:Object, options:IOffCanvasOptions) => void; + Orbit: (element:Object, options:IOrbitOptions) => void; + Reveal: (element:Object, options:IRevealOptions) => void; + Slider: (element:Object, options:ISliderOptions) => void; + Sticky: (element:Object, options:IStickyOptions) => void; + Tabs: (element:Object, options:ITabsOptions) => void; + Toggler: (element:Object, options:ITogglerOptions) => void; + Tooltip: (element:Object, options:ITooltipOptions) => void; + + } +} + +interface JQuery { + foundation(method:String|Array) : JQuery; +} + +declare var Foundation:Foundation.FoundationStatic; From 6ced381e2f78f050b810e1b2c8387734a35f62eb Mon Sep 17 00:00:00 2001 From: Michal Wrzesniewski Date: Thu, 3 Dec 2015 10:32:56 +0100 Subject: [PATCH 03/13] test file created --- foundation-sites/foundation-tests.ts | 2 ++ foundation-sites/foundation.d.ts | 25 +++++-------------------- 2 files changed, 7 insertions(+), 20 deletions(-) create mode 100644 foundation-sites/foundation-tests.ts diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts new file mode 100644 index 000000000..7aab47e80 --- /dev/null +++ b/foundation-sites/foundation-tests.ts @@ -0,0 +1,2 @@ +/// +/// \ No newline at end of file diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts index c72a93ba1..1093a954a 100644 --- a/foundation-sites/foundation.d.ts +++ b/foundation-sites/foundation.d.ts @@ -344,6 +344,8 @@ declare module Foundation { interface Nest { // TODO + //Feather: function(menu, type) + // Burn: function(menu, type){ } export interface Timer { @@ -360,29 +362,12 @@ declare module Foundation { // TODO :extension on jQuery } - export interface InterChange { - destroy: () => void; - } + interface IInterChangeOptions { - rules ?: Array; - } - interface ITooltipOptions { - hoverDelay ?: number; - fadeInDuration ?: number; - fadeOutDuration ?: number; - disableHover ?: boolean; - templateClasses ?: String; - tooltipClass ?: String; - triggerClass ?: String; - showOn ?: String; - template ?: String; - tipText ?: String; - clickOpenr ?: boolean; - positionClass ?: String; - vOffset ?: number; - hOffset ?: number; + rules ?: Array; } + interface FoundationStatic { version : String; From 400a0e998dcf4acec0049aa1282010129b792401 Mon Sep 17 00:00:00 2001 From: Michal Wrzesniewski Date: Thu, 3 Dec 2015 10:35:11 +0100 Subject: [PATCH 04/13] test file: Header added --- foundation-sites/foundation-tests.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts index 7aab47e80..e99545d6d 100644 --- a/foundation-sites/foundation-tests.ts +++ b/foundation-sites/foundation-tests.ts @@ -1,2 +1,8 @@ +// Tests for type definitions for Foundation Sites v6.0.4 +// Project: http://foundation.zurb.com/ +// Definitions by: Sam Vloeberghs +// Definitions by: Michał Wrześniewski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + /// /// \ No newline at end of file From 281dabc4bef9a2e2219a26c10d567ab3d024891e Mon Sep 17 00:00:00 2001 From: Michal Wrzesniewski Date: Thu, 3 Dec 2015 10:37:50 +0100 Subject: [PATCH 05/13] Equalizer compiler error fixed --- foundation-sites/foundation.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts index 1093a954a..27d761a38 100644 --- a/foundation-sites/foundation.d.ts +++ b/foundation-sites/foundation.d.ts @@ -118,7 +118,7 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/equalizer.html#javascript-reference export interface Equalizer { getHeights: (element:Object) => Array; - applyHeight: ($eqParent:Object, heights:Array) => void; + applyHeight: ($eqParent:Object, heights:Array) => void; destroy: () => void; } From 9416558e735d2a959b1f752080eae78fd66acedd Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Thu, 3 Dec 2015 10:52:54 +0100 Subject: [PATCH 06/13] update --- foundation-sites/foundation-tests.ts | 9 + foundation-sites/foundation.d.ts | 236 +++++++++++++-------------- foundation/foundation-tests.ts | 1 + 3 files changed, 122 insertions(+), 124 deletions(-) create mode 100644 foundation-sites/foundation-tests.ts diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts new file mode 100644 index 000000000..7238fe047 --- /dev/null +++ b/foundation-sites/foundation-tests.ts @@ -0,0 +1,9 @@ +/// +/// + +$(document).foundation(); +$(document).foundation('method'); +$(document).foundation(['method', 'method2']); + +Foundation.Abide($('.selector')); + diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts index c72a93ba1..afacabb43 100644 --- a/foundation-sites/foundation.d.ts +++ b/foundation-sites/foundation.d.ts @@ -9,19 +9,19 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/abide.html#javascript-reference - export interface Abide { - requiredCheck: (element:Object) => boolean; - findLabel: (element:Object) => boolean; - addErrorClasses: (element:Object) => void; - removeErrorClasses: (element:Object) => void; - validateInput: (element:Object, form:Object) => void; - validateForm: (element:Object) => void; - validateText: (element:Object) => boolean; - validateRadio: (group:String) => boolean; - resetform: ($form:Object) => void; + interface Abide { + requiredCheck(element:Object): boolean; + findLabel(element:Object): boolean; + addErrorClasses(element:Object): void; + removeErrorClasses(element:Object): void; + validateInput(element:Object, form:Object): void; + validateForm(element:Object): void; + validateText(element:Object): boolean; + validateRadio(group:String): boolean; + resetform($form:Object): void; } - interface IAbidePaterns { + export interface IAbidePatterns { alpha?: RegExp; alpha_numeric?: RegExp; integer?: RegExp; @@ -40,17 +40,17 @@ declare module Foundation { color?: RegExp; } - interface IAbideOptions { + export interface IAbideOptions { slideSpeed?: number multiOpen?: boolean; } // http://foundation.zurb.com/sites/docs/accordion.html#javascript-reference export interface Accordion { - toggle: ($target:JQuery) => void; - down: ($target:JQuery, firstTime:boolean) => void; - up: ($target:JQuery) => void; - destroy: () => void; + toggle($target:JQuery): void; + down($target:JQuery, firstTime:boolean): void; + up($target:JQuery): void; + destroy(): void; } interface IAccordionOptions { @@ -60,18 +60,18 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/accordion-menu.html#javascript-reference export interface AccordionMenu { - toggle: ($target:JQuery) => void; - down: ($target:JQuery, firstTime:boolean) => void; - up: ($target:JQuery) => void; - destroy: () => void; + toggle($target:JQuery): void; + down($target:JQuery, firstTime:boolean): void; + up($target:JQuery): void; + destroy(): void; } // http://foundation.zurb.com/sites/docs/drilldown-menu.html#javascript-reference export interface Drilldown { - _hideAll: ($elem:JQuery) => void; - _show: ($elem:JQuery) => void; - _hide: ($elem:JQuery) => void; - destroy: () => void; + _hideAll($elem:JQuery): void; + _show($elem:JQuery): void; + _hide($elem:JQuery): void; + destroy(): void; } interface IDrilldownOptions { @@ -82,11 +82,11 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/dropdown.html#javascript-reference export interface Dropdown { - getPositionClass: () => String; - open: () => void; - close: () => void; - toggle: () => void; - destroy: () => void; + getPositionClass(): String; + open(): void; + close(): void; + toggle(): void; + destroy(): void; } interface IDropdownOptions { @@ -101,7 +101,7 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/dropdown-menu.html#javascript-reference export interface DropdownMenu { - destroy: () => void; + destroy(): void; } interface IDropdownMenuOptions { @@ -117,9 +117,9 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/equalizer.html#javascript-reference export interface Equalizer { - getHeights: (element:Object) => Array; - applyHeight: ($eqParent:Object, heights:Array) => void; - destroy: () => void; + getHeights(element:Object): Array; + applyHeight($eqParent:Object, heights:Array): void; + destroy(): void; } interface IEqualizerOptions { @@ -129,8 +129,8 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/interchange.html#javascript-reference export interface Interchange { - replace: (path:String) => void; - destroy: () => void; + replace(path:String): void; + destroy(): void; } interface IInterchangeOptions { @@ -139,9 +139,9 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/magellan.html#javascript-reference export interface Magellan { - calcPoints: () => void; - reflow: () => void; - destroy: () => void; + calcPoints(): void; + reflow(): void; + destroy(): void; } interface IMagellanOptions { @@ -154,10 +154,10 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/offcanvas.html#javascript-reference export interface OffCanvas { - open: (event:Object, trigger:JQuery) => void; - toggle: (event:Object, trigger:JQuery) => void; - close: () => void; - destroy: () => void; + open(event:Object, trigger:JQuery): void; + toggle(event:Object, trigger:JQuery): void; + close(): void; + destroy(): void; } interface IOffCanvasOptions { @@ -173,9 +173,9 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/orbit.html#javascript-reference export interface Orbit { - changeSlide: (isLTR:boolean, chosenSlide?:Object, idx?:number) => void; - geoSync: () => void; - destroy: () => void; + changeSlide(isLTR:boolean, chosenSlide?:Object, idx?:number): void; + geoSync(): void; + destroy(): void; } interface IOrbitOptions { @@ -200,10 +200,10 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/reveal.html#javascript-reference export interface Reveal { - open: () => void; - toggle: () => void; - close: () => void; - destroy: () => void; + open(): void; + toggle(): void; + close(): void; + destroy(): void; } interface IRevealOptions { @@ -224,7 +224,7 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/slider.html#javascript-reference export interface Slider { - destroy: () => void; + destroy(): void; } interface ISliderOptions { @@ -246,10 +246,10 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/sticky.html#javascript-reference export interface Sticky { - _pauseListeners: (scrollListener:String) => void; - _calc: (checkSizes:boolean, scroll:number) => void; - destroy: () => void; - emCalc: (number:any) => void; + _pauseListeners(scrollListener:String): void; + _calc(checkSizes:boolean, scroll:number): void; + destroy(): void; + emCalc(number:any): void; } interface IStickyOptions { @@ -268,9 +268,9 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/tabs.html#javascript-reference export interface Tabs { - _handleTabChange: ($target:JQuery) => void; - selectTab: ($target:JQuery) => void; - destroy: () => void; + _handleTabChange($target:JQuery): void; + selectTab($target:JQuery): void; + destroy(): void; } interface ITabsOptions { @@ -279,8 +279,8 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/toggler.html#javascript-reference export interface Toggler { - toggle: () => void; - destroy: () => void; + toggle(): void; + destroy(): void; } interface ITogglerOptions { @@ -289,10 +289,10 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/tooltip.html#javascript-reference export interface Tooltip { - show: () => void; - hide: () =>void; - toggle: () => void; - destroy: () => void; + show(): void; + hide() =>void; + toggle(): void; + destroy(): void; } interface ITooltipOptions { @@ -316,26 +316,26 @@ declare module Foundation { // --------- export interface Box { - ImNotTouchingYou: (element:Object, parent?:Object, lrOnly?:boolean, tbOnly?:boolean) => boolean; - GetDimensions: (element:Object) => Object; - GetOffsets: (element:Object, anchor:Object, position:String, vOffset:number, hOffset:number, isOverflow:boolean) => Object; + ImNotTouchingYou(element:Object, parent?:Object, lrOnly?:boolean, tbOnly?:boolean): boolean; + GetDimensions(element:Object): Object; + GetOffsets(element:Object, anchor:Object, position:String, vOffset:number, hOffset:number, isOverflow:boolean): Object; } export interface KeyBoard { - parseKey: (event:any) => String; - findFocusable: ($element:Object) => Object; + parseKey(event:any): String; + findFocusable($element:Object): Object; } export interface MediaQuery { - get: (size:String) => String; - atLeast: (size:String) => boolean; + get(size:String): String; + atLeast(size:String): boolean; queries:Array; current:any; } export interface Motion { - animateIn: (element:Object, animation:any, cb:Function) => void; - animateOut: (element:Object, animation:any, cb:Function) => void; + animateIn(element:Object, animation:any, cb:Function): void; + animateOut(element:Object, animation:any, cb:Function): void; } interface Move { @@ -347,9 +347,9 @@ declare module Foundation { } export interface Timer { - start: () => void; - restart: () => void; - pause: () => void; + start(): void; + restart(): void; + pause(): void; } interface Touch { @@ -360,67 +360,55 @@ declare module Foundation { // TODO :extension on jQuery } - export interface InterChange { - destroy: () => void; - } - interface IInterChangeOptions { - rules ?: Array; - } - interface ITooltipOptions { - hoverDelay ?: number; - fadeInDuration ?: number; - fadeOutDuration ?: number; - disableHover ?: boolean; - templateClasses ?: String; - tooltipClass ?: String; - triggerClass ?: String; - showOn ?: String; - template ?: String; - tipText ?: String; - clickOpenr ?: boolean; - positionClass ?: String; - vOffset ?: number; - hOffset ?: number; - } - interface FoundationStatic { version : String; - rtl: () => boolean; - plugin: (plugin:Object, name:String) => void; - registerPlugin: (plugin:Object) => void; - unregisterPlugin: (plugin:Object) => void; - GetYoDigits: (length:number, namespace?:String) => String; - reflow: (elem:Object, plugins?:Array|String) => void; - getFnName: (fofn:String) => String; - transitionend: () => String; + rtl(): boolean; + plugin(plugin:Object, name:String): void; + registerPlugin(plugin:Object): void; + unregisterPlugin(plugin:Object): void; + GetYoDigits(length:number, namespace?:String): String; + reflow(elem:Object, plugins?:Array|String): void; + getFnName(fn:String): String; + transitionend(): String; util : { - throttle(func:(...args:any[]) => any, delay:number) : (...args:any[]) => any; + throttle(func:(...args:any[]) => any, delay:number) (...args:any[]) => any; }; - onImagesLoaded: (images:Object, cb:Function) => void; + onImagesLoaded(images:Object, cb:Function): void; - Abide: (element:Object, options:IAbideOptions) => void; - Accordion: (element:Object, options:IAccordionOptions) => void; - Dropdown: (element:Object, options:IDropdownOptions) => void; - DropdownMenu: (element:Object, options:IDropdownMenuOptions) => void; - Equalizer: (element:Object, options:IEqualizerOptions) => void; - Interchange: (element:Object, options:IInterChangeOptions) => void; - Magellan: (element:Object, options:IMagellanOptions) => void; - OffCanvas: (element:Object, options:IOffCanvasOptions) => void; - Orbit: (element:Object, options:IOrbitOptions) => void; - Reveal: (element:Object, options:IRevealOptions) => void; - Slider: (element:Object, options:ISliderOptions) => void; - Sticky: (element:Object, options:IStickyOptions) => void; - Tabs: (element:Object, options:ITabsOptions) => void; - Toggler: (element:Object, options:ITogglerOptions) => void; - Tooltip: (element:Object, options:ITooltipOptions) => void; + Abide(element:Object, options?:IAbideOptions): Foundation.Abide; + Accordion(element:Object, options?:IAccordionOptions): Foundation.Accordion; + Dropdown(element:Object, options?:IDropdownOptions): Foundation.Dropdown; + DropdownMenu(element:Object, options?:IDropdownMenuOptions): Foundation.DropdownMenu; + Equalizer(element:Object, options?:IEqualizerOptions): Foundation.Equalizer; + Interchange(element:Object, options?:IInterChangeOptions): Foundation.Interchange; + Magellan(element:Object, options?:IMagellanOptions): Foundation.Magellan; + OffCanvas(element:Object, options?:IOffCanvasOptions): Foundation.OffCanvas; + Orbit(element:Object, options?:IOrbitOptions): Foundation.Orbit; + Reveal(element:Object, options?:IRevealOptions): Foundation.Reveal; + Slider(element:Object, options?:ISliderOptions): Foundation.Slider; + Sticky(element:Object, options?:IStickyOptions): Foundation.Sticky; + Tabs(element:Object, options?:ITabsOptions): Foundation.Tabs; + Toggler(element:Object, options?:ITogglerOptions): Foundation.Toggler; + Tooltip(element:Object, options?:ITooltipOptions): Foundation.Tooltip; + + // utils + Box: Foundation.Box; + KeyBoard: Foundation.Box; + MediaQuery: Foundation.MediaQuery; + Motion: Foundation.Motion; + Move: Foundation.Move; + Nest: Foundation.Nest; + Timer: Foundation.Timer; + Touch: Foundation.Touch; + Triggers: Foundation.Triggers; } } interface JQuery { - foundation(method:String|Array) : JQuery; + foundation(method?:String|Array) : JQuery; } declare var Foundation:Foundation.FoundationStatic; diff --git a/foundation/foundation-tests.ts b/foundation/foundation-tests.ts index 9706fbf97..ff7bb015b 100644 --- a/foundation/foundation-tests.ts +++ b/foundation/foundation-tests.ts @@ -344,3 +344,4 @@ $(document).foundation("reflow"); plugin_list().forEach((plugin) => $(document).foundation(plugin, "reflow")); $(document).foundation("slider", "set_value", 100); +Foundatio From 326a957e9df792e9d184f7567820f1280ea5ad41 Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Thu, 3 Dec 2015 11:20:18 +0100 Subject: [PATCH 07/13] update to tests --- foundation-sites/foundation-tests.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts index ca5bf283a..8daba37ac 100644 --- a/foundation-sites/foundation-tests.ts +++ b/foundation-sites/foundation-tests.ts @@ -11,7 +11,10 @@ $(document).foundation(); $(document).foundation('method'); $(document).foundation(['method', 'method2']); -function pluginList(){ +function pluginList() { + + 'use strict'; + return [ 'Abide', 'Accordion', From dc1a12df3ef2c2f308581a7b6c72ec717ddfde63 Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Thu, 3 Dec 2015 11:20:41 +0100 Subject: [PATCH 08/13] update to tests --- foundation-sites/foundation-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts index 8daba37ac..f7da5e49c 100644 --- a/foundation-sites/foundation-tests.ts +++ b/foundation-sites/foundation-tests.ts @@ -38,5 +38,5 @@ function pluginList() { pluginList().forEach((value:String) => { Foundation[value].($('.selector')); - Foundation[value].($('.selector'), {}, []); + Foundation[value].($('.selector'), {}); }); From 4e7e79f99f5acb6e17f310775f69ccc0b47ceb45 Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Thu, 3 Dec 2015 11:22:02 +0100 Subject: [PATCH 09/13] update to change i shouldn't have done :) --- foundation/foundation-tests.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/foundation/foundation-tests.ts b/foundation/foundation-tests.ts index ff7bb015b..9706fbf97 100644 --- a/foundation/foundation-tests.ts +++ b/foundation/foundation-tests.ts @@ -344,4 +344,3 @@ $(document).foundation("reflow"); plugin_list().forEach((plugin) => $(document).foundation(plugin, "reflow")); $(document).foundation("slider", "set_value", 100); -Foundatio From 44474f1af32f15eda11142ca4898cab3c596200c Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Thu, 3 Dec 2015 13:49:21 +0100 Subject: [PATCH 10/13] update --- foundation-sites/foundation-tests.ts | 57 +++++++++++++++++++++++++++- foundation-sites/foundation.d.ts | 48 ++++++++++++----------- npm-debug.log | 45 ++++++++++++++++++++++ 3 files changed, 127 insertions(+), 23 deletions(-) create mode 100644 npm-debug.log diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts index f7da5e49c..54da9fb79 100644 --- a/foundation-sites/foundation-tests.ts +++ b/foundation-sites/foundation-tests.ts @@ -1,7 +1,6 @@ // Tests for type definitions for Foundation Sites v6.0.4 // Project: http://foundation.zurb.com/ // Definitions by: Sam Vloeberghs -// Definitions by: Michał Wrześniewski // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -11,6 +10,60 @@ $(document).foundation(); $(document).foundation('method'); $(document).foundation(['method', 'method2']); + + Foundation.Abide.($('.selector')); + Foundation.Abide.($('.selector'), {}); +/* + Foundation.Accordion.($('.selector')); + Foundation.Accordion.($('.selector'), {}); + + Foundation.AccordionMenu.($('.selector')); + Foundation.AccordionMenu.($('.selector'), {}); + + Foundation.DrillDown.($('.selector')); + Foundation.DrillDown.($('.selector'), {}); + + Foundation.Dropdown.($('.selector')); + Foundation.Dropdown.($('.selector'), {}); + + Foundation.DropdownMenu.($('.selector')); + Foundation.DropdownMenu.($('.selector'), {}); + + Foundation.Equalizer.($('.selector')); + Foundation.Equalizer.($('.selector'), {}); + + Foundation.Interchange.($('.selector')); + Foundation.Interchange.($('.selector'), {}); + + Foundation.Magellan.($('.selector')); + Foundation.Magellan.($('.selector'), {}); + + Foundation.OffCanvas.($('.selector')); + Foundation.OffCanvas.($('.selector'), {}); + + Foundation.Orbit.($('.selector')); + Foundation.Orbit.($('.selector'), {}); + + Foundation.Reveal.($('.selector')); + Foundation.Reveal.($('.selector'), {}); + + Foundation.Slider.($('.selector')); + Foundation.Slider.($('.selector'), {}); + + Foundation.Sticky.($('.selector')); + Foundation.Sticky.($('.selector'), {}); + + Foundation.Tabs.($('.selector')); + Foundation.Tabs.($('.selector'), {}); + + Foundation.Toggler.($('.selector')); + Foundation.Toggler.($('.selector'), {}); + + Foundation.Tooltip.($('.selector')); + Foundation.Tooltip.($('.selector'), {}); + */ + +/* function pluginList() { 'use strict'; @@ -40,3 +93,5 @@ pluginList().forEach((value:String) => { Foundation[value].($('.selector')); Foundation[value].($('.selector'), {}); }); + +*/ diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts index bcd012ec9..3ec7f344e 100644 --- a/foundation-sites/foundation.d.ts +++ b/foundation-sites/foundation.d.ts @@ -1,7 +1,6 @@ // Type definitions for Foundation Sites v6.0.4 // Project: http://foundation.zurb.com/ // Definitions by: Sam Vloeberghs -// Definitions by: Michał Wrześniewski // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -18,10 +17,10 @@ declare module Foundation { validateForm(element:Object): void; validateText(element:Object): boolean; validateRadio(group:String): boolean; - resetform($form:Object): void; + resetForm($form:Object): void; } - export interface IAbidePatterns { + interface IAbidePatterns { alpha?: RegExp; alpha_numeric?: RegExp; integer?: RegExp; @@ -40,8 +39,8 @@ declare module Foundation { color?: RegExp; } - export interface IAbideOptions { - slideSpeed?: number + interface IAbideOptions { + slideSpeed?: number; multiOpen?: boolean; patters?: Foundation.IAbidePatterns; } @@ -54,7 +53,7 @@ declare module Foundation { destroy(): void; } - export interface IAccordionOptions { + interface IAccordionOptions { slideSpeed?: number multiOpen?: boolean; } @@ -67,7 +66,7 @@ declare module Foundation { destroy(): void; } - export interface IAccordionMenuOptions { + interface IAccordionMenuOptions { slideSpeed?: number; multiOpen?: boolean; } @@ -80,7 +79,7 @@ declare module Foundation { destroy(): void; } - export interface IDrilldownOptions { + interface IDrilldownOptions { backButton?: String; wrapper?: String closeOnClick?: boolean @@ -95,7 +94,7 @@ declare module Foundation { destroy(): void; } - export interface IDropdownOptions { + interface IDropdownOptions { hoverDelay?: number; hover?: boolean; vOffset?: number; @@ -110,7 +109,7 @@ declare module Foundation { destroy(): void; } - export interface IDropdownMenuOptions { + interface IDropdownMenuOptions { disableHover?: boolean; autoclose?: boolean; hoverDelay?: number; @@ -128,7 +127,7 @@ declare module Foundation { destroy(): void; } - export interface IEqualizerOptions { + interface IEqualizerOptions { equalizeOnStack?: boolean; throttleInterval?: number; } @@ -139,7 +138,7 @@ declare module Foundation { destroy(): void; } - export interface IInterchangeOptions { + interface IInterchangeOptions { rules?: Array } @@ -150,7 +149,7 @@ declare module Foundation { destroy(): void; } - export interface IMagellanOptions { + interface IMagellanOptions { animationDuration?: number; animationEasing?: String; threshold?: number; @@ -166,7 +165,7 @@ declare module Foundation { destroy(): void; } - export interface IOffCanvasOptions { + interface IOffCanvasOptions { closeOnClick?: boolean; transitionTime?: number; position?: String; @@ -184,7 +183,7 @@ declare module Foundation { destroy(): void; } - export interface IOrbitOptions { + interface IOrbitOptions { bullets?: boolean; navButtons?: boolean; animInFromRight?: String; @@ -212,7 +211,7 @@ declare module Foundation { destroy(): void; } - export interface IRevealOptions { + interface IRevealOptions { animationIn?: String; animationOut?: String; showDelay?: number; @@ -233,7 +232,7 @@ declare module Foundation { destroy(): void; } - export interface ISliderOptions { + interface ISliderOptions { start?: number; end?: number; step?: number; @@ -258,7 +257,7 @@ declare module Foundation { emCalc(number:any): void; } - export interface IStickyOptions { + interface IStickyOptions { container?: String; stickTo?: String; anchor?: String; @@ -279,7 +278,7 @@ declare module Foundation { destroy(): void; } - export interface ITabsOptions { + interface ITabsOptions { animate?: boolean; } @@ -289,7 +288,7 @@ declare module Foundation { destroy(): void; } - export interface ITogglerOptions { + interface ITogglerOptions { animate?: boolean; } @@ -301,7 +300,7 @@ declare module Foundation { destroy(): void; } - export interface ITooltipOptions { + interface ITooltipOptions { hoverDelay?: number; fadeInDuration?: number; fadeOutDuration?: number; @@ -381,7 +380,7 @@ declare module Foundation { transitionend(): String; util : { - throttle(func:(...args:any[]) => any, delay:number) (...args:any[]) => any; + throttle(func:(...args:any[]) => any, delay:number): (...args:any[]) => any; }; onImagesLoaded(images:Object, cb:Function): void; @@ -415,6 +414,7 @@ declare module Foundation { Triggers: Foundation.Triggers; } + } interface JQuery { @@ -422,3 +422,7 @@ interface JQuery { } declare var Foundation:Foundation.FoundationStatic; + +declare module "Foundation" { + export = Foundation; +} diff --git a/npm-debug.log b/npm-debug.log new file mode 100644 index 000000000..19dc7e7fd --- /dev/null +++ b/npm-debug.log @@ -0,0 +1,45 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/Cellar/node/4.2.1/bin/node', +1 verbose cli '/usr/local/bin/npm', +1 verbose cli 'run', +1 verbose cli 'test' ] +2 info using npm@3.3.9 +3 info using node@v4.2.1 +4 verbose run-script [ 'pretest', 'test', 'posttest' ] +5 info lifecycle DefinitelyTyped@0.0.1~pretest: DefinitelyTyped@0.0.1 +6 silly lifecycle DefinitelyTyped@0.0.1~pretest: no script for pretest, continuing +7 info lifecycle DefinitelyTyped@0.0.1~test: DefinitelyTyped@0.0.1 +8 verbose lifecycle DefinitelyTyped@0.0.1~test: unsafe-perm in lifecycle true +9 verbose lifecycle DefinitelyTyped@0.0.1~test: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Volumes/Data/Kwerri/playground/DefinitelyTyped/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin +10 verbose lifecycle DefinitelyTyped@0.0.1~test: CWD: /Volumes/Data/Kwerri/playground/DefinitelyTyped +11 silly lifecycle DefinitelyTyped@0.0.1~test: Args: [ '-c', 'dt --changes' ] +12 silly lifecycle DefinitelyTyped@0.0.1~test: Returned: code: 1 signal: null +13 info lifecycle DefinitelyTyped@0.0.1~test: Failed to exec test script +14 verbose stack Error: DefinitelyTyped@0.0.1 test: `dt --changes` +14 verbose stack Exit status 1 +14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:233:16) +14 verbose stack at emitTwo (events.js:87:13) +14 verbose stack at EventEmitter.emit (events.js:172:7) +14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) +14 verbose stack at emitTwo (events.js:87:13) +14 verbose stack at ChildProcess.emit (events.js:172:7) +14 verbose stack at maybeClose (internal/child_process.js:818:16) +14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) +15 verbose pkgid DefinitelyTyped@0.0.1 +16 verbose cwd /Volumes/Data/Kwerri/playground/DefinitelyTyped +17 error Darwin 15.0.0 +18 error argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "run" "test" +19 error node v4.2.1 +20 error npm v3.3.9 +21 error code ELIFECYCLE +22 error DefinitelyTyped@0.0.1 test: `dt --changes` +22 error Exit status 1 +23 error Failed at the DefinitelyTyped@0.0.1 test script 'dt --changes'. +23 error This is most likely a problem with the DefinitelyTyped package, +23 error not with npm itself. +23 error Tell the author that this fails on your system: +23 error dt --changes +23 error You can get their info via: +23 error npm owner ls DefinitelyTyped +23 error There is likely additional logging output above. +24 verbose exit [ 1, true ] From 37ee1fd3be5abea113a1a04ddfd4f269e642719d Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Fri, 4 Dec 2015 09:31:31 +0100 Subject: [PATCH 11/13] progress --- foundation-sites/foundation-tests.ts | 115 +++++++++---------- foundation-sites/foundation.d.ts | 166 +++++++++++++-------------- foundation-sites/npm-debug.log | 45 ++++++++ 3 files changed, 185 insertions(+), 141 deletions(-) create mode 100644 foundation-sites/npm-debug.log diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts index 54da9fb79..50f88559b 100644 --- a/foundation-sites/foundation-tests.ts +++ b/foundation-sites/foundation-tests.ts @@ -10,60 +10,6 @@ $(document).foundation(); $(document).foundation('method'); $(document).foundation(['method', 'method2']); - - Foundation.Abide.($('.selector')); - Foundation.Abide.($('.selector'), {}); -/* - Foundation.Accordion.($('.selector')); - Foundation.Accordion.($('.selector'), {}); - - Foundation.AccordionMenu.($('.selector')); - Foundation.AccordionMenu.($('.selector'), {}); - - Foundation.DrillDown.($('.selector')); - Foundation.DrillDown.($('.selector'), {}); - - Foundation.Dropdown.($('.selector')); - Foundation.Dropdown.($('.selector'), {}); - - Foundation.DropdownMenu.($('.selector')); - Foundation.DropdownMenu.($('.selector'), {}); - - Foundation.Equalizer.($('.selector')); - Foundation.Equalizer.($('.selector'), {}); - - Foundation.Interchange.($('.selector')); - Foundation.Interchange.($('.selector'), {}); - - Foundation.Magellan.($('.selector')); - Foundation.Magellan.($('.selector'), {}); - - Foundation.OffCanvas.($('.selector')); - Foundation.OffCanvas.($('.selector'), {}); - - Foundation.Orbit.($('.selector')); - Foundation.Orbit.($('.selector'), {}); - - Foundation.Reveal.($('.selector')); - Foundation.Reveal.($('.selector'), {}); - - Foundation.Slider.($('.selector')); - Foundation.Slider.($('.selector'), {}); - - Foundation.Sticky.($('.selector')); - Foundation.Sticky.($('.selector'), {}); - - Foundation.Tabs.($('.selector')); - Foundation.Tabs.($('.selector'), {}); - - Foundation.Toggler.($('.selector')); - Foundation.Toggler.($('.selector'), {}); - - Foundation.Tooltip.($('.selector')); - Foundation.Tooltip.($('.selector'), {}); - */ - -/* function pluginList() { 'use strict'; @@ -89,9 +35,62 @@ function pluginList() { ]; } -pluginList().forEach((value:String) => { - Foundation[value].($('.selector')); - Foundation[value].($('.selector'), {}); +pluginList().forEach((value:string) => { + Foundation[value]($('.selector')); + Foundation[value]($('.selector'), {}); }); -*/ +/* + Foundation.Abide($('.selector')); + Foundation.Abide($('.selector'), {}); + + Foundation.Accordion($('.selector')); + Foundation.Accordion($('.selector'), {}); + + Foundation.AccordionMenu($('.selector')); + Foundation.AccordionMenu($('.selector'), {}); + + Foundation.DrillDown($('.selector')); + Foundation.DrillDown($('.selector'), {}); + + Foundation.Dropdown($('.selector')); + Foundation.Dropdown($('.selector'), {}); + + Foundation.DropdownMenu($('.selector')); + Foundation.DropdownMenu($('.selector'), {}); + + Foundation.Equalizer($('.selector')); + Foundation.Equalizer($('.selector'), {}); + + Foundation.Interchange($('.selector')); + Foundation.Interchange($('.selector'), {}); + + Foundation.Magellan($('.selector')); + Foundation.Magellan($('.selector'), {}); + + Foundation.OffCanvas($('.selector')); + Foundation.OffCanvas($('.selector'), {}); + + Foundation.Orbit($('.selector')); + Foundation.Orbit($('.selector'), {}); + + Foundation.Reveal($('.selector')); + Foundation.Reveal($('.selector'), {}); + + Foundation.Slider($('.selector')); + Foundation.Slider($('.selector'), {}); + + Foundation.Sticky($('.selector')); + Foundation.Sticky($('.selector'), {}); + + Foundation.Tabs($('.selector')); + Foundation.Tabs($('.selector'), {}); + + Foundation.Toggler($('.selector')); + Foundation.Toggler($('.selector'), {}); + + Foundation.Tooltip($('.selector')); + Foundation.Tooltip($('.selector'), {}); + */ + + diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts index 3ec7f344e..dbdb56446 100644 --- a/foundation-sites/foundation.d.ts +++ b/foundation-sites/foundation.d.ts @@ -5,7 +5,7 @@ /// -declare module Foundation { +declare module FoundationSites { // http://foundation.zurb.com/sites/docs/abide.html#javascript-reference interface Abide { @@ -16,7 +16,7 @@ declare module Foundation { validateInput(element:Object, form:Object): void; validateForm(element:Object): void; validateText(element:Object): boolean; - validateRadio(group:String): boolean; + validateRadio(group:string): boolean; resetForm($form:Object): void; } @@ -42,7 +42,7 @@ declare module Foundation { interface IAbideOptions { slideSpeed?: number; multiOpen?: boolean; - patters?: Foundation.IAbidePatterns; + patters?: IAbidePatterns; } // http://foundation.zurb.com/sites/docs/accordion.html#javascript-reference @@ -80,14 +80,14 @@ declare module Foundation { } interface IDrilldownOptions { - backButton?: String; - wrapper?: String + backButton?: string; + wrapper?: string closeOnClick?: boolean } // http://foundation.zurb.com/sites/docs/dropdown.html#javascript-reference interface Dropdown { - getPositionClass(): String; + getPositionClass(): string; open(): void; close(): void; toggle(): void; @@ -99,7 +99,7 @@ declare module Foundation { hover?: boolean; vOffset?: number; hOffset?: number; - positionClass?: String; + positionClass?: string; trapFocus?: boolean; autoFocus?: boolean; } @@ -115,9 +115,9 @@ declare module Foundation { hoverDelay?: number; clickOpen?: boolean; closingTime?: number; - alignments?: String; - verticalClasss?: String; - rightClasss?: String; + alignments?: string; + verticalClasss?: string; + rightClasss?: string; } // http://foundation.zurb.com/sites/docs/equalizer.html#javascript-reference @@ -134,7 +134,7 @@ declare module Foundation { // http://foundation.zurb.com/sites/docs/interchange.html#javascript-reference interface Interchange { - replace(path:String): void; + replace(path:string): void; destroy(): void; } @@ -151,9 +151,9 @@ declare module Foundation { interface IMagellanOptions { animationDuration?: number; - animationEasing?: String; + animationEasing?: string; threshold?: number; - activeClass?: String; + activeClass?: string; deepLinking?: boolean; } @@ -168,12 +168,12 @@ declare module Foundation { interface IOffCanvasOptions { closeOnClick?: boolean; transitionTime?: number; - position?: String; + position?: string; forceTop?: boolean; isRevealed?: boolean; - revealOn?: String; + revealOn?: string; autoFocus?: boolean; - revealClass?: String; + revealClass?: string; } // http://foundation.zurb.com/sites/docs/orbit.html#javascript-reference @@ -186,21 +186,21 @@ declare module Foundation { interface IOrbitOptions { bullets?: boolean; navButtons?: boolean; - animInFromRight?: String; - animOutToRight?: String; - animInFromLeft?: String; - animOutToLeft?: String; + animInFromRight?: string; + animOutToRight?: string; + animInFromLeft?: string; + animOutToLeft?: string; autoPlay?: boolean; timerDelay?: number; infiniteWrap?: boolean; swipe?: boolean; pauseOnHover?: boolean; accessible?: boolean; - containerClass?: String; - slideClass?: String; - boxOfBullets?: String; - nextClass?: String; - prevClass?: String; + containerClass?: string; + slideClass?: string; + boxOfBullets?: string; + nextClass?: string; + prevClass?: string; } // http://foundation.zurb.com/sites/docs/reveal.html#javascript-reference @@ -212,8 +212,8 @@ declare module Foundation { } interface IRevealOptions { - animationIn?: String; - animationOut?: String; + animationIn?: string; + animationOut?: string; showDelay?: number; hideDelay?: number; closeOnClick?: boolean; @@ -246,28 +246,28 @@ declare module Foundation { doubleSided?: boolean; decimal?: number; moveTime?: number; - disabledClass?: String; + disabledClass?: string; } // http://foundation.zurb.com/sites/docs/sticky.html#javascript-reference interface Sticky { - _pauseListeners(scrollListener:String): void; + _pauseListeners(scrollListener:string): void; _calc(checkSizes:boolean, scroll:number): void; destroy(): void; emCalc(number:any): void; } interface IStickyOptions { - container?: String; - stickTo?: String; - anchor?: String; - topAnchor?: String; - btmAnchor?: String; + container?: string; + stickTo?: string; + anchor?: string; + topAnchor?: string; + btmAnchor?: string; marginTop?: number; marginBottom?: number; - stickyOn?: String; - stickyClass?: String; - containerClass?: String; + stickyOn?: string; + stickyClass?: string; + containerClass?: string; checkEvery?: number; } @@ -305,14 +305,14 @@ declare module Foundation { fadeInDuration?: number; fadeOutDuration?: number; disableHover?: boolean; - templateClasses?: String; - tooltipClass?: String; - triggerClass?: String; - showOn?: String; - template?: String; - tipText?: String; + templateClasses?: string; + tooltipClass?: string; + triggerClass?: string; + showOn?: string; + template?: string; + tipText?: string; clickOpen?: boolean; - positionClass?: String; + positionClass?: string; vOffset?: number; hOffset?:number; } @@ -323,17 +323,17 @@ declare module Foundation { interface Box { ImNotTouchingYou(element:Object, parent?:Object, lrOnly?:boolean, tbOnly?:boolean): boolean; GetDimensions(element:Object): Object; - GetOffsets(element:Object, anchor:Object, position:String, vOffset:number, hOffset:number, isOverflow:boolean): Object; + GetOffsets(element:Object, anchor:Object, position:string, vOffset:number, hOffset:number, isOverflow:boolean): Object; } interface KeyBoard { - parseKey(event:any): String; + parseKey(event:any): string; findFocusable($element:Object): Object; } interface MediaQuery { - get(size:String): String; - atLeast(size:String): boolean; + get(size:string): string; + atLeast(size:string): boolean; queries:Array; current:any; } @@ -367,61 +367,61 @@ declare module Foundation { // TODO :extension on jQuery } - interface FoundationStatic { - version : String; + interface FoundationSitesStatic { + version : string; rtl(): boolean; - plugin(plugin:Object, name:String): void; + plugin(plugin:Object, name:string): void; registerPlugin(plugin:Object): void; unregisterPlugin(plugin:Object): void; - GetYoDigits(length:number, namespace?:String): String; - reflow(elem:Object, plugins?:Array|String): void; - getFnName(fn:String): String; - transitionend(): String; + GetYoDigits(length:number, namespace?:string): string; + reflow(elem:Object, plugins?:Array|string): void; + getFnName(fn:string): string; + transitionend(): string; util : { throttle(func:(...args:any[]) => any, delay:number): (...args:any[]) => any; }; onImagesLoaded(images:Object, cb:Function): void; - Abide(element:Object, options?:IAbideOptions): Foundation.Abide; - Accordion(element:Object, options?:IAccordionOptions): Foundation.Accordion; - AccordionMenu(element:Object, options?:IAccordionMenuOptions): Foundation.AccordionMenu; - DrillDown(element:Object, options?:IDrilldownOptions): Foundation.Drilldown; - Dropdown(element:Object, options?:IDropdownOptions): Foundation.Dropdown; - DropdownMenu(element:Object, options?:IDropdownMenuOptions): Foundation.DropdownMenu; - Equalizer(element:Object, options?:IEqualizerOptions): Foundation.Equalizer; - Interchange(element:Object, options?:IInterchangeOptions): Foundation.Interchange; - Magellan(element:Object, options?:IMagellanOptions): Foundation.Magellan; - OffCanvas(element:Object, options?:IOffCanvasOptions): Foundation.OffCanvas; - Orbit(element:Object, options?:IOrbitOptions): Foundation.Orbit; - Reveal(element:Object, options?:IRevealOptions): Foundation.Reveal; - Slider(element:Object, options?:ISliderOptions): Foundation.Slider; - Sticky(element:Object, options?:IStickyOptions): Foundation.Sticky; - Tabs(element:Object, options?:ITabsOptions): Foundation.Tabs; - Toggler(element:Object, options?:ITogglerOptions): Foundation.Toggler; - Tooltip(element:Object, options?:ITooltipOptions): Foundation.Tooltip; + Abide(element:Object, options?:IAbideOptions): Abide; + Accordion(element:Object, options?:IAccordionOptions): Accordion; + AccordionMenu(element:Object, options?:IAccordionMenuOptions): AccordionMenu; + DrillDown(element:Object, options?:IDrilldownOptions): Drilldown; + Dropdown(element:Object, options?:IDropdownOptions): Dropdown; + DropdownMenu(element:Object, options?:IDropdownMenuOptions): DropdownMenu; + Equalizer(element:Object, options?:IEqualizerOptions): Equalizer; + Interchange(element:Object, options?:IInterchangeOptions): Interchange; + Magellan(element:Object, options?:IMagellanOptions): Magellan; + OffCanvas(element:Object, options?:IOffCanvasOptions): OffCanvas; + Orbit(element:Object, options?:IOrbitOptions): Orbit; + Reveal(element:Object, options?:IRevealOptions): Reveal; + Slider(element:Object, options?:ISliderOptions): Slider; + Sticky(element:Object, options?:IStickyOptions): Sticky; + Tabs(element:Object, options?:ITabsOptions): Tabs; + Toggler(element:Object, options?:ITogglerOptions): Toggler; + Tooltip(element:Object, options?:ITooltipOptions): Tooltip; // utils - Box: Foundation.Box; - KeyBoard: Foundation.KeyBoard; - MediaQuery: Foundation.MediaQuery; - Motion: Foundation.Motion; - Move: Foundation.Move; - Nest: Foundation.Nest; - Timer: Foundation.Timer; - Touch: Foundation.Touch; - Triggers: Foundation.Triggers; + Box: Box; + KeyBoard: KeyBoard; + MediaQuery: MediaQuery; + Motion: Motion; + Move: Move; + Nest: Nest; + Timer: Timer; + Touch: Touch; + Triggers: Triggers; } } interface JQuery { - foundation(method?:String|Array) : JQuery; + foundation(method?:string|Array) : JQuery; } -declare var Foundation:Foundation.FoundationStatic; +declare var Foundation:FoundationSites.FoundationSitesStatic; declare module "Foundation" { export = Foundation; diff --git a/foundation-sites/npm-debug.log b/foundation-sites/npm-debug.log new file mode 100644 index 000000000..5a8786ce4 --- /dev/null +++ b/foundation-sites/npm-debug.log @@ -0,0 +1,45 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/Cellar/node/4.2.1/bin/node', +1 verbose cli '/usr/local/bin/npm', +1 verbose cli 'run', +1 verbose cli 'test' ] +2 info using npm@3.3.9 +3 info using node@v4.2.1 +4 verbose run-script [ 'pretest', 'test', 'posttest' ] +5 info lifecycle DefinitelyTyped@0.0.1~pretest: DefinitelyTyped@0.0.1 +6 silly lifecycle DefinitelyTyped@0.0.1~pretest: no script for pretest, continuing +7 info lifecycle DefinitelyTyped@0.0.1~test: DefinitelyTyped@0.0.1 +8 verbose lifecycle DefinitelyTyped@0.0.1~test: unsafe-perm in lifecycle true +9 verbose lifecycle DefinitelyTyped@0.0.1~test: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Volumes/Data/Kwerri/playground/DefinitelyTyped/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin +10 verbose lifecycle DefinitelyTyped@0.0.1~test: CWD: /Volumes/Data/Kwerri/playground/DefinitelyTyped +11 silly lifecycle DefinitelyTyped@0.0.1~test: Args: [ '-c', 'dt --changes' ] +12 silly lifecycle DefinitelyTyped@0.0.1~test: Returned: code: 1 signal: null +13 info lifecycle DefinitelyTyped@0.0.1~test: Failed to exec test script +14 verbose stack Error: DefinitelyTyped@0.0.1 test: `dt --changes` +14 verbose stack Exit status 1 +14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:233:16) +14 verbose stack at emitTwo (events.js:87:13) +14 verbose stack at EventEmitter.emit (events.js:172:7) +14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) +14 verbose stack at emitTwo (events.js:87:13) +14 verbose stack at ChildProcess.emit (events.js:172:7) +14 verbose stack at maybeClose (internal/child_process.js:818:16) +14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) +15 verbose pkgid DefinitelyTyped@0.0.1 +16 verbose cwd /Volumes/Data/Kwerri/playground/DefinitelyTyped/foundation-sites +17 error Darwin 15.0.0 +18 error argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "run" "test" +19 error node v4.2.1 +20 error npm v3.3.9 +21 error code ELIFECYCLE +22 error DefinitelyTyped@0.0.1 test: `dt --changes` +22 error Exit status 1 +23 error Failed at the DefinitelyTyped@0.0.1 test script 'dt --changes'. +23 error This is most likely a problem with the DefinitelyTyped package, +23 error not with npm itself. +23 error Tell the author that this fails on your system: +23 error dt --changes +23 error You can get their info via: +23 error npm owner ls DefinitelyTyped +23 error There is likely additional logging output above. +24 verbose exit [ 1, true ] From 60205dabae191b1fd68fb7830103a6ec7a83a342 Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Fri, 4 Dec 2015 10:10:36 +0100 Subject: [PATCH 12/13] update to tests --- foundation-sites/foundation-tests.ts | 149 ++++++++++++++------------- foundation-sites/foundation.d.ts | 2 +- foundation-sites/npm-debug.log | 45 -------- 3 files changed, 77 insertions(+), 119 deletions(-) delete mode 100644 foundation-sites/npm-debug.log diff --git a/foundation-sites/foundation-tests.ts b/foundation-sites/foundation-tests.ts index 50f88559b..225f3c0fa 100644 --- a/foundation-sites/foundation-tests.ts +++ b/foundation-sites/foundation-tests.ts @@ -7,90 +7,93 @@ /// $(document).foundation(); -$(document).foundation('method'); +$(document).foundation('method5'); $(document).foundation(['method', 'method2']); -function pluginList() { +Foundation.Abide($('.selector')); +Foundation.Abide($('.selector'), {}); - 'use strict'; +Foundation.Accordion($('.selector')); +Foundation.Accordion($('.selector'), {}); - return [ - 'Abide', - 'Accordion', - 'AccordionMenu', - 'DrillDown', - 'Dropdown', - 'DropdownMenu', - 'Equalizer', - 'Interchange', - 'Magellan', - 'OffCanvas', - 'Orbit', - 'Reveal', - 'Slider', - 'Sticky', - 'Tabs', - 'Toggler', - 'Tooltip' - ]; -} +Foundation.AccordionMenu($('.selector')); +Foundation.AccordionMenu($('.selector'), {}); -pluginList().forEach((value:string) => { - Foundation[value]($('.selector')); - Foundation[value]($('.selector'), {}); -}); +Foundation.DrillDown($('.selector')); +Foundation.DrillDown($('.selector'), {}); + +Foundation.Dropdown($('.selector')); +Foundation.Dropdown($('.selector'), {}); + +Foundation.DropdownMenu($('.selector')); +Foundation.DropdownMenu($('.selector'), {}); + +Foundation.Equalizer($('.selector')); +Foundation.Equalizer($('.selector'), {}); + +Foundation.Interchange($('.selector')); +Foundation.Interchange($('.selector'), {}); + +Foundation.Magellan($('.selector')); +Foundation.Magellan($('.selector'), {}); + +Foundation.OffCanvas($('.selector')); +Foundation.OffCanvas($('.selector'), {}); + +Foundation.Orbit($('.selector')); +Foundation.Orbit($('.selector'), {}); + +Foundation.Reveal($('.selector')); +Foundation.Reveal($('.selector'), {}); + +Foundation.Slider($('.selector')); +Foundation.Slider($('.selector'), {}); + +Foundation.Sticky($('.selector')); +Foundation.Sticky($('.selector'), {}); + +Foundation.Tabs($('.selector')); +Foundation.Tabs($('.selector'), {}); + +Foundation.Toggler($('.selector')); +Foundation.Toggler($('.selector'), {}); + +Foundation.Tooltip($('.selector')); +Foundation.Tooltip($('.selector'), {}); /* - Foundation.Abide($('.selector')); - Foundation.Abide($('.selector'), {}); + TODO: fix this: + error TS7017: Index signature of object type implicitly has an 'any' type. - Foundation.Accordion($('.selector')); - Foundation.Accordion($('.selector'), {}); + function pluginList() { - Foundation.AccordionMenu($('.selector')); - Foundation.AccordionMenu($('.selector'), {}); + 'use strict'; - Foundation.DrillDown($('.selector')); - Foundation.DrillDown($('.selector'), {}); + return [ + 'Abide', + 'Accordion', + 'AccordionMenu', + 'DrillDown', + 'Dropdown', + 'DropdownMenu', + 'Equalizer', + 'Interchange', + 'Magellan', + 'OffCanvas', + 'Orbit', + 'Reveal', + 'Slider', + 'Sticky', + 'Tabs', + 'Toggler', + 'Tooltip' + ]; + } - Foundation.Dropdown($('.selector')); - Foundation.Dropdown($('.selector'), {}); - - Foundation.DropdownMenu($('.selector')); - Foundation.DropdownMenu($('.selector'), {}); - - Foundation.Equalizer($('.selector')); - Foundation.Equalizer($('.selector'), {}); - - Foundation.Interchange($('.selector')); - Foundation.Interchange($('.selector'), {}); - - Foundation.Magellan($('.selector')); - Foundation.Magellan($('.selector'), {}); - - Foundation.OffCanvas($('.selector')); - Foundation.OffCanvas($('.selector'), {}); - - Foundation.Orbit($('.selector')); - Foundation.Orbit($('.selector'), {}); - - Foundation.Reveal($('.selector')); - Foundation.Reveal($('.selector'), {}); - - Foundation.Slider($('.selector')); - Foundation.Slider($('.selector'), {}); - - Foundation.Sticky($('.selector')); - Foundation.Sticky($('.selector'), {}); - - Foundation.Tabs($('.selector')); - Foundation.Tabs($('.selector'), {}); - - Foundation.Toggler($('.selector')); - Foundation.Toggler($('.selector'), {}); - - Foundation.Tooltip($('.selector')); - Foundation.Tooltip($('.selector'), {}); + pluginList().forEach((value:string) => { + Foundation[value]($('.selector')); + Foundation[value]($('.selector'), {}); + }); */ diff --git a/foundation-sites/foundation.d.ts b/foundation-sites/foundation.d.ts index dbdb56446..a6dd7682d 100644 --- a/foundation-sites/foundation.d.ts +++ b/foundation-sites/foundation.d.ts @@ -9,7 +9,7 @@ declare module FoundationSites { // http://foundation.zurb.com/sites/docs/abide.html#javascript-reference interface Abide { - requiredCheck(element:Object): boolean; + requiredChedck(element:Object): boolean; findLabel(element:Object): boolean; addErrorClasses(element:Object): void; removeErrorClasses(element:Object): void; diff --git a/foundation-sites/npm-debug.log b/foundation-sites/npm-debug.log deleted file mode 100644 index 5a8786ce4..000000000 --- a/foundation-sites/npm-debug.log +++ /dev/null @@ -1,45 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/local/Cellar/node/4.2.1/bin/node', -1 verbose cli '/usr/local/bin/npm', -1 verbose cli 'run', -1 verbose cli 'test' ] -2 info using npm@3.3.9 -3 info using node@v4.2.1 -4 verbose run-script [ 'pretest', 'test', 'posttest' ] -5 info lifecycle DefinitelyTyped@0.0.1~pretest: DefinitelyTyped@0.0.1 -6 silly lifecycle DefinitelyTyped@0.0.1~pretest: no script for pretest, continuing -7 info lifecycle DefinitelyTyped@0.0.1~test: DefinitelyTyped@0.0.1 -8 verbose lifecycle DefinitelyTyped@0.0.1~test: unsafe-perm in lifecycle true -9 verbose lifecycle DefinitelyTyped@0.0.1~test: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Volumes/Data/Kwerri/playground/DefinitelyTyped/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin -10 verbose lifecycle DefinitelyTyped@0.0.1~test: CWD: /Volumes/Data/Kwerri/playground/DefinitelyTyped -11 silly lifecycle DefinitelyTyped@0.0.1~test: Args: [ '-c', 'dt --changes' ] -12 silly lifecycle DefinitelyTyped@0.0.1~test: Returned: code: 1 signal: null -13 info lifecycle DefinitelyTyped@0.0.1~test: Failed to exec test script -14 verbose stack Error: DefinitelyTyped@0.0.1 test: `dt --changes` -14 verbose stack Exit status 1 -14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:233:16) -14 verbose stack at emitTwo (events.js:87:13) -14 verbose stack at EventEmitter.emit (events.js:172:7) -14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) -14 verbose stack at emitTwo (events.js:87:13) -14 verbose stack at ChildProcess.emit (events.js:172:7) -14 verbose stack at maybeClose (internal/child_process.js:818:16) -14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) -15 verbose pkgid DefinitelyTyped@0.0.1 -16 verbose cwd /Volumes/Data/Kwerri/playground/DefinitelyTyped/foundation-sites -17 error Darwin 15.0.0 -18 error argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "run" "test" -19 error node v4.2.1 -20 error npm v3.3.9 -21 error code ELIFECYCLE -22 error DefinitelyTyped@0.0.1 test: `dt --changes` -22 error Exit status 1 -23 error Failed at the DefinitelyTyped@0.0.1 test script 'dt --changes'. -23 error This is most likely a problem with the DefinitelyTyped package, -23 error not with npm itself. -23 error Tell the author that this fails on your system: -23 error dt --changes -23 error You can get their info via: -23 error npm owner ls DefinitelyTyped -23 error There is likely additional logging output above. -24 verbose exit [ 1, true ] From f7874b963eb324a9ac52caf9dda620c515de936a Mon Sep 17 00:00:00 2001 From: Sam Vloeberghs Date: Fri, 4 Dec 2015 10:13:00 +0100 Subject: [PATCH 13/13] removed debug log --- npm-debug.log | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 npm-debug.log diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index 19dc7e7fd..000000000 --- a/npm-debug.log +++ /dev/null @@ -1,45 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/local/Cellar/node/4.2.1/bin/node', -1 verbose cli '/usr/local/bin/npm', -1 verbose cli 'run', -1 verbose cli 'test' ] -2 info using npm@3.3.9 -3 info using node@v4.2.1 -4 verbose run-script [ 'pretest', 'test', 'posttest' ] -5 info lifecycle DefinitelyTyped@0.0.1~pretest: DefinitelyTyped@0.0.1 -6 silly lifecycle DefinitelyTyped@0.0.1~pretest: no script for pretest, continuing -7 info lifecycle DefinitelyTyped@0.0.1~test: DefinitelyTyped@0.0.1 -8 verbose lifecycle DefinitelyTyped@0.0.1~test: unsafe-perm in lifecycle true -9 verbose lifecycle DefinitelyTyped@0.0.1~test: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Volumes/Data/Kwerri/playground/DefinitelyTyped/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin -10 verbose lifecycle DefinitelyTyped@0.0.1~test: CWD: /Volumes/Data/Kwerri/playground/DefinitelyTyped -11 silly lifecycle DefinitelyTyped@0.0.1~test: Args: [ '-c', 'dt --changes' ] -12 silly lifecycle DefinitelyTyped@0.0.1~test: Returned: code: 1 signal: null -13 info lifecycle DefinitelyTyped@0.0.1~test: Failed to exec test script -14 verbose stack Error: DefinitelyTyped@0.0.1 test: `dt --changes` -14 verbose stack Exit status 1 -14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:233:16) -14 verbose stack at emitTwo (events.js:87:13) -14 verbose stack at EventEmitter.emit (events.js:172:7) -14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) -14 verbose stack at emitTwo (events.js:87:13) -14 verbose stack at ChildProcess.emit (events.js:172:7) -14 verbose stack at maybeClose (internal/child_process.js:818:16) -14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) -15 verbose pkgid DefinitelyTyped@0.0.1 -16 verbose cwd /Volumes/Data/Kwerri/playground/DefinitelyTyped -17 error Darwin 15.0.0 -18 error argv "/usr/local/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "run" "test" -19 error node v4.2.1 -20 error npm v3.3.9 -21 error code ELIFECYCLE -22 error DefinitelyTyped@0.0.1 test: `dt --changes` -22 error Exit status 1 -23 error Failed at the DefinitelyTyped@0.0.1 test script 'dt --changes'. -23 error This is most likely a problem with the DefinitelyTyped package, -23 error not with npm itself. -23 error Tell the author that this fails on your system: -23 error dt --changes -23 error You can get their info via: -23 error npm owner ls DefinitelyTyped -23 error There is likely additional logging output above. -24 verbose exit [ 1, true ]