Skip to content

Commit 28d4b1f

Browse files
committed
Ambient declarations
1 parent dc3f2c4 commit 28d4b1f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
3232
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
3333
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34-
"typeRoots": ["./types/*"], /* Specify multiple folders that act like './node_modules/@types'. */
34+
// "typeRoots": ["./types/*"], /* Specify multiple folders that act like './node_modules/@types'. */
3535
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
3636
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
3737
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
@@ -99,5 +99,6 @@
9999
/* Completeness */
100100
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
101101
"skipLibCheck": true /* Skip type checking all .d.ts files. */
102-
}
102+
},
103+
"include": ["src", "lib", "utils", "types"],
103104
}

types/types.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// types.d.ts
2-
declare module '../lib/svgdom-wrapper.mjs' {
1+
// types/types.d.ts
2+
declare module 'svgdom-wrapper' {
33
import type { Window } from 'svgdom';
44
export function makeWindow(): Window;
55
}
66

7-
declare module '../lib/nanoid-wrapper.mjs' {
7+
declare module 'nanoid-wrapper' {
88
export function generateId(): string;
9-
}
9+
}

utils/thumbnails.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ export const handler: Handler = async (event: any, context?: any) => {
297297
["dark", contextDark],
298298
]);
299299
// Dynamically import the ESM wrapper
300-
const { makeWindow } = await import('../lib/svgdom-wrapper.mjs');
300+
const { makeWindow } = await import('svgdom-wrapper');
301301
// Example: generate an ID using nanoid wrapper
302-
const { generateId } = await import('../lib/nanoid-wrapper.mjs');
302+
const { generateId } = await import('nanoid-wrapper');
303303
const window = makeWindow();
304304
const document = window.document;
305305

0 commit comments

Comments
 (0)