@master4n/types
Advanced tools
| /** | ||
| * Gender Person Status. | ||
| */ | ||
| export declare enum Gender { | ||
| MALE = 0, | ||
| FEMALE = 1, | ||
| OTHERS = 2 | ||
| } | ||
| /** | ||
| * Marital Person Status. | ||
| */ | ||
| export declare enum MaritalStatus { | ||
| SINGLE = 0, | ||
| MARRIED = 1, | ||
| DIVORCED = 2, | ||
| WIDOWED = 3 | ||
| } | ||
| /** | ||
| * Alive/Dead Person Status | ||
| */ | ||
| export declare enum Status { | ||
| ALIVE = 0, | ||
| DEAD = 1 | ||
| } | ||
| /** | ||
| * Address of the person's family | ||
| */ | ||
| export interface Address { | ||
| country: string; | ||
| state: string; | ||
| district: string; | ||
| village: string; | ||
| pin: number; | ||
| } | ||
| /** | ||
| * Person Details | ||
| */ | ||
| export interface Person { | ||
| id: string; | ||
| firstName: string; | ||
| middleName: string; | ||
| lastName: string; | ||
| gender: Gender; | ||
| birthDate?: Date; | ||
| deathDate?: Date; | ||
| maritalStatus: MaritalStatus; | ||
| status: Status; | ||
| } |
| /** | ||
| * Gender Person Status. | ||
| */ | ||
| export declare enum Gender { | ||
| MALE = 0, | ||
| FEMALE = 1, | ||
| OTHERS = 2 | ||
| } | ||
| /** | ||
| * Marital Person Status. | ||
| */ | ||
| export declare enum MaritalStatus { | ||
| SINGLE = 0, | ||
| MARRIED = 1, | ||
| DIVORCED = 2, | ||
| WIDOWED = 3 | ||
| } | ||
| /** | ||
| * Alive/Dead Person Status | ||
| */ | ||
| export declare enum Status { | ||
| ALIVE = 0, | ||
| DEAD = 1 | ||
| } | ||
| /** | ||
| * Address of the person's family | ||
| */ | ||
| export interface Address { | ||
| country: string; | ||
| state: string; | ||
| district: string; | ||
| village: string; | ||
| pin: number; | ||
| } | ||
| /** | ||
| * Person Details | ||
| */ | ||
| export interface Person { | ||
| id: string; | ||
| firstName: string; | ||
| middleName: string; | ||
| lastName: string; | ||
| gender: Gender; | ||
| birthDate?: Date; | ||
| deathDate?: Date; | ||
| maritalStatus: MaritalStatus; | ||
| status: Status; | ||
| } |
+0
-107
| 'use strict'; | ||
| class SinglePersonError extends Error { | ||
| constructor() { | ||
| super("Marital Status Of Person Is SINGLE"); | ||
| } | ||
| } | ||
| /** | ||
@@ -36,103 +30,2 @@ * Gender Person Status. | ||
| })(exports.Status || (exports.Status = {})); | ||
| class FamilyMember { | ||
| firstName; | ||
| middleName; | ||
| lastName; | ||
| gender; | ||
| children; | ||
| maritalStatus; | ||
| birthDate; | ||
| deathDate; | ||
| spouse; | ||
| parent; | ||
| status; | ||
| address; | ||
| constructor(firstName, middleName, lastName, gender, status) { | ||
| this.firstName = firstName; | ||
| this.middleName = middleName; | ||
| this.lastName = lastName; | ||
| this.gender = gender; | ||
| this.status = status; | ||
| this.maritalStatus = exports.MaritalStatus.SINGLE; | ||
| } | ||
| setAddress(address) { | ||
| this.address = address; | ||
| } | ||
| setBirthDate(birthDate) { | ||
| this.birthDate = birthDate; | ||
| } | ||
| setDeathDate(deathDate) { | ||
| if (!this.isAlive()) { | ||
| this.deathDate = deathDate; | ||
| } | ||
| } | ||
| setMaritalStatus(maritalStatus) { | ||
| this.maritalStatus = maritalStatus; | ||
| if (this.maritalStatus !== exports.MaritalStatus.SINGLE) { | ||
| this.children = new Array; | ||
| } | ||
| } | ||
| isMarried() { | ||
| if (this.maritalStatus !== undefined) { | ||
| if (this.maritalStatus !== exports.MaritalStatus.SINGLE) { | ||
| return true; | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| } | ||
| isAlive() { | ||
| if (this.status === exports.Status.ALIVE) { | ||
| return true; | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| } | ||
| /** | ||
| * Set the spouse of the person. | ||
| * @param spouse | ||
| */ | ||
| setSpouse(spouse) { | ||
| if (this.isMarried()) { | ||
| this.spouse = spouse; | ||
| } | ||
| else { | ||
| throw new SinglePersonError(); | ||
| } | ||
| } | ||
| /** | ||
| * Set parent of the person. | ||
| * @param parent | ||
| */ | ||
| setParent(parent) { | ||
| this.parent = parent; | ||
| } | ||
| /** | ||
| * Add person childrens. | ||
| * @param child | ||
| */ | ||
| addChild(child) { | ||
| if (this.isMarried() && this.children) { | ||
| this.children.push(child); | ||
| } | ||
| else { | ||
| throw new SinglePersonError(); | ||
| } | ||
| } | ||
| displayFamilyTree(depth = 0) { | ||
| console.log(' '.repeat(depth * 2) + this.firstName + ' ' + this.middleName + ' ' + this.lastName); | ||
| if (this.children) { | ||
| for (const child of this.children) { | ||
| child.displayFamilyTree(depth + 1); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| exports.FamilyMember = FamilyMember; | ||
| //# sourceMappingURL=index.cjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.cjs","sources":["../../src/src/errors/errors.ts","../../src/src/models/common.ts"],"sourcesContent":[null,null],"names":["Gender","MaritalStatus","Status"],"mappings":";;AAAM,MAAO,iBAAkB,SAAQ,KAAK,CAAA;AACxC,IAAA,WAAA,GAAA;QACI,KAAK,CAAC,oCAAoC,CAAC,CAAA;KAC9C;AACJ;;ACFD;;AAEG;AACSA,wBAIX;AAJD,CAAA,UAAY,MAAM,EAAA;AACd,IAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;AACJ,IAAA,MAAA,CAAA,MAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACN,IAAA,MAAA,CAAA,MAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACV,CAAC,EAJWA,cAAM,KAANA,cAAM,GAIjB,EAAA,CAAA,CAAA,CAAA;AAED;;AAEG;AACUC,+BAKZ;AALD,CAAA,UAAa,aAAa,EAAA;AACtB,IAAA,aAAA,CAAA,aAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACN,IAAA,aAAA,CAAA,aAAA,CAAA,SAAA,CAAA,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EAAA,CAAA,CAAA,CAAA;AAED;;AAEG;AACUC,+BAKZ;AALD,CAAA,UAAa,aAAa,EAAA;AACtB,IAAA,aAAA,CAAA,aAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACN,IAAA,aAAA,CAAA,aAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAO,CAAA;AACP,IAAA,aAAA,CAAA,aAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAQ,CAAA;AACR,IAAA,aAAA,CAAA,aAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAO,CAAA;AACX,CAAC,EALYA,qBAAa,KAAbA,qBAAa,GAKzB,EAAA,CAAA,CAAA,CAAA;AAED;;AAEG;AACSC,wBAGX;AAHD,CAAA,UAAY,MAAM,EAAA;AAChB,IAAA,MAAA,CAAA,MAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAK,CAAA;AACL,IAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;AACN,CAAC,EAHWA,cAAM,KAANA,cAAM,GAGjB,EAAA,CAAA,CAAA;;"} |
+1
-1
@@ -1,1 +0,1 @@ | ||
| export * from './models/common'; | ||
| export * from './models/person'; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| export * from './models/common'; | ||
| export * from './models/person'; |
+1
-106
@@ -1,7 +0,1 @@ | ||
| class SinglePersonError extends Error { | ||
| constructor() { | ||
| super("Marital Status Of Person Is SINGLE"); | ||
| } | ||
| } | ||
| /** | ||
@@ -34,103 +28,4 @@ * Gender Person Status. | ||
| })(Status || (Status = {})); | ||
| class FamilyMember { | ||
| firstName; | ||
| middleName; | ||
| lastName; | ||
| gender; | ||
| children; | ||
| maritalStatus; | ||
| birthDate; | ||
| deathDate; | ||
| spouse; | ||
| parent; | ||
| status; | ||
| address; | ||
| constructor(firstName, middleName, lastName, gender, status) { | ||
| this.firstName = firstName; | ||
| this.middleName = middleName; | ||
| this.lastName = lastName; | ||
| this.gender = gender; | ||
| this.status = status; | ||
| this.maritalStatus = MaritalStatus.SINGLE; | ||
| } | ||
| setAddress(address) { | ||
| this.address = address; | ||
| } | ||
| setBirthDate(birthDate) { | ||
| this.birthDate = birthDate; | ||
| } | ||
| setDeathDate(deathDate) { | ||
| if (!this.isAlive()) { | ||
| this.deathDate = deathDate; | ||
| } | ||
| } | ||
| setMaritalStatus(maritalStatus) { | ||
| this.maritalStatus = maritalStatus; | ||
| if (this.maritalStatus !== MaritalStatus.SINGLE) { | ||
| this.children = new Array; | ||
| } | ||
| } | ||
| isMarried() { | ||
| if (this.maritalStatus !== undefined) { | ||
| if (this.maritalStatus !== MaritalStatus.SINGLE) { | ||
| return true; | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| } | ||
| isAlive() { | ||
| if (this.status === Status.ALIVE) { | ||
| return true; | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| } | ||
| /** | ||
| * Set the spouse of the person. | ||
| * @param spouse | ||
| */ | ||
| setSpouse(spouse) { | ||
| if (this.isMarried()) { | ||
| this.spouse = spouse; | ||
| } | ||
| else { | ||
| throw new SinglePersonError(); | ||
| } | ||
| } | ||
| /** | ||
| * Set parent of the person. | ||
| * @param parent | ||
| */ | ||
| setParent(parent) { | ||
| this.parent = parent; | ||
| } | ||
| /** | ||
| * Add person childrens. | ||
| * @param child | ||
| */ | ||
| addChild(child) { | ||
| if (this.isMarried() && this.children) { | ||
| this.children.push(child); | ||
| } | ||
| else { | ||
| throw new SinglePersonError(); | ||
| } | ||
| } | ||
| displayFamilyTree(depth = 0) { | ||
| console.log(' '.repeat(depth * 2) + this.firstName + ' ' + this.middleName + ' ' + this.lastName); | ||
| if (this.children) { | ||
| for (const child of this.children) { | ||
| child.displayFamilyTree(depth + 1); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| export { FamilyMember, Gender, MaritalStatus, Status }; | ||
| export { Gender, MaritalStatus, Status }; | ||
| //# sourceMappingURL=index.mjs.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.mjs","sources":["../../src/src/errors/errors.ts","../../src/src/models/common.ts"],"sourcesContent":[null,null],"names":[],"mappings":"AAAM,MAAO,iBAAkB,SAAQ,KAAK,CAAA;AACxC,IAAA,WAAA,GAAA;QACI,KAAK,CAAC,oCAAoC,CAAC,CAAA;KAC9C;AACJ;;ACFD;;AAEG;IACS,OAIX;AAJD,CAAA,UAAY,MAAM,EAAA;AACd,IAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;AACJ,IAAA,MAAA,CAAA,MAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACN,IAAA,MAAA,CAAA,MAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACV,CAAC,EAJW,MAAM,KAAN,MAAM,GAIjB,EAAA,CAAA,CAAA,CAAA;AAED;;AAEG;IACU,cAKZ;AALD,CAAA,UAAa,aAAa,EAAA;AACtB,IAAA,aAAA,CAAA,aAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACN,IAAA,aAAA,CAAA,aAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAO,CAAA;AACP,IAAA,aAAA,CAAA,aAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAQ,CAAA;AACR,IAAA,aAAA,CAAA,aAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAO,CAAA;AACX,CAAC,EALY,aAAa,KAAb,aAAa,GAKzB,EAAA,CAAA,CAAA,CAAA;AAED;;AAEG;IACS,OAGX;AAHD,CAAA,UAAY,MAAM,EAAA;AAChB,IAAA,MAAA,CAAA,MAAA,C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,GAAA,SAAO,CAAA;AACX,CAAC,EALY,aAAa,KAAb,aAAa,GAKzB,EAAA,CAAA,CAAA,CAAA;AAED;;AAEG;IACS,OAGX;AAHD,CAAA,UAAY,MAAM,EAAA;AAChB,IAAA,MAAA,CAAA,MAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAK,CAAA;AACL,IAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;AACN,CAAC,EAHW,MAAM,KAAN,MAAM,GAGjB,EAAA,CAAA,CAAA;;;;"} |
+2
-65
@@ -39,2 +39,3 @@ /** | ||
| interface Person { | ||
| id: string; | ||
| firstName: string; | ||
@@ -48,68 +49,4 @@ middleName: string; | ||
| status: Status; | ||
| /** | ||
| * Display the family tree. | ||
| * @param depth | ||
| */ | ||
| displayFamilyTree(depth: number): void; | ||
| } | ||
| interface FamilyOperations { | ||
| /** | ||
| * Set the marital status of the person. | ||
| * @param maritalStatus | ||
| */ | ||
| setMaritalStatus(maritalStatus: MaritalStatus): void; | ||
| /** | ||
| * Set the birth date of the person. | ||
| * @param birthDate | ||
| */ | ||
| setBirthDate(birthDate: Date): void; | ||
| /** | ||
| * Set the death date of person. | ||
| * @param deathDate | ||
| */ | ||
| setDeathDate(deathDate: Date): void; | ||
| /** | ||
| * Set the address of the family. | ||
| * @param address | ||
| */ | ||
| setAddress(address: Address): void; | ||
| } | ||
| declare class FamilyMember implements Person, FamilyOperations { | ||
| firstName: string; | ||
| middleName: string; | ||
| lastName: string; | ||
| gender: Gender; | ||
| children?: FamilyMember[]; | ||
| maritalStatus: MaritalStatus; | ||
| birthDate?: Date; | ||
| deathDate?: Date; | ||
| spouse?: FamilyMember; | ||
| parent?: FamilyMember; | ||
| status: Status; | ||
| address?: Address; | ||
| constructor(firstName: string, middleName: string, lastName: string, gender: Gender, status: Status); | ||
| setAddress(address: Address): void; | ||
| setBirthDate(birthDate: Date): void; | ||
| setDeathDate(deathDate: Date): void; | ||
| setMaritalStatus(maritalStatus: MaritalStatus): void; | ||
| private isMarried; | ||
| private isAlive; | ||
| /** | ||
| * Set the spouse of the person. | ||
| * @param spouse | ||
| */ | ||
| setSpouse(spouse: FamilyMember): void; | ||
| /** | ||
| * Set parent of the person. | ||
| * @param parent | ||
| */ | ||
| setParent(parent: FamilyMember): void; | ||
| /** | ||
| * Add person childrens. | ||
| * @param child | ||
| */ | ||
| addChild(child: FamilyMember): void; | ||
| displayFamilyTree(depth?: number): void; | ||
| } | ||
| export { type Address, FamilyMember, Gender, MaritalStatus, type Person, Status }; | ||
| export { type Address, Gender, MaritalStatus, type Person, Status }; |
+1
-1
| { | ||
| "name": "@master4n/types", | ||
| "version": "1.1.1", | ||
| "version": "1.1.2", | ||
| "description": "Node Types For Application", | ||
@@ -5,0 +5,0 @@ "main": "cjs/index.cjs", |
+0
-5
@@ -13,9 +13,4 @@ # Installation | ||
| ### Additional Details | ||
| * Last updated: Thu, 04 Jan 2024 | ||
| * Dependencies: none | ||
| ## Credits | ||
| These definitions were written by [Master4Novice](https://github.com/Master4Novice). |
| export declare class SinglePersonError extends Error { | ||
| constructor(); | ||
| } |
| /** | ||
| * Gender Person Status. | ||
| */ | ||
| export declare enum Gender { | ||
| MALE = 0, | ||
| FEMALE = 1, | ||
| OTHERS = 2 | ||
| } | ||
| /** | ||
| * Marital Person Status. | ||
| */ | ||
| export declare enum MaritalStatus { | ||
| SINGLE = 0, | ||
| MARRIED = 1, | ||
| DIVORCED = 2, | ||
| WIDOWED = 3 | ||
| } | ||
| /** | ||
| * Alive/Dead Person Status | ||
| */ | ||
| export declare enum Status { | ||
| ALIVE = 0, | ||
| DEAD = 1 | ||
| } | ||
| /** | ||
| * Address of the person's family | ||
| */ | ||
| export interface Address { | ||
| country: string; | ||
| state: string; | ||
| district: string; | ||
| village: string; | ||
| pin: number; | ||
| } | ||
| /** | ||
| * Person Details | ||
| */ | ||
| export interface Person { | ||
| firstName: string; | ||
| middleName: string; | ||
| lastName: string; | ||
| gender: Gender; | ||
| birthDate?: Date; | ||
| deathDate?: Date; | ||
| maritalStatus: MaritalStatus; | ||
| status: Status; | ||
| /** | ||
| * Display the family tree. | ||
| * @param depth | ||
| */ | ||
| displayFamilyTree(depth: number): void; | ||
| } | ||
| interface FamilyOperations { | ||
| /** | ||
| * Set the marital status of the person. | ||
| * @param maritalStatus | ||
| */ | ||
| setMaritalStatus(maritalStatus: MaritalStatus): void; | ||
| /** | ||
| * Set the birth date of the person. | ||
| * @param birthDate | ||
| */ | ||
| setBirthDate(birthDate: Date): void; | ||
| /** | ||
| * Set the death date of person. | ||
| * @param deathDate | ||
| */ | ||
| setDeathDate(deathDate: Date): void; | ||
| /** | ||
| * Set the address of the family. | ||
| * @param address | ||
| */ | ||
| setAddress(address: Address): void; | ||
| } | ||
| export declare class FamilyMember implements Person, FamilyOperations { | ||
| firstName: string; | ||
| middleName: string; | ||
| lastName: string; | ||
| gender: Gender; | ||
| children?: FamilyMember[]; | ||
| maritalStatus: MaritalStatus; | ||
| birthDate?: Date; | ||
| deathDate?: Date; | ||
| spouse?: FamilyMember; | ||
| parent?: FamilyMember; | ||
| status: Status; | ||
| address?: Address; | ||
| constructor(firstName: string, middleName: string, lastName: string, gender: Gender, status: Status); | ||
| setAddress(address: Address): void; | ||
| setBirthDate(birthDate: Date): void; | ||
| setDeathDate(deathDate: Date): void; | ||
| setMaritalStatus(maritalStatus: MaritalStatus): void; | ||
| private isMarried; | ||
| private isAlive; | ||
| /** | ||
| * Set the spouse of the person. | ||
| * @param spouse | ||
| */ | ||
| setSpouse(spouse: FamilyMember): void; | ||
| /** | ||
| * Set parent of the person. | ||
| * @param parent | ||
| */ | ||
| setParent(parent: FamilyMember): void; | ||
| /** | ||
| * Add person childrens. | ||
| * @param child | ||
| */ | ||
| addChild(child: FamilyMember): void; | ||
| displayFamilyTree(depth?: number): void; | ||
| } | ||
| export {}; |
| export declare class SinglePersonError extends Error { | ||
| constructor(); | ||
| } |
| /** | ||
| * Gender Person Status. | ||
| */ | ||
| export declare enum Gender { | ||
| MALE = 0, | ||
| FEMALE = 1, | ||
| OTHERS = 2 | ||
| } | ||
| /** | ||
| * Marital Person Status. | ||
| */ | ||
| export declare enum MaritalStatus { | ||
| SINGLE = 0, | ||
| MARRIED = 1, | ||
| DIVORCED = 2, | ||
| WIDOWED = 3 | ||
| } | ||
| /** | ||
| * Alive/Dead Person Status | ||
| */ | ||
| export declare enum Status { | ||
| ALIVE = 0, | ||
| DEAD = 1 | ||
| } | ||
| /** | ||
| * Address of the person's family | ||
| */ | ||
| export interface Address { | ||
| country: string; | ||
| state: string; | ||
| district: string; | ||
| village: string; | ||
| pin: number; | ||
| } | ||
| /** | ||
| * Person Details | ||
| */ | ||
| export interface Person { | ||
| firstName: string; | ||
| middleName: string; | ||
| lastName: string; | ||
| gender: Gender; | ||
| birthDate?: Date; | ||
| deathDate?: Date; | ||
| maritalStatus: MaritalStatus; | ||
| status: Status; | ||
| /** | ||
| * Display the family tree. | ||
| * @param depth | ||
| */ | ||
| displayFamilyTree(depth: number): void; | ||
| } | ||
| interface FamilyOperations { | ||
| /** | ||
| * Set the marital status of the person. | ||
| * @param maritalStatus | ||
| */ | ||
| setMaritalStatus(maritalStatus: MaritalStatus): void; | ||
| /** | ||
| * Set the birth date of the person. | ||
| * @param birthDate | ||
| */ | ||
| setBirthDate(birthDate: Date): void; | ||
| /** | ||
| * Set the death date of person. | ||
| * @param deathDate | ||
| */ | ||
| setDeathDate(deathDate: Date): void; | ||
| /** | ||
| * Set the address of the family. | ||
| * @param address | ||
| */ | ||
| setAddress(address: Address): void; | ||
| } | ||
| export declare class FamilyMember implements Person, FamilyOperations { | ||
| firstName: string; | ||
| middleName: string; | ||
| lastName: string; | ||
| gender: Gender; | ||
| children?: FamilyMember[]; | ||
| maritalStatus: MaritalStatus; | ||
| birthDate?: Date; | ||
| deathDate?: Date; | ||
| spouse?: FamilyMember; | ||
| parent?: FamilyMember; | ||
| status: Status; | ||
| address?: Address; | ||
| constructor(firstName: string, middleName: string, lastName: string, gender: Gender, status: Status); | ||
| setAddress(address: Address): void; | ||
| setBirthDate(birthDate: Date): void; | ||
| setDeathDate(deathDate: Date): void; | ||
| setMaritalStatus(maritalStatus: MaritalStatus): void; | ||
| private isMarried; | ||
| private isAlive; | ||
| /** | ||
| * Set the spouse of the person. | ||
| * @param spouse | ||
| */ | ||
| setSpouse(spouse: FamilyMember): void; | ||
| /** | ||
| * Set parent of the person. | ||
| * @param parent | ||
| */ | ||
| setParent(parent: FamilyMember): void; | ||
| /** | ||
| * Add person childrens. | ||
| * @param child | ||
| */ | ||
| addChild(child: FamilyMember): void; | ||
| displayFamilyTree(depth?: number): void; | ||
| } | ||
| export {}; |
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
8475
-64.19%12
-14.29%205
-66.45%16
-23.81%