a90539ee0703f6380d3896924d83802d9de0fff5
[henge/kiak.git] / bootstrap.js
1 /**
2 * @file Shared API
3 * @author Jordan Lavatai and Ken Grimes
4 * @version 0.0.1
5 * @license APGL-3.0
6 * @copyright Strapp.io
7 */
8
9 const dlog = (msg) => console.log(msg)
10
11 /***********************/
12 /** Helper functions **/
13 /***********************/
14
15 /* SDP Interop helper functions to be used by beginRTCOffer and beginRTCAnswer */
16
17 /** @func Determines the multimedia signaling protocol for the given session description
18 * @desc Does some basic duck typing to determine the type of Session Description
19 * @arg {Object} Session Description Object
20 * @return {String} Returns 'planB' if Session Description is planB, 'Unified' if
21 * Session Description is Unified
22 */
23 function determineSessionDescription(sessionDescription) {
24 }
25
26 /** @func Converts a planB session description to Unified session description
27 * @arg {Object} Session Description Object
28 * @return {Object} PlanB Session Description
29 */
30 function toUnified(sessionDescription) {
31 }
32
33 /** @func Converts a Unified session description to planB session description
34 * @arg {Object} Session Description Object
35 * @return {Object} PlanB Session Description
36 */
37 function toPlanB(sessionDescription) {
38 }
39
40 /* WebSocket wielder helper functions */
41
42 /* Function for setting up webSocket wielders message handler */
43 /* TBD */
44 /* TBD */
45
46 /* SDP Negotiation helper functions */
47
48 /* addRemoteIceCandidate() */
49 /* addIceCandidateCreationHandler(callback for sending?) */
50 /* handleIceRequest() - WebSpocketless entity specific */
51
52
53 /***********************/
54 /** Exposed functions **/
55 /***********************/
56
57 /** @func Attempts to create a websocket
58 * @desc If user agent supports web sockets, attempt to create a websocket
59 * with given domain
60 * @arg {String} domain - ip address or domain name of other end of websocket
61 * @return {Boolean} returns true if successful, false if unsucessful
62 */
63 export function createWebSocket(domain) {
64
65 }
66
67 /** @func Returns public key for the user
68 * @desc Attempts to find a stored key. If unsucessful, ask user for key. If user
69 * doesn't have a key, generates a key
70 * @dependencies keyManager, fileSystem
71 * @options specif
72 * @return {Object} cryptoKey object
73 */
74 export function resolveKey() {
75
76 }
77
78 /** @func Begins the SDP handshake process as the offerer
79 * @desc
80 *
81 *
82 */
83 export function beginRTCOffer() {
84 }
85
86 /** @func Begins the SDP handshake process as the answerer
87 * @desc
88 *
89 *
90 */
91 export function beginRTCAnswer() {
92 }
93
94
95 /** @func Generic way to message host from client
96 * @desc tbd
97 * @arg {Object} data object to be sent
98 */
99 export function sendHostData(data) {
100 }
101
102 /** @func Generic way to message client from host
103 * @desc tbd
104 * @arg {Object} data object to be sent
105 */
106 export function sendClientData(data){
107 }