fix import path

This commit is contained in:
Timi
2026-04-02 16:52:48 +08:00
parent cdaf858a53
commit c266c9e95b
44 changed files with 180 additions and 194 deletions

View File

@@ -1,4 +1,5 @@
import { AttachmentView, Model } from "timi-web";
import type { AttachmentView } from "./Attachment";
import type { Model } from "./Model";
// 文章
export type Article<E extends ArticleMusicExtendData | ArticleSoftwareExtendData> = {

53
src/types/index.ts Normal file
View File

@@ -0,0 +1,53 @@
import type { Plugin } from "vue";
export * from "./Model";
export * from "./Article";
export * from "./Setting";
export * from "./Attachment";
export * from "./Model";
export * from "./User";
export * from "./Template";
export * from "./Comment";
export * from "./Developer";
/**
* 安装方法
*/
export type InstallRecord<T> = T & Plugin;
/**
* 默认插槽参数
*/
export type DefaultSlotProp = (props: object) => unknown
/**
* 默认插槽类型
*/
export interface DefaultSlots {
default: DefaultSlotProp;
icon?: DefaultSlotProp;
}
/**
* 合并类型为交叉类型
*/
export type Merge<T, R> = {
[K in keyof T]: T[K]
} & {
[K in keyof R]: R[K]
}
/**
* 合并交叉类型
*/
type MergeIntersection<T> = Pick<T, keyof T>
/**
* 提取必传属性
*/
export type PickRequiredUnion<P, U extends keyof P> = MergeIntersection<Merge<Required<Pick<P, U>>, Omit<P, U>>>
/**
* 除了提取的属性,其他都是必传属性
*/
export type PickNotRequiredUnion<P, U extends keyof P> = MergeIntersection<Merge<Pick<P, U>, Required<Omit<P, U>>>>