Skip to content

Commit

Permalink
Server tests working
Browse files Browse the repository at this point in the history
  • Loading branch information
divmgl committed Oct 28, 2023
1 parent 516ba9b commit 349f04e
Show file tree
Hide file tree
Showing 10 changed files with 370 additions and 220 deletions.
Empty file.
13 changes: 7 additions & 6 deletions packages/nwire/dist/Container.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { CountingSet } from "./CountingSet";
export type Context = {
[key: string]: unknown;
};
Expand All @@ -16,20 +17,20 @@ type RegistrationOptions = {
export declare class Container<TContext extends Context = {}> {
private _parentContainer?;
private _registry;
private _map;
private _resolvers;
private _transient;
constructor(_parentContainer?: Container<TContext> | undefined);
static build<T extends Context = {}>(): Container<T>;
copy<TContext>(rootContext?: Context): TContext;
context<TWriteContext extends Context = TContext>(rootContext?: Context, resolving?: Set<unknown>): TWriteContext;
context<TWriteContext extends Context = TContext>(rootContext?: Context, resolved?: CountingSet<unknown>): TWriteContext;
group<TNewKey extends string, TNewContext extends Context>(key: TNewKey, decorator: (container: Container<TContext>) => Container<TNewContext>): Container<MergeContext<TContext, TNewKey, TNewContext>>;
static group<TNewKey extends string, TNewContext extends Context>(key: TNewKey, decorator: (container: Container<Context>) => Container<TNewContext>): Container<MergeContext<Context, TNewKey, TNewContext>>;
instance<TNewKey extends string, TValue>(key: TNewKey, ValueClass: Instance<TValue>, ...args: any[]): Container<MergeContext<TContext, TNewKey, TValue>>;
static instance<TNewKey extends string, TValue>(key: TNewKey, ValueClass: Instance<TValue>, ...args: any[]): Container<MergeContext<Context, TNewKey, TValue>>;
register<TNewKey extends string, TValue>(key: TNewKey, value: (context: TContext) => TValue, { transient }?: RegistrationOptions): Container<MergeContext<TContext, TNewKey, TValue>>;
instance<TNewKey extends string, TValue>(key: TNewKey, ClassConstructor: Instance<TValue>, ...args: any[]): Container<MergeContext<TContext, TNewKey, TValue>>;
static instance<TNewKey extends string, TValue>(key: TNewKey, ClassConstructor: Instance<TValue>, ...args: any[]): Container<MergeContext<Context, TNewKey, TValue>>;
register<TNewKey extends string, TValue>(key: TNewKey, resolver: (context: TContext, resolvedSet: CountingSet<unknown>) => TValue, { transient }?: RegistrationOptions): Container<MergeContext<TContext, TNewKey, TValue>>;
static register<TNewKey extends string, TValue>(key: TNewKey, value: (context: Context) => TValue, options?: RegistrationOptions): Container<MergeContext<Context, TNewKey, TValue>>;
unregister<TNewKey extends string>(key: TNewKey): Container<Omit<TContext, TNewKey>>;
static unregister<TNewKey extends string>(key: TNewKey): Container<Omit<Context, TNewKey>>;
resolve<T>(key: keyof TContext): T;
resolve<T>(key: keyof TContext, resolved?: CountingSet<unknown>): T;
}
export {};
12 changes: 12 additions & 0 deletions packages/nwire/dist/CountingSet.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export declare class CountingSet<T> {
private readonly _map;
private readonly _set;
add(value: T): this;
delete(value: T): boolean;
has(value: T): boolean;
count(value: T): number;
clear(): void;
get size(): number;
[Symbol.iterator](): Iterator<T>;
forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
}
154 changes: 81 additions & 73 deletions packages/nwire/dist/cjs/index.js

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

6 changes: 3 additions & 3 deletions packages/nwire/dist/cjs/index.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 349f04e

Please sign in to comment.