titanpl 7.0.0-beta → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/package.json +2 -6
  2. package/packages/cli/package.json +4 -4
  3. package/packages/core-source/LICENSE +15 -0
  4. package/packages/core-source/README.md +128 -0
  5. package/packages/core-source/V8_SERIALIZATION.md +125 -0
  6. package/packages/core-source/configure.js +50 -0
  7. package/packages/core-source/globals.d.ts +2238 -0
  8. package/packages/core-source/index.d.ts +515 -0
  9. package/packages/core-source/index.js +639 -0
  10. package/packages/core-source/jsconfig.json +12 -0
  11. package/packages/core-source/mkctx.config.json +7 -0
  12. package/packages/core-source/native/Cargo.lock +1559 -0
  13. package/packages/core-source/native/Cargo.toml +30 -0
  14. package/packages/core-source/native/src/crypto_impl.rs +139 -0
  15. package/packages/core-source/native/src/lib.rs +702 -0
  16. package/packages/core-source/native/src/storage_impl.rs +73 -0
  17. package/packages/core-source/native/src/v8_impl.rs +93 -0
  18. package/packages/core-source/package-lock.json +1464 -0
  19. package/packages/core-source/package.json +53 -0
  20. package/packages/core-source/tests/buffer.test.js +78 -0
  21. package/packages/core-source/tests/cookies.test.js +117 -0
  22. package/packages/core-source/tests/crypto.test.js +142 -0
  23. package/packages/core-source/tests/fs.test.js +176 -0
  24. package/packages/core-source/tests/ls.test.js +149 -0
  25. package/packages/core-source/tests/net.test.js +84 -0
  26. package/packages/core-source/tests/os.test.js +81 -0
  27. package/packages/core-source/tests/path.test.js +102 -0
  28. package/packages/core-source/tests/response.test.js +146 -0
  29. package/packages/core-source/tests/session.test.js +110 -0
  30. package/packages/core-source/tests/setup.js +325 -0
  31. package/packages/core-source/tests/time.test.js +57 -0
  32. package/packages/core-source/tests/url.test.js +82 -0
  33. package/packages/core-source/titan-ext.d.ts +2 -0
  34. package/packages/core-source/titan.json +9 -0
  35. package/packages/core-source/vitest.config.js +8 -0
  36. package/packages/engine-darwin-arm64/package.json +1 -1
  37. package/packages/engine-linux-x64/package.json +1 -1
  38. package/packages/engine-win32-x64/bin/titan-server.exe +0 -0
  39. package/packages/engine-win32-x64/package.json +1 -1
  40. package/packages/native/index.d.ts +16 -1
  41. package/packages/native/index.js +6 -0
  42. package/packages/native/package.json +2 -2
  43. package/packages/native/t.native.d.ts +77 -0
  44. package/packages/packet/index.js +94 -102
  45. package/packages/packet/package.json +1 -1
  46. package/packages/route/package.json +1 -1
  47. package/packages/sdk/package.json +1 -1
  48. package/templates/common/_tanfig.json +4 -2
  49. package/templates/extension/package.json +2 -2
  50. package/templates/js/package.json +8 -8
  51. package/templates/rust-js/package.json +5 -5
  52. package/templates/rust-ts/package.json +5 -5
  53. package/templates/ts/package.json +8 -8
  54. package/packages/packet/node_modules/typescript/LICENSE.txt +0 -55
  55. package/packages/packet/node_modules/typescript/README.md +0 -50
  56. package/packages/packet/node_modules/typescript/SECURITY.md +0 -41
  57. package/packages/packet/node_modules/typescript/ThirdPartyNoticeText.txt +0 -193
  58. package/packages/packet/node_modules/typescript/bin/tsc +0 -2
  59. package/packages/packet/node_modules/typescript/bin/tsserver +0 -2
  60. package/packages/packet/node_modules/typescript/lib/_tsc.js +0 -133818
  61. package/packages/packet/node_modules/typescript/lib/_tsserver.js +0 -659
  62. package/packages/packet/node_modules/typescript/lib/_typingsInstaller.js +0 -222
  63. package/packages/packet/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2122
  64. package/packages/packet/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2122
  65. package/packages/packet/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2122
  66. package/packages/packet/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2122
  67. package/packages/packet/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2122
  68. package/packages/packet/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2122
  69. package/packages/packet/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2122
  70. package/packages/packet/node_modules/typescript/lib/lib.d.ts +0 -22
  71. package/packages/packet/node_modules/typescript/lib/lib.decorators.d.ts +0 -384
  72. package/packages/packet/node_modules/typescript/lib/lib.decorators.legacy.d.ts +0 -22
  73. package/packages/packet/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +0 -41
  74. package/packages/packet/node_modules/typescript/lib/lib.dom.d.ts +0 -39429
  75. package/packages/packet/node_modules/typescript/lib/lib.dom.iterable.d.ts +0 -571
  76. package/packages/packet/node_modules/typescript/lib/lib.es2015.collection.d.ts +0 -147
  77. package/packages/packet/node_modules/typescript/lib/lib.es2015.core.d.ts +0 -597
  78. package/packages/packet/node_modules/typescript/lib/lib.es2015.d.ts +0 -28
  79. package/packages/packet/node_modules/typescript/lib/lib.es2015.generator.d.ts +0 -77
  80. package/packages/packet/node_modules/typescript/lib/lib.es2015.iterable.d.ts +0 -605
  81. package/packages/packet/node_modules/typescript/lib/lib.es2015.promise.d.ts +0 -81
  82. package/packages/packet/node_modules/typescript/lib/lib.es2015.proxy.d.ts +0 -128
  83. package/packages/packet/node_modules/typescript/lib/lib.es2015.reflect.d.ts +0 -144
  84. package/packages/packet/node_modules/typescript/lib/lib.es2015.symbol.d.ts +0 -46
  85. package/packages/packet/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -326
  86. package/packages/packet/node_modules/typescript/lib/lib.es2016.array.include.d.ts +0 -116
  87. package/packages/packet/node_modules/typescript/lib/lib.es2016.d.ts +0 -21
  88. package/packages/packet/node_modules/typescript/lib/lib.es2016.full.d.ts +0 -23
  89. package/packages/packet/node_modules/typescript/lib/lib.es2016.intl.d.ts +0 -31
  90. package/packages/packet/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +0 -21
  91. package/packages/packet/node_modules/typescript/lib/lib.es2017.d.ts +0 -26
  92. package/packages/packet/node_modules/typescript/lib/lib.es2017.date.d.ts +0 -31
  93. package/packages/packet/node_modules/typescript/lib/lib.es2017.full.d.ts +0 -23
  94. package/packages/packet/node_modules/typescript/lib/lib.es2017.intl.d.ts +0 -44
  95. package/packages/packet/node_modules/typescript/lib/lib.es2017.object.d.ts +0 -49
  96. package/packages/packet/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +0 -135
  97. package/packages/packet/node_modules/typescript/lib/lib.es2017.string.d.ts +0 -45
  98. package/packages/packet/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +0 -53
  99. package/packages/packet/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -77
  100. package/packages/packet/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +0 -53
  101. package/packages/packet/node_modules/typescript/lib/lib.es2018.d.ts +0 -24
  102. package/packages/packet/node_modules/typescript/lib/lib.es2018.full.d.ts +0 -24
  103. package/packages/packet/node_modules/typescript/lib/lib.es2018.intl.d.ts +0 -83
  104. package/packages/packet/node_modules/typescript/lib/lib.es2018.promise.d.ts +0 -30
  105. package/packages/packet/node_modules/typescript/lib/lib.es2018.regexp.d.ts +0 -37
  106. package/packages/packet/node_modules/typescript/lib/lib.es2019.array.d.ts +0 -79
  107. package/packages/packet/node_modules/typescript/lib/lib.es2019.d.ts +0 -24
  108. package/packages/packet/node_modules/typescript/lib/lib.es2019.full.d.ts +0 -24
  109. package/packages/packet/node_modules/typescript/lib/lib.es2019.intl.d.ts +0 -23
  110. package/packages/packet/node_modules/typescript/lib/lib.es2019.object.d.ts +0 -33
  111. package/packages/packet/node_modules/typescript/lib/lib.es2019.string.d.ts +0 -37
  112. package/packages/packet/node_modules/typescript/lib/lib.es2019.symbol.d.ts +0 -24
  113. package/packages/packet/node_modules/typescript/lib/lib.es2020.bigint.d.ts +0 -765
  114. package/packages/packet/node_modules/typescript/lib/lib.es2020.d.ts +0 -27
  115. package/packages/packet/node_modules/typescript/lib/lib.es2020.date.d.ts +0 -42
  116. package/packages/packet/node_modules/typescript/lib/lib.es2020.full.d.ts +0 -24
  117. package/packages/packet/node_modules/typescript/lib/lib.es2020.intl.d.ts +0 -474
  118. package/packages/packet/node_modules/typescript/lib/lib.es2020.number.d.ts +0 -28
  119. package/packages/packet/node_modules/typescript/lib/lib.es2020.promise.d.ts +0 -47
  120. package/packages/packet/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +0 -99
  121. package/packages/packet/node_modules/typescript/lib/lib.es2020.string.d.ts +0 -44
  122. package/packages/packet/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -41
  123. package/packages/packet/node_modules/typescript/lib/lib.es2021.d.ts +0 -23
  124. package/packages/packet/node_modules/typescript/lib/lib.es2021.full.d.ts +0 -24
  125. package/packages/packet/node_modules/typescript/lib/lib.es2021.intl.d.ts +0 -166
  126. package/packages/packet/node_modules/typescript/lib/lib.es2021.promise.d.ts +0 -48
  127. package/packages/packet/node_modules/typescript/lib/lib.es2021.string.d.ts +0 -33
  128. package/packages/packet/node_modules/typescript/lib/lib.es2021.weakref.d.ts +0 -78
  129. package/packages/packet/node_modules/typescript/lib/lib.es2022.array.d.ts +0 -121
  130. package/packages/packet/node_modules/typescript/lib/lib.es2022.d.ts +0 -25
  131. package/packages/packet/node_modules/typescript/lib/lib.es2022.error.d.ts +0 -75
  132. package/packages/packet/node_modules/typescript/lib/lib.es2022.full.d.ts +0 -24
  133. package/packages/packet/node_modules/typescript/lib/lib.es2022.intl.d.ts +0 -145
  134. package/packages/packet/node_modules/typescript/lib/lib.es2022.object.d.ts +0 -26
  135. package/packages/packet/node_modules/typescript/lib/lib.es2022.regexp.d.ts +0 -39
  136. package/packages/packet/node_modules/typescript/lib/lib.es2022.string.d.ts +0 -25
  137. package/packages/packet/node_modules/typescript/lib/lib.es2023.array.d.ts +0 -924
  138. package/packages/packet/node_modules/typescript/lib/lib.es2023.collection.d.ts +0 -21
  139. package/packages/packet/node_modules/typescript/lib/lib.es2023.d.ts +0 -22
  140. package/packages/packet/node_modules/typescript/lib/lib.es2023.full.d.ts +0 -24
  141. package/packages/packet/node_modules/typescript/lib/lib.es2023.intl.d.ts +0 -56
  142. package/packages/packet/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +0 -65
  143. package/packages/packet/node_modules/typescript/lib/lib.es2024.collection.d.ts +0 -29
  144. package/packages/packet/node_modules/typescript/lib/lib.es2024.d.ts +0 -26
  145. package/packages/packet/node_modules/typescript/lib/lib.es2024.full.d.ts +0 -24
  146. package/packages/packet/node_modules/typescript/lib/lib.es2024.object.d.ts +0 -29
  147. package/packages/packet/node_modules/typescript/lib/lib.es2024.promise.d.ts +0 -35
  148. package/packages/packet/node_modules/typescript/lib/lib.es2024.regexp.d.ts +0 -25
  149. package/packages/packet/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +0 -68
  150. package/packages/packet/node_modules/typescript/lib/lib.es2024.string.d.ts +0 -29
  151. package/packages/packet/node_modules/typescript/lib/lib.es5.d.ts +0 -4601
  152. package/packages/packet/node_modules/typescript/lib/lib.es6.d.ts +0 -23
  153. package/packages/packet/node_modules/typescript/lib/lib.esnext.array.d.ts +0 -35
  154. package/packages/packet/node_modules/typescript/lib/lib.esnext.collection.d.ts +0 -96
  155. package/packages/packet/node_modules/typescript/lib/lib.esnext.d.ts +0 -29
  156. package/packages/packet/node_modules/typescript/lib/lib.esnext.decorators.d.ts +0 -28
  157. package/packages/packet/node_modules/typescript/lib/lib.esnext.disposable.d.ts +0 -193
  158. package/packages/packet/node_modules/typescript/lib/lib.esnext.error.d.ts +0 -24
  159. package/packages/packet/node_modules/typescript/lib/lib.esnext.float16.d.ts +0 -445
  160. package/packages/packet/node_modules/typescript/lib/lib.esnext.full.d.ts +0 -24
  161. package/packages/packet/node_modules/typescript/lib/lib.esnext.intl.d.ts +0 -21
  162. package/packages/packet/node_modules/typescript/lib/lib.esnext.iterator.d.ts +0 -148
  163. package/packages/packet/node_modules/typescript/lib/lib.esnext.promise.d.ts +0 -34
  164. package/packages/packet/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +0 -25
  165. package/packages/packet/node_modules/typescript/lib/lib.scripthost.d.ts +0 -322
  166. package/packages/packet/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +0 -41
  167. package/packages/packet/node_modules/typescript/lib/lib.webworker.d.ts +0 -13150
  168. package/packages/packet/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +0 -23
  169. package/packages/packet/node_modules/typescript/lib/lib.webworker.iterable.d.ts +0 -340
  170. package/packages/packet/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2122
  171. package/packages/packet/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2122
  172. package/packages/packet/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2122
  173. package/packages/packet/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2122
  174. package/packages/packet/node_modules/typescript/lib/tsc.js +0 -8
  175. package/packages/packet/node_modules/typescript/lib/tsserver.js +0 -8
  176. package/packages/packet/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -17
  177. package/packages/packet/node_modules/typescript/lib/tsserverlibrary.js +0 -21
  178. package/packages/packet/node_modules/typescript/lib/typesMap.json +0 -497
  179. package/packages/packet/node_modules/typescript/lib/typescript.d.ts +0 -11437
  180. package/packages/packet/node_modules/typescript/lib/typescript.js +0 -200276
  181. package/packages/packet/node_modules/typescript/lib/typingsInstaller.js +0 -8
  182. package/packages/packet/node_modules/typescript/lib/watchGuard.js +0 -53
  183. package/packages/packet/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2122
  184. package/packages/packet/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2122
  185. package/packages/packet/node_modules/typescript/package.json +0 -120
