2025-01-04 21:06:02 -07:00
|
|
|
import type {
|
|
|
|
|
ConfigProperties,
|
|
|
|
|
ConfigPropertyValue,
|
|
|
|
|
ProjectConfig,
|
|
|
|
|
Unit,
|
|
|
|
|
} from './config';
|
2024-12-17 21:49:23 -07:00
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
|
2024-12-17 21:49:23 -07:00
|
|
|
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;
|
2024-12-17 21:49:23 -07:00
|
|
|
};
|
|
|
|
|
|
2025-03-06 21:53:12 -07:00
|
|
|
// decomp.me colors
|
|
|
|
|
export type Colors = {
|
|
|
|
|
background: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// decomp.me theme
|
|
|
|
|
export type ThemeMessage = {
|
|
|
|
|
type: 'theme';
|
|
|
|
|
isDark: boolean;
|
|
|
|
|
colors: Colors;
|
|
|
|
|
codeFont?: string;
|
|
|
|
|
codeFontSize?: number;
|
2025-03-19 22:22:41 -06:00
|
|
|
fontLigatures?: boolean;
|
2025-03-06 21:53:12 -07:00
|
|
|
};
|
|
|
|
|
|
2024-12-17 21:49:23 -07:00
|
|
|
// extension -> webview
|
2025-03-06 21:53:12 -07:00
|
|
|
export type InboundMessage = StateMessage | ThemeMessage;
|
2024-12-17 21:49:23 -07:00
|
|
|
|
|
|
|
|
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';
|
|
|
|
|
};
|
|
|
|
|
|
2024-12-17 21:49:23 -07:00
|
|
|
// 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;
|