From 3eedbeafbdf56acd7985476632468e71f4c17bb6 Mon Sep 17 00:00:00 2001 From: Dave Allen Date: Fri, 9 Jan 2015 15:08:44 -0800 Subject: [PATCH 1/5] Updated definitions for Meteor version 1.0.2.1 --- meteor/meteor-tests.ts | 19 +- meteor/meteor.d.ts | 904 ++++++++++++++++++++++------------------- 2 files changed, 497 insertions(+), 426 deletions(-) diff --git a/meteor/meteor-tests.ts b/meteor/meteor-tests.ts index 05f4f4b31..fa81ec23d 100644 --- a/meteor/meteor-tests.ts +++ b/meteor/meteor-tests.ts @@ -1,4 +1,4 @@ -/// +/// /** * All code below was copied from the examples at http://docs.meteor.com/. @@ -124,7 +124,7 @@ Meteor.methods({ var you_want_to_throw_an_error = true; if (you_want_to_throw_an_error) - throw new Meteor.Error(404, "Can't find my pants"); + throw new Meteor.Error("404", "Can't find my pants"); return "some return value"; }, @@ -376,7 +376,7 @@ Accounts.ui.config({ Accounts.validateNewUser(function (user) { if (user.username && user.username.length >= 3) return true; - throw new Meteor.Error(403, "Username must have at least 3 characters"); + throw new Meteor.Error("403", "Username must have at least 3 characters"); }); // Validate username, without a specific error message. Accounts.validateNewUser(function (user) { @@ -530,13 +530,6 @@ Meteor.methods({ // Let other method calls from the same client start running, // without waiting for the email sending to complete. this.unblock(); - - Email.send({ - to: to, - from: from, - subject: subject, - text: text - }); } }); @@ -561,3 +554,9 @@ Blaze.toHTMLWithData(testTemplate, {test: 1}); Blaze.toHTMLWithData(testTemplate, function() {}); Blaze.toHTMLWithData(testView, {test: 1}); Blaze.toHTMLWithData(testView, function() {}); + +var reactiveVar1 = new ReactiveVar('test value'); +var reactiveVar2 = new ReactiveVar('test value', function(oldVal) { return true; }); + +var varValue: string = reactiveVar1.get(); +reactiveVar1.set('new value'); \ No newline at end of file diff --git a/meteor/meteor.d.ts b/meteor/meteor.d.ts index 48fa3266c..7049e02f9 100644 --- a/meteor/meteor.d.ts +++ b/meteor/meteor.d.ts @@ -1,19 +1,93 @@ -// Type definitions for Meteor 0.9.1 -// Project: http://www.meteor.com/ -// Definitions by: Dave Allen -// Definitions: https://github.com/borisyankov/DefinitelyTyped +/** + * + * Meteor definitions for TypeScript + * author - Olivier Refalo - orefalo@yahoo.com + * author - David Allen - dave@fullflavedave.com + * + * Thanks to Sam Hatoum for the base code for auto-generating this file. + * + * supports Meteor 1.0.2.1 + * + */ /** - * These are the modules and interfaces that can't be automatically generated from the Meteor api.js file + * These are the modules and interfaces that can't be automatically generated from the Meteor data.js file */ + +interface EJSON extends JSON {} +interface Template { + [templateName: string]: Meteor.Template; +} + +declare module Match { + var Any; + var String; + var Integer; + var Boolean; + var undefined; + //function null(); // not allowed in TypeScript + var Object; + function Optional(pattern):boolean; + function ObjectIncluding(dico):boolean; + function OneOf(...patterns); + function Where(condition); +} + declare module Meteor { - interface EJSONObject extends Object {} + //interface EJSONObject extends Object {} + + /** Start definitions for Template **/ + // DA: "Template" needs to support these functions: + // Template..rendered + // Template..created + // Template..destroyed + // Template..helpers + // Template..events + // and + // Template.currentData + // Template.parentData, etc. + + interface Event { + type:string; + target:HTMLElement; + currentTarget:HTMLElement; + which: number; + stopPropagation():void; + stopImmediatePropagation():void; + preventDefault():void; + isPropagationStopped():boolean; + isImmediatePropagationStopped():boolean; + isDefaultPrevented():boolean; + } + + interface EventHandlerFunction extends Function { + (event?:Meteor.Event):any; + } + + interface EventMap { + [id:string]:Meteor.EventHandlerFunction; + } + + // Same definition as top-level Template Interface + interface TemplateBase { + [templateName: string]: Meteor.Template; + } + + interface Template { + rendered: Function; + created: Function; + destroyed: Function; + events(eventMap:Meteor.EventMap): void; + helpers(helpers:{[id:string]: any}): void; + } + /** End definitions for Template **/ interface LoginWithExternalServiceOptions { requestPermissions?: string[]; requestOfflineToken?: Boolean; forceApprovalPrompt?: Boolean; userEmail?: string; + loginStyle?: string; } function loginWithMeteorDeveloperAccount(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; @@ -43,14 +117,6 @@ declare module Meteor { ready(): boolean; } - interface TemplateBase { - [templateName: string]: Meteor.Template; - } - - interface RenderedTemplate extends Object {} - - interface DataContext extends Object {} - interface Tinytest { add(name:string, func:Function); addAsync(name:string, func:Function); @@ -81,31 +147,32 @@ declare module Meteor { verifyEmail: Meteor.EmailFields; } - interface AccountsBase { - EmailTemplates: { - from: string; - siteName: string; - resetPassword: Meteor.EmailFields; - enrollAccount: Meteor.EmailFields; - verifyEmail: Meteor.EmailFields; - } - loginServicesConfigured(): boolean; + interface Error { + error: number; + reason?: string; + details?: string; } - interface MatchBase { - Any; - String; - Integer; - Boolean; - undefined; - null; - Object; - Optional(pattern):boolean; - ObjectIncluding(dico):boolean; - OneOf(...patterns); - Where(condition); + interface Connection { + id: string; + close: Function; + onClose: Function; + clientAddress: string; + httpHeaders: Object; } +} +declare module Mongo { + interface Selector extends Object {} + interface Modifier {} + interface SortSpecifier {} + interface FieldSpecifier { + [id: string]: Number; + } + enum IdGenerationEnum { + STRING, + MONGO + } interface AllowDenyOptions { insert?: (userId:string, doc) => boolean; update?: (userId, doc, fieldNames, modifier) => boolean; @@ -113,95 +180,9 @@ declare module Meteor { fetch?: string[]; transform?: Function; } - - interface Error { - error: number; - reason?: string; - details?: string; - } -} - -declare module Mongo { - interface CollectionFieldSpecifier { - [id: string]: Number; - } - - enum CollectionIdGenerationEnum { - STRING, - MONGO - } - -// interface CollectionOptions { -// connection: Object; -// idGeneration: Mongo.CollectionIdGenerationEnum; -// transform?: (document)=>any; -// } -// -// function Collection(name:string, options?: Mongo.CollectionOptions) : void; -} - -declare module Tracker { - function Computation(): void; - interface Computation { - - } - function Dependency(): void; - interface Dependency { - changed(): void; - depend(fromComputation: Tracker.Computation): boolean; - hasDependents(): boolean; - } -} - -declare module Package { - function describe(metadata:PackageDescribeAPI); - function on_use(func:{(api:Api, where?:string[]):void}); - function on_use(func:{(api:Api, where?:string):void}); - function on_test(func:{(api:Api):void}) ; - function register_extension(extension:string, options:PackageRegisterExtensionOptions); - interface PackageRegisterExtensionOptions {(bundle:Bundle, source_path:string, serve_path:string, where?:string[]):void} - interface PackageDescribeAPI { - summary: string; - } - interface Api { - export(variable:string); - export(variables:string[]); - use(deps:string, where?:string[]); - use(deps:string, where?:string); - use(deps:string[], where?:string[]); - use(deps:string[], where?:string); - add_files(file:string, where?:string[]); - add_files(file:string, where?:string); - add_files(file:string[], where?:string[]); - add_files(file:string[], where?:string); - imply(package:string); - imply(packages:string[]); - } - interface BundleOptions { - type: string; - path: string; - data: any; - where: string[]; - } - interface Bundle { - add_resource(options:BundleOptions); - error(diagnostics:string); - } -} - -declare module Npm { - function require(module:string); - function depends(dependencies:{[id:string]:string}); } declare module HTTP { - enum HTTPMethodEnum { - GET, - POST, - PUT, - DELETE - } - interface HTTPRequest { content?:string; data?:any; @@ -259,6 +240,8 @@ declare module DDP { } declare module Random { + function id(numberOfChars?: number): string; + function secret(numberOfChars?: number): string; function fraction():number; function hexString(numberOfDigits:number):string; // @param numberOfDigits, @returns a random hex string of the given length function choice(array:any[]):string; // @param array, @return a random element in array @@ -292,339 +275,428 @@ declare module Blaze { /** * These modules and interfaces are automatically generated from the Meteor api.js file */ -declare module Meteor { - var isClient: boolean; - var isServer: boolean; - var isCordova: boolean; - function startup(func: Function): void; - function wrapAsync(func: Function, context?: Object): any; - function absoluteUrl(path?: string, options?: { - secure?: Boolean; - replaceLocalhost?: Boolean; - rootUrl?: string; - }): string; - var settings: {[id:string]: any}; - var release: string; - function publish(name: string, func: Function): void; - function subscribe(name, ...args): SubscriptionHandle; - function methods(methods: Object): void; - function Error(error, reason?, details?): void; - function call(name: string, ...params): void; - function apply(name: string, params, options?: { - wait?: Boolean; - onResultReceived?: Function; - }, asyncCallback?): void; - function status(): Meteor.StatusEnum; - function reconnect(): void; - function disconnect(): void; - function onConnection(callback: Function): void; - function user(): Meteor.User; - function userId(): string; - var users: Mongo.Collection; - function loggingIn(): boolean; - function logout(callback?: Function): void; - function logoutOtherClients(callback?: Function): void; - function loginWithPassword(user: any, password: string, callback?: Function): void; - function loginWithExternalService(options?: { - requestPermissions?: string[]; - requestOfflineToken?: Boolean; - forceApprovalPrompt?: Boolean; - userEmail?: string; - loginStyle?: string; - }, callback?: Function): void; - function setTimeout(func: Function, delay: number): number; - function setInterval(func: Function, delay: number): number; - function clearTimeout(id: number): void; - function clearInterval(id: number): void; - function EnvironmentVariable(): void; - function get(): string; - function withValue(value: any, func: Function): void; - function bindEnvironment(func: Function, onException: Function, _this: Object): Function; +declare module Accounts { + var ui: { + config(options: { + requestPermissions?: Object; + requestOfflineToken?: Object; + forceApprovalPrompt?: Object; + passwordSignupFields?: string; + }): void; + }; + var emailTemplates: Meteor.EmailTemplates; + function config(options: { + sendVerificationEmail?: boolean; + forbidClientAccountCreation?: Boolean; + restrictCreationByEmailDomain?: string; + loginExpirationInDays?: number; + oauthSecretKey?: string; + }): void; + function validateLoginAttempt(func: Function): {stop: Function}; + function onLogin(func: Function): {stop: Function}; + function onLoginFailure(func: Function): {stop: Function}; + function onCreateUser(func: Function): void; + function validateNewUser(func: Function): void; + function onResetPasswordLink(callback: Function): void; + function onEmailVerificationLink(callback: Function): void; + function onEnrollmentLink(callback: Function): void; + function createUser(options: { + username?: string; + email?: string; + password?: string; + profile?: Object; + }, callback?: Function): string; + function changePassword(oldPassword: string, newPassword: string, callback?: Function): void; + function forgotPassword(options: { + email?: string; + }, callback?: Function): void; + function resetPassword(token: string, newPassword: string, callback?: Function): void; + function verifyEmail(token: string, callback?: Function): void; + function setPassword(userId: string, newPassword: string): void; + function sendResetPasswordEmail(userId: string, email?: string): void; + function sendEnrollmentEmail(userId: string, email?: string): void; + function sendVerificationEmail(userId: string, email?: string): void; } -declare module Meteor { - interface EJSON { - parse(str: string): EJSON; - stringify(val: Meteor.EJSON, options?: { - indent?: any; // boolean, integer, or string - canonical?: Boolean; - }): string; - fromJSONValue(val: JSON): any; - toJSONValue(val: Meteor.EJSON): JSON; - equals(a: Meteor.EJSONObject, b: Meteor.EJSONObject, options?: { - keyOrderSensitive?: Boolean; - }): boolean; - clone(v:T): T; /** TODO: add return value **/ - newBinary(size: number): any; - isBinary(x): boolean; - addType(name: string, factory: Function): void; +declare module Blaze { + var currentView: Blaze.View; + function With(data: Object, contentFunc: Function): Blaze.View; + function With(data: Function, contentFunc: Function): Blaze.View; + function If(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View; + function Unless(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View; + function Each(argFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View; + function isTemplate(value: any): boolean; + function render(templateOrView: Template, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; + function render(templateOrView: Blaze.View, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; + function renderWithData(templateOrView: Template, data: Object, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; + function renderWithData(templateOrView: Template, data: Function, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; + function renderWithData(templateOrView: Blaze.View, data: Object, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; + function renderWithData(templateOrView: Blaze.View, data: Function, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; + function remove(renderedView: Blaze.View): void; + function toHTML(templateOrView: Template): string; + function toHTML(templateOrView: Blaze.View): string; + function toHTMLWithData(templateOrView: Template, data: Object): string; + function toHTMLWithData(templateOrView: Template, data: Function): string; + function toHTMLWithData(templateOrView: Blaze.View, data: Object): string; + function toHTMLWithData(templateOrView: Blaze.View, data: Function): string; + function getData(elementOrView?: HTMLElement): Object; + function getData(elementOrView?: Blaze.View): Object; + function getView(element?: HTMLElement): Blaze.View; + function Template(viewName?: string, renderFunction?: Function): void; + function TemplateInstance(view: Blaze.View): void; + interface TemplateInstance { + data(): Object; + view(): Object; + firstNode(): Object; + lastNode(): Object; + $(selector: string): Node[]; + findAll(selector: string): HTMLElement[]; + find(selector?: string): HTMLElement; + autorun(runFunc: Function): Object; } + + function View(name?: string, renderFunction?: Function): void; +} + +declare module Match { + function test(value: any, pattern: any): boolean; } declare module DDP { function connect(url: string): DDP.DDPStatic; } +declare module EJSON { + var newBinary: any; + function addType(name: string, factory: Function): void; + function toJSONValue(val: EJSON): JSON; + function fromJSONValue(val: JSON): any; + function stringify(val: EJSON, options?: { + indent?: boolean; + canonical?: Boolean; + }): string; + function parse(str: string): EJSON; + function isBinary(x: Object): boolean; + function equals(a: EJSON, b: EJSON, options?: { + keyOrderSensitive?: boolean; + }): boolean; + function clone(val:T): T; + function CustomType(): void; + interface CustomType { + typeName(): string; + toJSONValue(): JSON; + clone(): EJSON.CustomType; + equals(other: Object): boolean; + } + +} + +declare module Meteor { + var users: Mongo.Collection; + var isClient: boolean; + var isServer: boolean; + var settings: {[id:string]: any}; + var isCordova: boolean; + var release: string; + function userId(): string; + function loggingIn(): boolean; + function user(): Meteor.User; + function logout(callback?: Function): void; + function logoutOtherClients(callback?: Function): void; + function loginWith(options?: { + requestPermissions?: string[]; + requestOfflineToken?: boolean; + forceApprovalPrompt?: Boolean; + userEmail?: string; + loginStyle?: string; + }, callback?: Function): void; + function loginWithPassword(user: Object, password: string, callback?: Function): void; + function loginWithPassword(user: string, password: string, callback?: Function): void; + function subscribe(name: string, ...args): SubscriptionHandle; + function subscribe(name: string, ...args): SubscriptionHandle; + function call(name: string, ...args): void; + function apply(name: string, args: EJSON[], options?: { + wait?: boolean; + onResultReceived?: Function; + }, asyncCallback?: Function): void; + function status(): Meteor.StatusEnum; + function reconnect(): void; + function disconnect(): void; + function onConnection(callback: Function): void; + function publish(name: string, func: Function): void; + function methods(methods: Object): void; + function wrapAsync(func: Function, context?: Object): any; + function startup(func: Function): void; + function setTimeout(func: Function, delay: number): number; + function setInterval(func: Function, delay: number): number; + function clearInterval(id: number): void; + function clearTimeout(id: number): void; + function absoluteUrl(path?: string, options?: { + secure?: boolean; + replaceLocalhost?: Boolean; + rootUrl?: string; + }): string; + function Error(error: string, reason?: string, details?: string): void; +} + declare module Mongo { function Collection(name: string, options?: { - connection?: Object; - idGeneration?: Mongo.CollectionIdGenerationEnum; - transform?: (document)=>any; - }): void; - function ObjectID(hexString: string): void; -} - -declare module Mongo { + connection?: Object; + idGeneration?: string; + transform?: Function; + }): void; interface Collection { - find(selector?: any, options?: { - sort?: any; - skip?: number; - limit?: number; - fields?: Mongo.CollectionFieldSpecifier; - reactive?: Boolean; - transform?: (document)=>any; - }): Mongo.Cursor; - findOne(selector?: any, options?: { - sort?: any; - skip?: number; - fields?: Mongo.CollectionFieldSpecifier; - reactive?: Boolean; - transform?: (document)=>any; - }): Meteor.EJSONObject; - insert(doc: Object, callback?: Function): string; - update(selector: any, modifier: any, options?: { - multi?: Boolean; - upsert?: Boolean; - }, callback?: Function): number; - upsert(selector: any, modifier: any, options?: { - multi?: Boolean; - }, callback?: Function): {numberAffected?: number; insertedId?: string;}; - remove(selector: any, callback?: Function): void; - allow(options: Meteor.AllowDenyOptions): boolean; - deny(options: Meteor.AllowDenyOptions): boolean; + insert(doc: Object, callback?: Function): string; + update(selector: Mongo.Selector, modifier: Mongo.Modifier, options?: { + multi?: boolean; + upsert?: Boolean; + }, callback?: Function): number; + find(selector?: Mongo.Selector, options?: { + sort?: Mongo.SortSpecifier; + skip?: number; + limit?: number; + fields?: Mongo.FieldSpecifier; + reactive?: boolean; + transform?: Function; + }): Mongo.Cursor; + findOne(selector?: Mongo.Selector, options?: { + sort?: Mongo.SortSpecifier; + skip?: number; + fields?: Mongo.FieldSpecifier; + reactive?: boolean; + transform?: Function; + }): T; + remove(selector: Mongo.Selector, callback?: Function): void; + upsert(selector: Mongo.Selector, modifier: Mongo.Modifier, options?: { + multi?: boolean; + }, callback?: Function): {numberAffected?: number; insertedId?: string;}; + allow(options: { + insert?: (userId:string, doc) => boolean; + update?: (userId, doc, fieldNames, modifier) => boolean; + remove?: (userId, doc) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + deny(options: { + insert?: (userId:string, doc) => boolean; + update?: (userId, doc, fieldNames, modifier) => boolean; + remove?: (userId, doc) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; } -} -declare module Mongo { + function ObjectID(hexString: string): void; + function Cursor(): void; interface Cursor { - count(): number; - fetch(): any[]; - forEach(callback: Function, thisArg?: any): void; + forEach(callback: Function, thisArg?: any): void; map(callback: Function, thisArg?: any): void; + fetch(): Array; + count(): number; observe(callbacks: Object): Meteor.LiveQueryHandle; observeChanges(callbacks: Object): Meteor.LiveQueryHandle; } -} -declare module Random { - function id(): string; } declare module Tracker { - function autorun(runFunc: Function): Tracker.Computation; - function flush(): void; - function nonreactive(func: Function): void; var active: boolean; var currentComputation: Tracker.Computation; + function Computation(): void; + interface Computation { + stopped(): boolean; + invalidated(): boolean; + firstRun(): boolean; + onInvalidate(callback: Function): void; + invalidate(): void; + stop(): void; + } + + function flush(): void; + function autorun(runFunc: Function): Tracker.Computation; + function nonreactive(func: Function): void; function onInvalidate(callback: Function): void; function afterFlush(callback: Function): void; -} - -declare module Tracker { - interface Computation { - stop(): void; - invalidate(): void; - onInvalidate(callback: Function): void; - stopped: boolean; - invalidated: boolean; - firstRun: boolean; - } -} - -declare module Tracker { + function Dependency(): void; interface Dependency { + depend(fromComputation?: Tracker.Computation): boolean changed(): void; - depend(fromComputation?: Tracker.Computation): boolean; - hasDependents(): boolean; + hasDependents(): boolean } -} -declare module Meteor { - interface Accounts extends Meteor.AccountsBase { - config(options: { - sendVerificationEmail?: Boolean; - forbidClientAccountCreation?: Boolean; - restrictCreationByEmailDomain?: any; // string or Function - loginExpirationInDays?: number; - oauthSecretKey?: string; - }): void; - ui: { - config(options: { - requestPermissions?: Object; - requestOfflineToken?: Object; - forceApprovalPrompt?: Boolean; - passwordSignupFields?: string; - }); /** TODO: add return value **/ - } - validateNewUser(func: Function): void; - onCreateUser(func: Function): void; - validateLoginAttempt(func: Function); /** TODO: add return value **/ - onLogin(func: Function); /** TODO: add return value **/ - onLoginFailure(func: Function); /** TODO: add return value **/ - createUser(options: { - username?: string; - email?: string; - password?: string; - profile?: Object; - }, callback?: Function): string; - changePassword(oldPassword: string, newPassword: string, callback?: Function): void; - forgotPassword(options: { - email?: string; - }, callback?: Function): void; - resetPassword(token: string, newPassword: string, callback?: Function): void; - setPassword(userId: string, newPassword: string): void; - verifyEmail(token: string, callback?: Function): void; - sendResetPasswordEmail(userId: string, email?: string): void; - sendEnrollmentEmail(userId: string, email?: string): void; - sendVerificationEmail(userId: string, email?: string): void; - emailTemplates: Meteor.EmailTemplates; - } -} - -declare module Meteor { - interface Match extends Meteor.MatchBase { - test(value: any, pattern: any): boolean; - } -} - -declare module Meteor { - interface Session { - set(key: string, value: any): void; - setDefault(key: string, value: any): void; - get(key: string): any; - equals(key: string, value: any): boolean; - } -} - -declare module HTTP { - function call(method: string, url, options?: { - content?: string; - data?: Object; - query?: string; - params?: Object; - auth?: string; - headers?: Object; - timeout?: number; - followRedirects?: Boolean; - }, asyncCallback?): HTTP.HTTPResponse; - function get(url, options?: { - }, asyncCallback?): HTTP.HTTPResponse; - function post(url, options?: { - }, asyncCallback?): HTTP.HTTPResponse; - function put(url, options?: { - }, asyncCallback?): HTTP.HTTPResponse; - function del(url, options?: { - }, asyncCallback?): HTTP.HTTPResponse; -} - -declare module Meteor { - interface Template { - rendered: Function; - created: Function; - destroyed: Function; - events(eventMap: {[id:string]: Function}): void; - helpers(helpers: Object): void; - findAll(selector: string); /** TODO: add return value **/ - $(selector: string); /** TODO: add return value **/ - find(selector?: string); /** TODO: add return value **/ - firstNode; /** TODO: add return value **/ - lastNode; /** TODO: add return value **/ - data; /** TODO: add return value **/ - autorun(runFunc: Function); /** TODO: add return value **/ - view; /** TODO: add return value **/ - registerHelper(name: string, func: Function); /** TODO: add return value **/ - body; /** TODO: add return value **/ - currentData(); /** TODO: add return value **/ - instance(); /** TODO: add return value **/ - parentData(numLevels: number); /** TODO: add return value **/ - } -} - -declare module Blaze { - function render(templateOrView: any, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; - function renderWithData(templateOrView: any, data: any, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; - function remove(renderedView: Blaze.View): void; - function With(data: any, contentFunc: Function); /** TODO: add return value **/ - function If(conditionFunc: Function, contentFunc: Function, elseFunc?: Function); /** TODO: add return value **/ - function Unless(conditionFunc: Function, contentFunc: Function, elseFunc?: Function); /** TODO: add return value **/ - function Each(argFunc: Function, contentFunc: Function, elseFunc?: Function); /** TODO: add return value **/ - function getData(elementOrView?: any); /** TODO: add return value **/ - var currentView; /** TODO: add return value **/ - function getView(element?: HTMLElement); /** TODO: add return value **/ - function toHTML(templateOrView: any): string; - function toHTMLWithData(templateOrView: any, data: any): string; - function View(name?: string, renderFunction?: Function): void; - function Template(viewName?: string, renderFunction?: Function): void; - function isTemplate(value: any): boolean; -} - -declare module Meteor { - interface ReactiveVar { - get(); /** TODO: add return value **/ - set(newValue: any); /** TODO: add return value **/ - } -} - -declare module Email { - function send(options: { - from?: string; - to?: any; // string or string[] - cc?: any; // string or string[] - bcc?: any; // string or string[] - replyTo?: any; // string or string[] - subject?: string; - text?: string; - html?: string; - headers?: Object; - }): void; } declare module Assets { function getText(assetPath: string, asyncCallback?: Function): string; - function getBinary(assetPath: string, asyncCallback?: Function): Meteor.EJSON; + function getBinary(assetPath: string, asyncCallback?: Function): EJSON; } -declare module Meteor { - interface Package { - describe(options: { - summary?: string; - version?: string; - name?: string; - git?: string; - }); /** TODO: add return value **/ - onUse(f: Function); /** TODO: add return value **/ - onTest(f: Function); /** TODO: add return value **/ - describe(options: { - }); /** TODO: add return value **/ - } +declare module App { + function info(options: { + id?: string; + version?: string; + name?: string; + description?: string; + author?: string; + email?: string; + website?: string; + }): void; + function setPreference(name: string, value: string): void; + function configurePlugin(pluginName: string, config: Object): void; + function icons(icons: Object): void; + function launchScreens(launchScreens: Object): void; } -declare module Meteor { - interface Api { - use(packageNameAndVersion?: string, architecture?: string, options?: { - weak?: Boolean; - unordered?: Boolean; - }); /** TODO: add return value **/ - versionsFrom(meteorversion: string); /** TODO: add return value **/ - imply(packagespecOrpackagespecs: any); /** TODO: add return value **/ - export(exportedObject: string, architecture?: string); /** TODO: add return value **/ - addFiles(filenameOrfilenames: any); /** TODO: add return value **/ - } +declare module Package { + function describe(options: { + summary?: string; + version?: string; + name?: string; + git?: string; + }): void; + function onUse(func: Function): void; + function onTest(func: Function): void; + function registerBuildPlugin(options?: { + name?: string; + use?: string; + sources?: string[]; + npmDependencies?: Object; + }): void; +} + +declare module Npm { + function depends(dependencies:{[id:string]:string}): void; + function require(name: string): void; +} + +declare module Cordova { + function depends(dependencies:{[id:string]:string}): void; +} + +declare module Session { + function set(key: string, value: EJSON): void; + function set(key: string, value: any /** Undefined **/): void; + function setDefault(key: string, value: EJSON): void; + function setDefault(key: string, value: any /** Undefined **/): void; + function get(key: string): any; + function equals(key: string, value: string): boolean; + function equals(key: string, value: number): boolean; + function equals(key: string, value: boolean): boolean; + function equals(key: string, value: any /** Null **/): boolean; + function equals(key: string, value: any /** Undefined **/): boolean; +} + +declare module HTTP { + function call(method: string, url: string, options?: { + content?: string; + data?: Object; + query?: string; + params?: Object; + auth?: string; + headers?: Object; + timeout?: number; + followRedirects?: boolean; + }, asyncCallback?: Function): HTTP.HTTPResponse; + function get(url: string, callOptions?: Object, asyncCallback?: Function): HTTP.HTTPResponse; + function post(url: string, callOptions?: Object, asyncCallback?: Function): HTTP.HTTPResponse; + function put(url: string, callOptions?: Object, asyncCallback?: Function): HTTP.HTTPResponse; + function del(url: string, callOptions?: Object, asyncCallback?: Function): HTTP.HTTPResponse; +} + +declare module Email { + function send(options: { + from?: string; + to?: string; + cc?: string; + bcc?: string; + replyTo?: string; + subject?: string; + text?: string; + html?: string; + headers?: Object; + }): void; +} + +declare function Subscription(): void; +declare module Subscription { + var connection: Meteor.Connection; + var userId: string; + function error(error: Error): void; + function stop(): void; + function onStop(func: Function): void; + function added(collection: string, id: string, fields: Object): void; + function changed(collection: string, id: string, fields: Object): void; + function removed(collection: string, id: string): void; + function ready(): void; +} + +declare function ReactiveVar(initialValue: any, equalsFunc?: (oldVal:any, newVal:any)=>boolean): void; +declare module ReactiveVar { + function get(): any; + function set(newValue: any): void; +} + +declare function Template(): void; +declare module Template { + var created: Function; + var rendered: Function; + var destroyed: Function; + var body: Meteor.TemplateBase; + function helpers(helpers:{[id:string]: any}): void; + function events(eventMap: {[actions: string]: Function}): void; + function instance(): Blaze.TemplateInstance; + function currentData(): {}; + function parentData(numLevels?: number): {}; + function registerHelper(name: string, func: Function): void; +} + +declare function CompileStep(): void; +declare module CompileStep { + var inputSize; /** TODO: add return value **/ + var inputPath; /** TODO: add return value **/ + var fullInputPath; /** TODO: add return value **/ + var pathForSourceMap; /** TODO: add return value **/ + var packageName; /** TODO: add return value **/ + var rootOutputPath; /** TODO: add return value **/ + var arch; /** TODO: add return value **/ + var fileOptions; /** TODO: add return value **/ + var declaredExports; /** TODO: add return value **/ + function read(n?: number); /** TODO: add return value **/ + function addHtml(options: { + section?: string; + data?: string; + }); /** TODO: add return value **/ + function addStylesheet(options: { + }, path: string, data: string, sourceMap: string); /** TODO: add return value **/ + function addJavaScript(options: { + path?: string; + data?: string; + sourcePath?: string; + }); /** TODO: add return value **/ + function addAsset(options: { + }, path: string, data: any /** Buffer **/); /** TODO: add return value **/ + function addAsset(options: { + }, path: string, data: string); /** TODO: add return value **/ + function error(options: { + }, message: string, sourcePath?: string, line?: number, func?: string); /** TODO: add return value **/ +} + +declare function PackageAPI(): void; +declare module PackageAPI { + function use(packageNames: string, architecture?: string, options?: { + weak?: boolean; + unordered?: Boolean; + }): void; + function use(packageNames: string[], architecture?: string, options?: { + weak?: boolean; + unordered?: Boolean; + }): void; + function imply(packageSpecs: string): void; + function imply(packageSpecs: string[]): void; + function addFiles(filename: string, architecture?: string): void; + function addFiles(filename: string[], architecture?: string): void; + function versionsFrom(meteorRelease: string): void; + function versionsFrom(meteorRelease: string[]): void; + // function export(exportedObject: string, architecture?: string): void; } -declare var Template: Meteor.TemplateBase; -declare var Session: Meteor.Session; -declare var Accounts: Meteor.Accounts; -declare var Match: Meteor.Match; -declare var EJSON: Meteor.EJSON; -declare var Tinytest: Meteor.Tinytest; From 80f606d5dbf6c10b7cc3738ac7a75ded6ae4e9fe Mon Sep 17 00:00:00 2001 From: Dave Allen Date: Fri, 9 Jan 2015 15:44:03 -0800 Subject: [PATCH 2/5] Updated Readme with indication that the definitions are for Meteor 1.0.2.1. Will update rest of Readme soon. --- meteor/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meteor/README.md b/meteor/README.md index 601787e02..286d20a49 100644 --- a/meteor/README.md +++ b/meteor/README.md @@ -1,9 +1,11 @@ # Meteor Type Definitions -These are the definitions for version 0.9.1 of Meteor. Although these definitions can be downloaded separately for use, the recommended way to use these +These are the definitions for version 1.0.2.1 of Meteor. This readme will be updated soon. + +Although these definitions can be downloaded separately for use, the recommended way to use these definitions in a Meteor application is by installing the [typescript-libs](https://atmosphere.meteor.com/package/typescript-libs) Meteor smart package. The smart package contains TypeScript definitions forMeteor, common third-party libraries (e.g. jquery, underscore, d3 etc.), and common smart packages -(e.g. iron-router). +(e.g. iron-router, underscore, d3, etc.). From within any Meteor application that is version 0.9.0 or later, install this package in the standard manner: From 25de4289ef324e08b7f5ddc31d2dd2e151f13942 Mon Sep 17 00:00:00 2001 From: Dave Allen Date: Thu, 22 Jan 2015 15:35:30 -0800 Subject: [PATCH 3/5] Updated for Meteor 1.0.3.1 --- meteor/README.md | 111 ++++++++++++++++++++++++++++----------------- meteor/meteor.d.ts | 77 +++++++++++-------------------- 2 files changed, 97 insertions(+), 91 deletions(-) diff --git a/meteor/README.md b/meteor/README.md index 286d20a49..4bd829d86 100644 --- a/meteor/README.md +++ b/meteor/README.md @@ -1,11 +1,11 @@ # Meteor Type Definitions -These are the definitions for version 1.0.2.1 of Meteor. This readme will be updated soon. +These are the definitions for version 1.0.3.1 of Meteor. Although these definitions can be downloaded separately for use, the recommended way to use these definitions in a Meteor application is by installing the [typescript-libs](https://atmosphere.meteor.com/package/typescript-libs) Meteor smart package. The smart package contains TypeScript definitions forMeteor, common third-party libraries (e.g. jquery, underscore, d3 etc.), and common smart packages -(e.g. iron-router, underscore, d3, etc.). +(e.g. iron-router, etc). From within any Meteor application that is version 0.9.0 or later, install this package in the standard manner: @@ -13,28 +13,42 @@ From within any Meteor application that is version 0.9.0 or later, install this -## Usage Overview -For most applications, there are 4 specific steps you will have to take to write your Meteor application in TypeScript using this package: +## Usage -1. [Reference the definitions] (#usage-type-definition-references) -2. [Declare functions for Templates in a special way] (#usage-templates) -3. [Declare Collections in a special way] (#usage-collections) -4. [Create custom definitions for code you write] (#usage-creating-definitions) -5. [Transpile your .ts files into .js files] (#usage-transpilation) +1. Add a symbolic link to the definitions from within some directory within your project (e.g. ".typescript" or "lib"). The definitions can be found somewhere +deep within `/.meteor/...`. The following will probably work: + + $ ln -s ../.meteor/local/build/programs/server/assets/packages/meteortypescript_typescript-libs/definitions package_defs + If the definitions can't be found within the .meteor directory, you will have to manually pull down the definitions from github and add them to your project: + -## Usage: Type Definition References -Within any TypeScript file, you can reference the Meteor definition file with this line: +2. Install the [Typescript compiler for Meteor](https://github.com/meteor-typescript/meteor-typescript-compiler) or an [IDE which can transpile TypeScript to JavaScript](#transpiling-typescript). +3. From the typescript files, add references. Reference the definition files with a single line: - /// + /// (substitute path in your project) + Or you can reference definition files individually: -## Usage: Templates -When specifying template functions, you will need to use "bracket notation" instead of "dot notation": + /// (substitue path in your project) + /// + /// - Template['myTemplateName']['rendered'] = function ( ) { ... } +4. Be aware of differences in coding styles when using TypeScript (see below) + + +## TypeScript/Meteor coding style + +### References + +Try to stay away from referencing *file.ts*, rather generate a *file.d.ts* using `tsc --reference file.ts`, and reference it in your file. Compilation will +be much faster and code cleaner - it's always better to split definition from implemention. + +### Templates + +When specifying template *helpers*, *events*, and functions for *created*, *rendered*, and *destroyed*, you will need to use a "bracket notation" instead of the "dot notation": Template['myTemplateName']['helpers']({ foo: function () { @@ -42,21 +56,28 @@ When specifying template functions, you will need to use "bracket notation" inst } }); - Template['myTemplateName']['foo'] = function () { - return Session.get("foo"); - }; + Template['myTemplateName']['rendered'] = function ( ) { ... } +This is because TypeScript enforces typing and it will throw an error saying "myTemplateName" does not exist when using the dot notation. -For "dot" notation, TypeScript requires properties be specified on a variable (but not for bracket notation), and it will throw an error saying "myTemplateName" -does not exist on Template. +### Accessing a Form field +Trying to read a form field value? use `(evt.target).value`. +### Global variables -## Usage: Collections -The majority of extra work required to use TypeScript with Meteor is creating and maintaining the collection interfaces. However, doing so also provides the +Preface any global variable declarations with a TypeScript "declare var" statement: + + declare var NavbarHelpers; + NavbarHelpers = {}; + NavbarHelpers.someMethod = function() {...} + +### Collections + +The majority of extra work required to use TypeScript with Meteor is creating and maintaining the collection interfaces. However, doing so also provides the additional benefit of succinctly documenting collection schema definitions (that are actually enforced). -To define collections, you will need to create an interface representing the collection, and then declare a Collection type variable with that interface type (as a generic): +To define collections, you will need to create an interface representing the collection and then declare a Collection type variable with that interface type (as a generic): interface JobDAO { _id?: string; @@ -65,39 +86,47 @@ To define collections, you will need to create an interface representing the col queuedAt?: string; } - declare var Jobs: Meteor.Collection; - Jobs = new Meteor.Collection('jobs'); + declare var Jobs: Mongo.Collection; + Jobs = new Mongo.Collection('jobs'); Finally, any TypeScript file using collections will need to contain a reference at the top pointing to the collection definitions: - /// - /// - /// + /// + /// +### Creating definition files -If you choose to define collections (using the code above) in a separate file (e.g. collections/models/models.ts) and then create a separate file per collection -with the methods and permissions for that collection (e.g. collections/jobs.ts), the collection definitions should be one directory deeper than the collection -method/permission declarations so that Meteor can find the variable declarations before use. (e.g. collections/models/models.ts). - - - -## Usage: Creating Definitions Here is a guide to creating definitions: +If you have lots of custom definitions for a project, you can: +- Create multiple definition files and include individual references to each definition file. +- Create one huge monolithic definition file so you only have to refer to that file. +- Create multiple definition files, and create a definition file with references to the other definitions files so that you only have to maintain one reference +for all of you custom definitions. e.g. contents of ".typescript/custom_defs/custom-definitions.d.ts": -## Usage: Transpilation -WebStorm is good TypeScript-aware editor. It can automatically transpile your TypeScript code into JavaScript every time you save a file. To enable this + /// + /// + /// + /// + + +## Transpiling TypeScript + +### Meteor plugin +One solution for transpiling typescript is to install the following meteor package [https://github.com/meteor-typescript/meteor-typescript-compiler](https://github.com/meteor-typescript/meteor-typescript-compiler) + +### IDE/Editor Transpilation +WebStorm is a good TypeScript-aware editor. It can automatically transpile your TypeScript code into JavaScript every time you save a file. To enable this feature in WebStorm on OSX, first install the TypeScript transpiler on your system: $ [sudo -H] npm install -g typescript Then, within WebStorm, go to Preferences -> File Watchers -> "+" symbol and add TypeScript. -If you are not using a TypeScript-aware editor, you can transpile the files using the [Meteor Typescript Compiler](https://github.com/orefalo/meteor-typescript-compiler). +### Command line +Last option, is to compile code from the command line. With node and the typescript compiler installed: - -## Example/Reference Projects -* [TypeScript demos](https://github.com/orefalo/meteor-typescript-demos) + $ tsc *.ts \ No newline at end of file diff --git a/meteor/meteor.d.ts b/meteor/meteor.d.ts index 7049e02f9..f640d0f17 100644 --- a/meteor/meteor.d.ts +++ b/meteor/meteor.d.ts @@ -288,7 +288,7 @@ declare module Accounts { function config(options: { sendVerificationEmail?: boolean; forbidClientAccountCreation?: Boolean; - restrictCreationByEmailDomain?: string; + restrictCreationByEmailDomain?: string | Function; loginExpirationInDays?: number; oauthSecretKey?: string; }): void; @@ -320,27 +320,17 @@ declare module Accounts { declare module Blaze { var currentView: Blaze.View; - function With(data: Object, contentFunc: Function): Blaze.View; - function With(data: Function, contentFunc: Function): Blaze.View; + function With(data: Object | Function, contentFunc: Function): Blaze.View; function If(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View; function Unless(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View; function Each(argFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View; function isTemplate(value: any): boolean; - function render(templateOrView: Template, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; - function render(templateOrView: Blaze.View, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; - function renderWithData(templateOrView: Template, data: Object, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; - function renderWithData(templateOrView: Template, data: Function, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; - function renderWithData(templateOrView: Blaze.View, data: Object, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; - function renderWithData(templateOrView: Blaze.View, data: Function, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; + function render(templateOrView: Template | Blaze.View, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; + function renderWithData(templateOrView: Template | Blaze.View, data: Object | Function, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; function remove(renderedView: Blaze.View): void; - function toHTML(templateOrView: Template): string; - function toHTML(templateOrView: Blaze.View): string; - function toHTMLWithData(templateOrView: Template, data: Object): string; - function toHTMLWithData(templateOrView: Template, data: Function): string; - function toHTMLWithData(templateOrView: Blaze.View, data: Object): string; - function toHTMLWithData(templateOrView: Blaze.View, data: Function): string; - function getData(elementOrView?: HTMLElement): Object; - function getData(elementOrView?: Blaze.View): Object; + function toHTML(templateOrView: Template | Blaze.View): string; + function toHTMLWithData(templateOrView: Template | Blaze.View, data: Object | Function): string; + function getData(elementOrView?: HTMLElement | Blaze.View): Object; function getView(element?: HTMLElement): Blaze.View; function Template(viewName?: string, renderFunction?: Function): void; function TemplateInstance(view: Blaze.View): void; @@ -372,7 +362,7 @@ declare module EJSON { function toJSONValue(val: EJSON): JSON; function fromJSONValue(val: JSON): any; function stringify(val: EJSON, options?: { - indent?: boolean; + indent?: boolean | number | string; canonical?: Boolean; }): string; function parse(str: string): EJSON; @@ -410,9 +400,7 @@ declare module Meteor { userEmail?: string; loginStyle?: string; }, callback?: Function): void; - function loginWithPassword(user: Object, password: string, callback?: Function): void; - function loginWithPassword(user: string, password: string, callback?: Function): void; - function subscribe(name: string, ...args): SubscriptionHandle; + function loginWithPassword(user: Object | string, password: string, callback?: Function): void; function subscribe(name: string, ...args): SubscriptionHandle; function call(name: string, ...args): void; function apply(name: string, args: EJSON[], options?: { @@ -553,12 +541,13 @@ declare module Package { version?: string; name?: string; git?: string; + documentation?: string; }): void; function onUse(func: Function): void; function onTest(func: Function): void; function registerBuildPlugin(options?: { name?: string; - use?: string; + use?: string | string[]; sources?: string[]; npmDependencies?: Object; }): void; @@ -574,16 +563,10 @@ declare module Cordova { } declare module Session { - function set(key: string, value: EJSON): void; - function set(key: string, value: any /** Undefined **/): void; - function setDefault(key: string, value: EJSON): void; - function setDefault(key: string, value: any /** Undefined **/): void; + function set(key: string, value: EJSON | any /** Undefined **/): void; + function setDefault(key: string, value: EJSON | any /** Undefined **/): void; function get(key: string): any; - function equals(key: string, value: string): boolean; - function equals(key: string, value: number): boolean; - function equals(key: string, value: boolean): boolean; - function equals(key: string, value: any /** Null **/): boolean; - function equals(key: string, value: any /** Undefined **/): boolean; + function equals(key: string, value: string | number | boolean | any /** Null **/ | any /** Undefined **/): boolean; } declare module HTTP { @@ -606,10 +589,10 @@ declare module HTTP { declare module Email { function send(options: { from?: string; - to?: string; - cc?: string; - bcc?: string; - replyTo?: string; + to?: string | string[]; + cc?: string | string[]; + bcc?: string | string[]; + replyTo?: string | string[]; subject?: string; text?: string; html?: string; @@ -638,6 +621,9 @@ declare module ReactiveVar { declare function Template(): void; declare module Template { + var onCreated; /** TODO: add return value **/ + var onRendered; /** TODO: add return value **/ + var onDestroyed; /** TODO: add return value **/ var created: Function; var rendered: Function; var destroyed: Function; @@ -647,7 +633,7 @@ declare module Template { function instance(): Blaze.TemplateInstance; function currentData(): {}; function parentData(numLevels?: number): {}; - function registerHelper(name: string, func: Function): void; + function registerHelper(name: string, helperFunction: Function): void; } declare function CompileStep(): void; @@ -674,29 +660,20 @@ declare module CompileStep { sourcePath?: string; }); /** TODO: add return value **/ function addAsset(options: { - }, path: string, data: any /** Buffer **/); /** TODO: add return value **/ - function addAsset(options: { - }, path: string, data: string); /** TODO: add return value **/ + }, path: string, data: any /** Buffer **/ | string); /** TODO: add return value **/ function error(options: { }, message: string, sourcePath?: string, line?: number, func?: string); /** TODO: add return value **/ } declare function PackageAPI(): void; declare module PackageAPI { - function use(packageNames: string, architecture?: string, options?: { + function use(packageNames: string | string[], architecture?: string, options?: { weak?: boolean; unordered?: Boolean; }): void; - function use(packageNames: string[], architecture?: string, options?: { - weak?: boolean; - unordered?: Boolean; - }): void; - function imply(packageSpecs: string): void; - function imply(packageSpecs: string[]): void; - function addFiles(filename: string, architecture?: string): void; - function addFiles(filename: string[], architecture?: string): void; - function versionsFrom(meteorRelease: string): void; - function versionsFrom(meteorRelease: string[]): void; + function imply(packageSpecs: string | string[]): void; + function addFiles(filename: string | string[], architecture?: string): void; + function versionsFrom(meteorRelease: string | string[]): void; // function export(exportedObject: string, architecture?: string): void; } From aa3c40741ac6c0c56ce47aed0b6cbb9d2946e9d9 Mon Sep 17 00:00:00 2001 From: Dave Allen Date: Thu, 22 Jan 2015 15:43:07 -0800 Subject: [PATCH 4/5] Fixed comment at top of definition file to conform to standards. --- meteor/meteor.d.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/meteor/meteor.d.ts b/meteor/meteor.d.ts index f640d0f17..50386a916 100644 --- a/meteor/meteor.d.ts +++ b/meteor/meteor.d.ts @@ -1,14 +1,7 @@ -/** - * - * Meteor definitions for TypeScript - * author - Olivier Refalo - orefalo@yahoo.com - * author - David Allen - dave@fullflavedave.com - * - * Thanks to Sam Hatoum for the base code for auto-generating this file. - * - * supports Meteor 1.0.2.1 - * - */ +// Type definitions for Meteor 1.0.3.1 +// Project: http://www.meteor.com/ +// Definitions by: Dave Allen +// Definitions: https://github.com/borisyankov/DefinitelyTyped /** * These are the modules and interfaces that can't be automatically generated from the Meteor data.js file From a451b00ed5ba1bf816ac30383f3442d33b49d90e Mon Sep 17 00:00:00 2001 From: Dave Allen Date: Thu, 22 Jan 2015 15:46:42 -0800 Subject: [PATCH 5/5] Fixed path to definitions in test. --- meteor/meteor-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meteor/meteor-tests.ts b/meteor/meteor-tests.ts index fa81ec23d..23dbff736 100644 --- a/meteor/meteor-tests.ts +++ b/meteor/meteor-tests.ts @@ -1,4 +1,4 @@ -/// +/// /** * All code below was copied from the examples at http://docs.meteor.com/.