UNPKG

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