Skip to content

TS/JS docs get lost when using $$restProps #1377

@mrtnbroder

Description

@mrtnbroder

Describe the bug
When using {...$$restProps}, type infos are getting lost when running svelte-kit package

To Reproduce
repro to clone: https://github.com/mrtnbroder/svelte-lost-types

Expected behavior
Using $$restProps shouldn't mess up the types produced

When using $$restProps

import { SvelteComponentTyped } from "svelte";
declare const __propDef: {
    props: {
        [x: string]: any;
        class?: string | null;
        disabled?: boolean | null;
    };
    events: {
        [evt: string]: CustomEvent<any>;
    };
    slots: {
        default: {};
    };
};
export declare type ButtonProps = typeof __propDef.props;
export declare type ButtonEvents = typeof __propDef.events;
export declare type ButtonSlots = typeof __propDef.slots;
export default class Button extends SvelteComponentTyped<ButtonProps, ButtonEvents, ButtonSlots> {
}
export {};

vs

not using $$restProps

import { SvelteComponentTyped } from "svelte";
declare const __propDef: {
    props: {
        /** CSS class for the element. */ class?: string | null;
        /** Whether the button is disabled. */ disabled?: boolean | null;
    };
    events: {
        [evt: string]: CustomEvent<any>;
    };
    slots: {
        default: {};
    };
};
export declare type ButtonProps = typeof __propDef.props;
export declare type ButtonEvents = typeof __propDef.events;
export declare type ButtonSlots = typeof __propDef.slots;
export default class Button extends SvelteComponentTyped<ButtonProps, ButtonEvents, ButtonSlots> {
}
export {};

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions