mxcad 1.0.3 → 1.0.4

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.
package/LICENSE.md CHANGED
@@ -1,9 +1,9 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Kamil Bysiec
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Kamil Bysiec
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,60 +1,60 @@
1
- # vite-vanilla-ts-lib-starter
2
-
3
- The starter is built on top of Vite 3.x and prepared for writing libraries in TypeScript. It generates a hybrid package - both support for CommonJS and ESM modules.
4
-
5
- ## Features
6
-
7
- - Hybrid support - CommonJS and ESM modules
8
- - IIFE bundle for direct browser support without bundler
9
- - Typings bundle
10
- - ESLint - scripts linter
11
- - Stylelint - styles linter
12
- - Prettier - formatter
13
- - Jest - test framework
14
- - Husky + lint-staged - pre-commit git hook set up for formatting
15
-
16
- ## GitHub Template
17
-
18
- This is a template repo. Click the green [Use this template](https://github.com/kbysiec/vite-vanilla-ts-lib-starter/generate) button to get started.
19
-
20
- ## Clone to local
21
-
22
- If you prefer to do it manually with the cleaner git history
23
-
24
- ```bash
25
- git clone https://github.com/kbysiec/vite-vanilla-ts-lib-starter.git
26
- cd vite-vanilla-ts-lib-starter
27
- npm i
28
- ```
29
-
30
- ## Checklist
31
-
32
- When you use this template, update the following:
33
-
34
- - Remove `.git` directory and run `git init` to clean up the history
35
- - Change the name in `package.json` - it will be the name of the IIFE bundle global variable and bundle files name (`.cjs`, `.mjs`, `.iife.js`, `d.ts`)
36
- - Change the author name in `LICENSE`
37
- - Clean up the `README` and `CHANGELOG` files
38
-
39
- And, enjoy :)
40
-
41
- ## Usage
42
-
43
- The starter contains the following scripts:
44
-
45
- - `dev` - starts dev server
46
- - `build` - generates the following bundles: CommonJS (`.cjs`) ESM (`.mjs`) and IIFE (`.iife.js`). The name of bundle is automatically taked from `package.json` name property
47
- - `test` - starts jest and runs all tests
48
- - `test:coverage` - starts jest and run all tests with code coverage report
49
- - `lint:scripts` - lint `.ts` files with eslint
50
- - `lint:styles` - lint `.css` and `.scss` files with stylelint
51
- - `format:scripts` - format `.ts`, `.html` and `.json` files with prettier
52
- - `format:styles` - format `.cs` and `.scss` files with stylelint
53
- - `format` - format all with prettier and stylelint
54
- - `prepare` - script for setting up husky pre-commit hook
55
-
56
- ## Acknowledgment
57
-
58
- If you found it useful somehow, I would be grateful if you could leave a star in the project's GitHub repository.
59
-
60
- Thank you.
1
+ # vite-vanilla-ts-lib-starter
2
+
3
+ The starter is built on top of Vite 3.x and prepared for writing libraries in TypeScript. It generates a hybrid package - both support for CommonJS and ESM modules.
4
+
5
+ ## Features
6
+
7
+ - Hybrid support - CommonJS and ESM modules
8
+ - IIFE bundle for direct browser support without bundler
9
+ - Typings bundle
10
+ - ESLint - scripts linter
11
+ - Stylelint - styles linter
12
+ - Prettier - formatter
13
+ - Jest - test framework
14
+ - Husky + lint-staged - pre-commit git hook set up for formatting
15
+
16
+ ## GitHub Template
17
+
18
+ This is a template repo. Click the green [Use this template](https://github.com/kbysiec/vite-vanilla-ts-lib-starter/generate) button to get started.
19
+
20
+ ## Clone to local
21
+
22
+ If you prefer to do it manually with the cleaner git history
23
+
24
+ ```bash
25
+ git clone https://github.com/kbysiec/vite-vanilla-ts-lib-starter.git
26
+ cd vite-vanilla-ts-lib-starter
27
+ npm i
28
+ ```
29
+
30
+ ## Checklist
31
+
32
+ When you use this template, update the following:
33
+
34
+ - Remove `.git` directory and run `git init` to clean up the history
35
+ - Change the name in `package.json` - it will be the name of the IIFE bundle global variable and bundle files name (`.cjs`, `.mjs`, `.iife.js`, `d.ts`)
36
+ - Change the author name in `LICENSE`
37
+ - Clean up the `README` and `CHANGELOG` files
38
+
39
+ And, enjoy :)
40
+
41
+ ## Usage
42
+
43
+ The starter contains the following scripts:
44
+
45
+ - `dev` - starts dev server
46
+ - `build` - generates the following bundles: CommonJS (`.cjs`) ESM (`.mjs`) and IIFE (`.iife.js`). The name of bundle is automatically taked from `package.json` name property
47
+ - `test` - starts jest and runs all tests
48
+ - `test:coverage` - starts jest and run all tests with code coverage report
49
+ - `lint:scripts` - lint `.ts` files with eslint
50
+ - `lint:styles` - lint `.css` and `.scss` files with stylelint
51
+ - `format:scripts` - format `.ts`, `.html` and `.json` files with prettier
52
+ - `format:styles` - format `.cs` and `.scss` files with stylelint
53
+ - `format` - format all with prettier and stylelint
54
+ - `prepare` - script for setting up husky pre-commit hook
55
+
56
+ ## Acknowledgment
57
+
58
+ If you found it useful somehow, I would be grateful if you could leave a star in the project's GitHub repository.
59
+
60
+ Thank you.
package/dist/mxcad.d.ts CHANGED
@@ -1,16 +1,21 @@
1
1
  // Generated by dts-bundle-generator v6.13.0
