mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 18:43:21 +08:00
Merge pull request #16551 from seckardt/feature/offset
popper.js: Update `PopperOptions.offset.offset` definition
This commit is contained in:
22
types/popper.js/index.d.ts
vendored
22
types/popper.js/index.d.ts
vendored
@@ -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 <https://rhysd.github.io>, joscha <https://github.com/joscha>
|
||||
// Definitions by: rhysd <https://rhysd.github.io>, joscha <https://github.com/joscha>, seckardt <https://github.com/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);
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import Popper from 'popper.js';
|
||||
|
||||
var reference = document.querySelector('.my-button');
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
"index.d.ts",
|
||||
"popper.js-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
8
types/popper.js/tslint.json
Normal file
8
types/popper.js/tslint.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"ban-types": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-var": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user