package.dist.tests.MockedD3.d.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mermaid Show documentation
Show all versions of mermaid Show documentation
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
The newest version!
/**
* This is a mocked/stubbed version of the d3 Selection type. Each of the main functions are all
* mocked (via vi.fn()) so you can track if they have been called, etc.
*
* Note that node() returns a HTML Element with tag 'svg'. It is an empty element (no innerHTML, no children, etc).
* This potentially allows testing of mermaidAPI render().
*/
export declare class MockedD3 {
attribs: Map;
id: string | undefined;
_children: MockedD3[];
_containingHTMLdoc: Document;
constructor(givenId?: string);
/** Helpful utility during development/debugging. This is not a real d3 function */
listChildren(): string;
select: import("vitest").Mock;
selectAll: import("vitest").Mock;
append: import("vitest").Mock;
insert: (type: string, beforeSelector?: string, id?: string) => MockedD3;
attr(attrName: string): undefined | string;
attr(attrName: string, attrValue: string): MockedD3;
lower(attrValue?: string): this;
style(attrValue?: string): this;
text(attrValue?: string): this;
node: import("vitest").Mock;
nodes: import("vitest").Mock;
getBBox: () => {
x: string | number | undefined;
y: string | number | undefined;
width: string | number | undefined;
height: string | number | undefined;
};
insertBefore: import("vitest").Mock;
curveBasis: import("vitest").Mock;
curveBasisClosed: import("vitest").Mock;
curveBasisOpen: import("vitest").Mock;
curveLinear: import("vitest").Mock;
curveLinearClosed: import("vitest").Mock;
curveMonotoneX: import("vitest").Mock;
curveMonotoneY: import("vitest").Mock;
curveNatural: import("vitest").Mock;
curveStep: import("vitest").Mock;
curveStepAfter: import("vitest").Mock;
curveStepBefore: import("vitest").Mock;
}