posthog-react-native 3.13.2 → 3.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/lib/index.cjs.js +4677 -0
  2. package/lib/index.cjs.js.map +1 -0
  3. package/lib/index.d.ts +875 -0
  4. package/lib/index.esm.js +4659 -0
  5. package/lib/index.esm.js.map +1 -0
  6. package/lib/posthog-core/src/eventemitter.d.ts +8 -8
  7. package/lib/posthog-core/src/featureFlagUtils.d.ts +34 -34
  8. package/lib/posthog-core/src/index.d.ts +239 -239
  9. package/lib/posthog-core/src/lz-string.d.ts +8 -8
  10. package/lib/posthog-core/src/types.d.ts +423 -422
  11. package/lib/posthog-core/src/utils.d.ts +19 -16
  12. package/lib/posthog-core/src/vendor/uuidv7.d.ts +179 -179
  13. package/lib/posthog-react-native/index.d.ts +10 -10
  14. package/lib/posthog-react-native/src/PostHogContext.d.ts +5 -5
  15. package/lib/posthog-react-native/src/PostHogProvider.d.ts +14 -14
  16. package/lib/posthog-react-native/src/autocapture.d.ts +4 -4
  17. package/lib/posthog-react-native/src/frameworks/wix-navigation.d.ts +3 -3
  18. package/lib/posthog-react-native/src/hooks/useFeatureFlag.d.ts +5 -5
  19. package/lib/posthog-react-native/src/hooks/useFeatureFlags.d.ts +3 -3
  20. package/lib/posthog-react-native/src/hooks/useNavigationTracker.d.ts +6 -6
  21. package/lib/posthog-react-native/src/hooks/usePostHog.d.ts +2 -2
  22. package/lib/posthog-react-native/src/legacy.d.ts +4 -4
  23. package/lib/posthog-react-native/src/native-deps.d.ts +4 -4
  24. package/lib/posthog-react-native/src/optional/OptionalAsyncStorage.d.ts +2 -2
  25. package/lib/posthog-react-native/src/optional/OptionalExpoApplication.d.ts +2 -2
  26. package/lib/posthog-react-native/src/optional/OptionalExpoDevice.d.ts +2 -2
  27. package/lib/posthog-react-native/src/optional/OptionalExpoFileSystem.d.ts +2 -2
  28. package/lib/posthog-react-native/src/optional/OptionalExpoLocalization.d.ts +2 -2
  29. package/lib/posthog-react-native/src/optional/OptionalReactNativeDeviceInfo.d.ts +2 -2
  30. package/lib/posthog-react-native/src/optional/OptionalReactNativeLocalize.d.ts +13 -13
  31. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigation.d.ts +2 -2
  32. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigationWix.d.ts +2 -2
  33. package/lib/posthog-react-native/src/optional/OptionalReactNativeSafeArea.d.ts +2 -2
  34. package/lib/posthog-react-native/src/optional/OptionalSessionReplay.d.ts +2 -2
  35. package/lib/posthog-react-native/src/posthog-rn.d.ts +71 -71
  36. package/lib/posthog-react-native/src/storage.d.ts +21 -21
  37. package/lib/posthog-react-native/src/surveys/PostHogSurveyProvider.d.ts +16 -16
  38. package/lib/posthog-react-native/src/surveys/components/BottomSection.d.ts +9 -9
  39. package/lib/posthog-react-native/src/surveys/components/Cancel.d.ts +6 -6
  40. package/lib/posthog-react-native/src/surveys/components/ConfirmationMessage.d.ts +13 -13
  41. package/lib/posthog-react-native/src/surveys/components/QuestionHeader.d.ts +7 -7
  42. package/lib/posthog-react-native/src/surveys/components/QuestionTypes.d.ts +27 -27
  43. package/lib/posthog-react-native/src/surveys/components/SurveyModal.d.ts +10 -10
  44. package/lib/posthog-react-native/src/surveys/components/Surveys.d.ts +14 -14
  45. package/lib/posthog-react-native/src/surveys/getActiveMatchingSurveys.d.ts +2 -2
  46. package/lib/posthog-react-native/src/surveys/icons.d.ts +10 -8
  47. package/lib/posthog-react-native/src/surveys/index.d.ts +6 -6
  48. package/lib/posthog-react-native/src/surveys/surveys-utils.d.ts +13 -13
  49. package/lib/posthog-react-native/src/surveys/useActivatedSurveys.d.ts +3 -3
  50. package/lib/posthog-react-native/src/surveys/useSurveyStorage.d.ts +8 -8
  51. package/lib/posthog-react-native/src/types.d.ts +112 -112
  52. package/lib/posthog-react-native/src/version.d.ts +1 -1
  53. package/lib/posthog-react-native/test/test-utils.d.ts +2 -0
  54. package/package.json +9 -8
  55. package/lib/posthog-core/src/eventemitter.js +0 -1
  56. package/lib/posthog-core/src/eventemitter.js.map +0 -1
  57. package/lib/posthog-core/src/featureFlagUtils.js +0 -1
  58. package/lib/posthog-core/src/featureFlagUtils.js.map +0 -1
  59. package/lib/posthog-core/src/index.js +0 -1
  60. package/lib/posthog-core/src/index.js.map +0 -1
  61. package/lib/posthog-core/src/lz-string.js +0 -1
  62. package/lib/posthog-core/src/lz-string.js.map +0 -1
  63. package/lib/posthog-core/src/types.js +0 -1
  64. package/lib/posthog-core/src/types.js.map +0 -1
  65. package/lib/posthog-core/src/utils.js +0 -1
  66. package/lib/posthog-core/src/utils.js.map +0 -1
  67. package/lib/posthog-core/src/vendor/uuidv7.js +0 -7
  68. package/lib/posthog-core/src/vendor/uuidv7.js.map +0 -1
  69. package/lib/posthog-react-native/index.js +0 -1
  70. package/lib/posthog-react-native/index.js.map +0 -1
  71. package/lib/posthog-react-native/src/PostHogContext.js +0 -1
  72. package/lib/posthog-react-native/src/PostHogContext.js.map +0 -1
  73. package/lib/posthog-react-native/src/PostHogProvider.js +0 -1
  74. package/lib/posthog-react-native/src/PostHogProvider.js.map +0 -1
  75. package/lib/posthog-react-native/src/autocapture.js +0 -1
  76. package/lib/posthog-react-native/src/autocapture.js.map +0 -1
  77. package/lib/posthog-react-native/src/frameworks/wix-navigation.js +0 -1
  78. package/lib/posthog-react-native/src/frameworks/wix-navigation.js.map +0 -1
  79. package/lib/posthog-react-native/src/hooks/useFeatureFlag.js +0 -1
  80. package/lib/posthog-react-native/src/hooks/useFeatureFlag.js.map +0 -1
  81. package/lib/posthog-react-native/src/hooks/useFeatureFlags.js +0 -1
  82. package/lib/posthog-react-native/src/hooks/useFeatureFlags.js.map +0 -1
  83. package/lib/posthog-react-native/src/hooks/useNavigationTracker.js +0 -1
  84. package/lib/posthog-react-native/src/hooks/useNavigationTracker.js.map +0 -1
  85. package/lib/posthog-react-native/src/hooks/usePostHog.js +0 -1
  86. package/lib/posthog-react-native/src/hooks/usePostHog.js.map +0 -1
  87. package/lib/posthog-react-native/src/legacy.js +0 -1
  88. package/lib/posthog-react-native/src/legacy.js.map +0 -1
  89. package/lib/posthog-react-native/src/native-deps.js +0 -1
  90. package/lib/posthog-react-native/src/native-deps.js.map +0 -1
  91. package/lib/posthog-react-native/src/optional/OptionalAsyncStorage.js +0 -1
  92. package/lib/posthog-react-native/src/optional/OptionalAsyncStorage.js.map +0 -1
  93. package/lib/posthog-react-native/src/optional/OptionalExpoApplication.js +0 -1
  94. package/lib/posthog-react-native/src/optional/OptionalExpoApplication.js.map +0 -1
  95. package/lib/posthog-react-native/src/optional/OptionalExpoDevice.js +0 -1
  96. package/lib/posthog-react-native/src/optional/OptionalExpoDevice.js.map +0 -1
  97. package/lib/posthog-react-native/src/optional/OptionalExpoFileSystem.js +0 -1
  98. package/lib/posthog-react-native/src/optional/OptionalExpoFileSystem.js.map +0 -1
  99. package/lib/posthog-react-native/src/optional/OptionalExpoLocalization.js +0 -1
  100. package/lib/posthog-react-native/src/optional/OptionalExpoLocalization.js.map +0 -1
  101. package/lib/posthog-react-native/src/optional/OptionalReactNativeDeviceInfo.js +0 -1
  102. package/lib/posthog-react-native/src/optional/OptionalReactNativeDeviceInfo.js.map +0 -1
  103. package/lib/posthog-react-native/src/optional/OptionalReactNativeLocalize.js +0 -1
  104. package/lib/posthog-react-native/src/optional/OptionalReactNativeLocalize.js.map +0 -1
  105. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigation.js +0 -1
  106. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigation.js.map +0 -1
  107. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigationWix.js +0 -1
  108. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigationWix.js.map +0 -1
  109. package/lib/posthog-react-native/src/optional/OptionalReactNativeSafeArea.js +0 -1
  110. package/lib/posthog-react-native/src/optional/OptionalReactNativeSafeArea.js.map +0 -1
  111. package/lib/posthog-react-native/src/optional/OptionalSessionReplay.js +0 -1
  112. package/lib/posthog-react-native/src/optional/OptionalSessionReplay.js.map +0 -1
  113. package/lib/posthog-react-native/src/posthog-rn.js +0 -1
  114. package/lib/posthog-react-native/src/posthog-rn.js.map +0 -1
  115. package/lib/posthog-react-native/src/storage.js +0 -1
  116. package/lib/posthog-react-native/src/storage.js.map +0 -1
  117. package/lib/posthog-react-native/src/surveys/PostHogSurveyProvider.js +0 -1
  118. package/lib/posthog-react-native/src/surveys/PostHogSurveyProvider.js.map +0 -1
  119. package/lib/posthog-react-native/src/surveys/components/BottomSection.js +0 -1
  120. package/lib/posthog-react-native/src/surveys/components/BottomSection.js.map +0 -1
  121. package/lib/posthog-react-native/src/surveys/components/Cancel.js +0 -1
  122. package/lib/posthog-react-native/src/surveys/components/Cancel.js.map +0 -1
  123. package/lib/posthog-react-native/src/surveys/components/ConfirmationMessage.js +0 -1
  124. package/lib/posthog-react-native/src/surveys/components/ConfirmationMessage.js.map +0 -1
  125. package/lib/posthog-react-native/src/surveys/components/QuestionHeader.js +0 -1
  126. package/lib/posthog-react-native/src/surveys/components/QuestionHeader.js.map +0 -1
  127. package/lib/posthog-react-native/src/surveys/components/QuestionTypes.js +0 -1
  128. package/lib/posthog-react-native/src/surveys/components/QuestionTypes.js.map +0 -1
  129. package/lib/posthog-react-native/src/surveys/components/SurveyModal.js +0 -1
  130. package/lib/posthog-react-native/src/surveys/components/SurveyModal.js.map +0 -1
  131. package/lib/posthog-react-native/src/surveys/components/Surveys.js +0 -1
  132. package/lib/posthog-react-native/src/surveys/components/Surveys.js.map +0 -1
  133. package/lib/posthog-react-native/src/surveys/getActiveMatchingSurveys.js +0 -1
  134. package/lib/posthog-react-native/src/surveys/getActiveMatchingSurveys.js.map +0 -1
  135. package/lib/posthog-react-native/src/surveys/icons.js +0 -1
  136. package/lib/posthog-react-native/src/surveys/icons.js.map +0 -1
  137. package/lib/posthog-react-native/src/surveys/index.js +0 -1
  138. package/lib/posthog-react-native/src/surveys/index.js.map +0 -1
  139. package/lib/posthog-react-native/src/surveys/surveys-utils.js +0 -1
  140. package/lib/posthog-react-native/src/surveys/surveys-utils.js.map +0 -1
  141. package/lib/posthog-react-native/src/surveys/useActivatedSurveys.js +0 -1
  142. package/lib/posthog-react-native/src/surveys/useActivatedSurveys.js.map +0 -1
  143. package/lib/posthog-react-native/src/surveys/useSurveyStorage.js +0 -1
  144. package/lib/posthog-react-native/src/surveys/useSurveyStorage.js.map +0 -1
  145. package/lib/posthog-react-native/src/types.js +0 -1
  146. package/lib/posthog-react-native/src/types.js.map +0 -1
  147. package/lib/posthog-react-native/src/version.js +0 -1
  148. package/lib/posthog-react-native/src/version.js.map +0 -1
  149. package/lib/posthog-react-native/tsconfig.tsbuildinfo +0 -1
