Skip to content

Instantly share code, notes, and snippets.

@deanohyeah
Created February 25, 2020 16:51
Show Gist options
  • Save deanohyeah/c45761d9bfdee0a00c33ba77de9a7c15 to your computer and use it in GitHub Desktop.
Save deanohyeah/c45761d9bfdee0a00c33ba77de9a7c15 to your computer and use it in GitHub Desktop.
typescript declarations for parent application from npm module
// ./custom_types/performanceEntry'
declare global {
export interface PerformanceEntry {
transferSize: number,
encodedBodySize: number,
decodedBodySize: number,
responseStart: number,
responseEnd: number,
requestStart: number,
attribution: Array<any>,
}
}
export declare const PerformanceEntry: PerformanceEntry;
// index.d.ts
import wrapGraphqlRequest from './helpers/wrap_graphql_request';
// type declared in another file
import { PerformanceMetricsConfigs } from './services/elastic_apm_rum';
export { PerformanceMetricsUser } from './services/elastic_apm_rum';
// this provides type dependencies to the parent application
export * from './custom_types/performanceEntry';
// export api for the module
declare function initialize(initializeConfigs: PerformanceMetricsConfigs): undefined;
export { wrapGraphqlRequest, initialize as rumInitialize };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment