import { Module, Provider, Environment } from '@zetapush/core'; import { CustomCloudService, NormalizedWorkerDeclaration, WorkerDeclaration, Service, WorkerDeclarationNormalizer } from '../common-types'; /** * Data structure to contains scan ouput of exposed Cloud Service */ declare class ScanOutput { custom: Array; platform: Array; bootLayer: Array; } /** * Return a cleaned & normalized WorkerDecleration */ export declare const clean: (exposed: any) => NormalizedWorkerDeclaration; /** * Normalize worker declaration * A worker declaration is the object return by worker project entry point */ export declare const normalize: (declaration: any) => Promise; /** * Recursivly scan CloudService DI Graph */ export declare const scan: (CustomCloudService: any, output?: ScanOutput, layer?: number) => ScanOutput; export declare const scanProvider: (provider: Provider, output?: ScanOutput) => void; export declare const scanProviders: (providers: Provider[], output?: ScanOutput) => ScanOutput; export declare const resolveProviders: (client: any, providers: Provider[]) => { providers: Provider[]; custom: any[]; platform: any[]; bootLayer: any[]; }; export declare const filterProviders: (providers: Provider[]) => Provider[]; /** * Resolve injected services */ export declare const analyzeService: (exposed: NormalizedWorkerDeclaration) => ScanOutput; /** * Resolve providers with dynamicly injected values */ export declare const resolve: (client: any, output: ScanOutput) => Provider[]; export interface DependencyInjectionAnalysis { /** * Original worker declaration */ declaration: WorkerDeclaration; /** * The list of resolved providers after analysis */ providers: Provider[]; /** * The list of platform services */ platformServices: Service[]; /** * The exposed class or namespace/class pairs */ exposed: NormalizedWorkerDeclaration; /** * Automatic scan result */ analyzed: ScanOutput; /** * Merge boot layers */ bootLayers: Service[]; } export declare const analyze: (client: any, declaration: any, env: Environment, customNormalizer?: WorkerDeclarationNormalizer) => Promise; /** * Resolve and inject dependencies */ export declare const instantiate: (analysis: DependencyInjectionAnalysis) => Promise; export declare const getPlatformServices: (providers: Provider[]) => any[]; export declare const makeEnvironmentInjectable: (env: Environment) => Provider[]; export {};