[6a3a178] | 1 | /*! *****************************************************************************
|
---|
| 2 | Copyright (C) Microsoft. 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 | // NOTE: This file is obsolete and may be removed in a later release.
|
---|
| 17 | // For CommonJS/AMD/UMD/SystemJS declarations please use 'index.d.ts'.
|
---|
| 18 | // For standalone browser declarations, please use 'standalone.d.ts'.
|
---|
| 19 |
|
---|
| 20 | declare module "reflect-metadata" {
|
---|
| 21 | // The "reflect-metadata" module has no imports or exports, but can be used by modules to load the polyfill.
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | declare namespace Reflect {
|
---|
| 25 | /**
|
---|
| 26 | * Applies a set of decorators to a target object.
|
---|
| 27 | * @param decorators An array of decorators.
|
---|
| 28 | * @param target The target object.
|
---|
| 29 | * @returns The result of applying the provided decorators.
|
---|
| 30 | * @remarks Decorators are applied in reverse order of their positions in the array.
|
---|
| 31 | * @example
|
---|
| 32 | *
|
---|
| 33 | * class Example { }
|
---|
| 34 | *
|
---|
| 35 | * // constructor
|
---|
| 36 | * Example = Reflect.decorate(decoratorsArray, Example);
|
---|
| 37 | *
|
---|
| 38 | */
|
---|
| 39 | function decorate(decorators: ClassDecorator[], target: Function): Function;
|
---|
| 40 | /**
|
---|
| 41 | * Applies a set of decorators to a property of a target object.
|
---|
| 42 | * @param decorators An array of decorators.
|
---|
| 43 | * @param target The target object.
|
---|
| 44 | * @param targetKey The property key to decorate.
|
---|
| 45 | * @param descriptor A property descriptor
|
---|
| 46 | * @remarks Decorators are applied in reverse order.
|
---|
| 47 | * @example
|
---|
| 48 | *
|
---|
| 49 | * class Example {
|
---|
| 50 | * // property declarations are not part of ES6, though they are valid in TypeScript:
|
---|
| 51 | * // static staticProperty;
|
---|
| 52 | * // property;
|
---|
| 53 | *
|
---|
| 54 | * static staticMethod() { }
|
---|
| 55 | * method() { }
|
---|
| 56 | * }
|
---|
| 57 | *
|
---|
| 58 | * // property (on constructor)
|
---|
| 59 | * Reflect.decorate(decoratorsArray, Example, "staticProperty");
|
---|
| 60 | *
|
---|
| 61 | * // property (on prototype)
|
---|
| 62 | * Reflect.decorate(decoratorsArray, Example.prototype, "property");
|
---|
| 63 | *
|
---|
| 64 | * // method (on constructor)
|
---|
| 65 | * Object.defineProperty(Example, "staticMethod",
|
---|
| 66 | * Reflect.decorate(decoratorsArray, Example, "staticMethod",
|
---|
| 67 | * Object.getOwnPropertyDescriptor(Example, "staticMethod")));
|
---|
| 68 | *
|
---|
| 69 | * // method (on prototype)
|
---|
| 70 | * Object.defineProperty(Example.prototype, "method",
|
---|
| 71 | * Reflect.decorate(decoratorsArray, Example.prototype, "method",
|
---|
| 72 | * Object.getOwnPropertyDescriptor(Example.prototype, "method")));
|
---|
| 73 | *
|
---|
| 74 | */
|
---|
| 75 | function decorate(decorators: (PropertyDecorator | MethodDecorator)[], target: Object, targetKey: string | symbol, descriptor?: PropertyDescriptor): PropertyDescriptor;
|
---|
| 76 | /**
|
---|
| 77 | * A default metadata decorator factory that can be used on a class, class member, or parameter.
|
---|
| 78 | * @param metadataKey The key for the metadata entry.
|
---|
| 79 | * @param metadataValue The value for the metadata entry.
|
---|
| 80 | * @returns A decorator function.
|
---|
| 81 | * @remarks
|
---|
| 82 | * If `metadataKey` is already defined for the target and target key, the
|
---|
| 83 | * metadataValue for that key will be overwritten.
|
---|
| 84 | * @example
|
---|
| 85 | *
|
---|
| 86 | * // constructor
|
---|
| 87 | * @Reflect.metadata(key, value)
|
---|
| 88 | * class Example {
|
---|
| 89 | * }
|
---|
| 90 | *
|
---|
| 91 | * // property (on constructor, TypeScript only)
|
---|
| 92 | * class Example {
|
---|
| 93 | * @Reflect.metadata(key, value)
|
---|
| 94 | * static staticProperty;
|
---|
| 95 | * }
|
---|
| 96 | *
|
---|
| 97 | * // property (on prototype, TypeScript only)
|
---|
| 98 | * class Example {
|
---|
| 99 | * @Reflect.metadata(key, value)
|
---|
| 100 | * property;
|
---|
| 101 | * }
|
---|
| 102 | *
|
---|
| 103 | * // method (on constructor)
|
---|
| 104 | * class Example {
|
---|
| 105 | * @Reflect.metadata(key, value)
|
---|
| 106 | * static staticMethod() { }
|
---|
| 107 | * }
|
---|
| 108 | *
|
---|
| 109 | * // method (on prototype)
|
---|
| 110 | * class Example {
|
---|
| 111 | * @Reflect.metadata(key, value)
|
---|
| 112 | * method() { }
|
---|
| 113 | * }
|
---|
| 114 | *
|
---|
| 115 | */
|
---|
| 116 | function metadata(metadataKey: any, metadataValue: any): {
|
---|
| 117 | (target: Function): void;
|
---|
| 118 | (target: Object, targetKey: string | symbol): void;
|
---|
| 119 | };
|
---|
| 120 | /**
|
---|
| 121 | * Define a unique metadata entry on the target.
|
---|
| 122 | * @param metadataKey A key used to store and retrieve metadata.
|
---|
| 123 | * @param metadataValue A value that contains attached metadata.
|
---|
| 124 | * @param target The target object on which to define metadata.
|
---|
| 125 | * @example
|
---|
| 126 | *
|
---|
| 127 | * class Example {
|
---|
| 128 | * }
|
---|
| 129 | *
|
---|
| 130 | * // constructor
|
---|
| 131 | * Reflect.defineMetadata("custom:annotation", options, Example);
|
---|
| 132 | *
|
---|
| 133 | * // decorator factory as metadata-producing annotation.
|
---|
| 134 | * function MyAnnotation(options): ClassDecorator {
|
---|
| 135 | * return target => Reflect.defineMetadata("custom:annotation", options, target);
|
---|
| 136 | * }
|
---|
| 137 | *
|
---|
| 138 | */
|
---|
| 139 | function defineMetadata(metadataKey: any, metadataValue: any, target: Object): void;
|
---|
| 140 | /**
|
---|
| 141 | * Define a unique metadata entry on the target.
|
---|
| 142 | * @param metadataKey A key used to store and retrieve metadata.
|
---|
| 143 | * @param metadataValue A value that contains attached metadata.
|
---|
| 144 | * @param target The target object on which to define metadata.
|
---|
| 145 | * @param targetKey The property key for the target.
|
---|
| 146 | * @example
|
---|
| 147 | *
|
---|
| 148 | * class Example {
|
---|
| 149 | * // property declarations are not part of ES6, though they are valid in TypeScript:
|
---|
| 150 | * // static staticProperty;
|
---|
| 151 | * // property;
|
---|
| 152 | *
|
---|
| 153 | * static staticMethod(p) { }
|
---|
| 154 | * method(p) { }
|
---|
| 155 | * }
|
---|
| 156 | *
|
---|
| 157 | * // property (on constructor)
|
---|
| 158 | * Reflect.defineMetadata("custom:annotation", Number, Example, "staticProperty");
|
---|
| 159 | *
|
---|
| 160 | * // property (on prototype)
|
---|
| 161 | * Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "property");
|
---|
| 162 | *
|
---|
| 163 | * // method (on constructor)
|
---|
| 164 | * Reflect.defineMetadata("custom:annotation", Number, Example, "staticMethod");
|
---|
| 165 | *
|
---|
| 166 | * // method (on prototype)
|
---|
| 167 | * Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "method");
|
---|
| 168 | *
|
---|
| 169 | * // decorator factory as metadata-producing annotation.
|
---|
| 170 | * function MyAnnotation(options): PropertyDecorator {
|
---|
| 171 | * return (target, key) => Reflect.defineMetadata("custom:annotation", options, target, key);
|
---|
| 172 | * }
|
---|
| 173 | *
|
---|
| 174 | */
|
---|
| 175 | function defineMetadata(metadataKey: any, metadataValue: any, target: Object, targetKey: string | symbol): void;
|
---|
| 176 | /**
|
---|
| 177 | * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
|
---|
| 178 | * @param metadataKey A key used to store and retrieve metadata.
|
---|
| 179 | * @param target The target object on which the metadata is defined.
|
---|
| 180 | * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
|
---|
| 181 | * @example
|
---|
| 182 | *
|
---|
| 183 | * class Example {
|
---|
| 184 | * }
|
---|
| 185 | *
|
---|
| 186 | * // constructor
|
---|
| 187 | * result = Reflect.hasMetadata("custom:annotation", Example);
|
---|
| 188 | *
|
---|
| 189 | */
|
---|
| 190 | function hasMetadata(metadataKey: any, target: Object): boolean;
|
---|
| 191 | /**
|
---|
| 192 | * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
|
---|
| 193 | * @param metadataKey A key used to store and retrieve metadata.
|
---|
| 194 | * @param target The target object on which the metadata is defined.
|
---|
| 195 | * @param targetKey The property key for the target.
|
---|
| 196 | * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
|
---|
| 197 | * @example
|
---|
| 198 | *
|
---|
| 199 | * class Example {
|
---|
| 200 | * // property declarations are not part of ES6, though they are valid in TypeScript:
|
---|
| 201 | * // static staticProperty;
|
---|
| 202 | * // property;
|
---|
| 203 | *
|
---|
| 204 | * static staticMethod(p) { }
|
---|
| 205 | * method(p) { }
|
---|
| 206 | * }
|
---|
| 207 | *
|
---|
| 208 | * // property (on constructor)
|
---|
| 209 | * result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty");
|
---|
| 210 | *
|
---|
| 211 | * // property (on prototype)
|
---|
| 212 | * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property");
|
---|
| 213 | *
|
---|
| 214 | * // method (on constructor)
|
---|
| 215 | * result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod");
|
---|
| 216 | *
|
---|
| 217 | * // method (on prototype)
|
---|
| 218 | * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method");
|
---|
| 219 | *
|
---|
| 220 | */
|
---|
| 221 | function hasMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean;
|
---|
| 222 | /**
|
---|
| 223 | * Gets a value indicating whether the target object has the provided metadata key defined.
|
---|
| 224 | * @param metadataKey A key used to store and retrieve metadata.
|
---|
| 225 | * @param target The target object on which the metadata is defined.
|
---|
| 226 | * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
|
---|
| 227 | * @example
|
---|
| 228 | *
|
---|
| 229 | * class Example {
|
---|
| 230 | * }
|
---|
| 231 | *
|
---|
| 232 | * // constructor
|
---|
| 233 | * result = Reflect.hasOwnMetadata("custom:annotation", Example);
|
---|
| 234 | *
|
---|
| 235 | */
|
---|
| 236 | function hasOwnMetadata(metadataKey: any, target: Object): boolean;
|
---|
| 237 | /**
|
---|
| 238 | * Gets a value indicating whether the target object has the provided metadata key defined.
|
---|
| 239 | * @param metadataKey A key used to store and retrieve metadata.
|
---|
| 240 | * @param target The target object on which the metadata is defined.
|
---|
| 241 | * @param targetKey The property key for the target.
|
---|
| 242 | * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
|
---|
| 243 | * @example
|
---|
| 244 | *
|
---|
| 245 | * class Example {
|
---|
| 246 | * // property declarations are not part of ES6, though they are valid in TypeScript:
|
---|
| 247 | * // static staticProperty;
|
---|
| 248 | * // property;
|
---|
| 249 | *
|
---|
| 250 | * static staticMethod(p) { }
|
---|
| 251 | * method(p) { }
|
---|
| 252 | * }
|
---|
| 253 | *
|
---|
| 254 | * // property (on constructor)
|
---|
| 255 | * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty");
|
---|
| 256 | *
|
---|
| 257 | * // property (on prototype)
|
---|
| 258 | * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property");
|
---|
| 259 | *
|
---|
| 260 | * // method (on constructor)
|
---|
| 261 | * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod");
|
---|
| 262 | *
|
---|
| 263 | * // method (on prototype)
|
---|
| 264 | * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method");
|
---|
| 265 | *
|
---|
| 266 | */
|
---|
| 267 | function hasOwnMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean;
|
---|
| 268 | /**
|
---|
| 269 | * Gets the metadata value for the provided metadata key on the target object or its prototype chain.
|
---|
| 270 | * @param metadataKey A key used to store and retrieve metadata.
|
---|
| 271 | * @param target The target object on which the metadata is defined.
|
---|
| 272 | * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
---|
| 273 | * @example
|
---|
| 274 | *
|
---|
| 275 | * class Example {
|
---|
| 276 | * }
|
---|
| 277 | *
|
---|
| 278 | * // constructor
|
---|
| 279 | * result = Reflect.getMetadata("custom:annotation", Example);
|
---|
| 280 | *
|
---|
| 281 | */
|
---|
| 282 | function getMetadata(metadataKey: any, target: Object): any;
|
---|
| 283 | /**
|
---|
| 284 | * Gets the metadata value for the provided metadata key on the target object or its prototype chain.
|
---|
| 285 | * @param metadataKey A key used to store and retrieve metadata.
|
---|
| 286 | * @param target The target object on which the metadata is defined.
|
---|
| 287 | * @param targetKey The property key for the target.
|
---|
| 288 | * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
---|
| 289 | * @example
|
---|
| 290 | *
|
---|
| 291 | * class Example {
|
---|
| 292 | * // property declarations are not part of ES6, though they are valid in TypeScript:
|
---|
| 293 | * // static staticProperty;
|
---|
| 294 | * // property;
|
---|
| 295 | *
|
---|
| 296 | * static staticMethod(p) { }
|
---|
| 297 | * method(p) { }
|
---|
| 298 | * }
|
---|
| 299 | *
|
---|
| 300 | * // property (on constructor)
|
---|
| 301 | * result = Reflect.getMetadata("custom:annotation", Example, "staticProperty");
|
---|
| 302 | *
|
---|
| 303 | * // property (on prototype)
|
---|
| 304 | * result = Reflect.getMetadata("custom:annotation", Example.prototype, "property");
|
---|
| 305 | *
|
---|
| 306 | * // method (on constructor)
|
---|
| 307 | * result = Reflect.getMetadata("custom:annotation", Example, "staticMethod");
|
---|
| 308 | *
|
---|
| 309 | * // method (on prototype)
|
---|
| 310 | * result = Reflect.getMetadata("custom:annotation", Example.prototype, "method");
|
---|
| 311 | *
|
---|
| 312 | */
|
---|
| 313 | function getMetadata(metadataKey: any, target: Object, targetKey: string | symbol): any;
|
---|
| 314 | /**
|
---|
| 315 | * Gets the metadata value for the provided metadata key on the target object.
|
---|
| 316 | * @param metadataKey A key used to store and retrieve metadata.
|
---|
| 317 | * @param target The target object on which the metadata is defined.
|
---|
| 318 | * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
---|
| 319 | * @example
|
---|
| 320 | *
|
---|
| 321 | * class Example {
|
---|
| 322 | * }
|
---|
| 323 | *
|
---|
| 324 | * // constructor
|
---|
| 325 | * result = Reflect.getOwnMetadata("custom:annotation", Example);
|
---|
| 326 | *
|
---|
| 327 | */
|
---|
| 328 | function getOwnMetadata(metadataKey: any, target: Object): any;
|
---|
| 329 | /**
|
---|
| 330 | * Gets the metadata value for the provided metadata key on the target object.
|
---|
| 331 | * @param metadataKey A key used to store and retrieve metadata.
|
---|
| 332 | * @param target The target object on which the metadata is defined.
|
---|
| 333 | * @param targetKey The property key for the target.
|
---|
| 334 | * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
|
---|
| 335 | * @example
|
---|
| 336 | *
|
---|
| 337 | * class Example {
|
---|
| 338 | * // property declarations are not part of ES6, though they are valid in TypeScript:
|
---|
| 339 | * // static staticProperty;
|
---|
| 340 | * // property;
|
---|
| 341 | *
|
---|
| 342 | * static staticMethod(p) { }
|
---|
| 343 | * method(p) { }
|
---|
| 344 | * }
|
---|
| 345 | *
|
---|
| 346 | * // property (on constructor)
|
---|
| 347 | * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty");
|
---|
| 348 | *
|
---|
| 349 | * // property (on prototype)
|
---|
| 350 | * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property");
|
---|
| 351 | *
|
---|
| 352 | * // method (on constructor)
|
---|
| 353 | * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod");
|
---|
| 354 | *
|
---|
| 355 | * // method (on prototype)
|
---|
| 356 | * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method");
|
---|
| 357 | *
|
---|
| 358 | */
|
---|
| 359 | function getOwnMetadata(metadataKey: any, target: Object, targetKey: string | symbol): any;
|
---|
| 360 | /**
|
---|
| 361 | * Gets the metadata keys defined on the target object or its prototype chain.
|
---|
| 362 | * @param target The target object on which the metadata is defined.
|
---|
| 363 | * @returns An array of unique metadata keys.
|
---|
| 364 | * @example
|
---|
| 365 | *
|
---|
| 366 | * class Example {
|
---|
| 367 | * }
|
---|
| 368 | *
|
---|
| 369 | * // constructor
|
---|
| 370 | * result = Reflect.getMetadataKeys(Example);
|
---|
| 371 | *
|
---|
| 372 | */
|
---|
| 373 | function getMetadataKeys(target: Object): any[];
|
---|
| 374 | /**
|
---|
| 375 | * Gets the metadata keys defined on the target object or its prototype chain.
|
---|
| 376 | * @param target The target object on which the metadata is defined.
|
---|
| 377 | * @param targetKey The property key for the target.
|
---|
| 378 | * @returns An array of unique metadata keys.
|
---|
| 379 | * @example
|
---|
| 380 | *
|
---|
| 381 | * class Example {
|
---|
| 382 | * // property declarations are not part of ES6, though they are valid in TypeScript:
|
---|
| 383 | * // static staticProperty;
|
---|
| 384 | * // property;
|
---|
| 385 | *
|
---|
| 386 | * static staticMethod(p) { }
|
---|
| 387 | * method(p) { }
|
---|
| 388 | * }
|
---|
| 389 | *
|
---|
| 390 | * // property (on constructor)
|
---|
| 391 | * result = Reflect.getMetadataKeys(Example, "staticProperty");
|
---|
| 392 | *
|
---|
| 393 | * // property (on prototype)
|
---|
| 394 | * result = Reflect.getMetadataKeys(Example.prototype, "property");
|
---|
| 395 | *
|
---|
| 396 | * // method (on constructor)
|
---|
| 397 | * result = Reflect.getMetadataKeys(Example, "staticMethod");
|
---|
| 398 | *
|
---|
| 399 | * // method (on prototype)
|
---|
| 400 | * result = Reflect.getMetadataKeys(Example.prototype, "method");
|
---|
| 401 | *
|
---|
| 402 | */
|
---|
| 403 | function getMetadataKeys(target: Object, targetKey: string | symbol): any[];
|
---|
| 404 | /**
|
---|
| 405 | * Gets the unique metadata keys defined on the target object.
|
---|
| 406 | * @param target The target object on which the metadata is defined.
|
---|
| 407 | * @returns An array of unique metadata keys.
|
---|
| 408 | * @example
|
---|
| 409 | *
|
---|
| 410 | * class Example {
|
---|
| 411 | * }
|
---|
| 412 | *
|
---|
| 413 | * // constructor
|
---|
| 414 | * result = Reflect.getOwnMetadataKeys(Example);
|
---|
| 415 | *
|
---|
| 416 | */
|
---|
| 417 | function getOwnMetadataKeys(target: Object): any[];
|
---|
| 418 | /**
|
---|
| 419 | * Gets the unique metadata keys defined on the target object.
|
---|
| 420 | * @param target The target object on which the metadata is defined.
|
---|
| 421 | * @param targetKey The property key for the target.
|
---|
| 422 | * @returns An array of unique metadata keys.
|
---|
| 423 | * @example
|
---|
| 424 | *
|
---|
| 425 | * class Example {
|
---|
| 426 | * // property declarations are not part of ES6, though they are valid in TypeScript:
|
---|
| 427 | * // static staticProperty;
|
---|
| 428 | * // property;
|
---|
| 429 | *
|
---|
| 430 | * static staticMethod(p) { }
|
---|
| 431 | * method(p) { }
|
---|
| 432 | * }
|
---|
| 433 | *
|
---|
| 434 | * // property (on constructor)
|
---|
| 435 | * result = Reflect.getOwnMetadataKeys(Example, "staticProperty");
|
---|
| 436 | *
|
---|
| 437 | * // property (on prototype)
|
---|
| 438 | * result = Reflect.getOwnMetadataKeys(Example.prototype, "property");
|
---|
| 439 | *
|
---|
| 440 | * // method (on constructor)
|
---|
| 441 | * result = Reflect.getOwnMetadataKeys(Example, "staticMethod");
|
---|
| 442 | *
|
---|
| 443 | * // method (on prototype)
|
---|
| 444 | * result = Reflect.getOwnMetadataKeys(Example.prototype, "method");
|
---|
| 445 | *
|
---|
| 446 | */
|
---|
| 447 | function getOwnMetadataKeys(target: Object, targetKey: string | symbol): any[];
|
---|
| 448 | /**
|
---|
| 449 | * Deletes the metadata entry from the target object with the provided key.
|
---|
| 450 | * @param metadataKey A key used to store and retrieve metadata.
|
---|
| 451 | * @param target The target object on which the metadata is defined.
|
---|
| 452 | * @returns `true` if the metadata entry was found and deleted; otherwise, false.
|
---|
| 453 | * @example
|
---|
| 454 | *
|
---|
| 455 | * class Example {
|
---|
| 456 | * }
|
---|
| 457 | *
|
---|
| 458 | * // constructor
|
---|
| 459 | * result = Reflect.deleteMetadata("custom:annotation", Example);
|
---|
| 460 | *
|
---|
| 461 | */
|
---|
| 462 | function deleteMetadata(metadataKey: any, target: Object): boolean;
|
---|
| 463 | /**
|
---|
| 464 | * Deletes the metadata entry from the target object with the provided key.
|
---|
| 465 | * @param metadataKey A key used to store and retrieve metadata.
|
---|
| 466 | * @param target The target object on which the metadata is defined.
|
---|
| 467 | * @param targetKey The property key for the target.
|
---|
| 468 | * @returns `true` if the metadata entry was found and deleted; otherwise, false.
|
---|
| 469 | * @example
|
---|
| 470 | *
|
---|
| 471 | * class Example {
|
---|
| 472 | * // property declarations are not part of ES6, though they are valid in TypeScript:
|
---|
| 473 | * // static staticProperty;
|
---|
| 474 | * // property;
|
---|
| 475 | *
|
---|
| 476 | * static staticMethod(p) { }
|
---|
| 477 | * method(p) { }
|
---|
| 478 | * }
|
---|
| 479 | *
|
---|
| 480 | * // property (on constructor)
|
---|
| 481 | * result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty");
|
---|
| 482 | *
|
---|
| 483 | * // property (on prototype)
|
---|
| 484 | * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property");
|
---|
| 485 | *
|
---|
| 486 | * // method (on constructor)
|
---|
| 487 | * result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod");
|
---|
| 488 | *
|
---|
| 489 | * // method (on prototype)
|
---|
| 490 | * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method");
|
---|
| 491 | *
|
---|
| 492 | */
|
---|
| 493 | function deleteMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean;
|
---|
| 494 | } |
---|