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