diff --git a/packages/svelte2tsx/index.d.ts b/packages/svelte2tsx/index.d.ts index 13b1b46ed..2a835e54d 100644 --- a/packages/svelte2tsx/index.d.ts +++ b/packages/svelte2tsx/index.d.ts @@ -3,11 +3,24 @@ export interface SvelteCompiledToTsx { map: import("magic-string").SourceMap; exportedNames: IExportedNames; events: ComponentEvents; + componentDocumentation: string; + slots: Map>; + generics: { + definitions: string[]; + references: string[]; + }; } -export interface IExportedNames { - has(name: string): boolean; -} +export type IExportedNames = Map< + string, + { + isLet: boolean; + type?: string; + identifierText?: string; + required?: boolean; + doc?: string; + } +>; export interface ComponentEvents { getAll(): { name: string; type: string; doc?: string }[]; diff --git a/packages/svelte2tsx/src/svelte2tsx/index.ts b/packages/svelte2tsx/src/svelte2tsx/index.ts index 923c49a31..6e6992770 100644 --- a/packages/svelte2tsx/src/svelte2tsx/index.ts +++ b/packages/svelte2tsx/src/svelte2tsx/index.ts @@ -451,7 +451,13 @@ declare function __sveltets_1_createSvelteComponentTyped( code: str.toString(), map: str.generateMap({ hires: true, source: options?.filename }), exportedNames: exportedNames.getExportsMap(), - events: events.createAPI() + events: events.createAPI(), + componentDocumentation: componentDocumentation.getFormatted(), + slots, + generics: { + definition: generics.toDefinitionString(), + references: generics.toReferencesString() + } }; } }