UNPKG

2.32 kBTypeScriptView Raw
1declare module 'gulpclass/TaskMetadata' {
2 /**
3 * Metadata of the Task annotation.
4 */
5 export interface TaskMetadata {
6 /**
7 * Object that is called by this task.
8 */
9 classConstructor: Function;
10 /**
11 * Method called by this class.
12 */
13 method: string;
14 /**
15 * Task name.
16 */
17 name: string;
18 /**
19 * Task dependencies
20 */
21 dependencies: string[];
22 /**
23 * Indicates if this task will be run using run-sequence component.
24 */
25 isSequence?: boolean;
26 /**
27 * Indicates if this task will be run using merge2 component.
28 */
29 isMerge?: boolean;
30 }
31
32}
33declare module 'gulpclass/GulpclassMetadata' {
34 /**
35 * Metadata of the Gulpclass annotation.
36 */
37 export interface GulpclassMetadata {
38 gulpInstance: any;
39 classConstructor: Function;
40 classInstance?: Object;
41 }
42
43}
44declare module 'gulpclass/MetadataStorage' {
45 import { TaskMetadata } from 'gulpclass/TaskMetadata';
46 import { GulpclassMetadata } from 'gulpclass/GulpclassMetadata';
47 /**
48 * Storages and registers all gulp classes and their tasks.
49 */
50 export class MetadataStorage {
51 private gulpclassMetadatas;
52 private taskMetadatas;
53 addGulpclassMetadata(metadata: GulpclassMetadata): void;
54 addTaskMetadata(metadata: TaskMetadata): void;
55 private registerTasks(gulpclassMetadata, taskMetadata);
56 private executeTask(gulpclassMetadata, taskMetadata, cb);
57 }
58 /**
59 * Default metadata storage is used as singleton and can be used to storage all metadatas.
60 */
61 export let defaultMetadataStorage: MetadataStorage;
62
63}
64declare module 'gulpclass/Decorators' {
65 /**
66 * Registers a class from which tasks will be loaded.
67 * You can optionally specify your gulp instance if you want to register tasks specifically there.
68 */
69 export function Gulpclass(gulpInstance?: any): Function;
70 /**
71 * Registers a task with the given name. If name is not specified then object's method name will be used.
72 */
73 export function Task(name?: string, dependencies?: string[]): Function;
74 /**
75 * Tasks will be run in sequence when using this annotation.
76 */
77 export function SequenceTask(name?: string): Function;
78 /**
79 * Tasks will be run merged when using this annotation.
80 */
81 export function MergedTask(name?: string): Function;
82
83}