chore: Update RunOptions docs

Co-authored-by: Alois Klink <alois@aloisklink.com>
This commit is contained in:
Sidharth Vinod 2023-02-20 13:10:54 +05:30
parent 40b5f868de
commit 38b2cbc3d1
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD

View File

@ -23,19 +23,22 @@ export type {
ParseOptions,
};
/**
* The options used when running mermaid.
*
* @param querySelector - The query selector to use when finding elements to render. Default: .mermaid
* @param nodes - The nodes to render. If this is set, querySelector will be ignored.
* @param postRenderCallback - A callback to call after each diagram is rendered.
* @param suppressErrors - If true, errors will be logged to the console, but not thrown. Default: false
*/
export interface RunOptions {
// Default: .mermaid
/**
* The query selector to use when finding elements to render. Default: `".mermaid"`.
*/
querySelector?: string;
/**
* The nodes to render. If this is set, `querySelector` will be ignored.
*/
nodes?: ArrayLike<HTMLElement>;
/**
* A callback to call after each diagram is rendered.
*/
postRenderCallback?: (id: string) => unknown;
/**
* If `true`, errors will be logged to the console, but not thrown. Default: `false`
*/
suppressErrors?: boolean;
}