# 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<Id>>

- 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[];
  data: Link<Id>[];
  errors?: MinilinkError[];
  plainLinks: Link<Id>[];
  }>

- Pastes your links into minilinks

  #### Returns Promise<{
  anomalies?: MinilinkError[];
  data: Link<Id>[];
  errors?: MinilinkError[];
  plainLinks: Link<Id>[];
  }>

  #### 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<Id>);
  idLocal: (() => Id);
  name: string;
  }

- Creates an entity

  #### Parameters

  - name: string

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

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

    Gets id of the link

    #### Example

    #### Get 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

    #### Example

    #### Get id of the link from minilinks

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

    - - (): Id

      - #### Returns Id

  - ##### 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<Id>

- Gets id of the package link

  #### Parameters

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

  #### Returns Promise<Id>

  #### 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): Id

- Gets id of the package link from minilinks

  #### Parameters

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

  #### Returns Id

  #### 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