clickgo 7.3.2 → 7.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -819,18 +819,28 @@ export interface IFabricObjectchangeEvent {
819
819
  'height': number;
820
820
  };
821
821
  }
822
- export interface IObjviewerLine {
823
- /** -- 可自定义线段的名称 --- */
824
- 'name'?: string;
825
- 'start': clickgo.control.IObjviewerLineObj;
826
- 'end': clickgo.control.IObjviewerLineObj;
827
- /** --- 默认 255 --- */
828
- 'hue'?: string;
829
- 'path'?: string;
830
- /** --- 默认 solid --- */
831
- 'stroke'?: 'solid' | 'dashed' | 'up' | 'down';
832
- }
833
- export interface IObjviewerLineObj {
834
- 'obj': HTMLElement | AbstractControl;
835
- 'pos': 'lt' | 't' | 'tr' | 'r' | 'rb' | 'b' | 'bl' | 'l';
822
+ /** --- 节点和连接的语义状态,不依赖主题的具体颜色 --- */
823
+ export type TObjviewerStatus = 'default' | 'online' | 'warning' | 'offline';
824
+ /** --- 按稳定节点 ID 声明的连接,节点暂不存在时不绘制,不保存 DOM 引用 --- */
825
+ export interface IObjviewerEdge {
826
+ 'source': string;
827
+ 'target': string;
828
+ 'label'?: string;
829
+ /** --- 默认 default,连接状态由应用明确提供 --- */
830
+ 'status'?: TObjviewerStatus;
831
+ /** --- 默认 none,dash 为流动虚线,dots 为静止底线上的移动圆点 --- */
832
+ 'animation'?: 'none' | 'dash' | 'dots';
833
+ /** --- 默认 forward,沿 source 到 target;reverse 反向,both 双向 --- */
834
+ 'direction'?: 'forward' | 'reverse' | 'both';
835
+ /** --- 动画周期,单位秒,默认 3,限制为 0.25–60;dots 为走完整条路径的时间 --- */
836
+ 'duration'?: number;
837
+ /** --- dots 模式每个方向的圆点数,默认 3,取整并限制为 1–8 --- */
838
+ 'dotCount'?: number;
839
+ }
840
+ /** --- 节点选择事件,仅通知选择,不在控件内执行业务跳转 --- */
841
+ export interface IObjviewerSelectEvent {
842
+ 'detail': {
843
+ 'nodeId': string;
844
+ 'label': string;
845
+ };
836
846
  }
@@ -21,19 +21,33 @@ export type { TTextEncoding, ITextEncoding, IDecodedText } from './tool/encoding
21
21
  * @returns 模块对象
22
22
  */
23
23
  export declare function runIife(code: string): any;
24
- /**
25
- * --- 压缩一个图片 ---
26
- * @param file 文件或 blob 类型 ---
27
- * @param options 参数
28
- */
29
- export declare function compressor<T extends File | Blob>(file: T, options?: {
24
+ /** --- 图片压缩参数,未指定大小上限时仅使用第一档质量 --- */
25
+ export interface ICompressorOptions {
30
26
  /** --- 最大宽度,默认无限 --- */
31
27
  'maxWidth'?: number;
32
28
  /** --- 最高高度,默认无限 --- */
33
29
  'maxHeight'?: number;
34
- /** --- 压缩质量,默认 0.8 --- */
35
- 'quality'?: number;
36
- }): Promise<T | false>;
30
+ /** --- 编码质量,取值 0 至 1,默认 0.8;数组按顺序尝试,仅 JPEG/WebP 支持调节质量 --- */
31
+ 'quality'?: number | readonly number[];
32
+ /** --- 输出格式,默认 auto 保留压缩器的自动选择;JPEG 的透明区域填白 --- */
33
+ 'mimeType'?: 'auto' | 'image/jpeg' | 'image/png' | 'image/webp';
34
+ /** --- 文件大小上限,单位字节,须为正有限数;各档都超限时返回 false,不再额外缩小尺寸或降质 --- */
35
+ 'maxSize'?: number;
36
+ }
37
+ /**
38
+ * --- 压缩图片,质量降档复用同一画布,保留方向校正及等比缩放 ---
39
+ * @param file 图片文件或 Blob;File 输入返回 File,转换格式时同步扩展名和 MIME 类型
40
+ * @param options 压缩参数
41
+ * @returns 压缩后的图片;参数无效、加载或编码失败、指定格式不受支持或无法满足大小上限时返回 false
42
+ * @example
43
+ * const image = await clickgo.tool.compressor(file, {
44
+ * 'mimeType': 'image/jpeg',
45
+ * 'maxWidth': 2000,
46
+ * 'quality': [0.9, 0.6, 0.5],
47
+ * 'maxSize': 2 * 1024 * 1024,
48
+ * });
49
+ */
50
+ export declare function compressor<T extends File | Blob>(file: T, options?: ICompressorOptions): Promise<T | false>;
37
51
  /** --- 类原型信息 --- */
38
52
  export interface IClassPrototype {
39
53
  /** --- 方法列表,key 为方法名,value 为函数体,例如:{'method1': function() { ... }} --- */
Binary file
Binary file