mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
types/Sharedb - add an optional agent parameter to the client connection (#41955)
* add an optional agent to the client sharedb connection * remove myself as a contributor, set agent to be agent or null * add docs
This commit is contained in:
Vendored
+6
@@ -1,9 +1,15 @@
|
||||
/// <reference path="sharedb.d.ts" />
|
||||
import * as WS from 'ws';
|
||||
import * as ShareDB from './sharedb';
|
||||
import Agent = require('./agent');
|
||||
|
||||
export class Connection {
|
||||
constructor(ws: WebSocket | WS);
|
||||
|
||||
// This direct reference from connection to agent is not used internal to
|
||||
// ShareDB, but it is handy for server-side only user code that may cache
|
||||
// state on the agent and read it in middleware
|
||||
agent: Agent | null;
|
||||
get(collectionName: string, documentID: string): Doc;
|
||||
createFetchQuery(collectionName: string, query: any, options: {results?: Query[]}, callback: (err: Error, results: any[]) => void): Query;
|
||||
createSubscribeQuery(collectionName: string, query: any, options: {results?: Query[]}, callback: (err: Error, results: any[]) => void): Query;
|
||||
|
||||
Reference in New Issue
Block a user