mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-26 15:29:22 +00:00
36 lines
619 B
TypeScript
36 lines
619 B
TypeScript
/**
|
|
* Custom smiley
|
|
*
|
|
* @author Pierre Hubert
|
|
*/
|
|
|
|
import { pathUserData } from "../utils/UserDataUtils";
|
|
|
|
export interface CustomEmojiBuilder {
|
|
id: number,
|
|
userID: number,
|
|
shortcut: string,
|
|
path: string,
|
|
}
|
|
|
|
export class CustomEmoji implements CustomEmojiBuilder {
|
|
id: number;
|
|
userID: number;
|
|
shortcut: string;
|
|
path: string;
|
|
|
|
public constructor(info: CustomEmojiBuilder) {
|
|
for (const key in info) {
|
|
if (info.hasOwnProperty(key))
|
|
this[key] = info[key];
|
|
}
|
|
}
|
|
|
|
get url() : string {
|
|
return pathUserData(this.path, false);
|
|
}
|
|
|
|
get sysPath() : string {
|
|
return pathUserData(this.path, true);
|
|
}
|
|
} |