Skip to content

Commit

Permalink
fix(typings): export all prop types
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyCrazy committed Jun 5, 2022
1 parent a3c1a7c commit 7f9dfc5
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/deck-components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FC } from 'react';

import { CommonUIModule } from '../webpack';

interface ButtonProps {
export interface ButtonProps {
className?: string;
noFocusRing?: boolean;
disabled?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/deck-components/ButtonItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FC } from 'react';

import { CommonUIModule } from '../webpack';

interface ButtonItemProps {
export interface ButtonItemProps {
label?: string;
description?: string;
layout?: 'below';
Expand Down
4 changes: 2 additions & 2 deletions src/deck-components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const showContextMenu: (children: ReactNode, parent?: EventTarget) => voi
}
});

interface MenuProps {
export interface MenuProps {
label: string;
onCancel?(): void;
cancelText?: string;
Expand All @@ -27,7 +27,7 @@ export const Menu: FC<MenuProps> = findModuleChild((m) => {
}
});

interface MenuItemProps {
export interface MenuItemProps {
onSelected?(): void;
}

Expand Down
11 changes: 6 additions & 5 deletions src/deck-components/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FC, ReactNode } from 'react';

import { findModuleChild } from '../webpack';

// TODO: there is another argument, figure out what it does
Expand All @@ -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>;
2 changes: 1 addition & 1 deletion src/deck-components/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FC } from 'react';

import { findModuleChild } from '../webpack';

interface PanelSectionProps {
export interface PanelSectionProps {
title?: string;
spinner?: boolean;
}
Expand Down
2 changes: 1 addition & 1 deletion src/deck-components/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export enum QuickAccessTab {
Decky,
}

interface Router {
export interface Router {
CloseSideMenus(): void;
OpenQuickAccessMenu(quickAccessTab: QuickAccessTab): void;
GetQuickAccessTab(): QuickAccessTab;
Expand Down
4 changes: 2 additions & 2 deletions src/deck-components/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/deck-components/Toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FC } from 'react';

import { CommonUIModule } from '../webpack';

interface ToggleProps {
export interface ToggleProps {
label?: string;
description?: string;
checked: boolean;
Expand Down

0 comments on commit 7f9dfc5

Please sign in to comment.