@@ -1,22 +0,0 @@
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
- /// <reference no-default-lib="true"/>
18
-
19
- /// <reference lib="es5" />
20
- /// <reference lib="dom" />
21
- /// <reference lib="webworker.importscripts" />
22
- /// <reference lib="scripthost" />
@@ -1,384 +0,0 @@
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
- /// <reference no-default-lib="true"/>
18
-
19
- /**
20
- * The decorator context types provided to class element decorators.
21
- */
22
- type ClassMemberDecoratorContext =
23
- | ClassMethodDecoratorContext
24
- | ClassGetterDecoratorContext
25
- | ClassSetterDecoratorContext
26
- | ClassFieldDecoratorContext
27
- | ClassAccessorDecoratorContext;
28
-
29
- /**
30
- * The decorator context types provided to any decorator.
31
- */
32
- type DecoratorContext =
33
- | ClassDecoratorContext
34
- | ClassMemberDecoratorContext;
35
-
36
- type DecoratorMetadataObject = Record<PropertyKey, unknown> & object;
37
-
38
- type DecoratorMetadata = typeof globalThis extends { Symbol: { readonly metadata: symbol; }; } ? DecoratorMetadataObject : DecoratorMetadataObject | undefined;
39
-
40
- /**
41
- * Context provided to a class decorator.
42
- * @template Class The type of the decorated class associated with this context.
43
- */
44
- interface ClassDecoratorContext<
45
- Class extends abstract new (...args: any) => any = abstract new (...args: any) => any,
46
- > {
47
- /** The kind of element that was decorated. */
48
- readonly kind: "class";
49
-
50
- /** The name of the decorated class. */
51
- readonly name: string | undefined;
52
-
53
- /**
54
- * Adds a callback to be invoked after the class definition has been finalized.
55
- *
56
- * @example
57
- * ```ts
58
- * function customElement(name: string): ClassDecoratorFunction {
59
- * return (target, context) => {
60
- * context.addInitializer(function () {
61
- * customElements.define(name, this);
62
- * });
63
- * }
64
- * }
65
- *
66
- * @customElement("my-element")
67
- * class MyElement {}
68
- * ```
69
- */
70
- addInitializer(initializer: (this: Class) => void): void;
71
-
72
- readonly metadata: DecoratorMetadata;
73
- }
74
-
75
- /**
76
- * Context provided to a class method decorator.
77
- * @template This The type on which the class element will be defined. For a static class element, this will be
78
- * the type of the constructor. For a non-static class element, this will be the type of the instance.
79
- * @template Value The type of the decorated class method.
80
- */
81
- interface ClassMethodDecoratorContext<
82
- This = unknown,
83
- Value extends (this: This, ...args: any) => any = (this: This, ...args: any) => any,
84
- > {
85
- /** The kind of class element that was decorated. */
86
- readonly kind: "method";
87
-
88
- /** The name of the decorated class element. */
89
- readonly name: string | symbol;
90
-
91
- /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
92
- readonly static: boolean;
93
-
94
- /** A value indicating whether the class element has a private name. */
95
- readonly private: boolean;
96
-
97
- /** An object that can be used to access the current value of the class element at runtime. */
98
- readonly access: {
99
- /**
100
- * Determines whether an object has a property with the same name as the decorated element.
101
- */
102
- has(object: This): boolean;
103
- /**
104
- * Gets the current value of the method from the provided object.
105
- *
106
- * @example
107
- * let fn = context.access.get(instance);
108
- */
109
- get(object: This): Value;
110
- };
111
-
112
- /**
113
- * Adds a callback to be invoked either after static methods are defined but before
114
- * static initializers are run (when decorating a `static` element), or before instance
115
- * initializers are run (when decorating a non-`static` element).
116
- *
117
- * @example
118
- * ```ts
119
- * const bound: ClassMethodDecoratorFunction = (value, context) {
120
- * if (context.private) throw new TypeError("Not supported on private methods.");
121
- * context.addInitializer(function () {
122
- * this[context.name] = this[context.name].bind(this);
123
- * });
124
- * }
125
- *
126
- * class C {
127
- * message = "Hello";
128
- *
129
- * @bound
130
- * m() {
131
- * console.log(this.message);
132
- * }
133
- * }
134
- * ```
135
- */
136
- addInitializer(initializer: (this: This) => void): void;
137
-
138
- readonly metadata: DecoratorMetadata;
139
- }
140
-
141
- /**
142
- * Context provided to a class getter decorator.
143
- * @template This The type on which the class element will be defined. For a static class element, this will be
144
- * the type of the constructor. For a non-static class element, this will be the type of the instance.
145
- * @template Value The property type of the decorated class getter.
146
- */
147
- interface ClassGetterDecoratorContext<
148
- This = unknown,
149
- Value = unknown,
150
- > {
151
- /** The kind of class element that was decorated. */
152
- readonly kind: "getter";
153
-
154
- /** The name of the decorated class element. */
155
- readonly name: string | symbol;
156
-
157
- /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
158
- readonly static: boolean;
159
-
160
- /** A value indicating whether the class element has a private name. */
161
- readonly private: boolean;
162
-
163
- /** An object that can be used to access the current value of the class element at runtime. */
164
- readonly access: {
165
- /**
166
- * Determines whether an object has a property with the same name as the decorated element.
167
- */
168
- has(object: This): boolean;
169
- /**
170
- * Invokes the getter on the provided object.
171
- *
172
- * @example
173
- * let value = context.access.get(instance);
174
- */
175
- get(object: This): Value;
176
- };
177
-
178
- /**
179
- * Adds a callback to be invoked either after static methods are defined but before
180
- * static initializers are run (when decorating a `static` element), or before instance
181
- * initializers are run (when decorating a non-`static` element).
182
- */
183
- addInitializer(initializer: (this: This) => void): void;
184
-
185
- readonly metadata: DecoratorMetadata;
186
- }
187
-
188
- /**
189
- * Context provided to a class setter decorator.
190
- * @template This The type on which the class element will be defined. For a static class element, this will be
191
- * the type of the constructor. For a non-static class element, this will be the type of the instance.
192
- * @template Value The type of the decorated class setter.
193
- */
194
- interface ClassSetterDecoratorContext<
195
- This = unknown,
196
- Value = unknown,
197
- > {
198
- /** The kind of class element that was decorated. */
199
- readonly kind: "setter";
200
-
201
- /** The name of the decorated class element. */
202
- readonly name: string | symbol;
203
-
204
- /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
205
- readonly static: boolean;
206
-
207
- /** A value indicating whether the class element has a private name. */
208
- readonly private: boolean;
209
-
210
- /** An object that can be used to access the current value of the class element at runtime. */
211
- readonly access: {
212
- /**
213
- * Determines whether an object has a property with the same name as the decorated element.
214
- */
215
- has(object: This): boolean;
216
- /**
217
- * Invokes the setter on the provided object.
218
- *
219
- * @example
220
- * context.access.set(instance, value);
221
- */
222
- set(object: This, value: Value): void;
223
- };
224
-
225
- /**
226
- * Adds a callback to be invoked either after static methods are defined but before
227
- * static initializers are run (when decorating a `static` element), or before instance
228
- * initializers are run (when decorating a non-`static` element).
229
- */
230
- addInitializer(initializer: (this: This) => void): void;
231
-
232
- readonly metadata: DecoratorMetadata;
233
- }
234
-
235
- /**
236
- * Context provided to a class `accessor` field decorator.
237
- * @template This The type on which the class element will be defined. For a static class element, this will be
238
- * the type of the constructor. For a non-static class element, this will be the type of the instance.
239
- * @template Value The type of decorated class field.
240
- */
241
- interface ClassAccessorDecoratorContext<
242
- This = unknown,
243
- Value = unknown,
244
- > {
245
- /** The kind of class element that was decorated. */
246
- readonly kind: "accessor";
247
-
248
- /** The name of the decorated class element. */
249
- readonly name: string | symbol;
250
-
251
- /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
252
- readonly static: boolean;
253
-
254
- /** A value indicating whether the class element has a private name. */
255
- readonly private: boolean;
256
-
257
- /** An object that can be used to access the current value of the class element at runtime. */
258
- readonly access: {
259
- /**
260
- * Determines whether an object has a property with the same name as the decorated element.
261
- */
262
- has(object: This): boolean;
263
-
264
- /**
265
- * Invokes the getter on the provided object.
266
- *
267
- * @example
268
- * let value = context.access.get(instance);
269
- */
270
- get(object: This): Value;
271
-
272
- /**
273
- * Invokes the setter on the provided object.
274
- *
275
- * @example
276
- * context.access.set(instance, value);
277
- */
278
- set(object: This, value: Value): void;
279
- };
280
-
281
- /**
282
- * Adds a callback to be invoked immediately after the auto `accessor` being
283
- * decorated is initialized (regardless if the `accessor` is `static` or not).
284
- */
285
- addInitializer(initializer: (this: This) => void): void;
286
-
287
- readonly metadata: DecoratorMetadata;
288
- }
289
-
290
- /**
291
- * Describes the target provided to class `accessor` field decorators.
292
- * @template This The `this` type to which the target applies.
293
- * @template Value The property type for the class `accessor` field.
294
- */
295
- interface ClassAccessorDecoratorTarget<This, Value> {
296
- /**
297
- * Invokes the getter that was defined prior to decorator application.
298
- *
299
- * @example
300
- * let value = target.get.call(instance);
301
- */
302
- get(this: This): Value;
303
-
304
- /**
305
- * Invokes the setter that was defined prior to decorator application.
306
- *
307
- * @example
308
- * target.set.call(instance, value);
309
- */
310
- set(this: This, value: Value): void;
311
- }
312
-
313
- /**
314
- * Describes the allowed return value from a class `accessor` field decorator.
315
- * @template This The `this` type to which the target applies.
316
- * @template Value The property type for the class `accessor` field.
317
- */
318
- interface ClassAccessorDecoratorResult<This, Value> {
319
- /**
320
- * An optional replacement getter function. If not provided, the existing getter function is used instead.
321
- */
322
- get?(this: This): Value;
323
-
324
- /**
325
- * An optional replacement setter function. If not provided, the existing setter function is used instead.
326
- */
327
- set?(this: This, value: Value): void;
328
-
329
- /**
330
- * An optional initializer mutator that is invoked when the underlying field initializer is evaluated.
331
- * @param value The incoming initializer value.
332
- * @returns The replacement initializer value.
333
- */
334
- init?(this: This, value: Value): Value;
335
- }
336
-
337
- /**
338
- * Context provided to a class field decorator.
339
- * @template This The type on which the class element will be defined. For a static class element, this will be
340
- * the type of the constructor. For a non-static class element, this will be the type of the instance.
341
- * @template Value The type of the decorated class field.
342
- */
343
- interface ClassFieldDecoratorContext<
344
- This = unknown,
345
- Value = unknown,
346
- > {
347
- /** The kind of class element that was decorated. */
348
- readonly kind: "field";
349
-
350
- /** The name of the decorated class element. */
351
- readonly name: string | symbol;
352
-
353
- /** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
354
- readonly static: boolean;
355
-
356
- /** A value indicating whether the class element has a private name. */
357
- readonly private: boolean;
358
-
359
- /** An object that can be used to access the current value of the class element at runtime. */
360
- readonly access: {
361
- /**
362
- * Determines whether an object has a property with the same name as the decorated element.
363
- */
364
- has(object: This): boolean;
365
-
366
- /**
367
- * Gets the value of the field on the provided object.
368
- */
369
- get(object: This): Value;
370
-
371
- /**
372
- * Sets the value of the field on the provided object.
373
- */
374
- set(object: This, value: Value): void;
375
- };
376
-
377
- /**
378
- * Adds a callback to be invoked immediately after the field being decorated
379
- * is initialized (regardless if the field is `static` or not).
380
- */
381
- addInitializer(initializer: (this: This) => void): void;
382
-
383
- readonly metadata: DecoratorMetadata;
384
- }
@@ -1,22 +0,0 @@
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
- /// <reference no-default-lib="true"/>
18
-
19
- declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
20
- declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
21
- declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
22
- declare type ParameterDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
@@ -1,41 +0,0 @@
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
- /// <reference no-default-lib="true"/>
18
-
19
- /////////////////////////////
20
- /// Window Async Iterable APIs
21
- /////////////////////////////
22
-
23
- interface FileSystemDirectoryHandleAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
24
- [Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<T>;
25
- }
26
-
27
- interface FileSystemDirectoryHandle {
28
- [Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
29
- entries(): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
30
- keys(): FileSystemDirectoryHandleAsyncIterator<string>;
31
- values(): FileSystemDirectoryHandleAsyncIterator<FileSystemHandle>;
32
- }
33
-
34
- interface ReadableStreamAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
35
- [Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
36
- }
37
-
38
- interface ReadableStream<R = any> {
39
- [Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
40
- values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
41
- }