Skip to content

Commit 3650dbc

Browse files
committed
Add explicit signatures to modified functions to make breaking changes more clear going forward
1 parent b510c6e commit 3650dbc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ts/src/time-profiler.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
import delay from 'delay';
18+
import type {perftools} from '../../proto/profile';
1819

1920
import {serializeTimeProfile} from './profile-serializer';
2021
import {SourceMapper} from './sourcemapper/sourcemapper';
@@ -39,7 +40,9 @@ export interface TimeProfilerOptions {
3940
sourceMapper?: SourceMapper;
4041
}
4142

42-
export async function profile(options: TimeProfilerOptions) {
43+
export async function profile(
44+
options: TimeProfilerOptions
45+
): Promise<perftools.profiles.IProfile> {
4346
const stop = await start(
4447
options.intervalMicros || DEFAULT_INTERVAL_MICROS,
4548
options.sourceMapper
@@ -51,7 +54,7 @@ export async function profile(options: TimeProfilerOptions) {
5154
export async function start(
5255
intervalMicros: Microseconds = DEFAULT_INTERVAL_MICROS,
5356
sourceMapper?: SourceMapper
54-
) {
57+
): Promise<() => Promise<perftools.profiles.IProfile>> {
5558
if (profiling) {
5659
throw new Error('already profiling');
5760
}

0 commit comments

Comments
 (0)