@@ -1,71 +1,71 @@
1
- import { PostHogCaptureOptions, PostHogCore, PostHogCoreOptions, PostHogEventProperties, PostHogFetchOptions, PostHogFetchResponse, PostHogPersistedProperty, SurveyResponse } from '../../posthog-core/src';
2
- import { PostHogAutocaptureOptions, PostHogCustomAppProperties, PostHogCustomStorage, PostHogSessionReplayConfig } from './types';
3
- import { OptionalReactNativeSessionReplay } from './optional/OptionalSessionReplay';
4
- export type PostHogOptions = PostHogCoreOptions & {
5
- /** Allows you to provide the storage type. By default 'file'.
6
- * 'file' will try to load the best available storage, the provided 'customStorage', 'customAsyncStorage' or in-memory storage.
7
- */
8
- persistence?: 'memory' | 'file';
9
- /** Allows you to provide your own implementation of the common information about your App or a function to modify the default App properties generated */
10
- customAppProperties?: PostHogCustomAppProperties | ((properties: PostHogCustomAppProperties) => PostHogCustomAppProperties);
11
- /** Allows you to provide a custom asynchronous storage such as async-storage, expo-file-system or a synchronous storage such as mmkv.
12
- * If not provided, PostHog will attempt to use the best available storage via optional peer dependencies (async-storage, expo-file-system).
13
- * If `persistence` is set to 'memory', this option will be ignored.
14
- */
15
- customStorage?: PostHogCustomStorage;
16
- /** Captures app lifecycle events such as Application Installed, Application Updated, Application Opened, Application Became Active and Application Backgrounded.
17
- * By default is false.
18
- * If you're already using the 'captureLifecycleEvents' options with 'withReactNativeNavigation' or 'PostHogProvider, you don't need to set this.
19
- * If this is set, this value has priority over the 'captureLifecycleEvents' option.
20
- * Application Installed and Application Updated events are not supported with persistence set to 'memory'.
21
- */
22
- captureNativeAppLifecycleEvents?: boolean;
23
- /**
24
- * Enable Recording of Session Replays for Android and iOS
25
- * Requires Record user sessions to be enabled in the PostHog Project Settings
26
- * Defaults to false
27
- */
28
- enableSessionReplay?: boolean;
29
- /**
30
- * Configuration for Session Replay
31
- */
32
- sessionReplayConfig?: PostHogSessionReplayConfig;
33
- /**
34
- * If enabled, the session id ($session_id) will be persisted across app restarts.
35
- * This is an option for back compatibility, so your current data isn't skewed with the new version of the SDK.
36
- * If this is false, the session id will be always reset on app restart.
37
- * Defaults to false
38
- */
39
- enablePersistSessionIdAcrossRestart?: boolean;
40
- };
41
- export declare class PostHog extends PostHogCore {
42
- private _persistence;
43
- private _storage;
44
- private _appProperties;
45
- private _currentSessionId?;
46
- private _enableSessionReplay?;
47
- private _disableSurveys;
48
- private _disableRemoteConfig;
49
- constructor(apiKey: string, options?: PostHogOptions);
50
- ready(): Promise<void>;
51
- getPersistedProperty<T>(key: PostHogPersistedProperty): T | undefined;
52
- setPersistedProperty<T>(key: PostHogPersistedProperty, value: T | null): void;
53
- fetch(url: string, options: PostHogFetchOptions): Promise<PostHogFetchResponse>;
54
- getLibraryId(): string;
55
- getLibraryVersion(): string;
56
- getCustomUserAgent(): string;
57
- getCommonEventProperties(): any;
58
- screen(name: string, properties?: {
59
- [key: string]: any;
60
- }, options?: PostHogCaptureOptions): Promise<void>;
61
- _isEnableSessionReplay(): boolean;
62
- _resetSessionId(reactNativeSessionReplay: typeof OptionalReactNativeSessionReplay | undefined, sessionId: string): void;
63
- getSessionId(): string;
64
- resetSessionId(): void;
65
- identify(distinctId?: string, properties?: PostHogEventProperties, options?: PostHogCaptureOptions): void;
66
- initReactNativeNavigation(options: PostHogAutocaptureOptions): boolean;
67
- getSurveys(): Promise<SurveyResponse['surveys']>;
68
- private startSessionReplay;
69
- private captureNativeAppLifecycleEvents;
70
- private persistAppVersion;
71
- }
1
+ import { PostHogCaptureOptions, PostHogCore, PostHogCoreOptions, PostHogEventProperties, PostHogFetchOptions, PostHogFetchResponse, PostHogPersistedProperty, SurveyResponse } from '../../posthog-core/src';
2
+ import { PostHogAutocaptureOptions, PostHogCustomAppProperties, PostHogCustomStorage, PostHogSessionReplayConfig } from './types';
3
+ import { OptionalReactNativeSessionReplay } from './optional/OptionalSessionReplay';
4
+ export type PostHogOptions = PostHogCoreOptions & {
5
+ /** Allows you to provide the storage type. By default 'file'.
6
+ * 'file' will try to load the best available storage, the provided 'customStorage', 'customAsyncStorage' or in-memory storage.
7
+ */
8
+ persistence?: 'memory' | 'file';
9
+ /** Allows you to provide your own implementation of the common information about your App or a function to modify the default App properties generated */
10
+ customAppProperties?: PostHogCustomAppProperties | ((properties: PostHogCustomAppProperties) => PostHogCustomAppProperties);
11
+ /** Allows you to provide a custom asynchronous storage such as async-storage, expo-file-system or a synchronous storage such as mmkv.
12
+ * If not provided, PostHog will attempt to use the best available storage via optional peer dependencies (async-storage, expo-file-system).
13
+ * If `persistence` is set to 'memory', this option will be ignored.
14
+ */
15
+ customStorage?: PostHogCustomStorage;
16
+ /** Captures app lifecycle events such as Application Installed, Application Updated, Application Opened, Application Became Active and Application Backgrounded.
17
+ * By default is false.
18
+ * If you're already using the 'captureLifecycleEvents' options with 'withReactNativeNavigation' or 'PostHogProvider, you don't need to set this.
19
+ * If this is set, this value has priority over the 'captureLifecycleEvents' option.
20
+ * Application Installed and Application Updated events are not supported with persistence set to 'memory'.
21
+ */
22
+ captureNativeAppLifecycleEvents?: boolean;
23
+ /**
24
+ * Enable Recording of Session Replays for Android and iOS
25
+ * Requires Record user sessions to be enabled in the PostHog Project Settings
26
+ * Defaults to false
27
+ */
28
+ enableSessionReplay?: boolean;
29
+ /**
30
+ * Configuration for Session Replay
31
+ */
32
+ sessionReplayConfig?: PostHogSessionReplayConfig;
33
+ /**
34
+ * If enabled, the session id ($session_id) will be persisted across app restarts.
35
+ * This is an option for back compatibility, so your current data isn't skewed with the new version of the SDK.
36
+ * If this is false, the session id will be always reset on app restart.
37
+ * Defaults to false
38
+ */
39
+ enablePersistSessionIdAcrossRestart?: boolean;
40
+ };
41
+ export declare class PostHog extends PostHogCore {
42
+ private _persistence;
43
+ private _storage;
44
+ private _appProperties;
45
+ private _currentSessionId?;
46
+ private _enableSessionReplay?;
47
+ private _disableSurveys;
48
+ private _disableRemoteConfig;
49
+ constructor(apiKey: string, options?: PostHogOptions);
50
+ ready(): Promise<void>;
51
+ getPersistedProperty<T>(key: PostHogPersistedProperty): T | undefined;
52
+ setPersistedProperty<T>(key: PostHogPersistedProperty, value: T | null): void;
53
+ fetch(url: string, options: PostHogFetchOptions): Promise<PostHogFetchResponse>;
54
+ getLibraryId(): string;
55
+ getLibraryVersion(): string;
56
+ getCustomUserAgent(): string;
57
+ getCommonEventProperties(): any;
58
+ screen(name: string, properties?: {
59
+ [key: string]: any;
60
+ }, options?: PostHogCaptureOptions): Promise<void>;
61
+ _isEnableSessionReplay(): boolean;
62
+ _resetSessionId(reactNativeSessionReplay: typeof OptionalReactNativeSessionReplay | undefined, sessionId: string): void;
63
+ getSessionId(): string;
64
+ resetSessionId(): void;
65
+ identify(distinctId?: string, properties?: PostHogEventProperties, options?: PostHogCaptureOptions): void;
66
+ initReactNativeNavigation(options: PostHogAutocaptureOptions): boolean;
67
+ getSurveys(): Promise<SurveyResponse['surveys']>;
68
+ private startSessionReplay;
69
+ private captureNativeAppLifecycleEvents;
70
+ private persistAppVersion;
71
+ }
@@ -1,21 +1,21 @@
1
- import { PostHogCustomStorage } from './types';
2
- type PostHogStorageContents = {
3
- [key: string]: any;
4
- };
5
- export declare class PostHogRNStorage {
6
- memoryCache: PostHogStorageContents;
7
- storage: PostHogCustomStorage;
8
- preloadPromise: Promise<void> | undefined;
9
- constructor(storage: PostHogCustomStorage);
10
- persist(): void;
11
- getItem(key: string): any | null | undefined;
12
- setItem(key: string, value: any): void;
13
- removeItem(key: string): void;
14
- clear(): void;
15
- getAllKeys(): readonly string[];
16
- populateMemoryCache(res: string | null): void;
17
- }
18
- export declare class PostHogRNSyncMemoryStorage extends PostHogRNStorage {
19
- constructor();
20
- }
21
- export {};
1
+ import { PostHogCustomStorage } from './types';
2
+ type PostHogStorageContents = {
3
+ [key: string]: any;
4
+ };
5
+ export declare class PostHogRNStorage {
6
+ memoryCache: PostHogStorageContents;
7
+ storage: PostHogCustomStorage;
8
+ preloadPromise: Promise<void> | undefined;
9
+ constructor(storage: PostHogCustomStorage);
10
+ persist(): void;
11
+ getItem(key: string): any | null | undefined;
12
+ setItem(key: string, value: any): void;
13
+ removeItem(key: string): void;
14
+ clear(): void;
15
+ getAllKeys(): readonly string[];
16
+ populateMemoryCache(res: string | null): void;
17
+ }
18
+ export declare class PostHogRNSyncMemoryStorage extends PostHogRNStorage {
19
+ constructor();
20
+ }
21
+ export {};
@@ -1,16 +1,16 @@
1
- import React from 'react';
2
- import { SurveyAppearance } from '../../../posthog-core/src';
3
- import { PostHog } from '../posthog-rn';
4
- export type PostHogSurveyProviderProps = {
5
- /**
6
- * The default appearance for surveys when not specified in PostHog.
7
- */
8
- defaultSurveyAppearance?: SurveyAppearance;
9
- /**
10
- * If true, PosHog appearance will be ignored and defaultSurveyAppearance is always used.
11
- */
12
- overrideAppearanceWithDefault?: boolean;
13
- client?: PostHog;
14
- children: React.ReactNode;
15
- };
16
- export declare function PostHogSurveyProvider(props: PostHogSurveyProviderProps): JSX.Element;
1
+ import React from 'react';
2
+ import { SurveyAppearance } from '../../../posthog-core/src';
3
+ import { PostHog } from '../posthog-rn';
4
+ export type PostHogSurveyProviderProps = {
5
+ /**
6
+ * The default appearance for surveys when not specified in PostHog.
7
+ */
8
+ defaultSurveyAppearance?: SurveyAppearance;
9
+ /**
10
+ * If true, PosHog appearance will be ignored and defaultSurveyAppearance is always used.
11
+ */
12
+ overrideAppearanceWithDefault?: boolean;
13
+ client?: PostHog;
14
+ children: React.ReactNode;
15
+ };
16
+ export declare function PostHogSurveyProvider(props: PostHogSurveyProviderProps): JSX.Element;
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
2
- import { SurveyAppearanceTheme } from '../surveys-utils';
3
- export declare function BottomSection({ text, submitDisabled, appearance, onSubmit, link, }: {
4
- text: string;
5
- submitDisabled: boolean;
6
- appearance: SurveyAppearanceTheme;
7
- onSubmit: () => void;
8
- link?: string | null;
9
- }): JSX.Element;
1
+ /// <reference types="react" />
2
+ import { SurveyAppearanceTheme } from '../surveys-utils';
3
+ export declare function BottomSection({ text, submitDisabled, appearance, onSubmit, link, }: {
4
+ text: string;
5
+ submitDisabled: boolean;
6
+ appearance: SurveyAppearanceTheme;
7
+ onSubmit: () => void;
8
+ link?: string | null;
9
+ }): JSX.Element;
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
- import { SurveyAppearanceTheme } from '../surveys-utils';
3
- export declare function Cancel({ onPress, appearance, }: {
4
- onPress: () => void;
5
- appearance: SurveyAppearanceTheme;
6
- }): JSX.Element;
1
+ /// <reference types="react" />
2
+ import { SurveyAppearanceTheme } from '../surveys-utils';
3
+ export declare function Cancel({ onPress, appearance, }: {
4
+ onPress: () => void;
5
+ appearance: SurveyAppearanceTheme;
6
+ }): JSX.Element;
@@ -1,13 +1,13 @@
1
- /// <reference types="react" />
2
- import { ViewStyle } from 'react-native';
3
- import { SurveyAppearanceTheme } from '../surveys-utils';
4
- import { SurveyQuestionDescriptionContentType } from '../../../../posthog-core/src';
5
- export declare function ConfirmationMessage({ appearance, header, description, contentType, onClose, styleOverrides, isModal, }: {
6
- appearance: SurveyAppearanceTheme;
7
- header: string;
8
- description: string;
9
- contentType?: SurveyQuestionDescriptionContentType;
10
- onClose: () => void;
11
- styleOverrides?: ViewStyle;
12
- isModal: boolean;
13
- }): JSX.Element;
1
+ /// <reference types="react" />
2
+ import { ViewStyle } from 'react-native';
3
+ import { SurveyAppearanceTheme } from '../surveys-utils';
4
+ import { SurveyQuestionDescriptionContentType } from '../../../../posthog-core/src';
5
+ export declare function ConfirmationMessage({ appearance, header, description, contentType, onClose, styleOverrides, isModal, }: {
6
+ appearance: SurveyAppearanceTheme;
7
+ header: string;
8
+ description: string;
9
+ contentType?: SurveyQuestionDescriptionContentType;
10
+ onClose: () => void;
11
+ styleOverrides?: ViewStyle;
12
+ isModal: boolean;
13
+ }): JSX.Element;
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
2
- import { SurveyQuestionDescriptionContentType } from '../../../../posthog-core/src';
3
- export declare function QuestionHeader({ question, description, descriptionContentType, }: {
4
- question: string;
5
- description?: string | null;
6
- descriptionContentType?: SurveyQuestionDescriptionContentType;
7
- }): JSX.Element;
1
+ /// <reference types="react" />
2
+ import { SurveyQuestionDescriptionContentType } from '../../../../posthog-core/src';
3
+ export declare function QuestionHeader({ question, description, descriptionContentType, }: {
4
+ question: string;
5
+ description?: string | null;
6
+ descriptionContentType?: SurveyQuestionDescriptionContentType;
7
+ }): JSX.Element;
@@ -1,27 +1,27 @@
1
- /// <reference types="react" />
2
- import { SurveyAppearanceTheme } from '../surveys-utils';
3
- import { SurveyQuestion } from '../../../../posthog-core/src';
4
- interface QuestionCommonProps {
5
- question: SurveyQuestion;
6
- appearance: SurveyAppearanceTheme;
7
- }
8
- export declare function OpenTextQuestion({ question, appearance, onSubmit, }: QuestionCommonProps & {
9
- onSubmit: (text: string) => void;
10
- }): JSX.Element;
11
- export declare function LinkQuestion({ question, appearance, onSubmit, }: QuestionCommonProps & {
12
- onSubmit: (clicked: string) => void;
13
- }): JSX.Element;
14
- export declare function RatingQuestion({ question, appearance, onSubmit, }: QuestionCommonProps & {
15
- onSubmit: (rating: number | null) => void;
16
- }): JSX.Element;
17
- export declare function RatingButton({ index, num, active, appearance, setActiveNumber, }: {
18
- index: number;
19
- num: number;
20
- active: boolean;
21
- appearance: SurveyAppearanceTheme;
22
- setActiveNumber: (num: number) => void;
23
- }): JSX.Element;
24
- export declare function MultipleChoiceQuestion({ question, appearance, onSubmit, }: QuestionCommonProps & {
25
- onSubmit: (choices: string | string[] | null) => void;
26
- }): JSX.Element;
27
- export {};
1
+ /// <reference types="react" />
2
+ import { SurveyAppearanceTheme } from '../surveys-utils';
3
+ import { SurveyQuestion } from '../../../../posthog-core/src';
4
+ interface QuestionCommonProps {
5
+ question: SurveyQuestion;
6
+ appearance: SurveyAppearanceTheme;
7
+ }
8
+ export declare function OpenTextQuestion({ question, appearance, onSubmit, }: QuestionCommonProps & {
9
+ onSubmit: (text: string) => void;
10
+ }): JSX.Element;
11
+ export declare function LinkQuestion({ question, appearance, onSubmit, }: QuestionCommonProps & {
12
+ onSubmit: (clicked: string) => void;
13
+ }): JSX.Element;
14
+ export declare function RatingQuestion({ question, appearance, onSubmit, }: QuestionCommonProps & {
15
+ onSubmit: (rating: number | null) => void;
16
+ }): JSX.Element;
17
+ export declare function RatingButton({ index, num, active, appearance, setActiveNumber, }: {
18
+ index: number;
19
+ num: number;
20
+ active: boolean;
21
+ appearance: SurveyAppearanceTheme;
22
+ setActiveNumber: (num: number) => void;
23
+ }): JSX.Element;
24
+ export declare function MultipleChoiceQuestion({ question, appearance, onSubmit, }: QuestionCommonProps & {
25
+ onSubmit: (choices: string | string[] | null) => void;
26
+ }): JSX.Element;
27
+ export {};
@@ -1,10 +1,10 @@
1
- /// <reference types="react" />
2
- import { SurveyAppearanceTheme } from '../surveys-utils';
3
- import { Survey } from '../../../../posthog-core/src';
4
- export type SurveyModalProps = {
5
- survey: Survey;
6
- appearance: SurveyAppearanceTheme;
7
- onShow: () => void;
8
- onClose: (submitted: boolean) => void;
9
- };
10
- export declare function SurveyModal(props: SurveyModalProps): JSX.Element | null;
1
+ /// <reference types="react" />
2
+ import { SurveyAppearanceTheme } from '../surveys-utils';
3
+ import { Survey } from '../../../../posthog-core/src';
4
+ export type SurveyModalProps = {
5
+ survey: Survey;
6
+ appearance: SurveyAppearanceTheme;
7
+ onShow: () => void;
8
+ onClose: (submitted: boolean) => void;
9
+ };
10
+ export declare function SurveyModal(props: SurveyModalProps): JSX.Element | null;
@@ -1,14 +1,14 @@
1
- /// <reference types="react" />
2
- import { StyleProp, ViewStyle } from 'react-native';
3
- import { SurveyAppearanceTheme } from '../surveys-utils';
4
- import { Survey } from '../../../../posthog-core/src';
5
- import { PostHog } from '../../posthog-rn';
6
- export declare const sendSurveyShownEvent: (survey: Survey, posthog: PostHog) => void;
7
- export declare const sendSurveyEvent: (responses: Record<string, string | number | string[] | null> | undefined, survey: Survey, posthog: PostHog) => void;
8
- export declare const dismissedSurveyEvent: (survey: Survey, posthog: PostHog) => void;
9
- export declare function Questions({ survey, appearance, styleOverrides, onSubmit, }: {
10
- survey: Survey;
11
- appearance: SurveyAppearanceTheme;
12
- styleOverrides?: StyleProp<ViewStyle>;
13
- onSubmit: () => void;
14
- }): JSX.Element;
1
+ /// <reference types="react" />
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { SurveyAppearanceTheme } from '../surveys-utils';
4
+ import { Survey } from '../../../../posthog-core/src';
5
+ import { PostHog } from '../../posthog-rn';
6
+ export declare const sendSurveyShownEvent: (survey: Survey, posthog: PostHog) => void;
7
+ export declare const sendSurveyEvent: (responses: Record<string, string | number | string[] | null> | undefined, survey: Survey, posthog: PostHog) => void;
8
+ export declare const dismissedSurveyEvent: (survey: Survey, posthog: PostHog) => void;
9
+ export declare function Questions({ survey, appearance, styleOverrides, onSubmit, }: {
10
+ survey: Survey;
11
+ appearance: SurveyAppearanceTheme;
12
+ styleOverrides?: StyleProp<ViewStyle>;
13
+ onSubmit: () => void;
14
+ }): JSX.Element;
@@ -1,2 +1,2 @@
1
- import { FeatureFlagValue, Survey } from '../../../posthog-core/src';
2
- export declare function getActiveMatchingSurveys(surveys: Survey[], flags: Record<string, FeatureFlagValue>, seenSurveys: string[], activatedSurveys: ReadonlySet<string>): Survey[];
1
+ import { FeatureFlagValue, Survey } from '../../../posthog-core/src';
2
+ export declare function getActiveMatchingSurveys(surveys: Survey[], flags: Record<string, FeatureFlagValue>, seenSurveys: string[], activatedSurveys: ReadonlySet<string>): Survey[];
@@ -1,8 +1,10 @@
1
- import { SvgProps } from 'react-native-svg';
2
- export declare const SatisfiedEmoji: (props: SvgProps) => JSX.Element;
3
- export declare const NeutralEmoji: (props: SvgProps) => JSX.Element;
4
- export declare const DissatisfiedEmoji: (props: SvgProps) => JSX.Element;
5
- export declare const VeryDissatisfiedEmoji: (props: SvgProps) => JSX.Element;
6
- export declare const VerySatisfiedEmoji: (props: SvgProps) => JSX.Element;
7
- export declare const CheckSVG: (props: SvgProps) => JSX.Element;
8
- export declare const CancelSVG: (props: SvgProps) => JSX.Element;
1
+ /// <reference types="react" />
2
+ /// <reference types="react" />
3
+ import { SvgProps } from 'react-native-svg';
4
+ export declare const SatisfiedEmoji: (props: SvgProps) => JSX.Element;
5
+ export declare const NeutralEmoji: (props: SvgProps) => JSX.Element;
6
+ export declare const DissatisfiedEmoji: (props: SvgProps) => JSX.Element;
7
+ export declare const VeryDissatisfiedEmoji: (props: SvgProps) => JSX.Element;
8
+ export declare const VerySatisfiedEmoji: (props: SvgProps) => JSX.Element;
9
+ export declare const CheckSVG: (props: SvgProps) => JSX.Element;
10
+ export declare const CancelSVG: (props: SvgProps) => JSX.Element;
@@ -1,6 +1,6 @@
1
- export { PostHogSurveyProvider } from './PostHogSurveyProvider';
2
- export type { PostHogSurveyProviderProps } from './PostHogSurveyProvider';
3
- export { SurveyModal } from './components/SurveyModal';
4
- export type { SurveyModalProps } from './components/SurveyModal';
5
- export type { Survey, SurveyAppearance } from '../../../posthog-core/src';
6
- export { Questions } from './components/Surveys';
1
+ export { PostHogSurveyProvider } from './PostHogSurveyProvider';
2
+ export type { PostHogSurveyProviderProps } from './PostHogSurveyProvider';
3
+ export { SurveyModal } from './components/SurveyModal';
4
+ export type { SurveyModalProps } from './components/SurveyModal';
5
+ export type { Survey, SurveyAppearance } from '../../../posthog-core/src';
6
+ export { Questions } from './components/Surveys';
@@ -1,13 +1,13 @@
1
- import { MultipleSurveyQuestion, Survey, SurveyAppearance, SurveyQuestion } from '../../../posthog-core/src';
2
- export declare const defaultBackgroundColor: "#eeeded";
3
- export type SurveyAppearanceTheme = Omit<Required<SurveyAppearance>, 'widgetSelector' | 'widgetType' | 'widgetColor' | 'widgetLabel' | 'shuffleQuestions'>;
4
- export declare const defaultSurveyAppearance: SurveyAppearanceTheme;
5
- export declare const getDisplayOrderQuestions: (survey: Survey) => SurveyQuestion[];
6
- export declare const hasEvents: (survey: Survey) => boolean;
7
- export declare const canActivateRepeatedly: (survey: Survey) => boolean;
8
- /**
9
- * Use the Fisher-yates algorithm to shuffle this array
10
- * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
11
- */
12
- export declare const getDisplayOrderChoices: (question: MultipleSurveyQuestion) => string[];
13
- export declare function getContrastingTextColor(color: string): 'black' | 'white';
1
+ import { MultipleSurveyQuestion, Survey, SurveyAppearance, SurveyQuestion } from '../../../posthog-core/src';
2
+ export declare const defaultBackgroundColor: "#eeeded";
3
+ export type SurveyAppearanceTheme = Omit<Required<SurveyAppearance>, 'widgetSelector' | 'widgetType' | 'widgetColor' | 'widgetLabel' | 'shuffleQuestions'>;
4
+ export declare const defaultSurveyAppearance: SurveyAppearanceTheme;
5
+ export declare const getDisplayOrderQuestions: (survey: Survey) => SurveyQuestion[];
6
+ export declare const hasEvents: (survey: Survey) => boolean;
7
+ export declare const canActivateRepeatedly: (survey: Survey) => boolean;
8
+ /**
9
+ * Use the Fisher-yates algorithm to shuffle this array
10
+ * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
11
+ */
12
+ export declare const getDisplayOrderChoices: (question: MultipleSurveyQuestion) => string[];
13
+ export declare function getContrastingTextColor(color: string): 'black' | 'white';
@@ -1,3 +1,3 @@
1
- import { Survey } from '../../../posthog-core/src';
2
- import { PostHog } from '../posthog-rn';
3
- export declare function useActivatedSurveys(posthog: PostHog, surveys: Survey[]): ReadonlySet<string>;
1
+ import { Survey } from '../../../posthog-core/src';
2
+ import { PostHog } from '../posthog-rn';
3
+ export declare function useActivatedSurveys(posthog: PostHog, surveys: Survey[]): ReadonlySet<string>;
@@ -1,8 +1,8 @@
1
- type SurveyStorage = {
2
- seenSurveys: string[];
3
- setSeenSurvey: (surveyId: string) => void;
4
- lastSeenSurveyDate: Date | undefined;
5
- setLastSeenSurveyDate: (date: Date) => void;
6
- };
7
- export declare function useSurveyStorage(): SurveyStorage;
8
- export {};
1
+ type SurveyStorage = {
2
+ seenSurveys: string[];
3
+ setSeenSurvey: (surveyId: string) => void;
4
+ lastSeenSurveyDate: Date | undefined;
5
+ setLastSeenSurveyDate: (date: Date) => void;
6
+ };
7
+ export declare function useSurveyStorage(): SurveyStorage;
8
+ export {};