diff --git a/types/popper.js/index.d.ts b/types/popper.js/index.d.ts index 0f8f06a7ba..96f93b3192 100644 --- a/types/popper.js/index.d.ts +++ b/types/popper.js/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for popper.js v1.8.5 +// Type definitions for popper.js 1.8 // Project: https://github.com/FezVrasta/popper.js/ -// Definitions by: rhysd , joscha +// Definitions by: rhysd , joscha , seckardt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Popper { - export interface PopperOptions { + interface PopperOptions { placement?: string; boundariesPadding?: number; modifiers?: { @@ -14,18 +14,18 @@ declare namespace Popper { 'function'?: Function, onLoad?: Function, applyStyle?: { - gpuAcceleration?: boolean, + gpuAcceleration?: boolean }, preventOverflow?: { boundariesElement?: string | Element, - priority?: ('left' | 'right' | 'top' | 'bottom')[], + priority?: Array<'left' | 'right' | 'top' | 'bottom'> }, offset?: { - offset?: number, + offset?: number | string }, flip?: { behavior?: string | string[], - boundariesElement?: string | Element, + boundariesElement?: string | Element }, }; modifiersIgnored?: string[]; @@ -34,7 +34,7 @@ declare namespace Popper { onCreate?(data: Popper.Data): void; onUpdate?(data: Popper.Data): void; } - export class Modifiers { + class Modifiers { applyStyle(data: Object): Object; shift(data: Object): Object; preventOverflow(data: Object): Object; @@ -43,7 +43,7 @@ declare namespace Popper { offset(data: Object): Object; arrow(data: Object): Object; } - export interface Data { + interface Data { placement: string; offsets: { popper: { @@ -56,8 +56,8 @@ declare namespace Popper { } declare class Popper { - public modifiers: Popper.Modifiers; - public placement: string; + modifiers: Popper.Modifiers; + placement: string; constructor(reference: Element, popper: Element | Object, options?: Popper.PopperOptions); diff --git a/types/popper.js/popper.js-tests.ts b/types/popper.js/popper.js-tests.ts index 326a23206c..143de99ccc 100644 --- a/types/popper.js/popper.js-tests.ts +++ b/types/popper.js/popper.js-tests.ts @@ -1,4 +1,3 @@ - import Popper from 'popper.js'; var reference = document.querySelector('.my-button'); diff --git a/types/popper.js/tsconfig.json b/types/popper.js/tsconfig.json index 9c055568cf..d459943eff 100644 --- a/types/popper.js/tsconfig.json +++ b/types/popper.js/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "popper.js-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/popper.js/tslint.json b/types/popper.js/tslint.json new file mode 100644 index 0000000000..107ac2cd42 --- /dev/null +++ b/types/popper.js/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": false, + "no-single-declare-module": false, + "no-var": false + } +}