|
| 1 | +/** |
| 2 | + * Copyright 2020, Optimizely |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +declare module '@optimizely/optimizely-sdk/lib/core/event_builder' { |
| 18 | + import { ProjectConfig } from '@optimizely/optimizely-sdk/lib/core/project_config'; |
| 19 | + import { LogHandler } from '@optimizely/js-sdk-logging'; |
| 20 | + import { Event as EventLoggingEndpoint } from '@optimizely/optimizely-sdk'; |
| 21 | + |
| 22 | + interface ImpressionOptions { |
| 23 | + attributes?: import('../../shared_types').UserAttributes; |
| 24 | + clientEngine: string; |
| 25 | + clientVersion: string; |
| 26 | + configObj: ProjectConfig; |
| 27 | + experimentId: string; |
| 28 | + eventKey?: string; |
| 29 | + variationId: string; |
| 30 | + logger?: LogHandler; |
| 31 | + userId: string; |
| 32 | + } |
| 33 | + |
| 34 | + interface ConversionEventOptions { |
| 35 | + attributes?: import('../../shared_types').UserAttributes; |
| 36 | + clientEngine: string; |
| 37 | + clientVersion: string; |
| 38 | + configObj: ProjectConfig; |
| 39 | + eventKey: string; |
| 40 | + logger: LogHandler; |
| 41 | + userId: string; |
| 42 | + eventTags?: import('../../shared_types').EventTags; |
| 43 | + } |
| 44 | + |
| 45 | + /** |
| 46 | + * Create impression event params to be sent to the logging endpoint |
| 47 | + * @param {ImpressionOptions} options Object containing values needed to build impression event |
| 48 | + * @return {EventLoggingEndpoint} Params to be used in impression event logging endpoint call |
| 49 | + */ |
| 50 | + export function getImpressionEvent(options: ImpressionOptions): EventLoggingEndpoint; |
| 51 | + |
| 52 | + /** |
| 53 | + * Create conversion event params to be sent to the logging endpoint |
| 54 | + * @param {ConversionEventOptions} options Object containing values needed to build conversion event |
| 55 | + * @return {EventLoggingEndpoint} Params to be used in conversion event logging endpoint call |
| 56 | + */ |
| 57 | + export function getConversionEvent(options: ConversionEventOptions): EventLoggingEndpoint; |
| 58 | +} |
0 commit comments