Skip to content

Commit

Permalink
refactor(web)move version function to the module level WPB-15329
Browse files Browse the repository at this point in the history
  • Loading branch information
typfel committed Jan 20, 2025
1 parent 14844be commit 2b6c378
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions crypto-ffi/bindings/js/src/CoreCrypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export {
CoreCryptoLogLevel,
setMaxLogLevel,
buildMetadata,
version,
CoreCrypto,
} from "./CoreCryptoInstance.js";
export type {
Expand Down
19 changes: 10 additions & 9 deletions crypto-ffi/bindings/js/src/CoreCryptoInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,16 @@ export function setMaxLogLevel(level: CoreCryptoLogLevel): void {
export function buildMetadata(): CoreCryptoFfiTypes.BuildMetadata {
return CoreCryptoFfi.build_metadata();
}

/**
* Returns the current version of {@link CoreCrypto}
*
* @returns The `core-crypto-ffi` version as defined in its `Cargo.toml` file
*/
export function version(): string {
return CoreCryptoFfi.version();
}

/**
* Wrapper for the WASM-compiled version of CoreCrypto
*/
Expand Down Expand Up @@ -1340,13 +1350,4 @@ export class CoreCrypto {
);
return normalizeEnum(E2eiConversationState, state);
}

/**
* Returns the current version of {@link CoreCrypto}
*
* @returns The `core-crypto-ffi` version as defined in its `Cargo.toml` file
*/
static version(): string {
return CoreCryptoFfi.version();
}
}

0 comments on commit 2b6c378

Please sign in to comment.