@types/surma__rollup-plugin-off-main-thread
TypeScript icon, indicating that this package has built-in type declarations

2.2.3 • Public • Published

Installation

npm install --save @types/surma__rollup-plugin-off-main-thread

Summary

This package contains type definitions for @surma/rollup-plugin-off-main-thread (https://github.com/surma/rollup-plugin-off-main-thread).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/surma__rollup-plugin-off-main-thread.

index.d.ts

import { Plugin, RenderedChunk } from "rollup";

interface OffMainThreadOptions {
    /**
     * A string containing the EJS template for the amd loader.
     * If `undefined`, OMT will use `loader.ejs`.
     */
    loader?: string;
    /**
     * Use `fetch()` + `eval()` to load dependencies instead of `<script>` tags
     * and `importScripts()`. _This is not CSP compliant, but is required if you
     * want to use dynamic imports in ServiceWorker_.
     * @default false
     */
    useEval?: boolean;
    /**
     * Function name to use instead of AMD’s `define`.
     * @default 'define'
     */
    amdFunctionName?: string;
    /**
     * A function that determines whether the loader code should be prepended to a
     * certain chunk. Should return true if the load is supposed to be prepended.
     */
    prependLoader?: (chunk: RenderedChunk, workerFiles: string[]) => boolean;
    /**
     * The scheme used when importing workers as a URL.
     * @default 'omt'
     */
    urlLoaderScheme?: string;
    /**
     * Silence the warning about ESM being badly supported in workers.
     * @default false
     */
    silenceESMWorkerWarning?: boolean;
}

/**
 * Use Rollup with workers and ES6 modules _today_.
 */
declare function OMT(opts?: OffMainThreadOptions): Plugin;

export = OMT;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: rollup

Credits

These definitions were written by Tiger Oakes.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/surma__rollup-plugin-off-main-thread

Weekly Downloads

4,530

Version

2.2.3

License

MIT

Unpacked Size

5.45 kB

Total Files

5

Last publish

Collaborators

  • types