@types/di-lite
TypeScript icon, indicating that this package has built-in type declarations

0.3.32 • Public • Published

Installation

npm install --save @types/di-lite

Summary

This package contains type definitions for di-lite (https://github.com/NickQiZhu/di.js).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/di-lite.

index.d.ts

declare namespace DiLite {
    interface DiLiteStatic {
        version: string;
        createContext(): CreateContext;
        dependencyExpression(depExp: string): string;
        entry(name: string, ctx: CreateContext): any;
        strategy: StrategyEnum;
        factory: FactoryEnum;
        utils: Utils;
    }

    interface Dictionary<T> {
        [index: string]: T;
    }

    interface CreateContext {
        map: Dictionary<any>;
        entry<T>(name: string): T;
        register<T>(name: string, service: T): Entry;
        has(name: string): boolean;
        get(name: string): any;
        create<T>(name: string, args: any): T;
        initialize(): void;
        clear(): void;
        inject<T>(name: string, o: T, dependencies: string): T;
        ready<T>(o: Function): T;
        ready<T>(o: any): T;
    }

    interface Entry {
        create(newArgs: any): Entry;
        object<T>(o: T): Entry;
        object<T>(): T;
        strategy<T>(s: Function): Entry;
        strategy<T>(): T;
        type<T>(t: T): Entry;
        type<T>(): T;
        dependencies<T>(d: T): Entry;
        dependencies<T>(): T;
        args<T>(a: T): Entry;
        args<T>(): T;
        factory(f: Function): Entry;
        factory<T>(): T;
    }

    interface StrategyEnum {
        proto<TObject, TType>(
            name: string,
            object: TObject,
            type: TType,
            args: any,
            ctx: CreateContext,
            dependencies: any,
        ): TObject;
        singleton<TObject, TType>(
            name: string,
            object: TObject,
            type: TType,
            args: any,
            ctx?: CreateContext,
            dependencies?: any,
        ): TObject;
    }

    interface FactoryEnum {
        constructor<T>(type: T, args: any): T;
        func<T>(type: T, args: any): T;
    }

    interface Utils {
        invokeStmt(args: any, op: string): string;
    }
}

declare module "di-lite" {
    export = di;
}
declare var di: DiLite.DiLiteStatic;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by Timothy Morris.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/di-lite

Weekly Downloads

13

Version

0.3.32

License

MIT

Unpacked Size

6.56 kB

Total Files

5

Last publish

Collaborators

  • types