diff options
author | Michal Klocek <michal.klocek@qt.io> | 2024-05-06 12:49:24 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2024-05-07 09:51:27 +0000 |
commit | 6c04301ecbe57a84d6cc82776b9de9d27fd10076 (patch) | |
tree | ed50ecf908d5dec121b5646c69f9da2e6415965f /chromium/third_party/node/node_modules/lit-html/directives/private-async-helpers.d.ts | |
parent | bdd23a0120a16de636b411a50c92cd273c4e80fa (diff) |
Missing node module sources
* lit-html
* lit-element
* lit-reactive-element
* lit-directive
Change-Id: Idb8413411ad45acd9350e5f155c39c9789f15b95
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/558486
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/node/node_modules/lit-html/directives/private-async-helpers.d.ts')
-rw-r--r-- | chromium/third_party/node/node_modules/lit-html/directives/private-async-helpers.d.ts | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/chromium/third_party/node/node_modules/lit-html/directives/private-async-helpers.d.ts b/chromium/third_party/node/node_modules/lit-html/directives/private-async-helpers.d.ts new file mode 100644 index 00000000000..1090d68b644 --- /dev/null +++ b/chromium/third_party/node/node_modules/lit-html/directives/private-async-helpers.d.ts @@ -0,0 +1,58 @@ +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +/** + * Helper to iterate an AsyncIterable in its own closure. + * @param iterable The iterable to iterate + * @param callback The callback to call for each value. If the callback returns + * `false`, the loop will be broken. + */ +export declare const forAwaitOf: <T>(iterable: AsyncIterable<T>, callback: (value: T) => Promise<boolean>) => Promise<void>; +/** + * Holds a reference to an instance that can be disconnected and reconnected, + * so that a closure over the ref (e.g. in a then function to a promise) does + * not strongly hold a ref to the instance. Approximates a WeakRef but must + * be manually connected & disconnected to the backing instance. + */ +export declare class PseudoWeakRef<T> { + private _ref?; + constructor(ref: T); + /** + * Disassociates the ref with the backing instance. + */ + disconnect(): void; + /** + * Reassociates the ref with the backing instance. + */ + reconnect(ref: T): void; + /** + * Retrieves the backing instance (will be undefined when disconnected) + */ + deref(): T | undefined; +} +/** + * A helper to pause and resume waiting on a condition in an async function + */ +export declare class Pauser { + private _promise?; + private _resolve?; + /** + * When paused, returns a promise to be awaited; when unpaused, returns + * undefined. Note that in the microtask between the pauser being resumed + * an an await of this promise resolving, the pauser could be paused again, + * hence callers should check the promise in a loop when awaiting. + * @returns A promise to be awaited when paused or undefined + */ + get(): Promise<void> | undefined; + /** + * Creates a promise to be awaited + */ + pause(): void; + /** + * Resolves the promise which may be awaited + */ + resume(): void; +} +//# sourceMappingURL=private-async-helpers.d.ts.map
\ No newline at end of file |