README
snapshot
POISnapshot models Javascript utilities to decode to a POISnapshot
Installation
$ npm install @advertima/snapshot --save
The @advertima/snapshot type definitions are included in the npm package.
Basics
import { POISnapshot } from '@advertima/snapshot';
// Decode binary snapshot
const snapshot = POISnapshot.decode(someBinaryData);
Test Utils
We provide you an easy way to create a POISnapshot instance of a PersonDetection instance for your tests.
import {
PersonDetectionGenerator,
POISnapshotGenerator,
ContentMessageGenerator,
} from '@advertima/snapshot';
const person = PersonDetectionGenerator.generate({ age: 27, gender: 'male', y: 1.4 });
const params1 = { age: 27, gender: 'female', name: 'toto' };
const params2 = { age: 28, gender: 'male', name: 'titi' };
const snapshot = POISnapshotGenerator.generate([params1, params2]);
const contentMessage = ContentMessageGenerator.generate({
localTimestamp: 1537362300000,
contentId: '1',
name: 'start',
personPutIds: [],
poi: 1,
});
License
@advertima/snapshot is MIT licensed.