SteamDeckHomebrew / decky-frontend-lib

The support library for creating plugins for decky
https://deckbrew.xyz
GNU Lesser General Public License v2.1
67 stars 33 forks source link

PanelSection + PanelSectionRow needs proper typescript definition #69

Closed devnoot closed 1 year ago

devnoot commented 1 year ago

Hi all, first of all thanks for putting together such an awesome library!

I believe that some of the Typescript definitions in the library are wrong or incomplete. In the following snippet, TypeScript will yell at you because the definition for PanelSection doesn't include a children prop.

This is from decky-frontend-lib@3.18.4:

export interface PanelSectionProps {
    title?: string;
    spinner?: boolean;
}
export declare const PanelSection: FC<PanelSectionProps>;
export declare const PanelSectionRow: FC<>;

I have the following setup for my src/index.tsx file.

import { FC } from 'react'
import { definePlugin, ServerAPI, PanelSection, PanelSectionRow } from 'decky-frontend-lib'

// Create Content component Interface
interface ContentProps {
    api: ServerAPI
}

// Create the Content component
const Content: FC<ContentProps> = ({ api }: ContentProps) => {
    return (
        <PanelSection>
            <PanelSectionRow>
                <div>Some content</div>
            </PanelSectionRow>
        </PanelSection>
    )
}

The typescript error is

Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & PanelSectionProps'.

Are you accepting PRs for these issues?