4irbnb

Replicating airbnb following the atomic design principles...

View the Project on GitHub kokiebisu/4irbnb

Home > @nextbnb/common

common package

@nextbnb/common is a package containing the interfaces and functions to validate the interface that can be utilized in other packages.

Remarks

Interfaces have a prefix of ‘I’

Classes

Class Description
ApiError Blueprint for the ApiError
BaseError Blueprint for the BaseError which will be extended by other specific errors
Experience Class to create the Experience instance
UnauthorizedError Customized error to be thrown when the user tries to perform an authorized action

Enumerations

Enumeration Description
HttpMethods List of all the HTTP methods
Service List of all the Services

Functions

Function Description
isExperience(arg) Checks whether a given value is an IExperience
isStay(arg) Checks whether a given value is an IStay
isUser(arg) Checks whether a given value is an IUser

Interfaces

Interface Description
IApiError Interface for the ApiError class
IBaseError Interface for the BaseError instance
IBaseErrorConstructor Interface for constructing the BaseError instance
IContext Interface of the Context
IExperience An experience posted by the user
IHost Interface for the Host
IHostConstructor Params to be passed to create the Host instance
IRole Interface of the serviceRoles property in Context
IStay A stay posted by the user
IUnauthorizedError Interface for the IUnauthorizedError instance
IUser A user

Variables

Variable Description
createExperience Factory to create Experience
createHost Factory to create Hosts
createStay Factory to create the Stay instance
createUser Factory to create the User instance
isHost Checks whether a given value is an IHost

Type Aliases

Type Alias Description
TEnvironment Type of environment