Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Simplified types inlined from dataloader.
*/

declare class DataLoader<K, V, C = K> {
constructor(batchLoadFn: DataLoader.BatchLoadFn<K, V>, options?: any);
load(key: K): Promise<V>;
loadMany(keys: ArrayLike<K>): Promise<Array<V | Error>>;
prime(key: K, value: V | Error): this;
clear(key: K): this;
clearAll(): this;
[key: string]: any;
}

declare namespace DataLoader {
type BatchLoadFn<K, V> = (keys: ReadonlyArray<K>) => PromiseLike<ArrayLike<V | Error>>;
}

export = DataLoader;
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } f
import { trace, context, Link, SpanStatusCode, SpanKind } from '@opentelemetry/api';
import { DataloaderInstrumentationConfig } from './types';
import { SDK_VERSION } from '@sentry/core';
import type * as Dataloader from 'dataloader';
import type * as Dataloader from './dataloader-types';

const MODULE_NAME = 'dataloader';
const PACKAGE_NAME = '@sentry/instrumentation-dataloader';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Simplified types inlined from generic-pool.
*/

export declare class Pool<T> {
acquire(priority?: number): PromiseLike<T>;
[key: string]: any;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
isWrapped,
} from '@opentelemetry/instrumentation';

import type * as genericPool from 'generic-pool';
import type * as genericPool from './generic-pool-types';

import { SDK_VERSION } from '@sentry/core';

Expand Down
Loading