Expose types for benchmark options (#52875)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52875

Changelog: [internal]

This simplifies typing tests.

Reviewed By: christophpurrer

Differential Revision: D79086359

fbshipit-source-id: 683a713e0182f18c9b26e515921d17cf7873aa06
This commit is contained in:
Rubén Norte
2025-07-28 10:02:25 -07:00
committed by Facebook GitHub Bot
parent 6e4d23ded2
commit 797d14da9e
2 changed files with 10 additions and 3 deletions
+5 -3
View File
@@ -18,7 +18,7 @@ import {
type TaskResult,
} from 'tinybench';
type SuiteOptions = $ReadOnly<{
export type SuiteOptions = $ReadOnly<{
minIterations?: number,
minDuration?: number,
warmup?: boolean,
@@ -28,7 +28,9 @@ type SuiteOptions = $ReadOnly<{
testOnly?: boolean,
}>;
type TestOptions = $ReadOnly<{
export type TestOptions = FnOptions;
type InternalTestOptions = $ReadOnly<{
...FnOptions,
only?: boolean,
}>;
@@ -71,7 +73,7 @@ interface SuiteAPI {
interface TestTask {
name: string;
fn: () => void;
options: TestOptions | void;
options: InternalTestOptions | void;
}
export function suite(
+5
View File
@@ -567,6 +567,11 @@ export function enqueueModalSizeUpdate(
export const unstable_benchmark = Benchmark;
export type {
SuiteOptions as BenchmarkSuiteOptions,
TestOptions as BenchmarkTestOptions,
} from './Benchmark';
/**
* Quick and dirty polyfills required by tinybench.
*/