@glowjs/core 2022.6.21

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.
Files changed (158) hide show
  1. package/README.md +3 -0
  2. package/dist/glow.core.js +1 -0
  3. package/dist/typings/base/Base.d.ts +24 -0
  4. package/dist/typings/base/IDisposable.d.ts +9 -0
  5. package/dist/typings/camera/CameraCacheData.d.ts +21 -0
  6. package/dist/typings/camera/CameraMgr.d.ts +320 -0
  7. package/dist/typings/camera/CameraMode.d.ts +13 -0
  8. package/dist/typings/camera/CameraPerson.d.ts +13 -0
  9. package/dist/typings/camera/CustomArcRotateCameraKeyboardMoveInput.d.ts +28 -0
  10. package/dist/typings/camera/CustomArcRotateCameraMouseWheelInput.d.ts +17 -0
  11. package/dist/typings/camera/FlyData.d.ts +29 -0
  12. package/dist/typings/camera/OrthographicView.d.ts +17 -0
  13. package/dist/typings/core/App.d.ts +139 -0
  14. package/dist/typings/core/AppOptions.d.ts +29 -0
  15. package/dist/typings/core/Size.d.ts +13 -0
  16. package/dist/typings/core/create.d.ts +9 -0
  17. package/dist/typings/core/version.d.ts +1 -0
  18. package/dist/typings/effect/ColorCorrection.d.ts +129 -0
  19. package/dist/typings/effect/EffectMgr.d.ts +62 -0
  20. package/dist/typings/effect/EnvironmentTexture.d.ts +36 -0
  21. package/dist/typings/effect/EnvironmentTextureSource.d.ts +25 -0
  22. package/dist/typings/effect/Fog.d.ts +43 -0
  23. package/dist/typings/effect/FogMode.d.ts +21 -0
  24. package/dist/typings/effect/Glow.d.ts +43 -0
  25. package/dist/typings/effect/HighLight.d.ts +48 -0
  26. package/dist/typings/effect/ImageProcessing.d.ts +48 -0
  27. package/dist/typings/effect/Light.d.ts +20 -0
  28. package/dist/typings/effect/SkyBox.d.ts +59 -0
  29. package/dist/typings/effect/SkyBoxSource.d.ts +37 -0
  30. package/dist/typings/effect/ToneMappingType.d.ts +13 -0
  31. package/dist/typings/entity/Building.d.ts +104 -0
  32. package/dist/typings/entity/Campus.d.ts +35 -0
  33. package/dist/typings/entity/Corner.d.ts +43 -0
  34. package/dist/typings/entity/DoorWindow.d.ts +77 -0
  35. package/dist/typings/entity/DoorWindowDirection.d.ts +21 -0
  36. package/dist/typings/entity/Entity.d.ts +346 -0
  37. package/dist/typings/entity/EntityType.d.ts +65 -0
  38. package/dist/typings/entity/Floor.d.ts +108 -0
  39. package/dist/typings/entity/Group.d.ts +38 -0
  40. package/dist/typings/entity/LeakLine.d.ts +45 -0
  41. package/dist/typings/entity/LevelMgr.d.ts +89 -0
  42. package/dist/typings/entity/ManualWall.d.ts +81 -0
  43. package/dist/typings/entity/ManualWallBuilder.d.ts +157 -0
  44. package/dist/typings/entity/MeshFaceData.d.ts +25 -0
  45. package/dist/typings/entity/OtherEntity.d.ts +20 -0
  46. package/dist/typings/entity/Path.d.ts +45 -0
  47. package/dist/typings/entity/PrefabWall.d.ts +57 -0
  48. package/dist/typings/entity/Room.d.ts +162 -0
  49. package/dist/typings/entity/Text3D.d.ts +62 -0
  50. package/dist/typings/entity/Thing.d.ts +121 -0
  51. package/dist/typings/entity/ViewInfo.d.ts +13 -0
  52. package/dist/typings/entity/Wall.d.ts +95 -0
  53. package/dist/typings/entity/component/Animator.d.ts +45 -0
  54. package/dist/typings/entity/component/AutoOpenDoor.d.ts +23 -0
  55. package/dist/typings/entity/component/Component.d.ts +17 -0
  56. package/dist/typings/entity/component/PathAnimation.d.ts +47 -0
  57. package/dist/typings/entity/component/Style.d.ts +65 -0
  58. package/dist/typings/entity/component/cabinet/BoardCard.d.ts +62 -0
  59. package/dist/typings/entity/component/cabinet/Cabinet.d.ts +22 -0
  60. package/dist/typings/entity/component/cabinet/NetworkPort.d.ts +46 -0
  61. package/dist/typings/entity/component/cabinet/RackMounted.d.ts +91 -0
  62. package/dist/typings/entity/component/heatmap/Heatmap.d.ts +52 -0
  63. package/dist/typings/entity/component/heatmap/HeatmapType.d.ts +17 -0
  64. package/dist/typings/entity/component/heatmap/buildHorizontal.d.ts +6 -0
  65. package/dist/typings/entity/component/heatmap/buildVertical.d.ts +6 -0
  66. package/dist/typings/entity/component/roaming/Roaming.d.ts +83 -0
  67. package/dist/typings/entity/component/roaming/pencil.d.ts +1 -0
  68. package/dist/typings/entity/placement.d.ts +20 -0
  69. package/dist/typings/entity/util/createManualWallEdgeMaterial.d.ts +8 -0
  70. package/dist/typings/entity/util/createManualWallFaceMaterial.d.ts +8 -0
  71. package/dist/typings/entity/util/createManualWallMesh.d.ts +12 -0
  72. package/dist/typings/entity/util/createMergedMesh.d.ts +13 -0
  73. package/dist/typings/entity/util/createPathArrowIcon.d.ts +4 -0
  74. package/dist/typings/entity/util/createPathCircleIcon.d.ts +4 -0
  75. package/dist/typings/entity/util/createRoomMaterial.d.ts +3 -0
  76. package/dist/typings/entity/util/createRoomMesh.d.ts +14 -0
  77. package/dist/typings/entity/util/getPerWeight.d.ts +6 -0
  78. package/dist/typings/entity/util/setRes.d.ts +5 -0
  79. package/dist/typings/entity/util/technologyBuildingMaterial.d.ts +67 -0
  80. package/dist/typings/event/EventArg.d.ts +14 -0
  81. package/dist/typings/event/EventDispatcher.d.ts +67 -0
  82. package/dist/typings/event/EventMgr.d.ts +102 -0
  83. package/dist/typings/event/EventObject.d.ts +26 -0
  84. package/dist/typings/event/EventType.d.ts +161 -0
  85. package/dist/typings/event/KeyCode.d.ts +54 -0
  86. package/dist/typings/event/PropertyChangedData.d.ts +21 -0
  87. package/dist/typings/gui/Billboard.d.ts +94 -0
  88. package/dist/typings/gui/BillboardOptions.d.ts +62 -0
  89. package/dist/typings/gui/FPSBar.d.ts +25 -0
  90. package/dist/typings/gui/GUIMgr.d.ts +41 -0
  91. package/dist/typings/gui/GradientRectangle.d.ts +57 -0
  92. package/dist/typings/gui/PerformancePanel.d.ts +41 -0
  93. package/dist/typings/gui/RectangleProgress.d.ts +20 -0
  94. package/dist/typings/gui/ToolTip.d.ts +24 -0
  95. package/dist/typings/index.d.ts +63 -0
  96. package/dist/typings/material/MaterialMgr.d.ts +18 -0
  97. package/dist/typings/misc/Point2D.d.ts +4 -0
  98. package/dist/typings/misc/Point3D.d.ts +4 -0
  99. package/dist/typings/misc/Point4D.d.ts +4 -0
  100. package/dist/typings/misc/SystemResId.d.ts +89 -0
  101. package/dist/typings/misc/blobToDataURL.d.ts +5 -0
  102. package/dist/typings/misc/cookie.d.ts +17 -0
  103. package/dist/typings/misc/dataURLtoBlob.d.ts +5 -0
  104. package/dist/typings/misc/getQueryString.d.ts +5 -0
  105. package/dist/typings/misc/guid.d.ts +21 -0
  106. package/dist/typings/misc/http.d.ts +46 -0
  107. package/dist/typings/misc/index.d.ts +15 -0
  108. package/dist/typings/misc/isHexColor.d.ts +5 -0
  109. package/dist/typings/misc/isLAN.d.ts +4 -0
  110. package/dist/typings/misc/math/Line.d.ts +5 -0
  111. package/dist/typings/misc/math/Point.d.ts +7 -0
  112. package/dist/typings/misc/math/compare/EPSILON.d.ts +4 -0
  113. package/dist/typings/misc/math/compare/greateThanOrEqual.d.ts +8 -0
  114. package/dist/typings/misc/math/compare/greaterThan.d.ts +7 -0
  115. package/dist/typings/misc/math/compare/lessThan.d.ts +7 -0
  116. package/dist/typings/misc/math/compare/lessThanOrEqual.d.ts +7 -0
  117. package/dist/typings/misc/math/compare/withinEpsilon.d.ts +9 -0
  118. package/dist/typings/misc/math/index.d.ts +34 -0
  119. package/dist/typings/misc/math/line/distanceToParallelLine.d.ts +7 -0
  120. package/dist/typings/misc/math/line/distanceToProjection.d.ts +8 -0
  121. package/dist/typings/misc/math/line/getLineIntersection.d.ts +9 -0
  122. package/dist/typings/misc/math/line/isLineParallel.d.ts +7 -0
  123. package/dist/typings/misc/math/line/project.d.ts +8 -0
  124. package/dist/typings/misc/math/line/relateToPoint.d.ts +8 -0
  125. package/dist/typings/misc/math/round.d.ts +6 -0
  126. package/dist/typings/misc/math/segment/getSegmentIntersection.d.ts +8 -0
  127. package/dist/typings/misc/math/segment/getSegmentPartIncludePoint.d.ts +8 -0
  128. package/dist/typings/misc/math/segment/onSegment.d.ts +8 -0
  129. package/dist/typings/misc/math/segment/segmentFullInclude.d.ts +8 -0
  130. package/dist/typings/misc/math/vec/addTo.d.ts +7 -0
  131. package/dist/typings/misc/math/vec/angleTo.d.ts +7 -0
  132. package/dist/typings/misc/math/vec/centerTo.d.ts +7 -0
  133. package/dist/typings/misc/math/vec/cross.d.ts +7 -0
  134. package/dist/typings/misc/math/vec/distanceTo.d.ts +7 -0
  135. package/dist/typings/misc/math/vec/dot.d.ts +7 -0
  136. package/dist/typings/misc/math/vec/ignoreYAxis.d.ts +7 -0
  137. package/dist/typings/misc/math/vec/lengthTo.d.ts +6 -0
  138. package/dist/typings/misc/math/vec/multiplyTo.d.ts +7 -0
  139. package/dist/typings/misc/math/vec/normalizeTo.d.ts +6 -0
  140. package/dist/typings/misc/math/vec/scaleTo.d.ts +7 -0
  141. package/dist/typings/misc/math/vec/subtractTo.d.ts +7 -0
  142. package/dist/typings/misc/math/vec/toPoint.d.ts +8 -0
  143. package/dist/typings/misc/math/vec/toVector3.d.ts +7 -0
  144. package/dist/typings/misc/math/vec/verticalVector.d.ts +7 -0
  145. package/dist/typings/misc/object.d.ts +16 -0
  146. package/dist/typings/misc/to.d.ts +5 -0
  147. package/dist/typings/res/ResCacheData.d.ts +14 -0
  148. package/dist/typings/res/ResOptions.d.ts +38 -0
  149. package/dist/typings/res/ResPool.d.ts +57 -0
  150. package/dist/typings/res/replaceInstancedMesh.d.ts +6 -0
  151. package/dist/typings/runtime/RunTime.d.ts +119 -0
  152. package/dist/typings/runtime/babylonjs/babylonjs-core.d.ts +73 -0
  153. package/dist/typings/runtime/babylonjs/babylonjs-gui.d.ts +12 -0
  154. package/dist/typings/runtime/babylonjs/babylonjs-loaders.d.ts +1 -0
  155. package/dist/typings/runtime/babylonjs/babylonjs-materials.d.ts +1 -0
  156. package/dist/typings/runtime/index.d.ts +7 -0
  157. package/dist/typings/runtime/tweenjs/index.d.ts +1 -0
  158. package/package.json +71 -0
