import React__default from 'react';
import { F as FileMetadata } from '../../types-CK4We_aI.js';
import { M as MMDPlaylistConfig, a as MMDResourceItem, b as MMDPlaylistNode, c as MMDResourceOptions, d as MMDResources } from '../../types-HorDyIRv.js';
export { M as MmdPlaylist, f as MmdPlaylistNode, j as MmdPresetItem, h as MmdResourceOption, N as NewMmdPlaylist, g as NewMmdPlaylistNode, k as NewMmdPresetItem, i as NewMmdResourceOption, a as mmdPlaylistNodes, e as mmdPlaylistNodesRelations, m as mmdPlaylists, d as mmdPlaylistsRelations, c as mmdPresetItems, b as mmdResourceOptions } from '../../drizzle-schema-BNhqj2AZ.js';
import 'three';
import 'drizzle-orm';
import 'drizzle-orm/pg-core';

/**
 * MMD 后台管理类型定义
 *
 * 这个文件定义了MMD后台管理系统的所有TypeScript类型
 * 包括前端组件使用的类型和后端API的类型
 *
 * @package sa2kit/mmd/admin
 */

/**
 * 播放列表配置（数据库格式）
 */
interface MmdPlaylistDB {
    id: string;
    name: string;
    description?: string;
    loop: boolean;
    preloadStrategy: 'none' | 'next' | 'all';
    autoPlay: boolean;
    thumbnailFileId?: string;
    status: 'draft' | 'published' | 'archived';
    sortOrder: number;
    config?: Record<string, any>;
    createdBy: string;
    createdAt: Date;
    updatedAt: Date;
    deletedAt?: Date;
}
/**
 * 播放节点配置（数据库格式）
 */
interface MmdPlaylistNodeDB {
    id: string;
    playlistId: string;
    name: string;
    description?: string;
    loop: boolean;
    duration?: number;
    thumbnailFileId?: string;
    sortOrder: number;
    modelFileId: string;
    motionFileId?: string;
    cameraFileId?: string;
    audioFileId?: string;
    stageModelFileId?: string;
    additionalMotionFileIds?: string[];
    config?: Record<string, any>;
    createdAt: Date;
    updatedAt: Date;
}
/**
 * 资源选项配置（数据库格式）
 */
interface MmdResourceOptionDB {
    id: string;
    name: string;
    description?: string;
    resourceType: 'model' | 'motion' | 'camera' | 'audio' | 'stage';
    fileId: string;
    thumbnailFileId?: string;
    tags?: string[];
    sortOrder: number;
    isActive: boolean;
    createdBy: string;
    createdAt: Date;
    updatedAt: Date;
}
/**
 * 预设项配置（数据库格式）
 */
interface MmdPresetItemDB {
    id: string;
    name: string;
    description?: string;
    thumbnailFileId?: string;
    modelFileId: string;
    motionFileId?: string;
    cameraFileId?: string;
    audioFileId?: string;
    stageModelFileId?: string;
    additionalMotionFileIds?: string[];
    sortOrder: number;
    isActive: boolean;
    tags?: string[];
    createdBy: string;
    createdAt: Date;
    updatedAt: Date;
}
/**
 * 播放列表配置（包含文件URL映射）
 */
interface MmdPlaylistWithFiles extends Omit<MmdPlaylistDB, 'thumbnailFileId'> {
    thumbnailUrl?: string;
    nodes: MmdPlaylistNodeWithFiles[];
}
/**
 * 播放节点配置（包含文件URL映射）
 */
interface MmdPlaylistNodeWithFiles extends Omit<MmdPlaylistNodeDB, 'modelFileId' | 'motionFileId' | 'cameraFileId' | 'audioFileId' | 'stageModelFileId' | 'thumbnailFileId' | 'additionalMotionFileIds'> {
    thumbnailUrl?: string;
    modelUrl: string;
    motionUrl?: string;
    cameraUrl?: string;
    audioUrl?: string;
    stageModelUrl?: string;
    additionalMotionUrls?: string[];
}
/**
 * 资源选项配置（包含文件URL映射）
 */
interface MmdResourceOptionWithFile extends Omit<MmdResourceOptionDB, 'fileId' | 'thumbnailFileId'> {
    fileUrl: string;
    thumbnailUrl?: string;
    fileMetadata?: Partial<FileMetadata>;
}
/**
 * 预设项配置（包含文件URL映射）
 */
