Fix TypeScript signatures

This commit is contained in:
stereobooster 2025-03-22 02:56:18 +01:00
parent 54d751bc87
commit fe22eddc64
No known key found for this signature in database
3 changed files with 11 additions and 3 deletions

View file

@ -3,6 +3,10 @@
All notable changes to only the d2.js package will be documented in this file. **Does not
include changes to the main d2 project.**
## Next
- Fix TypeScript signatures
## [0.1.22]
### March 20, 2025

2
d2js/js/index.d.ts vendored
View file

@ -47,7 +47,7 @@ export interface CompileRequest {
/** A mapping of D2 file paths to their content*/
fs: Record<string, string>;
/** The path of the entry D2 file [default: index]*/
inputPath: string;
inputPath?: string;
/** The CompileOptions to pass to the compiler*/
options: CompileOptions;
}

View file

@ -23,9 +23,13 @@
"browser": "./dist/browser/index.js",
"import": {
"browser": "./dist/browser/index.js",
"default": "./dist/node-esm/index.js"
"default": "./dist/node-esm/index.js",
"types": "./index.d.ts"
},
"require": {
"default": "./dist/node-cjs/index.js",
"types": "./index.d.ts"
},
"require": "./dist/node-cjs/index.js",
"default": "./dist/node-esm/index.js"
},
"./worker": "./dist/browser/worker.js"