From fac2367052fe382e29db99af878b0caedecba296 Mon Sep 17 00:00:00 2001 From: StevanFreeborn Date: Sun, 5 Feb 2023 15:32:22 -0600 Subject: [PATCH] fix: add js doc comments. --- src/models/FileInfo.ts | 34 ++++++++++++++++++++++++++++++++++ src/models/FormulaField.ts | 24 ++++++++++++++++++++++++ src/models/ListField.ts | 29 +++++++++++++++++++++++++++++ src/models/ListValue.ts | 31 +++++++++++++++++++++++++++++++ src/models/ReferenceField.ts | 24 ++++++++++++++++++++++++ 5 files changed, 142 insertions(+) diff --git a/src/models/FileInfo.ts b/src/models/FileInfo.ts index c333349..abc5198 100644 --- a/src/models/FileInfo.ts +++ b/src/models/FileInfo.ts @@ -1,13 +1,47 @@ import { FieldType } from '../enums/FieldType'; +/** + * @class FileInfo - Represents a file info. + */ export class FileInfo { + /** + * @property {FieldType} type - The type of the file. + */ public type: FieldType; + + /** + * @property {string} contentType - The content type of the file. + */ public contentType: string; + + /** + * @property {string} name - The name of the file. + */ public name: string; + + /** + * @property {Date} createdDate - The created date of the file. + */ public createdDate: Date; + + /** + * @property {Date} modifiedDate - The modified date of the file. + */ public modifiedDate: Date; + + /** + * @property {string} owner - The owner of the file. + */ public owner: string; + + /** + * @property {string} notes - The notes of the file. + */ public notes: string; + + /** + * @property {string} fileHref - The href of the file. + */ public fileHref: string; constructor( diff --git a/src/models/FormulaField.ts b/src/models/FormulaField.ts index f11dcd2..8865171 100644 --- a/src/models/FormulaField.ts +++ b/src/models/FormulaField.ts @@ -2,10 +2,34 @@ import { FormulaOutputType } from '../enums/FormulaOutputType'; import { Field } from './Field'; import { type ListValue } from './ListValue'; +/** + * @class FormulaField - Represents a formula field. + */ export class FormulaField extends Field { + /** + * @property {FormulaOutputType} outputType - The output type of the formula. + */ public outputType: FormulaOutputType; + + /** + * @property {ListValue[]} values - The list values of the formula. + */ public values: ListValue[]; + /** + * @constructor - Creates a new FormulaField. + * @param {number} id - The id of the formula field. + * @param {number} appId - The id of the app the formula field belongs to. + * @param {string} name - The name of the formula field. + * @param {string} type - The type of the formula field. + * @param {string} status - The status of the formula field. + * @param {boolean} isRequired - Whether the formula field is required. + * @param {boolean} isUnique - Whether the formula field is unique. + * @param {string} outputType - The output type of the formula field. + * @param {ListValue[]} values - The list values of the formula field. + * @returns {FormulaField} - A new FormulaField. + * @throws {Error} - Throws an error if the outputType is not a valid FormulaOutputType. + */ constructor( id: number, appId: number, diff --git a/src/models/ListField.ts b/src/models/ListField.ts index 0aa4593..e4c280b 100644 --- a/src/models/ListField.ts +++ b/src/models/ListField.ts @@ -2,11 +2,40 @@ import { Multiplicity } from '../enums/Multiplicity'; import { Field } from './Field'; import { type ListValue } from './ListValue'; +/** + * @class ListField - Represents a list field. + */ export class ListField extends Field { + /** + * @property {Multiplicity} multiplicity - The multiplicity of the list field. + */ public multiplicity: Multiplicity; + + /** + * @property {number} listId - The id of the list the list field belongs to. + */ public listId: number; + + /** + * @property {ListValue[]} values - The list values of the list field. + */ public values: ListValue[]; + /** + * @constructor - Creates a new ListField. + * @param {number} id - The id of the list field. + * @param {number} appId - The id of the app the list field belongs to. + * @param {string} name - The name of the list field. + * @param {string} type - The type of the list field. + * @param {string} status - The status of the list field. + * @param {boolean} isRequired - Whether the list field is required. + * @param {boolean} isUnique - Whether the list field is unique. + * @param {string} multiplicity - The multiplicity of the list field. + * @param {number} listId - The id of the list the list field belongs to. + * @param {ListValue[]} values - The list values of the list field. + * @returns {ListField} - A new ListField. + * @throws {Error} - Throws an error if the multiplicity is not a valid Multiplicity. + */ constructor( id: number, appId: number, diff --git a/src/models/ListValue.ts b/src/models/ListValue.ts index ebc12e5..9fc8442 100644 --- a/src/models/ListValue.ts +++ b/src/models/ListValue.ts @@ -1,10 +1,41 @@ +/** + * @class ListValue - Represents a list value. + */ export class ListValue { + /** + * @property {string} id - The id of the list value. + */ public id: string; + + /** + * @property {string} name - The name of the list value. + */ public name: string; + + /** + * @property {number} sortOrder - The sort order of the list value. + */ public sortOrder: number; + + /** + * @property {number} numericValue - The numeric value of the list value. + */ public numericValue: number; + + /** + * + */ public color: string; + /** + * @constructor - Creates a new ListValue. + * @param {string} id - The id of the list value. + * @param {string} name - The name of the list value. + * @param {number} sortOrder - The sort order of the list value. + * @param {number} numericValue - The numeric value of the list value. + * @param {string} color - The color of the list value. + * @returns {ListValue} - A new ListValue. + */ constructor( id: string, name: string, diff --git a/src/models/ReferenceField.ts b/src/models/ReferenceField.ts index a5fc590..e1646dc 100644 --- a/src/models/ReferenceField.ts +++ b/src/models/ReferenceField.ts @@ -1,10 +1,34 @@ import { Multiplicity } from '../enums/Multiplicity'; import { Field } from './Field'; +/** + * @class ReferenceField - Represents a reference field. + */ export class ReferenceField extends Field { + /** + * @property {Multiplicity} multiplicity - The multiplicity of the reference field. + */ public multiplicity: Multiplicity; + + /** + * @property {number} referencedAppId - The id of the app the reference field references. + */ public referencedAppId: number; + /** + * @constructor - Creates a new ReferenceField. + * @param {number} id - The id of the reference field. + * @param {number} appId - The id of the app the reference field belongs to. + * @param {string} name - The name of the reference field. + * @param {string} type - The type of the reference field. + * @param {string} status - The status of the reference field. + * @param {boolean} isRequired - Whether the reference field is required. + * @param {boolean} isUnique - Whether the reference field is unique. + * @param {string} multiplicity - The multiplicity of the reference field. + * @param {number} referencedAppId - The id of the app the reference field references. + * @returns {ReferenceField} - A new ReferenceField. + * @throws {Error} - Throws an error if the multiplicity is not a valid Multiplicity.jjkdleroritlasaxmvjd + */ constructor( id: number, appId: number,