Annotations.ts
30 lines
| 903 B
| video/mp2t
|
TypeScriptLexer
|
|
r127 | import { TypeRegistration } from "./Configuration"; | ||
| import { ExtractDependency } from "./fluent/interfaces"; | ||||
|
|
r132 | import { RegistrationBuilder } from "./fluent/RegistrationBuilder"; | ||
|
|
r109 | |||
|
|
r127 | export class AnnotaionBuilder<T, S extends object> { | ||
| wire<P extends any[]>(...args: P) { | ||||
|
|
r111 | return <C extends new (...args: ExtractDependency<P, S>) => T>(constructor: C) => { | ||
|
|
r120 | |||
|
|
r108 | }; | ||
| } | ||||
|
|
r118 | inject<P extends any[]>(...args: P) { | ||
| return <X extends { [m in M]: (...args: any) => any }, M extends keyof (T | X)>( | ||||
| target: X, | ||||
| memberName: M, | ||||
|
|
r127 | descriptor: TypedPropertyDescriptor< T[M] extends ((...args: ExtractDependency<P, S>) => any) ? any : never > | ||
|
|
r118 | ) => { | ||
|
|
r108 | |||
| }; | ||||
| } | ||||
|
|
r121 | getDescriptor(): TypeRegistration<new () => T, S> { | ||
|
|
r118 | throw new Error(); | ||
| } | ||||
|
|
r132 | getRegistrationBuilder(): RegistrationBuilder<T, S> { | ||
| throw new Error(); | ||||
| } | ||||
|
|
r119 | } | ||
