take-shot
Version:
Screenshots with JavaScript
20 lines (19 loc) • 900 B
TypeScript
import { CloneOptions, WindowOptions } from './dom/document-cloner';
import { RenderOptions } from './render/canvas/canvas-renderer';
import { ContextOptions } from './core/context';
import { CSSRuleSelector, FilterFontFace } from './dom/extra/embed-webfonts';
import { LoadingProps } from './utils/loading';
type ImageTypes = 'image/png' | 'image/jpeg' | 'image/webp';
declare const imageMap: Record<string, ImageTypes>;
type ImageType = keyof typeof imageMap;
export type Options = CloneOptions & WindowOptions & RenderOptions & ContextOptions & {
backgroundColor: string | null;
filterFontFace?: FilterFontFace;
cssRuleSelector?: CSSRuleSelector;
type?: ImageType;
quality?: number;
imagePlaceholder?: string;
loading?: LoadingProps;
};
declare const takeShot: (element: HTMLElement, options?: Partial<Options>) => Promise<string | undefined>;
export default takeShot;