1 | import { Binding, BindingFilter, BindingFromClassOptions, BindingScope, Constructor, Context, Application, Component, MixinTarget } from '@loopback/core';
|
2 | import { Bootable, Booter, BootOptions, InstanceWithBooters } from '../types';
|
3 | import * as loopbackContext from '@loopback/core';
|
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 | undefined): 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 | undefined): Binding<C>;
|
76 | |
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | mountComponentBooters(componentInstanceOrClass: Constructor<unknown> | InstanceWithBooters): void;
|
84 | readonly options: loopbackContext.ApplicationConfig;
|
85 | readonly state: string;
|
86 | controller: <T_1>(controllerCtor: loopbackContext.ControllerClass<T_1>, nameOrOptions?: string | BindingFromClassOptions | undefined) => Binding<T_1>;
|
87 | server: <T_2 extends loopbackContext.Server>(ctor: Constructor<T_2>, nameOrOptions?: string | BindingFromClassOptions | undefined) => Binding<T_2>;
|
88 | servers: <T_3 extends loopbackContext.Server>(ctors: Constructor<T_3>[]) => Binding<any>[];
|
89 | getServer: <T_4 extends loopbackContext.Server>(target: string | Constructor<T_4>) => Promise<T_4>;
|
90 | init: () => Promise<void>;
|
91 | onInit: (fn: () => loopbackContext.ValueOrPromise<void>) => Binding<loopbackContext.LifeCycleObserver>;
|
92 | onStart: (fn: () => loopbackContext.ValueOrPromise<void>) => Binding<loopbackContext.LifeCycleObserver>;
|
93 | stop: () => Promise<void>;
|
94 | onStop: (fn: () => loopbackContext.ValueOrPromise<void>) => Binding<loopbackContext.LifeCycleObserver>;
|
95 | setMetadata: (metadata: loopbackContext.ApplicationMetadata) => void;
|
96 | lifeCycleObserver: <T_5 extends loopbackContext.LifeCycleObserver>(ctor: Constructor<T_5>, nameOrOptions?: string | BindingFromClassOptions | undefined) => Binding<T_5>;
|
97 | service: <S>(cls: loopbackContext.ServiceOrProviderClass<S>, nameOrOptions?: string | loopbackContext.ServiceOptions | undefined) => Binding<S>;
|
98 | interceptor: (interceptor: loopbackContext.Interceptor | Constructor<loopbackContext.Provider<loopbackContext.Interceptor>>, nameOrOptions?: string | loopbackContext.InterceptorBindingOptions | undefined) => Binding<loopbackContext.Interceptor>;
|
99 | readonly name: string;
|
100 | readonly subscriptionManager: loopbackContext.ContextSubscriptionManager;
|
101 | scope: BindingScope;
|
102 | readonly parent: Context | undefined;
|
103 | emitEvent: <T_6 extends loopbackContext.ContextEvent>(type: string, event: T_6) => void;
|
104 | emitError: (err: unknown) => void;
|
105 | bind: <ValueType = any>(key: loopbackContext.BindingAddress<ValueType>) => Binding<ValueType>;
|
106 | add: (binding: Binding<unknown>) => Application;
|
107 | configure: <ConfigValueType = any>(key?: loopbackContext.BindingAddress<unknown> | undefined) => Binding<ConfigValueType>;
|
108 | getConfigAsValueOrPromise: <ConfigValueType_1>(key: loopbackContext.BindingAddress<unknown>, propertyPath?: string | undefined, resolutionOptions?: loopbackContext.ResolutionOptions | undefined) => loopbackContext.ValueOrPromise<ConfigValueType_1 | undefined>;
|
109 | getConfig: <ConfigValueType_2>(key: loopbackContext.BindingAddress<unknown>, propertyPath?: string | undefined, resolutionOptions?: loopbackContext.ResolutionOptions | undefined) => Promise<ConfigValueType_2 | undefined>;
|
110 | getConfigSync: <ConfigValueType_3>(key: loopbackContext.BindingAddress<unknown>, propertyPath?: string | undefined, resolutionOptions?: loopbackContext.ResolutionOptions | undefined) => ConfigValueType_3 | undefined;
|
111 | unbind: (key: loopbackContext.BindingAddress<unknown>) => boolean;
|
112 | subscribe: (observer: loopbackContext.ContextEventObserver) => loopbackContext.Subscription;
|
113 | unsubscribe: (observer: loopbackContext.ContextEventObserver) => boolean;
|
114 | close: () => void;
|
115 | isSubscribed: (observer: loopbackContext.ContextObserver) => boolean;
|
116 | createView: <T_7 = unknown>(filter: BindingFilter, comparator?: loopbackContext.BindingComparator | undefined, options?: Omit<loopbackContext.ResolutionOptions, "session"> | undefined) => loopbackContext.ContextView<T_7>;
|
117 | contains: (key: loopbackContext.BindingAddress<unknown>) => boolean;
|
118 | isBound: (key: loopbackContext.BindingAddress<unknown>) => boolean;
|
119 | getOwnerContext: (keyOrBinding: Readonly<Binding<unknown>> | loopbackContext.BindingAddress<unknown>) => 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 | loopbackContext.BindingTag) => Readonly<Binding<ValueType_2>>[];
|
125 | get: {
|
126 | <ValueType_3>(keyWithPath: loopbackContext.BindingAddress<ValueType_3>, session?: loopbackContext.ResolutionSession | undefined): Promise<ValueType_3>;
|
127 | <ValueType_4>(keyWithPath: loopbackContext.BindingAddress<ValueType_4>, options: loopbackContext.ResolutionOptions): Promise<ValueType_4 | undefined>;
|
128 | };
|
129 | getSync: {
|
130 | <ValueType_5>(keyWithPath: loopbackContext.BindingAddress<ValueType_5>, session?: loopbackContext.ResolutionSession | undefined): ValueType_5;
|
131 | <ValueType_6>(keyWithPath: loopbackContext.BindingAddress<ValueType_6>, options?: loopbackContext.ResolutionOptions | undefined): ValueType_6 | undefined;
|
132 | };
|
133 | getBinding: {
|
134 | <ValueType_7 = any>(key: loopbackContext.BindingAddress<ValueType_7>): Binding<ValueType_7>;
|
135 | <ValueType_8>(key: loopbackContext.BindingAddress<ValueType_8>, options?: {
|
136 | optional?: boolean | undefined;
|
137 | } | undefined): Binding<ValueType_8> | undefined;
|
138 | };
|
139 | findOrCreateBinding: <T_8>(key: loopbackContext.BindingAddress<T_8>, policy?: loopbackContext.BindingCreationPolicy | undefined) => Binding<T_8>;
|
140 | getValueOrPromise: <ValueType_9>(keyWithPath: loopbackContext.BindingAddress<ValueType_9>, optionsOrSession?: loopbackContext.ResolutionOptionsOrSession | undefined) => loopbackContext.ValueOrPromise<ValueType_9 | undefined>;
|
141 | toJSON: () => loopbackContext.JSONObject;
|
142 | inspect: (options?: loopbackContext.ContextInspectOptions | undefined) => loopbackContext.JSONObject;
|
143 | on: {
|
144 | (eventName: "bind" | "unbind", listener: loopbackContext.ContextEventListener): Application;
|
145 | (event: string | symbol, listener: (...args: any[]) => void): Application;
|
146 | };
|
147 | once: {
|
148 | (eventName: "bind" | "unbind", listener: loopbackContext.ContextEventListener): Application;
|
149 | (event: string | symbol, listener: (...args: any[]) => void): Application;
|
150 | };
|
151 | addListener: (event: string | symbol, listener: (...args: any[]) => void) => Application;
|
152 | removeListener: (event: string | symbol, listener: (...args: any[]) => void) => Application;
|
153 | off: (event: string | symbol, listener: (...args: any[]) => void) => Application;
|
154 | removeAllListeners: (event?: string | symbol | undefined) => Application;
|
155 | setMaxListeners: (n: number) => Application;
|
156 | getMaxListeners: () => number;
|
157 | listeners: (event: string | symbol) => Function[];
|
158 | rawListeners: (event: string | symbol) => Function[];
|
159 | emit: (event: string | symbol, ...args: any[]) => boolean;
|
160 | listenerCount: (type: string | symbol) => number;
|
161 | prependListener: (event: string | symbol, listener: (...args: any[]) => void) => Application;
|
162 | prependOnceListener: (event: string | symbol, listener: (...args: any[]) => void) => Application;
|
163 | eventNames: () => (string | symbol)[];
|
164 | };
|
165 | } & T;
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 | export declare function bindBooter(ctx: Context, booterCls: Constructor<Booter>): Binding;
|
174 | export declare const _bindBooter: typeof bindBooter;
|