From 931c10b2e8a44e538a32e34691740ae33f558529 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Thu, 28 Jan 2021 13:21:12 +0100 Subject: [PATCH] More forgiving SvelteComponentDev typings Add `$$events_def` and `$$slot_def` so that users can do ``` let el: SvelteComponent; ``` Without type errors. Without this change, TS complains that `$$events_def` and `$$slot_def` is missing from `SvelteComponentDev` and therefore cannot be assigned to it. --- src/runtime/internal/dev.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/runtime/internal/dev.ts b/src/runtime/internal/dev.ts index 53f6ef3bf1..99ff067474 100644 --- a/src/runtime/internal/dev.ts +++ b/src/runtime/internal/dev.ts @@ -115,6 +115,20 @@ export class SvelteComponentDev extends SvelteComponent { * ### DO NOT USE! */ $$prop_def: Props; + /** + * @private + * For type checking capabilities only. + * Does not exist at runtime. + * ### DO NOT USE! + */ + $$events_def: any; + /** + * @private + * For type checking capabilities only. + * Does not exist at runtime. + * ### DO NOT USE! + */ + $$slot_def: any; constructor(options: { target: Element;