traits.ts
23 lines
| 622 B
| video/mp2t
|
TypeScriptLexer
|
|
r118 | import { isPrimitive } from "../safe"; | ||
| import { Descriptor } from "./interfaces"; | ||||
|
|
r133 | import { AnnotationBuilder } from "./Annotations"; | ||
| import { Configuration } from "./fluent/Configuration"; | ||||
|
|
r118 | |||
| export function isDescriptor(x: any): x is Descriptor { | ||||
| return (!isPrimitive(x)) && | ||||
| (x.activate instanceof Function); | ||||
|
|
r132 | } | ||
|
|
r133 | export function declare<S extends object>() { | ||
|
|
r132 | return { | ||
| annotate<T>() { | ||||
|
|
r133 | return new AnnotationBuilder<T, S>(); | ||
|
|
r132 | }, | ||
|
|
r133 | configure(): Configuration<S> { | ||
|
|
r132 | throw new Error(); | ||
| }, | ||||
| dependency() { | ||||
| throw new Error(); | ||||
| } | ||||
| }; | ||||
| } | ||||
