client-personalization.d.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import { ClientTransporterOptions } from '@algolia/client-common';
  2. import { CreateClient } from '@algolia/client-common';
  3. import { RequestOptions } from '@algolia/transporter';
  4. import { Transporter } from '@algolia/transporter';
  5. export declare const createPersonalizationClient: CreateClient<PersonalizationClient, PersonalizationClientOptions & ClientTransporterOptions>;
  6. export declare const getPersonalizationStrategy: (base: PersonalizationClient) => (requestOptions?: RequestOptions | undefined) => Readonly<Promise<GetPersonalizationStrategyResponse>>;
  7. export declare type GetPersonalizationStrategyResponse = {
  8. /**
  9. * Events scoring
  10. */
  11. eventsScoring: Array<{
  12. eventName: string;
  13. eventType: string;
  14. score: number;
  15. }>;
  16. /**
  17. * Facets scoring
  18. */
  19. facetsScoring: Array<{
  20. facetName: string;
  21. score: number;
  22. }>;
  23. /**
  24. * Personalization impact
  25. */
  26. personalizationImpact: number;
  27. };
  28. export declare type PersonalizationClient = {
  29. /**
  30. * The application id.
  31. */
  32. readonly appId: string;
  33. /**
  34. * The underlying transporter.
  35. */
  36. readonly transporter: Transporter;
  37. };
  38. export declare type PersonalizationClientOptions = {
  39. /**
  40. * The application id.
  41. */
  42. readonly appId: string;
  43. /**
  44. * The api key.
  45. */
  46. readonly apiKey: string;
  47. /**
  48. * The prefered region.
  49. */
  50. readonly region?: string;
  51. };
  52. export declare type PersonalizationStrategy = {
  53. /**
  54. * Events scoring
  55. */
  56. readonly eventsScoring: ReadonlyArray<{
  57. readonly eventName: string;
  58. readonly eventType: string;
  59. readonly score: number;
  60. }>;
  61. /**
  62. * Facets scoring
  63. */
  64. readonly facetsScoring: ReadonlyArray<{
  65. readonly facetName: string;
  66. readonly score: number;
  67. }>;
  68. /**
  69. * Personalization impact
  70. */
  71. readonly personalizationImpact: number;
  72. };
  73. export declare const setPersonalizationStrategy: (base: PersonalizationClient) => (personalizationStrategy: PersonalizationStrategy, requestOptions?: RequestOptions | undefined) => Readonly<Promise<SetPersonalizationStrategyResponse>>;
  74. export declare type SetPersonalizationStrategyResponse = {
  75. /**
  76. * The status code.
  77. */
  78. status?: number;
  79. /**
  80. * The message.
  81. */
  82. message: string;
  83. };
  84. export { }