Skip to content

Commit

Permalink
Prepublish 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TiMESPLiNTER committed Jan 31, 2024
1 parent fae959f commit eaf088c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 24 deletions.
8 changes: 5 additions & 3 deletions lib/cjs/pimple.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import Container, { ServiceKey } from "./container";
import ServiceProvider from "./serviceProvider";
/** Declaration types */
type ProviderDeclaration<T> = Function | ServiceProvider<T>;
type ServiceProviderFunction<T> = (container: Pimple<T>) => void;
type ProviderDeclaration<T> = ServiceProviderFunction<T> | ServiceProvider<T>;
type LazyServiceDefinition<T, S> = (container: Pimple<T>) => S;
type ProtectedServiceDefinition<T, S> = () => LazyServiceDefinition<T, S>;
type ServiceDefinition<T, S> = LazyServiceDefinition<T, S> | ProtectedServiceDefinition<T, S> | S;
type PlainServiceDefinition<S> = S extends Function ? () => S : S;
type ServiceDefinition<T, S> = PlainServiceDefinition<S> | LazyServiceDefinition<T, S> | ProtectedServiceDefinition<T, S> | (S extends Function ? () => S : S);
type ServiceMap<T> = {
[key in ServiceKey<T>]: ServiceDefinition<T, T[ServiceKey<T>]>;
};
Expand Down Expand Up @@ -52,7 +54,7 @@ export default class Pimple<T> implements Container<T> {
/**
* Register a protected function
*/
protect<K extends ServiceKey<T>>(key: K, service: T[K]): () => T[K];
protect<T extends Function>(func: T): () => T;
/**
* Extend a service
*/
Expand Down
11 changes: 3 additions & 8 deletions lib/cjs/pimple.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/cjs/pimple.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions lib/esm/pimple.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import Container, { ServiceKey } from "./container";
import ServiceProvider from "./serviceProvider";
/** Declaration types */
type ProviderDeclaration<T> = Function | ServiceProvider<T>;
type ServiceProviderFunction<T> = (container: Pimple<T>) => void;
type ProviderDeclaration<T> = ServiceProviderFunction<T> | ServiceProvider<T>;
type LazyServiceDefinition<T, S> = (container: Pimple<T>) => S;
type ProtectedServiceDefinition<T, S> = () => LazyServiceDefinition<T, S>;
type ServiceDefinition<T, S> = LazyServiceDefinition<T, S> | ProtectedServiceDefinition<T, S> | S;
type PlainServiceDefinition<S> = S extends Function ? () => S : S;
type ServiceDefinition<T, S> = PlainServiceDefinition<S> | LazyServiceDefinition<T, S> | ProtectedServiceDefinition<T, S> | (S extends Function ? () => S : S);
type ServiceMap<T> = {
[key in ServiceKey<T>]: ServiceDefinition<T, T[ServiceKey<T>]>;
};
Expand Down Expand Up @@ -52,7 +54,7 @@ export default class Pimple<T> implements Container<T> {
/**
* Register a protected function
*/
protect<K extends ServiceKey<T>>(key: K, service: T[K]): () => T[K];
protect<T extends Function>(func: T): () => T;
/**
* Extend a service
*/
Expand Down
11 changes: 3 additions & 8 deletions lib/esm/pimple.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/esm/pimple.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eaf088c

Please sign in to comment.