# Class Package

Represents a deep package

#### Remarks

This class intended to be extended by packages

#### Example

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

- Defined in work/deeplinks/deeplinks/imports/package.ts:19

#####
Index

### Constructors

constructor

### Properties

deep
name

### Methods

applyMiniLinks
createEntity
id
idLocal

## Constructors

### constructor

- new Package(options): Package

- #### Parameters

  - ##### options: PackageOptions

  #### Returns Package

  - Defined in work/deeplinks/deeplinks/imports/package.ts:26

## Properties

### deep

deep: DeepClientInstance<Link<number>>

- Defined in work/deeplinks/deeplinks/imports/package.ts:20

### name

name: string

Name of the package

- Defined in work/deeplinks/deeplinks/imports/package.ts:24

## Methods

### applyMiniLinks

- applyMiniLinks(): Promise<{
  anomalies?: MinilinkError[];
  errors?: MinilinkError[];
  }>

- Pastes your links into minilinks

  #### Returns Promise<{
  anomalies?: MinilinkError[];
  errors?: MinilinkError[];
  }>

  #### Example

  #### Use applyMiniLinks and idLocal

      const package = new Package({deep});
      await package.applyMiniLinks();
      const deviceLinkId = await package.Device.idLocal();

  - Defined in work/deeplinks/deeplinks/imports/package.ts:141

### createEntity

- createEntity(name): {
  id: (() => Promise<number>);
  idLocal: (() => number);
  name: string;
  }

- Creates an entity

  #### Parameters

  - ##### name: string

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

  - ##### id: (() => Promise<number>)

    Gets id of the link

    #### Example

    #### Get id of the link

        const myPackage = new MyPackage({deep});
        const myLinkId = await myPackage.yourLinkName.id();

    - - (): Promise<number>

      - Gets id of the link

        #### Returns Promise<number>

        #### Example

        #### Get id of the link

            const myPackage = new MyPackage({deep});
            const myLinkId = await myPackage.yourLinkName.id();

  - ##### idLocal: (() => number)

    Gets id of the link from minilinks

    #### Example

    #### Get id of the link from minilinks

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

    - - (): number

      - Gets id of the link from minilinks

        #### Returns number

        #### Example

        #### Get id of the link from minilinks

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

  - ##### name: string

    Name of the link

  #### Example

  #### Create an entity

      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();

  - Defined in work/deeplinks/deeplinks/imports/package.ts:47

### id

- id(...names): Promise<number>

- Gets id of the package link

  #### Parameters

  - ##### `Rest` ...names: string[]

  #### Returns Promise<number>

  #### Example

  #### Get id of the package link

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

  - Defined in work/deeplinks/deeplinks/imports/package.ts:99

### idLocal

- idLocal(...names): number

- Gets id of the package link from minilinks

  #### Parameters

  - ##### `Rest` ...names: string[]

  #### Returns number

  #### Example

  #### Get id of the package link from minilinks

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

  - Defined in work/deeplinks/deeplinks/imports/package.ts:120

Generated using TypeDoc