@aurelia/kernel
Advanced tools
Comparing version 2.1.0-dev.202405280947 to 2.1.0-dev.202407271309
@@ -6,2 +6,20 @@ # Change Log | ||
<a name="2.0.0-beta.20"></a> | ||
# 2.0.0-beta.20 (2024-07-07) | ||
**Note:** Version bump only for package @aurelia/kernel | ||
<a name="2.0.0-beta.19"></a> | ||
# 2.0.0-beta.19 (2024-06-12) | ||
### Features: | ||
* **di:** ability to deregister key (#1981) ([8eb5c36](https://github.com/aurelia/aurelia/commit/8eb5c36)) | ||
* **dialog:** ability to animate using animator instead of lifecycles (#1986) ([a2477e5](https://github.com/aurelia/aurelia/commit/a2477e5)) | ||
### Refactorings: | ||
* **projection:** use $all instead of * to include all node types (#1987) ([337cb34](https://github.com/aurelia/aurelia/commit/337cb34)) | ||
<a name="2.0.0-beta.18"></a> | ||
@@ -8,0 +26,0 @@ # 2.0.0-beta.18 (2024-05-23) |
@@ -64,2 +64,3 @@ import { Constructable, IDisposable } from './interfaces'; | ||
disposeResolvers(): void; | ||
deregister(key: Key): void; | ||
/** | ||
@@ -110,3 +111,3 @@ * Register resources from another container, an API for manually registering resources | ||
export declare const DI: { | ||
createContainer: (config?: Partial<IContainerConfiguration> | undefined) => IContainer; | ||
createContainer: (config?: Partial<IContainerConfiguration>) => IContainer; | ||
getDesignParamtypes: (Type: Constructable | Injectable) => readonly Key[] | undefined; | ||
@@ -155,3 +156,3 @@ getDependencies: (Type: Constructable | Injectable) => Key[]; | ||
*/ | ||
createInterface: <K extends Key>(configureOrName?: string | ((builder: ResolverBuilder<K>) => IResolver<K>) | undefined, configuror?: ((builder: ResolverBuilder<K>) => IResolver<K>) | undefined) => InterfaceSymbol<K>; | ||
createInterface: <K extends Key>(configureOrName?: string | ((builder: ResolverBuilder<K>) => IResolver<K>), configuror?: (builder: ResolverBuilder<K>) => IResolver<K>) => InterfaceSymbol<K>; | ||
inject: (...dependencies: Key[]) => (decorated: unknown, context: DecoratorContext) => void; | ||
@@ -194,3 +195,3 @@ /** | ||
*/ | ||
singleton<T_1 extends Constructable>(target: T_1 & Partial<RegisterSelf<T_1>>, options?: SingletonOptions): T_1 & RegisterSelf<T_1>; | ||
singleton<T extends Constructable>(target: T & Partial<RegisterSelf<T>>, options?: SingletonOptions): T & RegisterSelf<T>; | ||
}; | ||
@@ -197,0 +198,0 @@ export declare const IContainer: InterfaceSymbol<IContainer>; |
@@ -35,3 +35,3 @@ import { type Key, IRegistration, type ResolveCallback, type Resolved, type IRegistry, type IContainer, InterfaceSymbol } from './di'; | ||
*/ | ||
singleton: <T_1 extends Constructable>(key: Key, value: T_1) => IRegistration<InstanceType<T_1>>; | ||
singleton: <T extends Constructable>(key: Key, value: T) => IRegistration<InstanceType<T>>; | ||
/** | ||
@@ -47,3 +47,3 @@ * Creates an instance from a class. | ||
*/ | ||
transient: <T_2 extends Constructable>(key: Key, value: T_2) => IRegistration<InstanceType<T_2>>; | ||
transient: <T extends Constructable>(key: Key, value: T) => IRegistration<InstanceType<T>>; | ||
/** | ||
@@ -60,3 +60,3 @@ * Creates an instance from the method passed. | ||
*/ | ||
callback: <T_3>(key: Key, callback: ResolveCallback<T_3>) => IRegistration<Resolved<T_3>>; | ||
callback: <T>(key: Key, callback: ResolveCallback<T>) => IRegistration<Resolved<T>>; | ||
/** | ||
@@ -76,3 +76,3 @@ * Creates an instance from the method passed. | ||
*/ | ||
cachedCallback: <T_4>(key: Key, callback: ResolveCallback<T_4>) => IRegistration<Resolved<T_4>>; | ||
cachedCallback: <T>(key: Key, callback: ResolveCallback<T>) => IRegistration<Resolved<T>>; | ||
/** | ||
@@ -91,3 +91,3 @@ * creates an alternate {@linkcode Key} to retrieve an instance by. | ||
*/ | ||
aliasTo: <T_5>(originalKey: T_5, aliasKey: Key) => IRegistration<Resolved<T_5>>; | ||
aliasTo: <T>(originalKey: T, aliasKey: Key) => IRegistration<Resolved<T>>; | ||
/** | ||
@@ -94,0 +94,0 @@ * @internal |
@@ -12,3 +12,3 @@ import { Constructable, Overwrite } from './interfaces'; | ||
*/ | ||
export declare const isArrayIndex: (value: unknown) => value is string | number; | ||
export declare const isArrayIndex: (value: unknown) => value is number | string; | ||
/** | ||
@@ -15,0 +15,0 @@ * Efficiently convert a string to camelCase. |
@@ -156,3 +156,3 @@ import { IContainer, IRegistry } from './di'; | ||
define<TSink extends Constructable<ISink>>(target: TSink, definition: SinkDefinition): void; | ||
getHandles<TSink_1 extends ISink>(target: TSink_1): Exclude<LogLevel, typeof none>[] | undefined; | ||
getHandles<TSink extends ISink>(target: TSink): Exclude<LogLevel, typeof none>[] | undefined; | ||
}>; | ||
@@ -168,9 +168,9 @@ export declare const sink: (definition: SinkDefinition) => <TSink extends Constructable<ISink>>(_target: TSink, context: ClassDecoratorContext<TSink>) => void; | ||
readonly red: <T extends string>(str: T) => T; | ||
readonly green: <T_1 extends string>(str: T_1) => T_1; | ||
readonly yellow: <T_2 extends string>(str: T_2) => T_2; | ||
readonly blue: <T_3 extends string>(str: T_3) => T_3; | ||
readonly magenta: <T_4 extends string>(str: T_4) => T_4; | ||
readonly cyan: <T_5 extends string>(str: T_5) => T_5; | ||
readonly white: <T_6 extends string>(str: T_6) => T_6; | ||
readonly grey: <T_7 extends string>(str: T_7) => T_7; | ||
readonly green: <T extends string>(str: T) => T; | ||
readonly yellow: <T extends string>(str: T) => T; | ||
readonly blue: <T extends string>(str: T) => T; | ||
readonly magenta: <T extends string>(str: T) => T; | ||
readonly cyan: <T extends string>(str: T) => T; | ||
readonly white: <T extends string>(str: T) => T; | ||
readonly grey: <T extends string>(str: T) => T; | ||
}; | ||
@@ -177,0 +177,0 @@ export interface ILogEvent { |
{ | ||
"name": "@aurelia/kernel", | ||
"version": "2.1.0-dev.202405280947", | ||
"version": "2.1.0-dev.202407271309", | ||
"main": "dist/cjs/index.cjs", | ||
@@ -57,4 +57,4 @@ "module": "dist/esm/index.mjs", | ||
"dependencies": { | ||
"@aurelia/metadata": "2.1.0-dev.202405280947", | ||
"@aurelia/platform": "2.1.0-dev.202405280947" | ||
"@aurelia/metadata": "2.1.0-dev.202407271309", | ||
"@aurelia/platform": "2.1.0-dev.202407271309" | ||
}, | ||
@@ -61,0 +61,0 @@ "devDependencies": { |
@@ -18,2 +18,3 @@ /* eslint-disable @typescript-eslint/no-this-alias */ | ||
type Transformer, | ||
IDisposableResolver, | ||
} from './di'; | ||
@@ -51,4 +52,7 @@ import { aliasToRegistration, singletonRegistration } from './di.registration'; | ||
public readonly inheritParentResources: boolean, | ||
public readonly defaultResolver: (key: Key, handler: IContainer) => IResolver, | ||
) { } | ||
public readonly defaultResolver: ( | ||
key: Key, | ||
handler: IContainer | ||
) => IResolver | ||
) {} | ||
@@ -134,3 +138,2 @@ public static from(config?: IContainerConfiguration): ContainerConfiguration { | ||
this._factories = new Map<Constructable, Factory>(); | ||
} else { | ||
@@ -261,2 +264,21 @@ this.root = parent.root; | ||
public deregister(key: Key): void { | ||
validateKey(key); | ||
const resolver = this._resolvers.get(key); | ||
if (resolver != null) { | ||
this._resolvers.delete(key); | ||
if (isResourceKey(key)) { | ||
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete | ||
delete this.res[key]; | ||
} | ||
if (this._disposableResolvers.has(key)) { | ||
(resolver as IDisposableResolver).dispose(); | ||
this._disposableResolvers.delete(key); | ||
} | ||
} | ||
} | ||
// public deregisterResolverFor<K extends Key>(key: K, searchAncestors: boolean): void { | ||
@@ -306,3 +328,5 @@ // validateKey(key); | ||
// seems to confuse the type checker. | ||
factory.registerTransformer(transformer as unknown as Transformer<Constructable>); | ||
factory.registerTransformer( | ||
transformer as unknown as Transformer<Constructable> | ||
); | ||
return true; | ||
@@ -309,0 +333,0 @@ } |
@@ -90,2 +90,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
disposeResolvers(): void; | ||
deregister(key: Key): void; | ||
/** | ||
@@ -92,0 +93,0 @@ * Register resources from another container, an API for manually registering resources |
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
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
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
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
Sorry, the diff of this file is not supported yet
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
1106075
18975
+ Added@aurelia/metadata@2.1.0-dev.202407271309(transitive)
+ Added@aurelia/platform@2.1.0-dev.202407271309(transitive)
- Removed@aurelia/metadata@2.1.0-dev.202405280947(transitive)
- Removed@aurelia/platform@2.1.0-dev.202405280947(transitive)