moh-common-lib
Version:
A library of Angular components, services, and styles for B.C. Government Ministry of Health (MoH).
31 lines (30 loc) • 1.05 kB
TypeScript
import { Base } from './base';
/**
* Person, each project can extend this person class
* NPM package dependencies:
* a) moment
*/
export declare class Person extends Base {
firstName: string;
middleName: string;
lastName: string;
/** Format to display birthdate */
dobFormat: string;
apiDobFormat: string;
dateOfBirth: Date;
/** Returns DoB in YYYYMMDD format, used by API. */
readonly dateOfBirthShort: string;
/** Returns DoB in dobFormat (default: YYYY/MM/DD), for display purposes */
readonly formatDateOfBirth: string;
/** Concatenates the first and last name together */
/**
* Sets the full name for the person (first, middle and last names)
* NOTE: Just for development with dummy data and unit tests
*/
name: string;
/** Returns the person's full name - first middle last name concatenated together */
readonly fullname: any;
/** Calculates the age from date of birth */
getAge(): number;
copy(object: Person): void;
}