From bc53c787acc21553baa1de1f6c8794cfde615cd8 Mon Sep 17 00:00:00 2001 From: typhonrt Date: Mon, 6 May 2024 17:01:19 -0700 Subject: [PATCH] Filter out SvelteComponent comments and types. --- src/generate/processDTS.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/generate/processDTS.js b/src/generate/processDTS.js index fc483f4a..77cc6988 100644 --- a/src/generate/processDTS.js +++ b/src/generate/processDTS.js @@ -171,7 +171,12 @@ function processPackageStandard() */ function processPackageSvelte() { - const svelteTypes = fs.readFileSync('./node_modules/svelte/types/index.d.ts', 'utf-8'); + let svelteTypes = fs.readFileSync('./node_modules/svelte/types/index.d.ts', 'utf-8'); + + svelteTypes = svelteTypes.replaceAll('### PRIVATE API', '@internal'); + svelteTypes = svelteTypes.replaceAll('### DO NOT USE!', '@internal'); + svelteTypes = svelteTypes.replaceAll('$capture_state(): void;', ''); + svelteTypes = svelteTypes.replaceAll('$inject_state(): void;', ''); // const regex = /declare module '([^']*)' \{([^}]*)}/gs; const regex = /declare module '([^']*)' \{((?:[^d]|d(?!eclare module))+)}/gs;