Skip to content

Commit 797d14d

Browse files
rubennortefacebook-github-bot
authored andcommitted
Expose types for benchmark options (#52875)
Summary: Pull Request resolved: #52875 Changelog: [internal] This simplifies typing tests. Reviewed By: christophpurrer Differential Revision: D79086359 fbshipit-source-id: 683a713e0182f18c9b26e515921d17cf7873aa06
1 parent 6e4d23d commit 797d14d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

private/react-native-fantom/src/Benchmark.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
type TaskResult,
1919
} from 'tinybench';
2020

21-
type SuiteOptions = $ReadOnly<{
21+
export type SuiteOptions = $ReadOnly<{
2222
minIterations?: number,
2323
minDuration?: number,
2424
warmup?: boolean,
@@ -28,7 +28,9 @@ type SuiteOptions = $ReadOnly<{
2828
testOnly?: boolean,
2929
}>;
3030

31-
type TestOptions = $ReadOnly<{
31+
export type TestOptions = FnOptions;
32+
33+
type InternalTestOptions = $ReadOnly<{
3234
...FnOptions,
3335
only?: boolean,
3436
}>;
@@ -71,7 +73,7 @@ interface SuiteAPI {
7173
interface TestTask {
7274
name: string;
7375
fn: () => void;
74-
options: TestOptions | void;
76+
options: InternalTestOptions | void;
7577
}
7678

7779
export function suite(

private/react-native-fantom/src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,11 @@ export function enqueueModalSizeUpdate(
567567

568568
export const unstable_benchmark = Benchmark;
569569

570+
export type {
571+
SuiteOptions as BenchmarkSuiteOptions,
572+
TestOptions as BenchmarkTestOptions,
573+
} from './Benchmark';
574+
570575
/**
571576
* Quick and dirty polyfills required by tinybench.
572577
*/

0 commit comments

Comments
 (0)