Skip to content

Commit

Permalink
Merge pull request #12 from Techming/develop
Browse files Browse the repository at this point in the history
V0.1.5 Add minified build file and fix type declaration file
  • Loading branch information
haoming29 authored Nov 17, 2022
2 parents 766ba2f + a137f60 commit 51428cf
Show file tree
Hide file tree
Showing 7 changed files with 660 additions and 64 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

For change log from mjpegcanvas, please refer to: https://github.com/rctoris/mjpegcanvasjs/blob/develop/CHANGELOG.md

2022-11-17 - **0.1.5**

- Fix type declaration
- Update README with link to ROS Wiki
- Create minified build file

2022-11-16 - **0.1.4**

- Added type support
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const viewer = new Viewer({

### Static Import

Pre-built files can be found in [webvideocanvas.js](build/webvideocanvas.js)
Pre-built files can be found in [webvideocanvas.js](build/webvideocanvas.js) and [webvideocanvas.min.js](build/webvideocanvas.min.js)

## Build

Expand Down
113 changes: 55 additions & 58 deletions build/webvideocanvas.d.ts
Original file line number Diff line number Diff line change
@@ -1,66 +1,63 @@
import EventEmitter2 from 'eventemitter2';

declare module '@techming/web-video-canvas' {
interface ViewOptions {
divID: string;
width: number;
height: number;
host: string;
port?: number;
quality?: number;
topic: string;
overlay?: HTMLCanvasElement;
refreshRate?: number;
interval?: number;
type?: string;
}
export as namespace WebVideoCanvas;
export class Viewer extends EventEmitter2 {
constructor(options: WebVideoCanvas.ViewOptions);
width: number;
height: number;
host: string;
port?: number;
quality?: number;
topic: string;
overlay?: HTMLCanvasElement;
refreshRate?: number;
interval?: number;
type?: string;
canvas?: HTMLCanvasElement;
image: typeof Image;

interface MultiStreamViewerOptions {
divID: string;
width: number;
height: number;
host: string;
port?: number;
quality?: number;
topics: [string];
labels?: [string];
defaultStream?: number;
}

class View extends EventEmitter2 {
constructor(options: ViewOptions);
width: number;
height: number;
host: string;
port?: number;
quality?: number;
topic: string;
overlay?: HTMLCanvasElement;
refreshRate?: number;
interval?: number;
type?: string;
canvas?: HTMLCanvasElement;
image: typeof Image;
draw(): void;
changeStream(topic: string): void;
}

draw(): void;
changeStream(topic: string): void;
}
export class MultiStreamViewer extends EventEmitter2 {
constructor(options: WebVideoCanvas.MultiStreamViewerOptions);
divID: string;
width: number;
height: number;
host: string;
port?: number;
quality?: number;
topics: [string];
labels?: [string];
defaultStream?: number;

class MultiStreamViewer extends EventEmitter2 {
constructor(options: MultiStreamViewerOptions);
divID: string;
width: number;
height: number;
host: string;
port?: number;
quality?: number;
topics: [string];
labels?: [string];
defaultStream?: number;
clearButton(): void;
fadeImage(): void;
}

clearButton(): void;
fadeImage(): void;
}
export interface ViewOptions {
divID: string;
width: number;
height: number;
host: string;
port?: number;
quality?: number;
topic: string;
overlay?: HTMLCanvasElement;
refreshRate?: number;
interval?: number;
type?: string;
}

export { View, MultiStreamViewer };
export interface MultiStreamViewerOptions {
divID: string;
width: number;
height: number;
host: string;
port?: number;
quality?: number;
topics: [string];
labels?: [string];
defaultStream?: number;
}
8 changes: 8 additions & 0 deletions build/webvideocanvas.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 51428cf

Please sign in to comment.