11import { IDictionary } from "../declarations" ;
2- import { ICommand } from "./commands" ;
3- import { IKeyCommand , IValidKeyName } from "./key-commands" ;
42import { Injector } from "../di/injector" ;
53import { Provider } from "../di/providers" ;
4+ import { CommandRegistry } from "../contracts/command-registry" ;
5+ import { KeyCommandRegistry } from "../contracts/key-command-registry" ;
6+ import { ModuleRegistry } from "../contracts/module-registry" ;
7+ import { PublicApiBuilder } from "../contracts/public-api-builder" ;
68
79/**
810 * The legacy injector facade surface. It extends the token-based `Injector` —
911 * the facade IS an injector — and adds the legacy subsystems, whose members
1012 * are individually @deprecated. Only the `Yok` class hierarchy implements
1113 * this; the interface survives until the hook/extension deprecation completes.
1214 */
13- interface IInjector extends Injector {
14- /**
15- * @deprecated Use provideLazy() — the same deferred loading, token-based.
16- */
17- require ( name : string , file : string ) : void ;
18- /**
19- * @deprecated Use provideLazy() — the same deferred loading, token-based.
20- */
21- require ( names : string [ ] , file : string ) : void ;
22- /**
23- * @deprecated Legacy public-API builder.
24- */
25- requirePublic ( names : string | string [ ] , file : string ) : void ;
26- /**
27- * @deprecated Legacy public-API builder.
28- */
29- requirePublicClass ( names : string | string [ ] , file : string ) : void ;
30- /**
31- * @deprecated Path-based command registration; slated for replacement by
32- * manifest-declared commands.
33- */
34- requireCommand ( name : string , file : string ) : void ;
35- /**
36- * @deprecated Path-based command registration; slated for replacement by
37- * manifest-declared commands.
38- */
39- requireCommand ( names : string [ ] , file : string ) : void ;
40- /**
41- * @deprecated Replaced together with the command registry.
42- */
43- requireKeyCommand ( name : IValidKeyName , file : string ) : void ;
15+ interface IInjector
16+ extends
17+ Injector ,
18+ CommandRegistry ,
19+ KeyCommandRegistry ,
20+ ModuleRegistry ,
21+ PublicApiBuilder {
4422 /**
4523 * Resolves an implementation by constructor function.
4624 * The injector will create new instances for every call.
@@ -62,43 +40,12 @@ interface IInjector extends Injector {
6240 */
6341 resolve < T > ( name : string , ctorArguments ?: IDictionary < any > ) : T ;
6442
65- /**
66- * @deprecated Legacy command-registry lookup.
67- */
68- resolveCommand ( name : string ) : ICommand ;
69- /**
70- * @deprecated Legacy command-registry lookup.
71- */
72- resolveKeyCommand ( key : string ) : IKeyCommand ;
7343 /**
7444 * @deprecated Legacy name-based registration. Use the Provider overload or
7545 * provide(); a contract's token name keeps string spellings resolvable.
7646 */
7747 register ( name : string , resolver : any , shared ?: boolean ) : void ;
7848 register ( providers : Provider | Provider [ ] ) : void ;
79- /**
80- * @deprecated Slated for replacement by defineCommand and manifest-declared
81- * commands.
82- */
83- registerCommand ( name : string , resolver : any ) : void ;
84- /**
85- * @deprecated Slated for replacement by defineCommand and manifest-declared
86- * commands.
87- */
88- registerCommand ( names : string [ ] , resolver : any ) : void ;
89- /**
90- * @deprecated Replaced together with the command registry.
91- */
92- registerKeyCommand ( key : IValidKeyName , resolver : any ) : void ;
93- /**
94- * @deprecated Legacy command-registry enumeration; feeds shell
95- * autocompletion and help.
96- */
97- getRegisteredCommandsNames ( includeDev : boolean ) : string [ ] ;
98- /**
99- * @deprecated Legacy command-registry enumeration.
100- */
101- getRegisteredKeyCommandsNames ( ) : string [ ] ;
10249 /**
10350 * @deprecated String-reflective help templating; removable only together
10451 * with the help-template pipeline.
@@ -108,43 +55,6 @@ interface IInjector extends Injector {
10855 * @deprecated See dynamicCallRegex.
10956 */
11057 dynamicCall ( call : string , args ?: any [ ] ) : Promise < any > ;
111- /**
112- * @deprecated Legacy command-registry routing.
113- */
114- isDefaultCommand ( commandName : string ) : boolean ;
115- /**
116- * @deprecated Legacy command-registry routing.
117- * Side-effecting: fails with help output on a bad subcommand.
118- */
119- isValidHierarchicalCommand (
120- commandName : string ,
121- commandArguments : string [ ] ,
122- ) : Promise < boolean > ;
123- /**
124- * @deprecated Legacy command-registry routing.
125- */
126- getChildrenCommandsNames ( commandName : string ) : string [ ] ;
127- /**
128- * @deprecated Hierarchical-routing internals of the legacy command
129- * registry.
130- */
131- buildHierarchicalCommand (
132- parentCommandName : string ,
133- commandLineArguments : string [ ] ,
134- ) : any ;
135- /**
136- * @deprecated Backing store of the require('nativescript') surface.
137- * Do not add new entries through it.
138- */
139- publicApi : any ;
140-
141- /**
142- * Defines if it's allowed to override already required module.
143- * This can be used in order to allow redefinition of modules, for example $logger can be replaced by a plugin.
144- * Default value is false.
145- * @deprecated Escape hatch of the legacy require-time module map.
146- */
147- overrideAlreadyRequiredModule : boolean ;
14858}
14959
15060/**
0 commit comments