@@ -0,0 +1,24 @@
1
+ import { Rectangle } from '../runtime';
2
+ import { App } from '../core/App';
3
+ /**
4
+ * 提示信息
5
+ */
6
+ export declare class ToolTip extends Rectangle {
7
+ private static _root;
8
+ private _textBlock;
9
+ /**
10
+ * 应用
11
+ */
12
+ app: App;
13
+ /**
14
+ * 实例化一个提示信息对象
15
+ * @param app 应用
16
+ */
17
+ constructor(app: App);
18
+ /**
19
+ * 获取或设置文本
20
+ */
21
+ get text(): string;
22
+ set text(value: string);
23
+ private _onFrameUpdate;
24
+ }
@@ -0,0 +1,63 @@
1
+ export * from './runtime';
2
+ export { Base } from './base/Base';
3
+ export { Entity } from './entity/Entity';
4
+ export type { IDisposable } from './base/IDisposable';
5
+ export type { ViewInfo } from './entity/ViewInfo';
6
+ export { CameraMgr } from './camera/CameraMgr';
7
+ export type { FlyData } from './camera/FlyData';
8
+ export { CameraMode } from './camera/CameraMode';
9
+ export { CameraPerson } from './camera/CameraPerson';
10
+ export { OrthographicView } from './camera/OrthographicView';
11
+ export { App } from './core/App';
12
+ export type { AppOptions } from './core/AppOptions';
13
+ export type { Size } from './core/Size';
14
+ export { ColorCorrection } from './effect/ColorCorrection';
15
+ export { EffectMgr } from './effect/EffectMgr';
16
+ export { EnvironmentTextureSource } from './effect/EnvironmentTextureSource';
17
+ export { SkyBoxSource } from './effect/SkyBoxSource';
18
+ export type { EventArg } from './event/EventArg';
19
+ export { EventDispatcher } from './event/EventDispatcher';
20
+ export { EventMgr } from './event/EventMgr';
21
+ export type { EventObject } from './event/EventObject';
22
+ export { EventType } from './event/EventType';
23
+ export type { PropertyChangedData } from './event/PropertyChangedData';
24
+ export { KeyCode } from './event/KeyCode';
25
+ export { Billboard } from './gui/Billboard';
26
+ export type { BillboardOptions } from './gui/BillboardOptions';
27
+ export { FPSBar } from './gui/FPSBar';
28
+ export { GUIMgr } from './gui/GUIMgr';
29
+ export { GradientRectangle } from './gui/GradientRectangle';
30
+ export { RectangleProgress } from './gui/RectangleProgress';
31
+ export { Building } from './entity/Building';
32
+ export { Campus } from './entity/Campus';
33
+ export { LevelMgr } from './entity/LevelMgr';
34
+ export { Corner } from './entity/Corner';
35
+ export { DoorWindow } from './entity/DoorWindow';
36
+ export { Floor } from './entity/Floor';
37
+ export { ManualWall } from './entity/ManualWall';
38
+ export { PrefabWall } from './entity/PrefabWall';
39
+ export { Room } from './entity/Room';
40
+ export { Wall } from './entity/Wall';
41
+ export { LeakLine } from './entity/LeakLine';
42
+ export { Text3D } from './entity/Text3D';
43
+ export * from './entity/placement';
44
+ export { EntityType } from './entity/EntityType';
45
+ export { DoorWindowDirection } from './entity/DoorWindowDirection';
46
+ export { Path } from './entity/Path';
47
+ export { Component } from './entity/component/Component';
48
+ export { Style } from './entity/component/Style';
49
+ export { Animator } from './entity/component/Animator';
50
+ export { Heatmap } from './entity/component/heatmap/Heatmap';
51
+ export { HeatmapType } from './entity/component/heatmap/HeatmapType';
52
+ export { PathAnimation } from './entity/component/PathAnimation';
53
+ export { Roaming } from './entity/component/roaming/Roaming';
54
+ export { Cabinet } from './entity/component/cabinet/Cabinet';
55
+ export { RackMounted } from './entity/component/cabinet/RackMounted';
56
+ export { BoardCard } from './entity/component/cabinet/BoardCard';
57
+ export { NetworkPort } from './entity/component/cabinet/NetworkPort';
58
+ export { MaterialMgr } from './material/MaterialMgr';
59
+ export { Group } from './entity/Group';
60
+ export { Thing } from './entity/Thing';
61
+ export { ResPool } from './res/ResPool';
62
+ export type { ResOptions } from './res/ResOptions';
63
+ export * from './misc';
@@ -0,0 +1,18 @@
1
+ import { NodeMaterial } from '../runtime';
2
+ import { Base } from '../base/Base';
3
+ import { App } from '../core/App';
4
+ /**
5
+ * 材质管理器
6
+ */
7
+ export declare class MaterialMgr extends Base {
8
+ /**
9
+ * 实例化一个材质管理器对象
10
+ * @param app 应用对象
11
+ */
12
+ constructor(app: App);
13
+ /**
14
+ * 创建节点材质
15
+ * @param fileName 文件名称
16
+ */
17
+ createNodeMaterial(fileName: string): Promise<NodeMaterial>;
18
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 二维点
3
+ */
4
+ export declare type Point2D = [number, number];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 三维点
3
+ */
4
+ export declare type Point3D = [number, number, number];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 四维点
3
+ */
4
+ export declare type Point4D = [number, number, number, number];
@@ -0,0 +1,89 @@
1
+ /**
2
+ * 系统内置资源ID枚举
3
+ */
4
+ export declare enum SystemResId {
5
+ /**
6
+ * 自定义建筑
7
+ */
8
+ CustomBuilding = "939abce2ec996ceb17190ba2915229d2",
9
+ /**
10
+ * 普通墙
11
+ */
12
+ ManualWall = "05bb16a31bb5e03d5f8fca9d2c9bfa7c",
13
+ /**
14
+ * 3D文本
15
+ */
16
+ Text = "b9d2a3e98a044d828241a55674d12fb3",
17
+ /**
18
+ * 圈地(无框)
19
+ */
20
+ Wall = "a4fd143c58ea17e7aeb20dab344c0231",
21
+ /**
22
+ * 普通墙贴图
23
+ */
24
+ ManualWallTexture = "2b0577a52d55cfe05b83f3392dba9cac",
25
+ /**
26
+ * 科技风
27
+ */
28
+ TechnologyManualWallTexture = "725c7996b1978d0bd1484d551d777e58",
29
+ /**
30
+ * 普通墙阴影贴图
31
+ */
32
+ ManualWallShadowTexture = "6d0a5fc8ee1e932ede4556e5918dc4fe",
33
+ /**
34
+ * 普通墙边缘贴图
35
+ */
36
+ ManualWallEdgeTexture = "962b0f041db1dbac633331e662c2182c",
37
+ /**
38
+ * 默认楼顶贴图
39
+ */
40
+ DefaultRoofTexture = "430eab360b8a4e371d1fb62ba2dfae9b",
41
+ /**
42
+ * 默认天花板贴图
43
+ */
44
+ DefaultCeilingTexture = "bd68f59792c7af353b47b68eeb43b36c",
45
+ /**
46
+ * 默认地板贴图
47
+ */
48
+ DefaultFloorTexture = "5e57fc77091c1445c44c17c770ff2dcd",
49
+ /**
50
+ * 科技风地板贴图
51
+ */
52
+ TechnologyFloorTexture = "3743334a2ed2df2ad6e2a2f221f87e58",
53
+ /**
54
+ * 漏水线贴图
55
+ */
56
+ LeakLineTexture = "bc17b3c748934e2e3a4a71095a2164bd",
57
+ /**
58
+ * 漏水线
59
+ */
60
+ LeakLine = "23bbbdc49de5e85d7db29b7e78097557",
61
+ /**
62
+ * 热力图材质
63
+ */
64
+ HeatmapMaterial = "8b103036eb2573bcd08348a58adc5ded",
65
+ /**
66
+ * 热力图烟雾贴图
67
+ */
68
+ HeatmapSmokeTexture = "42656a9c6ff1fb39bc10c4395c94b01c",
69
+ /**
70
+ * 场景漫游人物
71
+ */
72
+ SceneRoamingMan = "fa9c8432405a757bf3dcdd13d93976a3",
73
+ /**
74
+ * 路径
75
+ */
76
+ Path = "fb5819545e6e92a24c417eb95e0f6a3a",
77
+ /**
78
+ * 数据点位
79
+ */
80
+ DataPoint = "7cb64f7ab6119aba1233605791776c78",
81
+ /**
82
+ * 链接
83
+ */
84
+ Link = "36ada31beac6807eef7bcddc12ddb5f3",
85
+ /**
86
+ * 网口
87
+ */
88
+ NetworkPort = "cf1a7ec6257196ca660298ec798ebba5"
89
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Blob转BASE64
3
+ * @param blob Blob
4
+ */
5
+ export declare function blobToDataURL(blob: Blob): Promise<string>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * 设置Cookie
3
+ * @param {string} key 键
4
+ * @param {string} value 值
5
+ * @param {number} minutes 过期时间(分钟)
6
+ */
7
+ export declare function setCookie(key: string, value: string, minutes: number): void;
8
+ /**
9
+ * 获取指定键的Cookie
10
+ * @param {string} key 键
11
+ */
12
+ export declare function getCookie(key: string): string;
13
+ /**
14
+ * 删除指定的键
15
+ * @param {string} key 键
16
+ */
17
+ export declare function delCookie(key: string): void;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * BASE64转Blob
3
+ * @param dataURL BASE64字符串
4
+ */
5
+ export declare function dataURLtoBlob(dataURL: string): Blob;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 获取URL指定名称的参数值
3
+ * @param name 参数名称
4
+ */
5
+ export declare function getQueryString(name: string): string;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 生成一个指定长度的GUID字符串
3
+ * @param length 长度
4
+ * @returns GUID字符串
5
+ */
6
+ export declare function newGuid(length: number): string;
7
+ /**
8
+ * 生成一个8位长度的GUID字符串
9
+ * @returns GUID字符串
10
+ */
11
+ export declare function newGuid8(): string;
12
+ /**
13
+ * 生成一个16位长度的GUID字符串
14
+ * @returns GUID字符串
15
+ */
16
+ export declare function newGuid16(): string;
17
+ /**
18
+ * 生成一个32位长度的GUID字符串
19
+ * @returns GUID字符串
20
+ */
21
+ export declare function newGuid32(): string;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * AJAX
3
+ * @param method HTTP请求的方法
4
+ * @param url URL地址
5
+ * @param data 发送的数据,可以是字符串或者表单数据
6
+ * @param arraybuffer 是否返回二进制
7
+ * @param onProgress 进度回调函数,函数参数为0~100之间的数值
8
+ */
9
+ export declare function ajax(method: 'GET' | 'POST', url: string, data?: string | FormData, arraybuffer?: boolean, onProgress?: (progress: number) => void): Promise<string | ArrayBuffer | undefined>;
10
+ /**
11
+ * 发送HTTP GET请求,返回文本或二进制数据
12
+ * @param url URL地址
13
+ * @param arraybuffer 是否返回二进制
14
+ * @param onProgress 进度回调函数,函数参数为0~100之间的数值
15
+ */
16
+ export declare function get(url: string, arraybuffer?: boolean, onProgress?: (progress: number) => void): Promise<string | ArrayBuffer | undefined>;
17
+ /**
18
+ * 发送HTTP GET请求,返回JSON对象
19
+ * @param url URL地址
20
+ * @param onProgress 进度回调函数,函数参数为0~100之间的数值
21
+ */
22
+ export declare function getJson(url: string, onProgress?: (progress: number) => void): Promise<string | undefined>;
23
+ /**
24
+ * 发送HTTP POST请求,返回文本或二进制数据
25
+ * @param url URL地址
26
+ * @param data 数据,可以是字符串或者表单数据
27
+ * @param arraybuffer 是否返回二进制
28
+ * @param onProgress 进度回调函数,函数参数为0~100之间的数值
29
+ */
30
+ export declare function post(url: string, data: string | FormData, arraybuffer?: boolean, onProgress?: (progress: number) => void): Promise<string | ArrayBuffer | undefined>;
31
+ /**
32
+ * HTTP POST上传单个文件
33
+ * @param url URL地址
34
+ * @param fileData 文件数据
35
+ * @param arraybuffer 是否返回二进制
36
+ * @param onProgress 进度回调函数,函数参数为0~100之间的数值
37
+ */
38
+ export declare function postFile(url: string, fileData: any, arraybuffer?: boolean, onProgress?: (progress: number) => void): Promise<string | ArrayBuffer | undefined>;
39
+ /**
40
+ * HTTP POST上传多个文件
41
+ * @param url URL地址
42
+ * @param fileDatas 文件数据数组
43
+ * @param arraybuffer 是否返回二进制
44
+ * @param onProgress 进度回调函数,函数参数为0~100之间的数值
45
+ */
46
+ export declare function postFiles(url: string, fileDatas: any[], arraybuffer?: boolean, onProgress?: (progress: number) => void): Promise<string | ArrayBuffer | undefined>;
@@ -0,0 +1,15 @@
1
+ export * from './blobToDataURL';
2
+ export * from './cookie';
3
+ export * from './dataURLtoBlob';
4
+ export * from './getQueryString';
5
+ export * from './guid';
6
+ export * from './http';
7
+ export * from './isHexColor';
8
+ export * from './isLAN';
9
+ export * from './object';
10
+ export * from './Point2D';
11
+ export * from './Point3D';
12
+ export * from './Point4D';
13
+ export * from './SystemResId';
14
+ export * from './to';
15
+ export * from './math';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 判断是否是有效的十六进制颜色
3
+ * @param value
4
+ */
5
+ export declare function isHexColor(value: string): boolean;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 是否是局域网
3
+ */
4
+ export declare function isLAN(): boolean;
@@ -0,0 +1,5 @@
1
+ import { Point } from './Point';
2
+ /**
3
+ * 直线或线段
4
+ */
5
+ export declare type Line = [Point, Point];
@@ -0,0 +1,7 @@
1
+ import { Vector2, Vector3 } from '../../runtime';
2
+ import { Point2D } from '../Point2D';
3
+ import { Point3D } from '../Point3D';
4
+ /**
5
+ * 点
6
+ */
7
+ export declare type Point = Point2D | Point3D | Vector2 | Vector3;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 默认精度
3
+ */
4
+ export declare const EPSILON: number;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 判断数字a是否大于或等于b
3
+ * @param a 数字a
4
+ * @param b 数字b
5
+ * @param epsilon 精度,默认值0.0001
6
+ * @returns 布尔值
7
+ */
8
+ export declare function greateThanOrEqual(a: number, b: number, epsilon?: number): boolean;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 判断数字a是否大于数字b
3
+ * @param a 数字a
4
+ * @param b 数字b
5
+ * @param epsilon 精度,默认值0.0001
6
+ */
7
+ export declare function greaterThan(a: number, b: number, epsilon?: number): boolean;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 判断数字a是否小于b
3
+ * @param a 数字a
4
+ * @param b 数字b
5
+ * @param epsilon 精度,默认值0.0001
6
+ */
7
+ export declare function lessThan(a: number, b: number, epsilon?: number): boolean;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 判断数字a是否小于或等于b
3
+ * @param a 数字a
4
+ * @param b 数字b
5
+ * @param epsilon 精度,默认值0.0001
6
+ */
7
+ export declare function lessThanOrEqual(a: number, b: number, epsilon?: number): boolean;
@@ -0,0 +1,9 @@
1
+ import { Quaternion, Vector4 } from '../../../runtime';
2
+ import { Point } from '../Point';
3
+ /**
4
+ * 判断2个变量(数字、数组、二维向量、三维向量、四维向量、四元数)的值是否近似相等
5
+ * @param a 变量a
6
+ * @param b 变量b
7
+ * @param epsilon 精度,默认值0.0001
8
+ */
9
+ export declare function withinEpsilon<T = number | number[] | Point | Vector4 | Quaternion>(a: T, b: T, epsilon?: number): boolean;
@@ -0,0 +1,34 @@
1
+ export * from './Line';
2
+ export * from './Point';
3
+ export * from './round';
4
+ export * from './compare/EPSILON';
5
+ export * from './compare/greaterThan';
6
+ export * from './compare/greateThanOrEqual';
7
+ export * from './compare/lessThan';
8
+ export * from './compare/lessThanOrEqual';
9
+ export * from './compare/withinEpsilon';
10
+ export * from './line/distanceToParallelLine';
11
+ export * from './line/distanceToProjection';
12
+ export * from './line/getLineIntersection';
13
+ export * from './line/isLineParallel';
14
+ export * from './line/project';
15
+ export * from './line/relateToPoint';
16
+ export * from './segment/getSegmentIntersection';
17
+ export * from './segment/getSegmentPartIncludePoint';
18
+ export * from './segment/onSegment';
19
+ export * from './segment/segmentFullInclude';
20
+ export * from './vec/addTo';
21
+ export * from './vec/angleTo';
22
+ export * from './vec/centerTo';
23
+ export * from './vec/cross';
24
+ export * from './vec/distanceTo';
25
+ export * from './vec/dot';
26
+ export * from './vec/ignoreYAxis';
27
+ export * from './vec/lengthTo';
28
+ export * from './vec/multiplyTo';
29
+ export * from './vec/normalizeTo';
30
+ export * from './vec/scaleTo';
31
+ export * from './vec/subtractTo';
32
+ export * from './vec/toPoint';
33
+ export * from './vec/toVector3';
34
+ export * from './vec/verticalVector';
@@ -0,0 +1,7 @@
1
+ import { Line } from '../Line';
2
+ /**
3
+ * 计算平行线之间的距离
4
+ * @param a 直线a
5
+ * @param b 直线b
6
+ */
7
+ export declare function distanceToParallelLine(a: Line, b: Line): number;
@@ -0,0 +1,8 @@
1
+ import { Line } from '../Line';
2
+ import { Point } from '../Point';
3
+ /**
4
+ * 求点到直线的投影距离(垂直距离、最短距离)
5
+ * @param p 点p
6
+ * @param line 直线
7
+ */
8
+ export declare function distanceToProjection(p: Point, line: Line): number;
@@ -0,0 +1,9 @@
1
+ import { Line } from '../Line';
2
+ import { Point } from '../Point';
3
+ /**
4
+ * 获取2条直线的交点(若不相交则返回null)
5
+ * @param line1 直线1
6
+ * @param line2 直线2
7
+ * @returns 交点
8
+ */
9
+ export declare function getLineIntersection(line1: Line, line2: Line): Point;
@@ -0,0 +1,7 @@
1
+ import { Line } from '../Line';
2
+ /**
3
+ * 判断两直线是否平行
4
+ * @param a 直线a
5
+ * @param b 直线b
6
+ */
7
+ export declare function isLineParallel(a: Line, b: Line): boolean;
@@ -0,0 +1,8 @@
1
+ import { Line } from '../Line';
2
+ import { Point } from '../Point';
3
+ /**
4
+ * 求点到直线的投影点
5
+ * @param p 点p
6
+ * @param line 直线
7
+ */
8
+ export declare function project(p: Point, line: Line): Point;
@@ -0,0 +1,8 @@
1
+ import { Line } from '../Line';
2
+ import { Point } from '../Point';
3
+ /**
4
+ * 判断点与直线的关系,0=共线,1=右侧,-1=左侧
5
+ * @param p 点p
6
+ * @param line 直线(线段,点的顺序不能互换)
7
+ */
8
+ export declare function relateToPoint(p: Point, line: Line): number;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 四舍五入
3
+ * @param value 数值
4
+ * @param fractionDigits 保留的小数位数,默认4
5
+ */
6
+ export declare function round(value: number, fractionDigits?: number): number;
@@ -0,0 +1,8 @@
1
+ import { Line } from '../Line';
2
+ import { Point } from '../Point';
3
+ /**
4
+ * 获取两线段的交点
5
+ * @param segment1 线段1
6
+ * @param segment2 线段2
7
+ */
8
+ export declare function getSegmentIntersection(segment1: Line, segment2: Line): Point;
@@ -0,0 +1,8 @@
1
+ import { Line } from '../Line';
2
+ import { Point } from '../Point';
3
+ /**
4
+ * 获取线段1哪个端点与线段2部分包含
5
+ * @param segment1 线段1
6
+ * @param segment2 线段2
7
+ */
8
+ export declare function getSegmentPartIncludePoint(segment1: Line, segment2: Line): Point;
@@ -0,0 +1,8 @@
1
+ import { Line } from '../Line';
2
+ import { Point } from '../Point';
3
+ /**
4
+ * 判断点是否在线段上
5
+ * @param p 点p
6
+ * @param segment 线段
7
+ */
8
+ export declare function onSegment(p: Point, segment: Line): boolean;
@@ -0,0 +1,8 @@
1
+ import { Line } from '../Line';
2
+ /**
3
+ * 判断线段1是否完全包含线段2
4
+ * @param segment1 线段1
5
+ * @param segment2 线段2
6
+ * @returns 布尔值
7
+ */
8
+ export declare function segmentFullInclude(segment1: Line, segment2: Line): boolean;
@@ -0,0 +1,7 @@
1
+ import { Point } from '../Point';
2
+ /**
3
+ * 加法,返回一个新对象
4
+ * @param a 点a
5
+ * @param b 点b
6
+ */
7
+ export declare function addTo(a: Point, b: Point): Point;
@@ -0,0 +1,7 @@
1
+ import { Point } from '../Point';
2
+ /**
3
+ * 求向量a到向量b的夹角
4
+ * @param a 向量a
5
+ * @param b 向量b
6
+ */
7
+ export declare function angleTo(a: Point, b: Point): number;
@@ -0,0 +1,7 @@
1
+ import { Point } from '../Point';
2
+ /**
3
+ * 求两点的中心,返回一个新对象
4
+ * @param a 点a
5
+ * @param b 点b
6
+ */
7
+ export declare function centerTo(a: Point, b: Point): Point;
@@ -0,0 +1,7 @@
1
+ import { Point } from '../Point';
2
+ /**
3
+ * 叉乘(顺序相关,必须为三维点)
4
+ * @param left 左向量
5
+ * @param right 右向量
6
+ */
7
+ export declare function cross(left: Point, right: Point): Point;
@@ -0,0 +1,7 @@
1
+ import { Point } from '../Point';
2
+ /**
3
+ * 获取两点之间的距离
4
+ * @param a 点a
5
+ * @param b 点b
6
+ */
7
+ export declare function distanceTo(a: Point, b: Point): number;
@@ -0,0 +1,7 @@
1
+ import { Point } from '../Point';
2
+ /**
3
+ * 点乘(顺序无关)
4
+ * @param left 左向量
5
+ * @param right 右向量
6
+ */
7
+ export declare function dot(left: Point, right: Point): number;
@@ -0,0 +1,7 @@
1
+ import { Vector2, Vector3 } from '../../../runtime';
2
+ /**
3
+ * 去掉三维向量的Y轴,把向量投射到xz平面。
4
+ * @param vec3 三维向量
5
+ * @returns 二维向量
6
+ */
7
+ export declare function ignoreYAxis(vec3: Vector3): Vector2;
@@ -0,0 +1,6 @@
1
+ import { Point } from '../Point';
2
+ /**
3
+ * 求向量长度
4
+ * @param p 点p
5
+ */
6
+ export declare function lengthTo(p: Point): number;
@@ -0,0 +1,7 @@
1
+ import { Point } from '../Point';
2
+ /**
3
+ * 乘法,返回一个新对象
4
+ * @param a 点a
5
+ * @param b 点b
6
+ */
7
+ export declare function multiplyTo(a: Point, b: Point): Point;
@@ -0,0 +1,6 @@
1
+ import { Point } from '../Point';
2
+ /**
3
+ * 标准化,返回一个新对象
4
+ * @param p 点
5
+ */
6
+ export declare function normalizeTo(p: Point): Point;