Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mircea Cosbuc
committed
Jun 25, 2019
1 parent
29cbf1d
commit bb5aefd
Showing
5 changed files
with
136 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
new stream.Client('key', undefined, 'apiSecret'); | ||
|
||
stream.connect('abc', 'def', 'ghi'); // $ExpectType StreamClient | ||
|
||
const client = stream.connect('abc', 'def', 'ghi'); | ||
client.feed('feedSlug', 'user'); // $ExpectType Feed | ||
|
||
let callback = (err: object, httpResponse: object, body: object) => {}; | ||
|
||
let feed = client.feed('feedSlug', 'user'); | ||
feed.follow('feedSlug', 'user'); // $ExpectType Promise<object> | ||
feed.follow('feedSlug', 'user', { activity_copy_limit: 10 }); // $ExpectType Promise<object> | ||
|
||
feed.follow('feedSlug', 'user', { activity_copy_limit: 10 }, callback); // $ExpectType void | ||
feed.follow('feedSlug', 'user', callback); // $ExpectType void | ||
|
||
feed.unfollow('feedSlug', 'user'); // $ExpectType Promise<object> | ||
feed.unfollow('feedSlug', 'user', { keep_history: true }); // $ExpectType Promise<object> | ||
feed.unfollow('feedSlug', 'user', { keep_history: true }, callback); // $ExpectType void | ||
feed.unfollow('feedSlug', 'user', callback); // $ExpectType void | ||
|
||
let collections = client.collections; // $ExpectType Collections | ||
collections.buildURL('events', 'login-134'); // $ExpectType string | ||
collections.entry('events', 'login-134', { user: 'john', source: 'website' }); // $ExpectType CollectionEntry | ||
collections.get('events', 'login-134'); // $ExpectType Promise<object> | ||
collections.get('events', 'login-134', callback); // $ExpectType void | ||
collections.add('events', 'login-123', { user: 'john' }); // $ExpectType Promise<object> | ||
collections.add('events', 'login-1', { user: 'mo' }, callback); // $ExpectType void | ||
collections.update('events', 'login-2', { user: 'jo' }); // $ExpectType Promise<object> | ||
collections.update('events', 'login-2', { user: 'jo' }, callback); // $ExpectType void | ||
collections.delete('events', 'login-134'); // $ExpectType Promise<object> | ||
collections.delete('events', 'login-134', callback); // $ExpectType void | ||
collections.upsert('events', { id: 'login-1', user: 'jo' }); // $ExpectType Promise<object> | ||
collections.upsert('events', { id: 'login-1', source: 'cart' }, callback); // $ExpectType void | ||
collections.select('events', ['login-1', 'login-123']); // $ExpectType Promise<object> | ||
collections.select('events', ['login-1', 'login-123'], callback); // $ExpectType void | ||
collections.deleteMany('events', ['login-2', 'login-234']); // $ExpectType Promise<object> | ||
collections.deleteMany('events', ['login-2', 'login-234'], callback); // $ExpectType void | ||
|
||
new stream.errors.MissingSchemaError(); // $ExpectType MissingSchemaError | ||
new stream.errors.FeedError(); // $ExpectType FeedError | ||
new stream.errors.SiteError(); // $ExpectType SiteError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
{ | ||
"compileOnSave": false, | ||
"compilerOptions": { | ||
"forceConsistentCasingInFileNames": true, | ||
"lib": ["es6"], | ||
"module": "commonjs", | ||
"noEmit": true, | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"removeComments": true, | ||
"preserveConstEnums": true, | ||
"strictFunctionTypes": true, | ||
"strictNullChecks": true, | ||
"sourceMap": true, | ||
"baseUrl": "../", | ||
"types": [], | ||
"paths": {"getstream": ["getstream/"] } | ||
} | ||
"compileOnSave": false, | ||
"compilerOptions": { | ||
"forceConsistentCasingInFileNames": true, | ||
"lib": ["es6"], | ||
"module": "commonjs", | ||
"noEmit": true, | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"removeComments": true, | ||
"preserveConstEnums": true, | ||
"strictFunctionTypes": true, | ||
"strictNullChecks": true, | ||
"sourceMap": true, | ||
"baseUrl": "../", | ||
"types": [], | ||
"paths": { "getstream": ["getstream/"] } | ||
} | ||
} |