2.1.3 • Published 7 months ago

@types/fitvids v2.1.3

Weekly downloads
80
License
MIT
Repository
github
Last release
7 months ago

Installation

npm install --save @types/fitvids

Summary

This package contains type definitions for fitvids (https://github.com/rosszurowski/vanilla-fitvids#readme).

Details

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

index.d.ts

// Type definitions for fitvids 2.1
// Project: https://github.com/rosszurowski/vanilla-fitvids#readme
// Definitions by: Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/**
 * Lets your videos be responsive by wrapping them in an aspect ratio container.
 */
export as namespace fitvids;

/**
 * The module exports a single function.
 * Just call it, and it'll wrap video embeds from Youtube, Vimeo, and Kickstarter in a responsive container.
 * Other video players can be supported by passing a custom selector via the options.
 *
 * To wrap videos that have been added to the page dynamically, just call the function again.
 * Fitvids is smart enough to only wrap the new videos.
 */
declare function fitvids(
    parentSelector?: string | (Element | null) | NodeListOf<Element>,
    options?: fitvids.Options,
): void;
declare function fitvids(options: fitvids.Options): void;

declare namespace fitvids {
    interface Options {
        /**
         * If you'd like to ignore certain videos, you can pass a selector via the ignore option.
         * @default ""
         */
        ignore?: string | string[] | undefined;
        /**
         * By default, fitvids automatically wraps Youtube, Vimeo, and Kickstarter players,
         * but if you'd like it to wrap others too, you can pass them in as selectors via the players property.
         * @default ""
         */
        players?: string | string[] | undefined;
    }
}

export = fitvids;

Additional Details

  • Last updated: Thu, 08 Jul 2021 12:01:40 GMT
  • Dependencies: none
  • Global values: fitvids

Credits

These definitions were written by Piotr Błażejewicz.