export interface MarkAsSafeFunction { (value:string): any; } export interface AnalyticsAPI { /** * Generates an analytics event asynchronously. The calling thread should not be * blocked by messaging or persistence relating to the event. * @param category This describes the main subject of the event. Typically this will * be the name of the module that the event is being triggered from (e.g. 'Dialog'). * @param action This describes the interaction relating to the event. For example, * if a dialog is being opened, then this might be 'open'. * @param appKey The key of the add-on causing the event. * @param payload This optional parameter provides extra unstructured data relating to * the event in the form of key value pairs. Taking the dialog example further, this may * be {buttonCount: 3, closeOnSubmit: false, contentLength: 658}. */ trigger(category: any, action: any, appKey: any, payload: any): void; /** * The preferred method of marking strings as privacy safe * @param allowedStrings A list of allowed strings to match against * @return function that compares the string against the allowed list and * returns something that is considered privacy safe by the product */ markAsSafe(...allowedStrings:string[]): MarkAsSafeFunction; /* * To be used for variable data (such as addon keys or numbers) which cannot * be predicted ahead of time * @param value The string to marked as privacy safe * @return something that is considered privacy safe by the product */ dangerouslyCreateSafeString(value: string): any; }