Files
mattermost-mobile/types/database/file.d.ts
Avinash Lingaloo 98c89797a5 MM_30476 [v2] Section 'Post' of the server schema (#5077)
* MM_30476 : Added all isolated tables from the server schema

* MM_30476 : Updated 'test' script in package.json

* MM_30476 : ADDED team section of the server schema

* MM_30476 : ADDED section for Group from the server schema

* MM_30476 : One PR for one section only

* MM_30476 : One PR for one section only

* MM_30476 : Rename table schemas to avoid name collision

* MM_30476 : ADDED section 'Post' of the server schema

* MM_30476 : Updated Post section of the server schema

* MM_30476 : Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

* MM_30476 : Corrected draft wrt to suggestions

* MM_30476 : Apply suggestions from code review

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* MM_30476 : ADDED lazy queries to group_membership model

* MM_30476 : Update model to match definition - GroupsInChannel

* MM_30476 : Removed groups_in_team definition from Post section of this PR

* MM_30476 : Updated all comments to match their variable/field name

* MM_30476 : Updated test

* MM_30476 : Updated imports and groups_in_team definition

* MM_30476 : Updated FileInfo

* MM_30476 : Updated Posts and PostMetadata ts types

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2021-01-14 16:41:53 -03:00

49 lines
1.3 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Relation} from '@nozbe/watermelondb';
import Model, {Associations} from '@nozbe/watermelondb/Model';
import Post from '@typings/database/post';
/**
* The File model works in pair with the Post model. It hosts information about the files shared in a Post
*/
export default class File extends Model {
/** table (entity name) : File */
static table: string;
/** associations : Describes every relationship to this entity. */
static associations: Associations;
/** extension : The file's extension */
extension: string;
/** height : The height for the image */
height: number;
/** image_thumbnail : A base64 representation of an image */
imageThumbnail: string;
/** local_path : Local path of the file that has been uploaded to server */
localPath: string;
/** mime_type : The media type */
mimeType: string;
/** name : The name for the file object */
name: string;
/** post_id : The foreign key of the related Post model */
postId: string;
/** size : The numeric value of the size for the file */
size: number;
/** width : The width of the file object/image */
width: number;
/** post : The related Post record for this file */
post: Relation<Post>;
}