1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16

ash / webui / common / resources / fake_method_resolver.d.ts [blame]

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

declare class FakeMethodState<T = any> {
  resolveMethod(): Promise<T>;
  resolveMethodWithDelay(delayMs: number): Promise<T>;
  setResult(result: T): void;
}

export class FakeMethodResolver<T = any> {
  register(methodName: string): void;
  setResult(methodName: string, result: T): void;
  resolveMethod(methodName: string): Promise<T>;
  resolveMethodWithDelay(methodName: string, delayMs: number): Promise<T>;
}