mxcad 1.0.3 → 1.0.5
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 +9 -9
- package/README.md +60 -60
- package/dist/mxcad.d.ts +34 -12
- package/dist/mxcad.es.js +1341 -1188
- package/dist/mxcad.umd.js +49 -38
- package/dist/mxdrawassembly_min.wasm.wasm +0 -0
- package/package.json +14 -13
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,18 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v6.13.0
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare
|
|
11
|
-
|
|
12
|
-
|
|
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 function b64Encode(str: string): string;
|
|
9
|
+
export declare function b64Decode(str: string): string;
|
|
10
|
+
export declare function setMcDbEntity(data: any): void;
|
|
11
|
+
export declare const MxTools: {
|
|
12
|
+
b64Encode: typeof b64Encode;
|
|
13
|
+
b64Decode: typeof b64Decode;
|
|
14
|
+
setMcDbEntity: typeof setMcDbEntity;
|
|
15
|
+
};
|
|
14
16
|
/** 绘制文字 */
|
|
15
17
|
export declare function drawText(): Promise<void>;
|
|
16
18
|
/** 绘制圆*/
|
|
@@ -24,7 +26,27 @@ export declare function drawPolyLine(): Promise<void>;
|
|
|
24
26
|
export declare function drawPolygon(): Promise<void>;
|
|
25
27
|
export declare function drawArc(): Promise<void>;
|
|
26
28
|
export declare function drawEllipticalArc(): void;
|
|
29
|
+
declare class McObject {
|
|
30
|
+
updateDisplay(modelViewMatrix: number[], projectionMatrix: number[]): void;
|
|
31
|
+
test(): void;
|
|
32
|
+
}
|
|
33
|
+
declare class McApp {
|
|
34
|
+
Init: () => void;
|
|
35
|
+
CreateMxDraw(width: number, height: number, canvasId: string): McObject;
|
|
36
|
+
}
|
|
37
|
+
export interface Mxdrawassembly {
|
|
38
|
+
MxCpp: typeof McApp;
|
|
39
|
+
McApp: McApp;
|
|
40
|
+
}
|
|
27
41
|
export declare let MxCpp: Mxdrawassembly;
|
|
28
|
-
export declare function loadMxdrawassembly(call: () => void): void;
|
|
42
|
+
export declare function loadMxdrawassembly(call: (MxCpp: Mxdrawassembly) => void, locateFile?: (wasmURL: string, baseURL: string | URL) => string): void;
|
|
43
|
+
declare const _default: {
|
|
44
|
+
loadMxdrawassembly: typeof loadMxdrawassembly;
|
|
45
|
+
getWasmURL: (wasmURL: string, baseURL: string | URL) => string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
_default as default,
|
|
50
|
+
};
|
|
29
51
|
|
|
30
52
|
export {};
|