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