@pnlight/sdk-react-native 0.4.2 → 0.4.3
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.
- package/index.d.ts +14 -3
- package/package.json +1 -2
- package/RemoteUiView.d.ts +0 -62
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export function initialize(apiKey: string, baseDomain?: string): Promise<void>;
|
|
|
2
2
|
export function validatePurchase(captcha?: boolean): Promise<boolean>;
|
|
3
3
|
export function logEvent(
|
|
4
4
|
eventName: string,
|
|
5
|
-
eventArgs?: Record<string, any
|
|
5
|
+
eventArgs?: Record<string, any>,
|
|
6
6
|
): Promise<void>;
|
|
7
7
|
export function getUserId(): Promise<string>;
|
|
8
8
|
export function resetUserId(): Promise<void>;
|
|
@@ -18,7 +18,7 @@ export type AttributionProvider =
|
|
|
18
18
|
export function addAttribution(
|
|
19
19
|
provider: AttributionProvider,
|
|
20
20
|
data?: Record<string, any> | null,
|
|
21
|
-
identifier?: string | null
|
|
21
|
+
identifier?: string | null,
|
|
22
22
|
): Promise<boolean>;
|
|
23
23
|
|
|
24
24
|
export function prefetchUIConfig(placement: string): Promise<void>;
|
|
@@ -30,10 +30,21 @@ export interface UIConfig {
|
|
|
30
30
|
|
|
31
31
|
export function getUIConfig(placement: string): Promise<UIConfig | null>;
|
|
32
32
|
|
|
33
|
+
export interface ActionEvent {
|
|
34
|
+
url: string;
|
|
35
|
+
scheme: string;
|
|
36
|
+
path: string;
|
|
37
|
+
params: Record<string, string>;
|
|
38
|
+
logId?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
33
41
|
export interface RemoteUiViewProps {
|
|
34
42
|
placement: string;
|
|
35
43
|
style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
|
|
36
44
|
cardId?: string;
|
|
45
|
+
onAction?: (event: ActionEvent) => void;
|
|
37
46
|
}
|
|
38
47
|
|
|
39
|
-
export const RemoteUiView: (
|
|
48
|
+
export const RemoteUiView: (
|
|
49
|
+
props: RemoteUiViewProps,
|
|
50
|
+
) => import("react").ReactElement | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnlight/sdk-react-native",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "React Native wrapper for PNLight iOS binary SDK",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"PNLight.xcframework",
|
|
13
13
|
"PNLightSDK-ReactNative.podspec",
|
|
14
14
|
"RemoteUiView.js",
|
|
15
|
-
"RemoteUiView.d.ts",
|
|
16
15
|
"app.plugin.js",
|
|
17
16
|
"plugin"
|
|
18
17
|
],
|
package/RemoteUiView.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
2
|
-
|
|
3
|
-
export interface ActionEvent {
|
|
4
|
-
/**
|
|
5
|
-
* Full URL from the action (e.g., "myapp://button-clicked?id=primary")
|
|
6
|
-
* Note: Only custom URL schemes are passed to this callback.
|
|
7
|
-
* Standard http/https URLs are handled automatically by DivKit.
|
|
8
|
-
*/
|
|
9
|
-
url: string;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* URL scheme (e.g., "myapp", "app")
|
|
13
|
-
* Note: Will never be "http" or "https" as those are handled automatically.
|
|
14
|
-
*/
|
|
15
|
-
scheme: string;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* URL path (e.g., "/button-clicked")
|
|
19
|
-
*/
|
|
20
|
-
path: string;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Parsed query parameters as key-value pairs
|
|
24
|
-
*/
|
|
25
|
-
params: { [key: string]: string };
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* DivKit log ID (if available)
|
|
29
|
-
*/
|
|
30
|
-
logId?: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface RemoteUiViewProps {
|
|
34
|
-
/**
|
|
35
|
-
* Placement ID passed to getUIConfig(placement)
|
|
36
|
-
*/
|
|
37
|
-
placement: string;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Optional style for the container
|
|
41
|
-
*/
|
|
42
|
-
style?: StyleProp<ViewStyle>;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Optional DivKit card ID (defaults to placement-based ID)
|
|
46
|
-
*/
|
|
47
|
-
cardId?: string;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Callback for handling button clicks with custom URL schemes.
|
|
51
|
-
* Only called for custom schemes (myapp://, app://, etc.).
|
|
52
|
-
* Standard http/https URLs are handled automatically by DivKit.
|
|
53
|
-
* @param event - Action event containing URL, scheme, path, params, and logId
|
|
54
|
-
*/
|
|
55
|
-
onAction?: (event: ActionEvent) => void;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Remote UI view: fetches UI config for the given placement via getUIConfig,
|
|
60
|
-
* shows nothing while loading, then renders the config in a native DivKit view.
|
|
61
|
-
*/
|
|
62
|
-
export function RemoteUiView(props: RemoteUiViewProps): JSX.Element;
|