Comparing version 2.10.3 to 3.0.0
@@ -18,5 +18,5 @@ import { Awaitable, Promisify } from 'cosmokit'; | ||
schema?: (config?: S) => T; | ||
inject?: readonly string[]; | ||
inject?: readonly string[] | Partial<Inject>; | ||
/** @deprecated use `inject` instead */ | ||
using?: readonly string[]; | ||
using?: readonly string[] | Partial<Inject>; | ||
} | ||
@@ -51,3 +51,3 @@ type Config<T extends Plugin<any>> = T extends Constructor<infer U> ? U : T extends Function<infer U> ? U : T extends Object<infer U> ? U : never; | ||
forEach(callback: (value: MainScope<C>, key: Plugin<C>, map: Map<Plugin<C>, MainScope<C>>) => void): void; | ||
using(inject: readonly string[], callback: Plugin.Function<void, C>): ForkScope<C> | undefined; | ||
using(inject: readonly string[] | Partial<Inject>, callback: Plugin.Function<void, C>): ForkScope<C> | undefined; | ||
plugin(plugin: Plugin<C>, config?: any): ForkScope<C> | undefined; | ||
@@ -64,2 +64,6 @@ dispose(plugin: Plugin<C>): boolean; | ||
} | ||
export interface Inject { | ||
readonly required: readonly string[]; | ||
readonly optional: readonly string[]; | ||
} | ||
export type Disposable = () => void; | ||
@@ -120,3 +124,5 @@ export interface AcceptOptions { | ||
schema: any; | ||
using: readonly string[]; | ||
name?: string; | ||
using: string[]; | ||
inject: Set<string>; | ||
forkables: Function[]; | ||
@@ -128,3 +134,2 @@ children: ForkScope<C>[]; | ||
get isForkable(): boolean; | ||
get name(): string; | ||
fork(parent: Context, config: any): ForkScope<C>; | ||
@@ -217,2 +222,3 @@ dispose(): boolean; | ||
key: symbol; | ||
builtin?: boolean; | ||
prototype?: {}; | ||
@@ -222,3 +228,3 @@ } | ||
type: 'mixin'; | ||
service: keyof any; | ||
service: string; | ||
} | ||
@@ -249,11 +255,13 @@ } | ||
/** @deprecated */ | ||
static mixin(name: keyof any, options: string[] | Context.MixinOptions): void; | ||
static mixin(name: string, options: string[] | Context.MixinOptions): void; | ||
/** @deprecated */ | ||
static service(name: keyof any, options?: string[] | Context.MixinOptions): void; | ||
static service(name: string, options?: string[] | Context.MixinOptions): void; | ||
static handler: ProxyHandler<Context>; | ||
constructor(config?: Context.Config); | ||
get name(): string; | ||
get events(): Lifecycle; | ||
/** @deprecated */ | ||
get state(): EffectScope<this>; | ||
provide(name: string, value?: any): void; | ||
get<K extends string & keyof this>(name: K): undefined | this[K]; | ||
provide(name: string, value?: any, builtin?: boolean): void; | ||
mixin(name: string, mixins: string[]): void; | ||
@@ -260,0 +268,0 @@ extend(meta?: {}): this; |
{ | ||
"name": "cordis", | ||
"description": "AOP Framework for Modern JavaScript Applications", | ||
"version": "2.10.3", | ||
"version": "3.0.0", | ||
"sideEffects": false, | ||
@@ -6,0 +6,0 @@ "main": "lib/index.cjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
206072
1937