@@ -817,7 +817,7 @@ declare module "react-declarative" {
817817 scaleToSize,
818818 createScaleToSize,
819819 } 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";
821821 export { waitForNext } from "react-declarative/utils/hof/waitForNext";
822822 export { obsolete } from "react-declarative/utils/hof/obsolete";
823823 export { singleshot } from "react-declarative/utils/hof/singleshot";
@@ -8139,21 +8139,22 @@ declare module "react-declarative/utils/scaleToSize" {
81398139}
81408140
81418141declare 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> ,
81458145 delay?: number,
8146- ) => T ;
8146+ ) => (...args: P) => Promise<symbol | T> ;
81478147 export default timeout;
81488148}
81498149
81508150declare module "react-declarative/utils/hof/waitForNext" {
8151+ import { TIMEOUT_SYMBOL } from "react-declarative/utils/hof/timeout";
81518152 import { TSubject } from "react-declarative/utils/rx/Subject";
81528153 export const waitForNext: <T = any>(
81538154 subject: TSubject<T>,
81548155 condition: (t: T) => boolean,
81558156 delay?: number,
8156- ) => Promise<T>;
8157+ ) => Promise<typeof TIMEOUT_SYMBOL | T>;
81578158 export default waitForNext;
81588159}
81598160
0 commit comments