mirror of
https://github.com/bitwarden/browser
synced 2025-12-24 04:04:24 +00:00
31 lines
723 B
TypeScript
31 lines
723 B
TypeScript
import { SecureNoteType } from '../../enums/secureNoteType';
|
|
|
|
import { SecureNoteData } from '../data/secureNoteData';
|
|
|
|
import Domain from './domainBase';
|
|
|
|
import { SecureNoteView } from '../view/secureNoteView';
|
|
|
|
export class SecureNote extends Domain {
|
|
type: SecureNoteType;
|
|
|
|
constructor(obj?: SecureNoteData, alreadyEncrypted: boolean = false) {
|
|
super();
|
|
if (obj == null) {
|
|
return;
|
|
}
|
|
|
|
this.type = obj.type;
|
|
}
|
|
|
|
decrypt(orgId: string): Promise<SecureNoteView> {
|
|
return Promise.resolve(new SecureNoteView(this));
|
|
}
|
|
|
|
toSecureNoteData(): SecureNoteData {
|
|
const n = new SecureNoteData();
|
|
n.type = this.type;
|
|
return n;
|
|
}
|
|
}
|