viewerjs-soda
TypeScript icon, indicating that this package has built-in type declarations

1.0.1Β β€’Β PublicΒ β€’Β Published

viewerjs-soda

NPM version NPM downloads

πŸš€ Functional invocation for viewerjs

Type

/**
 * @param image An image or a group of images.
 * @param options The options of the viewer.
 */
export function view(image: string | string[], options?: ViewerOptions): void
/**
 * @param image A group of images.
 * @param indexOrSrc The index of the image or the src to be displayed.
 * @param options The options of the viewer.
 */
export function view(image: string[], indexOrSrc: number | string, options?: ViewerOptions): void

Usage

import { view } from "viewerjs-soda"

const options: ViewerOptions | undefined = {/** your options */}

// view an image directly
view("https://xxx", options)

// view a group of images
view(["https://aaa", "https://bbb", "https://ccc"], options)

// view a group of images, start with an index
view(["https://aaa", "https://bbb", "https://ccc"], 2, options)

// view a group of images, start with a src
view(["https://aaa", "https://bbb", "https://ccc"], "https://ccc", options)

Package Sidebar

Install

npm i viewerjs-soda

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

19.2 kB

Total Files

9

Last publish

Collaborators

  • 1adybug