feat: add WeakRef interface
This commit is contained in:
parent
335c5ee25f
commit
4fe89357fc
3 changed files with 98 additions and 2 deletions
|
|
@ -49,3 +49,13 @@ export interface ObservableLike {
|
|||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export type Falsy = false | 0 | 0n | '' | null | undefined;
|
||||
|
||||
export interface WeakRef<T extends object> {
|
||||
readonly [Symbol.toStringTag]: "WeakRef";
|
||||
|
||||
/**
|
||||
* Returns the WeakRef instance's target object, or undefined if the target object has been
|
||||
* reclaimed.
|
||||
*/
|
||||
deref(): T | undefined;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue