///
///
import { App } from 'vue';
import { ColorMethod } from 'mxcad';
import { ComputedRef } from 'vue';
import { DateInstance } from 'vuetify';
import { DefaultsInstance } from 'vuetify';
import { DisplayInstance } from 'vuetify';
import { GoToInstance } from 'vuetify';
import { IconAliases } from 'vuetify';
import { IconSet } from 'vuetify';
import { LocaleInstance } from 'vuetify';
import { LocaleMessages } from 'vuetify';
import { LocaleOptions } from 'vuetify';
import { McCmColor } from 'mxcad';
import { McDb } from 'mxcad';
import { McObject } from 'mxcad';
import { MxCADPluginSampleCode } from 'mxcad';
import { Ref } from 'vue';
import { ShallowRef } from 'vue';
import { Store } from 'pinia';
import { StoreDefinition } from 'pinia';
import { ThemeInstance } from 'vuetify';
declare interface AppConfig {
uiConfig?: string;
serverConfig?: string;
sketchesUiConfig?: string;
quickCommandConfig?: string;
themeConfig?: string;
}
declare type BuildPowersOf2LengthArrays = R[0][N] extends never ? R : BuildPowersOf2LengthArrays;
declare type ColorIndex = RangeOf2<0, 256> | -1;
declare type ColorType = typeof defaultColor;
declare type ConcatLargestUntilDone = B["length"] extends N ? B : [...R[0], ...B][N] extends never ? ConcatLargestUntilDone : ConcatLargestUntilDone;
declare type CustomUploadCalllback = ((file: File) => (Promise | CustomUploadCalllbackResult)) | undefined;
declare interface CustomUploadCalllbackResult {
/** 转换后的文件url链接 */
fileUrl: string;
}
declare interface CustomUploadConfig {
callback: CustomUploadCalllback;
}
declare interface CutBox {
imgBase64: string;
param: CutBoxParam;
exportStatus: 'ready' | 'exporting' | 'success' | 'error';
fileName?: string;
selected?: boolean;
}
declare interface CutBoxParam {
bd_pt1_x: string;
bd_pt1_y: string;
bd_pt2_x: string;
bd_pt2_y: string;
}
declare const defaultColor: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
declare const defaultLineType: {
name: string;
explain: string;
appearance: string;
id: number;
};
/**
* 事件总线类
*/
declare class EventBus> {
private handlers;
/**
* 注册事件监听器
* @param event - 事件类型
* @param handler - 事件处理函数
*/
on(event: E, handler: (payload: EventMap[E]) => any): any;
/**
* 移除事件监听器
*/
off(event: E, handler: (payload: EventMap[E]) => any): any;
/**
* 触发事件
*/
emit(event: E, payload?: EventMap[E]): any;
/**
* 注册一次性事件监听器
*/
once(event: E, handler: (payload: EventMap[E]) => any): any;
/**
* 清除指定事件的所有监听器
*/
clear(event?: E): any;
/**
* 获取指定事件的监听器数量
*/
count(event: E): number;
}
declare interface JSONLineType {
name: string;
comments: string;
id: number;
}
declare type LineType = typeof defaultLineType & {
value?: null | string;
};
declare class MxCADApp extends MxCADEvents {
setStaticAssetPath(url: string): void;
getStaticAssetPath(): string;
initConfig(config: AppConfig): void;
/** 设置打印配置和回调 */
initPrintConfig(config: MxCADPrintCallConfig): void;
/** 设置剪切图纸设置和回调 */
initCutConfig(config: MxCADCutCallConfig): void;
/** 设置自定义上传设置和回调 */
initCustomUploadConfig(config: CustomUploadConfig): void;
/** 获取mxcad-app使用的vuetify实例 */
getVuetify(): Promise<{
install: (app: App) => void;
unmount: () => void;
defaults: Ref;
display: DisplayInstance;
theme: ThemeInstance & {
install: (app: App) => void;
};
icons: {
defaultSet: string;
aliases: Partial;
sets: Record;
};
locale: {
isRtl: Ref;
rtl: Ref>;
rtlClasses: Ref;
name: string;
decimalSeparator: ShallowRef;
messages: Ref;
current: Ref;
fallback: Ref;
t: (key: string, ...params: unknown[]) => string;
n: (value: number) => string;
provide: (props: LocaleOptions) => LocaleInstance;
};
date: {
options: {
adapter: (new (options: {
locale: any;
formats?: any;
}) => DateInstance) | DateInstance;
formats?: Record;
locale: Record;
};
instance: {
locale?: any;
date: (value?: any) => unknown;
format: (date: unknown, formatString: string) => string;
toJsDate: (value: unknown) => Date;
parseISO: (date: string) => unknown;
toISO: (date: unknown) => string;
startOfDay: (date: unknown) => unknown;
endOfDay: (date: unknown) => unknown;
startOfWeek: (date: unknown, firstDayOfWeek?: number | string) => unknown;
endOfWeek: (date: unknown) => unknown;
startOfMonth: (date: unknown) => unknown;
endOfMonth: (date: unknown) => unknown;
startOfYear: (date: unknown) => unknown;
endOfYear: (date: unknown) => unknown;
isAfter: (date: unknown, comparing: unknown) => boolean;
isAfterDay: (date: unknown, comparing: unknown) => boolean;
isSameDay: (date: unknown, comparing: unknown) => boolean;
isSameMonth: (date: unknown, comparing: unknown) => boolean;
isSameYear: (date: unknown, comparing: unknown) => boolean;
isBefore: (date: unknown, comparing: unknown) => boolean;
isEqual: (date: unknown, comparing: unknown) => boolean;
isValid: (date: any) => boolean;
isWithinRange: (date: unknown, range: [unknown, unknown]) => boolean;
addMinutes: (date: unknown, amount: number) => unknown;
addHours: (date: unknown, amount: number) => unknown;
addDays: (date: unknown, amount: number) => unknown;
addWeeks: (date: unknown, amount: number) => unknown;
addMonths: (date: unknown, amount: number) => unknown;
getYear: (date: unknown) => number;
setYear: (date: unknown, year: number) => unknown;
getDiff: (date: unknown, comparing: unknown, unit?: string) => number;
getWeekArray: (date: unknown, firstDayOfWeek?: number | string) => unknown[][];
getWeekdays: (firstDayOfWeek?: number | string, weekdayFormat?: "long" | "short" | "narrow") => string[];
getWeek: (date: unknown, firstDayOfWeek?: number | string, firstWeekMinSize?: number) => number;
getMonth: (date: unknown) => number;
setMonth: (date: unknown, month: number) => unknown;
getDate: (date: unknown) => number;
setDate: (date: unknown, day: number) => unknown;
getNextMonth: (date: unknown) => unknown;
getPreviousMonth: (date: unknown) => unknown;
getHours: (date: unknown) => number;
setHours: (date: unknown, hours: number) => unknown;
getMinutes: (date: unknown) => number;
setMinutes: (date: unknown, minutes: number) => unknown;
};
};
goTo: GoToInstance;
}>;
/** 初始化代码编辑器的代码示例 */
initCodeEditorCodeExamples(codes: MxCADPluginSampleCode[]): void;
}
export declare let mxcadApp: MxCADApp;
declare namespace mxcadApp_2 {
export {
MxCADView,
store,
mxcadApp
}
}
export default mxcadApp_2;
declare type MxCADCutCallBack = (data: Blob, box: CutBox) => (void | string) | Promise;
declare interface MxCADCutCallConfig {
/** 剪切图纸回调函数 */
callback: MxCADCutCallBack;
}
declare class MxCADEvents extends EventBus {
/**
* 创建vue app 实例
*/
on(event: 'createVueApp', handler: (payload: MxCADEventsMap['createVueApp']) => void): void;
/**
* 挂载vue app 实例
*/
on(event: 'mountedVueApp', handler: (payload: MxCADEventsMap['mountedVueApp']) => void): void;
/**
* 一次性监听创建vue app 实例
*/
once(event: 'createVueApp', handler: (payload: MxCADEventsMap['createVueApp']) => void): void;
/**
* 一次性监听挂载vue app 实例
*/
once(event: 'mountedVueApp', handler: (payload: MxCADEventsMap['mountedVueApp']) => void): void;
}
declare interface MxCADEventsMap {
"createVueApp": App;
"mountedVueApp": App;
}
declare type MxCADPrintCallBack = (data: Blob, param: MxCADPrintParam) => (void | string) | Promise;
declare interface MxCADPrintCallConfig {
/** 打印预览回调函数 */
callback: MxCADPrintCallBack;
}
declare interface MxCADPrintParam {
width: string;
height: string;
roate_angle: number;
view_angle: number;
bd_pt1_x: string;
bd_pt1_y: string;
bd_pt2_x: string;
bd_pt2_y: string;
colorPolicy: 'mono' | 'default';
open_file_md5: string;
layout_name?: string;
create_clip_block?: boolean;
}
export declare class MxCADView {
constructor(config?: MxCADViewConfig);
private vueApp?;
private rootContainer?;
private _config;
mxcad: McObject;
create(rootContainer?: string | HTMLElement): boolean;
getVueApp(): App | undefined;
getRootContainer(): HTMLElement | undefined;
get config(): MxCADViewConfig;
}
declare interface MxCADViewConfig {
rootContainer?: string | HTMLElement;
openFile?: string;
map?: boolean;
requestHeaders?: any;
fetchAttributes?: number;
}
declare type RangeOf = Partial>["length"];
/** 限制数值范围 */
declare type RangeOf2 = Exclude, RangeOf> | From;
declare type Replace = {
[K in keyof R]: T;
};
export declare namespace store {
export {
useColor,
useLayer,
useLineType
}
}
declare type TupleOf = number extends N ? T[] : {
[K in N]: BuildPowersOf2LengthArrays extends infer U ? U extends never[][] ? Replace, T> : never : never;
}[N];
declare const useColor: StoreDefinition<"color", Pick<{
colorIndexList: ComputedRef< {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[]>;
colorSelectList: Ref<{
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[], {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[] | {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[]>;
currentSelectColor: Ref<{
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | undefined, {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | undefined>;
initColorIndexList: () => void;
createColor: (options?: Partial) => {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
toMcCmColor: (color: ColorType) => McCmColor;
getMcColorToColorInfo: (mcColor: McCmColor, getColorsList?: () => {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[]) => {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
}, "colorSelectList" | "currentSelectColor">, Pick<{
colorIndexList: ComputedRef< {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[]>;
colorSelectList: Ref<{
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[], {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[] | {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[]>;
currentSelectColor: Ref<{
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | undefined, {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | undefined>;
initColorIndexList: () => void;
createColor: (options?: Partial) => {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
toMcCmColor: (color: ColorType) => McCmColor;
getMcColorToColorInfo: (mcColor: McCmColor, getColorsList?: () => {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[]) => {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
}, "colorIndexList">, Pick<{
colorIndexList: ComputedRef< {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[]>;
colorSelectList: Ref<{
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[], {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[] | {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[]>;
currentSelectColor: Ref<{
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | undefined, {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | undefined>;
initColorIndexList: () => void;
createColor: (options?: Partial) => {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
toMcCmColor: (color: ColorType) => McCmColor;
getMcColorToColorInfo: (mcColor: McCmColor, getColorsList?: () => {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
}[]) => {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
}, "initColorIndexList" | "createColor" | "toMcCmColor" | "getMcColorToColorInfo">>;
declare const useLayer: () => Store<"layer", Pick<{
/** 数据列表 */
list: Ref<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[], {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[] | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[]>;
/** 选中索引 */
index: Ref;
currentLayer: Ref<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | undefined, {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | undefined>;
/** 根ID */
rootId: ComputedRef;
/** 设置索引 */
setIndex: (i: number | number[] | Ref) => void;
getIndex: (_index?: ({
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[] | Ref<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[], {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[]>) | (number | number[] | Ref)) => number | number[];
/** 添加 */
add: (layerItem?: {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}) => {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
};
/** 创建 */
create: (options?: Partial<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}>) => {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
};
/** 删除 */
remove: (layers?: number | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | (number | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
})[] | Ref, type?: "index" | "id" | "this") => {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[] | undefined;
/** 切换状态 */
toggle: (key: keyof Pick<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}, "freeze" | "lock" | "print" | "visible">, i?: number | number[] | Ref) => boolean | (boolean | undefined)[] | undefined;
/** 设置值 */
setValue: (key: "id" | "color" | "name" | "lineWeight" | "visible" | "lineType" | "freeze" | "lock" | "print" | "status", v: string | number | boolean | {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
} | (string | number | boolean | {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
})[] | Ref, i?: number | number[] | Ref, isSave?: boolean) => (string | number | boolean | {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
})[];
/** 置于当前状态 */
putCurrent: (val?: {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | number, isSave?: boolean) => void;
parseJSON: (jsonText?: string) => void;
stringifyJSON: () => string;
initLayerList: () => void;
initCurrentLayer: (layerName?: string) => void;
setLayerList: (jsonText: string) => Promise;
/** 恢复图层状态记录 */
recoveryLayerStateHistory: () => void;
/** 是否选中 */
isSelected: (i: number) => boolean;
}, "index" | "list" | "currentLayer">, Pick<{
/** 数据列表 */
list: Ref<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[], {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[] | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[]>;
/** 选中索引 */
index: Ref;
currentLayer: Ref<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | undefined, {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | undefined>;
/** 根ID */
rootId: ComputedRef;
/** 设置索引 */
setIndex: (i: number | number[] | Ref) => void;
getIndex: (_index?: ({
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[] | Ref<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[], {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[]>) | (number | number[] | Ref)) => number | number[];
/** 添加 */
add: (layerItem?: {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}) => {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
};
/** 创建 */
create: (options?: Partial<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}>) => {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
};
/** 删除 */
remove: (layers?: number | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | (number | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
})[] | Ref, type?: "index" | "id" | "this") => {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[] | undefined;
/** 切换状态 */
toggle: (key: keyof Pick<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}, "freeze" | "lock" | "print" | "visible">, i?: number | number[] | Ref) => boolean | (boolean | undefined)[] | undefined;
/** 设置值 */
setValue: (key: "id" | "color" | "name" | "lineWeight" | "visible" | "lineType" | "freeze" | "lock" | "print" | "status", v: string | number | boolean | {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
} | (string | number | boolean | {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
})[] | Ref, i?: number | number[] | Ref, isSave?: boolean) => (string | number | boolean | {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
})[];
/** 置于当前状态 */
putCurrent: (val?: {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | number, isSave?: boolean) => void;
parseJSON: (jsonText?: string) => void;
stringifyJSON: () => string;
initLayerList: () => void;
initCurrentLayer: (layerName?: string) => void;
setLayerList: (jsonText: string) => Promise;
/** 恢复图层状态记录 */
recoveryLayerStateHistory: () => void;
/** 是否选中 */
isSelected: (i: number) => boolean;
}, "rootId">, Pick<{
/** 数据列表 */
list: Ref<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[], {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[] | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[]>;
/** 选中索引 */
index: Ref;
currentLayer: Ref<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | undefined, {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | undefined>;
/** 根ID */
rootId: ComputedRef;
/** 设置索引 */
setIndex: (i: number | number[] | Ref) => void;
getIndex: (_index?: ({
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[] | Ref<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[], {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[]>) | (number | number[] | Ref)) => number | number[];
/** 添加 */
add: (layerItem?: {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}) => {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
};
/** 创建 */
create: (options?: Partial<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}>) => {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
};
/** 删除 */
remove: (layers?: number | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | (number | {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
})[] | Ref, type?: "index" | "id" | "this") => {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}[] | undefined;
/** 切换状态 */
toggle: (key: keyof Pick<{
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
}, "freeze" | "lock" | "print" | "visible">, i?: number | number[] | Ref) => boolean | (boolean | undefined)[] | undefined;
/** 设置值 */
setValue: (key: "id" | "color" | "name" | "lineWeight" | "visible" | "lineType" | "freeze" | "lock" | "print" | "status", v: string | number | boolean | {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
} | (string | number | boolean | {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
})[] | Ref, i?: number | number[] | Ref, isSave?: boolean) => (string | number | boolean | {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
} | {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
})[];
/** 置于当前状态 */
putCurrent: (val?: {
id: number;
name: string;
visible: boolean;
freeze: boolean;
lock: boolean;
print: boolean;
status: boolean;
color: {
color: string;
name: string;
index: ColorIndex;
method: ColorMethod;
n: number;
};
lineType: {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
lineWeight: McDb.LineWeight;
} | number, isSave?: boolean) => void;
parseJSON: (jsonText?: string) => void;
stringifyJSON: () => string;
initLayerList: () => void;
initCurrentLayer: (layerName?: string) => void;
setLayerList: (jsonText: string) => Promise;
/** 恢复图层状态记录 */
recoveryLayerStateHistory: () => void;
/** 是否选中 */
isSelected: (i: number) => boolean;
}, "add" | "toggle" | "setIndex" | "putCurrent" | "remove" | "getIndex" | "create" | "setValue" | "parseJSON" | "stringifyJSON" | "initLayerList" | "initCurrentLayer" | "setLayerList" | "recoveryLayerStateHistory" | "isSelected">>;
declare const useLineType: StoreDefinition<"lineType", Pick<{
initLineTypeList: () => void;
createLineType: (options?: Partial) => {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
parseJSONLineType: (jsonLineType: JSONLineType) => {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
stringifyJSONLineType: (lineType: LineType) => void;
lineTypeList: Ref<{
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
}[], LineType[] | {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
}[]>;
currentLineType: Ref;
}, "lineTypeList" | "currentLineType">, Pick<{
initLineTypeList: () => void;
createLineType: (options?: Partial) => {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
parseJSONLineType: (jsonLineType: JSONLineType) => {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
stringifyJSONLineType: (lineType: LineType) => void;
lineTypeList: Ref<{
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
}[], LineType[] | {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
}[]>;
currentLineType: Ref;
}, never>, Pick<{
initLineTypeList: () => void;
createLineType: (options?: Partial) => {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
parseJSONLineType: (jsonLineType: JSONLineType) => {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
};
stringifyJSONLineType: (lineType: LineType) => void;
lineTypeList: Ref<{
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
}[], LineType[] | {
name: string;
explain: string;
appearance: string;
id: number;
value?: null | string | undefined;
}[]>;
currentLineType: Ref;
}, "initLineTypeList" | "createLineType" | "parseJSONLineType" | "stringifyJSONLineType">>;
export { }
/**
* plugins/howdyjs
*
* @@howdyjs documentation: https://github.com/leon-kfd/howdyjs
* doc: https://kongfandong.cn/howdy/
* @howdyjs/mouse-menu 指令式右键菜单组件
* @howdyjs/resize 拖拽更改元素尺寸插件
*/
declare module '@howdyjs/to-drag' {
interface ToDragEvent {
[key: string]: any;
}
}
declare module '@tiptap/core' {
interface Commands {
TextDecoration: {
/**
* Set the font size attribute
*/
setTextDecoration: (textDecoration: string) => ReturnType;
/**
* Unset the font size attribute
*/
unsetTextDecoration: () => ReturnType;
};
}
}
declare module "@tiptap/core" {
interface Commands {
selectedText: {
setSelectedText: (from: number, to: number) => ReturnType;
unsetSelectedText: (from: number, to: number) => ReturnType;
};
}
}
declare module '@tiptap/core' {
interface Commands {
Strike: {
/**
* Set the font size attribute
*/
setStrike: () => ReturnType;
/**
* Unset the font size attribute
*/
unsetStrike: () => ReturnType;
toggleStrike: () => ReturnType;
};
}
}
declare module '@tiptap/core' {
interface Commands {
Underline: {
setUnderline: () => ReturnType;
unsetUnderline: () => ReturnType;
toggleUnderline: () => ReturnType;
};
}
}
declare module '@tiptap/core' {
interface Commands {
Overline: {
/**
* Set the font size attribute
*/
setOverline: () => ReturnType;
/**
* Unset the font size attribute
*/
unsetOverline: () => ReturnType;
toggleOverline: () => ReturnType;
};
}
}
declare module '@tiptap/core' {
interface Commands {
fontSize: {
/**
* Set the font size attribute
*/
setFontSize: (size: string) => ReturnType;
/**
* Unset the font size attribute
*/
unsetFontSize: () => ReturnType;
};
}
}