forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meteor-publish-composite.d.ts
65 lines (56 loc) · 1.92 KB
/
meteor-publish-composite.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Type definitions for meteor-publish-composite
// Project: https://github.com/englue/meteor-publish-composite
// Definitions by: Robert Van Gorkom <https://github.com/vangorra>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../meteor/meteor.d.ts" />
declare interface PublishCompositeConfigN {
children? : PublishCompositeConfigN[];
find(
...args : any[]
) : Mongo.Cursor<any>;
}
declare interface PublishCompositeConfig4<InLevel1, InLevel2, InLevel3, InLevel4, OutLevel> {
children? : PublishCompositeConfigN[];
find(
arg4 : InLevel4,
arg3 : InLevel3,
arg2 : InLevel2,
arg1 : InLevel1
) : Mongo.Cursor<OutLevel>;
}
declare interface PublishCompositeConfig3<InLevel1, InLevel2, InLevel3, OutLevel> {
children? : PublishCompositeConfig4<InLevel1, InLevel2, InLevel3, OutLevel, any>[];
find(
arg3 : InLevel3,
arg2 : InLevel2,
arg1 : InLevel1
) : Mongo.Cursor<OutLevel>;
}
declare interface PublishCompositeConfig2<InLevel1, InLevel2, OutLevel> {
children? : PublishCompositeConfig3<InLevel1, InLevel2, OutLevel, any>[];
find(
arg2 : InLevel2,
arg1 : InLevel1
) : Mongo.Cursor<OutLevel>;
}
declare interface PublishCompositeConfig1<InLevel1, OutLevel> {
children? : PublishCompositeConfig2<InLevel1, OutLevel, any>[];
find(
arg1 : InLevel1
) : Mongo.Cursor<OutLevel>;
}
declare interface PublishCompositeConfig<OutLevel> {
children? : PublishCompositeConfig1<OutLevel, any>[];
find() : Mongo.Cursor<OutLevel>;
}
declare namespace Meteor {
function publishComposite(
name : string,
config : PublishCompositeConfig<any>|PublishCompositeConfig<any>[]
) : void;
function publishComposite(
name : string,
configFunc : (...args : any[]) =>
PublishCompositeConfig<any>|PublishCompositeConfig<any>[]
) : void;
}