mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-17 17:48:06 +00:00
* Add undefined to optional properties, part A In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment This PR covers non-widely used packages starting with a- and following. microsoft/dtslint#335 * reformat for shorter line length
69 lines
2.3 KiB
TypeScript
69 lines
2.3 KiB
TypeScript
// Type definitions for arrive 2.4
|
|
// Project: https://github.com/uzairfarooq/arrive
|
|
// Definitions by: Vijay Pemmaraju <https://github.com/vijaypemmaraju>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
// required for declare global to work
|
|
export { };
|
|
|
|
interface Options {
|
|
fireOnAttributesModification?: boolean | undefined;
|
|
onceOnly?: boolean | undefined;
|
|
existing?: boolean | undefined;
|
|
}
|
|
|
|
type ArriveSignature = (element: string, handlerOrOptions: ((this: Element, element: Element) => void) | Options, handler?: (this: Element, element: Element) => void) => void;
|
|
type UnbindArriveSignature = (elementOrHandler?: string | ((this: Element, element: Element) => void), handler?: (this: Element, element: Element) => void) => void;
|
|
type LeaveSignature = (element: string, handlerOrOptions: ((this: Element, element: Element) => void) | Options, handler?: (this: Element) => void) => void;
|
|
type UnbindLeaveSignature = (elementOrHandler?: string | ((this: Element, element: Element) => void), handler?: (this: Element, element: Element) => void) => void;
|
|
|
|
declare global {
|
|
// tslint:disable-next-line no-unnecessary-class
|
|
class Arrive {
|
|
static unbindAllArrive: () => void;
|
|
static unbindAllLeave: () => void;
|
|
}
|
|
|
|
interface Document {
|
|
arrive: ArriveSignature;
|
|
unbindArrive: UnbindArriveSignature;
|
|
leave: LeaveSignature;
|
|
unbindLeave: UnbindLeaveSignature;
|
|
}
|
|
|
|
interface JQuery {
|
|
arrive: ArriveSignature;
|
|
unbindArrive: UnbindArriveSignature;
|
|
leave: LeaveSignature;
|
|
unbindLeave: UnbindLeaveSignature;
|
|
}
|
|
|
|
interface Window {
|
|
arrive: ArriveSignature;
|
|
unbindArrive: UnbindArriveSignature;
|
|
leave: LeaveSignature;
|
|
unbindLeave: UnbindLeaveSignature;
|
|
}
|
|
|
|
interface NodeList {
|
|
arrive: ArriveSignature;
|
|
unbindArrive: UnbindArriveSignature;
|
|
leave: LeaveSignature;
|
|
unbindLeave: UnbindLeaveSignature;
|
|
}
|
|
|
|
interface Element {
|
|
arrive: ArriveSignature;
|
|
unbindArrive: UnbindArriveSignature;
|
|
leave: LeaveSignature;
|
|
unbindLeave: UnbindLeaveSignature;
|
|
}
|
|
|
|
interface HTMLCollectionBase {
|
|
arrive: ArriveSignature;
|
|
unbindArrive: UnbindArriveSignature;
|
|
leave: LeaveSignature;
|
|
unbindLeave: UnbindLeaveSignature;
|
|
}
|
|
}
|