import { VueIntegrationAddons } from '@hawk.so/types'; interface VueIntegrationOptions { /** * Disable Vue.js error handler * * Used by @hawk.so/nuxt since Nuxt has own error hook. * Otherwise, Nuxt will show 500 error */ disableVueErrorHandler?: boolean; } /** * Errors fired inside Vue components are not dispatched by global handlers. * This integration allow us to set up own error handler */ export declare class VueIntegration { /** * Vue application to handle errors in it */ private readonly vue; /** * User can set up own vue error handler, * we should save and call it at the end */ private readonly existedHandler; /** * Callback that should be triggered with caught error. * This callback is used by parent class to format and send an event. */ private readonly callback; /** * Set up a new vue app * * @param vue - Vue app to handle * @param callback - callback that accepts new error * @param options - additional options */ constructor(vue: any, callback: any, options: VueIntegrationOptions); /** * Extract additional useful information from the Vue app * * Can be used outside of this class, for example, by Nuxt integration * * @param vm - component instance * @param info - a Vue-specific error info, e.g. which lifecycle hook the error was found in. */ spoilAddons(vm: { [key: string]: unknown; }, info: string): VueIntegrationAddons; /** * Setups event handlers for Vue.js instance */ private setupHandler; /** * Extract additional useful information from the Vue 2 app * * @param vm - component instance * @param info - which lifecycle hook the error was found in. */ private spoilAddonsFromVue2; /** * Extract additional useful information from the Vue 3 app * * @param vm - component instance * @param info - which lifecycle hook the error was found in. */ private spoilAddonsFromVue3; /** * In production, the error code is a link with reference to doc. * This method returns the error message by the code extracted from the link * * @param code - Error source info (3rd argument of the vue:error hook) * https://vuejs.org/api/composition-api-lifecycle.html#onerrorcaptured */ private getRuntimeErrorSourceByCode; /** * Write error to the console * * @param err - error to print * @param info - a Vue-specific error info, e.g. which lifecycle hook the error was found in. * @param component - where error was occurred */ private printError; } export {};