jasperjs-annotations
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -1,5 +0,6 @@ | ||
export declare function Component(def: jasper.core.IHtmlComponentDefinition): void; | ||
export declare function Service(def: jasper.core.IServiceDefinition): void; | ||
export declare function Decorator(def: jasper.core.IHtmlDecoratorDefinition): void; | ||
export declare function Page(def: IPageDefinition): void; | ||
export declare function Component(def: jasper.core.IHtmlComponentDefinition): (target: Function) => void; | ||
export declare function Decorator(def: jasper.core.IHtmlDecoratorDefinition): (target: Function) => void; | ||
export declare function Service(def: jasper.core.IServiceDefinition): (target: Function) => void; | ||
export declare function Pipe(def: jasper.core.IFilterDefinition): (target: Function) => void; | ||
export declare function Page(def: IPageDefinition): (target: Function) => void; | ||
export declare function Template(url: string, content: string): void; | ||
@@ -6,0 +7,0 @@ export interface IPageDefinition extends jasper.core.IHtmlComponentDefinition { |
32
index.js
var jsp = require('jasperjs'); | ||
function Component(def) { | ||
jsp.component(def); | ||
return function (target) { | ||
def.ctrl = target; | ||
jsp.component(def); | ||
}; | ||
} | ||
exports.Component = Component; | ||
function Decorator(def) { | ||
return function (target) { | ||
def.ctrl = target; | ||
jsp.decorator(def); | ||
}; | ||
} | ||
exports.Decorator = Decorator; | ||
function Service(def) { | ||
jsp.service(def); | ||
return function (target) { | ||
def.ctor = target; | ||
jsp.service(def); | ||
}; | ||
} | ||
exports.Service = Service; | ||
function Decorator(def) { | ||
jsp.decorator(def); | ||
function Pipe(def) { | ||
return function (target) { | ||
def.ctor = target; | ||
jsp.filter(def); | ||
}; | ||
} | ||
exports.Decorator = Decorator; | ||
exports.Pipe = Pipe; | ||
function Page(def) { | ||
jsp.component(def); | ||
//TODO jsp.template(); | ||
return function (target) { | ||
def.ctrl = target; | ||
jsp.component(def); | ||
}; | ||
} | ||
@@ -18,0 +36,0 @@ exports.Page = Page; |
37
index.ts
import jsp = require('jasperjs'); | ||
export function Component(def:jasper.core.IHtmlComponentDefinition) { | ||
jsp.component(def); | ||
export function Component(def: jasper.core.IHtmlComponentDefinition) { | ||
return function (target: Function) { | ||
def.ctrl = target; | ||
jsp.component(def); | ||
} | ||
} | ||
export function Service(def:jasper.core.IServiceDefinition) { | ||
jsp.service(def); | ||
export function Decorator(def: jasper.core.IHtmlDecoratorDefinition) { | ||
return function (target: Function) { | ||
def.ctrl = target; | ||
jsp.decorator(def); | ||
} | ||
} | ||
export function Decorator(def:jasper.core.IHtmlDecoratorDefinition) { | ||
jsp.decorator(def); | ||
export function Service(def: jasper.core.IServiceDefinition) { | ||
return function (target: Function) { | ||
def.ctor = target; | ||
jsp.service(def); | ||
} | ||
} | ||
export function Pipe(def: jasper.core.IFilterDefinition) { | ||
return function (target: Function) { | ||
def.ctor = target; | ||
jsp.filter(def); | ||
} | ||
} | ||
export function Page(def:IPageDefinition) { | ||
jsp.component(def); | ||
//TODO jsp.template(); | ||
return function (target: Function) { | ||
def.ctrl = target; | ||
jsp.component(def); | ||
} | ||
} | ||
@@ -27,2 +45,3 @@ | ||
area?: string|string[]; | ||
} | ||
} | ||
{ | ||
"name": "jasperjs-annotations", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Decorator annotations for jasperjs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
270338
5215