Skip to content

Commit cd023ec

Browse files
committed
xo: Fix @typescript-eslint/consistent-type-definitions.
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 1aa4ade commit cd023ec

23 files changed

+54
-54
lines changed

app/common/dnd-util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export type DndSettings = {
1313

1414
type SettingName = keyof DndSettings;
1515

16-
interface Toggle {
16+
type Toggle = {
1717
dnd: boolean;
1818
newSettings: Partial<DndSettings>;
19-
}
19+
};
2020

2121
export function toggle(): Toggle {
2222
const dnd = !ConfigUtil.getConfigItem("dnd", false);

app/common/logger-util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import process from "node:process";
66
import {initSetUp} from "./default-util";
77
import {app} from "./remote";
88

9-
interface LoggerOptions {
9+
type LoggerOptions = {
1010
file?: string;
11-
}
11+
};
1212

1313
initSetUp();
1414

app/common/messages.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
interface DialogBoxError {
1+
type DialogBoxError = {
22
title: string;
33
content: string;
4-
}
4+
};
55

66
export function invalidZulipServerError(domain: string): string {
77
return `${domain} does not appear to be a valid Zulip server. Make sure that

app/common/typed-ipc.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type {DndSettings} from "./dnd-util";
22
import type {MenuProps, ServerConf} from "./types";
33

4-
export interface MainMessage {
4+
export type MainMessage = {
55
"clear-app-settings": () => void;
66
"configure-spell-checker": () => void;
77
"fetch-user-agent": () => string;
@@ -22,15 +22,15 @@ export interface MainMessage {
2222
"update-badge": (messageCount: number) => void;
2323
"update-menu": (props: MenuProps) => void;
2424
"update-taskbar-icon": (data: string, text: string) => void;
25-
}
25+
};
2626

27-
export interface MainCall {
27+
export type MainCall = {
2828
"get-server-settings": (domain: string) => ServerConf;
2929
"is-online": (url: string) => boolean;
3030
"save-server-icon": (iconURL: string) => string;
31-
}
31+
};
3232

33-
export interface RendererMessage {
33+
export type RendererMessage = {
3434
back: () => void;
3535
"copy-zulip-url": () => void;
3636
destroytray: () => void;
@@ -79,4 +79,4 @@ export interface RendererMessage {
7979
zoomActualSize: () => void;
8080
zoomIn: () => void;
8181
zoomOut: () => void;
82-
}
82+
};

app/common/types.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export interface MenuProps {
1+
export type MenuProps = {
22
tabs: TabData[];
33
activeTabIndex?: number;
44
enableMenu?: boolean;
5-
}
5+
};
66

77
export type NavItem =
88
| "General"
@@ -11,16 +11,16 @@ export type NavItem =
1111
| "Organizations"
1212
| "Shortcuts";
1313

14-
export interface ServerConf {
14+
export type ServerConf = {
1515
url: string;
1616
alias: string;
1717
icon: string;
18-
}
18+
};
1919

2020
export type TabRole = "server" | "function";
2121

22-
export interface TabData {
22+
export type TabData = {
2323
role: TabRole;
2424
name: string;
2525
index: number;
26-
}
26+
};

app/renderer/js/clipboard-decrypter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ import crypto from "node:crypto";
1616
// don’t leak anything from the user’s clipboard other than the token
1717
// intended for us.
1818

19-
export interface ClipboardDecrypter {
19+
export type ClipboardDecrypter = {
2020
version: number;
2121
key: Uint8Array;
2222
pasted: Promise<string>;
23-
}
23+
};
2424

2525
export class ClipboardDecrypterImpl implements ClipboardDecrypter {
2626
version: number;

app/renderer/js/components/functional-tab.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import {generateNodeFromHtml} from "./base";
55
import type {TabProps} from "./tab";
66
import Tab from "./tab";
77

8-
export interface FunctionalTabProps extends TabProps {
8+
export type FunctionalTabProps = {
99
$view: Element;
10-
}
10+
} & TabProps;
1111

1212
export default class FunctionalTab extends Tab {
1313
$view: Element;

app/renderer/js/components/server-tab.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import type {TabProps} from "./tab";
99
import Tab from "./tab";
1010
import type WebView from "./webview";
1111

12-
export interface ServerTabProps extends TabProps {
12+
export type ServerTabProps = {
1313
webview: Promise<WebView>;
14-
}
14+
} & TabProps;
1515

1616
export default class ServerTab extends Tab {
1717
webview: Promise<WebView>;

app/renderer/js/components/tab.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type {TabRole} from "../../../common/types";
22

3-
export interface TabProps {
3+
export type TabProps = {
44
role: TabRole;
55
icon?: string;
66
name: string;
@@ -12,7 +12,7 @@ export interface TabProps {
1212
onHoverOut?: () => void;
1313
materialIcon?: string;
1414
onDestroy?: () => void;
15-
}
15+
};
1616

1717
export default abstract class Tab {
1818
abstract $el: Element;

app/renderer/js/components/webview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {contextMenu} from "./context-menu";
1919

2020
const shouldSilentWebview = ConfigUtil.getConfigItem("silent", false);
2121

22-
interface WebViewProps {
22+
type WebViewProps = {
2323
$root: Element;
2424
rootWebContents: WebContents;
2525
index: number;
@@ -32,7 +32,7 @@ interface WebViewProps {
3232
preload?: string;
3333
onTitleChange: () => void;
3434
hasPermission?: (origin: string, permission: string) => boolean;
35-
}
35+
};
3636

3737
export default class WebView {
3838
static templateHtml(props: WebViewProps): Html {

0 commit comments

Comments
 (0)