first-npm-package-nicule
Version:
This isi first npm package
29 lines (25 loc) • 715 B
text/typescript
import { Type } from '@angular/core';
export interface QueryDecorator {
(props: {
class?: Array<string>;
}): any;
new(props: {
class?: Array<string>;
}): any;
}
export function Query(queryMetadata: {
class?: Array<string>;
} = {}): any {
return (type: Type<any>) => {
const ANNOTATIONS = '__annotations__';
type[ANNOTATIONS] = type[ANNOTATIONS] || [];
type[ANNOTATIONS].push(queryMetadata);
};
}
export function Root(): any {
return (type: Type<any>) => {
const ANNOTATIONS = '__annotations__';
type[ANNOTATIONS] = type[ANNOTATIONS] || [];
type[ANNOTATIONS].push({ class: [] });
};
}