fix(typings): export all prop types

This commit is contained in:
Jonas Dellinger
2022-06-05 15:07:47 +02:00
parent a3c1a7c7b7
commit 7f9dfc5910
8 changed files with 15 additions and 14 deletions

View File

@@ -2,7 +2,7 @@ import { FC } from 'react';
import { CommonUIModule } from '../webpack';
interface ButtonProps {
export interface ButtonProps {
className?: string;
noFocusRing?: boolean;
disabled?: boolean;

View File

@@ -2,7 +2,7 @@ import { FC } from 'react';
import { CommonUIModule } from '../webpack';
interface ButtonItemProps {
export interface ButtonItemProps {
label?: string;
description?: string;
layout?: 'below';

View File

@@ -11,7 +11,7 @@ export const showContextMenu: (children: ReactNode, parent?: EventTarget) => voi
}
});
interface MenuProps {
export interface MenuProps {
label: string;
onCancel?(): void;
cancelText?: string;
@@ -27,7 +27,7 @@ export const Menu: FC<MenuProps> = findModuleChild((m) => {
}
});
interface MenuItemProps {
export interface MenuItemProps {
onSelected?(): void;
}

View File

@@ -1,4 +1,5 @@
import { FC, ReactNode } from 'react';
import { findModuleChild } from '../webpack';
// TODO: there is another argument, figure out what it does
@@ -11,18 +12,18 @@ export const showModal: (children: ReactNode, parent?: EventTarget) => void = fi
}
});
interface ModalRootProps {
onMiddleButton?(): void,
export interface ModalRootProps {
onMiddleButton?(): void;
onCancel?(): void;
onOK?(): void;
bAllowFullSize?: boolean;
}
export const ModalRoot = findModuleChild(m => {
if (typeof m !== "object") return undefined;
export const ModalRoot = findModuleChild((m) => {
if (typeof m !== 'object') return undefined;
for (let prop in m) {
if (!m[prop]?.prototype?.OK && m[prop]?.prototype?.Cancel && m[prop]?.prototype?.render) {
return m[prop];
}
}
}) as FC<ModalRootProps>;
}) as FC<ModalRootProps>;

View File

@@ -2,7 +2,7 @@ import { FC } from 'react';
import { findModuleChild } from '../webpack';
interface PanelSectionProps {
export interface PanelSectionProps {
title?: string;
spinner?: boolean;
}

View File

@@ -17,7 +17,7 @@ export enum QuickAccessTab {
Decky,
}
interface Router {
export interface Router {
CloseSideMenus(): void;
OpenQuickAccessMenu(quickAccessTab: QuickAccessTab): void;
GetQuickAccessTab(): QuickAccessTab;

View File

@@ -2,13 +2,13 @@ import { FC } from 'react';
import { CommonUIModule } from '../webpack';
interface NotchLabel {
export interface NotchLabel {
notchIndex: number;
label: string;
value: number;
}
interface SliderProps {
export interface SliderProps {
label?: string;
value: number;
layout?: 'below';

View File

@@ -2,7 +2,7 @@ import { FC } from 'react';
import { CommonUIModule } from '../webpack';
interface ToggleProps {
export interface ToggleProps {
label?: string;
description?: string;
checked: boolean;