instabug-reactnative
Version:
React Native plugin for integrating the Instabug SDK
90 lines (89 loc) • 3.8 kB
TypeScript
import Trace from '../models/Trace';
/**
* Enables or disables APM
* @param isEnabled
*/
export declare const setEnabled: (isEnabled: boolean) => void;
/**
* If APM is enabled, Instabug SDK starts collecting data about the app launch time by default.
* This API is used to give user more control over this behavior.
* @param isEnabled
*/
export declare const setAppLaunchEnabled: (isEnabled: boolean) => void;
/**
* To define when an app launch is complete,
* such as when it's intractable, use the end app launch API.
* You can then view this data with the automatic cold app launch.
*/
export declare const endAppLaunch: () => void;
/**
* Enables or disables APM Network Metric
* @param isEnabled - a boolean indicates either iOS monitoring is enabled or disabled.
*/
export declare const setNetworkEnabledIOS: (isEnabled: boolean) => void;
/**
* Enables or disables APM UI Responsiveness tracking feature
* @param isEnabled
*/
export declare const setAutoUITraceEnabled: (isEnabled: boolean) => void;
/**
* Starts a custom execution trace.
*
* Returns a promise which resolves with the trace reference if APM is enabled; otherwise, the promise is rejected.
*
* @param name - The name of the trace to start.
* @returns A promise that resolves with a Trace object.
*
* @deprecated Please migrate to the App Flows APIs: {@link startFlow}, {@link endFlow}, and {@link setFlowAttribute}.
*/
export declare const startExecutionTrace: (name: string) => Promise<Trace>;
/**
* Starts an AppFlow with the specified name.
*
* On starting two flows with the same name, the older flow will end with a force abandon end reason.
* The AppFlow name cannot exceed 150 characters; otherwise, it's truncated,
* leading and trailing whitespaces are also ignored.
*
* @param name - The name of the AppFlow. It cannot be an empty string or null.
* A new AppFlow is started if APM is enabled, the feature is enabled,
* and the Instabug SDK is initialized.
*/
export declare const startFlow: (name: string) => void;
/**
* Ends an AppFlow with the given name.
*
* @param name - The name of the AppFlow to end. It cannot be an empty string or null.
*/
export declare const endFlow: (name: string) => void;
/**
* Sets custom attributes for an AppFlow with a given name.
*
* Setting an attribute value to null will remove the corresponding key if it already exists.
* Attribute keys cannot exceed 30 characters and leading/trailing whitespaces are ignored.
* Empty strings or null for attribute keys are not accepted.
*
* Attribute values cannot exceed 60 characters and leading/trailing whitespaces are ignored.
* Empty strings for attribute values are not accepted, but null can be used to remove an attribute.
*
* If an AppFlow is ended, attributes will not be added and existing ones will not be updated.
*
* @param name - The name of the AppFlow. It cannot be an empty string or null.
* @param key - The key of the attribute. It cannot be an empty string or null.
* @param [value] - The value of the attribute. It cannot be an empty string. Use null to remove the attribute.
*/
export declare const setFlowAttribute: (name: string, key: string, value?: string | null) => void;
/**
* Initiates a UI trace with the specified name using a native module.
* @param {string} name - The `name` parameter in the `startUITrace` function is a string that
* represents the name of the UI trace that you want to start. This name is used to identify and track
* the specific UI trace within the application.
*/
export declare const startUITrace: (name: string) => void;
/**
* Ends the currently running custom trace.
*/
export declare const endUITrace: () => void;
/**
* Used for internal testing.
*/
export declare const _ibgSleep: () => void;