mirror of
https://github.com/bitwarden/clients.git
synced 2026-07-10 21:03:56 +08:00
22 lines
565 B
TypeScript
22 lines
565 B
TypeScript
import { AttachmentView } from 'jslib/models/view/attachmentView';
|
|
|
|
export class Attachment {
|
|
static template(): Attachment {
|
|
const req = new Attachment();
|
|
req.fileName = 'photo.jpg';
|
|
return req;
|
|
}
|
|
|
|
static toView(req: Attachment, view = new AttachmentView()) {
|
|
view.fileName = req.fileName;
|
|
return view;
|
|
}
|
|
|
|
fileName: string;
|
|
|
|
// Use build method instead of ctor so that we can control order of JSON stringify for pretty print
|
|
build(o: AttachmentView) {
|
|
this.fileName = o.fileName;
|
|
}
|
|
}
|