///
import { Container, ContainerSettings, Context, ILogger, ITypeRegistry, Identity, LogLevel, Logger, StoppableEvent, StoppableEventException, Symbols, Transporter } from '@e2/lib';
import { Exception } from 'agentframework';
export declare class Hash52 {
static toNumber(input: string): number;
static toBuffer(input: string): Buffer;
static toArray(input: string): Uint8Array;
}
export declare class Hash32 {
static toNumber(input: string): number;
static toBuffer(input: string): Buffer;
static toArray(input: string): Uint8Array;
}
export declare class Hash24 {
static toNumber(input: string): number;
static toBuffer(input: string): Buffer;
static toArray(input: string): Uint8Array;
}
export declare class Hash16 {
static toNumber(input: string): number;
static toBuffer(input: string): Buffer;
static toArray(input: string): Uint8Array;
}
export declare class BaseX {
map: object;
alphabet: string;
base: number;
leader: string;
constructor(alphabet: string);
static readonly singleton: BaseX;
fromBuffer(data: Buffer): string;
toBuffer(text: string): Buffer;
fromHex(hex: string): string;
toHex(text: string): string;
fromNumber(n: number): string;
toNumber(text: string): number;
private decodeUnsafe;
}
export declare class Base58 extends BaseX {
constructor();
static fromBuffer(data: Buffer): string;
static toBuffer(text: string): Buffer;
static fromHex(hex: string): string;
static toHex(text: string): string;
static fromNumber(n: number): string;
static toNumber(text: string): number;
}
export declare class Base62 extends BaseX {
constructor();
static fromBuffer(data: Buffer): string;
static toBuffer(text: string): Buffer;
static fromHex(hex: string): string;
static toHex(text: string): string;
static fromNumber(n: number): string;
static toNumber(text: string): number;
}
export declare class ObjectId {
_bsontype: string;
id: Buffer;
private static index;
constructor(id?: ObjectId | string | Buffer | number | Date);
generationTime: number;
getTimestamp(): Date;
equals(otherId: string | ObjectId): boolean;
toHexString(): string;
toString(format?: string): string;
inspect(): string;
toJSON(): string;
static createFromTime(time: number): ObjectId;
static createFromHexString(hex: string): ObjectId;
static isValid(id: any): boolean;
private static generate;
private static get_inc;
}
export declare function CreateHashedObjectId(inputs: Array | string | Buffer | number | any, algorithm?: string): ObjectId;
export declare class FileStreamException extends Exception {
}
export declare class FileWriteException extends Exception {
}
export declare class File {
private _file;
private _permission;
private constructor();
static Read: number;
static ReadWrite: number;
static Write: number;
static resolve(root: string, filePath: string, permission: number): File;
toString(): string;
readonly path: string;
readonly permission: number;
readAll(): string;
}
export declare class Directory {
private _directory;
private _permission;
private constructor();
static cwd(): Directory;
static withReadPermission(directory: string): Directory;
static withReadWritePermission(directory: string): Directory;
static mkdir(dir: string, mode?: number): boolean;
private static resolve;
toString(): string;
readonly path: string;
directory(relativePath: string): Directory;
file(relativeFilePath: string): File;
}
export declare class ApplicationSettings extends ContainerSettings {
static [Symbols.Initializer](ctx: Container, opts?: any): any;
AUTO_CREATE_DIRECTORY: boolean;
PACKAGE_FILE: string;
EXIT_WAIT_TIMEOUT: number;
HOME_DIR: string;
DATA_DIR: string;
CONF_DIR: string;
LOG_DIR: string;
LOG_LEVEL: string | 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
}
export declare class ApplicationLogger extends Logger {
static [Symbols.Initializer](app: Context): ILogger;
}
export declare class StandardOutputTransporter extends Transporter {
private formatter;
constructor(level: LogLevel, style: string);
format(data: string): string;
write(data: string): void;
writeSync(data: string): void;
}
export declare class FileLogTransporter extends Transporter {
private fd;
private stream;
private readonly filename;
constructor(level: LogLevel, filename: string);
openWritableFileStream(): void;
write(data: string): void;
writeSync(data: string): void;
}
export interface IApplicationOptions {
root: string;
confDir: string;
settings?: any;
registry?: ITypeRegistry;
params?: Array;
}
export declare class Application extends Container {
protected readonly options: IApplicationOptions;
protected onCreatingState(): any;
protected onCreatingIdentity(): Identity;
protected onCreatingLogger(): ILogger;
protected onCreatingSettings(): S;
protected onCreatingRootDirectory(): Directory;
constructor(opts?: IApplicationOptions);
protected readonly root: Directory;
directory(relativePath?: string): Directory;
file(relativeFilePath: string): File;
exit(reason?: Error | object | string): void;
get(key: string, defaultValue?: any): any;
set(key: string, value: any): any;
has(key: string): boolean;
}
export declare class UncaughtExceptionEvent extends StoppableEvent {
exception: Exception | Error;
constructor(exception: Exception | Error);
}
export declare class UnhandledException extends StoppableEventException {
event: UncaughtExceptionEvent;
constructor(event: UncaughtExceptionEvent, error: Exception | Error);
}
export declare class SignalEvent extends StoppableEvent {
signal: string;
code: number;
constructor(signal: string, code: number);
}
export declare class UnhandledSignalEventException extends StoppableEventException {
event: SignalEvent;
constructor(event: SignalEvent, signal: string, code: number);
}
export declare enum ApplicationEvents {
signals = "signals",
uncaughtException = "uncaughtException",
unhandledRejection = "unhandledRejection",
exiting = "exiting",
exit = "exit"
}
export declare class ExitEvent extends StoppableEvent {
}
export declare function parseYAML(file: File): any;
export declare function parseJSON(file: File): any;
export declare function dumpYAML(data: any, filename: string): void;
export declare function dumpJSON(data: any, filename: string): void;
export declare function serialize(obj: any): string;
export { Constructor, TypedConstructor, TypedConstructorWithParameters, TypedConstructorWithoutParameter } from 'agentframework';
export { IAttribute, IAgentAttribute, IBeforeDecorateAttribute } from 'agentframework';
export { IInterceptor } from 'agentframework';
export { IInitializer } from 'agentframework';
export { IInvocation } from 'agentframework';
export { IDesign } from 'agentframework';
export { PropertyFilter, Reflection, Property, Method, Parameter } from 'agentframework';
export { PropertyFilters } from 'agentframework';
export { Reflector } from 'agentframework';
export { AgentAttribute } from 'agentframework';
export { Decoratable } from 'agentframework';
export { Target, UniversalDecorator, decorateAgent, decorateClass, decorateClassMember, decorateClassMethod, decorateClassField, decorateParameter, decorate } from 'agentframework';
export { IsObject, IsFunction, IsNullOrUndefined, IsObjectOrFunction, IsSymbol, IsString, IsNumber, IsEqual, ToPropertyKey, GetPrototypeArray, GetPrototypeArrayReverse } from 'agentframework';
export { Exception } from 'agentframework';
export { padStart, padEnd } from '@e2/lib';
export { ConfigurationAttribute } from '@e2/lib';
export { ControllerAttribute } from '@e2/lib';
export { MethodAttribute } from '@e2/lib';
export { MiddlewareAttribute } from '@e2/lib';
export { ParamsAttribute } from '@e2/lib';
export { ServiceAttribute } from '@e2/lib';
export { SingletonAttribute } from '@e2/lib';
export { TransitAttribute } from '@e2/lib';
export { ModelAttribute } from '@e2/lib';
export { KeyAttribute } from '@e2/lib';
export { PropertyAttribute } from '@e2/lib';
export { controller, middleware, param, method, service, singleton, transit, conf } from '@e2/lib';
export { model, key, property } from '@e2/lib';
export { IsAssignable } from '@e2/lib';
export { Resolvable } from '@e2/lib';
export { IRouter, IRouterEventHandlers, RouteFunction, RouteHandler, Router } from '@e2/lib';
export { RouterEventHandlers } from '@e2/lib';
export { CreateObjectSignature } from '@e2/lib';
export { CreateFlattenObject } from '@e2/lib';
export { retry, sleep, RetryOptions, RetryContext, RetryFunction } from '@e2/lib';
export { BeforeRetry, CalculateBackoff, HandleError, HandleTimeout } from '@e2/lib';
export { ITypeRegistry } from '@e2/lib';
export { TypeFinalizer, TypeInitializer } from '@e2/lib';
export { TypeRegistry } from '@e2/lib';
export { ITypeResolver } from '@e2/lib';
export { TypeResolver } from '@e2/lib';
export { Compositor } from '@e2/lib';
export { Sequence } from '@e2/lib';
export { StepFunction, NextFunction, LastFunction } from '@e2/lib';
export { StoppableEvent } from '@e2/lib';
export { PriorityEventEmitter } from '@e2/lib';
export { ILogger } from '@e2/lib';
export { LogLevel } from '@e2/lib';
export { Logger } from '@e2/lib';
export { Transporter } from '@e2/lib';
export { AbstractLogger } from '@e2/lib';
export { ChildLogger } from '@e2/lib';
export { LoggerOptions } from '@e2/lib';
export { Serializers } from '@e2/lib';
export { ConsoleTransporter } from '@e2/lib';
export { ConsoleFormatter } from '@e2/lib';
export { ConsoleLogger } from '@e2/lib';
export { DeserializationException } from '@e2/lib';
export { SerializationException } from '@e2/lib';
export { LoggerException } from '@e2/lib';
export { TransporterException } from '@e2/lib';
export { MissingConfigurationValueException } from '@e2/lib';
export { StoppableEventException } from '@e2/lib';
export { NotImplementedException } from '@e2/lib';
export { NotSupportedException } from '@e2/lib';
export { Route } from '@e2/lib';
export { MatchedRoute } from '@e2/lib';
export { Param } from '@e2/lib';
export { ILoggerSettings } from '@e2/lib';
export { Context } from '@e2/lib';
export { Identity } from '@e2/lib';
export { Container } from '@e2/lib';
export { ContainerSettings } from '@e2/lib';
export { IContainerOptions } from '@e2/lib';
export { Symbols } from '@e2/lib';
export { SafeJSON } from '@e2/lib';
export { defineProperty } from '@e2/lib';
export { IDisposable } from '@e2/lib';
export { StringFormatter } from '@e2/lib';