salesforce / design-system-react

Salesforce Lightning Design System for React
https://design-system-react-site.herokuapp.com/
BSD 3-Clause "New" or "Revised" License
915 stars 416 forks source link

Settings Typings #3045

Closed fmaximus closed 2 years ago

fmaximus commented 2 years ago

Typings of @salesforce/design-system-react/components/settings are incorrect.

import Settings from "@salesforce/design-system-react/components/settings"

const App = () => {
    Settings.setAppElement("#root");
}

gives an error: TS2693: 'Settings' only refers to a type, but is being used as a value here.

Working typings:

declare module "@salesforce/design-system-react/components/settings" {
    type Props = {
        setAssetsPath: (arg0: string) => void;
        getAssetsPath: () => string;
        setAppElement: (arg0: string) => void;
        getAppElement: () => string;
    };
    const settings: Props;
    export default settings;
}
welcome[bot] commented 2 years ago

Thanks for opening your first issue! :wave: If you have found this library helpful, please star it. A maintainer will try to respond within 7 days. If you haven’t heard anything by then, please bump this thread.