temp solution to formatted
This commit is contained in:
parent
7d4acc2468
commit
f26a596a78
2 changed files with 82 additions and 59 deletions
|
|
@ -3,15 +3,21 @@ use std::path::Path;
|
|||
use std::process::Command;
|
||||
|
||||
pub fn formatter(file: &Path) -> io::Result<()> {
|
||||
Command::new("pnpm")
|
||||
let result = Command::new("pnpm")
|
||||
.arg("eslint")
|
||||
.arg("--flag")
|
||||
.arg("unstable_ts_config")
|
||||
.arg("--fix")
|
||||
.arg(file)
|
||||
.output()
|
||||
.map(|_| ())
|
||||
.map_err(io::Error::other)
|
||||
.output();
|
||||
|
||||
match result {
|
||||
Ok(_) => Ok(()),
|
||||
Err(e) => {
|
||||
eprintln!("error running formatter on {}: {}", file.display(), e);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const _: specta_typescript::FormatterFn = formatter;
|
||||
|
|
|
|||
|
|
@ -1,114 +1,131 @@
|
|||
// This file has been generated by Specta. DO NOT EDIT.
|
||||
|
||||
import type { InferCommandOutput } from 'taurpc';
|
||||
import { createTauRPCProxy as createProxy } from 'taurpc';
|
||||
import { createTauRPCProxy as createProxy, type InferCommandOutput } from 'taurpc'
|
||||
type TAURI_CHANNEL<T> = (response: T) => void
|
||||
|
||||
type TAURI_CHANNEL<T> = (response: T) => void;
|
||||
|
||||
export type ClusterError = { InvalidVersion: string } | 'MissingJavaVersion' | 'ClusterDownloading' | 'ClusterAlreadyRunning';
|
||||
export type ClusterError = { InvalidVersion: string } | "MissingJavaVersion" | "ClusterDownloading" | "ClusterAlreadyRunning"
|
||||
|
||||
export type ClusterStage = 'notready' | 'downloading' | 'repairing' | 'ready';
|
||||
export type ClusterStage = "notready" | "downloading" | "repairing" | "ready"
|
||||
|
||||
export interface CreateCluster { name: string; mc_version: string; mc_loader: GameLoader; mc_loader_version: string | null; icon: Icon | null }
|
||||
export type CreateCluster = { name: string; mc_version: string; mc_loader: GameLoader; mc_loader_version: string | null; icon: Icon | null }
|
||||
|
||||
export type CryptoError = { InvalidHash: { algorithm: HashAlgorithm; expected: string; actual: string } } | 'InvalidAlgorithm';
|
||||
export type CryptoError = { InvalidHash: { algorithm: HashAlgorithm; expected: string; actual: string } } | "InvalidAlgorithm"
|
||||
|
||||
export type DaoError = 'NotFound' | 'AlreadyExists' | { InvalidValue: [string, string] };
|
||||
export type DaoError = "NotFound" | "AlreadyExists" | { InvalidValue: [string, string] }
|
||||
|
||||
export type DirectoryError = 'BaseDir';
|
||||
export type DirectoryError = "BaseDir"
|
||||
|
||||
export type DiscordError = 'MissingClientId' | 'ConnectError';
|
||||
export type DiscordError = "MissingClientId" | "ConnectError"
|
||||
|
||||
export type GameLoader = 'vanilla' | 'forge' | 'neoforge' | 'quilt' | 'fabric' | 'legacyfabric';
|
||||
export type GameLoader = "vanilla" | "forge" | "neoforge" | "quilt" | "fabric" | "legacyfabric"
|
||||
|
||||
export type HashAlgorithm = 'Sha1' | 'Sha256' | 'Md5';
|
||||
export type HashAlgorithm = "Sha1" | "Sha256" | "Md5"
|
||||
|
||||
/**
|
||||
* A wrapper around generic and unhelpful [`std::io::Error`] messages.
|
||||
*/
|
||||
export type IOError = { InvalidAbsolutePath: string } | { IOErrorWrapper: { path: string } } | 'IOError' | 'DeserializeError' | 'AsyncZipError';
|
||||
export type IOError = { InvalidAbsolutePath: string } | { IOErrorWrapper: { path: string } } | "IOError" | "DeserializeError" | "AsyncZipError"
|
||||
|
||||
export type Icon = string;
|
||||
export type Icon = string
|
||||
|
||||
export type IncompatiblePackageType = 'McVersion' | 'Loader';
|
||||
export type IncompatiblePackageType = "McVersion" | "Loader"
|
||||
|
||||
export type IngressError = 'NotFound';
|
||||
export type IngressError = "NotFound"
|
||||
|
||||
export interface IngressPayload { id: string; message: string; ingress_type: IngressType; percent: number | null; total: number }
|
||||
export type IngressPayload = { id: string; message: string; ingress_type: IngressType; percent: number | null; total: number }
|
||||
|
||||
export type IngressType = { Download: { file_name: string } } | 'JavaPrepare' | 'JavaCheck' | 'JavaLocate' | 'MinecraftDownload' | { PrepareCluster: { cluster_name: string } };
|
||||
export type IngressType = { Download: { file_name: string } } | "JavaPrepare" | "JavaCheck" | "JavaLocate" | "MinecraftDownload" | { PrepareCluster: { cluster_name: string } }
|
||||
|
||||
export type JavaError = { ParseVersion: [string] } | 'Execute' | 'MissingJava';
|
||||
export type JavaError = { ParseVersion: [string] } | "Execute" | "MissingJava"
|
||||
|
||||
export type LauncherError = { type: 'DirError'; data: DirectoryError } | { type: 'IOError'; data: IOError } | { type: 'IngressError'; data: IngressError } | { type: 'JavaError'; data: JavaError } | { type: 'CryptoError'; data: CryptoError } | { type: 'DiscordError'; data: DiscordError } | { type: 'MetadataError'; data: MetadataError } | { type: 'ClusterError'; data: ClusterError } | { type: 'MinecraftAuthError'; data: MinecraftAuthError } | { type: 'ProcessError'; data: ProcessError } | { type: 'PackageError'; data: PackageError } | { type: 'DaoError'; data: DaoError } | { type: 'SerdeError' } | { type: 'AnyhowError' } | { type: 'DbError' } | { type: 'ReqwestError' } | { type: 'InterpulseError' } | { type: 'RegexError' } | { type: 'SemaphoreError' } | { type: 'UrlError' } | { type: 'TauriError' };
|
||||
export type LauncherError = { type: "DirError"; data: DirectoryError } | { type: "IOError"; data: IOError } | { type: "IngressError"; data: IngressError } | { type: "JavaError"; data: JavaError } | { type: "CryptoError"; data: CryptoError } | { type: "DiscordError"; data: DiscordError } | { type: "MetadataError"; data: MetadataError } | { type: "ClusterError"; data: ClusterError } | { type: "MinecraftAuthError"; data: MinecraftAuthError } | { type: "ProcessError"; data: ProcessError } | { type: "PackageError"; data: PackageError } | { type: "DaoError"; data: DaoError } | { type: "SerdeError" } | { type: "AnyhowError" } | { type: "DbError" } | { type: "ReqwestError" } | { type: "InterpulseError" } | { type: "RegexError" } | { type: "SemaphoreError" } | { type: "UrlError" } | { type: "TauriError" }
|
||||
|
||||
export type LauncherEvent = { Ingress: IngressPayload } | { Message: MessagePayload } | { Process: ProcessPayload };
|
||||
export type LauncherEvent = { Ingress: IngressPayload } | { Message: MessagePayload } | { Process: ProcessPayload }
|
||||
|
||||
export type MessageLevel = 'Info' | 'Warn' | 'Error';
|
||||
export type MessageLevel = "Info" | "Warn" | "Error"
|
||||
|
||||
export interface MessagePayload { level: MessageLevel; message: string }
|
||||
export type MessagePayload = { level: MessageLevel; message: string }
|
||||
|
||||
export type MetadataError = 'FetchError' | { NotModdedManifest: GameLoader } | { NotVanillaManifest: GameLoader } | 'ParseError' | 'NoMatchingLoader' | 'NoMatchingVersion';
|
||||
export type MetadataError = "FetchError" | { NotModdedManifest: GameLoader } | { NotVanillaManifest: GameLoader } | "ParseError" | "NoMatchingLoader" | "NoMatchingVersion"
|
||||
|
||||
/**
|
||||
* Wrapper around all `Error`s that can occur during the Microsoft authentication process.
|
||||
*/
|
||||
export type MinecraftAuthError = 'PublicKeyReading' | 'PKCS8Error' | { SerializeError: { step: MinecraftAuthStep } } | { DeserializeError: { step: MinecraftAuthStep; raw: string } } | { RequestError: { step: MinecraftAuthStep } } | { SigningError: { step: MinecraftAuthStep } } | 'HashError' | 'SessionIdError';
|
||||
export type MinecraftAuthError = "PublicKeyReading" | "PKCS8Error" | { SerializeError: { step: MinecraftAuthStep } } | { DeserializeError: { step: MinecraftAuthStep; raw: string } } | { RequestError: { step: MinecraftAuthStep } } | { SigningError: { step: MinecraftAuthStep } } | "HashError" | "SessionIdError"
|
||||
|
||||
/**
|
||||
* An ordered list of all MSA authentication steps.
|
||||
*/
|
||||
export type MinecraftAuthStep = 'DeviceToken' | 'SisuAuthenicate' | 'OAuthToken' | 'RefreshOAuthToken' | 'SisuAuthorize' | 'XstsAuthorize' | 'MinecraftToken' | 'MinecraftEntitlements' | 'MinecraftProfile';
|
||||
export type MinecraftAuthStep = "DeviceToken" | "SisuAuthenicate" | "OAuthToken" | "RefreshOAuthToken" | "SisuAuthorize" | "XstsAuthorize" | "MinecraftToken" | "MinecraftEntitlements" | "MinecraftProfile"
|
||||
|
||||
/**
|
||||
* A structure of all needed Minecraft credentials for logging in and account management.
|
||||
*/
|
||||
export interface MinecraftCredentials {
|
||||
export type MinecraftCredentials = {
|
||||
/**
|
||||
* The uuid of the credentials.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The username of the Minecraft account.
|
||||
*/
|
||||
username: string;
|
||||
/**
|
||||
* The access token as a String.
|
||||
*/
|
||||
access_token: string;
|
||||
/**
|
||||
* The refresh token as a string for [`MinecraftState#refresh`].
|
||||
*/
|
||||
refresh_token: string;
|
||||
/**
|
||||
* The time that the access token expires as a [`DateTime<Utc>`].
|
||||
*/
|
||||
expires: string;
|
||||
id: string;
|
||||
/**
|
||||
* The username of the Minecraft account.
|
||||
*/
|
||||
username: string;
|
||||
/**
|
||||
* The access token as a String.
|
||||
*/
|
||||
access_token: string;
|
||||
/**
|
||||
* The refresh token as a string for [`MinecraftState#refresh`].
|
||||
*/
|
||||
refresh_token: string;
|
||||
/**
|
||||
* The time that the access token expires as a [`DateTime<Utc>`].
|
||||
*/
|
||||
expires: string }
|
||||
|
||||
}
|
||||
export type Model = { id: bigint; folder_name: string; stage: ClusterStage; created_at: string; group_id: bigint | null; name: string; mc_version: string; mc_loader: GameLoader; mc_loader_version: string | null; last_played: string | null; overall_played: bigint | null; icon_url: Icon | null; setting_profile_name: string | null; linked_pack_id: string | null; linked_pack_version: string | null }
|
||||
|
||||
export interface Model { id: bigint; folder_name: string; stage: ClusterStage; created_at: string; group_id: bigint | null; name: string; mc_version: string; mc_loader: GameLoader; mc_loader_version: string | null; last_played: string | null; overall_played: bigint | null; icon_url: Icon | null; setting_profile_name: string | null; linked_pack_id: string | null; linked_pack_version: string | null }
|
||||
export type PackageError = "NoPrimaryFile" | "IsModPack" | { Incompatible: IncompatiblePackageType }
|
||||
|
||||
export type PackageError = 'NoPrimaryFile' | 'IsModPack' | { Incompatible: IncompatiblePackageType };
|
||||
export type Process = { pid: number; started_at: string; cluster_id: bigint; post_hook: string | null; account_id: string }
|
||||
|
||||
export interface Process { pid: number; started_at: string; cluster_id: bigint; post_hook: string | null; account_id: string }
|
||||
export type ProcessError = { HookUnsuccessful: number } | "NoPid"
|
||||
|
||||
export type ProcessError = { HookUnsuccessful: number } | 'NoPid';
|
||||
export type ProcessPayload = { Starting: { command: string } } | { Started: { process: Process } } | { Stopped: { pid: number; exit_code: number } } | { Output: { pid: number; output: string } }
|
||||
|
||||
export type ProcessPayload = { Starting: { command: string } } | { Started: { process: Process } } | { Stopped: { pid: number; exit_code: number } } | { Output: { pid: number; output: string } };
|
||||
export type Resolution = { width: number; height: number }
|
||||
|
||||
export interface Resolution { width: number; height: number }
|
||||
export type SettingProfileModel = { name: string; java_id: bigint | null; res: Resolution | null; force_fullscreen: boolean | null; mem_max: number | null; launch_args: string | null; launch_env: string | null; hook_pre: string | null; hook_wrapper: string | null; hook_post: string | null; os_extra: SettingsOsExtra | null }
|
||||
|
||||
export interface SettingProfileModel { name: string; java_id: bigint | null; res: Resolution | null; force_fullscreen: boolean | null; mem_max: number | null; launch_args: string | null; launch_env: string | null; hook_pre: string | null; hook_wrapper: string | null; hook_post: string | null; os_extra: SettingsOsExtra | null }
|
||||
export type SettingsOsExtra = Record<string, never>
|
||||
|
||||
export interface SettingsOsExtra { enable_gamemode: boolean | null }
|
||||
const ARGS_MAP = { 'onelauncher':'{"return_error":[],"open_dev_tools":[]}', 'core':'{"get_users":[],"get_user":["uuid"],"get_default_user":["fallback"],"get_cluster":["id"],"create_cluster":["options"],"get_profile_or_default":["name"],"remove_cluster":["id"],"set_default_user":["uuid"],"open_msa_login":[],"get_global_profile":[],"remove_user":["uuid"],"get_clusters":[]}', '':'{"send_event":["event"]}' }
|
||||
export type Router = { 'onelauncher': { return_error: () => Promise<null>,
|
||||
open_dev_tools: () => Promise<void> },
|
||||
'core': { get_clusters: () => Promise<Model[]>,
|
||||
get_cluster: (id: bigint) => Promise<Model | null>,
|
||||
remove_cluster: (id: bigint) => Promise<null>,
|
||||
create_cluster: (options: CreateCluster) => Promise<Model>,
|
||||
get_profile_or_default: (name: string | null) => Promise<SettingProfileModel>,
|
||||
get_global_profile: () => Promise<SettingProfileModel>,
|
||||
get_users: () => Promise<MinecraftCredentials[]>,
|
||||
get_user: (uuid: string) => Promise<MinecraftCredentials | null>,
|
||||
remove_user: (uuid: string) => Promise<null>,
|
||||
get_default_user: (fallback: boolean | null) => Promise<MinecraftCredentials | null>,
|
||||
set_default_user: (uuid: string | null) => Promise<null>,
|
||||
open_msa_login: () => Promise<MinecraftCredentials | null> },
|
||||
'': { send_event: (event: LauncherEvent) => Promise<void> } };
|
||||
|
||||
<<<<<<< Updated upstream
|
||||
const ARGS_MAP = { '': '{"send_event":["event"]}', 'onelauncher': '{"return_error":[],"open_dev_tools":[]}', 'core': '{"get_user":["uuid"],"get_default_user":["fallback"],"set_default_user":["uuid"],"get_global_profile":[],"get_clusters":[],"remove_cluster":["id"],"get_profile_or_default":["name"],"get_users":[],"remove_user":["uuid"],"open_msa_login":[],"create_cluster":["options"],"get_cluster":["id"]}' };
|
||||
export interface Router {
|
||||
'onelauncher': { return_error: () => Promise<null>; open_dev_tools: () => Promise<void> };
|
||||
'core': { get_clusters: () => Promise<Array<Model>>; get_cluster: (id: bigint) => Promise<Model | null>; remove_cluster: (id: bigint) => Promise<null>; create_cluster: (options: CreateCluster) => Promise<Model>; get_profile_or_default: (name: string | null) => Promise<SettingProfileModel>; get_global_profile: () => Promise<SettingProfileModel>; get_users: () => Promise<Array<MinecraftCredentials>>; get_user: (uuid: string) => Promise<MinecraftCredentials | null>; remove_user: (uuid: string) => Promise<null>; get_default_user: (fallback: boolean | null) => Promise<MinecraftCredentials | null>; set_default_user: (uuid: string | null) => Promise<null>; open_msa_login: () => Promise<MinecraftCredentials | null> };
|
||||
'': { send_event: (event: LauncherEvent) => Promise<void> };
|
||||
}
|
||||
=======
|
||||
>>>>>>> Stashed changes
|
||||
|
||||
export type { InferCommandOutput };
|
||||
export const createTauRPCProxy = () => createProxy<Router>(ARGS_MAP);
|
||||
export type { InferCommandOutput }
|
||||
export const createTauRPCProxy = () => createProxy<Router>(ARGS_MAP)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue