UNPKG

flipper-common

Version:

Server & UI shared Flipper utilities

36 lines 1.41 kB
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format */ type Result = { kind: 'success'; } | { kind: 'cancelled'; } | { kind: 'failure'; supportedOperation: boolean; error: any; }; export declare class UnsupportedError extends Error { constructor(message: string); } export declare function reportPlatformFailures<T>(promise: Promise<T>, name: string): Promise<T>; export declare function reportPluginFailures<T>(promise: Promise<T>, name: string, plugin: string): Promise<T>; export declare function tryCatchReportPlatformFailures<T>(closure: () => T, name: string): T; export declare function tryCatchReportPluginFailures<T>(closure: () => T, name: string, plugin: string): T; export declare function tryCatchReportPluginFailuresAsync<T>(closure: () => Promise<T>, name: string, plugin: string): Promise<T>; /** * Track usage of a feature. * @param action Unique name for the action performed. E.g. captureScreenshot * @param data Optional additional metadata attached to the event. */ export declare function reportUsage(action: string, data?: { [key: string]: string; }, plugin?: string): void; export declare function logPlatformSuccessRate(name: string, result: Result): void; export {}; //# sourceMappingURL=metrics.d.ts.map