Files
FixIt/assets/js/modules/encryption.ts
T
Cell a5d24f395e refactor(assets): use ES6 # private fields instead of TS private
Convert all TypeScript `private` and `private readonly` declarations to
ES6 `#` syntax for true runtime privacy. TypeScript's `private` keyword
only provides compile-time checking but fields remain accessible in
compiled JavaScript.
2026-07-23 14:33:19 +08:00

25 lines
661 B
TypeScript

import type { CoreService, EncryptionService } from '../core/tokens'
/**
* Encryption module — bootstrap page/shortcode decryption via FixItDecryptor.
*
* Responsibilities:
* - Initialize FixItDecryptor for full-page and shortcode-scoped decryption.
*/
export class EncryptionModule implements EncryptionService {
#core: CoreService
constructor(core: CoreService) {
this.#core = core
}
/** Initialize FixItDecryptor with encryption config. */
setup() {
if (!this.#core.config.encryption || !window.FixItDecryptor)
return
const decryptor = new window.FixItDecryptor()
decryptor.init(this.#core.config.encryption)
}
}