Files

93 lines
1.7 KiB
TypeScript
Raw Permalink Normal View History

2025-01-04 21:06:02 -07:00
import type {
ConfigProperties,
ConfigPropertyValue,
ProjectConfig,
Unit,
} from './config';
2025-03-02 22:55:54 -07:00
export type WebviewProps = {
extensionVersion: string;
resourceRoot: string;
};
export type BuildStatus = {
success: boolean;
cmdline: string;
stdout: string;
stderr: string;
};
export type StateMessage = {
type: 'state';
2025-01-04 21:06:02 -07:00
buildRunning?: boolean;
configProperties?: ConfigProperties;
currentUnit?: Unit | null;
2025-03-02 22:55:54 -07:00
leftStatus?: BuildStatus | null;
rightStatus?: BuildStatus | null;
leftObject?: ArrayBuffer | null;
rightObject?: ArrayBuffer | null;
2025-01-04 21:06:02 -07:00
projectConfig?: ProjectConfig | null;
2025-05-27 22:15:56 -06:00
diffLabel?: string | null;
};
// decomp.me colors
export type Colors = {
background: string;
};
// decomp.me theme
export type ThemeMessage = {
type: 'theme';
isDark: boolean;
colors: Colors;
codeFont?: string;
codeFontSize?: number;
fontLigatures?: boolean;
};
// extension -> webview
export type InboundMessage = StateMessage | ThemeMessage;
export type ReadyMessage = {
type: 'ready';
};
export type LineRangesMessage = {
type: 'lineRanges';
data: Array<{ start: number; end: number }>;
};
export type RunTaskMessage = {
type: 'runTask';
taskType: string;
};
2024-12-19 10:45:17 -07:00
export type SetCurrentUnitMessage = {
type: 'setCurrentUnit';
unit: Unit | 'source' | null;
};
export type QuickPickUnitMessage = {
type: 'quickPickUnit';
};
2025-01-04 21:06:02 -07:00
export type SetConfigPropertyMessage = {
type: 'setConfigProperty';
id: string;
value: ConfigPropertyValue | undefined;
};
export type OpenSettingsMessage = {
type: 'openSettings';
};
// webview -> extension
2024-12-19 10:45:17 -07:00
export type OutboundMessage =
| LineRangesMessage
2025-01-04 21:06:02 -07:00
| OpenSettingsMessage
| QuickPickUnitMessage
| ReadyMessage
2024-12-19 10:45:17 -07:00
| RunTaskMessage
2025-01-04 21:06:02 -07:00
| SetConfigPropertyMessage
| SetCurrentUnitMessage;