feat:移除了弹窗,服务器添加sls
This commit is contained in:
commit
6a295f9a7a
4082 files changed
+1322534
No files matched your search
@@ -0,0 +1,52 @@
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
|
||||
import type { SingleplayerWorld } from '@/helpers/worlds'
|
||||
|
||||
export type DatapackKind = 'folder' | 'zip'
|
||||
|
||||
export type WorldDatapack = {
|
||||
file_name: string
|
||||
display_name: string
|
||||
kind: DatapackKind
|
||||
pack_format?: number
|
||||
supported_formats?: number[]
|
||||
description?: unknown
|
||||
icon?: string
|
||||
enabled?: boolean
|
||||
size: number
|
||||
modified?: string
|
||||
}
|
||||
|
||||
export type WorldWithDatapacks = SingleplayerWorld & {
|
||||
datapacks: WorldDatapack[]
|
||||
}
|
||||
|
||||
export async function listDatapacks(instanceId: string): Promise<WorldWithDatapacks[]> {
|
||||
return await invoke('plugin:datapacks|list_datapacks', { instanceId })
|
||||
}
|
||||
|
||||
export async function deleteDatapack(
|
||||
instanceId: string,
|
||||
worldPath: string,
|
||||
fileName: string,
|
||||
): Promise<void> {
|
||||
return await invoke('plugin:datapacks|delete_datapack', {
|
||||
instanceId,
|
||||
worldPath,
|
||||
fileName,
|
||||
})
|
||||
}
|
||||
|
||||
export async function setDatapackEnabled(
|
||||
instanceId: string,
|
||||
worldPath: string,
|
||||
fileName: string,
|
||||
enabled: boolean,
|
||||
): Promise<void> {
|
||||
return await invoke('plugin:datapacks|set_datapack_enabled', {
|
||||
instanceId,
|
||||
worldPath,
|
||||
fileName,
|
||||
enabled,
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user