<promise void> in typescript

11,362
  1. I am but not the part const htmlElementsMap: Object

:Object is a type annotation. Some notes on type annotations

  1. What is an Object

It is the type of standard JavaScript objects : https://developer.mozilla.org/en-US/docs/Glossary/Object

  1. what does this PromiseLike<void> means:

PromiseLike is something that follows the a+ promise spec : https://promisesaplus.com/

The browser native Promise is one implementation : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

<void> is a generic type annotation.

  1. What does implements means

It means it follows the types present in the interface.

  1. What is a static and why it is assigned to the class name

What is static: It is a type of member present on classes.

Why it is assigned to the class name: It is not. : AddItemsToShoppingBag is a return type annotation, not an assignment.

Share:
11,362

Related videos on Youtube

J Don
Author by

J Don

Updated on June 04, 2022

Comments

  • J Don
    J Don almost 2 years

    I am trying to learn typescript but i am not clear on few concepts on typescript such as:

    1) I am but not the part Object = Object.assign

    export const htmlElementsMap: Object = Object.assign(
      {},
      homePageElementsMap,
      loginPageElementsMap,
      productDetailPageElementsMap,
      productListPageElementsMap,
      shoppingBagPageElementsMap,
      thankYouPageElementsMap
    );
    

    2) Same with this part export const UrlNavigationMap: Object = { What is an object?

    3) For this function i am not sure what does this PromiseLike<void> means:

    performAs(actor: PerformsTasks): PromiseLike<void> {
        return actor.attemptsTo(
          Click.on(homePageElementsMap.lnk_men),
          SearchItemBySku.called()
        );
      }
    

    4) export class FillShippingAddress implements Task {} - What does implements means?

    and last:

    5) What is a static and why it is assigned to the class name?

    export class AddItemsToShoppingBag implements Task{
      static called(gender: string): AddItemsToShoppingBag {
        return new AddItemsToShoppingBag(gender);
      }
    
    • Explosion Pills
      Explosion Pills over 6 years
      You have several questions here so you should probably split them up, but a lot of these questions have existing answers. For starters: stackoverflow.com/questions/43712705/…