Skip to content

Commit

Permalink
feat: optimized typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
zhensherlock committed May 7, 2023
1 parent 79b9dd7 commit e548acf
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 62 deletions.
2 changes: 1 addition & 1 deletion src/core/htmlMapMarker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Interface with WebRTC-streamer API
*/
import { HtmlMapMarkerOptions } from '../types'
import type { HtmlMapMarkerOptions } from '../types'

class HtmlMapMarker extends google.maps.OverlayView {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/core/janusVideoRoom.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JanusVideoRoomOptions, JanusVideoRoomAdvancedUrl } from '../types'
import type { JanusVideoRoomOptions, JanusVideoRoomAdvancedUrl } from '../types'
import { initialJanusVideoRoomOptions } from '../utils/initialization'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/core/webRTCStreamer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MediaConstraints, WebRTCStreamerOptions } from '../types'
import type { MediaConstraints, WebRTCStreamerOptions } from '../types'
import { initialWebRTCStreamerOptions } from '../utils/initialization'

/**
Expand Down
22 changes: 22 additions & 0 deletions src/types/htmlMapMarker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export interface HtmlMapMarkerOptions {
/**
* marker position
*/
latLng: google.maps.LatLng,
/**
* marker content
*/
html: string,
/**
* map instance
*/
map: google.maps.Map,
/**
* marker width
*/
width: number,
/**
* marker height
*/
height: number
}
62 changes: 3 additions & 59 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,59 +1,3 @@
export interface WebRTCStreamerOptions {
/**
* id of the video element tag
*/
element: HTMLVideoElement | string;
/**
* url of webrtc-streamer (default is current location)
*/
url: string;
}

export type MediaConstraints = {
offerToReceiveAudio: boolean;
offerToReceiveVideo: boolean;
}

export interface HtmlMapMarkerOptions {
/**
* marker position
*/
latLng: google.maps.LatLng,
/**
* marker content
*/
html: string,
/**
* map instance
*/
map: google.maps.Map,
/**
* marker width
*/
width: number,
/**
* marker height
*/
height: number
}

export interface JanusVideoRoomOptions {
/**
* url of Janus Gateway
*/
janusUrl: string;
/**
* url of webrtc-streamer (default is current location)
*/
url: string;
/**
* event bus
*/
eventBus?: any;
}

export interface JanusVideoRoomAdvancedUrl {
video?: string,
audio?: string,
options?: string
}
export * from './webRTCStreamer'
export * from './htmlMapMarker'
export * from './janusVideoRoom'
20 changes: 20 additions & 0 deletions src/types/janusVideoRoom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export interface JanusVideoRoomOptions {
/**
* url of Janus Gateway
*/
janusUrl: string;
/**
* url of webrtc-streamer (default is current location)
*/
url: string;
/**
* event bus
*/
eventBus?: any;
}

export interface JanusVideoRoomAdvancedUrl {
video?: string,
audio?: string,
options?: string
}
15 changes: 15 additions & 0 deletions src/types/webRTCStreamer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export interface WebRTCStreamerOptions {
/**
* id of the video element tag
*/
element: HTMLVideoElement | string;
/**
* url of webrtc-streamer (default is current location)
*/
url: string;
}

export type MediaConstraints = {
offerToReceiveAudio: boolean;
offerToReceiveVideo: boolean;
}

0 comments on commit e548acf

Please sign in to comment.