interface MmdPresetItemWithFiles extends Omit<MmdPresetItemDB, 'modelFileId' | 'motionFileId' | 'cameraFileId' | 'audioFileId' | 'stageModelFileId' | 'thumbnailFileId' | 'additionalMotionFileIds'> {
    thumbnailUrl?: string;
    modelUrl: string;
    motionUrl?: string;
    cameraUrl?: string;
    audioUrl?: string;
    stageModelUrl?: string;
    additionalMotionUrls?: string[];
}
/**
 * 创建播放列表请求
 */
interface CreatePlaylistRequest {
    name: string;
    description?: string;
    loop?: boolean;
    preloadStrategy?: 'none' | 'next' | 'all';
    autoPlay?: boolean;
    thumbnailFileId?: string;
    config?: Record<string, any>;
}
/**
 * 更新播放列表请求
 */
interface UpdatePlaylistRequest extends Partial<CreatePlaylistRequest> {
    status?: 'draft' | 'published' | 'archived';
    sortOrder?: number;
}
/**
 * 创建播放节点请求
 */
interface CreatePlaylistNodeRequest {
    playlistId: string;
    name: string;
    description?: string;
    loop?: boolean;
    duration?: number;
    thumbnailFileId?: string;
    sortOrder?: number;
    modelFileId: string;
    motionFileId?: string;
    cameraFileId?: string;
    audioFileId?: string;
    stageModelFileId?: string;
    additionalMotionFileIds?: string[];
    config?: Record<string, any>;
}
/**
 * 更新播放节点请求
 */
interface UpdatePlaylistNodeRequest extends Partial<Omit<CreatePlaylistNodeRequest, 'playlistId'>> {
}
/**
 * 创建资源选项请求
 */
interface CreateResourceOptionRequest {
    name: string;
    description?: string;
    resourceType: 'model' | 'motion' | 'camera' | 'audio' | 'stage';
    fileId: string;
    thumbnailFileId?: string;
    tags?: string[];
    sortOrder?: number;
}
/**
 * 更新资源选项请求
 */
interface UpdateResourceOptionRequest extends Partial<CreateResourceOptionRequest> {
    isActive?: boolean;
}
/**
 * 创建预设项请求
 */
interface CreatePresetItemRequest {
    name: string;
    description?: string;
    thumbnailFileId?: string;
    modelFileId: string;
    motionFileId?: string;
    cameraFileId?: string;
    audioFileId?: string;
    stageModelFileId?: string;
    additionalMotionFileIds?: string[];
    tags?: string[];
    sortOrder?: number;
}
/**
 * 更新预设项请求
 */
interface UpdatePresetItemRequest extends Partial<CreatePresetItemRequest> {
    isActive?: boolean;
}
/**
 * 分页查询参数
 */
interface PaginationQuery {
    page?: number;
    pageSize?: number;
    sortBy?: string;
    sortOrder?: 'asc' | 'desc';
}
/**
 * 播放列表查询参数
 */
interface PlaylistQuery extends PaginationQuery {
    status?: 'draft' | 'published' | 'archived';
    createdBy?: string;
    search?: string;
}
/**
 * 资源选项查询参数
 */
interface ResourceOptionQuery extends PaginationQuery {
    resourceType?: 'model' | 'motion' | 'camera' | 'audio' | 'stage';
    tags?: string[];
    isActive?: boolean;
    search?: string;
}
/**
 * 预设项查询参数
 */
interface PresetItemQuery extends PaginationQuery {
    tags?: string[];
    isActive?: boolean;
    search?: string;
}
/**
 * 分页响应
 */
interface PaginationResponse<T> {
    items: T[];
    total: number;
    page: number;
    pageSize: number;
    totalPages: number;
}
/**
 * 文件ID到URL的映射
 */
interface FileIdToUrlMap {
    [fileId: string]: string;
}
/**
 * 批量文件URL查询响应
 */
interface BatchFileUrlsResponse {
    fileUrls: FileIdToUrlMap;
    missingFileIds: string[];
}
/**
 * MMD资源文件上传配置
 */
interface MmdFileUploadConfig {
    /** 模块ID（用于文件分类） */
    moduleId: 'mmd-models' | 'mmd-motions' | 'mmd-cameras' | 'mmd-audios' | 'mmd-stages' | 'mmd-thumbnails';
    /** 允许的文件类型 */
    acceptedTypes: string[];
    /** 最大文件大小(MB) */
    maxFileSize: number;
    /** 文件描述 */
    description: string;
    /** 额外提示 */
    hint?: string;
}
/**
 * MMD资源类型配置映射
 */
