Currently, I am diving into the world of typescript but there are a few concepts that still elude me. Some of these include:
1) My confusion lies within this snippet of code: Object = Object.assign
export const htmlElementsMap: Object = Object.assign(
{},
homePageElementsMap,
loginPageElementsMap,
productDetailPageElementsMap,
productListPageElementsMap,
shoppingBagPageElementsMap,
thankYouPageElementsMap
);
2) Similarly, I'm unsure about this segment:
export const UrlNavigationMap: Object = {
What exactly is an object?
3) The usage of PromiseLike<void>
in this function has me puzzled:
performAs(actor: PerformsTasks): PromiseLike<void> {
return actor.attemptsTo(
Click.on(homePageElementsMap.lnk_men),
SearchItemBySku.called()
);
}
4) In the line
export class FillShippingAddress implements Task {}
, what does 'implements' signify?
Finally,
5) Can you explain the concept of static
and its association with the class name in TypeScript?
export class AddItemsToShoppingBag implements Task{
static called(gender: string): AddItemsToShoppingBag {
return new AddItemsToShoppingBag(gender);
}