inbrain-surveys
Version:
In-App monetization via surveys, powered by inBrain.ai.
160 lines (159 loc) • 3.65 kB
TypeScript
/**
* Native Surveys interface
*/
export type InBrainNativeSurvey = {
id: string;
searchId: string;
rank: number;
time: number;
value: number;
currencySale: boolean;
multiplier: number;
namedCategories?: Category[];
isProfilerSurvey: boolean;
/**
* All the possible cases are listed at `ConversionLevel` declaration
*/
conversionLevel: ConversionLevel;
};
/**
* Native Survey's Category interface
*/
export type Category = {
id: number;
name: string;
};
/**
* InBrainReward interface
*/
export type InBrainReward = {
transactionId: number;
amount: number;
currency: string;
transactionType: number;
};
/**
* ConversionLevel interface
*
* Possible cases are:
* 0 = New Survey;
* 1 = Very Poor Conversion;
* 2 = Poor Conversion;
* 3 = Fair Conversion
* 4 = Good Conversion;
* 5 = Very Good Conversion;
* 6 = Excellent Conversion
*
*/
export type ConversionLevel = {
id: number;
name: string;
};
/**
* InBrainSurveyFilter
*/
export type InBrainSurveyFilter = {
placementId?: string;
categoryIds?: number[];
excludedCategoryIds?: number[];
};
/**
* OpenWallOption
*/
export declare enum InBrainWallOption {
all = 0,
surveys = 1,
offers = 2
}
/**
* InBrainSurveyCategory
*/
export declare const InBrainSurveyCategory: {
Automotive: number;
BeveragesAlcoholic: number;
BeveragesNonAlcoholic: number;
Business: number;
ChildrenAndParenting: number;
CoalitionLoyaltyPrograms: number;
DestinationsAndTourism: number;
Education: number;
ElectronicsComputerSoftware: number;
EntertainmentAndLeisure: number;
FinanceBankingInvestingAndInsurance: number;
Food: number;
GamblingLottery: number;
GovernmentAndPolitics: number;
HealthCare: number;
Home: number;
MediaAndPublishing: number;
PersonalCare: number;
Restaurants: number;
SensitiveExplicitContent: number;
SmokingTobacco: number;
SocialResearch: number;
SportsRecreationFitness: number;
Telecommunications: number;
Transportation: number;
TravelAirlines: number;
TravelHotels: number;
TravelServicesAgencyBooking: number;
CreditCards: number;
VideoGames: number;
FashionAndClothingOther: number;
FashionAndClothingDepartmentStore: number;
};
/**
* Data returned with OnSurveysClose event
*/
export type OnCloseSurveysData = {
byWebView: boolean;
/**
* At the moment only first Native Survey reward is delivered.
* That means if the user complete a Native Survey, proceed to Survey Wall and complete one more survey -
* only first reward will be delivered. In case of Survey Wall usage only - no rewards will be delivered.
*/
rewards?: InBrainSurveyReward[];
};
/**
* Survey Outcome Type
*
* Possible cases are:
* 0 = Completed;
* 1 = Terminated;
*
*/
export type SurveyOutcomeType = {
id: number;
name: string;
};
/**
* Survey reward interface
*/
export type InBrainSurveyReward = {
surveyId: string;
userReward: number;
outcomeType: SurveyOutcomeType;
placementId?: string;
categories?: Category[];
};
/**
* Survey Currency Sale interface
*/
export type InBrainCurrencySale = {
title: string;
multiplier: number;
startOn: Date;
endOn: Date;
};
/**
* @unsupported Please, use InBrainNativeSurvey instead
*/
export type InBrainNativeSurveys = {};
/**
* @unsupported The type is not supported anymore
*/
export type ProfileMatch = {};
/**
* @unsupported The type is not supported anymore
*/
export declare const ProfileMatchNames: {};