declare const MMD_RESOURCE_TYPE_CONFIGS: Record<string, MmdFileUploadConfig>;
/**
 * MMD后台管理器组件属性
 */
interface MmdAdminPanelProps {
    /** UniversalFile服务实例（用于文件上传） */
    fileService: any;
    /** 当前用户ID */
    userId: string;
    /** API基础路径 */
    apiBaseUrl?: string;
    /** 是否显示高级选项 */
    showAdvancedOptions?: boolean;
    /** 自定义样式类名 */
    className?: string;
}
/**
 * 播放列表编辑器组件属性
 */
interface PlaylistEditorProps {
    /** 播放列表ID（编辑模式）或 undefined（创建模式） */
    playlistId?: string;
    /** UniversalFile服务实例 */
    fileService: any;
    /** 当前用户ID */
    userId: string;
    /** 保存回调 */
    onSave?: (playlist: MmdPlaylistWithFiles) => void;
    /** 取消回调 */
    onCancel?: () => void;
}
/**
 * 资源选择器组件属性
 */
interface ResourceSelectorProps {
    /** 资源类型 */
    resourceType: 'model' | 'motion' | 'camera' | 'audio' | 'stage';
    /** UniversalFile服务实例 */
    fileService: any;
    /** 当前用户ID */
    userId: string;
    /** 当前选中的文件ID */
    value?: string;
    /** 选择回调 */
    onChange: (fileId: string, fileUrl: string) => void;
    /** 是否必填 */
    required?: boolean;
}
/**
 * 播放列表转换为前端格式
 */
type PlaylistToFrontendConverter = (playlist: MmdPlaylistDB, nodes: MmdPlaylistNodeDB[], fileUrls: FileIdToUrlMap) => MmdPlaylistWithFiles;
/**
 * 播放列表转换为MMD组件格式
 */
type PlaylistToMmdConfigConverter = (playlist: MmdPlaylistWithFiles) => MMDPlaylistConfig;
/**
 * 资源选项转换为前端格式
 */
type ResourceOptionToFrontendConverter = (option: MmdResourceOptionDB, fileUrls: FileIdToUrlMap) => MmdResourceOptionWithFile;
/**
 * 预设项转换为前端格式
 */
type PresetItemToFrontendConverter = (item: MmdPresetItemDB, fileUrls: FileIdToUrlMap) => MmdPresetItemWithFiles;
/**
 * 预设项转换为MMD资源格式
 */
type PresetItemToMmdResourceConverter = (item: MmdPresetItemWithFiles) => MMDResourceItem;

/**
 * MMD 后台管理面板 - 主入口组件
 *
 * 功能：
 * - 播放列表管理（列表、创建、编辑、删除）
 * - 预设项管理
 * - 资源选项管理
 * - 统计信息展示
 *
 * @package sa2kit/mmd/admin
 */

/**
 * MMD后台管理面板
 */
declare const MmdAdminPanel: React__default.FC<MmdAdminPanelProps>;

/**
 * MMD 播放列表编辑器组件
 *
 * 功能：
 * - 创建/编辑播放列表
 * - 添加/删除/排序播放节点
 * - 为每个节点配置资源（模型、动作、音频等）
 * - 预览配置
 *
 * @package sa2kit/mmd/admin
 */

/**
 * 播放列表编辑器
 */
declare const MmdPlaylistEditor: React__default.FC<PlaylistEditorProps>;

/**
 * MMD 资源选择器组件
 *
 * 集成 UniversalFile 文件上传组件，支持：
 * - 文件上传到OSS
 * - 文件列表浏览
 * - 文件选择
 * - 文件预览
 *
 * @package sa2kit/mmd/admin
 */

/**
 * MMD资源选择器
 */
declare const MmdResourceSelector: React__default.FC<ResourceSelectorProps>;

/**
 * MMD 后台管理数据转换工具
 *
 * 提供数据库格式和前端格式之间的转换函数
 * 以及文件ID到URL的映射功能
 *
 * @package sa2kit/mmd/admin
 */

/**
 * 从数据库记录中提取所有文件ID
 */
declare function extractFileIdsFromPlaylist(playlist: MmdPlaylistDB, nodes: MmdPlaylistNodeDB[]): string[];
/**
 * 从资源选项中提取文件ID
 */
