Comparing version 1.7.1 to 1.7.2
@@ -1,5 +0,5 @@ | ||
declare class Bottle { | ||
static pop: (name?: string) => Bottle; | ||
static clear: (name?: string) => void; | ||
static list: (container?: Bottle.IContainer) => Array<string>; | ||
declare class Bottle<EntryName extends string = string> { | ||
static pop(name?: string): Bottle; | ||
static clear(name?: string): void; | ||
static list<T extends string = string>(container?: Bottle.IContainer<T>): Array<T>; | ||
static config: Object; | ||
@@ -24,3 +24,4 @@ | ||
*/ | ||
decorator(name: string|((service: any) => any), func?: (service: any) => any): this; | ||
decorator(func: Bottle.Decorator): this; | ||
decorator(name: EntryName, func: Bottle.Decorator): this; | ||
@@ -35,3 +36,3 @@ /** | ||
*/ | ||
digest(services: Array<string>): Array<any>; | ||
digest(services: EntryName[]): Array<any>; | ||
@@ -41,3 +42,3 @@ /** | ||
*/ | ||
factory(name: string, Factory: (container: Bottle.IContainer) => any): this; | ||
factory(name: EntryName, Factory: (container: Bottle.IContainer<EntryName>) => any): this; | ||
@@ -47,3 +48,3 @@ /** | ||
*/ | ||
instanceFactory(name: string, Factory: (container: Bottle.IContainer) => any): this; | ||
instanceFactory(name: EntryName, Factory: (container: Bottle.IContainer<EntryName>) => any): this; | ||
@@ -53,3 +54,3 @@ /** | ||
*/ | ||
list(container?: Bottle.IContainer): Array<string>; | ||
list<T extends string = EntryName>(container?: Bottle.IContainer<T>): Array<T>; | ||
@@ -59,4 +60,4 @@ /** | ||
*/ | ||
middleware(name: string|((service: any, next: (error?: Error) => void) => void), | ||
func?: (service: any, next: (error?: Error) => void) => void): this; | ||
middleware(func: Bottle.Middleware): this; | ||
middleware(name: EntryName, func: Bottle.Middleware): this; | ||
@@ -66,3 +67,3 @@ /** | ||
*/ | ||
provider(name: string, Provider: ((...any: any[]) => void)): this; | ||
provider(name: EntryName, Provider: ((...any: any[]) => void)): this; | ||
@@ -87,4 +88,4 @@ /** | ||
*/ | ||
service(name: string, Constructor: ((...any: any[]) => any), ...dependency: string[]): this; | ||
service<T>(name: string, Constructor: new (...any: any[]) => T, ...dependency: string[]): this; | ||
service(name: EntryName, Constructor: ((...any: any[]) => any), ...dependency: EntryName[]): this; | ||
service<T>(name: EntryName, Constructor: new (...any: any[]) => T, ...dependency: EntryName[]): this; | ||
@@ -94,4 +95,4 @@ /** | ||
*/ | ||
serviceFactory(name: string, factoryService: ((...any: any[]) => any), ...dependency: string[]): this; | ||
serviceFactory<T>(name: string, factoryService: ((...any: any[]) => T), ...dependency: string[]): this; | ||
serviceFactory(name: EntryName, factoryService: ((...any: any[]) => any), ...dependency: EntryName[]): this; | ||
serviceFactory<T>(name: EntryName, factoryService: ((...any: any[]) => T), ...dependency: EntryName[]): this; | ||
@@ -101,3 +102,3 @@ /** | ||
*/ | ||
value(name: string, val: any): this; | ||
value(name: EntryName, val: any): this; | ||
} | ||
@@ -108,2 +109,5 @@ | ||
declare module Bottle { | ||
type Middleware = ((service: any, next: (error?: Error) => void) => void); | ||
type Decorator = (service: any) => any; | ||
interface IRegisterableObject { | ||
@@ -117,8 +121,8 @@ $name: string; | ||
interface IContainer { | ||
interface IContainer<EntryName extends string = string> { | ||
[key: string]: any; | ||
$decorator(name: string|((service: any) => any), func?: (service: any) => any): this; | ||
$decorator(name: string | Decorator, func?: Decorator): this; | ||
$register(Obj: Bottle.IRegisterableObject): this; | ||
$list(container?: Bottle.IContainer): Array<string>; | ||
$list(container?: Bottle.IContainer): EntryName[]; | ||
} | ||
} |
;(function(undefined) { | ||
'use strict'; | ||
/** | ||
* BottleJS v1.7.1 - 2018-05-03 | ||
* BottleJS v1.7.2 - 2019-02-07 | ||
* A powerful dependency injection micro container | ||
* | ||
* Copyright (c) 2018 Stephen Young | ||
* Copyright (c) 2019 Stephen Young | ||
* Licensed MIT | ||
@@ -9,0 +9,0 @@ */ |
{ | ||
"name": "bottlejs", | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"description": "A powerful dependency injection micro container", | ||
@@ -29,6 +29,6 @@ "main": "dist/bottle.js", | ||
"devDependencies": { | ||
"grunt": "^1.0.2", | ||
"grunt": "^1.0.3", | ||
"grunt-contrib-clean": "^1.1.0", | ||
"grunt-contrib-concat": "^1.0.1", | ||
"grunt-contrib-jasmine": "^1.2.0", | ||
"grunt-contrib-jasmine": "^2.0.3", | ||
"grunt-contrib-jshint": "^1.1.0", | ||
@@ -35,0 +35,0 @@ "grunt-contrib-uglify": "^3.3.0", |
@@ -11,3 +11,2 @@ | ||
[![NPM](https://nodei.co/npm/bottlejs.png?downloads=true&downloadRank=true)](https://nodei.co/npm/bottlejs/) | ||
[![NPM](https://nodei.co/npm-dl/bottlejs.png?months=9&height=3)](https://nodei.co/npm/bottlejs/) | ||
@@ -45,5 +44,4 @@ > A powerful dependency injection micro container | ||
```html | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bottlejs/VERSION/bottle.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bottlejs/1.7.1/bottle.min.js"></script> | ||
``` | ||
Replace `VERSION` in the above URL with a valid BottleJS version, e.g. `https://cdnjs.cloudflare.com/ajax/libs/bottlejs/1.6.1/bottle.min.js` | ||
@@ -50,0 +48,0 @@ ## Simple Example |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
718
46787
455