/** * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ export default class PCancelable implements PromiseLike { private _pending; private _canceled; private _promise; private _cancel?; private _reject; constructor(executor: (onCancel: (cancelHandler: () => void) => void, resolve: (value: T | PromiseLike) => void, reject: (reason?: unknown) => void) => void); then(onFulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | undefined | null): Promise; catch(onRejected?: ((reason: unknown) => TResult | PromiseLike) | undefined | null): Promise; cancel(): void; }