declare function extractFileIdsFromResourceOptions(options: MmdResourceOptionDB[]): string[];
/**
 * 从预设项中提取文件ID
 */
declare function extractFileIdsFromPresetItem(item: MmdPresetItemDB): string[];
/**
 * 转换播放节点（数据库 -> 前端格式）
 */
declare function convertPlaylistNodeToFrontend(node: MmdPlaylistNodeDB, fileUrls: FileIdToUrlMap): MmdPlaylistNodeWithFiles;
/**
 * 转换播放列表（数据库 -> 前端格式）
 */
declare function convertPlaylistToFrontend(playlist: MmdPlaylistDB, nodes: MmdPlaylistNodeDB[], fileUrls: FileIdToUrlMap): MmdPlaylistWithFiles;
/**
 * 转换资源选项（数据库 -> 前端格式）
 */
declare function convertResourceOptionToFrontend(option: MmdResourceOptionDB, fileUrls: FileIdToUrlMap): MmdResourceOptionWithFile;
/**
 * 转换预设项（数据库 -> 前端格式）
 */
declare function convertPresetItemToFrontend(item: MmdPresetItemDB, fileUrls: FileIdToUrlMap): MmdPresetItemWithFiles;
/**
 * 转换播放节点（前端格式 -> MMD组件格式）
 */
declare function convertNodeToMmdFormat(node: MmdPlaylistNodeWithFiles): MMDPlaylistNode;
/**
 * 转换播放列表（前端格式 -> MMD组件格式）
 */
declare function convertPlaylistToMmdConfig(playlist: MmdPlaylistWithFiles): MMDPlaylistConfig;
/**
 * 转换预设项（前端格式 -> MMD资源项格式）
 */
declare function convertPresetItemToMmdResource(item: MmdPresetItemWithFiles): MMDResourceItem;
/**
 * 转换资源选项列表（前端格式 -> MMD资源选项格式）
 */
declare function convertResourceOptionsToMmdFormat(options: MmdResourceOptionWithFile[]): MMDResourceOptions;
/**
 * 验证文件URL映射是否完整
 */
declare function validateFileUrls(requiredFileIds: string[], fileUrls: FileIdToUrlMap): {
    valid: boolean;
    missingIds: string[];
};
/**
 * 生成默认文件URL映射（用于开发/测试）
 */
declare function generateMockFileUrls(fileIds: string[]): FileIdToUrlMap;
/**
 * 合并多个文件URL映射
 */
declare function mergeFileUrlMaps(...maps: FileIdToUrlMap[]): FileIdToUrlMap;
/**
 * 从MMDResources提取文件路径（用于编辑时反向映射）
 */
declare function extractPathsFromMmdResources(resources: MMDResources): string[];

export { type BatchFileUrlsResponse, type CreatePlaylistNodeRequest, type CreatePlaylistRequest, type CreatePresetItemRequest, type CreateResourceOptionRequest, type FileIdToUrlMap, MMD_RESOURCE_TYPE_CONFIGS, MmdAdminPanel, type MmdAdminPanelProps, type MmdFileUploadConfig, type MmdPlaylistDB, MmdPlaylistEditor, type MmdPlaylistNodeDB, type MmdPlaylistNodeWithFiles, type MmdPlaylistWithFiles, type MmdPresetItemDB, type MmdPresetItemWithFiles, type MmdResourceOptionDB, type MmdResourceOptionWithFile, MmdResourceSelector, type PaginationQuery, type PaginationResponse, type PlaylistEditorProps, type PlaylistQuery, type PlaylistToFrontendConverter, type PlaylistToMmdConfigConverter, type PresetItemQuery, type PresetItemToFrontendConverter, type PresetItemToMmdResourceConverter, type ResourceOptionQuery, type ResourceOptionToFrontendConverter, type ResourceSelectorProps, type UpdatePlaylistNodeRequest, type UpdatePlaylistRequest, type UpdatePresetItemRequest, type UpdateResourceOptionRequest, convertNodeToMmdFormat, convertPlaylistNodeToFrontend, convertPlaylistToFrontend, convertPlaylistToMmdConfig, convertPresetItemToFrontend, convertPresetItemToMmdResource, convertResourceOptionToFrontend, convertResourceOptionsToMmdFormat, extractFileIdsFromPlaylist, extractFileIdsFromPresetItem, extractFileIdsFromResourceOptions, extractPathsFromMmdResources, generateMockFileUrls, mergeFileUrlMaps, validateFileUrls };