2
2
 
3
- declare class McObject {
4
- updateDisplay(modelViewMatrix: number[], projectionMatrix: number[]): void;
5
- test(): void;
6
- }
7
- declare class McApp {
8
- CreateMxDraw(width: number, height: number, canvasId: string): McObject;
9
- }
10
- export declare interface Mxdrawassembly {
11
- //McGePoint3d: typeof McGePoint3d
12
- McApp: McApp;
13
- }
3
+ /*** webAssembly 请求加载wasm文件 获取示例结果
4
+ * @param url wasm 文件路径
5
+ * @param importObject 导入对象
6
+ * */
7
+ export declare function fetchAndInstantiate(url: string, importObject: WebAssembly.Imports): Promise<WebAssembly.WebAssemblyInstantiatedSource>;
8
+ export declare const readFromBlobOrFile: (blob: Blob) => Promise<unknown>;
9
+ export declare const fetchFile: (_data: string | URL) => Promise<Uint8Array>;
10
+ export declare const toBlobURL: (url: URL | RequestInfo, mimeType: any) => Promise<string>;
11
+ export declare function b64Encode(str: string): string;
12
+ export declare function b64Decode(str: string): string;
13
+ export declare function setMcDbEntity(data: any): void;
14
+ export declare const MxTools: {
15
+ b64Encode: typeof b64Encode;
16
+ b64Decode: typeof b64Decode;
17
+ setMcDbEntity: typeof setMcDbEntity;
18
+ };
14
19
  /** 绘制文字 */
15
20
  export declare function drawText(): Promise<void>;
16
21
  /** 绘制圆*/
@@ -24,7 +29,27 @@ export declare function drawPolyLine(): Promise<void>;
24
29
  export declare function drawPolygon(): Promise<void>;
25
30
  export declare function drawArc(): Promise<void>;
26
31
  export declare function drawEllipticalArc(): void;
32
+ declare class McObject {
33
+ updateDisplay(modelViewMatrix: number[], projectionMatrix: number[]): void;
34
+ test(): void;
35
+ }
36
+ declare class McApp {
37
+ Init: () => void;
38
+ CreateMxDraw(width: number, height: number, canvasId: string): McObject;
39
+ }
40
+ export interface Mxdrawassembly {
41
+ MxCpp: typeof McApp;
42
+ McApp: McApp;
43
+ }
27
44
  export declare let MxCpp: Mxdrawassembly;
28
- export declare function loadMxdrawassembly(call: () => void): void;
45
+ export declare function loadMxdrawassembly(call: (MxCpp: Mxdrawassembly) => void, locateFile?: (wasmURL: string, baseURL: string | URL) => string): void;
46
+ declare const _default: {
47
+ loadMxdrawassembly: typeof loadMxdrawassembly;
48
+ getWasmURL: (wasmURL: string, baseURL: string | URL) => string;
49
+ };
50
+
51
+ export {
52
+ _default as default,
53
+ };
29
54
 
30
55
  export {};