main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[79a0317] | 1 | import { DOMParser } from './types';
|
---|
| 2 | /**
|
---|
| 3 | * `node-canvas` exports.
|
---|
| 4 | */
|
---|
| 5 | interface ICanvas {
|
---|
| 6 | createCanvas(width: number, height: number): any;
|
---|
| 7 | loadImage(src: string): Promise<any>;
|
---|
| 8 | }
|
---|
| 9 | /**
|
---|
| 10 | * WHATWG-compatible `fetch` function.
|
---|
| 11 | */
|
---|
| 12 | declare type Fetch = (input: any, config?: any) => Promise<any>;
|
---|
| 13 | interface IConfig {
|
---|
| 14 | /**
|
---|
| 15 | * XML/HTML parser from string into DOM Document.
|
---|
| 16 | */
|
---|
| 17 | DOMParser: DOMParser;
|
---|
| 18 | /**
|
---|
| 19 | * `node-canvas` exports.
|
---|
| 20 | */
|
---|
| 21 | canvas: ICanvas;
|
---|
| 22 | /**
|
---|
| 23 | * WHATWG-compatible `fetch` function.
|
---|
| 24 | */
|
---|
| 25 | fetch: Fetch;
|
---|
| 26 | }
|
---|
| 27 | /**
|
---|
| 28 | * Options preset for `node-canvas`.
|
---|
| 29 | * @param config - Preset requirements.
|
---|
| 30 | * @param config.DOMParser - XML/HTML parser from string into DOM Document.
|
---|
| 31 | * @param config.canvas - `node-canvas` exports.
|
---|
| 32 | * @param config.fetch - WHATWG-compatible `fetch` function.
|
---|
| 33 | * @returns Preset object.
|
---|
| 34 | */
|
---|
| 35 | export declare function node({ DOMParser, canvas, fetch }: IConfig): {
|
---|
| 36 | window: null;
|
---|
| 37 | ignoreAnimation: boolean;
|
---|
| 38 | ignoreMouse: boolean;
|
---|
| 39 | DOMParser: DOMParser;
|
---|
| 40 | fetch: Fetch;
|
---|
| 41 | createCanvas: (width: number, height: number) => any;
|
---|
| 42 | createImage: (src: string) => Promise<any>;
|
---|
| 43 | };
|
---|
| 44 | export {};
|
---|
| 45 | //# sourceMappingURL=node.d.ts.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.