UNPKG

6.95 kBSource Map (JSON)View Raw
1{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../lib/metadata.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AA+CtE;;;;;GAKG;AACH,MAAM,CAAC,IAAM,MAAM,GAAoB,kBAAkB,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAuC5F;;;;;GAKG;AACH,MAAM,CAAC,IAAM,QAAQ,GAAsB,kBAAkB,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAyC9E;;;;;GAKG;AACH,MAAM,CAAC,IAAM,UAAU,GAA6C,aAAa,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAsCpG;;;;;GAKG;AACH,MAAM,CAAC,IAAM,IAAI,GAAkB,kBAAkB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAsClE;;;;;GAKG;AACH,MAAM,CAAC,IAAM,QAAQ,GAAsB,kBAAkB,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAuC9E;;;;;GAKG;AACH,MAAM,CAAC,IAAM,IAAI,GAAkB,kBAAkB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport { makeDecorator, makeParamDecorator } from './util/decorators';\n\n/**\n * Type of the Inject decorator / constructor function.\n *\n * @stable\n */\nexport interface InjectDecorator {\n /**\n * @whatItDoes A parameter decorator that specifies a dependency.\n * @howToUse\n * ```\n * @Injectable()\n * class Car {\n * constructor(@Inject(\"MyEngine\") public engine:Engine) {}\n * }\n * ```\n *\n * @description\n * For more details, see the {@linkDocs guide/dependency-injection \"Dependency Injection Guide\"}.\n *\n * ### Example\n *\n * {@example core/di/ts/metadata_spec.ts region='Inject'}\n *\n * When `@Inject()` is not present, {@link Injector} will use the type annotation of the\n * parameter.\n *\n * ### Example\n *\n * {@example core/di/ts/metadata_spec.ts region='InjectWithoutDecorator'}\n *\n * @stable\n */\n (token: any): any;\n new (token: any): Inject;\n}\n\n/**\n * Type of the Inject metadata.\n *\n * @stable\n */\nexport interface Inject {\n token: any;\n}\n\n/**\n * Inject decorator and metadata.\n *\n * @stable\n * @Annotation\n */\nexport const Inject: InjectDecorator = makeParamDecorator('Inject', [['token', undefined]]);\n\n/**\n * Type of the Optional decorator / constructor function.\n *\n * @stable\n */\nexport interface OptionalDecorator {\n /**\n * @whatItDoes A parameter metadata that marks a dependency as optional.\n * {@link Injector} provides `null` if the dependency is not found.\n * @howToUse\n * ```\n * @Injectable()\n * class Car {\n * constructor(@Optional() public engine:Engine) {}\n * }\n * ```\n *\n * @description\n * For more details, see the {@linkDocs guide/dependency-injection \"Dependency Injection Guide\"}.\n *\n * ### Example\n *\n * {@example core/di/ts/metadata_spec.ts region='Optional'}\n *\n * @stable\n */\n (): any;\n new (): Optional;\n}\n\n/**\n * Type of the Optional metadata.\n *\n * @stable\n */\nexport interface Optional {}\n\n/**\n * Optional decorator and metadata.\n *\n * @stable\n * @Annotation\n */\nexport const Optional: OptionalDecorator = makeParamDecorator('Optional', []);\n\n/**\n * Type of the Injectable decorator / constructor function.\n *\n * @stable\n */\nexport interface InjectableDecorator {\n /**\n * @whatItDoes A marker metadata that marks a class as available to {@link Injector} for creation.\n * @howToUse\n * ```\n * @Injectable()\n * class Car {}\n * ```\n *\n * @description\n * For more details, see the {@linkDocs guide/dependency-injection \"Dependency Injection Guide\"}.\n *\n * ### Example\n *\n * {@example core/di/ts/metadata_spec.ts region='Injectable'}\n *\n * {@link Injector} will throw {@link NoAnnotationError} when trying to instantiate a class that\n * does not have `@Injectable` marker, as shown in the example below.\n *\n * {@example core/di/ts/metadata_spec.ts region='InjectableThrows'}\n *\n * @stable\n */\n (): any;\n new (): Injectable;\n}\n\n/**\n * Type of the Injectable metadata.\n *\n * @stable\n */\nexport interface Injectable {}\n\n/**\n * Injectable decorator and metadata.\n *\n * @stable\n * @Annotation\n */\nexport const Injectable: InjectableDecorator = <InjectableDecorator>makeDecorator('Injectable', []);\n\n/**\n * Type of the Self decorator / constructor function.\n *\n * @stable\n */\nexport interface SelfDecorator {\n /**\n * @whatItDoes Specifies that an {@link Injector} should retrieve a dependency only from itself.\n * @howToUse\n * ```\n * @Injectable()\n * class Car {\n * constructor(@Self() public engine:Engine) {}\n * }\n * ```\n *\n * @description\n * For more details, see the {@linkDocs guide/dependency-injection \"Dependency Injection Guide\"}.\n *\n * ### Example\n *\n * {@example core/di/ts/metadata_spec.ts region='Self'}\n *\n * @stable\n */\n (): any;\n new (): Self;\n}\n\n/**\n * Type of the Self metadata.\n *\n * @stable\n */\nexport interface Self {}\n\n/**\n * Self decorator and metadata.\n *\n * @stable\n * @Annotation\n */\nexport const Self: SelfDecorator = makeParamDecorator('Self', []);\n\n/**\n * Type of the SkipSelf decorator / constructor function.\n *\n * @stable\n */\nexport interface SkipSelfDecorator {\n /**\n * @whatItDoes Specifies that the dependency resolution should start from the parent injector.\n * @howToUse\n * ```\n * @Injectable()\n * class Car {\n * constructor(@SkipSelf() public engine:Engine) {}\n * }\n * ```\n *\n * @description\n * For more details, see the {@linkDocs guide/dependency-injection \"Dependency Injection Guide\"}.\n *\n * ### Example\n *\n * {@example core/di/ts/metadata_spec.ts region='SkipSelf'}\n *\n * @stable\n */\n (): any;\n new (): SkipSelf;\n}\n\n/**\n * Type of the SkipSelf metadata.\n *\n * @stable\n */\nexport interface SkipSelf {}\n\n/**\n * SkipSelf decorator and metadata.\n *\n * @stable\n * @Annotation\n */\nexport const SkipSelf: SkipSelfDecorator = makeParamDecorator('SkipSelf', []);\n\n/**\n * Type of the Host decorator / constructor function.\n *\n * @stable\n */\nexport interface HostDecorator {\n /**\n * @whatItDoes Specifies that an injector should retrieve a dependency from any injector until\n * reaching the host element of the current component.\n * @howToUse\n * ```\n * @Injectable()\n * class Car {\n * constructor(@Host() public engine:Engine) {}\n * }\n * ```\n *\n * @description\n * For more details, see the {@linkDocs guide/dependency-injection \"Dependency Injection Guide\"}.\n *\n * ### Example\n *\n * {@example core/di/ts/metadata_spec.ts region='Host'}\n *\n * @stable\n */\n (): any;\n new (): Host;\n}\n\n/**\n * Type of the Host metadata.\n *\n * @stable\n */\nexport interface Host {}\n\n/**\n * Host decorator and metadata.\n *\n * @stable\n * @Annotation\n */\nexport const Host: HostDecorator = makeParamDecorator('Host', []);\n"]}
\No newline at end of file