diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 43c6fdc..820f797 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -30,7 +30,7 @@ jobs: uses: threeal/cmake-action@v1.3.0 with: c-compiler: emcc - options: CMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake + options: CMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake CMAKE_BUILD_TYPE=Release - name: Build Project run: cmake --build build - name: Install Project diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fb0ba9a..5a64426 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -62,8 +62,9 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Emscripten") ${CMAKE_SOURCE_DIR}/LICENSE-2.0.txt js/package.json js/index.d.ts + js/index.d.cts js/LICENSE - js/README.md + ${CMAKE_SOURCE_DIR}/README.md ${CMAKE_CURRENT_BINARY_DIR}/index.cjs ${CMAKE_CURRENT_BINARY_DIR}/index.mjs DESTINATION pkg diff --git a/src/js/README.md b/src/js/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/src/js/index.d.cts b/src/js/index.d.cts new file mode 100644 index 0000000..b977a44 --- /dev/null +++ b/src/js/index.d.cts @@ -0,0 +1,8 @@ +export default _default; +declare function _default(): { + readonly scrub: () => void; + readonly exportState: () => ArrayBufferLike; + readonly importState: (state: AllowSharedBufferSource) => void; + readonly update: (data: AllowSharedBufferSource) => void; + readonly finish: () => ArrayBufferLike; +}; diff --git a/src/js/package.json b/src/js/package.json index ee4e4ce..a5c0ab0 100644 --- a/src/js/package.json +++ b/src/js/package.json @@ -1,9 +1,9 @@ { "name": "@exact-realty/sha2", "author": "Exact Realty Limited", - "keywords": ["sha256", "sha2", "hash", "digst"], - "description": "SHA2 implementation with exportable state", - "version": "1.0.0", + "keywords": ["sha256", "sha2", "hash", "digest"], + "description": "SHA-2 implementation with exportable state", + "version": "1.0.1", "license": "Apache-2.0", "repository": { "type": "git", @@ -13,6 +13,7 @@ "LICENSE-2.0.txt", "index.cjs", "index.d.ts", + "index.d.cts", "index.mjs" ], "type": "module", @@ -21,7 +22,10 @@ "types": "./index.d.ts", "exports": { ".": { - "types": "./index.d.ts", + "types": { + "import": "./index.d.ts", + "require": "./index.d.cts" + }, "import": "./index.mjs", "require": "./index.cjs" }