Skip to content

Commit

Permalink
chore: type Sampler is better
Browse files Browse the repository at this point in the history
  • Loading branch information
maraisr committed Jul 3, 2024
1 parent 44e2a54 commit 7c78208
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { span_buffer, wait_promises } from './_internal';
export { configure, report } from './_internal';

type API = {
sampler: typeof Sampler | boolean;
sampler: Sampler | boolean;
scope: { name: string };
clock: ClockLike;
};
Expand Down
6 changes: 3 additions & 3 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type Options = {
/**
* @borrows {@link Sampler}
*/
sampler?: typeof Sampler | boolean;
sampler?: Sampler | boolean;

clock?: ClockLike;
};
Expand All @@ -47,7 +47,7 @@ export type Context = {
* Return true if the span should be sampled, and reported to the {@link Exporter}.
* Return false if the span should not be sampled, and not reported to the {@link Exporter}.
*/
export function Sampler(
export type Sampler = (
/**
* The id of the new span looking for a sampling decision.
*/
Expand All @@ -64,7 +64,7 @@ export function Sampler(
* The tracer this span belongs to.
*/
tracer: { readonly name: string },
): boolean;
) => boolean;

// --- spans

Expand Down

0 comments on commit 7c78208

Please sign in to comment.