Skip to content

Latest commit

History

History
42 lines (31 loc) 路 1.22 KB

README.md

File metadata and controls

42 lines (31 loc) 路 1.22 KB

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)