This commit is contained in:
jolo-dev 2025-02-23 18:53:25 +01:00
parent b5999e8c83
commit 3a2d32712a

View file

@ -93,11 +93,7 @@ declare module "@terrastruct/d2" {
readonly ready: Promise<void>;
worker: D2Worker;
currentResolve?: (
result:
| string
| RenderResult
| EncodedResult
| DecodedResult,
result: string | RenderResult | EncodedResult | DecodedResult
) => void;
currentReject?: (reason: Error) => void;
@ -120,20 +116,15 @@ declare module "@terrastruct/d2" {
*/
sendMessage(
type: string,
data: object,
): Promise<
CompileResult | RenderResult | EncodedResult | DecodedResult
>;
data: object
): Promise<CompileResult | RenderResult | EncodedResult | DecodedResult>;
/**
* Compiles the provided input.
* @param input A string representing the source or a CompileRequest.
* @param options Optional compilation options.
*/
compile(
input: string | CompileRequest,
options?: Options,
): Promise<string>;
compile(input: string | CompileRequest, options?: Options): Promise<string>;
/**
* Renders the given diagram.