Skip to content

Instantly share code, notes, and snippets.

@shadow1349
Created September 16, 2019 20:09
Show Gist options
  • Save shadow1349/62cc89fb3405ee1133caf40c4c6f605c to your computer and use it in GitHub Desktop.
Save shadow1349/62cc89fb3405ee1133caf40c4c6f605c to your computer and use it in GitHub Desktop.
import { IModel, IAlgoliaModel, Model } from "./model";
export interface INote extends IModel {
Title: string;
Note: string;
/**
* ID of the user who created the document
*/
Author: string;
Tags?: string[];
}
export interface IAlgoliaNote extends INote, IAlgoliaModel {}
export class NoteModel extends Model implements IAlgoliaNote {
Title: string;
Note: string;
/**
* ID of the user who created the document
*/
Author: string;
constructor(private model: INote) {
super(model);
this.Title = this.model.Title;
this.Note = this.model.Note;
this.Author = this.model.Author;
this._tags = this.model.Tags;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment