Skip to content

Commit 58ca761

Browse files
committed
fix formating
1 parent 19317e6 commit 58ca761

1 file changed

Lines changed: 19 additions & 41 deletions

File tree

types/snapdom.d.ts

Lines changed: 19 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export type BlobType = "svg" | RasterMime;
1313
export type IconFontMatcher = string | RegExp;
1414
export type CachePolicy = "disabled" | "full" | "auto" | "soft";
1515

16-
export type ExcludeMode = "hide" | "remove";
17-
export type FilterMode = "hide" | "remove";
16+
export type ExcludeMode = 'hide' | 'remove';
17+
export type FilterMode = 'hide' | 'remove';
1818

1919
export interface LocalFontDescriptor {
2020
/** CSS font-family name (e.g. "Inter"). */
@@ -143,12 +143,14 @@ export interface CaptureOptions {
143143
*/
144144
fallbackURL?:
145145
| string
146-
| ((args: {
147-
width?: number;
148-
height?: number;
149-
src?: string;
150-
element: HTMLImageElement;
151-
}) => string | Promise<string>);
146+
| ((
147+
args: {
148+
width?: number;
149+
height?: number;
150+
src?: string;
151+
element: HTMLImageElement;
152+
}
153+
) => string | Promise<string>);
152154

153155
/**
154156
* Cache policy applied at capture start.
@@ -174,7 +176,7 @@ export interface BlobOptions {
174176

175177
export interface DownloadOptions {
176178
/** File format. Default: "png". */
177-
format?: BlobType;
179+
format?: "svg" | RasterMime;
178180
/** Base filename without extension. Default: "snapDOM". */
179181
filename?: string;
180182
/** Background override for lossy formats. */
@@ -207,40 +209,16 @@ export interface CaptureResult {
207209
/**
208210
* Capture an element and return reusable export helpers.
209211
*/
210-
export declare function snapdom(
211-
el: Element,
212-
options?: CaptureOptions
213-
): Promise<CaptureResult>;
212+
export declare function snapdom(el: Element, options?: CaptureOptions): Promise<CaptureResult>;
214213

215214
export declare namespace snapdom {
216-
function toImg(
217-
el: Element,
218-
options?: CaptureOptions
219-
): Promise<HTMLImageElement>;
220-
function toCanvas(
221-
el: Element,
222-
options?: CaptureOptions
223-
): Promise<HTMLCanvasElement>;
224-
function toBlob(
225-
el: Element,
226-
options?: CaptureOptions & BlobOptions
227-
): Promise<Blob>;
228-
function toPng(
229-
el: Element,
230-
options?: CaptureOptions
231-
): Promise<HTMLImageElement>;
232-
function toJpg(
233-
el: Element,
234-
options?: CaptureOptions
235-
): Promise<HTMLImageElement>;
236-
function toWebp(
237-
el: Element,
238-
options?: CaptureOptions
239-
): Promise<HTMLImageElement>;
240-
function download(
241-
el: Element,
242-
options?: CaptureOptions & DownloadOptions
243-
): Promise<void>;
215+
function toImg(el: Element, options?: CaptureOptions): Promise<HTMLImageElement>;
216+
function toCanvas(el: Element, options?: CaptureOptions): Promise<HTMLCanvasElement>;
217+
function toBlob(el: Element, options?: CaptureOptions & BlobOptions): Promise<Blob>;
218+
function toPng(el: Element, options?: CaptureOptions): Promise<HTMLImageElement>;
219+
function toJpg(el: Element, options?: CaptureOptions): Promise<HTMLImageElement>;
220+
function toWebp(el: Element, options?: CaptureOptions): Promise<HTMLImageElement>;
221+
function download(el: Element, options?: CaptureOptions & DownloadOptions): Promise<void>;
244222
}
245223

246224
/**

0 commit comments

Comments
 (0)