5.0.4 • Published 6 months ago

@types/basiclightbox v5.0.4

Weekly downloads
318
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/basiclightbox

Summary

This package contains type definitions for basiclightbox (https://basiclightbox.electerious.com).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/basiclightbox.

index.d.ts

// Type definitions for basiclightbox 5.0
// Project: https://basiclightbox.electerious.com
// Definitions by: Adrian Hope-Bailie <https://github.com/adrianhopebailie>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export interface BasicLightBox {
    /**
     * Shows a lightbox instance.
     *
     * @param cb A function that gets executed as soon as the lightbox starts to fade in.
     */
    show: (cb?: () => void) => void;

    /**
     * Closes a lightbox instance.
     *
     * @param cb A function that gets executed as soon as the lightbox has been faded out.
     */
    close: (cb?: () => void) => void;

    /**
     * Returns true when the lightbox instance is visible. Also returns true when the lightbox is currently in the process of showing/hiding and not fully visible/hidden, yet.
     */
    visible: () => boolean;

    /**
     * Returns the DOM element/node associated with the instance.
     */
    element: () => Element;
  }

  export interface BasicLightBoxOptions {
    /*
     * Prevents the lightbox from closing when clicking its background.
     */
    closable?: boolean | undefined;
    /*
     * One or more space separated classes to be added to the basicLightbox element.
     */
    className?: string | undefined;
    /*
     * Function that gets executed before the lightbox will be shown.
     * Returning false will prevent the lightbox from showing.
     */
    onShow?: ((instance: BasicLightBox) => boolean) | undefined;
    /*
     * Function that gets executed before the lightbox closes.
     * Returning false will prevent the lightbox from closing.
     */
    onClose?: ((instance: BasicLightBox) => boolean) | undefined;
  }

  /**
   * Creates a new BasicLightbox instance.
   *
   * @param content Content of the lightbox.
   * @param options An object of options.
   */
  export function create(content: string | Element, options?: BasicLightBoxOptions): BasicLightBox;

  /**
   * Returns `true` when a lightbox is visible. Also returns true when a lightbox is currently in the process of showing/hiding and not fully visible/hidden, yet.
   */
  export function visible(): boolean;

Additional Details

  • Last updated: Wed, 07 Jul 2021 21:44:52 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Adrian Hope-Bailie.

5.0.4

6 months ago

5.0.3

7 months ago

5.0.2

8 months ago

5.0.1

3 years ago

5.0.0

5 years ago