mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #32814 from understandr/Meteor-PR
[Meteor] fix Mongo $addToSet and add Meteor.absoluteUrl.defaultOptions
This commit is contained in:
Vendored
+10
-5
@@ -63,11 +63,16 @@ declare module "meteor/meteor" {
|
||||
/** Method **/
|
||||
|
||||
/** Url **/
|
||||
function absoluteUrl(path?: string, options?: {
|
||||
secure?: boolean;
|
||||
replaceLocalhost?: boolean;
|
||||
rootUrl?: string;
|
||||
}): string;
|
||||
var absoluteUrl: {
|
||||
(path?: string, options?: absoluteUrlOptions): string;
|
||||
defaultOptions: absoluteUrlOptions;
|
||||
}
|
||||
|
||||
interface absoluteUrlOptions {
|
||||
secure?: boolean;
|
||||
replaceLocalhost?: boolean;
|
||||
rootUrl?: string;
|
||||
}
|
||||
/** Url **/
|
||||
|
||||
/** Timeout **/
|
||||
|
||||
Vendored
+1
-1
@@ -96,7 +96,7 @@ declare module "meteor/mongo" {
|
||||
{ $each?: T[P], $position?: number, $slice?: number, $sort?: 1 | -1 | Dictionary<number> }
|
||||
}
|
||||
type ArraysOrEach<T> = {
|
||||
[P in keyof T]?: OnlyArrays<T[P]> | { $each: T[P] }
|
||||
[P in keyof T]?: OnlyElementsOfArrays<T[P]> | { $each: T[P] }
|
||||
}
|
||||
type CurrentDateModifier = { $type: "timestamp" | "date" } | true
|
||||
type Modifier<T> = T | {
|
||||
|
||||
@@ -246,7 +246,13 @@ Items.insert({ list: groceriesId, name: "Persimmons" });
|
||||
/**
|
||||
* From Collections, collection.update section
|
||||
*/
|
||||
var Players = new Mongo.Collection('Players');
|
||||
|
||||
interface Players {
|
||||
score: number
|
||||
badges: string[]
|
||||
}
|
||||
|
||||
var Players: Mongo.Collection<Players> = new Mongo.Collection('Players');
|
||||
|
||||
Template['adminDashboard'].events({
|
||||
'click .givePoints': function () {
|
||||
@@ -265,6 +271,17 @@ Meteor.methods({
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Also from Collections, collection.update section
|
||||
*/
|
||||
Meteor.methods({
|
||||
declareWinners: function () {
|
||||
Players.update({ score: { $gt: 10 } },
|
||||
{ $addToSet: { badges: {$each: ["Winner", "Super"]} } },
|
||||
{ multi: true });
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* From Collections, collection.remove section
|
||||
*/
|
||||
@@ -795,3 +812,10 @@ const collectionWithoutConnection = new Mongo.Collection<MonkeyDAO>("monkey", {
|
||||
});
|
||||
|
||||
} // End of namespace
|
||||
|
||||
// absoluteUrl
|
||||
Meteor.absoluteUrl('/sub', {rootUrl: 'http://wonderful.com'});
|
||||
Meteor.absoluteUrl.defaultOptions = {
|
||||
rootUrl: 'http://123.com',
|
||||
secure: false
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user