Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-html / node_modules / typescript / lib / lib.esnext.weakref.d.ts
1 /*! *****************************************************************************
2 Copyright (c) Microsoft Corporation. All rights reserved.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the
5 License at http://www.apache.org/licenses/LICENSE-2.0
6
7 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10 MERCHANTABLITY OR NON-INFRINGEMENT.
11
12 See the Apache Version 2.0 License for specific language governing permissions
13 and limitations under the License.
14 ***************************************************************************** */
15
16
17
18 /// <reference no-default-lib="true"/>\r
19
20
21 interface WeakRef<T extends object> {\r
22     readonly [Symbol.toStringTag]: "WeakRef";\r
23 \r
24     /**\r
25      * Returns the WeakRef instance's target object, or undefined if the target object has been\r
26      * reclaimed.\r
27      */\r
28     deref(): T | undefined;\r
29 }\r
30 \r
31 interface WeakRefConstructor {\r
32     readonly prototype: WeakRef<any>;\r
33 \r
34     /**\r
35      * Creates a WeakRef instance for the given target object.\r
36      * @param target The target object for the WeakRef instance.\r
37      */\r
38     new<T extends object>(target?: T): WeakRef<T>;\r
39 }\r
40 \r
41 declare var WeakRef: WeakRefConstructor;\r
42 \r
43 interface FinalizationRegistry {\r
44     readonly [Symbol.toStringTag]: "FinalizationRegistry";\r
45 \r
46     /**\r
47      * Registers an object with the registry.\r
48      * @param target The target object to register.\r
49      * @param heldValue The value to pass to the finalizer for this object. This cannot be the\r
50      * target object.\r
51      * @param unregisterToken The token to pass to the unregister method to unregister the target\r
52      * object. If provided (and not undefined), this must be an object. If not provided, the target\r
53      * cannot be unregistered.\r
54      */\r
55     register(target: object, heldValue: any, unregisterToken?: object): void;\r
56 \r
57     /**\r
58      * Unregisters an object from the registry.\r
59      * @param unregisterToken The token that was used as the unregisterToken argument when calling\r
60      * register to register the target object.\r
61      */\r
62     unregister(unregisterToken: object): void;\r
63 }\r
64 \r
65 interface FinalizationRegistryConstructor {\r
66     readonly prototype: FinalizationRegistry;\r
67 \r
68     /**\r
69      * Creates a finalization registry with an associated cleanup callback\r
70      * @param cleanupCallback The callback to call after an object in the registry has been reclaimed.\r
71      */\r
72     new(cleanupCallback: (heldValue: any) => void): FinalizationRegistry;\r
73 }\r
74 \r
75 declare var FinalizationRegistry: FinalizationRegistryConstructor;\r