Skip to content
Toolkit for dealing with Telegram Stickers and Bodymovin/Lottie animations.
TypeScript HTML
Branch: master
Clone or download
Latest commit c82b80d Jul 9, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Initial draft Jul 9, 2019
src Fix validations structure Jul 9, 2019
.editorconfig Initial draft Jul 9, 2019
.gitignore Initial draft Jul 9, 2019
.npmignore Initial draft Jul 9, 2019
README.md Update Readme Jul 9, 2019
package.json Bump version 0.0.4 Jul 9, 2019
tsconfig.json Initial draft Jul 9, 2019
tslint.json Initial draft Jul 9, 2019

README.md

Telegram Sticker Kit by LottieFiles

Toolkit for dealing with Telegram Stickers and Bodymovin/Lottie animations

Installation

In HTML, import from CDN or from the local Installation:

Lottie Player:
  • Import from CDN.
<script src="https://unpkg.com/@lottiefiles/tgskit@0.0.4/dist/tgskit.js"></script>
  • Import from local node_modules directory.
<script src="/node_modules/@lottiefiles/tgskit/dist/tgskit.js"></script>

In Javascript or TypeScript:

  1. Install package using npm or yarn.
npm install --save @lottiefiles/tgskit
  1. Import package in your code.
import { TGSKit } from '@lottiefiles/tgskit';

Usage

const anim = new TGSKit();

anim.load('http://localhost:1234/bodymovin.json')
  .then(() => {
    const errors = anim.validate();

    if (errors.length === 0) {
      anim.download('sticker');
    } else {
      console.log('Given JSON does not meet requirements for a TGS:');
      console.log(errors);
    }
  })
  .catch(err => {
    console.log('There was an error loading the src resource', err);
  });

Docs

TGSKit class documentation is available in the /docs/ directory.

You can’t perform that action at this time.