mraid-type-definitions
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

mraid-type-definitions

MRAID or “Mobile Rich Media Ad Interface Definitions” is a standard set by the IAB (Interactive Advertising Bureau) to mitigate advertisers headaches of in-app advertising caused by myriads of mobile devices running on different platforms (operating system).

This package is the type definition for MRAID. 🚀

Getting Started

# Clone the repository (you can also click "Use this template")
git clone https://github.com/sumn2u/mraid-type-definitions.git your_project_name
cd your_project_name

# Edit `package.json` and `tsconfig.json` to your liking
...

# Install dependencies
yarn install

# Now you can run various yarn commands:
yarn lint
yarn test
yarn build
yarn clean
yarn ts-node <filename>
...

Compiles and minifies build for production

yarn build

Tests with Jest

Tests can be written with Jest:

import {MRAID1, MRAID2, MRAID3 } from './main'
describe('MRAID Versions', () => {
  const identity = (property: MRAID1| MRAID2 | MRAID3 ): MRAID1| MRAID2 | MRAID3  => property;
  test('Should return mraid version', () => {
    const testVersion: Partial<MRAID1> = { getVersion: jest.fn( () =>  "3.0")};
    expect(identity(testVersion as MRAID1))
    .toEqual(testVersion);
  });
})

Run the tests with yarn test, no separate compile step is necessary.

Usage

It can used as dependency by providing branch name or commit id after #.

 "mraid-type-definitions": "git+ssh://git@github.com/sumn2u/mraid-type-definitions.git#<branch_name or commit_id>"

References

Feedback

Reach out with feedback and ideas:

Package Sidebar

Install

npm i mraid-type-definitions

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

19.2 kB

Total Files

13

Last publish

Collaborators

  • iamsuman