import InstrumentationModule from '../../native/InstrumentationModule'; // @ts-ignore // eslint-disable-next-line @typescript-eslint/no-unused-vars const {MAX_USER_DATA_STRING_LENGTH} = InstrumentationModule.getConstants(); /** * Sets a key-value pair identifier that will be included in all snapshots. * The identifier can be used to add any data you wish. * * The `key` must be unique across your application. * The `key` namespace is distinct for each user data type. * Re-using the same `key` overwrites the previous `value`. * The `key` is limited to @constant {MAX_USER_DATA_STRING_LENGTH} characters. * * A `value` of `null` will clear the data. * * This information is not persisted across application runs. Once the application is destroyed, * the user data is cleared. * * @param {string} key Key for value. * @param {boolean} value Boolean value. */ async function setUserDataBoolean( key: string, value: boolean | null, ): Promise { if (!value) { return removeUserDataBoolean(key); } await InstrumentationModule.setUserDataBoolean(key, value); } /** * Removes a key-value pair set with {@link setUserDataBoolean}. * The identifier can be used to add any data you wish. * * @param {string} key Key of the entry to remove. */ async function removeUserDataBoolean(key: string): Promise { await InstrumentationModule.removeUserDataBoolean(key); } export {setUserDataBoolean, removeUserDataBoolean};