mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-18 07:35:19 +00:00
Hierarchical dependency injection framework
Adapted from this experiment: https://stackblitz.com/edit/vitejs-vite-6tenu8?file=src%2Fapp.ts
This commit is contained in:
@@ -1,7 +1,23 @@
|
||||
export interface Ctor<T, Args extends any[] = any[]> {
|
||||
new (...args: Args): T;
|
||||
prototype: T;
|
||||
}
|
||||
|
||||
export type AbstractCtor<T, Args extends any[] = any[]>
|
||||
= (abstract new (...args: Args) => T)
|
||||
& { prototype: T }
|
||||
;
|
||||
|
||||
export interface Fn<Args extends any[] = [], R = void> {
|
||||
(...args: Args): R;
|
||||
}
|
||||
|
||||
export interface Method<T, Args extends any[] = any[], R = any> {
|
||||
(this: T, ...args: Args): R;
|
||||
}
|
||||
|
||||
export type Opt<T> = T | null | undefined;
|
||||
|
||||
export type WithOpt<T, K extends keyof T>
|
||||
= Omit<T, K>
|
||||
& Partial<Pick<T, K>>
|
||||
|
||||
Reference in New Issue
Block a user