/** * * Copyright 2020-2026 Splunk Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ export declare function generateId(bits: number): string; export declare function limitLen(s: string, cap: number): string; /** * Get plugin config from user provided value * * @template {Object|undefined} T * @param value Value given by user * @param defaults Default value * @param defaultDisable If undefined by user should mean false */ export declare function getPluginConfig(value: T | boolean | undefined, defaults?: T, defaultDisable?: T | boolean): false | T; /** * Type guard that checks if value is function (and acts as user-defined type guard) * * @param value Value to check * @returns is function */ export declare function isFunction(value: unknown): value is (...args: unknown[]) => unknown; export declare function isIframe(): boolean; /** * Wrap function while keeping the toString calling the original as some frameworks * use it to determine if the function's native or polyfilled * * Example: * https://github.com/vuejs/vue/blob/0603ff695d2f41286239298210113cbe2b209e28/src/core/util/env.js#L58 * https://github.com/vuejs/vue/blob/0603ff695d2f41286239298210113cbe2b209e28/src/core/util/next-tick.js#L42 * * @param nodule Target object * @param name Property to patch * @param wrapper Wrapper */ export declare function wrapNatively(nodule: Nodule, name: FieldName, wrapper: (original: Nodule[FieldName]) => Nodule[FieldName]): void; /** * Get the original version of function (without all of the shimmer wrappings) */ export declare function getOriginalFunction(func: T): T; /** * Wait for a variable to be set globally * * @param {string} identifier Name of the variable (window[identifier]) * @param {function} callback Fired when such value is available * @returns {function} cleanup to call in disable (in case not defined before instrumentation is disabled) */ export declare function waitForGlobal(identifier: string, callback: (value: T) => void): () => void;