@@ -817,7 +817,7 @@ declare module "react-declarative" {
817
817
scaleToSize,
818
818
createScaleToSize,
819
819
} from "react-declarative/utils/scaleToSize";
820
- export { timeout, TimeoutError } from "react-declarative/utils/hof/timeout";
820
+ export { timeout, TIMEOUT_SYMBOL } from "react-declarative/utils/hof/timeout";
821
821
export { waitForNext } from "react-declarative/utils/hof/waitForNext";
822
822
export { obsolete } from "react-declarative/utils/hof/obsolete";
823
823
export { singleshot } from "react-declarative/utils/hof/singleshot";
@@ -8139,21 +8139,22 @@ declare module "react-declarative/utils/scaleToSize" {
8139
8139
}
8140
8140
8141
8141
declare module "react-declarative/utils/hof/timeout" {
8142
- export class TimeoutError extends Error {}
8143
- export const timeout: <T extends (...args: any[]) => any>(
8144
- run: T ,
8142
+ export const TIMEOUT_SYMBOL: unique symbol;
8143
+ export const timeout: <T extends unknown = any, P extends any[] = any[] >(
8144
+ run: (...args: P) => Promise<T> ,
8145
8145
delay?: number,
8146
- ) => T ;
8146
+ ) => (...args: P) => Promise<symbol | T> ;
8147
8147
export default timeout;
8148
8148
}
8149
8149
8150
8150
declare module "react-declarative/utils/hof/waitForNext" {
8151
+ import { TIMEOUT_SYMBOL } from "react-declarative/utils/hof/timeout";
8151
8152
import { TSubject } from "react-declarative/utils/rx/Subject";
8152
8153
export const waitForNext: <T = any>(
8153
8154
subject: TSubject<T>,
8154
8155
condition: (t: T) => boolean,
8155
8156
delay?: number,
8156
- ) => Promise<T>;
8157
+ ) => Promise<typeof TIMEOUT_SYMBOL | T>;
8157
8158
export default waitForNext;
8158
8159
}
8159
8160
0 commit comments