UNPKG

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