fix import path
This commit is contained in:
@@ -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
53
src/types/index.ts
Normal 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>>>>
|
||||
Reference in New Issue
Block a user