adding common for new sort of backend and doing sort of proto way...hacky but okay for now

This commit is contained in:
talksik
2022-06-03 10:54:33 -07:00
parent 0d7839dd13
commit f8de994490
7 changed files with 113 additions and 4 deletions
@@ -0,0 +1,35 @@
export interface IContent {
id: string;
creatorUserId: string;
contentUrl: string; // remote resource of file/media
createdDate: Date;
// visitCount
}
// ? persist length of clip for easier viewing for others...
// ?they have to load it anyway and will get metadata anyway?
export class ContentBlock implements IContent {
constructor(
public id: string,
public creatorUserId: string,
public contentUrl: string,
public contentType: ContentType,
public blobType: string,
public createdDate: Date,
) {}
}
export enum ContentType {
audio = 'audio',
link = 'link',
image = 'image',
}
export function isUrlImage(url: string) {
return url.match(/\.(jpeg|jpg|gif|png)$/) != null;
}