1 |
|
2 |
|
3 | import { Container, ContainerSettings, Context, ILogger, ITypeRegistry, Identity, LogLevel, Logger, StoppableEvent, StoppableEventException, Symbols, Transporter } from '@e2/lib';
|
4 | import { Exception } from 'agentframework';
|
5 |
|
6 | export declare class Hash52 {
|
7 | static toNumber(input: string): number;
|
8 | static toBuffer(input: string): Buffer;
|
9 | static toArray(input: string): Uint8Array;
|
10 | }
|
11 | export declare class Hash32 {
|
12 | static toNumber(input: string): number;
|
13 | static toBuffer(input: string): Buffer;
|
14 | static toArray(input: string): Uint8Array;
|
15 | }
|
16 | export declare class Hash24 {
|
17 | static toNumber(input: string): number;
|
18 | static toBuffer(input: string): Buffer;
|
19 | static toArray(input: string): Uint8Array;
|
20 | }
|
21 | export declare class Hash16 {
|
22 | static toNumber(input: string): number;
|
23 | static toBuffer(input: string): Buffer;
|
24 | static toArray(input: string): Uint8Array;
|
25 | }
|
26 | export declare class BaseX {
|
27 | map: object;
|
28 | alphabet: string;
|
29 | base: number;
|
30 | leader: string;
|
31 | constructor(alphabet: string);
|
32 | static readonly singleton: BaseX;
|
33 | fromBuffer(data: Buffer): string;
|
34 | toBuffer(text: string): Buffer;
|
35 | fromHex(hex: string): string;
|
36 | toHex(text: string): string;
|
37 | fromNumber(n: number): string;
|
38 | toNumber(text: string): number;
|
39 | private decodeUnsafe;
|
40 | }
|
41 | export declare class Base58 extends BaseX {
|
42 | constructor();
|
43 | static fromBuffer(data: Buffer): string;
|
44 | static toBuffer(text: string): Buffer;
|
45 | static fromHex(hex: string): string;
|
46 | static toHex(text: string): string;
|
47 | static fromNumber(n: number): string;
|
48 | static toNumber(text: string): number;
|
49 | }
|
50 | export declare class Base62 extends BaseX {
|
51 | constructor();
|
52 | static fromBuffer(data: Buffer): string;
|
53 | static toBuffer(text: string): Buffer;
|
54 | static fromHex(hex: string): string;
|
55 | static toHex(text: string): string;
|
56 | static fromNumber(n: number): string;
|
57 | static toNumber(text: string): number;
|
58 | }
|
59 | export declare class ObjectId {
|
60 | _bsontype: string;
|
61 | id: Buffer;
|
62 | private static index;
|
63 | constructor(id?: ObjectId | string | Buffer | number | Date);
|
64 | generationTime: number;
|
65 | getTimestamp(): Date;
|
66 | equals(otherId: string | ObjectId): boolean;
|
67 | toHexString(): string;
|
68 | toString(format?: string): string;
|
69 | inspect(): string;
|
70 | toJSON(): string;
|
71 | static createFromTime(time: number): ObjectId;
|
72 | static createFromHexString(hex: string): ObjectId;
|
73 | static isValid(id: any): boolean;
|
74 | private static generate;
|
75 | private static get_inc;
|
76 | }
|
77 | export declare function CreateHashedObjectId(inputs: Array<string | Buffer | number | any> | string | Buffer | number | any, algorithm?: string): ObjectId;
|
78 | export declare class FileStreamException extends Exception {
|
79 | }
|
80 | export declare class FileWriteException extends Exception {
|
81 | }
|
82 | export declare class File {
|
83 | private _file;
|
84 | private _permission;
|
85 | private constructor();
|
86 | static Read: number;
|
87 | static ReadWrite: number;
|
88 | static Write: number;
|
89 | static resolve(root: string, filePath: string, permission: number): File;
|
90 | toString(): string;
|
91 | readonly path: string;
|
92 | readonly permission: number;
|
93 | readAll(): string;
|
94 | }
|
95 | export declare class Directory {
|
96 | private _directory;
|
97 | private _permission;
|
98 | private constructor();
|
99 | static cwd(): Directory;
|
100 | static withReadPermission(directory: string): Directory;
|
101 | static withReadWritePermission(directory: string): Directory;
|
102 | static mkdir(dir: string, mode?: number): boolean;
|
103 | private static resolve;
|
104 | toString(): string;
|
105 | readonly path: string;
|
106 | directory(relativePath: string): Directory;
|
107 | file(relativeFilePath: string): File;
|
108 | }
|
109 | export declare class ApplicationSettings extends ContainerSettings {
|
110 | static [Symbols.Initializer](ctx: Container<ContainerSettings>, opts?: any): any;
|
111 | AUTO_CREATE_DIRECTORY: boolean;
|
112 | PACKAGE_FILE: string;
|
113 | EXIT_WAIT_TIMEOUT: number;
|
114 | HOME_DIR: string;
|
115 | DATA_DIR: string;
|
116 | CONF_DIR: string;
|
117 | LOG_DIR: string;
|
118 | LOG_LEVEL: string | 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
|
119 | }
|
120 | export declare class ApplicationLogger extends Logger {
|
121 | static [Symbols.Initializer](app: Context<ApplicationSettings>): ILogger;
|
122 | }
|
123 | export declare class StandardOutputTransporter extends Transporter {
|
124 | private formatter;
|
125 | constructor(level: LogLevel, style: string);
|
126 | format(data: string): string;
|
127 | write(data: string): void;
|
128 | writeSync(data: string): void;
|
129 | }
|
130 | export declare class FileLogTransporter extends Transporter {
|
131 | private fd;
|
132 | private stream;
|
133 | private readonly filename;
|
134 | constructor(level: LogLevel, filename: string);
|
135 | openWritableFileStream(): void;
|
136 | write(data: string): void;
|
137 | writeSync(data: string): void;
|
138 | }
|
139 | export interface IApplicationOptions {
|
140 | root: string;
|
141 | confDir: string;
|
142 | settings?: any;
|
143 | registry?: ITypeRegistry;
|
144 | params?: Array<any>;
|
145 | }
|
146 | export declare class Application<S extends ApplicationSettings> extends Container<S> {
|
147 | protected readonly options: IApplicationOptions;
|
148 | protected onCreatingState(): any;
|
149 | protected onCreatingIdentity(): Identity;
|
150 | protected onCreatingLogger(): ILogger;
|
151 | protected onCreatingSettings(): S;
|
152 | protected onCreatingRootDirectory(): Directory;
|
153 | constructor(opts?: IApplicationOptions);
|
154 | protected readonly root: Directory;
|
155 | directory(relativePath?: string): Directory;
|
156 | file(relativeFilePath: string): File;
|
157 | exit(reason?: Error | object | string): void;
|
158 | get(key: string, defaultValue?: any): any;
|
159 | set(key: string, value: any): any;
|
160 | has(key: string): boolean;
|
161 | }
|
162 | export declare class UncaughtExceptionEvent extends StoppableEvent {
|
163 | exception: Exception | Error;
|
164 | constructor(exception: Exception | Error);
|
165 | }
|
166 | export declare class UnhandledException extends StoppableEventException {
|
167 | event: UncaughtExceptionEvent;
|
168 | constructor(event: UncaughtExceptionEvent, error: Exception | Error);
|
169 | }
|
170 | export declare class SignalEvent extends StoppableEvent {
|
171 | signal: string;
|
172 | code: number;
|
173 | constructor(signal: string, code: number);
|
174 | }
|
175 | export declare class UnhandledSignalEventException extends StoppableEventException {
|
176 | event: SignalEvent;
|
177 | constructor(event: SignalEvent, signal: string, code: number);
|
178 | }
|
179 | export declare enum ApplicationEvents {
|
180 | signals = "signals",
|
181 | uncaughtException = "uncaughtException",
|
182 | unhandledRejection = "unhandledRejection",
|
183 | exiting = "exiting",
|
184 | exit = "exit"
|
185 | }
|
186 | export declare class ExitEvent extends StoppableEvent {
|
187 | }
|
188 | export declare function parseYAML(file: File): any;
|
189 | export declare function parseJSON(file: File): any;
|
190 | export declare function dumpYAML(data: any, filename: string): void;
|
191 | export declare function dumpJSON(data: any, filename: string): void;
|
192 | export declare function serialize(obj: any): string;
|
193 | export { Constructor, TypedConstructor, TypedConstructorWithParameters, TypedConstructorWithoutParameter } from 'agentframework';
|
194 | export { IAttribute, IAgentAttribute, IBeforeDecorateAttribute } from 'agentframework';
|
195 | export { IInterceptor } from 'agentframework';
|
196 | export { IInitializer } from 'agentframework';
|
197 | export { IInvocation } from 'agentframework';
|
198 | export { IDesign } from 'agentframework';
|
199 | export { PropertyFilter, Reflection, Property, Method, Parameter } from 'agentframework';
|
200 | export { PropertyFilters } from 'agentframework';
|
201 | export { Reflector } from 'agentframework';
|
202 | export { AgentAttribute } from 'agentframework';
|
203 | export { Decoratable } from 'agentframework';
|
204 | export { Target, UniversalDecorator, decorateAgent, decorateClass, decorateClassMember, decorateClassMethod, decorateClassField, decorateParameter, decorate } from 'agentframework';
|
205 | export { IsObject, IsFunction, IsNullOrUndefined, IsObjectOrFunction, IsSymbol, IsString, IsNumber, IsEqual, ToPropertyKey, GetPrototypeArray, GetPrototypeArrayReverse } from 'agentframework';
|
206 | export { Exception } from 'agentframework';
|
207 | export { padStart, padEnd } from '@e2/lib';
|
208 | export { ConfigurationAttribute } from '@e2/lib';
|
209 | export { ControllerAttribute } from '@e2/lib';
|
210 | export { MethodAttribute } from '@e2/lib';
|
211 | export { MiddlewareAttribute } from '@e2/lib';
|
212 | export { ParamsAttribute } from '@e2/lib';
|
213 | export { ServiceAttribute } from '@e2/lib';
|
214 | export { SingletonAttribute } from '@e2/lib';
|
215 | export { TransitAttribute } from '@e2/lib';
|
216 | export { ModelAttribute } from '@e2/lib';
|
217 | export { KeyAttribute } from '@e2/lib';
|
218 | export { PropertyAttribute } from '@e2/lib';
|
219 | export { controller, middleware, param, method, service, singleton, transit, conf } from '@e2/lib';
|
220 | export { model, key, property } from '@e2/lib';
|
221 | export { IsAssignable } from '@e2/lib';
|
222 | export { Resolvable } from '@e2/lib';
|
223 | export { IRouter, IRouterEventHandlers, RouteFunction, RouteHandler, Router } from '@e2/lib';
|
224 | export { RouterEventHandlers } from '@e2/lib';
|
225 | export { CreateObjectSignature } from '@e2/lib';
|
226 | export { CreateFlattenObject } from '@e2/lib';
|
227 | export { retry, sleep, RetryOptions, RetryContext, RetryFunction } from '@e2/lib';
|
228 | export { BeforeRetry, CalculateBackoff, HandleError, HandleTimeout } from '@e2/lib';
|
229 | export { ITypeRegistry } from '@e2/lib';
|
230 | export { TypeFinalizer, TypeInitializer } from '@e2/lib';
|
231 | export { TypeRegistry } from '@e2/lib';
|
232 | export { ITypeResolver } from '@e2/lib';
|
233 | export { TypeResolver } from '@e2/lib';
|
234 | export { Compositor } from '@e2/lib';
|
235 | export { Sequence } from '@e2/lib';
|
236 | export { StepFunction, NextFunction, LastFunction } from '@e2/lib';
|
237 | export { StoppableEvent } from '@e2/lib';
|
238 | export { PriorityEventEmitter } from '@e2/lib';
|
239 | export { ILogger } from '@e2/lib';
|
240 | export { LogLevel } from '@e2/lib';
|
241 | export { Logger } from '@e2/lib';
|
242 | export { Transporter } from '@e2/lib';
|
243 | export { AbstractLogger } from '@e2/lib';
|
244 | export { ChildLogger } from '@e2/lib';
|
245 | export { LoggerOptions } from '@e2/lib';
|
246 | export { Serializers } from '@e2/lib';
|
247 | export { ConsoleTransporter } from '@e2/lib';
|
248 | export { ConsoleFormatter } from '@e2/lib';
|
249 | export { ConsoleLogger } from '@e2/lib';
|
250 | export { DeserializationException } from '@e2/lib';
|
251 | export { SerializationException } from '@e2/lib';
|
252 | export { LoggerException } from '@e2/lib';
|
253 | export { TransporterException } from '@e2/lib';
|
254 | export { MissingConfigurationValueException } from '@e2/lib';
|
255 | export { StoppableEventException } from '@e2/lib';
|
256 | export { NotImplementedException } from '@e2/lib';
|
257 | export { NotSupportedException } from '@e2/lib';
|
258 | export { Route } from '@e2/lib';
|
259 | export { MatchedRoute } from '@e2/lib';
|
260 | export { Param } from '@e2/lib';
|
261 | export { ILoggerSettings } from '@e2/lib';
|
262 | export { Context } from '@e2/lib';
|
263 | export { Identity } from '@e2/lib';
|
264 | export { Container } from '@e2/lib';
|
265 | export { ContainerSettings } from '@e2/lib';
|
266 | export { IContainerOptions } from '@e2/lib';
|
267 | export { Symbols } from '@e2/lib';
|
268 | export { SafeJSON } from '@e2/lib';
|
269 | export { defineProperty } from '@e2/lib';
|
270 | export { IDisposable } from '@e2/lib';
|
271 | export { StringFormatter } from '@e2/lib'; |
\ | No newline at end of file |