1 |
|
2 | import { Application, Binding, BindingFilter, BindingFromClassOptions, BindingScope, Component, Constructor, Context, MixinTarget } from '@loopback/core';
|
3 | import { Bootable, Booter, BootOptions, InstanceWithBooters } from '../types';
|
4 | export { Binding };
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | export declare function BootMixin<T extends MixinTarget<Application>>(superClass: T): {
|
23 | new (...args: any[]): {
|
24 | projectRoot: string;
|
25 | bootOptions?: BootOptions | undefined;
|
26 | booted: boolean;
|
27 | |
28 |
|
29 |
|
30 | start(): Promise<void>;
|
31 | |
32 |
|
33 |
|
34 | boot(): Promise<void>;
|
35 | |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | booters(...booterCls: Constructor<Booter>[]): Binding[];
|
47 | |
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | applicationBooter(subApp: Application & Bootable, filter?: BindingFilter): Binding<Booter>;
|
56 | |
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 | component<C extends Component = Component>(componentCtor: Constructor<C>, nameOrOptions?: string | BindingFromClassOptions): Binding<C>;
|
76 | |
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | mountComponentBooters(componentInstanceOrClass: Constructor<unknown> | InstanceWithBooters): void;
|
84 | readonly options: import("@loopback/core").ApplicationConfig;
|
85 | readonly state: string;
|
86 | controller: <T>(controllerCtor: import("@loopback/core").ControllerClass<T>, nameOrOptions?: string | BindingFromClassOptions | undefined) => Binding<T>;
|
87 | server: <T_1 extends import("@loopback/core").Server>(ctor: Constructor<T_1>, nameOrOptions?: string | BindingFromClassOptions | undefined) => Binding<T_1>;
|
88 | servers: <T_2 extends import("@loopback/core").Server>(ctors: Constructor<T_2>[]) => Binding<any>[];
|
89 | getServer: <T_3 extends import("@loopback/core").Server>(target: string | Constructor<T_3>) => Promise<T_3>;
|
90 | init: () => Promise<void>;
|
91 | onInit: (fn: () => import("@loopback/core").ValueOrPromise<void>) => Binding<import("@loopback/core").LifeCycleObserver>;
|
92 | onStart: (fn: () => import("@loopback/core").ValueOrPromise<void>) => Binding<import("@loopback/core").LifeCycleObserver>;
|
93 | stop: () => Promise<void>;
|
94 | onStop: (fn: () => import("@loopback/core").ValueOrPromise<void>) => Binding<import("@loopback/core").LifeCycleObserver>;
|
95 | setMetadata: (metadata: import("@loopback/core").ApplicationMetadata) => void;
|
96 | lifeCycleObserver: <T_4 extends import("@loopback/core").LifeCycleObserver>(ctor: Constructor<T_4>, nameOrOptions?: string | BindingFromClassOptions | undefined) => Binding<T_4>;
|
97 | service: <S>(cls: import("@loopback/core").ServiceOrProviderClass<S>, nameOrOptions?: string | import("@loopback/core").ServiceOptions | undefined) => Binding<S>;
|
98 | interceptor: (interceptor: import("@loopback/core").Interceptor | Constructor<import("@loopback/core").Provider<import("@loopback/core").Interceptor>>, nameOrOptions?: string | import("@loopback/core").InterceptorBindingOptions | undefined) => Binding<import("@loopback/core").Interceptor>;
|
99 | readonly name: string;
|
100 | readonly subscriptionManager: import("@loopback/core").ContextSubscriptionManager;
|
101 | scope: BindingScope;
|
102 | readonly parent: Context | undefined;
|
103 | emitEvent: <T_5 extends import("@loopback/core").ContextEvent>(type: string, event: T_5) => void;
|
104 | emitError: (err: unknown) => void;
|
105 | bind: <ValueType = any>(key: import("@loopback/core").BindingAddress<ValueType>) => Binding<ValueType>;
|
106 | add: (binding: Binding<unknown>) => Application;
|
107 | configure: <ConfigValueType = any>(key?: import("@loopback/core").BindingAddress | undefined) => Binding<ConfigValueType>;
|
108 | getConfigAsValueOrPromise: <ConfigValueType_1>(key: import("@loopback/core").BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => import("@loopback/core").ValueOrPromise<ConfigValueType_1 | undefined>;
|
109 | getConfig: <ConfigValueType_2>(key: import("@loopback/core").BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => Promise<ConfigValueType_2 | undefined>;
|
110 | getConfigSync: <ConfigValueType_3>(key: import("@loopback/core").BindingAddress, propertyPath?: string | undefined, resolutionOptions?: import("@loopback/core").ResolutionOptions | undefined) => ConfigValueType_3 | undefined;
|
111 | unbind: (key: import("@loopback/core").BindingAddress) => boolean;
|
112 | subscribe: (observer: import("@loopback/core").ContextEventObserver) => import("@loopback/core").Subscription;
|
113 | unsubscribe: (observer: import("@loopback/core").ContextEventObserver) => boolean;
|
114 | close: () => void;
|
115 | isSubscribed: (observer: import("@loopback/core").ContextObserver) => boolean;
|
116 | createView: <T_6 = unknown>(filter: BindingFilter, comparator?: import("@loopback/core").BindingComparator | undefined, options?: Omit<import("@loopback/core").ResolutionOptions, "session"> | undefined) => import("@loopback/core").ContextView<T_6>;
|
117 | contains: (key: import("@loopback/core").BindingAddress) => boolean;
|
118 | isBound: (key: import("@loopback/core").BindingAddress) => boolean;
|
119 | getOwnerContext: (keyOrBinding: Readonly<Binding<unknown>> | import("@loopback/core").BindingAddress) => Context | undefined;
|
120 | getScopedContext: (scope: BindingScope.APPLICATION | BindingScope.SERVER | BindingScope.REQUEST) => Context | undefined;
|
121 | getResolutionContext: (binding: Readonly<Binding<unknown>>) => Context | undefined;
|
122 | isVisibleTo: (ctx: Context) => boolean;
|
123 | find: <ValueType_1 = any>(pattern?: string | RegExp | BindingFilter | undefined) => Readonly<Binding<ValueType_1>>[];
|
124 | findByTag: <ValueType_2 = any>(tagFilter: RegExp | import("@loopback/core").BindingTag) => Readonly<Binding<ValueType_2>>[];
|
125 | get: {
|
126 | <ValueType_3>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_3>, session?: import("@loopback/core").ResolutionSession | undefined): Promise<ValueType_3>;
|
127 | <ValueType_4>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_4>, options: import("@loopback/core").ResolutionOptions): Promise<ValueType_4 | undefined>;
|
128 | };
|
129 | getSync: {
|
130 | <ValueType_5>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_5>, session?: import("@loopback/core").ResolutionSession | undefined): ValueType_5;
|
131 | <ValueType_6>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_6>, options?: import("@loopback/core").ResolutionOptions | undefined): ValueType_6 | undefined;
|
132 | };
|
133 | getBinding: {
|
134 | <ValueType_7 = any>(key: import("@loopback/core").BindingAddress<ValueType_7>): Binding<ValueType_7>;
|
135 | <ValueType_8>(key: import("@loopback/core").BindingAddress<ValueType_8>, options?: {
|
136 | optional?: boolean | undefined;
|
137 | } | undefined): Binding<ValueType_8> | undefined;
|
138 | };
|
139 | findOrCreateBinding: <T_7>(key: import("@loopback/core").BindingAddress<T_7>, policy?: import("@loopback/core").BindingCreationPolicy | undefined) => Binding<T_7>;
|
140 | getValueOrPromise: <ValueType_9>(keyWithPath: import("@loopback/core").BindingAddress<ValueType_9>, optionsOrSession?: import("@loopback/core").ResolutionOptionsOrSession | undefined) => import("@loopback/core").ValueOrPromise<ValueType_9 | undefined>;
|
141 | toJSON: () => import("@loopback/core").JSONObject;
|
142 | inspect: (options?: import("@loopback/core").ContextInspectOptions | undefined) => import("@loopback/core").JSONObject;
|
143 | on: {
|
144 | (eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): Application;
|
145 | (event: string | symbol, listener: (...args: any[]) => void): Application;
|
146 | };
|
147 | once: {
|
148 | (eventName: "bind" | "unbind", listener: import("@loopback/core").ContextEventListener): Application;
|
149 | (event: string | symbol, listener: (...args: any[]) => void): Application;
|
150 | };
|
151 | [EventEmitter.captureRejectionSymbol]?: (<K>(error: Error, event: string | symbol, ...args: any[]) => void) | undefined;
|
152 | addListener: <K_1>(eventName: string | symbol, listener: (...args: any[]) => void) => Application;
|
153 | removeListener: <K_2>(eventName: string | symbol, listener: (...args: any[]) => void) => Application;
|
154 | off: <K_3>(eventName: string | symbol, listener: (...args: any[]) => void) => Application;
|
155 | removeAllListeners: (event?: string | symbol | undefined) => Application;
|
156 | setMaxListeners: (n: number) => Application;
|
157 | getMaxListeners: () => number;
|
158 | listeners: <K_4>(eventName: string | symbol) => Function[];
|
159 | rawListeners: <K_5>(eventName: string | symbol) => Function[];
|
160 | emit: <K_6>(eventName: string | symbol, ...args: any[]) => boolean;
|
161 | listenerCount: <K_7>(eventName: string | symbol, listener?: Function | undefined) => number;
|
162 | prependListener: <K_8>(eventName: string | symbol, listener: (...args: any[]) => void) => Application;
|
163 | prependOnceListener: <K_9>(eventName: string | symbol, listener: (...args: any[]) => void) => Application;
|
164 | eventNames: () => (string | symbol)[];
|
165 | };
|
166 | } & T;
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 | export declare function bindBooter(ctx: Context, booterCls: Constructor<Booter>): Binding;
|
175 | export declare const _bindBooter: typeof bindBooter;
|