state sync
This commit is contained in:
34
app/basepak/static/js/mermaid/tests/util.d.ts
vendored
Normal file
34
app/basepak/static/js/mermaid/tests/util.d.ts
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import { type Selection } from 'd3';
|
||||
export declare const convert: (template: TemplateStringsArray, ...params: unknown[]) => {
|
||||
[k: string]: unknown;
|
||||
}[];
|
||||
export declare const MOCKED_BBOX: {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
interface JsdomItInput {
|
||||
body: Selection<HTMLBodyElement, never, HTMLElement, any>;
|
||||
svg: Selection<SVGSVGElement, never, HTMLElement, any>;
|
||||
}
|
||||
/**
|
||||
* Test method borrowed from d3 : https://github.com/d3/d3-selection/blob/v3.0.0/test/jsdom.js
|
||||
*
|
||||
* Fools d3 into thinking it's working in a browser with a real DOM.
|
||||
*
|
||||
* The DOM is actually an instance of JSDom with monkey-patches for DOM methods that require a
|
||||
* rendering engine.
|
||||
*
|
||||
* The resulting environment is capable of rendering SVGs with the caveat that layouts are
|
||||
* completely screwed.
|
||||
*
|
||||
* This makes it possible to make structural tests instead of mocking everything.
|
||||
*/
|
||||
export declare function jsdomIt(message: string, run: (input: JsdomItInput) => void | Promise<void>): void;
|
||||
/**
|
||||
* Retrieves the node from its parent with ParentNode#querySelector,
|
||||
* then checks that it exists before returning it.
|
||||
*/
|
||||
export declare function ensureNodeFromSelector(selector: string, parent?: ParentNode): Element;
|
||||
export {};
|
||||
Reference in New Issue
Block a user