-
Notifications
You must be signed in to change notification settings - Fork 21
/
meteor.js
1740 lines (1731 loc) · 73.2 KB
/
meteor.js
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
return mod(require("tern/lib/infer"), require("tern/lib/tern"), require);
if (typeof define == "function" && define.amd) // AMD
return define(["../lib/infer", "../lib/tern"], mod);
mod(tern, tern);
})(function(infer, tern, require) {
"use strict";
function resolvePath(base, path) {
if (path[0] == "/") return path;
var slash = base.lastIndexOf("/"), m;
if (slash >= 0) path = base.slice(0, slash + 1) + path;
while (m = /[^\/]*[^\/\.][^\/]*\/\.\.\//.exec(path))
path = path.slice(0, m.index) + path.slice(m.index + m[0].length);
return path.replace(/(^|[^\.])\.\//g, "$1");
}
function buildWrappingScope(parent, origin, node) {
var scope = new infer.Scope(parent);
return scope;
}
tern.registerPlugin("meteor", function(server, options) {
server._meteor = {
modules: Object.create(null),
options: options || {},
currentFile: null,
server: server
};
server.on("beforeLoad", function(file) {
// Just building a wrapping scope for a file
this._meteor.currentFile = resolvePath(server.options.projectDir + "/", file.name.replace(/\\/g, "/"));
file.scope = buildWrappingScope(file.scope, file.name, file.ast);
});
server.on("afterLoad", function(file) {
// XXX do we even need this stuff?
this._meteor.currentFile = null;
});
server.on("reset", function() {
// XXX
});
return {defs: defs};
});
var defs = {
"!name": "meteor",
"Match": {
"Any": "?",
"String": "?",
"Number": "?",
"Boolean": "?",
"undefined": "?",
"null": "?",
"Integer": "?",
"ObjectIncluding": "?",
"Object": "?",
"Optional": "fn(pattern: string)",
"OneOf": "fn()",
"Where": "fn(condition: bool)",
"!doc": "The namespace for all Match types and methods.",
"!url": "https://docs.meteor.com/#/full/check",
"test": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Returns true if the value matches the pattern.",
"!type": "fn(value, pattern: +MatchPattern)",
"!url": "https://docs.meteor.com/#/full/match_test"
}
},
"MeteorSubscribeHandle": {
"stop": "fn()",
"ready": "fn() -> bool"
},
"Blaze": {
"Template": {
"!data": {
"!locus": "Client"
},
"!doc": "Constructor for a Template, which is used to construct Views with particular name and content.",
"!type": "fn(viewName?: string, renderFunction: fn())",
"!url": "https://docs.meteor.com/#/full/blaze_template"
},
"TemplateInstance": {
"!doc": "The class for template instances",
"!type": "fn(view: +Blaze.View)",
"!url": "https://docs.meteor.com/#/full/Blaze-TemplateInstance",
"prototype": {
"$": {
"!data": {
"!locus": "Client"
},
"!doc": "Find all elements matching `selector` in this template instance, and return them as a JQuery object.",
"!type": "fn(selector: string) -> [+DOMNode]",
"!url": "https://docs.meteor.com/#/full/template_$"
},
"autorun": {
"!data": {
"!locus": "Client"
},
"!doc": "A version of [Tracker.autorun](#tracker_autorun) that is stopped when the template is destroyed.",
"!type": "fn(runFunc: fn()) -> +Tracker.Computation",
"!url": "https://docs.meteor.com/#/full/template_autorun"
},
"data": {
"!data": {
"!locus": "Client"
},
"!doc": "The data context of this instance's latest invocation.",
"!url": "https://docs.meteor.com/#/full/template_data"
},
"find": {
"!data": {
"!locus": "Client"
},
"!doc": "Find one element matching `selector` in this template instance.",
"!type": "fn(selector: string) -> +DOMElement",
"!url": "https://docs.meteor.com/#/full/template_find"
},
"findAll": {
"!data": {
"!locus": "Client"
},
"!doc": "Find all elements matching `selector` in this template instance.",
"!type": "fn(selector: string) -> [+DOMElement]",
"!url": "https://docs.meteor.com/#/full/template_findAll"
},
"firstNode": {
"!data": {
"!locus": "Client"
},
"!doc": "The first top-level DOM node in this template instance.",
"!type": "+DOMNode",
"!url": "https://docs.meteor.com/#/full/template_firstNode"
},
"lastNode": {
"!data": {
"!locus": "Client"
},
"!doc": "The last top-level DOM node in this template instance.",
"!type": "+DOMNode",
"!url": "https://docs.meteor.com/#/full/template_lastNode"
},
"subscribe": {
"!data": {
"!locus": "Client"
},
"!doc": "A version of [Meteor.subscribe](#meteor_subscribe) that is stopped\nwhen the template is destroyed.",
"!type": "fn(name: string, arg1, arg2..., options?: fn()) -> +SubscriptionHandle",
"!url": "https://docs.meteor.com/#/full/Blaze-TemplateInstance-subscribe"
},
"subscriptionsReady": {
"!doc": "A reactive function that returns true when all of the subscriptions\ncalled with [this.subscribe](#TemplateInstance-subscribe) are ready.",
"!type": "fn() -> bool",
"!url": "https://docs.meteor.com/#/full/Blaze-TemplateInstance-subscriptionsReady"
},
"view": {
"!data": {
"!locus": "Client"
},
"!doc": "The [View](#blaze_view) object for this invocation of the template.",
"!type": "+Blaze.View",
"!url": "https://docs.meteor.com/#/full/template_view"
}
}
},
"View": {
"!data": {
"!locus": "Client"
},
"!doc": "Constructor for a View, which represents a reactive region of DOM.",
"!type": "fn(name?: string, renderFunction: fn())",
"!url": "https://docs.meteor.com/#/full/blaze_view"
},
"!doc": "The namespace for all Blaze-related methods and classes.",
"!url": "https://docs.meteor.com/#/full/blaze",
"Each": {
"!data": {
"!locus": "Client"
},
"!doc": "Constructs a View that renders `contentFunc` for each item in a sequence.",
"!type": "fn(argFunc: fn(), contentFunc: fn(), elseFunc?: fn())",
"!url": "https://docs.meteor.com/#/full/blaze_each"
},
"If": {
"!data": {
"!locus": "Client"
},
"!doc": "Constructs a View that renders content conditionally.",
"!type": "fn(conditionFunc: fn(), contentFunc: fn(), elseFunc?: fn())",
"!url": "https://docs.meteor.com/#/full/blaze_if"
},
"Unless": {
"!data": {
"!locus": "Client"
},
"!doc": "An inverted [`Blaze.If`](#blaze_if).",
"!type": "fn(conditionFunc: fn(), contentFunc: fn(), elseFunc?: fn())",
"!url": "https://docs.meteor.com/#/full/blaze_unless"
},
"With": {
"!data": {
"!locus": "Client"
},
"!doc": "Constructs a View that renders content with a data context.",
"!type": "fn(data: ?, contentFunc: fn())",
"!url": "https://docs.meteor.com/#/full/blaze_with"
},
"currentView": {
"!data": {
"!locus": "Client"
},
"!doc": "The View corresponding to the current template helper, event handler, callback, or autorun. If there isn't one, `null`.",
"!type": "+Blaze.View",
"!url": "https://docs.meteor.com/#/full/blaze_currentview"
},
"getData": {
"!data": {
"!locus": "Client"
},
"!doc": "Returns the current data context, or the data context that was used when rendering a particular DOM element or View from a Meteor template.",
"!type": "fn(elementOrView?: +DOMElement)",
"!url": "https://docs.meteor.com/#/full/blaze_getdata"
},
"getView": {
"!data": {
"!locus": "Client"
},
"!doc": "Gets either the current View, or the View enclosing the given DOM element.",
"!type": "fn(element?: +DOMElement)",
"!url": "https://docs.meteor.com/#/full/blaze_getview"
},
"isTemplate": {
"!data": {
"!locus": "Client"
},
"!doc": "Returns true if `value` is a template object like `Template.myTemplate`.",
"!type": "fn(value)",
"!url": "https://docs.meteor.com/#/full/blaze_istemplate"
},
"remove": {
"!data": {
"!locus": "Client"
},
"!doc": "Removes a rendered View from the DOM, stopping all reactive updates and event listeners on it.",
"!type": "fn(renderedView: +Blaze.View)",
"!url": "https://docs.meteor.com/#/full/blaze_remove"
},
"render": {
"!data": {
"!locus": "Client"
},
"!doc": "Renders a template or View to DOM nodes and inserts it into the DOM, returning a rendered [View](#blaze_view) which can be passed to [`Blaze.remove`](#blaze_remove).",
"!type": "fn(templateOrView: +Template, parentNode: +DOMNode, nextNode?: +DOMNode, parentView?: +Blaze.View)",
"!url": "https://docs.meteor.com/#/full/blaze_render"
},
"renderWithData": {
"!data": {
"!locus": "Client"
},
"!doc": "Renders a template or View to DOM nodes with a data context. Otherwise identical to `Blaze.render`.",
"!type": "fn(templateOrView: +Template, data: ?, parentNode: +DOMNode, nextNode?: +DOMNode, parentView?: +Blaze.View)",
"!url": "https://docs.meteor.com/#/full/blaze_renderwithdata"
},
"toHTML": {
"!data": {
"!locus": "Client"
},
"!doc": "Renders a template or View to a string of HTML.",
"!type": "fn(templateOrView: +Template)",
"!url": "https://docs.meteor.com/#/full/blaze_tohtml"
},
"toHTMLWithData": {
"!data": {
"!locus": "Client"
},
"!doc": "Renders a template or View to HTML with a data context. Otherwise identical to `Blaze.toHTML`.",
"!type": "fn(templateOrView: +Template, data: ?)",
"!url": "https://docs.meteor.com/#/full/blaze_tohtmlwithdata"
}
},
"CompileStep": {
"!doc": "The object passed into Plugin.registerSourceHandler",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/CompileStep",
"prototype": {
"addAsset": {
"!doc": "Add a file to serve as-is to the browser or to include on\nthe browser, depending on the target. On the web, it will be served\nat the exact path requested. For server targets, it can be retrieved\nusing `Assets.getText` or `Assets.getBinary`.",
"!type": "fn(options: ?, path: string, data: +Buffer)",
"!url": "https://docs.meteor.com/#/full/CompileStep-addAsset"
},
"addHtml": {
"!doc": "Works in web targets only. Add markup to the `head` or `body`\nsection of the document.",
"!type": "fn(options: ?)",
"!url": "https://docs.meteor.com/#/full/CompileStep-addHtml"
},
"addJavaScript": {
"!doc": "Add JavaScript code. The code added will only see the\nnamespaces imported by this package as runtime dependencies using\n['api.use'](#PackageAPI-use). If the file being compiled was added\nwith the bare flag, the resulting JavaScript won't be wrapped in a\nclosure.",
"!type": "fn(options: ?)",
"!url": "https://docs.meteor.com/#/full/CompileStep-addJavaScript"
},
"addStylesheet": {
"!doc": "Web targets only. Add a stylesheet to the document.",
"!type": "fn(options: ?, path: string, data: string, sourceMap: string)",
"!url": "https://docs.meteor.com/#/full/CompileStep-addStylesheet"
},
"arch": {
"!doc": "The architecture for which we are building. Can be \"os\",\n\"web.browser\", or \"web.cordova\".",
"!type": "string",
"!url": "https://docs.meteor.com/#/full/CompileStep-arch"
},
"declaredExports": {
"!doc": "The list of exports that the current package has defined.\nCan be used to treat those symbols differently during compilation.",
"!type": "?",
"!url": "https://docs.meteor.com/#/full/CompileStep-declaredExports"
},
"error": {
"!doc": "Display a build error.",
"!type": "fn(options: ?, message: string, sourcePath?: string, line: number, func: string)",
"!url": "https://docs.meteor.com/#/full/CompileStep-error"
},
"fileOptions": {
"!doc": "Any options passed to \"api.addFiles\".",
"!type": "?",
"!url": "https://docs.meteor.com/#/full/CompileStep-fileOptions"
},
"fullInputPath": {
"!doc": "The filename and absolute path of the input file.\nPlease don't use this filename to read the file from disk, instead\nuse [compileStep.read](CompileStep-read).",
"!type": "string",
"!url": "https://docs.meteor.com/#/full/CompileStep-fullInputPath"
},
"inputPath": {
"!doc": "The filename and relative path of the input file.\nPlease don't use this filename to read the file from disk, instead\nuse [compileStep.read](CompileStep-read).",
"!type": "string",
"!url": "https://docs.meteor.com/#/full/CompileStep-inputPath"
},
"inputSize": {
"!doc": "The total number of bytes in the input file.",
"!type": "number",
"!url": "https://docs.meteor.com/#/full/CompileStep-inputSize"
},
"packageName": {
"!doc": "The name of the package in which the file being built exists.",
"!type": "string",
"!url": "https://docs.meteor.com/#/full/CompileStep-packageName"
},
"pathForSourceMap": {
"!doc": "If you are generating a sourcemap for the compiled file, use\nthis path for the original file in the sourcemap.",
"!type": "string",
"!url": "https://docs.meteor.com/#/full/CompileStep-pathForSourceMap"
},
"read": {
"!doc": "Read from the input file. If `n` is specified, returns the\nnext `n` bytes of the file as a Buffer. XXX not sure if this actually\nreturns a String sometimes...",
"!type": "fn(n?: number) -> +Buffer",
"!url": "https://docs.meteor.com/#/full/CompileStep-read"
},
"rootOutputPath": {
"!doc": "On web targets, this will be the root URL prepended\nto the paths you pick for your output files. For example,\nit could be \"/packages/my-package\".",
"!type": "string",
"!url": "https://docs.meteor.com/#/full/CompileStep-rootOutputPath"
}
}
},
"EJSON": {
"CustomType": {
"!doc": "The interface that a class must satisfy to be able to become an\nEJSON custom type via EJSON.addType.",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/EJSON-CustomType",
"prototype": {
"clone": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Return a value `r` such that `this.equals(r)` is true, and modifications to `r` do not affect `this` and vice versa.",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/ejson_type_clone"
},
"equals": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Return `true` if `other` has a value equal to `this`; `false` otherwise.",
"!type": "fn(other: ?)",
"!url": "https://docs.meteor.com/#/full/ejson_type_equals"
},
"toJSONValue": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Serialize this instance into a JSON-compatible value.",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/ejson_type_toJSONValue"
},
"typeName": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Return the tag used to identify this type. This must match the tag used to register this type with [`EJSON.addType`](#ejson_add_type).",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/ejson_type_typeName"
}
}
},
"!doc": "Namespace for EJSON functions",
"!url": "https://docs.meteor.com/#/full/ejson",
"addType": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Add a custom datatype to EJSON.",
"!type": "fn(name: string, factory: fn())",
"!url": "https://docs.meteor.com/#/full/ejson_add_type"
},
"clone": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Return a deep copy of `val`.",
"!type": "fn(val: +EJSON)",
"!url": "https://docs.meteor.com/#/full/ejson_clone"
},
"equals": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Return true if `a` and `b` are equal to each other. Return false otherwise. Uses the `equals` method on `a` if present, otherwise performs a deep comparison.",
"!type": "fn(a: +EJSON, b: +EJSON, options?: ?)",
"!url": "https://docs.meteor.com/#/full/ejson_equals"
},
"fromJSONValue": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Deserialize an EJSON value from its plain JSON representation.",
"!type": "fn(val: +JSONCompatible)",
"!url": "https://docs.meteor.com/#/full/ejson_from_json_value"
},
"isBinary": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Returns true if `x` is a buffer of binary data, as returned from [`EJSON.newBinary`](#ejson_new_binary).",
"!type": "fn(x: ?)",
"!url": "https://docs.meteor.com/#/full/ejson_is_binary"
},
"newBinary": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Allocate a new buffer of binary data that EJSON can serialize.",
"!url": "https://docs.meteor.com/#/full/ejson_new_binary"
},
"parse": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Parse a string into an EJSON value. Throws an error if the string is not valid EJSON.",
"!type": "fn(str: string)",
"!url": "https://docs.meteor.com/#/full/ejson_parse"
},
"stringify": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Serialize a value to a string.\n\nFor EJSON values, the serialization fully represents the value. For non-EJSON values, serializes the same way as `JSON.stringify`.",
"!type": "fn(val: +EJSON, options?: ?)",
"!url": "https://docs.meteor.com/#/full/ejson_stringify"
},
"toJSONValue": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Serialize an EJSON-compatible value into its plain JSON representation.",
"!type": "fn(val: +EJSON)",
"!url": "https://docs.meteor.com/#/full/ejson_to_json_value"
}
},
"Meteor": {
"Error": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "This class represents a symbolic error thrown by a method.",
"!type": "fn(error: string, reason?: string, details?: string)",
"!url": "https://docs.meteor.com/#/full/meteor_error"
},
"!doc": "The Meteor namespace",
"!url": "https://docs.meteor.com/#/full/core",
"absoluteUrl": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Generate an absolute URL pointing to the application. The server reads from the `ROOT_URL` environment variable to determine where it is running. This is taken care of automatically for apps deployed with `meteor deploy`, but must be provided when using `meteor build`.",
"!type": "fn(path?: string, options?: ?)",
"!url": "https://docs.meteor.com/#/full/meteor_absoluteurl"
},
"apply": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Invoke a method passing an array of arguments.",
"!type": "fn(name: string, args: [+EJSONable], options?: ?, asyncCallback?: fn())",
"!url": "https://docs.meteor.com/#/full/meteor_apply"
},
"call": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Invokes a method passing any number of arguments.",
"!type": "fn(name: string, arg1, arg2..., asyncCallback?: fn())",
"!url": "https://docs.meteor.com/#/full/meteor_call"
},
"clearInterval": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Cancel a repeating function call scheduled by `Meteor.setInterval`.",
"!type": "fn(id: number)",
"!url": "https://docs.meteor.com/#/full/meteor_clearinterval"
},
"clearTimeout": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Cancel a function call scheduled by `Meteor.setTimeout`.",
"!type": "fn(id: number)",
"!url": "https://docs.meteor.com/#/full/meteor_cleartimeout"
},
"disconnect": {
"!data": {
"!locus": "Client"
},
"!doc": "Disconnect the client from the server.",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/meteor_disconnect"
},
"isClient": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Boolean variable. True if running in client environment.",
"!type": "bool",
"!url": "https://docs.meteor.com/#/full/meteor_isclient"
},
"isCordova": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Boolean variable. True if running in a Cordova mobile environment.",
"!type": "bool",
"!url": "https://docs.meteor.com/#/full/meteor_iscordova"
},
"isServer": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Boolean variable. True if running in server environment.",
"!type": "bool",
"!url": "https://docs.meteor.com/#/full/meteor_isserver"
},
"loggingIn": {
"!data": {
"!locus": "Client"
},
"!doc": "True if a login method (such as `Meteor.loginWithPassword`, `Meteor.loginWithFacebook`, or `Accounts.createUser`) is currently in progress. A reactive data source.",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/meteor_loggingin"
},
"loginWith<ExternalService>": {
"!data": {
"!locus": "Client"
},
"!doc": "Log the user in using an external service.",
"!type": "fn(options?: ?, callback?: fn())",
"!url": "https://docs.meteor.com/#/full/meteor_loginwithexternalservice"
},
"loginWithPassword": {
"!data": {
"!locus": "Client"
},
"!doc": "Log the user in with a password.",
"!type": "fn(user: ?, password: string, callback?: fn())",
"!url": "https://docs.meteor.com/#/full/meteor_loginwithpassword"
},
"logout": {
"!data": {
"!locus": "Client"
},
"!doc": "Log the user out.",
"!type": "fn(callback?: fn())",
"!url": "https://docs.meteor.com/#/full/meteor_logout"
},
"logoutOtherClients": {
"!data": {
"!locus": "Client"
},
"!doc": "Log out other clients logged in as the current user, but does not log out the client that calls this function.",
"!type": "fn(callback?: fn())",
"!url": "https://docs.meteor.com/#/full/meteor_logoutotherclients"
},
"methods": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Defines functions that can be invoked over the network by clients.",
"!type": "fn(methods: ?)",
"!url": "https://docs.meteor.com/#/full/meteor_methods"
},
"onConnection": {
"!data": {
"!locus": "Server"
},
"!doc": "Register a callback to be called when a new DDP connection is made to the server.",
"!type": "fn(callback: fn())",
"!url": "https://docs.meteor.com/#/full/meteor_onconnection"
},
"publish": {
"!data": {
"!locus": "Server"
},
"!doc": "Publish a record set.",
"!type": "fn(name: string, func: fn())",
"!url": "https://docs.meteor.com/#/full/meteor_publish"
},
"reconnect": {
"!data": {
"!locus": "Client"
},
"!doc": "Force an immediate reconnection attempt if the client is not connected to the server.\n\n This method does nothing if the client is already connected.",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/meteor_reconnect"
},
"release": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "`Meteor.release` is a string containing the name of the [release](#meteorupdate) with which the project was built (for example, `\"1.2.3\"`). It is `undefined` if the project was built using a git checkout of Meteor.",
"!type": "string",
"!url": "https://docs.meteor.com/#/full/meteor_release"
},
"setInterval": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Call a function repeatedly, with a time delay between calls.",
"!type": "fn(func: fn(), delay: number)",
"!url": "https://docs.meteor.com/#/full/meteor_setinterval"
},
"setTimeout": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Call a function in the future after waiting for a specified delay.",
"!type": "fn(func: fn(), delay: number)",
"!url": "https://docs.meteor.com/#/full/meteor_settimeout"
},
"settings": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "`Meteor.settings` contains deployment-specific configuration options. You can initialize settings by passing the `--settings` option (which takes the name of a file containing JSON data) to `meteor run` or `meteor deploy`. When running your server directly (e.g. from a bundle), you instead specify settings by putting the JSON directly into the `METEOR_SETTINGS` environment variable. If you don't provide any settings, `Meteor.settings` will be an empty object. If the settings object contains a key named `public`, then `Meteor.settings.public` will be available on the client as well as the server. All other properties of `Meteor.settings` are only defined on the server.",
"!type": "?",
"!url": "https://docs.meteor.com/#/full/meteor_settings"
},
"startup": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Run code when a client or a server starts.",
"!type": "fn(func: fn())",
"!url": "https://docs.meteor.com/#/full/meteor_startup"
},
"status": {
"!data": {
"!locus": "Client"
},
"!doc": "Get the current connection status. A reactive data source.",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/meteor_status"
},
"subscribe": {
"!data": {
"!locus": "Client"
},
"!doc": "Subscribe to a record set. Returns a handle that provides\n`stop()` and `ready()` methods.",
"!type": "fn(name: string, arg1, arg2..., callbacks?: fn()) -> MeteorSubscribeHandle",
"!url": "https://docs.meteor.com/#/full/meteor_subscribe"
},
"user": {
"!data": {
"!locus": "Anywhere but publish functions"
},
"!doc": "Get the current user record, or `null` if no user is logged in. A reactive data source.",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/meteor_user"
},
"userId": {
"!data": {
"!locus": "Anywhere but publish functions"
},
"!doc": "Get the current user id, or `null` if no user is logged in. A reactive data source.",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/meteor_userid"
},
"users": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "A [Mongo.Collection](#collections) containing user documents.",
"!type": "+Mongo.Collection",
"!url": "https://docs.meteor.com/#/full/meteor_users"
},
"wrapAsync": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Wrap a function that takes a callback function as its final parameter. On the server, the wrapped function can be used either synchronously (without passing a callback) or asynchronously (when a callback is passed). On the client, a callback is always required; errors will be logged if there is no callback. If a callback is provided, the environment captured when the original function was called will be restored in the callback.",
"!type": "fn(func: fn(), context?: ?)",
"!url": "https://docs.meteor.com/#/full/meteor_wrapasync"
}
},
"Mongo": {
"Collection": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Constructor for a Collection",
"!type": "fn(name: string, options?: ?)",
"!url": "https://docs.meteor.com/#/full/mongo_collection",
"prototype": {
"allow": {
"!data": {
"!locus": "Server"
},
"!doc": "Allow users to write directly to this collection from client code, subject to limitations you define.",
"!type": "fn(options: ?)",
"!url": "https://docs.meteor.com/#/full/allow"
},
"deny": {
"!data": {
"!locus": "Server"
},
"!doc": "Override `allow` rules.",
"!type": "fn(options: ?)",
"!url": "https://docs.meteor.com/#/full/deny"
},
"find": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Find the documents in a collection that match the selector.",
"!type": "fn(selector?: +MongoSelector, options?: ?) -> +Mongo.Cursor",
"!url": "https://docs.meteor.com/#/full/find"
},
"findOne": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Finds the first document that matches the selector, as ordered by sort and skip options.",
"!type": "fn(selector?: +MongoSelector, options?: ?) -> ?",
"!url": "https://docs.meteor.com/#/full/findone"
},
"insert": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Insert a document in the collection. Returns its unique _id.",
"!type": "fn(doc: ?, callback?: fn())",
"!url": "https://docs.meteor.com/#/full/insert"
},
"remove": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Remove documents from the collection",
"!type": "fn(selector: +MongoSelector, callback?: fn())",
"!url": "https://docs.meteor.com/#/full/remove"
},
"update": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Modify one or more documents in the collection. Returns the number of affected documents.",
"!type": "fn(selector: +MongoSelector, modifier: +MongoModifier, options?: ?, callback?: fn())",
"!url": "https://docs.meteor.com/#/full/update"
},
"upsert": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Modify one or more documents in the collection, or insert one if no matching documents were found. Returns an object with keys `numberAffected` (the number of documents modified) and `insertedId` (the unique _id of the document that was inserted, if any).",
"!type": "fn(selector: +MongoSelector, modifier: +MongoModifier, options?: ?, callback?: fn())",
"!url": "https://docs.meteor.com/#/full/upsert"
}
}
},
"Cursor": {
"!doc": "To create a cursor, use find. To access the documents in a cursor, use forEach, map, or fetch.",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/Mongo-Cursor",
"prototype": {
"count": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Returns the number of documents that match a query.",
"!type": "fn() -> number",
"!url": "https://docs.meteor.com/#/full/count"
},
"fetch": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Return all matching documents as an Array.",
"!type": "fn() -> [?]",
"!url": "https://docs.meteor.com/#/full/fetch"
},
"forEach": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Call `callback` once for each matching document, sequentially and synchronously.",
"!type": "fn(callback: fn(?, number), thisArg)",
"!url": "https://docs.meteor.com/#/full/foreach"
},
"map": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Map callback over all matching documents. Returns an Array.",
"!type": "fn(callback: fn(?, number), thisArg)",
"!url": "https://docs.meteor.com/#/full/map"
},
"observe": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Watch a query. Receive callbacks as the result set changes.",
"!type": "fn(callbacks: ?)",
"!url": "https://docs.meteor.com/#/full/observe"
},
"observeChanges": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Watch a query. Receive callbacks as the result set changes. Only the differences between the old and new documents are passed to the callbacks.",
"!type": "fn(callbacks: ?)",
"!url": "https://docs.meteor.com/#/full/observe_changes"
}
}
},
"ObjectID": {
"!data": {
"!locus": "Anywhere"
},
"!doc": "Create a Mongo-style `ObjectID`. If you don't specify a `hexString`, the `ObjectID` will generated randomly (not using MongoDB's ID construction rules).",
"!type": "fn(hexString: string)",
"!url": "https://docs.meteor.com/#/full/mongo_object_id"
},
"!doc": "Namespace for MongoDB-related items",
"!url": "https://docs.meteor.com/#/full/mongo_collections"
},
"PackageAPI": {
"!doc": "Type of the API object passed into the `Package.onUse` function.",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/PackageAPI",
"prototype": {
"addFiles": {
"!data": {
"!locus": "package.js"
},
"!doc": "Specify the source code for your package.",
"!type": "fn(filename: string, architecture?: string)",
"!url": "https://docs.meteor.com/#/full/pack_addFiles"
},
"export": {
"!data": {
"!locus": "package.js"
},
"!doc": "Export package-level variables in your package. The specified variables (declared without `var` in the source code) will be available to packages that use this package.",
"!type": "fn(exportedObject: string, architecture?: string)",
"!url": "https://docs.meteor.com/#/full/pack_export"
},
"imply": {
"!data": {
"!locus": "package.js"
},
"!doc": "Give users of this package access to another package (by passing in the string `packagename`) or a collection of packages (by passing in an array of strings [`packagename1`, `packagename2`]",
"!type": "fn(packageSpecs: string)",
"!url": "https://docs.meteor.com/#/full/pack_api_imply"
},
"use": {
"!data": {
"!locus": "package.js"
},
"!doc": "Depend on package `packagename`.",
"!type": "fn(packageNames: string, architecture?: string, options?: ?)",
"!url": "https://docs.meteor.com/#/full/pack_use"
},
"versionsFrom": {
"!data": {
"!locus": "package.js"
},
"!doc": "Use versions of core packages from a release. Unless provided, all packages will default to the versions released along with `meteorRelease`. This will save you from having to figure out the exact versions of the core packages you want to use. For example, if the newest release of meteor is `[email protected]` and it includes `[email protected]`, you can write `api.versionsFrom('[email protected]')` in your package, and when you later write `api.use('jquery')`, it will be equivalent to `api.use('[email protected]')`. You may specify an array of multiple releases, in which case the default value for constraints will be the \"or\" of the versions from each release: `api.versionsFrom(['[email protected]', '[email protected]'])` may cause `api.use('jquery')` to be interpreted as `api.use('[email protected] || 2.0.0')`.",
"!type": "fn(meteorRelease: string)",
"!url": "https://docs.meteor.com/#/full/pack_versions"
}
}
},
"ReactiveVar": {
"!data": {
"!locus": "Client"
},
"!doc": "Constructor for a ReactiveVar, which represents a single reactive variable.",
"!type": "fn(initialValue, equalsFunc?: fn())",
"!url": "https://docs.meteor.com/#/full/reactivevar",
"prototype": {
"get": {
"!data": {
"!locus": "Client"
},
"!doc": "Returns the current value of the ReactiveVar, establishing a reactive dependency.",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/reactivevar_get"
},
"set": {
"!data": {
"!locus": "Client"
},
"!doc": "Sets the current value of the ReactiveVar, invalidating the Computations that called `get` if `newValue` is different from the old value.",
"!type": "fn(newValue)",
"!url": "https://docs.meteor.com/#/full/reactivevar_set"
}
}
},
"Subscription": {
"!doc": "The server's side of a subscription",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/Subscription",
"prototype": {
"added": {
"!data": {
"!locus": "Server"
},
"!doc": "Call inside the publish function. Informs the subscriber that a document has been added to the record set.",
"!type": "fn(collection: string, id: string, fields: ?)",
"!url": "https://docs.meteor.com/#/full/publish_added"
},
"changed": {
"!data": {
"!locus": "Server"
},
"!doc": "Call inside the publish function. Informs the subscriber that a document in the record set has been modified.",
"!type": "fn(collection: string, id: string, fields: ?)",
"!url": "https://docs.meteor.com/#/full/publish_changed"
},
"connection": {
"!data": {
"!locus": "Server"
},
"!doc": "Access inside the publish function. The incoming [connection](#meteor_onconnection) for this subscription.",
"!url": "https://docs.meteor.com/#/full/publish_connection"
},
"error": {
"!data": {
"!locus": "Server"
},
"!doc": "Call inside the publish function. Stops this client's subscription, triggering a call on the client to the `onStop` callback passed to [`Meteor.subscribe`](#meteor_subscribe), if any. If `error` is not a [`Meteor.Error`](#meteor_error), it will be [sanitized](#meteor_error).",
"!type": "fn(error: +Error)",
"!url": "https://docs.meteor.com/#/full/publish_error"
},
"onStop": {
"!data": {
"!locus": "Server"
},
"!doc": "Call inside the publish function. Registers a callback function to run when the subscription is stopped.",
"!type": "fn(func: fn())",
"!url": "https://docs.meteor.com/#/full/publish_onstop"
},
"ready": {
"!data": {
"!locus": "Server"
},
"!doc": "Call inside the publish function. Informs the subscriber that an initial, complete snapshot of the record set has been sent. This will trigger a call on the client to the `onReady` callback passed to [`Meteor.subscribe`](#meteor_subscribe), if any.",
"!type": "fn()",
"!url": "https://docs.meteor.com/#/full/publish_ready"
},
"removed": {
"!data": {
"!locus": "Server"
},
"!doc": "Call inside the publish function. Informs the subscriber that a document has been removed from the record set.",
"!type": "fn(collection: string, id: string)",
"!url": "https://docs.meteor.com/#/full/publish_removed"
},