Represents a deep package

This class intended to be extended by packages

const package = new Package({deep, name});
const {name: packageName} = package;
const batteryLevelValueLinkId = await package.batteryLevelValue.id();

Constructors

Properties

Methods

Constructors

Properties

name: string

Name of the package

Methods

  • Creates an entity

    Parameters

    • name: string

    Returns {
        id: (() => Promise<Id>);
        idLocal: (() => Id);
        name: string;
    }

    • id: (() => Promise<Id>)

      Gets id of the link

      const myPackage = new MyPackage({deep});
      const myLinkId = await myPackage.yourLinkName.id();
        • (): Promise<Id>
        • Returns Promise<Id>

    • idLocal: (() => Id)

      Gets id of the link from minilinks

      const myPackage = new MyPackage({deep});
      const myLinkLocalId = await myPackage.yourLinkName.idLocal();
    • name: string

      Name of the link

    class MyPackage extends Package {
    public yourLinkName = this.createEntity("YourLinkName");
    }
    const myPackage = new MyPackage({deep});
    const myLinkId = await myPackage.yourLinkName.id();
    const myLinkLocalId = await myPackage.yourLinkName.idLocal();
  • Gets id of the package link

    Parameters

    • Rest...names: string[]

    Returns Promise<Id>

    const package = new Package({deep});
    const myLinkId = await package.id("MyLinkName");
  • Gets id of the package link from minilinks

    Parameters

    • Rest...names: string[]

    Returns Id

    const package = new Package({deep});
    await package.applyMiniLinks();
    const myLinkId = await package.idLocal("MyLinkName");