UNPKG

rollup-plugin-chrome-extension

Version:

Build Chrome Extensions with this Rollup plugin.

18 lines (17 loc) 1.01 kB
import cheerio from 'cheerio'; import { HtmlInputsOptions } from '../plugin-options'; export type HtmlFilePathData = { filePath: string; rootPath: string; }; /** Cheerio.Root objects with a file path */ export type CheerioFile = cheerio.Root & HtmlFilePathData; export declare const loadHtml: (rootPath: string) => (filePath: string) => CheerioFile; export declare const getRelativePath: ({ filePath, rootPath }: HtmlFilePathData) => (p: string) => string; export declare const getScriptElems: ($: cheerio.Root) => cheerio.Cheerio; export declare const mutateScriptElems: ({ browserPolyfill }: Pick<HtmlInputsOptions, 'browserPolyfill'>) => ($: CheerioFile) => CheerioFile; export declare const getScripts: ($: cheerio.Root) => cheerio.Element[]; export declare const getScriptSrc: ($: CheerioFile) => string[]; export declare const getJsAssets: ($: CheerioFile) => string[]; export declare const getCssHrefs: ($: CheerioFile) => string[]; export declare const getImgSrcs: ($: CheerioFile) => string[];