UNPKG

@xcons/widget

Version:

XCon Studio widget utilities with advanced template rendering, reactive binding system and registry pattern support

46 lines (45 loc) 1.81 kB
import { ServiceConfig, ServiceConstructor, ServiceToken, ServiceScope, ServiceMetadata } from './service-types'; /** * Injectable decorator for marking classes as services - NO AUTO-REGISTRATION * Renamed from @injectable to @xinjectable */ export declare function xinjectable<T>(config?: ServiceConfig): <K extends ServiceConstructor<T>>(target: K) => K; /** * Singleton scope decorator * Renamed from @singleton to @xsingleton */ export declare function xsingleton<T>(token?: ServiceToken): <K extends ServiceConstructor<T>>(target: K) => K; /** * Transient scope decorator * Renamed from @transient to @xtransient */ export declare function xtransient<T>(token?: ServiceToken): <K extends ServiceConstructor<T>>(target: K) => K; /** * Scoped scope decorator * Renamed from @scoped to @xscoped */ export declare function xscoped<T>(token?: ServiceToken): <K extends ServiceConstructor<T>>(target: K) => K; /** * Manual service registration - for bootstrap or manual use */ export declare function registerService<T>(target: ServiceConstructor<T>, config?: ServiceConfig): void; /** * Register service with specific token - for bootstrap use */ export declare function registerServiceWithToken<T>(token: ServiceToken<T>, target: ServiceConstructor<T>, scope?: ServiceScope): void; /** * Register value with token - for bootstrap use */ export declare function registerValue<T>(token: ServiceToken<T>, value: T): void; /** * Check if class is marked as injectable */ export declare function isInjectable(target: any): boolean; /** * Get service metadata from class */ export declare function getServiceMetadata(target: ServiceConstructor): ServiceMetadata | undefined; /** * Create service token */ export declare function createServiceToken<T = any>(description: string): ServiceToken<T>;