This commit is contained in:
eric
2025-11-13 05:05:53 +08:00
parent cbdc65f56e
commit 891af61146
691 changed files with 83952 additions and 0 deletions

99
types/dnd.d.ts vendored Normal file
View File

@@ -0,0 +1,99 @@
declare module '@hello-pangea/dnd' {
import type { ReactNode } from 'react'
export interface DraggableProvided {
draggableProps: {
style?: React.CSSProperties
[key: string]: any
}
dragHandleProps: {
[key: string]: any
} | null
innerRef: (element?: HTMLElement | null) => void
}
export interface DroppableProvided {
innerRef: (element?: HTMLElement | null) => void
placeholder?: ReactNode
droppableProps: {
[key: string]: any
}
}
export interface DraggableStateSnapshot {
isDragging: boolean
isDropAnimating: boolean
draggingOver: string | null
dropAnimation: {
duration: number
curve: string
moveTo: {
x: number
y: number
}
} | null
}
export interface DraggableRubric {
draggableId: string
type: string
source: {
droppableId: string
index: number
}
}
export interface DropResult {
draggableId: string
type: string
source: {
droppableId: string
index: number
}
destination: {
droppableId: string
index: number
} | null
reason: 'DROP' | 'CANCEL'
}
export interface DroppableStateSnapshot {
isDraggingOver: boolean
draggingOverWith: string | null
draggingFromThisWith: string | null
isUsingPlaceholder: boolean
}
export interface DragDropContextProps {
onDragEnd: (result: DropResult) => void
onDragStart?: (initial: DraggableRubric) => void
onDragUpdate?: (initial: DraggableRubric) => void
children: ReactNode
}
export interface DroppableProps {
droppableId: string
type?: string
mode?: 'standard' | 'virtual'
isDropDisabled?: boolean
isCombineEnabled?: boolean
direction?: 'vertical' | 'horizontal'
ignoreContainerClipping?: boolean
renderClone?: any
getContainerForClone?: () => HTMLElement
children: (provided: DroppableProvided, snapshot: DroppableStateSnapshot) => ReactNode
}
export interface DraggableProps {
draggableId: string
index: number
isDragDisabled?: boolean
disableInteractiveElementBlocking?: boolean
shouldRespectForcePress?: boolean
children: (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => ReactNode
}
export const DragDropContext: React.FC<DragDropContextProps>
export const Droppable: React.FC<DroppableProps>
export const Draggable: React.FC<DraggableProps>
}

8
types/env.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
declare namespace NodeJS {
interface ProcessEnv {
NEXTAUTH_URL: string
NEXTAUTH_SECRET: string
GITHUB_CLIENT_ID: string
GITHUB_SECRET: string
}
}

79
types/navigation.ts Normal file
View File

@@ -0,0 +1,79 @@
export interface NavigationSubItem {
id: string
title: string
href: string
description?: string
icon?: string
enabled: boolean
}
export interface NavigationCategory {
id: string
title: string
icon?: string
description?: string
parentId?: string
items?: NavigationSubItem[]
enabled?: boolean
}
export interface NavigationItem {
id: string
title: string
description?: string
icon?: string
items?: NavigationSubItem[]
subCategories?: NavigationCategory[]
enabled?: boolean
}
export interface NavigationData {
navigationItems: NavigationItem[]
}
export interface ResourceItem {
title: string
description: string
icon: string
url: string
}
export interface ResourceSection {
id: string
title: string
items: ResourceItem[]
}
export interface ResourceData {
resourceSections: ResourceSection[]
}
// 图标路径解析工具函数
export function resolveIconPath(icon?: string): string | undefined {
if (!icon) return undefined
// 预定义的图标映射
const iconMap: Record<string, string> = {
'search': '/icons/search.svg',
'user': '/icons/user.svg',
'linecons-desktop': '/icons/desktop.svg',
// 添加更多常见图标的映射
}
// 如果是预定义的图标名称,使用映射
if (iconMap[icon]) {
return iconMap[icon]
}
// 如果是完整的 URL直接返回
if (icon.startsWith('http://') || icon.startsWith('https://')) {
return icon
}
// 如果是相对路径,确保以 / 开头
if (!icon.startsWith('/')) {
return `/icons/${icon}`
}
return icon
}

10
types/next-auth.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
import 'next-auth'
declare module 'next-auth' {
interface Session {
accessToken?: string
}
interface JWT {
accessToken?: string
}
}

View File

@@ -0,0 +1,9 @@
export type ResourceMetadata = {
commit: string;
generated: string;
metadata: Array<{
commit: string;
hash: string;
path: string;
}>;
};

9
types/session.ts Normal file
View File

@@ -0,0 +1,9 @@
export interface SessionData {
user?: {
accessToken?: string
email?: string
name?: string
image?: string
}
isLoggedIn: boolean
}

31
types/site.ts Normal file
View File

@@ -0,0 +1,31 @@
export interface SiteConfig {
basic: {
title: string
description: string
keywords: string
}
appearance: {
logo: string
favicon: string
theme: 'light' | 'dark' | 'system'
}
navigation: {
linkTarget: '_blank' | '_self'
}
}
export interface SiteInfo {
basic: {
title: string
description: string
keywords: string
}
appearance: {
logo: string
favicon: string
theme: string
}
navigation: {
linkTarget: string
}
}